@autoguru/overdrive 4.48.0-next.2 → 4.48.0-next.3
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/dist/components/DateInput/DateInput.d.ts +7 -1
- package/dist/components/DateInput/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput.js +9 -7
- package/dist/components/Popover/Popover.css.d.ts.map +1 -1
- package/dist/components/Popover/Popover.css.js +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DatePickerProps } from '../DatePicker/DatePicker';
|
|
3
3
|
type FilteredDatePickerProps = Pick<DatePickerProps, 'calendarOptions' | 'lang'>;
|
|
4
|
+
export interface DateInputProps extends FilteredDatePickerProps, Partial<Pick<HTMLInputElement, 'min' | 'max'>> {
|
|
5
|
+
/**
|
|
6
|
+
* Accessible label for the date input field, can be the same or different to the `placeholder` content
|
|
7
|
+
*/
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Input component for structured date entry with integrated calendar date picker.
|
|
6
12
|
*
|
|
@@ -42,6 +48,6 @@ type FilteredDatePickerProps = Pick<DatePickerProps, 'calendarOptions' | 'lang'>
|
|
|
42
48
|
* />
|
|
43
49
|
* ```
|
|
44
50
|
*/
|
|
45
|
-
export declare const DateInput: React.ForwardRefExoticComponent<
|
|
51
|
+
export declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").EventHandlers<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").ValidationProps & React.RefAttributes<HTMLInputElement>>;
|
|
46
52
|
export {};
|
|
47
53
|
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../lib/components/DateInput/DateInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AAWf,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAM5E,KAAK,uBAAuB,GAAG,IAAI,CAClC,eAAe,EACf,iBAAiB,GAAG,MAAM,CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../lib/components/DateInput/DateInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AAWf,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAM5E,KAAK,uBAAuB,GAAG,IAAI,CAClC,eAAe,EACf,iBAAiB,GAAG,MAAM,CAC1B,CAAC;AAEF,MAAM,WAAW,cAChB,SAAQ,uBAAuB,EAC9B,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,SAAS,+UAwJrB,CAAC"}
|
|
@@ -90,6 +90,7 @@ export const DateInput = withEnhancedInput(({
|
|
|
90
90
|
calendarOptions,
|
|
91
91
|
eventHandlers,
|
|
92
92
|
field,
|
|
93
|
+
label,
|
|
93
94
|
lang,
|
|
94
95
|
max,
|
|
95
96
|
min,
|
|
@@ -112,10 +113,6 @@ export const DateInput = withEnhancedInput(({
|
|
|
112
113
|
locale
|
|
113
114
|
} = useLocale();
|
|
114
115
|
const [selectedDate, setSelectedDate] = useState(value ? safeParseDateString(value) : null);
|
|
115
|
-
const minMaxValues = {
|
|
116
|
-
minValue: min ? safeParseDateString(min) : undefined,
|
|
117
|
-
maxValue: max ? safeParseDateString(max) : undefined
|
|
118
|
-
};
|
|
119
116
|
useEffect(() => {
|
|
120
117
|
const parsedDate = value ? safeParseDateString(value) : null;
|
|
121
118
|
setSelectedDate(parsedDate);
|
|
@@ -155,8 +152,11 @@ export const DateInput = withEnhancedInput(({
|
|
|
155
152
|
onBlur: handleBlur,
|
|
156
153
|
onChange: handleDateChange,
|
|
157
154
|
onFocus: handleFocus,
|
|
158
|
-
value: selectedDate
|
|
159
|
-
|
|
155
|
+
value: selectedDate,
|
|
156
|
+
label,
|
|
157
|
+
minValue: min ? safeParseDateString(min) : undefined,
|
|
158
|
+
maxValue: max ? safeParseDateString(max) : undefined
|
|
159
|
+
});
|
|
160
160
|
const dateFieldState = useDateFieldState(_objectSpread(_objectSpread({}, hookProps), {}, {
|
|
161
161
|
locale,
|
|
162
162
|
createCalendar
|
|
@@ -193,7 +193,9 @@ export const DateInput = withEnhancedInput(({
|
|
|
193
193
|
id: id,
|
|
194
194
|
name: name,
|
|
195
195
|
value: formatDateValue(selectedDate),
|
|
196
|
-
|
|
196
|
+
min: min,
|
|
197
|
+
max: max,
|
|
198
|
+
calendarOptions: _objectSpread(_objectSpread({}, defaultCalendarOptions), calendarOptions),
|
|
197
199
|
disabled: disabled,
|
|
198
200
|
lang: lang,
|
|
199
201
|
size: size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/Popover.css.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,QAiBvB,CAAC;AAEH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"Popover.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/Popover.css.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,QAiBvB,CAAC;AAEH,eAAO,MAAM,YAAY,QAevB,CAAC;AAEH,eAAO,MAAM,eAAe,QAY1B,CAAC"}
|
|
@@ -27,6 +27,7 @@ export const triggerStyle = style({
|
|
|
27
27
|
[cssLayerComponent]: {
|
|
28
28
|
background: 'transparent',
|
|
29
29
|
border: 'none',
|
|
30
|
+
color: 'inherit',
|
|
30
31
|
cursor: 'pointer',
|
|
31
32
|
padding: 0,
|
|
32
33
|
selectors: {
|
|
@@ -46,7 +47,7 @@ export const fullScreenStyle = style({
|
|
|
46
47
|
position: 'fixed',
|
|
47
48
|
right: 0,
|
|
48
49
|
top: 0,
|
|
49
|
-
zIndex:
|
|
50
|
+
zIndex: 2000 // higher than modal
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}, "fullScreenStyle");
|
package/package.json
CHANGED