@mtes-mct/monitor-ui 1.1.1 → 1.2.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/CHANGELOG.md +7 -0
- package/README.md +19 -4
- package/formiks/FormikDatePicker.d.ts +5 -0
- package/formiks/FormikDateRangePicker.d.ts +5 -0
- package/index.d.ts +4 -0
- package/package.json +2 -3
- package/src/formiks/FormikDatePicker.js +17 -0
- package/src/formiks/FormikDatePicker.js.map +1 -0
- package/src/formiks/FormikDateRangePicker.js +17 -0
- package/src/formiks/FormikDateRangePicker.js.map +1 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v1.1.0...v1.1.1) (2022-11-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **semantic-release:** publish to NPM ([#12](https://github.com/MTES-MCT/monitor-ui/issues/12)) ([2c42952](https://github.com/MTES-MCT/monitor-ui/commit/2c42952dcc8bbc3983aee55f784e0ca082760d0f))
|
|
7
|
+
|
|
1
8
|
# [1.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v1.0.0...v1.1.0) (2022-11-24)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -2,9 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
[![License][img-license]][lnk-license]
|
|
4
4
|
[![CI Status][img-github]][lnk-github]
|
|
5
|
-
|
|
5
|
+
[![NPM Version][img-npm]][lnk-npm]
|
|
6
6
|
|
|
7
|
-
> Common React
|
|
7
|
+
> Common React components, hooks, utilities and CSS stylesheets
|
|
8
|
+
> for [Monitorfish][lnk-github-monitorfish] and [Monitorenv][lnk-github-monitorenv].
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm i -E @mtes-mct/monitor-ui
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
or
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
yarn add -E @mtes-mct/monitor-ui
|
|
20
|
+
```
|
|
8
21
|
|
|
9
22
|
## Documentation
|
|
10
23
|
|
|
@@ -18,8 +31,10 @@ Please read the [contributing document](CONTRIBUTING.md) for setup and contribut
|
|
|
18
31
|
|
|
19
32
|
[img-github]: https://img.shields.io/github/workflow/status/MTES-MCT/monitor-ui/Check/main?style=flat-square
|
|
20
33
|
[img-license]: https://img.shields.io/github/license/MTES-MCT/monitor-ui?style=flat-square
|
|
21
|
-
[img-npm]: https://img.shields.io/npm/v/@
|
|
34
|
+
[img-npm]: https://img.shields.io/npm/v/@mtes-mct/monitor-ui?style=flat-square
|
|
22
35
|
[lnk-github]: https://github.com/MTES-MCT/monitor-ui/actions?query=branch%3Amain++
|
|
36
|
+
[lnk-github-monitorenv]: https://github.com/MTES-MCT/monitorenv
|
|
37
|
+
[lnk-github-monitorfish]: https://github.com/MTES-MCT/monitorfish
|
|
23
38
|
[lnk-license]: https://github.com/MTES-MCT/monitor-ui/blob/main/LICENSE
|
|
24
|
-
[lnk-npm]: https://www.npmjs.com/package/@
|
|
39
|
+
[lnk-npm]: https://www.npmjs.com/package/@mtes-mct/monitor-ui
|
|
25
40
|
[lnk-storybook]: https://mtes-mct.github.io/monitor-ui/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DatePickerProps } from '../fields/DatePicker';
|
|
2
|
+
export declare type FormikDatePickerProps = Omit<DatePickerProps, 'onChange'> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function FormikDatePicker({ name, ...originalProps }: FormikDatePickerProps): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DateRangePickerProps } from '../fields/DateRangePicker';
|
|
2
|
+
export declare type FormikDateRangePickerProps = Omit<DateRangePickerProps, 'onChange'> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function FormikDateRangePicker({ name, ...originalProps }: FormikDateRangePickerProps): JSX.Element;
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { THEME } from './theme';
|
|
|
3
3
|
export { DateRangePicker } from './fields/DateRangePicker';
|
|
4
4
|
export { DatePicker } from './fields/DatePicker';
|
|
5
5
|
export { Select } from './fields/Select';
|
|
6
|
+
export { FormikDatePicker } from './formiks/FormikDatePicker';
|
|
7
|
+
export { FormikDateRangePicker } from './formiks/FormikDateRangePicker';
|
|
6
8
|
export { FormikEffect } from './formiks/FormikEffect';
|
|
7
9
|
export { FormikSelect } from './formiks/FormikSelect';
|
|
8
10
|
export { ThemeProvider } from './ThemeProvider';
|
|
@@ -10,5 +12,7 @@ export type { PartialTheme, Theme } from './theme';
|
|
|
10
12
|
export type { DateRangePickerProps } from './fields/DateRangePicker';
|
|
11
13
|
export type { DatePickerProps } from './fields/DatePicker';
|
|
12
14
|
export type { SelectProps } from './fields/Select';
|
|
15
|
+
export type { FormikDatePickerProps } from './formiks/FormikDatePicker';
|
|
16
|
+
export type { FormikDateRangePickerProps } from './formiks/FormikDateRangePicker';
|
|
13
17
|
export type { FormikEffectProps } from './formiks/FormikEffect';
|
|
14
18
|
export type { FormikSelectProps } from './formiks/FormikSelect';
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtes-mct/monitor-ui",
|
|
3
3
|
"description": "Common React UI components and styles for Monitorfish and Monitorenv.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "18",
|
|
8
8
|
"npm": "8"
|
|
9
9
|
},
|
|
10
|
-
"browser": "./src/index.ts",
|
|
11
10
|
"dependencies": {
|
|
12
11
|
"@babel/runtime": "7.19.4",
|
|
13
12
|
"date-fns": "2.29.3",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"bugs": {
|
|
38
37
|
"url": "https://github.com/MTES-MCT/monitor-ui/issues"
|
|
39
38
|
},
|
|
40
|
-
"exports": "./index.js",
|
|
39
|
+
"exports": "./src/index.js",
|
|
41
40
|
"homepage": "https://mtes-mct.github.io/monitor-ui/",
|
|
42
41
|
"publishConfig": {
|
|
43
42
|
"access": "public",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { DatePicker } from '../fields/DatePicker/index.js';
|
|
5
|
+
|
|
6
|
+
function FormikDatePicker({ name, ...originalProps }) {
|
|
7
|
+
const [, , helpers] = useField(name);
|
|
8
|
+
const { setValue } = helpers;
|
|
9
|
+
// We don't include `setValues` in `useEffect()` dependencies
|
|
10
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
11
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
+
useEffect(() => () => setValue(undefined), []);
|
|
13
|
+
return jsx(DatePicker, { onChange: setValue, ...originalProps });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { FormikDatePicker };
|
|
17
|
+
//# sourceMappingURL=FormikDatePicker.js.map
|
|
@@ -0,0 +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 `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,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useField } from 'formik';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { DateRangePicker } from '../fields/DateRangePicker/index.js';
|
|
5
|
+
|
|
6
|
+
function FormikDateRangePicker({ name, ...originalProps }) {
|
|
7
|
+
const [, , helpers] = useField(name);
|
|
8
|
+
const { setValue } = helpers;
|
|
9
|
+
// We don't include `setValues` in `useEffect()` dependencies
|
|
10
|
+
// both because it is useless and it will trigger infinite hook calls
|
|
11
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
+
useEffect(() => () => setValue(undefined), []);
|
|
13
|
+
return jsx(DateRangePicker, { onChange: setValue, ...originalProps });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { FormikDateRangePicker };
|
|
17
|
+
//# sourceMappingURL=FormikDateRangePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormikDateRangePicker.js","sources":["../../../src/formiks/FormikDateRangePicker.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useEffect } from 'react'\n\nimport { DateRangePicker } from '../fields/DateRangePicker'\n\nimport type { DateRangePickerProps } from '../fields/DateRangePicker'\n\nexport type FormikDateRangePickerProps = Omit<DateRangePickerProps, 'onChange'> & {\n name: string\n}\nexport function FormikDateRangePicker({ name, ...originalProps }: FormikDateRangePickerProps) {\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 <DateRangePicker onChange={setValue} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAUM,SAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAA8B,EAAA;IAC1F,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,eAAe,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAA,GAAM,aAAa,EAAA,CAAI,CAAA;AACnE;;;;"}
|
package/src/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export { THEME } from './theme.js';
|
|
|
4
4
|
export { DateRangePicker } from './fields/DateRangePicker/index.js';
|
|
5
5
|
export { DatePicker } from './fields/DatePicker/index.js';
|
|
6
6
|
export { Select } from './fields/Select.js';
|
|
7
|
+
export { FormikDatePicker } from './formiks/FormikDatePicker.js';
|
|
8
|
+
export { FormikDateRangePicker } from './formiks/FormikDateRangePicker.js';
|
|
7
9
|
export { FormikEffect } from './formiks/FormikEffect.js';
|
|
8
10
|
export { FormikSelect } from './formiks/FormikSelect.js';
|
|
9
11
|
export { ThemeProvider } from './ThemeProvider.js';
|
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":";;;;;;;;;;"}
|