@indico-data/design-system 2.54.0 → 2.55.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/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +24 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.d.ts +6 -0
- package/lib/components/forms/date/inputDateTimePicker/helpers.d.ts +1 -0
- package/lib/components/forms/date/inputDateTimePicker/index.d.ts +1 -0
- package/lib/components/forms/subcomponents/DisplayFormError.d.ts +2 -1
- package/lib/components/forms/timePicker/TimePicker.d.ts +3 -1
- package/lib/components/forms/timePicker/helpers.d.ts +2 -5
- package/lib/index.css +0 -90
- package/lib/index.d.ts +3 -1
- package/lib/index.esm.css +0 -90
- package/lib/index.esm.js +187 -166
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +187 -166
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +4 -4
- package/src/components/forms/date/datePicker/DatePicker.tsx +0 -2
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.mdx +20 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +262 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +141 -0
- package/src/components/forms/date/inputDateTimePicker/helpers.ts +3 -0
- package/src/components/forms/date/inputDateTimePicker/index.ts +1 -0
- package/src/components/forms/input/Input.tsx +1 -1
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/forms/subcomponents/DisplayFormError.tsx +7 -2
- package/src/components/forms/timePicker/TimePicker.mdx +3 -27
- package/src/components/forms/timePicker/TimePicker.stories.tsx +19 -1
- package/src/components/forms/timePicker/TimePicker.tsx +37 -80
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +33 -11
- package/src/components/forms/timePicker/helpers.ts +61 -13
- package/src/styles/index.scss +0 -2
- package/lib/components/forms/timePicker/constants.d.ts +0 -13
- package/src/components/forms/timePicker/constants.ts +0 -21
- package/src/components/forms/timePicker/styles/TimePicker.scss +0 -51
package/lib/index.esm.js
CHANGED
|
@@ -5013,12 +5013,12 @@ var classnames = {exports: {}};
|
|
|
5013
5013
|
} (classnames));
|
|
5014
5014
|
|
|
5015
5015
|
var classnamesExports = classnames.exports;
|
|
5016
|
-
var
|
|
5016
|
+
var y$1 = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
5017
5017
|
|
|
5018
5018
|
const Icon = (_a) => {
|
|
5019
5019
|
var { name, size = 'md', className, ariaLabel } = _a, props = __rest(_a, ["name", "size", "className", "ariaLabel"]);
|
|
5020
5020
|
const label = ariaLabel || `${name} Icon`;
|
|
5021
|
-
const iconClasses =
|
|
5021
|
+
const iconClasses = y$1('icon', {
|
|
5022
5022
|
[`icon--${size}`]: size,
|
|
5023
5023
|
}, className);
|
|
5024
5024
|
const faIconName = name.split('fa-')[1];
|
|
@@ -5043,7 +5043,7 @@ const Icon = (_a) => {
|
|
|
5043
5043
|
|
|
5044
5044
|
const Button$1 = forwardRef((props, ref) => {
|
|
5045
5045
|
const { ariaLabel, children, isLoading, isDisabled, variant = 'solid', isPill, iconLeft, iconRight, onClick, type = 'button', size = 'md', onMouseEnter, onMouseExit, onKeyDown, className, href } = props, rest = __rest(props, ["ariaLabel", "children", "isLoading", "isDisabled", "variant", "isPill", "iconLeft", "iconRight", "onClick", "type", "size", "onMouseEnter", "onMouseExit", "onKeyDown", "className", "href"]);
|
|
5046
|
-
const buttonClasses =
|
|
5046
|
+
const buttonClasses = y$1('btn', {
|
|
5047
5047
|
[`btn--${variant}`]: variant,
|
|
5048
5048
|
[`btn--${size}`]: size,
|
|
5049
5049
|
'btn--icon-only': !children && (iconLeft || iconRight),
|
|
@@ -5461,8 +5461,9 @@ function withLabel(WrappedComponent) {
|
|
|
5461
5461
|
return forwardRef(WithLabelComponent);
|
|
5462
5462
|
}
|
|
5463
5463
|
|
|
5464
|
-
const DisplayFormError = (
|
|
5465
|
-
|
|
5464
|
+
const DisplayFormError = (_a) => {
|
|
5465
|
+
var { message } = _a, rest = __rest(_a, ["message"]);
|
|
5466
|
+
return (jsx("p", Object.assign({ className: "form-errors" }, rest, { children: message })));
|
|
5466
5467
|
};
|
|
5467
5468
|
|
|
5468
5469
|
const Input = React__default.forwardRef((_a, ref) => {
|
|
@@ -5471,11 +5472,11 @@ const Input = React__default.forwardRef((_a, ref) => {
|
|
|
5471
5472
|
const handleClear = () => {
|
|
5472
5473
|
onChange === null || onChange === void 0 ? void 0 : onChange({ target: { value: '' } });
|
|
5473
5474
|
};
|
|
5474
|
-
const inputClasses =
|
|
5475
|
+
const inputClasses = y$1('input', {
|
|
5475
5476
|
error: hasErrors,
|
|
5476
5477
|
'input--has-icon': iconName,
|
|
5477
5478
|
}, className);
|
|
5478
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, id: id, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, placeholder: placeholder, readOnly: readonly, onChange: onChange, onBlur: onBlur, maxLength: maxLength, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), isClearable && !isDisabled && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5479
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, id: id, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, placeholder: placeholder, readOnly: readonly, onChange: onChange, onBlur: onBlur, maxLength: maxLength, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), isClearable && !isDisabled && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(DisplayFormError, { "data-testid": `${name}-error`, message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5479
5480
|
});
|
|
5480
5481
|
const LabeledInput = withLabel(Input);
|
|
5481
5482
|
|
|
@@ -5483,7 +5484,7 @@ const Pagination = (_a) => {
|
|
|
5483
5484
|
var { totalPages, currentPage = 1, onChange, className } = _a, rest = __rest(_a, ["totalPages", "currentPage", "onChange", "className"]);
|
|
5484
5485
|
const [inputValue, setInputValue] = useState(currentPage.toString());
|
|
5485
5486
|
const totalPagesText = `of ${totalPages}`;
|
|
5486
|
-
const classes =
|
|
5487
|
+
const classes = y$1('pagination', className);
|
|
5487
5488
|
useEffect(() => {
|
|
5488
5489
|
setInputValue(currentPage.toString());
|
|
5489
5490
|
}, [currentPage]);
|
|
@@ -5514,7 +5515,7 @@ const Pagination = (_a) => {
|
|
|
5514
5515
|
const isNextButtonDisabled = currentPage === totalPages;
|
|
5515
5516
|
const isPreviousButtonDisabled = currentPage === 1;
|
|
5516
5517
|
const hasError = Number(inputValue) > totalPages || Number(inputValue) < 1;
|
|
5517
|
-
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", isDisabled: isPreviousButtonDisabled }) }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__current-page", children: jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className:
|
|
5518
|
+
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", isDisabled: isPreviousButtonDisabled }) }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__current-page", children: jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className: y$1('pagination__current-page-input', {
|
|
5518
5519
|
'has-error': hasError,
|
|
5519
5520
|
}), value: inputValue, name: "currentPage", label: "Current Page", hasHiddenLabel: true, onKeyDown: (e) => {
|
|
5520
5521
|
if (e.key === 'Enter') {
|
|
@@ -5762,11 +5763,11 @@ const Table = (props) => {
|
|
|
5762
5763
|
const { responsive = true, direction = 'auto', keyField = 'id', striped = false, noDataComponent = 'built-in', isDisabled, isLoading, isFullHeight = false, subHeaderAlign = 'left', className, paginationTotalRows, totalEntriesText, data, columns: initialColumns, canPinColumns = false, onPinnedColumnsChange } = props, rest = __rest(props, ["responsive", "direction", "keyField", "striped", "noDataComponent", "isDisabled", "isLoading", "isFullHeight", "subHeaderAlign", "className", "paginationTotalRows", "totalEntriesText", "data", "columns", "canPinColumns", "onPinnedColumnsChange"]);
|
|
5763
5764
|
// Turns on/off column pinning.
|
|
5764
5765
|
const { columnsWithPinning } = usePinnedColumnsManager(initialColumns, canPinColumns, onPinnedColumnsChange);
|
|
5765
|
-
const combinedClassName =
|
|
5766
|
+
const combinedClassName = y$1(className, {
|
|
5766
5767
|
'table--striped': striped,
|
|
5767
5768
|
'table-body': true,
|
|
5768
5769
|
});
|
|
5769
|
-
const tableWrapperClassName =
|
|
5770
|
+
const tableWrapperClassName = y$1('table', {
|
|
5770
5771
|
'table--full-height': isFullHeight,
|
|
5771
5772
|
});
|
|
5772
5773
|
return (jsx("div", { className: tableWrapperClassName, "data-testid": "table", children: jsx(Xe, Object.assign({ data: data, columns: columnsWithPinning, responsive: responsive, direction: direction, subHeaderAlign: subHeaderAlign, keyField: keyField, striped: striped, className: combinedClassName, disabled: isDisabled, noDataComponent: noDataComponent, progressPending: isLoading, progressComponent: jsx(LoadingComponent, {}), pagination: true, paginationComponent: (props) => (jsx(TablePagination$1, Object.assign({}, props, { totalEntriesText: totalEntriesText }))), paginationTotalRows: paginationTotalRows, highlightOnHover: true, pointerOnHover: true }, rest)) }));
|
|
@@ -5790,7 +5791,7 @@ const Toggle = React__default.forwardRef((_a, ref) => {
|
|
|
5790
5791
|
const Textarea = React__default.forwardRef((_a, ref) => {
|
|
5791
5792
|
var { label, name, placeholder, value, onChange, onKeyDown, isRequired, isDisabled, errorMessage, helpText, hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus, defaultValue } = _a, rest = __rest(_a, ["label", "name", "placeholder", "value", "onChange", "onKeyDown", "isRequired", "isDisabled", "errorMessage", "helpText", "hasHiddenLabel", "rows", "cols", "readonly", "wrap", "form", "maxLength", "autofocus", "defaultValue"]);
|
|
5792
5793
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
5793
|
-
const textareaClasses =
|
|
5794
|
+
const textareaClasses = y$1('textarea', { error: hasErrors });
|
|
5794
5795
|
return (jsxs(Fragment, { children: [jsx("div", { className: "textarea-wrapper", children: jsx("textarea", Object.assign({ ref: ref, rows: rows, cols: cols, autoFocus: autofocus, wrap: wrap, form: form, maxLength: maxLength, readOnly: readonly, "data-testid": `form-textarea-${name}`, name: name, disabled: isDisabled, placeholder: placeholder, onChange: onChange, onKeyDown: onKeyDown, className: textareaClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, value: value, defaultValue: defaultValue }, rest)) }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5795
5796
|
});
|
|
5796
5797
|
const LabeledTextarea = withLabel(Textarea);
|
|
@@ -5802,7 +5803,7 @@ const PasswordInput = React__default.forwardRef((_a, ref) => {
|
|
|
5802
5803
|
const handleShowPassword = () => {
|
|
5803
5804
|
setShowPassword((prevShowPassword) => !prevShowPassword);
|
|
5804
5805
|
};
|
|
5805
|
-
const inputClasses =
|
|
5806
|
+
const inputClasses = y$1('password-input', {
|
|
5806
5807
|
error: hasErrors,
|
|
5807
5808
|
}, 'password-input--has-icon');
|
|
5808
5809
|
return (jsxs(Fragment, { children: [jsxs("div", { className: "password-input-wrapper", children: [jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon" }), jsx("input", Object.assign({ ref: ref, "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, placeholder: placeholder, onChange: onChange, onBlur: onBlur, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? 'true' : 'false', "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), hasShowPassword && (jsx(Icon, { name: showPassword ? 'fa-eye-slash' : 'eye', "data-testid": `${name}-${showPassword ? 'hide' : 'show'}-password-icon`, size: "md", onClick: handleShowPassword, className: "toggle-show-password-icon" }))] }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
@@ -5820,7 +5821,7 @@ const Select$1 = (_a) => {
|
|
|
5820
5821
|
Option: OptionComponent,
|
|
5821
5822
|
};
|
|
5822
5823
|
const mergedComponents = Object.assign(Object.assign({}, defaultComponents), customComponents);
|
|
5823
|
-
return (jsx(ReactSelect, Object.assign({ classNamePrefix: classNamePrefix, className:
|
|
5824
|
+
return (jsx(ReactSelect, Object.assign({ classNamePrefix: classNamePrefix, className: y$1('select-wrapper', className), components: mergedComponents }, props)));
|
|
5824
5825
|
};
|
|
5825
5826
|
|
|
5826
5827
|
/**
|
|
@@ -11833,38 +11834,114 @@ const getCommonProps = (props) => {
|
|
|
11833
11834
|
});
|
|
11834
11835
|
};
|
|
11835
11836
|
|
|
11836
|
-
const
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11837
|
+
const formatTimeValue = (value) => {
|
|
11838
|
+
if (!value || value.trim() === '') {
|
|
11839
|
+
return '';
|
|
11840
|
+
}
|
|
11841
|
+
// Normalize the input
|
|
11842
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
11843
|
+
// Extract time components using regex
|
|
11844
|
+
const timeRegex = /^(0?[1-9]|1[0-2]):([0-5][0-9])(\s*)([ap]m)$/i;
|
|
11845
|
+
const matches = normalizedValue.match(timeRegex);
|
|
11846
|
+
if (matches) {
|
|
11847
|
+
const hours = parseInt(matches[1], 10);
|
|
11848
|
+
const minutes = parseInt(matches[2], 10);
|
|
11849
|
+
const period = matches[4].toUpperCase(); // Convert am/pm to AM/PM
|
|
11850
|
+
// Format as hh:mm AM/PM
|
|
11851
|
+
return `${hours}:${minutes < 10 ? '0' + minutes : minutes} ${period}`;
|
|
11852
|
+
}
|
|
11853
|
+
return value; // Return original if no match (shouldn't happen with valid inputs)
|
|
11854
|
+
};
|
|
11855
|
+
const validateInputValue = (value) => {
|
|
11856
|
+
if (!value || value.trim() === '') {
|
|
11857
|
+
return ''; // Empty input is allowed
|
|
11858
|
+
}
|
|
11859
|
+
// Normalize the input (remove extra spaces, convert to lowercase)
|
|
11860
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
11861
|
+
// Regular expression for valid time formats: 1:10 pm, 01:10 pm, 1:10pm, 01:10pm
|
|
11862
|
+
const timeRegex = /^(0?[1-9]|1[0-2]):([0-5][0-9])(\s*)([ap]m)$/i;
|
|
11863
|
+
if (!timeRegex.test(normalizedValue)) {
|
|
11864
|
+
// Check if the issue might be a 24-hour format
|
|
11865
|
+
const hour24Regex = /^([13-9]|1[3-9]|2[0-3]):/i;
|
|
11866
|
+
if (hour24Regex.test(normalizedValue)) {
|
|
11867
|
+
return 'Please enter time in 12-hour format (e.g., 1:10 pm)';
|
|
11850
11868
|
}
|
|
11851
|
-
|
|
11852
|
-
|
|
11869
|
+
return 'Please enter a valid time format (e.g., 1:10 pm)';
|
|
11870
|
+
}
|
|
11871
|
+
// Extract hours and minutes for additional validation
|
|
11872
|
+
const matches = normalizedValue.match(timeRegex);
|
|
11873
|
+
if (matches) {
|
|
11874
|
+
const hours = parseInt(matches[1], 10);
|
|
11875
|
+
const minutes = parseInt(matches[2], 10);
|
|
11876
|
+
if (hours < 1 || hours > 12) {
|
|
11877
|
+
return 'Hours must be between 1 and 12';
|
|
11878
|
+
}
|
|
11879
|
+
if (minutes < 0 || minutes > 59) {
|
|
11880
|
+
return 'Minutes must be between 0 and 59';
|
|
11881
|
+
}
|
|
11882
|
+
}
|
|
11883
|
+
return ''; // Valid time format
|
|
11853
11884
|
};
|
|
11854
11885
|
|
|
11855
|
-
const
|
|
11856
|
-
|
|
11857
|
-
const
|
|
11858
|
-
const
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11886
|
+
const TimePicker = ({ timeValue = '', label = 'Time Picker', name = 'time-picker', hasHiddenLabel = false, onTimeChange, }) => {
|
|
11887
|
+
const [validationError, setValidationError] = useState('');
|
|
11888
|
+
const [inputValue, setInputValue] = useState(timeValue);
|
|
11889
|
+
const handleTimeChange = (e) => {
|
|
11890
|
+
const newValue = e.target.value;
|
|
11891
|
+
const error = validateInputValue(newValue);
|
|
11892
|
+
setInputValue(newValue);
|
|
11893
|
+
setValidationError(error);
|
|
11894
|
+
// Only send valid values to parent component
|
|
11895
|
+
if (!error || error === '') {
|
|
11896
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(newValue);
|
|
11897
|
+
}
|
|
11898
|
+
};
|
|
11899
|
+
const handleBlur = (e) => {
|
|
11900
|
+
const currentValue = e.target.value;
|
|
11901
|
+
// Only format if there's no validation error
|
|
11902
|
+
if (validationError === '' && currentValue.trim() !== '') {
|
|
11903
|
+
const formattedValue = formatTimeValue(currentValue);
|
|
11904
|
+
setInputValue(formattedValue);
|
|
11905
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(formattedValue);
|
|
11906
|
+
}
|
|
11907
|
+
};
|
|
11908
|
+
return (jsx("div", { className: "time-input-wrapper", children: jsx(LabeledInput, { "data-testid": `${name}-input`, label: label, hasHiddenLabel: hasHiddenLabel, value: inputValue, maxLength: 8, onChange: handleTimeChange, onBlur: handleBlur, name: name, errorMessage: validationError }) }));
|
|
11862
11909
|
};
|
|
11863
11910
|
|
|
11864
|
-
const
|
|
11865
|
-
|
|
11866
|
-
const
|
|
11867
|
-
|
|
11911
|
+
const DatePicker = (props) => {
|
|
11912
|
+
const { mode = 'single', className, captionLayout = 'dropdown', selected, hasTimePicker = false, id, month, defaultMonth, startMonth, endMonth, components, numberOfMonths, isDisabled, formatters, weekStartsOn, firstWeekContainsDate, today, timeValue, isRequired, min, max, onTimeChange, onSelect, onMonthChange, onNextClick, onPrevClick, onDayClick } = props, rest = __rest(props, ["mode", "className", "captionLayout", "selected", "hasTimePicker", "id", "month", "defaultMonth", "startMonth", "endMonth", "components", "numberOfMonths", "isDisabled", "formatters", "weekStartsOn", "firstWeekContainsDate", "today", "timeValue", "isRequired", "min", "max", "onTimeChange", "onSelect", "onMonthChange", "onNextClick", "onPrevClick", "onDayClick"]);
|
|
11913
|
+
const futureDateByYear = (year) => new Date(new Date().getFullYear() + year, 11, 31);
|
|
11914
|
+
const endMonthDefault = endMonth !== null && endMonth !== void 0 ? endMonth : futureDateByYear(5);
|
|
11915
|
+
const modeMap = {
|
|
11916
|
+
single: {
|
|
11917
|
+
mode: 'single',
|
|
11918
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
11919
|
+
selected: selected,
|
|
11920
|
+
onSelect: onSelect,
|
|
11921
|
+
endMonth: endMonthDefault,
|
|
11922
|
+
},
|
|
11923
|
+
multiple: {
|
|
11924
|
+
mode: 'multiple',
|
|
11925
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
11926
|
+
selected: selected,
|
|
11927
|
+
onSelect: onSelect,
|
|
11928
|
+
endMonth: endMonthDefault,
|
|
11929
|
+
},
|
|
11930
|
+
range: {
|
|
11931
|
+
mode: 'range',
|
|
11932
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 2,
|
|
11933
|
+
selected: selected,
|
|
11934
|
+
onSelect: onSelect,
|
|
11935
|
+
endMonth: endMonthDefault,
|
|
11936
|
+
},
|
|
11937
|
+
};
|
|
11938
|
+
const modeProps = modeMap[mode];
|
|
11939
|
+
const commonProps = getCommonProps(props);
|
|
11940
|
+
const handleTimeChange = (time) => {
|
|
11941
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
11942
|
+
};
|
|
11943
|
+
const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
|
|
11944
|
+
return (jsxs(Fragment, { children: [hasTimePicker && (jsx("div", { className: "time-picker-wrapper", children: jsxs(Row, { align: "center", children: [jsx(Col, { xs: "content", children: jsx("p", { className: "ma-0", children: "Select Time" }) }), jsx(Col, { children: jsx(TimePicker, { timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange }) })] }) })), jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
11868
11945
|
};
|
|
11869
11946
|
|
|
11870
11947
|
function getNodeName$1(node) {
|
|
@@ -13567,15 +13644,6 @@ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: con
|
|
|
13567
13644
|
(isPortal ? (jsx(FloatingPortal, { id: portalOptions === null || portalOptions === void 0 ? void 0 : portalOptions.rootId, children: tooltipContent })) : (tooltipContent))] }));
|
|
13568
13645
|
}
|
|
13569
13646
|
|
|
13570
|
-
function Menu(_a) {
|
|
13571
|
-
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
13572
|
-
return (jsx("div", Object.assign({ className: classNames('menu', className) }, rest, { children: React__default.Children.map(children, (child) => React__default.isValidElement(child)
|
|
13573
|
-
? React__default.cloneElement(child, {
|
|
13574
|
-
className: classNames(child.props.className, 'menu-item'),
|
|
13575
|
-
})
|
|
13576
|
-
: child) })));
|
|
13577
|
-
}
|
|
13578
|
-
|
|
13579
13647
|
const IconTriggerDatePicker = (props) => {
|
|
13580
13648
|
const { ariaLabel, className, isDisabled, disableBeforeDate, disableAfterDate, id, label, onSelect, selected, triggerIcon, triggerIconSize, mode, isOpen, clearOnClose, initialMonth } = props, rest = __rest(props, ["ariaLabel", "className", "isDisabled", "disableBeforeDate", "disableAfterDate", "id", "label", "onSelect", "selected", "triggerIcon", "triggerIconSize", "mode", "isOpen", "clearOnClose", "initialMonth"]);
|
|
13581
13649
|
const [localMonth, setLocalMonth] = useState(initialMonth !== null && initialMonth !== void 0 ? initialMonth : new Date());
|
|
@@ -19023,6 +19091,66 @@ function SingleInputDatePicker(props) {
|
|
|
19023
19091
|
return (jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, children: [jsx(LabeledInput, { id: inputId, value: localTextValue, placeholder: inputPlaceholder, isDisabled: isDisabled, iconName: inputIconName, isClearable: isClearable, onChange: handleInputChange, errorMessage: errorMessage, label: 'Single Date Picker', name: 'Date Picker' }), jsx(DatePicker, Object.assign({ captionLayout: captionLayout, mode: "single", selected: selected, onSelect: handleDayPickerSelect, month: localMonth, onMonthChange: setLocalMonth }, rest))] }));
|
|
19024
19092
|
}
|
|
19025
19093
|
|
|
19094
|
+
const Form = (_a) => {
|
|
19095
|
+
var { children, onSubmit, action, method, target, autocomplete, noValidate, enctype, rel } = _a, rest = __rest(_a, ["children", "onSubmit", "action", "method", "target", "autocomplete", "noValidate", "enctype", "rel"]);
|
|
19096
|
+
const handleSubmit = (e) => {
|
|
19097
|
+
e.preventDefault(); // Prevent the default form submission
|
|
19098
|
+
// Create a FormData object, passing in the form (e.currentTarget)
|
|
19099
|
+
const formData = new FormData(e.currentTarget);
|
|
19100
|
+
// Convert FormData into a plain object
|
|
19101
|
+
const formObject = Array.from(formData.entries()).reduce((obj, [key, value]) => {
|
|
19102
|
+
obj[key] = value.toString();
|
|
19103
|
+
return obj;
|
|
19104
|
+
}, {});
|
|
19105
|
+
// Call the onSubmit prop, if provided, passing the form object instead of the event
|
|
19106
|
+
if (onSubmit) {
|
|
19107
|
+
onSubmit(formObject); // Modified to pass formObject instead of e
|
|
19108
|
+
}
|
|
19109
|
+
};
|
|
19110
|
+
return (jsx("form", Object.assign({ onSubmit: handleSubmit, action: action, method: method, target: target, autoComplete: autocomplete, noValidate: noValidate, encType: enctype, rel: rel }, rest, { children: children })));
|
|
19111
|
+
};
|
|
19112
|
+
|
|
19113
|
+
const Skeleton = (_a) => {
|
|
19114
|
+
var { className, height, width, isCircle, isFullHeight } = _a, rest = __rest(_a, ["className", "height", "width", "isCircle", "isFullHeight"]);
|
|
19115
|
+
const dynamicStyle = Object.assign(Object.assign({}, (height && { height: typeof height === 'number' ? `${height}px` : height })), (width && { width: typeof width === 'number' ? `${width}px` : width }));
|
|
19116
|
+
const circleClass = isCircle ? 'skeleton--circle' : '';
|
|
19117
|
+
const fullHeightClass = isFullHeight ? 'skeleton--full-height' : '';
|
|
19118
|
+
const combinedClassName = `skeleton ${circleClass} ${fullHeightClass} ${className || ''}`.trim();
|
|
19119
|
+
return jsx("div", Object.assign({ className: combinedClassName, style: dynamicStyle }, rest));
|
|
19120
|
+
};
|
|
19121
|
+
|
|
19122
|
+
const Card = (_a) => {
|
|
19123
|
+
var { className = '', children, title, subtitle, hasBoxShadow = false } = _a, rest = __rest(_a, ["className", "children", "title", "subtitle", "hasBoxShadow"]);
|
|
19124
|
+
const cardClasses = y$1('card', { 'card--box-shadow': hasBoxShadow }, className);
|
|
19125
|
+
return (jsxs("div", Object.assign({ className: cardClasses }, rest, { children: [(title || subtitle) && (jsxs("div", { className: "card__header", children: [title && jsx("h2", { children: title }), subtitle && jsx("p", { children: subtitle })] })), jsx("div", { className: "card__content", children: children })] })));
|
|
19126
|
+
};
|
|
19127
|
+
|
|
19128
|
+
function Menu(_a) {
|
|
19129
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
19130
|
+
return (jsx("div", Object.assign({ className: y$1('menu', className) }, rest, { children: React__default.Children.map(children, (child) => React__default.isValidElement(child)
|
|
19131
|
+
? React__default.cloneElement(child, {
|
|
19132
|
+
className: y$1(child.props.className, 'menu-item'),
|
|
19133
|
+
})
|
|
19134
|
+
: child) })));
|
|
19135
|
+
}
|
|
19136
|
+
|
|
19137
|
+
const Pill = (_a) => {
|
|
19138
|
+
var { children, className, color = 'info', size = 'sm' } = _a, rest = __rest(_a, ["children", "className", "color", "size"]);
|
|
19139
|
+
const pillClasses = y$1('pill', className, {
|
|
19140
|
+
[`pill--${color}`]: color,
|
|
19141
|
+
[`pill--${size}`]: size,
|
|
19142
|
+
});
|
|
19143
|
+
return (jsx("div", Object.assign({ className: pillClasses }, rest, { children: children })));
|
|
19144
|
+
};
|
|
19145
|
+
|
|
19146
|
+
const Badge = (_a) => {
|
|
19147
|
+
var { className = '', children, size = 'md', string } = _a, rest = __rest(_a, ["className", "children", "size", "string"]);
|
|
19148
|
+
const badgeClasses = y$1('badge', {
|
|
19149
|
+
[`badge--${size}`]: size,
|
|
19150
|
+
}, className);
|
|
19151
|
+
return (jsx("div", Object.assign({ className: badgeClasses }, rest, { children: string ? jsx("p", { children: string }) : children })));
|
|
19152
|
+
};
|
|
19153
|
+
|
|
19026
19154
|
var lib = {exports: {}};
|
|
19027
19155
|
|
|
19028
19156
|
var Modal$2 = {};
|
|
@@ -20845,19 +20973,11 @@ const Modal = (_a) => {
|
|
|
20845
20973
|
var { className = '', children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement = document.getElementById('theme-root') ||
|
|
20846
20974
|
document.getElementById('root') ||
|
|
20847
20975
|
document.body, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position = 'center', parentSelector } = _a, rest = __rest(_a, ["className", "children", "isOpen", "onRequestClose", "portalClassName", "overlayClassName", "appElement", "shouldCloseOnOverlayClick", "shouldCloseOnEsc", "testId", "contentElement", "overlayElement", "position", "parentSelector"]);
|
|
20848
|
-
const modalClasses =
|
|
20849
|
-
const overlayClasses =
|
|
20976
|
+
const modalClasses = y$1('modal', `modal--${position}`, className);
|
|
20977
|
+
const overlayClasses = y$1('modal-overlay', overlayClassName);
|
|
20850
20978
|
return (jsx(ReactModal, Object.assign({ style: {}, className: modalClasses, overlayClassName: overlayClasses, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement }, rest, { children: jsxs("div", { className: "modal-content", children: [jsx(Button$1, { className: "modal-close-button", onClick: onRequestClose, variant: "link", size: "md", iconLeft: "x-close", ariaLabel: "Close" }), jsx("div", { className: "modal-body", children: children })] }) })));
|
|
20851
20979
|
};
|
|
20852
20980
|
|
|
20853
|
-
const Badge = (_a) => {
|
|
20854
|
-
var { className = '', children, size = 'md', string } = _a, rest = __rest(_a, ["className", "children", "size", "string"]);
|
|
20855
|
-
const badgeClasses = classNames('badge', {
|
|
20856
|
-
[`badge--${size}`]: size,
|
|
20857
|
-
}, className);
|
|
20858
|
-
return (jsx("div", Object.assign({ className: badgeClasses }, rest, { children: string ? jsx("p", { children: string }) : children })));
|
|
20859
|
-
};
|
|
20860
|
-
|
|
20861
20981
|
/**
|
|
20862
20982
|
* table-core
|
|
20863
20983
|
*
|
|
@@ -23870,7 +23990,7 @@ function ActionBar({ table, TableActions, className, children, }) {
|
|
|
23870
23990
|
row.toggleSelected(false);
|
|
23871
23991
|
});
|
|
23872
23992
|
};
|
|
23873
|
-
return (jsx(Card, { className:
|
|
23993
|
+
return (jsx(Card, { className: y$1('tanstack-table__action-bar', className), children: children !== null && children !== void 0 ? children : (jsx("div", { className: "tanstack-table__action-bar__container", children: TableActions && (jsx("div", { className: "tanstack-table__action-bar__button-container", children: jsx(TableActions, { selectedItems: selectedItems, unselectRows: unselectRows }) })) })) }));
|
|
23874
23994
|
}
|
|
23875
23995
|
|
|
23876
23996
|
function NoResults({ clearFilters, hasFilters, message }) {
|
|
@@ -41155,7 +41275,7 @@ const TableHeader = forwardRef(({ table }, ref) => {
|
|
|
41155
41275
|
return (jsx(Fragment, { children: table.getHeaderGroups().map((headerGroup) => (jsx("tr", { children: headerGroup.headers.map((header) => {
|
|
41156
41276
|
var _a, _b, _c;
|
|
41157
41277
|
const { column } = header;
|
|
41158
|
-
return (jsx("th", { className:
|
|
41278
|
+
return (jsx("th", { className: y$1('tanstack-table__thead__th', {
|
|
41159
41279
|
'pa-0': !!((_c = (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.hasNoPadding),
|
|
41160
41280
|
}), ref: (el) => {
|
|
41161
41281
|
if (el)
|
|
@@ -41170,14 +41290,14 @@ function CirclePulse(_a) {
|
|
|
41170
41290
|
}
|
|
41171
41291
|
|
|
41172
41292
|
const TableBody = ({ table, onRowClick, isLoading, columnsLength, activeRows, }) => {
|
|
41173
|
-
return (jsxs(Fragment, { children: [table.getRowModel().rows.map((row) => (jsx("tr", { className:
|
|
41293
|
+
return (jsxs(Fragment, { children: [table.getRowModel().rows.map((row) => (jsx("tr", { className: y$1('tanstack-table__tbody__tr', {
|
|
41174
41294
|
'is-selected': row.getIsSelected(),
|
|
41175
41295
|
'show-hover': !!onRowClick,
|
|
41176
41296
|
'is-clicked': activeRows.includes(row.id), // Checkbox Is clicked
|
|
41177
41297
|
}), children: row.getVisibleCells().map((cell) => {
|
|
41178
41298
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41179
41299
|
const { columnDef } = cell.column;
|
|
41180
|
-
return (jsx("td", { className:
|
|
41300
|
+
return (jsx("td", { className: y$1('tanstack-table__tbody__td', {
|
|
41181
41301
|
'pa-0': !!((_c = (_b = (_a = columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.cell) === null || _c === void 0 ? void 0 : _c.hasNoPadding),
|
|
41182
41302
|
}), style: Object.assign({}, getTdStyles(cell.column, (_f = (_e = (_d = columnDef.meta) === null || _d === void 0 ? void 0 : _d.styles) === null || _e === void 0 ? void 0 : _e.cell) === null || _f === void 0 ? void 0 : _f.textAlign, (_h = (_g = columnDef.meta) === null || _g === void 0 ? void 0 : _g.styles) === null || _h === void 0 ? void 0 : _h.definedColumnSize, cell.column.getSize())), onClick: () => {
|
|
41183
41303
|
var _a, _b, _c;
|
|
@@ -41186,7 +41306,7 @@ const TableBody = ({ table, onRowClick, isLoading, columnsLength, activeRows, })
|
|
|
41186
41306
|
onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row);
|
|
41187
41307
|
}
|
|
41188
41308
|
}, children: flexRender(columnDef.cell, cell.getContext()) }, cell.id));
|
|
41189
|
-
}) }, row.id))), isLoading && (jsx("tr", { className: "tanstack-table__tbody__tr", children: jsx("td", { className:
|
|
41309
|
+
}) }, row.id))), isLoading && (jsx("tr", { className: "tanstack-table__tbody__tr", children: jsx("td", { className: y$1('tanstack-table__centered-row', {
|
|
41190
41310
|
'is-Loading': isLoading,
|
|
41191
41311
|
}), colSpan: columnsLength, children: jsx(CirclePulse, { "data-testid": "loading-indicator" }) }) }))] }));
|
|
41192
41312
|
};
|
|
@@ -41232,7 +41352,7 @@ function TanstackTable(_a) {
|
|
|
41232
41352
|
}
|
|
41233
41353
|
return (jsx(TableBody, { table: table, onRowClick: onRowClick, isLoading: isLoading, columnsLength: columns.length, activeRows: activeRows }));
|
|
41234
41354
|
};
|
|
41235
|
-
return (jsxs("div", { className: "tanstack-table__outer-container", children: [jsxs("div", { className: "tanstack-table__container", children: [jsxs("table", { className:
|
|
41355
|
+
return (jsxs("div", { className: "tanstack-table__outer-container", children: [jsxs("div", { className: "tanstack-table__container", children: [jsxs("table", { className: y$1('tanstack-table', className, {
|
|
41236
41356
|
'is-Loading': isLoading,
|
|
41237
41357
|
}), children: [jsx("thead", { className: "tanstack-table__thead", children: jsx(TableHeader, { table: table, ref: thRefs }) }), jsx("tbody", { className: "tanstack-table__tbody", children: renderBody() })] }), hasSelectedRows && (jsx(ActionBar, { table: table, TableActions: TableActions, className: actionBarClassName }))] }), shouldRenderPagination ? (jsx(TablePagination, { currentPage: currentPage, rowCount: rowCount, onChangePage: onChangePage, rowsPerPage: rowsPerPage, totalEntriesText: totalEntriesText !== null && totalEntriesText !== void 0 ? totalEntriesText : `${totalRowsOnPage} of ${rowCount} entries` })) : null] }));
|
|
41238
41358
|
}
|
|
@@ -42735,7 +42855,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
42735
42855
|
* @copyright ReactTooltip Team
|
|
42736
42856
|
* @license MIT
|
|
42737
42857
|
*/
|
|
42738
|
-
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:!1,base:!1};function S({css:e,id:t=w,type:o="base",ref:r}){var l,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===c&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=!0;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:r="top",offset:l=10,strategy:n="absolute",middlewares:c=[offset(Number(l)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:i})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=c;return o?(s.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:r,strategy:n,middleware:s}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var l,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(l=r.arrow)&&void 0!==l?l:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:s}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_=(e,t,o)=>{let r=null;const l=function(...l){const n=()=>{r=null;};!r&&(e.apply(this,l),r=setTimeout(n,t));};return l.cancel=()=>{r&&(clearTimeout(r),r=null);},l},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,T=(e,t)=>{if(e===t)return !0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>T(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return !1;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),r=Object.keys(t);return o.length===r.length&&o.every((o=>T(e[o],t[o])))},k=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return !1;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},C=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(k(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},L="undefined"!=typeof window?useLayoutEffect:useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=createContext({getTooltipData:()=>x});function I(e=R){return useContext(N).getTooltipData(e)}var B={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},z={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const D=({forwardRef:t,id:r,className:c,classNameArrow:i,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=!1,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:k=!1,hidden:R=!1,noArrow:x=!1,clickable:N=!1,closeOnEsc:$=!1,closeOnScroll:j=!1,closeOnResize:D=!1,openEvents:q,closeEvents:H,globalCloseEvents:M,imperativeModeOnly:W,style:P,position:V,afterShow:F,afterHide:K,content:U,contentWrapperRef:X,isOpen:Y,defaultIsOpen:G=!1,setIsOpen:Z,activeAnchor:J,setActiveAnchor:Q,border:ee,opacity:te,arrowColor:oe,role:re="tooltip"})=>{var le;const ne=useRef(null),ce=useRef(null),ie=useRef(null),se=useRef(null),ae=useRef(null),[ue,de]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=useState(!1),[me,fe]=useState(!1),[ye,he]=useState(null),we=useRef(!1),be=useRef(null),{anchorRefs:Se,setActiveAnchor:ge}=I(r),Ee=useRef(!1),[Ae,_e]=useState([]),Oe=useRef(!1),Te=w||h.includes("click"),ke=Te||(null==q?void 0:q.click)||(null==q?void 0:q.dblclick)||(null==q?void 0:q.mousedown),Ce=q?{...q}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!q&&Te&&Object.assign(Ce,{mouseenter:!1,focus:!1,click:!0});const Le=H?{...H}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!H&&Te&&Object.assign(Le,{mouseleave:!1,blur:!1});const Re=M?{...M}:{escape:$||!1,scroll:j||!1,resize:D||!1,clickOutsideAnchor:ke||!1};W&&(Object.assign(Ce,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Le,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Re,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),L((()=>(Oe.current=!0,()=>{Oe.current=!1;})),[]);const xe=e=>{Oe.current&&(e&&fe(!0),setTimeout((()=>{Oe.current&&(null==Z||Z(e),void 0===Y&&ve(e));}),10));};useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),useEffect((()=>{if(pe!==we.current)if(ae.current&&clearTimeout(ae.current),we.current=pe,pe)null==F||F();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ae.current=setTimeout((()=>{fe(!1),he(null),null==K||K();}),e+25);}}),[pe]);const Ne=e=>{de((t=>T(t,e)?t:e));},$e=(e=A)=>{ie.current&&clearTimeout(ie.current),me?xe(!0):ie.current=setTimeout((()=>{xe(!0);}),e);},Ie=(e=O)=>{se.current&&clearTimeout(se.current),se.current=setTimeout((()=>{Ee.current||xe(!1);}),e);},je=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return Q(null),void ge({current:null});A?$e():xe(!0),Q(o),ge({current:o}),se.current&&clearTimeout(se.current);},Be=()=>{N?Ie(O||100):O?Ie():xe(!1),ie.current&&clearTimeout(ie.current);},ze=({x:e,y:t})=>{var o;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==ye?void 0:ye.place)&&void 0!==o?o:v,offset:m,elementReference:r,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Ne(e);}));},De=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ze(o),be.current=o;},qe=e=>{var t;if(!pe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=ne.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...Ae].some((e=>null==e?void 0:e.contains(o)))||(xe(!1),ie.current&&clearTimeout(ie.current));},He=_(je,50),Me=_(Be,50),We=e=>{Me.cancel(),He(e);},Pe=()=>{He.cancel(),Me();},Ve=useCallback((()=>{var e,t;const o=null!==(e=null==ye?void 0:ye.position)&&void 0!==e?e:V;o?ze(o):k?be.current&&ze(be.current):(null==J?void 0:J.isConnected)&&E({place:null!==(t=null==ye?void 0:ye.place)&&void 0!==t?t:v,offset:m,elementReference:J,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Oe.current&&Ne(e);}));}),[pe,J,U,P,v,null==ye?void 0:ye.place,m,b,V,null==ye?void 0:ye.position,k]);useEffect((()=>{var e,t;const o=new Set(Se);Ae.forEach((e=>{o.add({current:e});}));const r=document.querySelector(`[id='${d}']`);r&&o.add({current:r});const l=()=>{xe(!1);},n=C(J),c=C(ne.current);Re.scroll&&(window.addEventListener("scroll",l),null==n||n.addEventListener("scroll",l),null==c||c.addEventListener("scroll",l));let i=null;Re.resize?window.addEventListener("resize",l):J&&ne.current&&(i=autoUpdate(J,ne.current,Ve,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const s=e=>{"Escape"===e.key&&xe(!1);};Re.escape&&window.addEventListener("keydown",s),Re.clickOutsideAnchor&&window.addEventListener("click",qe);const a=[],u=e=>{pe&&(null==e?void 0:e.target)===J||je(e);},p=e=>{pe&&(null==e?void 0:e.target)===J&&Be();},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Ce).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:We}):m.includes(e)&&a.push({event:e,listener:u}));})),Object.entries(Le).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:Pe}):m.includes(e)&&a.push({event:e,listener:p}));})),k&&a.push({event:"pointermove",listener:De});const y=()=>{Ee.current=!0;},h=()=>{Ee.current=!1,Be();};return N&&!ke&&(null===(e=ne.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.addEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t);}));})),()=>{var e,t;Re.scroll&&(window.removeEventListener("scroll",l),null==n||n.removeEventListener("scroll",l),null==c||c.removeEventListener("scroll",l)),Re.resize?window.removeEventListener("resize",l):null==i||i(),Re.clickOutsideAnchor&&window.removeEventListener("click",qe),Re.escape&&window.removeEventListener("keydown",s),N&&!ke&&(null===(e=ne.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.removeEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t);}));}));}}),[J,Ve,me,Se,Ae,q,H,M,Te,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=[],l=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===r?t.push(e.target):e.oldValue===r&&l.push(e.target);}if("childList"===e.type){if(J){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{l.push(...t.filter((e=>e.matches(o)))),l.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,J))&&(fe(!1),xe(!1),Q(null),ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current),!0)}));}if(o)try{const r=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...r.filter((e=>e.matches(o)))),t.push(...r.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||l.length)&&_e((e=>[...e.filter((e=>!l.includes(e))),...t]));}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect();}}),[r,p,null==ye?void 0:ye.anchorSelect,J]),useEffect((()=>{Ve();}),[Ve]),useEffect((()=>{if(!(null==X?void 0:X.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ve()));}));return e.observe(X.current),()=>{e.disconnect();}}),[U,null==X?void 0:X.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...Ae,t];J&&o.includes(J)||Q(null!==(e=Ae[0])&&void 0!==e?e:t);}),[d,Ae,J]),useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),useEffect((()=>{var e;let t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));_e(e);}catch(e){_e([]);}}),[r,p,null==ye?void 0:ye.anchorSelect]),useEffect((()=>{ie.current&&(clearTimeout(ie.current),$e(A));}),[A]);const Fe=null!==(le=null==ye?void 0:ye.content)&&void 0!==le?le:U,Ke=pe&&Object.keys(ue.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}he(null!=e?e:null),(null==e?void 0:e.delay)?$e(e.delay):xe(!0);},close:e=>{(null==e?void 0:e.delay)?Ie(e.delay):xe(!1);},activeAnchor:J,place:ue.place,isOpen:Boolean(me&&!R&&Fe&&Ke)}))),me&&!R&&Fe?React__default.createElement(g,{id:r,role:re,className:classNames("react-tooltip",B.tooltip,z.tooltip,z[u],c,`react-tooltip__place-${ue.place}`,B[Ke?"show":"closing"],Ke?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B.fixed,N&&B.clickable),onTransitionEnd:e=>{ae.current&&clearTimeout(ae.current),pe||"opacity"!==e.propertyName||(fe(!1),he(null),null==K||K());},style:{...P,...ue.tooltipStyles,opacity:void 0!==te&&Ke?te:void 0},ref:ne},Fe,React__default.createElement(g,{className:classNames("react-tooltip-arrow",B.arrow,z.arrow,i,x&&B.noArrow),style:{...ue.tooltipArrowStyles,background:oe?`linear-gradient(to right bottom, transparent 50%, ${oe} 50%)`:void 0},ref:ce})):null},q=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__default.forwardRef((({id:t,anchorId:r,anchorSelect:n,content:c,html:i,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=!1,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=!1,hidden:T=!1,noArrow:k=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:R=!1,closeOnResize:x=!1,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B=!1,style:z,position:H,isOpen:M,defaultIsOpen:W=!1,disableStyleInjection:P=!1,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,role:G="tooltip"},Z)=>{const[J,Q]=useState(c),[ee,te]=useState(i),[oe,re]=useState(v),[le,ne]=useState(p),[ce,ie]=useState(m),[se,ae]=useState(E),[ue,de]=useState(_),[pe,ve]=useState(O),[me,fe]=useState(T),[ye,he]=useState(f),[we,be]=useState(w),[Se,ge]=useState(S),[Ee,Ae]=useState(null),[_e,Oe]=useState(null),Te=useRef(P),{anchorRefs:ke,activeAnchor:Ce}=I(t),Le=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null;}return t}),{}),Re=e=>{const t={place:e=>{var t;re(null!==(t=e)&&void 0!==t?t:v);},content:e=>{Q(null!=e?e:c);},html:e=>{te(null!=e?e:i);},variant:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ie(null===e?m:Number(e));},wrapper:e=>{var t;he(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");be(null!=t?t:w);},"position-strategy":e=>{var t;ge(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{ae(null===e?E:Number(e));},"delay-hide":e=>{de(null===e?_:Number(e));},float:e=>{ve(null===e?O:"true"===e);},hidden:e=>{fe(null===e?T:"true"===e);},"class-name":e=>{Ae(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o);}));};useEffect((()=>{Q(c);}),[c]),useEffect((()=>{te(i);}),[i]),useEffect((()=>{re(v);}),[v]),useEffect((()=>{ne(p);}),[p]),useEffect((()=>{ie(m);}),[m]),useEffect((()=>{ae(E);}),[E]),useEffect((()=>{de(_);}),[_]),useEffect((()=>{ve(O);}),[O]),useEffect((()=>{fe(T);}),[T]),useEffect((()=>{ge(S);}),[S]),useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(ke);let l=n;if(!l&&t&&(l=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),l)try{document.querySelectorAll(l).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`);}const c=document.querySelector(`[id='${r}']`);if(c&&o.add({current:c}),!o.size)return ()=>null;const i=null!==(e=null!=_e?_e:c)&&void 0!==e?e:Ce.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!i||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Le(i);Re(o);}));})),a={attributes:!0,childList:!1,subtree:!1};if(i){const e=Le(i);Re(e),s.observe(i,a);}return ()=>{s.disconnect();}}),[ke,Ce,_e,r,n]),useEffect((()=>{(null==z?void 0:z.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==z?void 0:z.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let xe=h;const Ne=useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__default.createElement(q,{content:ee}));const $e={forwardRef:Z,id:t,anchorId:r,anchorSelect:n,className:classNames(u,Ee),classNameArrow:d,content:xe,contentWrapperRef:Ne,place:oe,variant:le,offset:ce,wrapper:ye,events:we,openOnClick:b,positionStrategy:Se,middlewares:g,delayShow:se,delayHide:ue,float:pe,hidden:me,noArrow:k,clickable:C,closeOnEsc:L,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B,style:z,position:H,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,activeAnchor:_e,setActiveAnchor:e=>Oe(e),role:G};return React__default.createElement(D,{...$e})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42858
|
+
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:!1,base:!1};function S({css:e,id:t=w,type:o="base",ref:r}){var l,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===c&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=!0;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:r="top",offset:l=10,strategy:n="absolute",middlewares:c=[offset(Number(l)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:i})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=c;return o?(s.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:r,strategy:n,middleware:s}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var l,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(l=r.arrow)&&void 0!==l?l:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:s}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_=(e,t,o)=>{let r=null;const l=function(...l){const n=()=>{r=null;};!r&&(e.apply(this,l),r=setTimeout(n,t));};return l.cancel=()=>{r&&(clearTimeout(r),r=null);},l},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,T=(e,t)=>{if(e===t)return !0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>T(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return !1;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),r=Object.keys(t);return o.length===r.length&&o.every((o=>T(e[o],t[o])))},k=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return !1;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},C=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(k(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},L="undefined"!=typeof window?useLayoutEffect:useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=createContext({getTooltipData:()=>x});function I(e=R){return useContext(N).getTooltipData(e)}var B={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},z={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const D=({forwardRef:t,id:r,className:c,classNameArrow:i,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=!1,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:k=!1,hidden:R=!1,noArrow:x=!1,clickable:N=!1,closeOnEsc:$=!1,closeOnScroll:j=!1,closeOnResize:D=!1,openEvents:q,closeEvents:H,globalCloseEvents:M,imperativeModeOnly:W,style:P,position:V,afterShow:F,afterHide:K,content:U,contentWrapperRef:X,isOpen:Y,defaultIsOpen:G=!1,setIsOpen:Z,activeAnchor:J,setActiveAnchor:Q,border:ee,opacity:te,arrowColor:oe,role:re="tooltip"})=>{var le;const ne=useRef(null),ce=useRef(null),ie=useRef(null),se=useRef(null),ae=useRef(null),[ue,de]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=useState(!1),[me,fe]=useState(!1),[ye,he]=useState(null),we=useRef(!1),be=useRef(null),{anchorRefs:Se,setActiveAnchor:ge}=I(r),Ee=useRef(!1),[Ae,_e]=useState([]),Oe=useRef(!1),Te=w||h.includes("click"),ke=Te||(null==q?void 0:q.click)||(null==q?void 0:q.dblclick)||(null==q?void 0:q.mousedown),Ce=q?{...q}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!q&&Te&&Object.assign(Ce,{mouseenter:!1,focus:!1,click:!0});const Le=H?{...H}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!H&&Te&&Object.assign(Le,{mouseleave:!1,blur:!1});const Re=M?{...M}:{escape:$||!1,scroll:j||!1,resize:D||!1,clickOutsideAnchor:ke||!1};W&&(Object.assign(Ce,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Le,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Re,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),L((()=>(Oe.current=!0,()=>{Oe.current=!1;})),[]);const xe=e=>{Oe.current&&(e&&fe(!0),setTimeout((()=>{Oe.current&&(null==Z||Z(e),void 0===Y&&ve(e));}),10));};useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),useEffect((()=>{if(pe!==we.current)if(ae.current&&clearTimeout(ae.current),we.current=pe,pe)null==F||F();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ae.current=setTimeout((()=>{fe(!1),he(null),null==K||K();}),e+25);}}),[pe]);const Ne=e=>{de((t=>T(t,e)?t:e));},$e=(e=A)=>{ie.current&&clearTimeout(ie.current),me?xe(!0):ie.current=setTimeout((()=>{xe(!0);}),e);},Ie=(e=O)=>{se.current&&clearTimeout(se.current),se.current=setTimeout((()=>{Ee.current||xe(!1);}),e);},je=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return Q(null),void ge({current:null});A?$e():xe(!0),Q(o),ge({current:o}),se.current&&clearTimeout(se.current);},Be=()=>{N?Ie(O||100):O?Ie():xe(!1),ie.current&&clearTimeout(ie.current);},ze=({x:e,y:t})=>{var o;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==ye?void 0:ye.place)&&void 0!==o?o:v,offset:m,elementReference:r,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Ne(e);}));},De=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ze(o),be.current=o;},qe=e=>{var t;if(!pe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=ne.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...Ae].some((e=>null==e?void 0:e.contains(o)))||(xe(!1),ie.current&&clearTimeout(ie.current));},He=_(je,50),Me=_(Be,50),We=e=>{Me.cancel(),He(e);},Pe=()=>{He.cancel(),Me();},Ve=useCallback((()=>{var e,t;const o=null!==(e=null==ye?void 0:ye.position)&&void 0!==e?e:V;o?ze(o):k?be.current&&ze(be.current):(null==J?void 0:J.isConnected)&&E({place:null!==(t=null==ye?void 0:ye.place)&&void 0!==t?t:v,offset:m,elementReference:J,tooltipReference:ne.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:ee}).then((e=>{Oe.current&&Ne(e);}));}),[pe,J,U,P,v,null==ye?void 0:ye.place,m,b,V,null==ye?void 0:ye.position,k]);useEffect((()=>{var e,t;const o=new Set(Se);Ae.forEach((e=>{o.add({current:e});}));const r=document.querySelector(`[id='${d}']`);r&&o.add({current:r});const l=()=>{xe(!1);},n=C(J),c=C(ne.current);Re.scroll&&(window.addEventListener("scroll",l),null==n||n.addEventListener("scroll",l),null==c||c.addEventListener("scroll",l));let i=null;Re.resize?window.addEventListener("resize",l):J&&ne.current&&(i=autoUpdate(J,ne.current,Ve,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const s=e=>{"Escape"===e.key&&xe(!1);};Re.escape&&window.addEventListener("keydown",s),Re.clickOutsideAnchor&&window.addEventListener("click",qe);const a=[],u=e=>{pe&&(null==e?void 0:e.target)===J||je(e);},p=e=>{pe&&(null==e?void 0:e.target)===J&&Be();},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Ce).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:We}):m.includes(e)&&a.push({event:e,listener:u}));})),Object.entries(Le).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:Pe}):m.includes(e)&&a.push({event:e,listener:p}));})),k&&a.push({event:"pointermove",listener:De});const y=()=>{Ee.current=!0;},h=()=>{Ee.current=!1,Be();};return N&&!ke&&(null===(e=ne.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.addEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t);}));})),()=>{var e,t;Re.scroll&&(window.removeEventListener("scroll",l),null==n||n.removeEventListener("scroll",l),null==c||c.removeEventListener("scroll",l)),Re.resize?window.removeEventListener("resize",l):null==i||i(),Re.clickOutsideAnchor&&window.removeEventListener("click",qe),Re.escape&&window.removeEventListener("keydown",s),N&&!ke&&(null===(e=ne.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ne.current)||void 0===t||t.removeEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t);}));}));}}),[J,Ve,me,Se,Ae,q,H,M,Te,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=[],l=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===r?t.push(e.target):e.oldValue===r&&l.push(e.target);}if("childList"===e.type){if(J){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{l.push(...t.filter((e=>e.matches(o)))),l.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,J))&&(fe(!1),xe(!1),Q(null),ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current),!0)}));}if(o)try{const r=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...r.filter((e=>e.matches(o)))),t.push(...r.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||l.length)&&_e((e=>[...e.filter((e=>!l.includes(e))),...t]));}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect();}}),[r,p,null==ye?void 0:ye.anchorSelect,J]),useEffect((()=>{Ve();}),[Ve]),useEffect((()=>{if(!(null==X?void 0:X.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ve()));}));return e.observe(X.current),()=>{e.disconnect();}}),[U,null==X?void 0:X.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...Ae,t];J&&o.includes(J)||Q(null!==(e=Ae[0])&&void 0!==e?e:t);}),[d,Ae,J]),useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),useEffect((()=>{var e;let t=null!==(e=null==ye?void 0:ye.anchorSelect)&&void 0!==e?e:p;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));_e(e);}catch(e){_e([]);}}),[r,p,null==ye?void 0:ye.anchorSelect]),useEffect((()=>{ie.current&&(clearTimeout(ie.current),$e(A));}),[A]);const Fe=null!==(le=null==ye?void 0:ye.content)&&void 0!==le?le:U,Ke=pe&&Object.keys(ue.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}he(null!=e?e:null),(null==e?void 0:e.delay)?$e(e.delay):xe(!0);},close:e=>{(null==e?void 0:e.delay)?Ie(e.delay):xe(!1);},activeAnchor:J,place:ue.place,isOpen:Boolean(me&&!R&&Fe&&Ke)}))),me&&!R&&Fe?React__default.createElement(g,{id:r,role:re,className:y$1("react-tooltip",B.tooltip,z.tooltip,z[u],c,`react-tooltip__place-${ue.place}`,B[Ke?"show":"closing"],Ke?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B.fixed,N&&B.clickable),onTransitionEnd:e=>{ae.current&&clearTimeout(ae.current),pe||"opacity"!==e.propertyName||(fe(!1),he(null),null==K||K());},style:{...P,...ue.tooltipStyles,opacity:void 0!==te&&Ke?te:void 0},ref:ne},Fe,React__default.createElement(g,{className:y$1("react-tooltip-arrow",B.arrow,z.arrow,i,x&&B.noArrow),style:{...ue.tooltipArrowStyles,background:oe?`linear-gradient(to right bottom, transparent 50%, ${oe} 50%)`:void 0},ref:ce})):null},q=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__default.forwardRef((({id:t,anchorId:r,anchorSelect:n,content:c,html:i,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=!1,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=!1,hidden:T=!1,noArrow:k=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:R=!1,closeOnResize:x=!1,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B=!1,style:z,position:H,isOpen:M,defaultIsOpen:W=!1,disableStyleInjection:P=!1,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,role:G="tooltip"},Z)=>{const[J,Q]=useState(c),[ee,te]=useState(i),[oe,re]=useState(v),[le,ne]=useState(p),[ce,ie]=useState(m),[se,ae]=useState(E),[ue,de]=useState(_),[pe,ve]=useState(O),[me,fe]=useState(T),[ye,he]=useState(f),[we,be]=useState(w),[Se,ge]=useState(S),[Ee,Ae]=useState(null),[_e,Oe]=useState(null),Te=useRef(P),{anchorRefs:ke,activeAnchor:Ce}=I(t),Le=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null;}return t}),{}),Re=e=>{const t={place:e=>{var t;re(null!==(t=e)&&void 0!==t?t:v);},content:e=>{Q(null!=e?e:c);},html:e=>{te(null!=e?e:i);},variant:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ie(null===e?m:Number(e));},wrapper:e=>{var t;he(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");be(null!=t?t:w);},"position-strategy":e=>{var t;ge(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{ae(null===e?E:Number(e));},"delay-hide":e=>{de(null===e?_:Number(e));},float:e=>{ve(null===e?O:"true"===e);},hidden:e=>{fe(null===e?T:"true"===e);},"class-name":e=>{Ae(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o);}));};useEffect((()=>{Q(c);}),[c]),useEffect((()=>{te(i);}),[i]),useEffect((()=>{re(v);}),[v]),useEffect((()=>{ne(p);}),[p]),useEffect((()=>{ie(m);}),[m]),useEffect((()=>{ae(E);}),[E]),useEffect((()=>{de(_);}),[_]),useEffect((()=>{ve(O);}),[O]),useEffect((()=>{fe(T);}),[T]),useEffect((()=>{ge(S);}),[S]),useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(ke);let l=n;if(!l&&t&&(l=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),l)try{document.querySelectorAll(l).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`);}const c=document.querySelector(`[id='${r}']`);if(c&&o.add({current:c}),!o.size)return ()=>null;const i=null!==(e=null!=_e?_e:c)&&void 0!==e?e:Ce.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!i||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Le(i);Re(o);}));})),a={attributes:!0,childList:!1,subtree:!1};if(i){const e=Le(i);Re(e),s.observe(i,a);}return ()=>{s.disconnect();}}),[ke,Ce,_e,r,n]),useEffect((()=>{(null==z?void 0:z.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==z?void 0:z.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let xe=h;const Ne=useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__default.createElement(q,{content:ee}));const $e={forwardRef:Z,id:t,anchorId:r,anchorSelect:n,className:y$1(u,Ee),classNameArrow:d,content:xe,contentWrapperRef:Ne,place:oe,variant:le,offset:ce,wrapper:ye,events:we,openOnClick:b,positionStrategy:Se,middlewares:g,delayShow:se,delayHide:ue,float:pe,hidden:me,noArrow:k,clickable:C,closeOnEsc:L,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:j,imperativeModeOnly:B,style:z,position:H,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,activeAnchor:_e,setActiveAnchor:e=>Oe(e),role:G};return React__default.createElement(D,{...$e})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42739
42859
|
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"});}));
|
|
42740
42860
|
|
|
42741
42861
|
const Tooltip = (_a) => {
|
|
@@ -42754,104 +42874,5 @@ function BarSpinner(_a) {
|
|
|
42754
42874
|
return (jsx("div", Object.assign({ className: `bar-spinner ${className}`, id: id, style: style }, rest, { children: jsx("span", {}) })));
|
|
42755
42875
|
}
|
|
42756
42876
|
|
|
42757
|
-
const hourOptions = Array.from({ length: 12 }, (_, i) => {
|
|
42758
|
-
const num = `${i + 1}`;
|
|
42759
|
-
return {
|
|
42760
|
-
label: num,
|
|
42761
|
-
value: num,
|
|
42762
|
-
};
|
|
42763
|
-
});
|
|
42764
|
-
const minuteOptions = Array.from({ length: 60 }, (_, i) => {
|
|
42765
|
-
const num = `${i}`.padStart(2, '0');
|
|
42766
|
-
return {
|
|
42767
|
-
label: num,
|
|
42768
|
-
value: num,
|
|
42769
|
-
};
|
|
42770
|
-
});
|
|
42771
|
-
const periodOptions = [
|
|
42772
|
-
{ label: 'AM', value: 'am' },
|
|
42773
|
-
{ label: 'PM', value: 'pm' },
|
|
42774
|
-
];
|
|
42775
|
-
|
|
42776
|
-
// Parse initial time value
|
|
42777
|
-
const parseTimeValue = (time) => {
|
|
42778
|
-
if (!time)
|
|
42779
|
-
return { hours: '12', minutes: '00', period: 'am' };
|
|
42780
|
-
const match = time.match(/(\d{1,2}):(\d{2})\s*(am|pm)/i);
|
|
42781
|
-
if (!match)
|
|
42782
|
-
return { hours: '12', minutes: '00', period: 'am' };
|
|
42783
|
-
const [, hours, minutes, period] = match;
|
|
42784
|
-
return {
|
|
42785
|
-
hours: hours,
|
|
42786
|
-
minutes: minutes,
|
|
42787
|
-
period: period.toLowerCase(),
|
|
42788
|
-
};
|
|
42789
|
-
};
|
|
42790
|
-
|
|
42791
|
-
const TimePicker = ({ timeValue = '', label = 'Time Picker', onTimeChange, }) => {
|
|
42792
|
-
const initialTime = parseTimeValue(timeValue);
|
|
42793
|
-
const [hours, setHours] = useState(initialTime.hours);
|
|
42794
|
-
const [minutes, setMinutes] = useState(initialTime.minutes);
|
|
42795
|
-
const [period, setPeriod] = useState(initialTime.period);
|
|
42796
|
-
const handleHourChange = (option) => {
|
|
42797
|
-
setHours((option === null || option === void 0 ? void 0 : option.value) || '12');
|
|
42798
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${(option === null || option === void 0 ? void 0 : option.value) || '12'}:${minutes} ${period.toUpperCase()}`);
|
|
42799
|
-
};
|
|
42800
|
-
const handleMinuteChange = (option) => {
|
|
42801
|
-
setMinutes((option === null || option === void 0 ? void 0 : option.value) || '00');
|
|
42802
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${hours}:${(option === null || option === void 0 ? void 0 : option.value) || '00'} ${period.toUpperCase()}`);
|
|
42803
|
-
};
|
|
42804
|
-
const handlePeriodChange = (option) => {
|
|
42805
|
-
setPeriod((option === null || option === void 0 ? void 0 : option.value) || 'am');
|
|
42806
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${hours}:${minutes} ${((option === null || option === void 0 ? void 0 : option.value) || 'am').toUpperCase()}`);
|
|
42807
|
-
};
|
|
42808
|
-
return (jsx("div", { className: "time-input-wrapper", children: jsxs(FloatUI, { ariaLabel: label, children: [jsx(LabeledInput, { "data-testid": "time-picker-input", name: "hours", label: label, hasHiddenLabel: true, value: `${hours}:${minutes} ${period.toUpperCase()}`, readonly: true, className: "time-picker-input" }), jsxs(Row, { gutterWidth: 0, className: "time-picker-row", children: [jsx(Col, { xs: "content", children: jsx(Select$1, { menuIsOpen: true, className: "hour-menu", components: { DropdownIndicator: () => null, IndicatorSeparator: () => null }, name: "hours", value: { label: hours, value: hours }, onChange: handleHourChange, options: hourOptions }) }), jsx(Col, { xs: "content", children: jsx(Select$1, { className: "minute-menu", components: { DropdownIndicator: () => null, IndicatorSeparator: () => null }, name: "minutes", options: minuteOptions, menuIsOpen: true, value: { label: minutes.padStart(2, '0'), value: minutes }, onChange: handleMinuteChange }) }), jsx(Col, { xs: "content", children: jsx(Select$1, { menuIsOpen: true, className: "period-menu", components: { DropdownIndicator: () => null, IndicatorSeparator: () => null }, name: "period", options: periodOptions, value: { label: period.toUpperCase(), value: period }, onChange: handlePeriodChange }) })] })] }) }));
|
|
42809
|
-
};
|
|
42810
|
-
|
|
42811
|
-
const DatePicker = (props) => {
|
|
42812
|
-
const { mode = 'single', className, captionLayout = 'dropdown', selected, hasTimePicker = false, id, month, defaultMonth, startMonth, endMonth, components, numberOfMonths, isDisabled, formatters, weekStartsOn, firstWeekContainsDate, today, timeValue, isRequired, min, max, onTimeChange, onSelect, onMonthChange, onNextClick, onPrevClick, onDayClick } = props, rest = __rest(props, ["mode", "className", "captionLayout", "selected", "hasTimePicker", "id", "month", "defaultMonth", "startMonth", "endMonth", "components", "numberOfMonths", "isDisabled", "formatters", "weekStartsOn", "firstWeekContainsDate", "today", "timeValue", "isRequired", "min", "max", "onTimeChange", "onSelect", "onMonthChange", "onNextClick", "onPrevClick", "onDayClick"]);
|
|
42813
|
-
const futureDateByYear = (year) => new Date(new Date().getFullYear() + year, 11, 31);
|
|
42814
|
-
const endMonthDefault = endMonth !== null && endMonth !== void 0 ? endMonth : futureDateByYear(5);
|
|
42815
|
-
const modeMap = {
|
|
42816
|
-
single: {
|
|
42817
|
-
mode: 'single',
|
|
42818
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
42819
|
-
selected: selected,
|
|
42820
|
-
onSelect: onSelect,
|
|
42821
|
-
endMonth: endMonthDefault,
|
|
42822
|
-
},
|
|
42823
|
-
multiple: {
|
|
42824
|
-
mode: 'multiple',
|
|
42825
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
42826
|
-
selected: selected,
|
|
42827
|
-
onSelect: onSelect,
|
|
42828
|
-
endMonth: endMonthDefault,
|
|
42829
|
-
},
|
|
42830
|
-
range: {
|
|
42831
|
-
mode: 'range',
|
|
42832
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 2,
|
|
42833
|
-
selected: selected,
|
|
42834
|
-
onSelect: onSelect,
|
|
42835
|
-
endMonth: endMonthDefault,
|
|
42836
|
-
},
|
|
42837
|
-
};
|
|
42838
|
-
const modeProps = modeMap[mode];
|
|
42839
|
-
const commonProps = getCommonProps(props);
|
|
42840
|
-
const handleTimeChange = (time) => {
|
|
42841
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
42842
|
-
};
|
|
42843
|
-
const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
|
|
42844
|
-
return (jsxs(Fragment, { children: [hasTimePicker && (jsx("div", { className: "time-picker-wrapper", children: jsxs(Row, { align: "center", children: [jsx(Col, { xs: "content", children: jsx("p", { className: "ma-0", children: "Select Time" }) }), jsx(Col, { children: jsx(TimePicker, { timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange }) })] }) })), jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
42845
|
-
};
|
|
42846
|
-
|
|
42847
|
-
const Pill = (_a) => {
|
|
42848
|
-
var { children, className, color = 'info', size = 'sm' } = _a, rest = __rest(_a, ["children", "className", "color", "size"]);
|
|
42849
|
-
const pillClasses = classNames('pill', className, {
|
|
42850
|
-
[`pill--${color}`]: color,
|
|
42851
|
-
[`pill--${size}`]: size,
|
|
42852
|
-
});
|
|
42853
|
-
return (jsx("div", Object.assign({ className: pillClasses }, rest, { children: children })));
|
|
42854
|
-
};
|
|
42855
|
-
|
|
42856
42877
|
export { Badge, BarSpinner, Button$1 as Button, Card, Checkbox, CirclePulse, Col, Container, DatePicker, FloatUI, Form, Icon, IconTriggerDatePicker, LabeledInput as Input, Menu, Modal, Pagination, LabeledPasswordInput as PasswordInput, Pill, Radio as RadioInput, Row, Select$1 as SelectInput, SingleInputDatePicker, Skeleton, Table, TanstackTable, LabeledTextarea as Textarea, TimePicker, Toggle as ToggleInput, Tooltip, arrow$2 as arrow, autoPlacement, autoUpdate$1 as autoUpdate, computePosition$2 as computePosition, detectOverflow$1 as detectOverflow, flip$2 as flip, getOverflowAncestors$1 as getOverflowAncestors, hide$1 as hide, inline, limitShift, offset$2 as offset, platform$1 as platform, registerFontAwesomeIcons, shift$2 as shift, size, useFloating$1 as useFloating };
|
|
42857
42878
|
//# sourceMappingURL=index.esm.js.map
|