@sprinklrjs/spaceweb 14.16.0 → 14.16.1
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/esm/select/styled-component.js +1 -3
- package/esm/time-range-picker/RangeSelector.js +2 -2
- package/esm/time-range-picker/RangeSelectorContainer.js +1 -1
- package/package.json +2 -2
- package/select/styled-component.js +1 -3
- package/time-range-picker/RangeSelector.js +2 -2
- package/time-range-picker/RangeSelectorContainer.js +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -74,9 +74,7 @@ var InputContainer = function (_a) {
|
|
|
74
74
|
var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
75
75
|
var containerRef = useRef(null);
|
|
76
76
|
if (!props.$searchable) {
|
|
77
|
-
return (_jsxs(_Fragment, { children: [commaSeparatedValues ? (_jsx(HiddenElement, __assign({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props.$multi ? locale.select.multiValueNavigationDescription : '') }))) : null, _jsx(StyledInputContainer, __assign({}, props, { "$selectSize": size, "aria-controls": props.$isOpen ? listboxId : undefined, "aria-owns": props.$isOpen ? listboxId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, "aria-autocomplete": "list", role: "combobox", ref: containerRef },
|
|
78
|
-
? {}
|
|
79
|
-
: { 'aria-placeholder': placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder }), { "aria-haspopup": "listbox" }, { children: props.children
|
|
77
|
+
return (_jsxs(_Fragment, { children: [commaSeparatedValues ? (_jsx(HiddenElement, __assign({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props.$multi ? locale.select.multiValueNavigationDescription : '') }))) : null, _jsx(StyledInputContainer, __assign({}, props, { "$selectSize": size, "aria-controls": props.$isOpen ? listboxId : undefined, "aria-owns": props.$isOpen ? listboxId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, "aria-autocomplete": "list", role: "combobox", ref: containerRef, "aria-haspopup": "listbox" }, { children: props.children
|
|
80
78
|
? cloneElement(Children.only(props.children), __assign({ onFocus: function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }, ($value && $value.length > 0 ? {} : { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder })))
|
|
81
79
|
: null }))] }));
|
|
82
80
|
}
|
|
@@ -14,8 +14,8 @@ var RangeSelector = function (_a) {
|
|
|
14
14
|
var TIME_RANGE_LIST_OVERRIDES = useMemo(function () {
|
|
15
15
|
return mergeOverrides({ Menu: { props: { overrides: { List: { props: { overrides: { Root: { className: 'h-0' } } } } } } } }, overrides);
|
|
16
16
|
}, [overrides]);
|
|
17
|
-
return (_jsxs(Box, __assign({ className: "flex border-0 border-t-1 border-solid spr-border-01" }, { children: [props.timeRangePresets.length !== 1 ? (_jsx(TimeRangeList, __assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets, overrides: TIME_RANGE_LIST_OVERRIDES, hidePresetSearch: hidePresetSearch }, restTimeRangeListProps))) : null, _jsxs(Box, __assign({ className: "overflow-y-auto" }, { children: [_jsx(Calendar, __assign({ timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
18
|
-
// @ts-
|
|
17
|
+
return (_jsxs(Box, __assign({ className: "flex flex-1 min-h-0 overflow-y-auto border-0 border-t-1 border-solid spr-border-01", "data-testid": "time-range-selector-scroll" }, { children: [props.timeRangePresets.length !== 1 ? (_jsx(TimeRangeList, __assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets, overrides: TIME_RANGE_LIST_OVERRIDES, hidePresetSearch: hidePresetSearch }, restTimeRangeListProps))) : null, _jsxs(Box, __assign({ className: "overflow-y-auto" }, { children: [_jsx(Calendar, __assign({ timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
18
|
+
// @ts-expect-error Calendar overrides type does not include date-picker overrides shape
|
|
19
19
|
overrides: props.overrides, fixedHeight: props.fixedHeight }, calendarProps)), footerContent] }))] })));
|
|
20
20
|
};
|
|
21
21
|
RangeSelector.displayName = 'RangeSelector';
|
|
@@ -114,7 +114,7 @@ var RangeSelectorContainer = function (_a) {
|
|
|
114
114
|
fill: theme.spr.clrRed,
|
|
115
115
|
});
|
|
116
116
|
} }), _jsx(Typography, __assign({ className: "my-0", variant: "bs3" }, { children: errMsg }))] }))) : null;
|
|
117
|
-
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { "aria-label": locale.timeRangePicker.timezoneLabel, className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: monthsShown !== 1 ? 'items-center' : undefined, style: { maxWidth: 'fit-content' } }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? (_jsx(Button, __assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : (_jsx(Button, __assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), _jsx(Button, __assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
117
|
+
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8 flex flex-col", style: { maxHeight: '100vh' }, "data-testid": "time-range-selector-panel" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { "aria-label": locale.timeRangePicker.timezoneLabel, className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: monthsShown !== 1 ? 'items-center' : undefined, style: { maxWidth: 'fit-content' } }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? (_jsx(Button, __assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : (_jsx(Button, __assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), _jsx(Button, __assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
118
118
|
};
|
|
119
119
|
RangeSelectorContainer.displayName = 'RangeSelectorContainer';
|
|
120
120
|
export default RangeSelectorContainer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprinklrjs/spaceweb",
|
|
3
|
-
"version": "14.16.
|
|
3
|
+
"version": "14.16.1",
|
|
4
4
|
"description": "Components for SpaceWeb",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"typescript": "~5.0.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@sprinklrjs/spaceweb-themes": "14.16.
|
|
103
|
+
"@sprinklrjs/spaceweb-themes": "14.16.1",
|
|
104
104
|
"react": ">=17.0.2 <19.0.0",
|
|
105
105
|
"react-dom": ">=17.0.2 <19.0.0"
|
|
106
106
|
}
|
|
@@ -79,9 +79,7 @@ var InputContainer = function (_a) {
|
|
|
79
79
|
var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
80
80
|
var containerRef = (0, react_1.useRef)(null);
|
|
81
81
|
if (!props.$searchable) {
|
|
82
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [commaSeparatedValues ? ((0, jsx_runtime_1.jsx)(hidden_element_1.HiddenElement, tslib_1.__assign({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props.$multi ? locale.select.multiValueNavigationDescription : '') }))) : null, (0, jsx_runtime_1.jsx)(exports.StyledInputContainer, tslib_1.__assign({}, props, { "$selectSize": size, "aria-controls": props.$isOpen ? listboxId : undefined, "aria-owns": props.$isOpen ? listboxId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, "aria-autocomplete": "list", role: "combobox", ref: containerRef },
|
|
83
|
-
? {}
|
|
84
|
-
: { 'aria-placeholder': placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder }), { "aria-haspopup": "listbox" }, { children: props.children
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [commaSeparatedValues ? ((0, jsx_runtime_1.jsx)(hidden_element_1.HiddenElement, tslib_1.__assign({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props.$multi ? locale.select.multiValueNavigationDescription : '') }))) : null, (0, jsx_runtime_1.jsx)(exports.StyledInputContainer, tslib_1.__assign({}, props, { "$selectSize": size, "aria-controls": props.$isOpen ? listboxId : undefined, "aria-owns": props.$isOpen ? listboxId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, "aria-autocomplete": "list", role: "combobox", ref: containerRef, "aria-haspopup": "listbox" }, { children: props.children
|
|
85
83
|
? (0, react_1.cloneElement)(react_1.Children.only(props.children), tslib_1.__assign({ onFocus: function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }, ($value && $value.length > 0 ? {} : { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder })))
|
|
86
84
|
: null }))] }));
|
|
87
85
|
}
|
|
@@ -16,8 +16,8 @@ var RangeSelector = function (_a) {
|
|
|
16
16
|
var TIME_RANGE_LIST_OVERRIDES = (0, react_1.useMemo)(function () {
|
|
17
17
|
return (0, overrides_1.mergeOverrides)({ Menu: { props: { overrides: { List: { props: { overrides: { Root: { className: 'h-0' } } } } } } } }, overrides);
|
|
18
18
|
}, [overrides]);
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex border-0 border-t-1 border-solid spr-border-01" }, { children: [props.timeRangePresets.length !== 1 ? ((0, jsx_runtime_1.jsx)(TimeRangeList, tslib_1.__assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets, overrides: TIME_RANGE_LIST_OVERRIDES, hidePresetSearch: hidePresetSearch }, restTimeRangeListProps))) : null, (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "overflow-y-auto" }, { children: [(0, jsx_runtime_1.jsx)(Calendar, tslib_1.__assign({ timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
20
|
-
// @ts-
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex flex-1 min-h-0 overflow-y-auto border-0 border-t-1 border-solid spr-border-01", "data-testid": "time-range-selector-scroll" }, { children: [props.timeRangePresets.length !== 1 ? ((0, jsx_runtime_1.jsx)(TimeRangeList, tslib_1.__assign({ onChange: onChange, timeRange: timeRange, preset: preset, timeRangePresets: props.timeRangePresets, overrides: TIME_RANGE_LIST_OVERRIDES, hidePresetSearch: hidePresetSearch }, restTimeRangeListProps))) : null, (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "overflow-y-auto" }, { children: [(0, jsx_runtime_1.jsx)(Calendar, tslib_1.__assign({ timeSelectEnd: props.timeSelect, timeSelectStart: props.timeSelect, value: timeRange, onChange: onChange, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: props.minDate, maxDate: props.maxDate, range: true, monthsShown: props.monthsShown, locale: props.locale, formatString: formatString,
|
|
20
|
+
// @ts-expect-error Calendar overrides type does not include date-picker overrides shape
|
|
21
21
|
overrides: props.overrides, fixedHeight: props.fixedHeight }, calendarProps)), footerContent] }))] })));
|
|
22
22
|
};
|
|
23
23
|
RangeSelector.displayName = 'RangeSelector';
|
|
@@ -116,7 +116,7 @@ var RangeSelectorContainer = function (_a) {
|
|
|
116
116
|
fill: theme.spr.clrRed,
|
|
117
117
|
});
|
|
118
118
|
} }), (0, jsx_runtime_1.jsx)(typography_1.Typography, tslib_1.__assign({ className: "my-0", variant: "bs3" }, { children: errMsg }))] }))) : null;
|
|
119
|
-
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "spr-ui-01 rounded-8" }, { children: [(0, jsx_runtime_1.jsxs)(Header, tslib_1.__assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [(0, jsx_runtime_1.jsx)(HeaderBeforeEnhancer, tslib_1.__assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : ((0, jsx_runtime_1.jsx)(TimezonePicker, tslib_1.__assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { "aria-label": locale.timeRangePicker.timezoneLabel, className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), (0, jsx_runtime_1.jsx)(RangeSelector, tslib_1.__assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: (0, jsx_runtime_1.jsx)(Footer, tslib_1.__assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "justify-between w-0 grow flex" }, { children: [(0, jsx_runtime_1.jsx)(FooterBeforeEnhancer, tslib_1.__assign({}, footerBeforeEnhancerProps)), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: monthsShown !== 1 ? 'items-center' : undefined, style: { maxWidth: 'fit-content' } }, { children: [monthsShown === 1 ? null : errorEl, (0, jsx_runtime_1.jsxs)(stack_1.StackItem, tslib_1.__assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), (0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
119
|
+
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "spr-ui-01 rounded-8 flex flex-col", style: { maxHeight: '100vh' }, "data-testid": "time-range-selector-panel" }, { children: [(0, jsx_runtime_1.jsxs)(Header, tslib_1.__assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [(0, jsx_runtime_1.jsx)(HeaderBeforeEnhancer, tslib_1.__assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : ((0, jsx_runtime_1.jsx)(TimezonePicker, tslib_1.__assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { "aria-label": locale.timeRangePicker.timezoneLabel, className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), (0, jsx_runtime_1.jsx)(RangeSelector, tslib_1.__assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: (0, jsx_runtime_1.jsx)(Footer, tslib_1.__assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "justify-between w-0 grow flex" }, { children: [(0, jsx_runtime_1.jsx)(FooterBeforeEnhancer, tslib_1.__assign({}, footerBeforeEnhancerProps)), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: monthsShown !== 1 ? 'items-center' : undefined, style: { maxWidth: 'fit-content' } }, { children: [monthsShown === 1 ? null : errorEl, (0, jsx_runtime_1.jsxs)(stack_1.StackItem, tslib_1.__assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), (0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
120
120
|
};
|
|
121
121
|
RangeSelectorContainer.displayName = 'RangeSelectorContainer';
|
|
122
122
|
exports.default = RangeSelectorContainer;
|