@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.js
CHANGED
|
@@ -5038,12 +5038,12 @@ var classnames = {exports: {}};
|
|
|
5038
5038
|
} (classnames));
|
|
5039
5039
|
|
|
5040
5040
|
var classnamesExports = classnames.exports;
|
|
5041
|
-
var
|
|
5041
|
+
var y$1 = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
5042
5042
|
|
|
5043
5043
|
const Icon = (_a) => {
|
|
5044
5044
|
var { name, size = 'md', className, ariaLabel } = _a, props = __rest(_a, ["name", "size", "className", "ariaLabel"]);
|
|
5045
5045
|
const label = ariaLabel || `${name} Icon`;
|
|
5046
|
-
const iconClasses =
|
|
5046
|
+
const iconClasses = y$1('icon', {
|
|
5047
5047
|
[`icon--${size}`]: size,
|
|
5048
5048
|
}, className);
|
|
5049
5049
|
const faIconName = name.split('fa-')[1];
|
|
@@ -5068,7 +5068,7 @@ const Icon = (_a) => {
|
|
|
5068
5068
|
|
|
5069
5069
|
const Button$1 = React.forwardRef((props, ref) => {
|
|
5070
5070
|
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"]);
|
|
5071
|
-
const buttonClasses =
|
|
5071
|
+
const buttonClasses = y$1('btn', {
|
|
5072
5072
|
[`btn--${variant}`]: variant,
|
|
5073
5073
|
[`btn--${size}`]: size,
|
|
5074
5074
|
'btn--icon-only': !children && (iconLeft || iconRight),
|
|
@@ -5486,8 +5486,9 @@ function withLabel(WrappedComponent) {
|
|
|
5486
5486
|
return React.forwardRef(WithLabelComponent);
|
|
5487
5487
|
}
|
|
5488
5488
|
|
|
5489
|
-
const DisplayFormError = (
|
|
5490
|
-
|
|
5489
|
+
const DisplayFormError = (_a) => {
|
|
5490
|
+
var { message } = _a, rest = __rest(_a, ["message"]);
|
|
5491
|
+
return (jsxRuntime.jsx("p", Object.assign({ className: "form-errors" }, rest, { children: message })));
|
|
5491
5492
|
};
|
|
5492
5493
|
|
|
5493
5494
|
const Input = React__namespace.default.forwardRef((_a, ref) => {
|
|
@@ -5496,11 +5497,11 @@ const Input = React__namespace.default.forwardRef((_a, ref) => {
|
|
|
5496
5497
|
const handleClear = () => {
|
|
5497
5498
|
onChange === null || onChange === void 0 ? void 0 : onChange({ target: { value: '' } });
|
|
5498
5499
|
};
|
|
5499
|
-
const inputClasses =
|
|
5500
|
+
const inputClasses = y$1('input', {
|
|
5500
5501
|
error: hasErrors,
|
|
5501
5502
|
'input--has-icon': iconName,
|
|
5502
5503
|
}, className);
|
|
5503
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "input-wrapper", children: [iconName && (jsxRuntime.jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsxRuntime.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 && (jsxRuntime.jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsxRuntime.jsx(DisplayFormError, { message: errorMessage }), helpText && (jsxRuntime.jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5504
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "input-wrapper", children: [iconName && (jsxRuntime.jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsxRuntime.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 && (jsxRuntime.jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsxRuntime.jsx(DisplayFormError, { "data-testid": `${name}-error`, message: errorMessage }), helpText && (jsxRuntime.jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5504
5505
|
});
|
|
5505
5506
|
const LabeledInput = withLabel(Input);
|
|
5506
5507
|
|
|
@@ -5508,7 +5509,7 @@ const Pagination = (_a) => {
|
|
|
5508
5509
|
var { totalPages, currentPage = 1, onChange, className } = _a, rest = __rest(_a, ["totalPages", "currentPage", "onChange", "className"]);
|
|
5509
5510
|
const [inputValue, setInputValue] = React.useState(currentPage.toString());
|
|
5510
5511
|
const totalPagesText = `of ${totalPages}`;
|
|
5511
|
-
const classes =
|
|
5512
|
+
const classes = y$1('pagination', className);
|
|
5512
5513
|
React.useEffect(() => {
|
|
5513
5514
|
setInputValue(currentPage.toString());
|
|
5514
5515
|
}, [currentPage]);
|
|
@@ -5539,7 +5540,7 @@ const Pagination = (_a) => {
|
|
|
5539
5540
|
const isNextButtonDisabled = currentPage === totalPages;
|
|
5540
5541
|
const isPreviousButtonDisabled = currentPage === 1;
|
|
5541
5542
|
const hasError = Number(inputValue) > totalPages || Number(inputValue) < 1;
|
|
5542
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: classes }, rest, { children: jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs(Row, { gutterWidth: 12, align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("div", { className: "pagination__previous", children: jsxRuntime.jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", isDisabled: isPreviousButtonDisabled }) }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("div", { className: "pagination__current-page", children: jsxRuntime.jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className:
|
|
5543
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classes }, rest, { children: jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs(Row, { gutterWidth: 12, align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("div", { className: "pagination__previous", children: jsxRuntime.jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", isDisabled: isPreviousButtonDisabled }) }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("div", { className: "pagination__current-page", children: jsxRuntime.jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className: y$1('pagination__current-page-input', {
|
|
5543
5544
|
'has-error': hasError,
|
|
5544
5545
|
}), value: inputValue, name: "currentPage", label: "Current Page", hasHiddenLabel: true, onKeyDown: (e) => {
|
|
5545
5546
|
if (e.key === 'Enter') {
|
|
@@ -5787,11 +5788,11 @@ const Table = (props) => {
|
|
|
5787
5788
|
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"]);
|
|
5788
5789
|
// Turns on/off column pinning.
|
|
5789
5790
|
const { columnsWithPinning } = usePinnedColumnsManager(initialColumns, canPinColumns, onPinnedColumnsChange);
|
|
5790
|
-
const combinedClassName =
|
|
5791
|
+
const combinedClassName = y$1(className, {
|
|
5791
5792
|
'table--striped': striped,
|
|
5792
5793
|
'table-body': true,
|
|
5793
5794
|
});
|
|
5794
|
-
const tableWrapperClassName =
|
|
5795
|
+
const tableWrapperClassName = y$1('table', {
|
|
5795
5796
|
'table--full-height': isFullHeight,
|
|
5796
5797
|
});
|
|
5797
5798
|
return (jsxRuntime.jsx("div", { className: tableWrapperClassName, "data-testid": "table", children: jsxRuntime.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: jsxRuntime.jsx(LoadingComponent, {}), pagination: true, paginationComponent: (props) => (jsxRuntime.jsx(TablePagination$1, Object.assign({}, props, { totalEntriesText: totalEntriesText }))), paginationTotalRows: paginationTotalRows, highlightOnHover: true, pointerOnHover: true }, rest)) }));
|
|
@@ -5815,7 +5816,7 @@ const Toggle = React__namespace.default.forwardRef((_a, ref) => {
|
|
|
5815
5816
|
const Textarea = React__namespace.default.forwardRef((_a, ref) => {
|
|
5816
5817
|
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"]);
|
|
5817
5818
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
5818
|
-
const textareaClasses =
|
|
5819
|
+
const textareaClasses = y$1('textarea', { error: hasErrors });
|
|
5819
5820
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "textarea-wrapper", children: jsxRuntime.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 && jsxRuntime.jsx(DisplayFormError, { message: errorMessage }), helpText && (jsxRuntime.jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5820
5821
|
});
|
|
5821
5822
|
const LabeledTextarea = withLabel(Textarea);
|
|
@@ -5827,7 +5828,7 @@ const PasswordInput = React__namespace.default.forwardRef((_a, ref) => {
|
|
|
5827
5828
|
const handleShowPassword = () => {
|
|
5828
5829
|
setShowPassword((prevShowPassword) => !prevShowPassword);
|
|
5829
5830
|
};
|
|
5830
|
-
const inputClasses =
|
|
5831
|
+
const inputClasses = y$1('password-input', {
|
|
5831
5832
|
error: hasErrors,
|
|
5832
5833
|
}, 'password-input--has-icon');
|
|
5833
5834
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "password-input-wrapper", children: [jsxRuntime.jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon" }), jsxRuntime.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 && (jsxRuntime.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 && jsxRuntime.jsx(DisplayFormError, { message: errorMessage }), helpText && (jsxRuntime.jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
@@ -5845,7 +5846,7 @@ const Select$1 = (_a) => {
|
|
|
5845
5846
|
Option: OptionComponent,
|
|
5846
5847
|
};
|
|
5847
5848
|
const mergedComponents = Object.assign(Object.assign({}, defaultComponents), customComponents);
|
|
5848
|
-
return (jsxRuntime.jsx(ReactSelect__default.default, Object.assign({ classNamePrefix: classNamePrefix, className:
|
|
5849
|
+
return (jsxRuntime.jsx(ReactSelect__default.default, Object.assign({ classNamePrefix: classNamePrefix, className: y$1('select-wrapper', className), components: mergedComponents }, props)));
|
|
5849
5850
|
};
|
|
5850
5851
|
|
|
5851
5852
|
/**
|
|
@@ -11858,38 +11859,114 @@ const getCommonProps = (props) => {
|
|
|
11858
11859
|
});
|
|
11859
11860
|
};
|
|
11860
11861
|
|
|
11861
|
-
const
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11862
|
+
const formatTimeValue = (value) => {
|
|
11863
|
+
if (!value || value.trim() === '') {
|
|
11864
|
+
return '';
|
|
11865
|
+
}
|
|
11866
|
+
// Normalize the input
|
|
11867
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
11868
|
+
// Extract time components using regex
|
|
11869
|
+
const timeRegex = /^(0?[1-9]|1[0-2]):([0-5][0-9])(\s*)([ap]m)$/i;
|
|
11870
|
+
const matches = normalizedValue.match(timeRegex);
|
|
11871
|
+
if (matches) {
|
|
11872
|
+
const hours = parseInt(matches[1], 10);
|
|
11873
|
+
const minutes = parseInt(matches[2], 10);
|
|
11874
|
+
const period = matches[4].toUpperCase(); // Convert am/pm to AM/PM
|
|
11875
|
+
// Format as hh:mm AM/PM
|
|
11876
|
+
return `${hours}:${minutes < 10 ? '0' + minutes : minutes} ${period}`;
|
|
11877
|
+
}
|
|
11878
|
+
return value; // Return original if no match (shouldn't happen with valid inputs)
|
|
11879
|
+
};
|
|
11880
|
+
const validateInputValue = (value) => {
|
|
11881
|
+
if (!value || value.trim() === '') {
|
|
11882
|
+
return ''; // Empty input is allowed
|
|
11883
|
+
}
|
|
11884
|
+
// Normalize the input (remove extra spaces, convert to lowercase)
|
|
11885
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
11886
|
+
// Regular expression for valid time formats: 1:10 pm, 01:10 pm, 1:10pm, 01:10pm
|
|
11887
|
+
const timeRegex = /^(0?[1-9]|1[0-2]):([0-5][0-9])(\s*)([ap]m)$/i;
|
|
11888
|
+
if (!timeRegex.test(normalizedValue)) {
|
|
11889
|
+
// Check if the issue might be a 24-hour format
|
|
11890
|
+
const hour24Regex = /^([13-9]|1[3-9]|2[0-3]):/i;
|
|
11891
|
+
if (hour24Regex.test(normalizedValue)) {
|
|
11892
|
+
return 'Please enter time in 12-hour format (e.g., 1:10 pm)';
|
|
11875
11893
|
}
|
|
11876
|
-
|
|
11877
|
-
|
|
11894
|
+
return 'Please enter a valid time format (e.g., 1:10 pm)';
|
|
11895
|
+
}
|
|
11896
|
+
// Extract hours and minutes for additional validation
|
|
11897
|
+
const matches = normalizedValue.match(timeRegex);
|
|
11898
|
+
if (matches) {
|
|
11899
|
+
const hours = parseInt(matches[1], 10);
|
|
11900
|
+
const minutes = parseInt(matches[2], 10);
|
|
11901
|
+
if (hours < 1 || hours > 12) {
|
|
11902
|
+
return 'Hours must be between 1 and 12';
|
|
11903
|
+
}
|
|
11904
|
+
if (minutes < 0 || minutes > 59) {
|
|
11905
|
+
return 'Minutes must be between 0 and 59';
|
|
11906
|
+
}
|
|
11907
|
+
}
|
|
11908
|
+
return ''; // Valid time format
|
|
11878
11909
|
};
|
|
11879
11910
|
|
|
11880
|
-
const
|
|
11881
|
-
|
|
11882
|
-
const
|
|
11883
|
-
const
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11911
|
+
const TimePicker = ({ timeValue = '', label = 'Time Picker', name = 'time-picker', hasHiddenLabel = false, onTimeChange, }) => {
|
|
11912
|
+
const [validationError, setValidationError] = React.useState('');
|
|
11913
|
+
const [inputValue, setInputValue] = React.useState(timeValue);
|
|
11914
|
+
const handleTimeChange = (e) => {
|
|
11915
|
+
const newValue = e.target.value;
|
|
11916
|
+
const error = validateInputValue(newValue);
|
|
11917
|
+
setInputValue(newValue);
|
|
11918
|
+
setValidationError(error);
|
|
11919
|
+
// Only send valid values to parent component
|
|
11920
|
+
if (!error || error === '') {
|
|
11921
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(newValue);
|
|
11922
|
+
}
|
|
11923
|
+
};
|
|
11924
|
+
const handleBlur = (e) => {
|
|
11925
|
+
const currentValue = e.target.value;
|
|
11926
|
+
// Only format if there's no validation error
|
|
11927
|
+
if (validationError === '' && currentValue.trim() !== '') {
|
|
11928
|
+
const formattedValue = formatTimeValue(currentValue);
|
|
11929
|
+
setInputValue(formattedValue);
|
|
11930
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(formattedValue);
|
|
11931
|
+
}
|
|
11932
|
+
};
|
|
11933
|
+
return (jsxRuntime.jsx("div", { className: "time-input-wrapper", children: jsxRuntime.jsx(LabeledInput, { "data-testid": `${name}-input`, label: label, hasHiddenLabel: hasHiddenLabel, value: inputValue, maxLength: 8, onChange: handleTimeChange, onBlur: handleBlur, name: name, errorMessage: validationError }) }));
|
|
11887
11934
|
};
|
|
11888
11935
|
|
|
11889
|
-
const
|
|
11890
|
-
|
|
11891
|
-
const
|
|
11892
|
-
|
|
11936
|
+
const DatePicker = (props) => {
|
|
11937
|
+
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"]);
|
|
11938
|
+
const futureDateByYear = (year) => new Date(new Date().getFullYear() + year, 11, 31);
|
|
11939
|
+
const endMonthDefault = endMonth !== null && endMonth !== void 0 ? endMonth : futureDateByYear(5);
|
|
11940
|
+
const modeMap = {
|
|
11941
|
+
single: {
|
|
11942
|
+
mode: 'single',
|
|
11943
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
11944
|
+
selected: selected,
|
|
11945
|
+
onSelect: onSelect,
|
|
11946
|
+
endMonth: endMonthDefault,
|
|
11947
|
+
},
|
|
11948
|
+
multiple: {
|
|
11949
|
+
mode: 'multiple',
|
|
11950
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
11951
|
+
selected: selected,
|
|
11952
|
+
onSelect: onSelect,
|
|
11953
|
+
endMonth: endMonthDefault,
|
|
11954
|
+
},
|
|
11955
|
+
range: {
|
|
11956
|
+
mode: 'range',
|
|
11957
|
+
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 2,
|
|
11958
|
+
selected: selected,
|
|
11959
|
+
onSelect: onSelect,
|
|
11960
|
+
endMonth: endMonthDefault,
|
|
11961
|
+
},
|
|
11962
|
+
};
|
|
11963
|
+
const modeProps = modeMap[mode];
|
|
11964
|
+
const commonProps = getCommonProps(props);
|
|
11965
|
+
const handleTimeChange = (time) => {
|
|
11966
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
11967
|
+
};
|
|
11968
|
+
const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
|
|
11969
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasTimePicker && (jsxRuntime.jsx("div", { className: "time-picker-wrapper", children: jsxRuntime.jsxs(Row, { align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("p", { className: "ma-0", children: "Select Time" }) }), jsxRuntime.jsx(Col, { children: jsxRuntime.jsx(TimePicker, { timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange }) })] }) })), jsxRuntime.jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
11893
11970
|
};
|
|
11894
11971
|
|
|
11895
11972
|
function getNodeName$1(node) {
|
|
@@ -13592,15 +13669,6 @@ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: con
|
|
|
13592
13669
|
(isPortal ? (jsxRuntime.jsx(FloatingPortal, { id: portalOptions === null || portalOptions === void 0 ? void 0 : portalOptions.rootId, children: tooltipContent })) : (tooltipContent))] }));
|
|
13593
13670
|
}
|
|
13594
13671
|
|
|
13595
|
-
function Menu(_a) {
|
|
13596
|
-
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
13597
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('menu', className) }, rest, { children: React__namespace.default.Children.map(children, (child) => React__namespace.default.isValidElement(child)
|
|
13598
|
-
? React__namespace.default.cloneElement(child, {
|
|
13599
|
-
className: classNames(child.props.className, 'menu-item'),
|
|
13600
|
-
})
|
|
13601
|
-
: child) })));
|
|
13602
|
-
}
|
|
13603
|
-
|
|
13604
13672
|
const IconTriggerDatePicker = (props) => {
|
|
13605
13673
|
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"]);
|
|
13606
13674
|
const [localMonth, setLocalMonth] = React.useState(initialMonth !== null && initialMonth !== void 0 ? initialMonth : new Date());
|
|
@@ -19048,6 +19116,66 @@ function SingleInputDatePicker(props) {
|
|
|
19048
19116
|
return (jsxRuntime.jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, children: [jsxRuntime.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' }), jsxRuntime.jsx(DatePicker, Object.assign({ captionLayout: captionLayout, mode: "single", selected: selected, onSelect: handleDayPickerSelect, month: localMonth, onMonthChange: setLocalMonth }, rest))] }));
|
|
19049
19117
|
}
|
|
19050
19118
|
|
|
19119
|
+
const Form = (_a) => {
|
|
19120
|
+
var { children, onSubmit, action, method, target, autocomplete, noValidate, enctype, rel } = _a, rest = __rest(_a, ["children", "onSubmit", "action", "method", "target", "autocomplete", "noValidate", "enctype", "rel"]);
|
|
19121
|
+
const handleSubmit = (e) => {
|
|
19122
|
+
e.preventDefault(); // Prevent the default form submission
|
|
19123
|
+
// Create a FormData object, passing in the form (e.currentTarget)
|
|
19124
|
+
const formData = new FormData(e.currentTarget);
|
|
19125
|
+
// Convert FormData into a plain object
|
|
19126
|
+
const formObject = Array.from(formData.entries()).reduce((obj, [key, value]) => {
|
|
19127
|
+
obj[key] = value.toString();
|
|
19128
|
+
return obj;
|
|
19129
|
+
}, {});
|
|
19130
|
+
// Call the onSubmit prop, if provided, passing the form object instead of the event
|
|
19131
|
+
if (onSubmit) {
|
|
19132
|
+
onSubmit(formObject); // Modified to pass formObject instead of e
|
|
19133
|
+
}
|
|
19134
|
+
};
|
|
19135
|
+
return (jsxRuntime.jsx("form", Object.assign({ onSubmit: handleSubmit, action: action, method: method, target: target, autoComplete: autocomplete, noValidate: noValidate, encType: enctype, rel: rel }, rest, { children: children })));
|
|
19136
|
+
};
|
|
19137
|
+
|
|
19138
|
+
const Skeleton = (_a) => {
|
|
19139
|
+
var { className, height, width, isCircle, isFullHeight } = _a, rest = __rest(_a, ["className", "height", "width", "isCircle", "isFullHeight"]);
|
|
19140
|
+
const dynamicStyle = Object.assign(Object.assign({}, (height && { height: typeof height === 'number' ? `${height}px` : height })), (width && { width: typeof width === 'number' ? `${width}px` : width }));
|
|
19141
|
+
const circleClass = isCircle ? 'skeleton--circle' : '';
|
|
19142
|
+
const fullHeightClass = isFullHeight ? 'skeleton--full-height' : '';
|
|
19143
|
+
const combinedClassName = `skeleton ${circleClass} ${fullHeightClass} ${className || ''}`.trim();
|
|
19144
|
+
return jsxRuntime.jsx("div", Object.assign({ className: combinedClassName, style: dynamicStyle }, rest));
|
|
19145
|
+
};
|
|
19146
|
+
|
|
19147
|
+
const Card = (_a) => {
|
|
19148
|
+
var { className = '', children, title, subtitle, hasBoxShadow = false } = _a, rest = __rest(_a, ["className", "children", "title", "subtitle", "hasBoxShadow"]);
|
|
19149
|
+
const cardClasses = y$1('card', { 'card--box-shadow': hasBoxShadow }, className);
|
|
19150
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: cardClasses }, rest, { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: "card__header", children: [title && jsxRuntime.jsx("h2", { children: title }), subtitle && jsxRuntime.jsx("p", { children: subtitle })] })), jsxRuntime.jsx("div", { className: "card__content", children: children })] })));
|
|
19151
|
+
};
|
|
19152
|
+
|
|
19153
|
+
function Menu(_a) {
|
|
19154
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
19155
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: y$1('menu', className) }, rest, { children: React__namespace.default.Children.map(children, (child) => React__namespace.default.isValidElement(child)
|
|
19156
|
+
? React__namespace.default.cloneElement(child, {
|
|
19157
|
+
className: y$1(child.props.className, 'menu-item'),
|
|
19158
|
+
})
|
|
19159
|
+
: child) })));
|
|
19160
|
+
}
|
|
19161
|
+
|
|
19162
|
+
const Pill = (_a) => {
|
|
19163
|
+
var { children, className, color = 'info', size = 'sm' } = _a, rest = __rest(_a, ["children", "className", "color", "size"]);
|
|
19164
|
+
const pillClasses = y$1('pill', className, {
|
|
19165
|
+
[`pill--${color}`]: color,
|
|
19166
|
+
[`pill--${size}`]: size,
|
|
19167
|
+
});
|
|
19168
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: pillClasses }, rest, { children: children })));
|
|
19169
|
+
};
|
|
19170
|
+
|
|
19171
|
+
const Badge = (_a) => {
|
|
19172
|
+
var { className = '', children, size = 'md', string } = _a, rest = __rest(_a, ["className", "children", "size", "string"]);
|
|
19173
|
+
const badgeClasses = y$1('badge', {
|
|
19174
|
+
[`badge--${size}`]: size,
|
|
19175
|
+
}, className);
|
|
19176
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: badgeClasses }, rest, { children: string ? jsxRuntime.jsx("p", { children: string }) : children })));
|
|
19177
|
+
};
|
|
19178
|
+
|
|
19051
19179
|
var lib = {exports: {}};
|
|
19052
19180
|
|
|
19053
19181
|
var Modal$2 = {};
|
|
@@ -20870,19 +20998,11 @@ const Modal = (_a) => {
|
|
|
20870
20998
|
var { className = '', children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement = document.getElementById('theme-root') ||
|
|
20871
20999
|
document.getElementById('root') ||
|
|
20872
21000
|
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"]);
|
|
20873
|
-
const modalClasses =
|
|
20874
|
-
const overlayClasses =
|
|
21001
|
+
const modalClasses = y$1('modal', `modal--${position}`, className);
|
|
21002
|
+
const overlayClasses = y$1('modal-overlay', overlayClassName);
|
|
20875
21003
|
return (jsxRuntime.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: jsxRuntime.jsxs("div", { className: "modal-content", children: [jsxRuntime.jsx(Button$1, { className: "modal-close-button", onClick: onRequestClose, variant: "link", size: "md", iconLeft: "x-close", ariaLabel: "Close" }), jsxRuntime.jsx("div", { className: "modal-body", children: children })] }) })));
|
|
20876
21004
|
};
|
|
20877
21005
|
|
|
20878
|
-
const Badge = (_a) => {
|
|
20879
|
-
var { className = '', children, size = 'md', string } = _a, rest = __rest(_a, ["className", "children", "size", "string"]);
|
|
20880
|
-
const badgeClasses = classNames('badge', {
|
|
20881
|
-
[`badge--${size}`]: size,
|
|
20882
|
-
}, className);
|
|
20883
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: badgeClasses }, rest, { children: string ? jsxRuntime.jsx("p", { children: string }) : children })));
|
|
20884
|
-
};
|
|
20885
|
-
|
|
20886
21006
|
/**
|
|
20887
21007
|
* table-core
|
|
20888
21008
|
*
|
|
@@ -23895,7 +24015,7 @@ function ActionBar({ table, TableActions, className, children, }) {
|
|
|
23895
24015
|
row.toggleSelected(false);
|
|
23896
24016
|
});
|
|
23897
24017
|
};
|
|
23898
|
-
return (jsxRuntime.jsx(Card, { className:
|
|
24018
|
+
return (jsxRuntime.jsx(Card, { className: y$1('tanstack-table__action-bar', className), children: children !== null && children !== void 0 ? children : (jsxRuntime.jsx("div", { className: "tanstack-table__action-bar__container", children: TableActions && (jsxRuntime.jsx("div", { className: "tanstack-table__action-bar__button-container", children: jsxRuntime.jsx(TableActions, { selectedItems: selectedItems, unselectRows: unselectRows }) })) })) }));
|
|
23899
24019
|
}
|
|
23900
24020
|
|
|
23901
24021
|
function NoResults({ clearFilters, hasFilters, message }) {
|
|
@@ -41180,7 +41300,7 @@ const TableHeader = React.forwardRef(({ table }, ref) => {
|
|
|
41180
41300
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: table.getHeaderGroups().map((headerGroup) => (jsxRuntime.jsx("tr", { children: headerGroup.headers.map((header) => {
|
|
41181
41301
|
var _a, _b, _c;
|
|
41182
41302
|
const { column } = header;
|
|
41183
|
-
return (jsxRuntime.jsx("th", { className:
|
|
41303
|
+
return (jsxRuntime.jsx("th", { className: y$1('tanstack-table__thead__th', {
|
|
41184
41304
|
'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),
|
|
41185
41305
|
}), ref: (el) => {
|
|
41186
41306
|
if (el)
|
|
@@ -41195,14 +41315,14 @@ function CirclePulse(_a) {
|
|
|
41195
41315
|
}
|
|
41196
41316
|
|
|
41197
41317
|
const TableBody = ({ table, onRowClick, isLoading, columnsLength, activeRows, }) => {
|
|
41198
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [table.getRowModel().rows.map((row) => (jsxRuntime.jsx("tr", { className:
|
|
41318
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [table.getRowModel().rows.map((row) => (jsxRuntime.jsx("tr", { className: y$1('tanstack-table__tbody__tr', {
|
|
41199
41319
|
'is-selected': row.getIsSelected(),
|
|
41200
41320
|
'show-hover': !!onRowClick,
|
|
41201
41321
|
'is-clicked': activeRows.includes(row.id), // Checkbox Is clicked
|
|
41202
41322
|
}), children: row.getVisibleCells().map((cell) => {
|
|
41203
41323
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41204
41324
|
const { columnDef } = cell.column;
|
|
41205
|
-
return (jsxRuntime.jsx("td", { className:
|
|
41325
|
+
return (jsxRuntime.jsx("td", { className: y$1('tanstack-table__tbody__td', {
|
|
41206
41326
|
'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),
|
|
41207
41327
|
}), 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: () => {
|
|
41208
41328
|
var _a, _b, _c;
|
|
@@ -41211,7 +41331,7 @@ const TableBody = ({ table, onRowClick, isLoading, columnsLength, activeRows, })
|
|
|
41211
41331
|
onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row);
|
|
41212
41332
|
}
|
|
41213
41333
|
}, children: flexRender(columnDef.cell, cell.getContext()) }, cell.id));
|
|
41214
|
-
}) }, row.id))), isLoading && (jsxRuntime.jsx("tr", { className: "tanstack-table__tbody__tr", children: jsxRuntime.jsx("td", { className:
|
|
41334
|
+
}) }, row.id))), isLoading && (jsxRuntime.jsx("tr", { className: "tanstack-table__tbody__tr", children: jsxRuntime.jsx("td", { className: y$1('tanstack-table__centered-row', {
|
|
41215
41335
|
'is-Loading': isLoading,
|
|
41216
41336
|
}), colSpan: columnsLength, children: jsxRuntime.jsx(CirclePulse, { "data-testid": "loading-indicator" }) }) }))] }));
|
|
41217
41337
|
};
|
|
@@ -41257,7 +41377,7 @@ function TanstackTable(_a) {
|
|
|
41257
41377
|
}
|
|
41258
41378
|
return (jsxRuntime.jsx(TableBody, { table: table, onRowClick: onRowClick, isLoading: isLoading, columnsLength: columns.length, activeRows: activeRows }));
|
|
41259
41379
|
};
|
|
41260
|
-
return (jsxRuntime.jsxs("div", { className: "tanstack-table__outer-container", children: [jsxRuntime.jsxs("div", { className: "tanstack-table__container", children: [jsxRuntime.jsxs("table", { className:
|
|
41380
|
+
return (jsxRuntime.jsxs("div", { className: "tanstack-table__outer-container", children: [jsxRuntime.jsxs("div", { className: "tanstack-table__container", children: [jsxRuntime.jsxs("table", { className: y$1('tanstack-table', className, {
|
|
41261
41381
|
'is-Loading': isLoading,
|
|
41262
41382
|
}), children: [jsxRuntime.jsx("thead", { className: "tanstack-table__thead", children: jsxRuntime.jsx(TableHeader, { table: table, ref: thRefs }) }), jsxRuntime.jsx("tbody", { className: "tanstack-table__tbody", children: renderBody() })] }), hasSelectedRows && (jsxRuntime.jsx(ActionBar, { table: table, TableActions: TableActions, className: actionBarClassName }))] }), shouldRenderPagination ? (jsxRuntime.jsx(TablePagination, { currentPage: currentPage, rowCount: rowCount, onChangePage: onChangePage, rowsPerPage: rowsPerPage, totalEntriesText: totalEntriesText !== null && totalEntriesText !== void 0 ? totalEntriesText : `${totalRowsOnPage} of ${rowCount} entries` })) : null] }));
|
|
41263
41383
|
}
|
|
@@ -42760,7 +42880,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
42760
42880
|
* @copyright ReactTooltip Team
|
|
42761
42881
|
* @license MIT
|
|
42762
42882
|
*/
|
|
42763
|
-
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?React.useLayoutEffect:React.useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=React.createContext({getTooltipData:()=>x});function I(e=R){return React.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=React.useRef(null),ce=React.useRef(null),ie=React.useRef(null),se=React.useRef(null),ae=React.useRef(null),[ue,de]=React.useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=React.useState(!1),[me,fe]=React.useState(!1),[ye,he]=React.useState(null),we=React.useRef(!1),be=React.useRef(null),{anchorRefs:Se,setActiveAnchor:ge}=I(r),Ee=React.useRef(!1),[Ae,_e]=React.useState([]),Oe=React.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));};React.useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),React.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=React.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]);React.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]),React.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]),React.useEffect((()=>{Ve();}),[Ve]),React.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]),React.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]),React.useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),React.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]),React.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 React.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__namespace.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__namespace.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__namespace.default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__namespace.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]=React.useState(c),[ee,te]=React.useState(i),[oe,re]=React.useState(v),[le,ne]=React.useState(p),[ce,ie]=React.useState(m),[se,ae]=React.useState(E),[ue,de]=React.useState(_),[pe,ve]=React.useState(O),[me,fe]=React.useState(T),[ye,he]=React.useState(f),[we,be]=React.useState(w),[Se,ge]=React.useState(S),[Ee,Ae]=React.useState(null),[_e,Oe]=React.useState(null),Te=React.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);}));};React.useEffect((()=>{Q(c);}),[c]),React.useEffect((()=>{te(i);}),[i]),React.useEffect((()=>{re(v);}),[v]),React.useEffect((()=>{ne(p);}),[p]),React.useEffect((()=>{ie(m);}),[m]),React.useEffect((()=>{ae(E);}),[E]),React.useEffect((()=>{de(_);}),[_]),React.useEffect((()=>{ve(O);}),[O]),React.useEffect((()=>{fe(T);}),[T]),React.useEffect((()=>{ge(S);}),[S]),React.useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),React.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),React.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]),React.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=React.useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__namespace.default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__namespace.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__namespace.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:`
|
|
42883
|
+
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?React.useLayoutEffect:React.useEffect,R="DEFAULT_TOOLTIP_ID",x={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},N=React.createContext({getTooltipData:()=>x});function I(e=R){return React.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=React.useRef(null),ce=React.useRef(null),ie=React.useRef(null),se=React.useRef(null),ae=React.useRef(null),[ue,de]=React.useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[pe,ve]=React.useState(!1),[me,fe]=React.useState(!1),[ye,he]=React.useState(null),we=React.useRef(!1),be=React.useRef(null),{anchorRefs:Se,setActiveAnchor:ge}=I(r),Ee=React.useRef(!1),[Ae,_e]=React.useState([]),Oe=React.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));};React.useEffect((()=>{if(void 0===Y)return ()=>null;Y&&fe(!0);const e=setTimeout((()=>{ve(Y);}),10);return ()=>{clearTimeout(e);}}),[Y]),React.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=React.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]);React.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]),React.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]),React.useEffect((()=>{Ve();}),[Ve]),React.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]),React.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]),React.useEffect((()=>(G&&xe(!0),()=>{ie.current&&clearTimeout(ie.current),se.current&&clearTimeout(se.current);})),[]),React.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]),React.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 React.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__namespace.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__namespace.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__namespace.default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),H=React__namespace.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]=React.useState(c),[ee,te]=React.useState(i),[oe,re]=React.useState(v),[le,ne]=React.useState(p),[ce,ie]=React.useState(m),[se,ae]=React.useState(E),[ue,de]=React.useState(_),[pe,ve]=React.useState(O),[me,fe]=React.useState(T),[ye,he]=React.useState(f),[we,be]=React.useState(w),[Se,ge]=React.useState(S),[Ee,Ae]=React.useState(null),[_e,Oe]=React.useState(null),Te=React.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);}));};React.useEffect((()=>{Q(c);}),[c]),React.useEffect((()=>{te(i);}),[i]),React.useEffect((()=>{re(v);}),[v]),React.useEffect((()=>{ne(p);}),[p]),React.useEffect((()=>{ie(m);}),[m]),React.useEffect((()=>{ae(E);}),[E]),React.useEffect((()=>{de(_);}),[_]),React.useEffect((()=>{ve(O);}),[O]),React.useEffect((()=>{fe(T);}),[T]),React.useEffect((()=>{ge(S);}),[S]),React.useEffect((()=>{Te.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),React.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),React.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]),React.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=React.useRef(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?React__namespace.default.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null;}else J&&(xe=J);ee&&(xe=React__namespace.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__namespace.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:`
|
|
42764
42884
|
.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"});}));
|
|
42765
42885
|
|
|
42766
42886
|
const Tooltip = (_a) => {
|
|
@@ -42779,105 +42899,6 @@ function BarSpinner(_a) {
|
|
|
42779
42899
|
return (jsxRuntime.jsx("div", Object.assign({ className: `bar-spinner ${className}`, id: id, style: style }, rest, { children: jsxRuntime.jsx("span", {}) })));
|
|
42780
42900
|
}
|
|
42781
42901
|
|
|
42782
|
-
const hourOptions = Array.from({ length: 12 }, (_, i) => {
|
|
42783
|
-
const num = `${i + 1}`;
|
|
42784
|
-
return {
|
|
42785
|
-
label: num,
|
|
42786
|
-
value: num,
|
|
42787
|
-
};
|
|
42788
|
-
});
|
|
42789
|
-
const minuteOptions = Array.from({ length: 60 }, (_, i) => {
|
|
42790
|
-
const num = `${i}`.padStart(2, '0');
|
|
42791
|
-
return {
|
|
42792
|
-
label: num,
|
|
42793
|
-
value: num,
|
|
42794
|
-
};
|
|
42795
|
-
});
|
|
42796
|
-
const periodOptions = [
|
|
42797
|
-
{ label: 'AM', value: 'am' },
|
|
42798
|
-
{ label: 'PM', value: 'pm' },
|
|
42799
|
-
];
|
|
42800
|
-
|
|
42801
|
-
// Parse initial time value
|
|
42802
|
-
const parseTimeValue = (time) => {
|
|
42803
|
-
if (!time)
|
|
42804
|
-
return { hours: '12', minutes: '00', period: 'am' };
|
|
42805
|
-
const match = time.match(/(\d{1,2}):(\d{2})\s*(am|pm)/i);
|
|
42806
|
-
if (!match)
|
|
42807
|
-
return { hours: '12', minutes: '00', period: 'am' };
|
|
42808
|
-
const [, hours, minutes, period] = match;
|
|
42809
|
-
return {
|
|
42810
|
-
hours: hours,
|
|
42811
|
-
minutes: minutes,
|
|
42812
|
-
period: period.toLowerCase(),
|
|
42813
|
-
};
|
|
42814
|
-
};
|
|
42815
|
-
|
|
42816
|
-
const TimePicker = ({ timeValue = '', label = 'Time Picker', onTimeChange, }) => {
|
|
42817
|
-
const initialTime = parseTimeValue(timeValue);
|
|
42818
|
-
const [hours, setHours] = React.useState(initialTime.hours);
|
|
42819
|
-
const [minutes, setMinutes] = React.useState(initialTime.minutes);
|
|
42820
|
-
const [period, setPeriod] = React.useState(initialTime.period);
|
|
42821
|
-
const handleHourChange = (option) => {
|
|
42822
|
-
setHours((option === null || option === void 0 ? void 0 : option.value) || '12');
|
|
42823
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${(option === null || option === void 0 ? void 0 : option.value) || '12'}:${minutes} ${period.toUpperCase()}`);
|
|
42824
|
-
};
|
|
42825
|
-
const handleMinuteChange = (option) => {
|
|
42826
|
-
setMinutes((option === null || option === void 0 ? void 0 : option.value) || '00');
|
|
42827
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${hours}:${(option === null || option === void 0 ? void 0 : option.value) || '00'} ${period.toUpperCase()}`);
|
|
42828
|
-
};
|
|
42829
|
-
const handlePeriodChange = (option) => {
|
|
42830
|
-
setPeriod((option === null || option === void 0 ? void 0 : option.value) || 'am');
|
|
42831
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(`${hours}:${minutes} ${((option === null || option === void 0 ? void 0 : option.value) || 'am').toUpperCase()}`);
|
|
42832
|
-
};
|
|
42833
|
-
return (jsxRuntime.jsx("div", { className: "time-input-wrapper", children: jsxRuntime.jsxs(FloatUI, { ariaLabel: label, children: [jsxRuntime.jsx(LabeledInput, { "data-testid": "time-picker-input", name: "hours", label: label, hasHiddenLabel: true, value: `${hours}:${minutes} ${period.toUpperCase()}`, readonly: true, className: "time-picker-input" }), jsxRuntime.jsxs(Row, { gutterWidth: 0, className: "time-picker-row", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx(Select$1, { menuIsOpen: true, className: "hour-menu", components: { DropdownIndicator: () => null, IndicatorSeparator: () => null }, name: "hours", value: { label: hours, value: hours }, onChange: handleHourChange, options: hourOptions }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.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 }) }), jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.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 }) })] })] }) }));
|
|
42834
|
-
};
|
|
42835
|
-
|
|
42836
|
-
const DatePicker = (props) => {
|
|
42837
|
-
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"]);
|
|
42838
|
-
const futureDateByYear = (year) => new Date(new Date().getFullYear() + year, 11, 31);
|
|
42839
|
-
const endMonthDefault = endMonth !== null && endMonth !== void 0 ? endMonth : futureDateByYear(5);
|
|
42840
|
-
const modeMap = {
|
|
42841
|
-
single: {
|
|
42842
|
-
mode: 'single',
|
|
42843
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
42844
|
-
selected: selected,
|
|
42845
|
-
onSelect: onSelect,
|
|
42846
|
-
endMonth: endMonthDefault,
|
|
42847
|
-
},
|
|
42848
|
-
multiple: {
|
|
42849
|
-
mode: 'multiple',
|
|
42850
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 1,
|
|
42851
|
-
selected: selected,
|
|
42852
|
-
onSelect: onSelect,
|
|
42853
|
-
endMonth: endMonthDefault,
|
|
42854
|
-
},
|
|
42855
|
-
range: {
|
|
42856
|
-
mode: 'range',
|
|
42857
|
-
numberOfMonths: numberOfMonths !== null && numberOfMonths !== void 0 ? numberOfMonths : 2,
|
|
42858
|
-
selected: selected,
|
|
42859
|
-
onSelect: onSelect,
|
|
42860
|
-
endMonth: endMonthDefault,
|
|
42861
|
-
},
|
|
42862
|
-
};
|
|
42863
|
-
const modeProps = modeMap[mode];
|
|
42864
|
-
const commonProps = getCommonProps(props);
|
|
42865
|
-
const handleTimeChange = (time) => {
|
|
42866
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
42867
|
-
};
|
|
42868
|
-
const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
|
|
42869
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasTimePicker && (jsxRuntime.jsx("div", { className: "time-picker-wrapper", children: jsxRuntime.jsxs(Row, { align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("p", { className: "ma-0", children: "Select Time" }) }), jsxRuntime.jsx(Col, { children: jsxRuntime.jsx(TimePicker, { timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange }) })] }) })), jsxRuntime.jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
42870
|
-
};
|
|
42871
|
-
|
|
42872
|
-
const Pill = (_a) => {
|
|
42873
|
-
var { children, className, color = 'info', size = 'sm' } = _a, rest = __rest(_a, ["children", "className", "color", "size"]);
|
|
42874
|
-
const pillClasses = classNames('pill', className, {
|
|
42875
|
-
[`pill--${color}`]: color,
|
|
42876
|
-
[`pill--${size}`]: size,
|
|
42877
|
-
});
|
|
42878
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: pillClasses }, rest, { children: children })));
|
|
42879
|
-
};
|
|
42880
|
-
|
|
42881
42902
|
exports.Badge = Badge;
|
|
42882
42903
|
exports.BarSpinner = BarSpinner;
|
|
42883
42904
|
exports.Button = Button$1;
|