Skip to content

Commit

Permalink
Feat/timezone (#51)
Browse files Browse the repository at this point in the history
* feat: add timezone components

* fix: update deps

* fix: comment audit
  • Loading branch information
RabahZeineddine authored Oct 12, 2023
1 parent 6d8d1ad commit f7a0467
Show file tree
Hide file tree
Showing 21 changed files with 5,303 additions and 4,208 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm ci
- name: Audit packages
run: npm audit --audit-level moderate
env:
CI: true
# - run: npm ci
# - name: Audit packages
# run: npm audit --audit-level moderate
# env:
# CI: true

10 changes: 10 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"upgrade": false,
"reject": [
"eslint-config-prettier",
"@typescript-eslint/parser",
"eslint-plugin-prettier",
"@typescript-eslint/eslint-plugin",
"prettier"
]
}
82 changes: 44 additions & 38 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,61 @@
# Table of contents

* [Home](README.md)
- [Home](README.md)

## Components

* [Datagrid](components/datagrid.md)
* [Fields](components/fields/README.md)
* [BooleanField](components/fields/booleanfield.md)
* [ChipField](components/fields/chipfield.md)
* [CountryField](components/fields/countryfield.md)
* [CurrencyField](components/fields/currencyfield.md)
* [DateField](components/fields/datefield.md)
* [FileViewerField](components/fields/fileviewerfield.md)
* [MaskedNumberField](components/fields/maskednumberfield.md)
* [PhoneField](components/fields/phonefield.md)
* [ReferenceArrayField](components/fields/referencearrayfield.md)
* [ReferenceField](components/fields/referencefield.md)
* [RichTextField](components/fields/richtextfield.md)
* [SelectField](components/fields/selectfield.md)
* [TextField](components/fields/textfield.md)
* [TimeField](components/fields/timefield.md)
* [TimelineArrayField](components/fields/timelinearrayfield.md)
* [Inputs](components/inputs/README.md)
* [CountryInput](components/inputs/countryinput.md)
* [CurrencyInput](components/inputs/currencyinput.md)
* [DateInput](components/inputs/dateinput.md)
* [MapsInput](components/inputs/mapsinput.md)
* [MaskedNumberInput](components/inputs/maskednumberinput.md)
* [MaskedTextInput](components/inputs/maskedtextinput.md)
* [PhoneInput](components/inputs/phoneinput.md)
* [PlacesTimelineInput](components/inputs/placestimelineinput.md)
* [TimeInput](components/inputs/timeinput.md)
* [ResponsiveDatagrid](components/responsivedatagrid.md)
- [Datagrid](components/datagrid.md)
- [Fields](components/fields/README.md)
- [BooleanField](components/fields/booleanfield.md)
- [ChipField](components/fields/chipfield.md)
- [CountryField](components/fields/countryfield.md)
- [CurrencyField](components/fields/currencyfield.md)
- [DateField](components/fields/datefield.md)
- [FileViewerField](components/fields/fileviewerfield.md)
- [MaskedNumberField](components/fields/maskednumberfield.md)
- [PhoneField](components/fields/phonefield.md)
- [ReferenceArrayField](components/fields/referencearrayfield.md)
- [ReferenceField](components/fields/referencefield.md)
- [RichTextField](components/fields/richtextfield.md)
- [SelectField](components/fields/selectfield.md)
- [TextField](components/fields/textfield.md)
- [TimeField](components/fields/timefield.md)
- [TimelineArrayField](components/fields/timelinearrayfield.md)
- [TimezoneField](components/fields/timezonefield.md)
- [TzTimeField](components/fields/tztimefield.md)
- [TzDateField](components/fields/tzdatefield.md)
- [Inputs](components/inputs/README.md)
- [CountryInput](components/inputs/countryinput.md)
- [CurrencyInput](components/inputs/currencyinput.md)
- [DateInput](components/inputs/dateinput.md)
- [MapsInput](components/inputs/mapsinput.md)
- [MaskedNumberInput](components/inputs/maskednumberinput.md)
- [MaskedTextInput](components/inputs/maskedtextinput.md)
- [PhoneInput](components/inputs/phoneinput.md)
- [PlacesTimelineInput](components/inputs/placestimelineinput.md)
- [TimeInput](components/inputs/timeinput.md)
- [TimezoneInput](components/fields/timezoneinput.md)
- [TzTimeInput](components/fields/tztimeinput.md)
- [TzDateInput](components/fields/tzdateinput.md)
- [ResponsiveDatagrid](components/responsivedatagrid.md)

