@instructure/ui-date-input 9.5.2 → 9.6.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 +11 -0
- package/es/DateInput2/index.js +27 -23
- package/es/DateInput2/props.js +2 -1
- package/lib/DateInput2/index.js +27 -23
- package/lib/DateInput2/props.js +2 -1
- package/package.json +20 -20
- package/src/DateInput2/README.md +103 -1
- package/src/DateInput2/index.tsx +37 -26
- package/src/DateInput2/props.ts +24 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DateInput2/index.d.ts +3 -8
- package/types/DateInput2/index.d.ts.map +1 -1
- package/types/DateInput2/props.d.ts +5 -1
- package/types/DateInput2/props.d.ts.map +1 -1
@@ -8,7 +8,7 @@ category: components
|
|
8
8
|
---
|
9
9
|
**/
|
10
10
|
declare const DateInput2: {
|
11
|
-
({ renderLabel, screenReaderLabels, isRequired, interaction, size, isInline, value, messages, width, onChange, onBlur, withYearPicker, onRequestValidateDate, invalidDateErrorMessage, locale, timezone, placeholder, ...rest }: DateInput2Props): jsx.JSX.Element;
|
11
|
+
({ renderLabel, screenReaderLabels, isRequired, interaction, size, isInline, value, messages, width, onChange, onBlur, withYearPicker, onRequestValidateDate, invalidDateErrorMessage, locale, timezone, placeholder, formatDate, ...rest }: DateInput2Props): jsx.JSX.Element;
|
12
12
|
propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
13
13
|
renderLabel: import("@instructure/shared-types").Renderable;
|
14
14
|
screenReaderLabels: {
|
@@ -19,13 +19,7 @@ declare const DateInput2: {
|
|
19
19
|
value?: string;
|
20
20
|
size?: "small" | "medium" | "large";
|
21
21
|
placeholder?: string;
|
22
|
-
onChange?: (event:
|
23
|
-
/**
|
24
|
-
---
|
25
|
-
category: components
|
26
|
-
---
|
27
|
-
**/
|
28
|
-
React.SyntheticEvent, value: string) => void;
|
22
|
+
onChange?: (event: React.SyntheticEvent, inputValue: string, dateString: string) => void;
|
29
23
|
onBlur?: (event: React.SyntheticEvent) => void;
|
30
24
|
interaction?: "enabled" | "disabled" | "readonly";
|
31
25
|
isRequired?: boolean;
|
@@ -44,6 +38,7 @@ declare const DateInput2: {
|
|
44
38
|
startYear: number;
|
45
39
|
endYear: number;
|
46
40
|
};
|
41
|
+
formatDate?: (isoDate: string, locale: string, timezone: string) => string;
|
47
42
|
}>;
|
48
43
|
};
|
49
44
|
export default DateInput2;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput2/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAa3C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput2/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAa3C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAqB7D;;;;GAIG;AACH,QAAA,MAAM,UAAU;iPAqBb,eAAe;;;;;;;;;;;2BArChB,MAAM,cACJ;yBAMO,MAAO,cAIjB;;;;;;;;sCAiEa,CAAC,kCAAsC,CAAC;;;;;;+BAmE9B,CAAC;;;;;;CA8DxB,CAAA;AAID,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
@@ -27,7 +27,7 @@ type DateInput2OwnProps = {
|
|
27
27
|
/**
|
28
28
|
* Callback fired when the input changes.
|
29
29
|
*/
|
30
|
-
onChange?: (event: React.SyntheticEvent,
|
30
|
+
onChange?: (event: React.SyntheticEvent, inputValue: string, dateString: string) => void;
|
31
31
|
/**
|
32
32
|
* Callback executed when the input fires a blur event.
|
33
33
|
*/
|
@@ -124,6 +124,10 @@ type DateInput2OwnProps = {
|
|
124
124
|
startYear: number;
|
125
125
|
endYear: number;
|
126
126
|
};
|
127
|
+
/**
|
128
|
+
* Formatting function for how the date should be displayed inside the input field. It will be applied if the user clicks on a date in the date picker of after blur event from the input field.
|
129
|
+
*/
|
130
|
+
formatDate?: (isoDate: string, locale: string, timezone: string) => string;
|
127
131
|
};
|
128
132
|
type PropKeys = keyof DateInput2OwnProps;
|
129
133
|
type DateInput2Props = DateInput2OwnProps & OtherHTMLAttributes<DateInput2OwnProps, InputHTMLAttributes<DateInput2OwnProps & Element>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/DateInput2/props.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/DateInput2/props.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAA;AAElC,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,WAAW,EAAE,UAAU,CAAA;IACvB,kBAAkB,EAAE;QAClB,YAAY,EAAE,MAAM,CAAA;QACpB,eAAe,EAAE,MAAM,CAAA;QACvB,eAAe,EAAE,MAAM,CAAA;KACxB,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