@mtes-mct/monitor-ui 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/dayjs.min.js +16 -0
- package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/dayjs.min.js.map +1 -0
- package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js +2 -2
- package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js.map +1 -1
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry1.js +23 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry1.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry2.js +35 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry2.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry3.js +53 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_curry3.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_has.js +6 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_has.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_isObject.js +6 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_isObject.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_isPlaceholder.js +6 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/internal/_isPlaceholder.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeDeepRight.js +35 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeDeepRight.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeDeepWithKey.js +47 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeDeepWithKey.js.map +1 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeWithKey.js +52 -0
- package/.yarn/cache/ramda-npm-0.28.0-6a5fe8f6cc-44ea6e5010.zip/node_modules/ramda/es/mergeWithKey.js.map +1 -0
- package/CHANGELOG.md +15 -0
- package/README.md +2 -0
- package/_virtual/dayjs.min.js +4 -0
- package/_virtual/dayjs.min.js.map +1 -0
- package/_virtual/dayjs.min2.js +6 -0
- package/_virtual/dayjs.min2.js.map +1 -0
- package/fields/Checkbox.d.ts +8 -0
- package/fields/DatePicker/index.d.ts +1 -1
- package/fields/DateRangePicker/NumberInput.d.ts +1 -1
- package/fields/DateRangePicker/index.d.ts +1 -1
- package/fields/MultiSelect.d.ts +10 -0
- package/fields/Select.d.ts +5 -6
- package/fields/TextInput.d.ts +9 -0
- package/fields/Textarea.d.ts +9 -0
- package/formiks/FormikCheckbox.d.ts +3 -0
- package/formiks/FormikMultiSelect.d.ts +3 -0
- package/formiks/FormikSelect.d.ts +1 -3
- package/formiks/FormikTextInput.d.ts +3 -0
- package/formiks/FormikTextarea.d.ts +3 -0
- package/index.d.ts +16 -0
- package/package.json +3 -8
- package/src/ThemeProvider.js +1 -1
- package/src/fields/Checkbox.js +17 -0
- package/src/fields/Checkbox.js.map +1 -0
- package/src/fields/DatePicker/index.js +1 -1
- package/src/fields/DatePicker/index.js.map +1 -1
- package/src/fields/DateRangePicker/RangeCalendarPicker.js +2 -2
- package/src/fields/DateRangePicker/RangeCalendarPicker.js.map +1 -1
- package/src/fields/DateRangePicker/index.js +1 -1
- package/src/fields/DateRangePicker/index.js.map +1 -1
- package/src/fields/DateRangePicker/utils.js +2 -2
- package/src/fields/DateRangePicker/utils.js.map +1 -1
- package/src/fields/MultiSelect.js +28 -0
- package/src/fields/MultiSelect.js.map +1 -0
- package/src/fields/Select.js +9 -22
- package/src/fields/Select.js.map +1 -1
- package/src/fields/TextInput.js +22 -0
- package/src/fields/TextInput.js.map +1 -0
- package/src/fields/Textarea.js +22 -0
- package/src/fields/Textarea.js.map +1 -0
- package/src/formiks/FormikCheckbox.js +22 -0
- package/src/formiks/FormikCheckbox.js.map +1 -0
- package/src/formiks/FormikDatePicker.js +1 -1
- package/src/formiks/FormikDatePicker.js.map +1 -1
- package/src/formiks/FormikMultiSelect.js +21 -0
- package/src/formiks/FormikMultiSelect.js.map +1 -0
- package/src/formiks/FormikSelect.js +2 -2
- package/src/formiks/FormikSelect.js.map +1 -1
- package/src/formiks/FormikTextInput.js +21 -0
- package/src/formiks/FormikTextInput.js.map +1 -0
- package/src/formiks/FormikTextarea.js +21 -0
- package/src/formiks/FormikTextarea.js.map +1 -0
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/utils/dayjs.js +6 -6
- package/src/utils/dayjs.js.map +1 -1
- package/src/utils/getLocalizedDayjs.js +2 -2
- package/src/utils/getLocalizedDayjs.js.map +1 -1
- package/src/utils/getUtcDayjs.js +2 -2
- package/src/utils/getUtcDayjs.js.map +1 -1
- package/src/utils/getUtcizedDayjs.js +2 -2
- package/src/utils/getUtcizedDayjs.js.map +1 -1
- package/src/utils/sortDates.js +2 -2
- package/src/utils/sortDates.js.map +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useMemo, useCallback, useEffect } from 'react';
|
|
4
|
+
import { Checkbox } from '../fields/Checkbox.js';
|
|
5
|
+
|
|
6
|
+
function FormikCheckbox({ name, ...originalProps }) {
|
|
7
|
+
const [field, , helpers] = useField(name);
|
|
8
|
+
const value = useMemo(() => field.value, [field.value]);
|
|
9
|
+
// We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
|
|
10
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
11
|
+
const setValue = useMemo(() => helpers.setValue, [helpers.setValue]);
|
|
12
|
+
const handleChange = useCallback((isChecked) => {
|
|
13
|
+
setValue(isChecked);
|
|
14
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
|
+
}, []);
|
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
|
+
useEffect(() => () => setValue(undefined), []);
|
|
18
|
+
return jsx(Checkbox, { defaultChecked: value, name: name, onChange: handleChange, ...originalProps });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { FormikCheckbox };
|
|
22
|
+
//# sourceMappingURL=FormikCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikCheckbox.js","sources":["../../../src/formiks/FormikCheckbox.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect, useMemo } from 'react'\n\nimport { Checkbox } from '../fields/Checkbox'\n\nimport type { CheckboxProps } from '../fields/Checkbox'\n\nexport type FormikCheckboxProps = Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'onChange'>\nexport function FormikCheckbox({ name, ...originalProps }: FormikCheckboxProps) {\n const [field, , helpers] = useField(name)\n\n const value = useMemo(() => field.value, [field.value])\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const setValue = useMemo(() => helpers.setValue, [helpers.setValue])\n\n const handleChange = useCallback((isChecked: boolean) => {\n setValue(isChecked)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <Checkbox defaultChecked={value} name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAQM,SAAU,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAuB,EAAA;AAC5E,IAAA,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AAEzC,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;;;AAGvD,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEpE,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,SAAkB,KAAI;QACtD,QAAQ,CAAC,SAAS,CAAC,CAAA;;KAGpB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,IAAC,QAAQ,EAAA,EAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AACnG;;;;"}
|
|
@@ -6,7 +6,7 @@ import { DatePicker } from '../fields/DatePicker/index.js';
|
|
|
6
6
|
function FormikDatePicker({ name, ...originalProps }) {
|
|
7
7
|
const [, , helpers] = useField(name);
|
|
8
8
|
const { setValue } = helpers;
|
|
9
|
-
// We don't include `setValues` in
|
|
9
|
+
// We don't include `setValues` in `useEffect()` dependencies
|
|
10
10
|
// both because it is useless and it will trigger infinite hook calls
|
|
11
11
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
12
|
useEffect(() => () => setValue(undefined), []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikDatePicker.js","sources":["../../../src/formiks/FormikDatePicker.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useEffect } from 'react'\n\nimport { DatePicker } from '../fields/DatePicker'\n\nimport type { DatePickerProps } from '../fields/DatePicker'\n\nexport type FormikDatePickerProps = Omit<DatePickerProps, 'onChange'> & {\n name: string\n}\nexport function FormikDatePicker({ name, ...originalProps }: FormikDatePickerProps) {\n const [, , helpers] = useField(name)\n const { setValue } = helpers\n\n // We don't include `setValues` in
|
|
1
|
+
{"version":3,"file":"FormikDatePicker.js","sources":["../../../src/formiks/FormikDatePicker.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useEffect } from 'react'\n\nimport { DatePicker } from '../fields/DatePicker'\n\nimport type { DatePickerProps } from '../fields/DatePicker'\n\nexport type FormikDatePickerProps = Omit<DatePickerProps, 'onChange'> & {\n name: string\n}\nexport function FormikDatePicker({ name, ...originalProps }: FormikDatePickerProps) {\n const [, , helpers] = useField(name)\n const { setValue } = helpers\n\n // We don't include `setValues` in `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <DatePicker onChange={setValue} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAUM,SAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAyB,EAAA;IAChF,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AACpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;;;;AAK5B,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;IAE9C,OAAOA,GAAA,CAAC,UAAU,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAA,GAAM,aAAa,EAAA,CAAI,CAAA;AAC9D;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
|
+
import { MultiSelect } from '../fields/MultiSelect.js';
|
|
5
|
+
|
|
6
|
+
function FormikMultiSelect({ name, ...originalProps }) {
|
|
7
|
+
const [, , helpers] = useField(name);
|
|
8
|
+
// We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
|
|
9
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
10
|
+
const { setValue } = helpers;
|
|
11
|
+
const handleChange = useCallback((nextValue) => {
|
|
12
|
+
setValue(nextValue);
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, []);
|
|
15
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
|
+
useEffect(() => () => setValue(undefined), []);
|
|
17
|
+
return jsx(MultiSelect, { name: name, onChange: handleChange, ...originalProps });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { FormikMultiSelect };
|
|
21
|
+
//# sourceMappingURL=FormikMultiSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikMultiSelect.js","sources":["../../../src/formiks/FormikMultiSelect.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { MultiSelect } from '../fields/MultiSelect'\n\nimport type { MultiSelectProps } from '../fields/MultiSelect'\n\nexport type FormikMultiSelectProps = Omit<MultiSelectProps, 'defaultValue' | 'onChange'>\nexport function FormikMultiSelect({ name, ...originalProps }: FormikMultiSelectProps) {\n const [, , helpers] = useField(name)\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const { setValue } = helpers\n\n const handleChange = useCallback((nextValue: string[] | undefined) => {\n setValue(nextValue)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <MultiSelect name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAQM,SAAU,iBAAiB,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAA0B,EAAA;IAClF,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;;;AAGpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,SAA+B,KAAI;QACnE,QAAQ,CAAC,SAAS,CAAC,CAAA;;KAGpB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,GAAC,CAAA,WAAW,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AAC/E;;;;"}
|
|
@@ -8,8 +8,8 @@ function FormikSelect({ name, ...originalProps }) {
|
|
|
8
8
|
// We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
|
|
9
9
|
// both because it is useless and it will trigger infinite hook calls
|
|
10
10
|
const { setValue } = helpers;
|
|
11
|
-
const handleChange = useCallback((
|
|
12
|
-
setValue(
|
|
11
|
+
const handleChange = useCallback((nextValue) => {
|
|
12
|
+
setValue(nextValue);
|
|
13
13
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
14
|
}, []);
|
|
15
15
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikSelect.js","sources":["../../../src/formiks/FormikSelect.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { Select } from '../fields/Select'\n\nimport type { SelectProps } from '../fields/Select'\n\nexport type FormikSelectProps = Omit<SelectProps, '
|
|
1
|
+
{"version":3,"file":"FormikSelect.js","sources":["../../../src/formiks/FormikSelect.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { Select } from '../fields/Select'\n\nimport type { SelectProps } from '../fields/Select'\n\nexport type FormikSelectProps = Omit<SelectProps, 'defaultValue' | 'onChange'>\nexport function FormikSelect({ name, ...originalProps }: FormikSelectProps) {\n const [, , helpers] = useField(name)\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const { setValue } = helpers\n\n const handleChange = useCallback((nextValue: string | undefined) => {\n setValue(nextValue)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <Select name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAQM,SAAU,YAAY,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAqB,EAAA;IACxE,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;;;AAGpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,SAA6B,KAAI;QACjE,QAAQ,CAAC,SAAS,CAAC,CAAA;;KAGpB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,GAAC,CAAA,MAAM,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AAC1E;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
|
+
import { TextInput } from '../fields/TextInput.js';
|
|
5
|
+
|
|
6
|
+
function FormikTextInput({ name, ...originalProps }) {
|
|
7
|
+
const [, , helpers] = useField(name);
|
|
8
|
+
// We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
|
|
9
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
10
|
+
const { setValue } = helpers;
|
|
11
|
+
const handleChange = useCallback((nextValue) => {
|
|
12
|
+
setValue(nextValue);
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, []);
|
|
15
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
|
+
useEffect(() => () => setValue(undefined), []);
|
|
17
|
+
return jsx(TextInput, { name: name, onChange: handleChange, ...originalProps });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { FormikTextInput };
|
|
21
|
+
//# sourceMappingURL=FormikTextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikTextInput.js","sources":["../../../src/formiks/FormikTextInput.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { TextInput } from '../fields/TextInput'\n\nimport type { TextInputProps } from '../fields/TextInput'\n\nexport type FormikTextInputProps = Omit<TextInputProps, 'defaultValue' | 'onChange'>\nexport function FormikTextInput({ name, ...originalProps }: FormikTextInputProps) {\n const [, , helpers] = useField(name)\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const { setValue } = helpers\n\n const handleChange = useCallback((nextValue: string | undefined) => {\n setValue(nextValue)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <TextInput name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAQM,SAAU,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAwB,EAAA;IAC9E,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;;;AAGpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,SAA6B,KAAI;QACjE,QAAQ,CAAC,SAAS,CAAC,CAAA;;KAGpB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,GAAC,CAAA,SAAS,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AAC7E;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
|
+
import { Textarea } from '../fields/Textarea.js';
|
|
5
|
+
|
|
6
|
+
function FormikTextarea({ name, ...originalProps }) {
|
|
7
|
+
const [, , helpers] = useField(name);
|
|
8
|
+
// We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
|
|
9
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
10
|
+
const { setValue } = helpers;
|
|
11
|
+
const handleChange = useCallback((nextValue) => {
|
|
12
|
+
setValue(nextValue);
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, []);
|
|
15
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
|
+
useEffect(() => () => setValue(undefined), []);
|
|
17
|
+
return jsx(Textarea, { name: name, onChange: handleChange, ...originalProps });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { FormikTextarea };
|
|
21
|
+
//# sourceMappingURL=FormikTextarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikTextarea.js","sources":["../../../src/formiks/FormikTextarea.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { Textarea } from '../fields/Textarea'\n\nimport type { TextareaProps } from '../fields/Textarea'\n\nexport type FormikTextareaProps = Omit<TextareaProps, 'defaultValue' | 'onChange'>\nexport function FormikTextarea({ name, ...originalProps }: FormikTextareaProps) {\n const [, , helpers] = useField(name)\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const { setValue } = helpers\n\n const handleChange = useCallback((nextValue: string | undefined) => {\n setValue(nextValue)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <Textarea name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAQM,SAAU,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAuB,EAAA;IAC5E,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;;;AAGpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,SAA6B,KAAI;QACjE,QAAQ,CAAC,SAAS,CAAC,CAAA;;KAGpB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,GAAC,CAAA,QAAQ,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AAC5E;;;;"}
|
package/src/index.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import * as constants from './constants.js';
|
|
2
2
|
export { constants as MUI };
|
|
3
3
|
export { THEME } from './theme.js';
|
|
4
|
+
export { Checkbox } from './fields/Checkbox.js';
|
|
4
5
|
export { DateRangePicker } from './fields/DateRangePicker/index.js';
|
|
5
6
|
export { DatePicker } from './fields/DatePicker/index.js';
|
|
7
|
+
export { MultiSelect } from './fields/MultiSelect.js';
|
|
6
8
|
export { Select } from './fields/Select.js';
|
|
9
|
+
export { Textarea } from './fields/Textarea.js';
|
|
10
|
+
export { TextInput } from './fields/TextInput.js';
|
|
11
|
+
export { FormikCheckbox } from './formiks/FormikCheckbox.js';
|
|
7
12
|
export { FormikDatePicker } from './formiks/FormikDatePicker.js';
|
|
8
13
|
export { FormikDateRangePicker } from './formiks/FormikDateRangePicker.js';
|
|
9
14
|
export { FormikEffect } from './formiks/FormikEffect.js';
|
|
15
|
+
export { FormikMultiSelect } from './formiks/FormikMultiSelect.js';
|
|
10
16
|
export { FormikSelect } from './formiks/FormikSelect.js';
|
|
17
|
+
export { FormikTextarea } from './formiks/FormikTextarea.js';
|
|
18
|
+
export { FormikTextInput } from './formiks/FormikTextInput.js';
|
|
11
19
|
export { ThemeProvider } from './ThemeProvider.js';
|
|
12
20
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
package/src/utils/dayjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default as dayjs } from 'dayjs';
|
|
1
|
+
import dayjs_minExports from '../../_virtual/dayjs.min2.js';
|
|
2
|
+
export { default as dayjs } from '../../_virtual/dayjs.min2.js';
|
|
3
3
|
import timezone from '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/timezone.js';
|
|
4
4
|
import utc from '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/utc.js';
|
|
5
5
|
import '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
dayjs_minExports.extend(timezone);
|
|
8
|
+
dayjs_minExports.extend(utc);
|
|
9
|
+
dayjs_minExports.locale('fr');
|
|
10
|
+
dayjs_minExports.tz.setDefault('UTC');
|
|
11
11
|
//# sourceMappingURL=dayjs.js.map
|
package/src/utils/dayjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs.js","sources":["../../../src/utils/dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport timezone from 'dayjs/plugin/timezone'\nimport utc from 'dayjs/plugin/utc'\n\nimport 'dayjs/locale/fr'\n\ndayjs.extend(timezone)\ndayjs.extend(utc)\ndayjs.locale('fr')\n\ndayjs.tz.setDefault('UTC')\n\nexport { dayjs }\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"dayjs.js","sources":["../../../src/utils/dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport timezone from 'dayjs/plugin/timezone'\nimport utc from 'dayjs/plugin/utc'\n\nimport 'dayjs/locale/fr'\n\ndayjs.extend(timezone)\ndayjs.extend(utc)\ndayjs.locale('fr')\n\ndayjs.tz.setDefault('UTC')\n\nexport { dayjs }\n"],"names":["dayjs"],"mappings":";;;;;;AAMAA,gBAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACtBA,gBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACjBA,gBAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAElBA,gBAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './dayjs.js';
|
|
2
|
-
import
|
|
2
|
+
import dayjs_minExports from '../../_virtual/dayjs.min2.js';
|
|
3
3
|
|
|
4
4
|
// TODO Use `date-fns` instead of `dayjs`.
|
|
5
5
|
/**
|
|
@@ -12,7 +12,7 @@ function getLocalizedDayjs(utcDate) {
|
|
|
12
12
|
// The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,
|
|
13
13
|
// and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.
|
|
14
14
|
const timezoneOffsetInMinutes = utcDate.getTimezoneOffset();
|
|
15
|
-
return
|
|
15
|
+
return dayjs_minExports(utcDate).add(timezoneOffsetInMinutes, 'minutes');
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { getLocalizedDayjs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizedDayjs.js","sources":["../../../src/utils/getLocalizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a UTC date treated as if it was a locally timezoned one\n *\n * @example\n * `2022-01-02T03:04:05.006Z` => `2022-01-02T03:04:05.006+01:00` (or `+02:00` during DST) in Europe/Paris timezone.\n */\nexport function getLocalizedDayjs(utcDate: Date): Dayjs {\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = utcDate.getTimezoneOffset()\n\n return dayjs(utcDate).add(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":[],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,iBAAiB,CAAC,OAAa,EAAA;;;AAG7C,IAAA,MAAM,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAA;IAE3D,
|
|
1
|
+
{"version":3,"file":"getLocalizedDayjs.js","sources":["../../../src/utils/getLocalizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a UTC date treated as if it was a locally timezoned one\n *\n * @example\n * `2022-01-02T03:04:05.006Z` => `2022-01-02T03:04:05.006+01:00` (or `+02:00` during DST) in Europe/Paris timezone.\n */\nexport function getLocalizedDayjs(utcDate: Date): Dayjs {\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = utcDate.getTimezoneOffset()\n\n return dayjs(utcDate).add(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":["dayjs"],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,iBAAiB,CAAC,OAAa,EAAA;;;AAG7C,IAAA,MAAM,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAA;IAE3D,OAAOA,gBAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAA;AAC/D;;;;"}
|
package/src/utils/getUtcDayjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUtcDayjs.js","sources":["../../../src/utils/getUtcDayjs.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\nexport function getUtcDayjs(): Dayjs {\n return dayjs().utc()\n}\n"],"names":[],"mappings":";;;SAIgB,WAAW,GAAA;AACzB,IAAA,
|
|
1
|
+
{"version":3,"file":"getUtcDayjs.js","sources":["../../../src/utils/getUtcDayjs.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\nexport function getUtcDayjs(): Dayjs {\n return dayjs().utc()\n}\n"],"names":["dayjs"],"mappings":";;;SAIgB,WAAW,GAAA;AACzB,IAAA,OAAOA,gBAAK,EAAE,CAAC,GAAG,EAAE,CAAA;AACtB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './dayjs.js';
|
|
2
|
-
import
|
|
2
|
+
import dayjs_minExports from '../../_virtual/dayjs.min2.js';
|
|
3
3
|
|
|
4
4
|
// TODO Use `date-fns` instead of `dayjs`.
|
|
5
5
|
/**
|
|
@@ -13,7 +13,7 @@ function getUtcizedDayjs(localDate) {
|
|
|
13
13
|
// The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,
|
|
14
14
|
// and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.
|
|
15
15
|
const timezoneOffsetInMinutes = definedLocalDate.getTimezoneOffset();
|
|
16
|
-
return
|
|
16
|
+
return dayjs_minExports(definedLocalDate).subtract(timezoneOffsetInMinutes, 'minutes');
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { getUtcizedDayjs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUtcizedDayjs.js","sources":["../../../src/utils/getUtcizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a locally timezoned date treated as if it was a UTC one\n *\n * @example\n * `2022-01-02T03:04:05.006+01:00` => `2022-01-02T03:04:05.006Z`.\n */\nexport function getUtcizedDayjs(localDate?: Date): Dayjs {\n const definedLocalDate = localDate || new Date()\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = definedLocalDate.getTimezoneOffset()\n\n return dayjs(definedLocalDate).subtract(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":[],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,eAAe,CAAC,SAAgB,EAAA;AAC9C,IAAA,MAAM,gBAAgB,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;;;AAGhD,IAAA,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAA;IAEpE,
|
|
1
|
+
{"version":3,"file":"getUtcizedDayjs.js","sources":["../../../src/utils/getUtcizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a locally timezoned date treated as if it was a UTC one\n *\n * @example\n * `2022-01-02T03:04:05.006+01:00` => `2022-01-02T03:04:05.006Z`.\n */\nexport function getUtcizedDayjs(localDate?: Date): Dayjs {\n const definedLocalDate = localDate || new Date()\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = definedLocalDate.getTimezoneOffset()\n\n return dayjs(definedLocalDate).subtract(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":["dayjs"],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,eAAe,CAAC,SAAgB,EAAA;AAC9C,IAAA,MAAM,gBAAgB,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;;;AAGhD,IAAA,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAA;IAEpE,OAAOA,gBAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAA;AAC7E;;;;"}
|
package/src/utils/sortDates.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './dayjs.js';
|
|
2
|
-
import
|
|
2
|
+
import dayjs_minExports from '../../_virtual/dayjs.min2.js';
|
|
3
3
|
|
|
4
4
|
function sortDates(dates) {
|
|
5
5
|
return dates
|
|
6
6
|
.map(date => date.toISOString())
|
|
7
7
|
.sort()
|
|
8
|
-
.map(dateAsIsoString =>
|
|
8
|
+
.map(dateAsIsoString => dayjs_minExports(dateAsIsoString).toDate());
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { sortDates };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortDates.js","sources":["../../../src/utils/sortDates.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nexport function sortDates(dates: Date[]): Date[] {\n return dates\n .map(date => date.toISOString())\n .sort()\n .map(dateAsIsoString => dayjs(dateAsIsoString).toDate())\n}\n"],"names":[],"mappings":";;;AAEM,SAAU,SAAS,CAAC,KAAa,EAAA;AACrC,IAAA,OAAO,KAAK;SACT,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;AAC/B,SAAA,IAAI,EAAE;AACN,SAAA,GAAG,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"sortDates.js","sources":["../../../src/utils/sortDates.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nexport function sortDates(dates: Date[]): Date[] {\n return dates\n .map(date => date.toISOString())\n .sort()\n .map(dateAsIsoString => dayjs(dateAsIsoString).toDate())\n}\n"],"names":["dayjs"],"mappings":";;;AAEM,SAAU,SAAS,CAAC,KAAa,EAAA;AACrC,IAAA,OAAO,KAAK;SACT,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;AAC/B,SAAA,IAAI,EAAE;AACN,SAAA,GAAG,CAAC,eAAe,IAAIA,gBAAK,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5D;;;;"}
|