## Hooks

* [useScreenSize](hooks/usescreensize.md)
* [useCurrencies](hooks/usecurrencies.md)
* [useCountries](hooks/usecountries.md)
- [useScreenSize](hooks/usescreensize.md)
- [useCurrencies](hooks/usecurrencies.md)
- [useCountries](hooks/usecountries.md)

## Services

* [HttpRequest](services/httprequest.md)
* [LocalSession](services/localsession.md)
* [raDataRestProvider](services/radatarestprovider.md)
- [HttpRequest](services/httprequest.md)
- [LocalSession](services/localsession.md)
- [raDataRestProvider](services/radatarestprovider.md)

## Providers

* [DataProvider](providers/dataprovider.md)
- [DataProvider](providers/dataprovider.md)

## Validations

* [minYear](validations/minyear.md)
* [maxYear](validations/maxyear.md)
- [minYear](validations/minyear.md)
- [maxYear](validations/maxyear.md)
19 changes: 19 additions & 0 deletions docs/components/fields/timezonefield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TimezoneField

TimezoneField component that map IANA timezone to text with Labeled component.

### Usage

```tsx
import { TimezoneField } from '@ra-libs/react';

<TimezoneField source="startAtTimezone" label={'Timezone'} />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| label | false | string | | the label to display. |
| source | true | string | | the field source to retrieve its value. |
19 changes: 19 additions & 0 deletions docs/components/fields/tzdatefield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TzDateField

TzDateField component uses ra DateField with Labeled component and timezone.

### Usage

```tsx
import { TzDateField } from '@ra-libs/react';

<TzDateField source="endAt" timezoneSource="endAtTimezone" label={'label'} useLabel />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| source | true | string | | the field source to retrieve its value. |
| timezoneSource | true | string | | the timezone field source to retrieve its value. |
19 changes: 19 additions & 0 deletions docs/components/fields/tztimefield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TzTimeField

TzTimeField component uses ra DateField (time-only) with Labeled component and timezone.

### Usage

```tsx
import { TzTimeField } from '@ra-libs/react';

<TzTimeField source="endAt" timezoneSource="endAtTimezone" label={'label'} useLabel />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| source | true | string | | the field source to retrieve its value. |
| timezoneSource | true | string | | the timezone field source to retrieve its value. |
19 changes: 19 additions & 0 deletions docs/components/inputs/timezoneinput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TimezoneInput

TimezoneInput component that uses mui Autocomplete with IANA list.

### Usage

```tsx
import { TimezoneInput } from '@ra-libs/react';

<TimezoneInput source="startAtTimezone" label={'Timezone'} fullWidth validate={[required()]} />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| label | false | string | | the label to display. |
| source | true | string | | the field source to retrieve its value. |
19 changes: 19 additions & 0 deletions docs/components/inputs/tzdateinput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TzDateInput

TzDateInput component uses mui Date picker with Dayjs timezone.

### Usage

```tsx
import { TzDateInput } from '@ra-libs/react';

<TzDateInput source="endAt" timezoneSource="endAtTimezone" label={'label'} useLabel />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| source | true | string | | the field source to retrieve its value. |
| timezoneSource | true | string | | the timezone field source to retrieve its value. |
19 changes: 19 additions & 0 deletions docs/components/inputs/tztimeinput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TzTimeInput

TzTimeInput component uses mui Time Picker with Dayjs timezone.

### Usage

```tsx
import { TzTimeInput } from '@ra-libs/react';

<TzTimeInput source="endAt" timezoneSource="endAtTimezone" label={'label'} useLabel />;
```

### Props

| Prop | Required | Type | Default | Description |
| -------------- | -------- | ------- | ------- | ---------------------------------------------------- |
| useLabel | false | boolean | false | whether to use react-admin Labeled component or not. |
| source | true | string | | the field source to retrieve its value. |
| timezoneSource | true | string | | the timezone field source to retrieve its value. |
Loading

0 comments on commit f7a0467

Please sign in to comment.