@dilicorp/ui 0.0.44 → 0.0.45
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.
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SupportedDateFormat, SupportedLanguages } from '../../../atoms/input-datepicker';
|
|
2
3
|
declare type FilterDatepickerProps = {
|
|
3
4
|
name: string;
|
|
4
5
|
id?: string;
|
|
5
6
|
value?: string;
|
|
6
7
|
placeholder?: string;
|
|
8
|
+
locale?: SupportedLanguages;
|
|
9
|
+
dateFormat?: SupportedDateFormat;
|
|
7
10
|
};
|
|
8
11
|
export declare const FilterDatepicker: React.FC<FilterDatepickerProps>;
|
|
9
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-datepicker.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"filter-datepicker.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEzF,aAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+B5D,CAAA"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Datepicker from 'react-datepicker';
|
|
3
3
|
import dateHelper from '../../../utils/date-helper';
|
|
4
4
|
export const FilterDatepicker = (props) => {
|
|
5
|
-
const { name, id = name, value, placeholder } = props;
|
|
5
|
+
const { name, id = name, value, placeholder, locale = 'pt-BR', dateFormat = 'dd/MM/yyyy' } = props;
|
|
6
6
|
const [date, setDate] = React.useState(dateHelper.stringToDate(value));
|
|
7
7
|
const handleChange = (currentDate) => {
|
|
8
8
|
setDate(currentDate);
|
|
@@ -11,5 +11,5 @@ export const FilterDatepicker = (props) => {
|
|
|
11
11
|
Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
|
|
12
12
|
placeholder,
|
|
13
13
|
":"),
|
|
14
|
-
React.createElement(Datepicker, { name: name, id: id, placeholderText: placeholder, selected: date, locale:
|
|
14
|
+
React.createElement(Datepicker, { name: name, id: id, placeholderText: placeholder, selected: date, locale: locale, className: "form-control", dateFormat: dateFormat, autoComplete: "off", onChange: handleChange })));
|
|
15
15
|
};
|