@iress-oss/ids-components 5.20.8 → 5.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AutocompleteNoResults-B9WjoXJo.js +10 -0
- package/dist/Badge-BqaFutTZ.js +40 -0
- package/dist/CheckboxGroup-WLxp9nIX.js +79 -0
- package/dist/CheckboxMark.types-CW7xyywE.js +17 -0
- package/dist/ClearButton-s0_b3pvJ.js +25 -0
- package/dist/ComboboxHiddenInput-DH3V3Dyg.js +27 -0
- package/dist/Expander-B3_k6HJq.js +55 -0
- package/dist/InputBase-BnBuTYZm.js +48 -0
- package/dist/LabelBase-CV1O4V_d.js +51 -0
- package/dist/Loading.module-DdUL1FMv.js +16 -0
- package/dist/LogoFromSrc-7oPJTvAO.js +50 -0
- package/dist/LongLoading-Dw8sUYlh.js +117 -0
- package/dist/MenuItem.module-guf-3YyL.js +24 -0
- package/dist/Placeholder-C1YrHg4w.js +35 -0
- package/dist/Popover.module-6flgSLob.js +10 -0
- package/dist/PopoverProvider-DgUOscvy.js +109 -0
- package/dist/Progress-BypnLSGF.js +35 -0
- package/dist/RadioGroup-DtA0WE3l.js +78 -0
- package/dist/SelectControl-D8Y9Up2f.js +28 -0
- package/dist/Skeleton-D_iuo6Xw.js +34 -0
- package/dist/SkipLink-rElTLeMe.js +15 -0
- package/dist/SlideoutProvider-DnaE67W-.js +125 -0
- package/dist/SliderTicks-BqTI-XhQ.js +47 -0
- package/dist/StartUpLoading-DFAMmjg3.js +68 -0
- package/dist/Tab-C08D4jxr.js +68 -0
- package/dist/TabSet.module-q8a7ksiF.js +13 -0
- package/dist/Table.module-DnaTe51E.js +32 -0
- package/dist/Toggle-CF22OY-P.js +66 -0
- package/dist/Tooltip-BxM_1Wtq.js +60 -0
- package/dist/ValidationBase-A2Ed7iem.js +29 -0
- package/dist/ValidationSummary-D6Wa4vOf.js +38 -0
- package/dist/chunk-efA98nb6.js +13 -0
- package/dist/classnames-BTnCYmAN.js +31 -0
- package/dist/components/Alert/Alert.js +2 -11
- package/dist/components/Alert/Alert.types.js +8 -8
- package/dist/components/Alert/index.js +3 -6
- package/dist/components/Autocomplete/Autocomplete.js +2 -45
- package/dist/components/Autocomplete/Autocomplete.types.js +0 -1
- package/dist/components/Autocomplete/components/AutocompleteInstructions.js +10 -10
- package/dist/components/Autocomplete/components/AutocompleteNoResults.js +2 -5
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +2 -191
- package/dist/components/Autocomplete/index.js +3 -6
- package/dist/components/Badge/Badge.js +2 -49
- package/dist/components/Badge/Badge.types.js +14 -14
- package/dist/components/Badge/index.js +3 -7
- package/dist/components/Button/Button.js +2 -10
- package/dist/components/Button/Button.types.js +22 -20
- package/dist/components/Button/CloseButton/CloseButton.js +2 -7
- package/dist/components/Button/CloseButton/CloseButton.types.js +0 -1
- package/dist/components/Button/index.js +3 -11
- package/dist/components/ButtonGroup/ButtonGroup.js +2 -72
- package/dist/components/ButtonGroup/ButtonGroup.types.js +0 -1
- package/dist/components/ButtonGroup/ButtonGroupProvider.js +26 -33
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +6 -6
- package/dist/components/ButtonGroup/hooks/useIDSButtonGroupItem.js +2 -6
- package/dist/components/ButtonGroup/index.js +3 -6
- package/dist/components/Card/Card.js +34 -48
- package/dist/components/Card/Card.types.js +8 -5
- package/dist/components/Card/components/ButtonCard.js +29 -37
- package/dist/components/Card/components/LinkCard.js +28 -36
- package/dist/components/Card/helpers/composeIDSCard.js +18 -26
- package/dist/components/Card/helpers/composeIDSCardSlots.js +47 -32
- package/dist/components/Card/index.js +7 -15
- package/dist/components/Checkbox/Checkbox.js +2 -15
- package/dist/components/Checkbox/Checkbox.types.js +0 -1
- package/dist/components/Checkbox/helpers/mapCheckboxGroupOptions.js +12 -19
- package/dist/components/Checkbox/index.js +2 -4
- package/dist/components/CheckboxGroup/CheckboxGroup.js +2 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.types.js +10 -10
- package/dist/components/CheckboxGroup/CheckboxGroupContext.js +5 -5
- package/dist/components/CheckboxGroup/index.js +3 -7
- package/dist/components/CheckboxMark/CheckboxMark.js +29 -40
- package/dist/components/CheckboxMark/CheckboxMark.types.js +2 -16
- package/dist/components/CheckboxMark/index.js +3 -6
- package/dist/components/Col/Col.js +14 -33
- package/dist/components/Col/Col.types.js +67 -65
- package/dist/components/Col/index.js +3 -12
- package/dist/components/Combobox/Combobox.js +2 -48
- package/dist/components/Combobox/Combobox.types.js +0 -1
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.js +2 -46
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.types.js +0 -1
- package/dist/components/Combobox/components/ComboboxHiddenInput.js +2 -8
- package/dist/components/Combobox/components/ComboboxResults.js +2 -41
- package/dist/components/Combobox/components/ComboboxResultsDescriptor.js +2 -40
- package/dist/components/Combobox/hooks/useComboboxFlags.js +11 -14
- package/dist/components/Combobox/hooks/useComboboxInlineCompletion.js +39 -59
- package/dist/components/Combobox/index.js +2 -5
- package/dist/components/Container/Container.js +12 -21
- package/dist/components/Container/Container.types.js +6 -4
- package/dist/components/Container/index.js +3 -6
- package/dist/components/Divider/Divider.js +14 -21
- package/dist/components/Divider/Divider.types.js +6 -4
- package/dist/components/Divider/index.js +2 -5
- package/dist/components/Expander/Expander.js +2 -80
- package/dist/components/Expander/Expander.types.js +10 -6
- package/dist/components/Expander/index.js +3 -7
- package/dist/components/Field/Field.js +2 -71
- package/dist/components/Field/Field.types.js +0 -1
- package/dist/components/Field/FieldGroup/FieldGroup.js +2 -77
- package/dist/components/Field/FieldGroup/FieldGroup.types.js +0 -1
- package/dist/components/Field/components/FieldAppendToLabel.js +2 -43
- package/dist/components/Field/components/FieldLegend.js +9 -6
- package/dist/components/Field/helpers/getUniqueItemsByKey.js +4 -8
- package/dist/components/Field/index.js +2 -6
- package/dist/components/Filter/Filter.js +2 -45
- package/dist/components/Filter/Filter.types.js +0 -1
- package/dist/components/Filter/components/FilterLabel.js +6 -10
- package/dist/components/Filter/components/FilterResetButton.js +2 -39
- package/dist/components/Filter/components/FilterSearch.js +2 -39
- package/dist/components/Filter/hooks/useFilterFlags.js +15 -24
- package/dist/components/Filter/index.js +2 -4
- package/dist/components/Form/Form.js +2 -6
- package/dist/components/Form/Form.types.js +6 -4
- package/dist/components/Form/FormContext.js +5 -7
- package/dist/components/Form/FormField/FormField.js +2 -91
- package/dist/components/Form/FormField/FormField.types.js +6 -4
- package/dist/components/Form/FormField/FormFieldset.js +2 -81
- package/dist/components/Form/FormField/helpers/getErrorTypeMessage.js +9 -19
- package/dist/components/Form/FormField/helpers/transformCustomRulesToValidateRule.js +23 -33
- package/dist/components/Form/HookForm/HookForm.js +2 -12
- package/dist/components/Form/components/FormValidationSummary.js +22 -22
- package/dist/components/Form/hooks/useNoDefaultValueInForms.js +6 -13
- package/dist/components/Form/index.js +4 -13
- package/dist/components/HeadingWithDeprecatedFallback/HeadingWithDeprecatedFallback.js +12 -14
- package/dist/components/Hide/Hide.js +2 -7
- package/dist/components/Hide/Hide.types.js +8 -5
- package/dist/components/Hide/helpers/composeHideClasses.js +2 -40
- package/dist/components/Hide/index.js +3 -7
- package/dist/components/Icon/Icon.js +2 -40
- package/dist/components/Icon/Icon.types.js +35 -30
- package/dist/components/Icon/index.js +3 -15
- package/dist/components/Inline/Inline.js +2 -41
- package/dist/components/Inline/Inline.types.js +6 -4
- package/dist/components/Inline/index.js +3 -6
- package/dist/components/Input/ClearButton/ClearButton.js +2 -20
- package/dist/components/Input/Input.js +2 -14
- package/dist/components/Input/Input.types.js +15 -15
- package/dist/components/Input/InputBase/InputBase.js +2 -9
- package/dist/components/Input/InputBase/InputBase.types.js +0 -1
- package/dist/components/Input/index.js +3 -7
- package/dist/components/InputCurrency/InputCurrency.js +2 -8
- package/dist/components/InputCurrency/InputCurrency.types.js +0 -1
- package/dist/components/InputCurrency/index.js +2 -4
- package/dist/components/Label/Label.js +9 -6
- package/dist/components/Label/Label.types.js +0 -1
- package/dist/components/Label/LabelBase/LabelBase.js +2 -70
- package/dist/components/Label/LabelBase/LabelBase.types.js +0 -1
- package/dist/components/Label/index.js +2 -4
- package/dist/components/Menu/Menu.js +49 -63
- package/dist/components/Menu/Menu.types.js +17 -10
- package/dist/components/Menu/MenuDivider/MenuDivider.js +2 -39
- package/dist/components/Menu/MenuHeading/MenuHeading.js +2 -8
- package/dist/components/Menu/MenuItem/MenuItem.js +2 -11
- package/dist/components/Menu/MenuItem/MenuItem.types.js +10 -6
- package/dist/components/Menu/MenuItem/hooks/useMenuItemAria.js +11 -16
- package/dist/components/Menu/MenuItem/hooks/useMenuItemButtonProps.js +44 -46
- package/dist/components/Menu/MenuItem/hooks/useMenuItemComposite.js +17 -14
- package/dist/components/Menu/MenuItem/hooks/useMenuItemInteractions.js +53 -64
- package/dist/components/Menu/MenuItem/hooks/useMenuItemRole.js +8 -8
- package/dist/components/Menu/MenuProvider.js +45 -66
- package/dist/components/Menu/MenuText/MenuText.js +2 -40
- package/dist/components/Menu/helpers/mapMenuItems.js +2 -47
- package/dist/components/Menu/hooks/useMenu.js +6 -6
- package/dist/components/Menu/hooks/useMenuAria.js +13 -18
- package/dist/components/Menu/hooks/useMenuComposite.js +7 -7
- package/dist/components/Menu/hooks/useMenuRole.js +11 -12
- package/dist/components/Menu/hooks/useMenuStyles.js +2 -26
- package/dist/components/Menu/index.js +10 -29
- package/dist/components/Modal/Modal.js +2 -16
- package/dist/components/Modal/Modal.types.js +9 -4
- package/dist/components/Modal/ModalProvider.js +26 -31
- package/dist/components/Modal/hooks/useIDSProvidedModal.js +12 -12
- package/dist/components/Modal/hooks/useModal.js +11 -19
- package/dist/components/Modal/index.js +5 -11
- package/dist/components/Navbar/Navbar.js +2 -13
- package/dist/components/Navbar/Navbar.types.js +6 -4
- package/dist/components/Navbar/components/HomeLinkContent.js +2 -6
- package/dist/components/Navbar/components/LogoFromSrc.js +2 -6
- package/dist/components/Navbar/components/NavbarLogo.js +2 -8
- package/dist/components/Navbar/index.js +3 -6
- package/dist/components/Panel/Panel.js +21 -35
- package/dist/components/Panel/Panel.types.js +12 -11
- package/dist/components/Panel/index.js +3 -8
- package/dist/components/Placeholder/Placeholder.js +2 -42
- package/dist/components/Placeholder/Placeholder.types.js +0 -1
- package/dist/components/Placeholder/index.js +2 -4
- package/dist/components/Popover/InputPopover/InputPopover.js +51 -87
- package/dist/components/Popover/InputPopover/InputPopover.types.js +0 -1
- package/dist/components/Popover/InputPopover/InputPopoverActivator.js +50 -58
- package/dist/components/Popover/InputPopover/InputPopoverProvider.js +86 -107
- package/dist/components/Popover/Popover.js +59 -97
- package/dist/components/Popover/Popover.types.js +14 -15
- package/dist/components/Popover/PopoverProvider.js +2 -15
- package/dist/components/Popover/components/NestedPopoverActivator.js +9 -9
- package/dist/components/Popover/components/PopoverActivator.js +63 -81
- package/dist/components/Popover/components/PopoverContent.js +51 -58
- package/dist/components/Popover/helpers/composeFloatingProps.js +42 -33
- package/dist/components/Popover/helpers/composePopoverWidth.js +7 -4
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +23 -29
- package/dist/components/Popover/helpers/hasFocus.js +7 -7
- package/dist/components/Popover/helpers/waitUntilTrue.js +11 -11
- package/dist/components/Popover/hooks/usePopover.js +6 -6
- package/dist/components/Popover/hooks/usePopoverActivatorInteractions.js +23 -32
- package/dist/components/Popover/hooks/usePopoverAria.js +12 -17
- package/dist/components/Popover/hooks/usePopoverImperativeHandle.js +20 -24
- package/dist/components/Popover/hooks/usePopoverItem.js +20 -16
- package/dist/components/Popover/hooks/usePopoverNavigation.js +32 -31
- package/dist/components/Popover/hooks/usePopoverState.js +21 -28
- package/dist/components/Popover/index.js +5 -13
- package/dist/components/Progress/Progress.js +2 -48
- package/dist/components/Progress/Progress.types.js +0 -1
- package/dist/components/Progress/index.js +2 -4
- package/dist/components/Provider/Provider.js +2 -38
- package/dist/components/Provider/index.js +2 -4
- package/dist/components/Radio/Radio.js +2 -11
- package/dist/components/Radio/Radio.types.js +0 -1
- package/dist/components/Radio/helpers/mapRadioGroupOptions.js +12 -19
- package/dist/components/Radio/index.js +2 -4
- package/dist/components/RadioGroup/RadioGroup.js +2 -98
- package/dist/components/RadioGroup/RadioGroup.types.js +11 -11
- package/dist/components/RadioGroup/RadioGroupContext.js +5 -5
- package/dist/components/RadioGroup/index.js +3 -8
- package/dist/components/Readonly/Readonly.js +2 -43
- package/dist/components/Readonly/Readonly.types.js +0 -1
- package/dist/components/Readonly/index.js +2 -4
- package/dist/components/RichSelect/RichSelect.js +2 -42
- package/dist/components/RichSelect/RichSelect.types.js +0 -1
- package/dist/components/RichSelect/SelectBody/SelectBody.js +2 -56
- package/dist/components/RichSelect/SelectBody/SelectBody.types.js +0 -1
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +2 -63
- package/dist/components/RichSelect/SelectCreate/SelectCreate.types.js +0 -1
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +2 -40
- package/dist/components/RichSelect/SelectHeading/SelectHeading.types.js +0 -1
- package/dist/components/RichSelect/SelectLabel/SelectLabel.js +2 -12
- package/dist/components/RichSelect/SelectLabel/SelectLabel.types.js +0 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenu.js +2 -44
- package/dist/components/RichSelect/SelectMenu/SelectMenu.types.js +0 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +2 -39
- package/dist/components/RichSelect/SelectSearch/SelectSearch.js +2 -39
- package/dist/components/RichSelect/SelectSearch/SelectSearch.types.js +0 -1
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +2 -8
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.types.js +0 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.js +2 -45
- package/dist/components/RichSelect/SelectTags/SelectTags.types.js +0 -1
- package/dist/components/RichSelect/components/SelectActivator.js +2 -7
- package/dist/components/RichSelect/components/SelectHiddenInput.js +18 -29
- package/dist/components/RichSelect/components/SelectOptions.js +2 -40
- package/dist/components/RichSelect/hooks/useRichSelectState.js +15 -17
- package/dist/components/RichSelect/index.js +3 -16
- package/dist/components/Row/Row.js +2 -41
- package/dist/components/Row/Row.types.js +6 -4
- package/dist/components/Row/index.js +3 -6
- package/dist/components/Select/Select.js +2 -14
- package/dist/components/Select/Select.types.js +0 -1
- package/dist/components/Select/SelectOption/SelectOption.js +8 -8
- package/dist/components/Select/components/SelectControl.js +2 -9
- package/dist/components/Select/components/SelectReadonly.js +2 -40
- package/dist/components/Select/helpers/mapSelectOptions.js +2 -21
- package/dist/components/Select/helpers/nodesToSelectOptions.js +2 -9
- package/dist/components/Select/index.js +3 -9
- package/dist/components/Skeleton/Skeleton.js +2 -44
- package/dist/components/Skeleton/Skeleton.types.js +10 -6
- package/dist/components/Skeleton/index.js +3 -7
- package/dist/components/SkipLink/SkipLink.js +2 -30
- package/dist/components/SkipLink/SkipLink.types.js +0 -1
- package/dist/components/SkipLink/index.js +2 -4
- package/dist/components/Slideout/Slideout.js +2 -18
- package/dist/components/Slideout/Slideout.types.js +14 -14
- package/dist/components/Slideout/SlideoutProvider.js +2 -8
- package/dist/components/Slideout/components/SlideoutInner.js +2 -8
- package/dist/components/Slideout/hooks/useIDSProvidedSlideout.js +12 -12
- package/dist/components/Slideout/hooks/useSlideout.js +11 -19
- package/dist/components/Slideout/index.js +5 -16
- package/dist/components/Slider/Slider.js +2 -12
- package/dist/components/Slider/Slider.types.js +0 -1
- package/dist/components/Slider/components/SliderTicks.js +2 -10
- package/dist/components/Slider/index.js +2 -4
- package/dist/components/Spinner/Spinner.js +2 -6
- package/dist/components/Spinner/Spinner.types.js +0 -1
- package/dist/components/Spinner/index.js +2 -4
- package/dist/components/Stack/Stack.js +15 -26
- package/dist/components/Stack/Stack.types.js +6 -4
- package/dist/components/Stack/index.js +3 -6
- package/dist/components/TabSet/Tab/Tab.js +2 -100
- package/dist/components/TabSet/Tab/Tab.types.js +0 -1
- package/dist/components/TabSet/TabSet.js +37 -58
- package/dist/components/TabSet/TabSet.types.js +10 -6
- package/dist/components/TabSet/TabSetProvider.js +45 -49
- package/dist/components/TabSet/components/TabSetItem.js +24 -44
- package/dist/components/TabSet/helpers/mapTabs.js +2 -33
- package/dist/components/TabSet/hooks/useTabSetItems.js +5 -5
- package/dist/components/TabSet/index.js +21 -11
- package/dist/components/Table/Table.js +2 -18
- package/dist/components/Table/Table.types.js +22 -22
- package/dist/components/Table/TableBody/TableBody.js +2 -125
- package/dist/components/Table/TableBody/TableBody.types.js +0 -1
- package/dist/components/Table/TableContext.js +9 -9
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.js +11 -17
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.types.js +0 -1
- package/dist/components/Table/TableProvider.js +31 -38
- package/dist/components/Table/components/TableBodyCell.js +16 -30
- package/dist/components/Table/components/TableEmpty.js +15 -11
- package/dist/components/Table/components/TableHeader.js +2 -8
- package/dist/components/Table/components/TableHeaderCell.js +2 -8
- package/dist/components/Table/components/TableRows.js +29 -48
- package/dist/components/Table/components/TableSortButton.js +2 -7
- package/dist/components/Table/helpers/composeIDSTableColumnDefs.js +29 -41
- package/dist/components/Table/helpers/composeIDSTableInitialSorting.js +6 -9
- package/dist/components/Table/helpers/findColumnByKey.js +4 -4
- package/dist/components/Table/helpers/getFormatFromValue.js +7 -10
- package/dist/components/Table/helpers/hasColumns.js +4 -4
- package/dist/components/Table/hooks/useIDSTableColumnSort.js +18 -23
- package/dist/components/Table/hooks/useIDSTableColumnStyles.js +21 -23
- package/dist/components/Table/hooks/useTable.js +5 -5
- package/dist/components/Table/index.js +4 -15
- package/dist/components/Tag/Tag.js +2 -8
- package/dist/components/Tag/Tag.types.js +0 -1
- package/dist/components/Tag/TagInput/TagInput.js +2 -8
- package/dist/components/Tag/TagInput/TagInput.types.js +0 -1
- package/dist/components/Tag/components/TagListInput/TagListInput.js +2 -8
- package/dist/components/Tag/components/TagListInput/TagListInput.types.js +0 -1
- package/dist/components/Tag/index.js +2 -5
- package/dist/components/Text/Text.js +19 -34
- package/dist/components/Text/Text.types.js +18 -18
- package/dist/components/Text/index.js +3 -6
- package/dist/components/Toaster/Toast/Toast.js +2 -13
- package/dist/components/Toaster/Toast/Toast.types.js +12 -9
- package/dist/components/Toaster/Toast/ToastAnimated.js +2 -9
- package/dist/components/Toaster/Toast/ToastIcon.js +2 -6
- package/dist/components/Toaster/Toaster.js +2 -11
- package/dist/components/Toaster/Toaster.types.js +23 -25
- package/dist/components/Toaster/ToasterProvider.js +2 -7
- package/dist/components/Toaster/hooks/useToaster.js +2 -26
- package/dist/components/Toaster/index.js +4 -17
- package/dist/components/Toggle/Toggle.js +2 -102
- package/dist/components/Toggle/Toggle.types.js +10 -10
- package/dist/components/Toggle/index.js +3 -7
- package/dist/components/Tooltip/Tooltip.js +2 -77
- package/dist/components/Tooltip/Tooltip.types.js +0 -1
- package/dist/components/Tooltip/index.js +2 -4
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.js +2 -51
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.js +15 -21
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationMessage.js +11 -8
- package/dist/components/ValidationMessage/ValidationMessage.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +2 -69
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.types.js +0 -1
- package/dist/components/ValidationMessage/index.js +4 -8
- package/dist/constants-C4s0aMXs.js +161 -0
- package/dist/constants.js +2 -193
- package/dist/enums.js +42 -22
- package/dist/floating-ui.react-Dj2ev6bJ.js +3098 -0
- package/dist/fuzzysort-BZ6Yv-YR.js +377 -0
- package/dist/helpers/dom/closestCrossShadow.js +19 -24
- package/dist/helpers/dom/domUtils.js +10 -11
- package/dist/helpers/dom/focusableElements.js +7 -9
- package/dist/helpers/dom/getActiveElement.js +7 -7
- package/dist/helpers/dom/hasShadowDom.js +4 -4
- package/dist/helpers/form/getFormControlValueAsString.js +4 -4
- package/dist/helpers/form/getFormControlValueAsStringIfDefined.js +6 -7
- package/dist/helpers/form/getValueAsEvent.js +6 -6
- package/dist/helpers/form/isValidFormInputElement.js +4 -4
- package/dist/helpers/formatting/capitalizeFirstLetter.js +4 -4
- package/dist/helpers/formatting/formatCurrency.js +14 -21
- package/dist/helpers/formatting/formatDate.js +16 -22
- package/dist/helpers/formatting/formatDateTime.js +49 -54
- package/dist/helpers/formatting/formatObjectKey.js +4 -4
- package/dist/helpers/formatting/formatPercentage.js +6 -6
- package/dist/helpers/formatting/stringReplacer.js +8 -8
- package/dist/helpers/formatting/toArray.js +4 -4
- package/dist/helpers/formatting/toCSSLengthValue.js +6 -6
- package/dist/helpers/label-value/composeLabelValueDescriptor.js +9 -12
- package/dist/helpers/label-value/getQueryRangeExclusive.js +10 -13
- package/dist/helpers/label-value/getValueFromLabelValues.js +7 -7
- package/dist/helpers/label-value/highlightQueryInLabel.js +7 -6
- package/dist/helpers/label-value/highlightQueryInLabelValue.js +8 -8
- package/dist/helpers/label-value/searchLabelValues.js +12 -11
- package/dist/helpers/responsive/getResponsiveLayoutModifiers.js +8 -10
- package/dist/helpers/responsive/getResponsivePaddingClasses.js +6 -10
- package/dist/helpers/transition/getTransitionDuration.js +5 -7
- package/dist/helpers/transition/timeStringToNumber.js +4 -4
- package/dist/helpers/utility/generateScopedName.js +8 -9
- package/dist/helpers/utility/idsLogger.js +5 -9
- package/dist/helpers/utility/propagateTestid.js +4 -4
- package/dist/hooks/index.js +5 -11
- package/dist/hooks/useAriaRelationship.js +20 -35
- package/dist/hooks/useBreakpoint.js +16 -16
- package/dist/hooks/useControlledState.js +35 -53
- package/dist/hooks/useIdIfNeeded.js +7 -7
- package/dist/hooks/useResponsiveProps.js +25 -25
- package/dist/index.esm-BCkAygZA.js +169 -0
- package/dist/interfaces.js +0 -1
- package/dist/lib-CUMSFn3v.js +1415 -0
- package/dist/main-CTy1XcUn.js +4604 -0
- package/dist/main.js +88 -336
- package/dist/patterns/Loading/Loading.js +2 -8
- package/dist/patterns/Loading/LoadingSuspense.js +2 -7
- package/dist/patterns/Loading/components/ComponentLoading.js +2 -10
- package/dist/patterns/Loading/components/DefaultLoading.js +2 -9
- package/dist/patterns/Loading/components/LongLoading.js +2 -132
- package/dist/patterns/Loading/components/PageLoading.js +2 -14
- package/dist/patterns/Loading/components/StartUpLoading.js +2 -107
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -9
- package/dist/patterns/Loading/hooks/useEstimatedProgressValue.js +25 -25
- package/dist/patterns/Loading/hooks/useShouldRenderLoading.js +26 -23
- package/dist/patterns/Loading/hooks/useShowIndicator.js +18 -19
- package/dist/patterns/Loading/hooks/useSuspenseResource.js +19 -26
- package/dist/patterns/Loading/index.js +2 -5
- package/dist/style.css +2 -1
- package/dist/types.js +0 -1
- package/dist/useAutocompleteSearch-CBgqGiKn.js +179 -0
- package/dist/useIDSButtonGroupItem-BkzYQzAi.js +21 -0
- package/dist/useMenuStyles-cry3mes_.js +20 -0
- package/package.json +15 -15
- package/dist/AutocompleteNoResults-B60rzwfa.js +0 -12
- package/dist/ComboboxHiddenInput-BUswpU00.js +0 -32
- package/dist/FieldAppendToLabel-BK8cAMZT.js +0 -77
- package/dist/InputBase-B6gEHXZ7.js +0 -56
- package/dist/Loading.module-BXP_0EH0.js +0 -13
- package/dist/LoadingSuspense-CuQm3zqO.js +0 -5740
- package/dist/LogoFromSrc-BvialtyP.js +0 -59
- package/dist/MenuItem.module-BFPHZtJl.js +0 -24
- package/dist/Popover.module-oIsv6lht.js +0 -11
- package/dist/PopoverProvider-BMBTLkRr.js +0 -142
- package/dist/SelectControl-Bf6qXlwP.js +0 -47
- package/dist/SlideoutProvider-CQh140HM.js +0 -200
- package/dist/SliderTicks-DRFLh0Rw.js +0 -74
- package/dist/TabSet.module-Dks7jQfN.js +0 -13
- package/dist/Table.module-BARl9Jy6.js +0 -32
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/floating-ui.react-DfIjfJIq.js +0 -3503
- package/dist/fuzzysort-BNka47rs.js +0 -395
- package/dist/index-BaVtNOfa.js +0 -1693
- package/dist/index-DLnR8XTt.js +0 -47
- package/dist/index-cbHCAGLB.js +0 -40
- package/dist/index.esm-CL8gh5wr.js +0 -192
- package/dist/useIDSButtonGroupItem-DXJpvTGd.js +0 -29
|
@@ -0,0 +1,4604 @@
|
|
|
1
|
+
import { n as e } from "./chunk-efA98nb6.js";
|
|
2
|
+
import { ALERT_ICONS as t } from "./components/Alert/Alert.types.js";
|
|
3
|
+
import { t as n } from "./classnames-BTnCYmAN.js";
|
|
4
|
+
import { Breakpoint as r, DisplayMode as i, FormElementWidth as a, GlobalCSSClass as o, GutterSize as s, HeadingLevel as c, HorizontalAlign as l, ModalSize as u, PaddingSize as d, SystemValidationStatus as f, TextFieldType as p, TextMode as m, VerticalAlign as h } from "./enums.js";
|
|
5
|
+
import { IconFlip as g, IconRotate as _, IconSet as v, IconSize as y, IconSpin as b } from "./components/Icon/Icon.types.js";
|
|
6
|
+
import { IressText as x } from "./components/Text/Text.js";
|
|
7
|
+
import { propagateTestid as S } from "./helpers/utility/propagateTestid.js";
|
|
8
|
+
import { idsLogger as C } from "./helpers/utility/idsLogger.js";
|
|
9
|
+
import { HeadingWithDeprecatedFallback as w } from "./components/HeadingWithDeprecatedFallback/HeadingWithDeprecatedFallback.js";
|
|
10
|
+
import { n as T, t as E } from "./AutocompleteNoResults-B9WjoXJo.js";
|
|
11
|
+
import { b as D, d as O, g as k, o as ee, r as te, s as A, u as j, y as ne } from "./floating-ui.react-Dj2ev6bJ.js";
|
|
12
|
+
import { toArray as M } from "./helpers/formatting/toArray.js";
|
|
13
|
+
import { useControlledState as N } from "./hooks/useControlledState.js";
|
|
14
|
+
import { t as P } from "./constants-C4s0aMXs.js";
|
|
15
|
+
import { focusableElements as F } from "./helpers/dom/focusableElements.js";
|
|
16
|
+
import { r as I } from "./PopoverProvider-DgUOscvy.js";
|
|
17
|
+
import { usePopover as re } from "./components/Popover/hooks/usePopover.js";
|
|
18
|
+
import { handlePopoverTabKey as ie } from "./components/Popover/helpers/handlePopoverTabKey.js";
|
|
19
|
+
import { IressPopover as L } from "./components/Popover/Popover.js";
|
|
20
|
+
import { usePopoverItem as R } from "./components/Popover/hooks/usePopoverItem.js";
|
|
21
|
+
import { IressInputPopover as z } from "./components/Popover/InputPopover/InputPopover.js";
|
|
22
|
+
import { getFormControlValueAsString as B } from "./helpers/form/getFormControlValueAsString.js";
|
|
23
|
+
import { t as ae } from "./ClearButton-s0_b3pvJ.js";
|
|
24
|
+
import { n as V, t as oe } from "./InputBase-BnBuTYZm.js";
|
|
25
|
+
import { InputMode as se } from "./components/Input/Input.types.js";
|
|
26
|
+
import { FormContext as ce } from "./components/Form/FormContext.js";
|
|
27
|
+
import { useNoDefaultValueInForms as le } from "./components/Form/hooks/useNoDefaultValueInForms.js";
|
|
28
|
+
import { getFormControlValueAsStringIfDefined as ue } from "./helpers/form/getFormControlValueAsStringIfDefined.js";
|
|
29
|
+
import { getValueAsEvent as de } from "./helpers/form/getValueAsEvent.js";
|
|
30
|
+
import { t as fe } from "./useAutocompleteSearch-CBgqGiKn.js";
|
|
31
|
+
import { IressPanel as pe } from "./components/Panel/Panel.js";
|
|
32
|
+
import { AutocompleteInstructions as me } from "./components/Autocomplete/components/AutocompleteInstructions.js";
|
|
33
|
+
import { useRichSelectState as he } from "./components/RichSelect/hooks/useRichSelectState.js";
|
|
34
|
+
import { composeLabelValueDescriptor as ge } from "./helpers/label-value/composeLabelValueDescriptor.js";
|
|
35
|
+
import { ButtonCssClass as _e, ButtonMode as ve, ButtonType as ye } from "./components/Button/Button.types.js";
|
|
36
|
+
import { IressButtonGroupProvider as be } from "./components/ButtonGroup/ButtonGroupProvider.js";
|
|
37
|
+
import { n as xe, t as Se } from "./useIDSButtonGroupItem-BkzYQzAi.js";
|
|
38
|
+
import { HideCssClass as Ce } from "./components/Hide/Hide.types.js";
|
|
39
|
+
import { SelectHiddenInput as we } from "./components/RichSelect/components/SelectHiddenInput.js";
|
|
40
|
+
import { useIdIfNeeded as Te } from "./hooks/useIdIfNeeded.js";
|
|
41
|
+
import { useMenu as Ee } from "./components/Menu/hooks/useMenu.js";
|
|
42
|
+
import { IressMenu as De } from "./components/Menu/Menu.js";
|
|
43
|
+
import { t as Oe } from "./MenuItem.module-guf-3YyL.js";
|
|
44
|
+
import { useMenuItemRole as ke } from "./components/Menu/MenuItem/hooks/useMenuItemRole.js";
|
|
45
|
+
import { useMenuItemAria as Ae } from "./components/Menu/MenuItem/hooks/useMenuItemAria.js";
|
|
46
|
+
import { IressCheckboxMark as je } from "./components/CheckboxMark/CheckboxMark.js";
|
|
47
|
+
import { useMenuItemButtonProps as Me } from "./components/Menu/MenuItem/hooks/useMenuItemButtonProps.js";
|
|
48
|
+
import { useMenuItemInteractions as Ne } from "./components/Menu/MenuItem/hooks/useMenuItemInteractions.js";
|
|
49
|
+
import { useMenuItemComposite as Pe } from "./components/Menu/MenuItem/hooks/useMenuItemComposite.js";
|
|
50
|
+
import { getValueFromLabelValues as Fe } from "./helpers/label-value/getValueFromLabelValues.js";
|
|
51
|
+
import { IressCard as Ie } from "./components/Card/Card.js";
|
|
52
|
+
import { CheckboxGroupContext as Le } from "./components/CheckboxGroup/CheckboxGroupContext.js";
|
|
53
|
+
import { getResponsiveLayoutModifiers as Re } from "./helpers/responsive/getResponsiveLayoutModifiers.js";
|
|
54
|
+
import { IressCol as ze } from "./components/Col/Col.js";
|
|
55
|
+
import { n as Be, t as Ve } from "./ComboboxHiddenInput-DH3V3Dyg.js";
|
|
56
|
+
import { useComboboxFlags as He } from "./components/Combobox/hooks/useComboboxFlags.js";
|
|
57
|
+
import { useComboboxInlineCompletion as Ue } from "./components/Combobox/hooks/useComboboxInlineCompletion.js";
|
|
58
|
+
import { InlineCssClass as We } from "./components/Inline/Inline.types.js";
|
|
59
|
+
import { IressContainer as Ge } from "./components/Container/Container.js";
|
|
60
|
+
import { IressDivider as Ke } from "./components/Divider/Divider.js";
|
|
61
|
+
import { IressLabel as qe } from "./components/Label/Label.js";
|
|
62
|
+
import { getUniqueItemsByKey as Je } from "./components/Field/helpers/getUniqueItemsByKey.js";
|
|
63
|
+
import { FieldLegend as Ye } from "./components/Field/components/FieldLegend.js";
|
|
64
|
+
import { useFilterFlags as Xe } from "./components/Filter/hooks/useFilterFlags.js";
|
|
65
|
+
import { FilterLabel as Ze } from "./components/Filter/components/FilterLabel.js";
|
|
66
|
+
import { t as Qe } from "./ValidationSummary-D6Wa4vOf.js";
|
|
67
|
+
import { FormValidationSummary as $e } from "./components/Form/components/FormValidationSummary.js";
|
|
68
|
+
import { getErrorTypeMessage as et } from "./components/Form/FormField/helpers/getErrorTypeMessage.js";
|
|
69
|
+
import { transformCustomRulesToValidateRule as tt } from "./components/Form/FormField/helpers/transformCustomRulesToValidateRule.js";
|
|
70
|
+
import { formatCurrency as nt } from "./helpers/formatting/formatCurrency.js";
|
|
71
|
+
import { IressModalProvider as rt } from "./components/Modal/ModalProvider.js";
|
|
72
|
+
import { useIDSProvidedModal as it } from "./components/Modal/hooks/useIDSProvidedModal.js";
|
|
73
|
+
import { getTransitionDuration as at } from "./helpers/transition/getTransitionDuration.js";
|
|
74
|
+
import { NavbarHorizontalAlign as ot } from "./components/Navbar/Navbar.types.js";
|
|
75
|
+
import { n as st, t as ct } from "./LogoFromSrc-7oPJTvAO.js";
|
|
76
|
+
import { TOASTER_ARIA_ATTRIBUTES as lt, TOAST_POSITION_ANIMATION_MATRIX as ut } from "./components/Toaster/Toaster.types.js";
|
|
77
|
+
import { IressStack as dt } from "./components/Stack/Stack.js";
|
|
78
|
+
import { SlideoutMode as ft, SlideoutPosition as pt, SlideoutSize as mt } from "./components/Slideout/Slideout.types.js";
|
|
79
|
+
import { n as ht, r as gt } from "./SlideoutProvider-DnaE67W-.js";
|
|
80
|
+
import { useIDSProvidedSlideout as _t } from "./components/Slideout/hooks/useIDSProvidedSlideout.js";
|
|
81
|
+
import { RadioGroupContext as vt } from "./components/RadioGroup/RadioGroupContext.js";
|
|
82
|
+
import { RowCssClass as yt } from "./components/Row/Row.types.js";
|
|
83
|
+
import { n as bt, t as xt } from "./SelectControl-D8Y9Up2f.js";
|
|
84
|
+
import { IressSelectOption as St } from "./components/Select/SelectOption/SelectOption.js";
|
|
85
|
+
import { t as Ct } from "./Skeleton-D_iuo6Xw.js";
|
|
86
|
+
import { n as wt, t as Tt } from "./SliderTicks-BqTI-XhQ.js";
|
|
87
|
+
import { TableScope as Et } from "./components/Table/Table.types.js";
|
|
88
|
+
import { t as Dt } from "./Table.module-DnaTe51E.js";
|
|
89
|
+
import { useTable as Ot } from "./components/Table/hooks/useTable.js";
|
|
90
|
+
import { TableEmpty as kt } from "./components/Table/components/TableEmpty.js";
|
|
91
|
+
import { t as At } from "./lib-CUMSFn3v.js";
|
|
92
|
+
import { useIDSTableColumnStyles as jt } from "./components/Table/hooks/useIDSTableColumnStyles.js";
|
|
93
|
+
import { useIDSTableColumnSort as Mt } from "./components/Table/hooks/useIDSTableColumnSort.js";
|
|
94
|
+
import { IressTableProvider as Nt } from "./components/Table/TableProvider.js";
|
|
95
|
+
import { hasColumns as Pt } from "./components/Table/helpers/hasColumns.js";
|
|
96
|
+
import { TableRows as Ft } from "./components/Table/components/TableRows.js";
|
|
97
|
+
import { useAriaRelationship as It } from "./hooks/useAriaRelationship.js";
|
|
98
|
+
import { t as Lt } from "./StartUpLoading-DFAMmjg3.js";
|
|
99
|
+
import { t as Rt } from "./Loading.module-DdUL1FMv.js";
|
|
100
|
+
import { useShouldRenderLoading as zt } from "./patterns/Loading/hooks/useShouldRenderLoading.js";
|
|
101
|
+
import { t as Bt } from "./LongLoading-Dw8sUYlh.js";
|
|
102
|
+
import { uncacheSuspenseResource as Vt, useSuspenseResource as Ht } from "./patterns/Loading/hooks/useSuspenseResource.js";
|
|
103
|
+
import * as Ut from "react";
|
|
104
|
+
import H, { Suspense as Wt, cloneElement as Gt, createContext as Kt, createElement as qt, forwardRef as U, isValidElement as Jt, useCallback as Yt, useContext as Xt, useEffect as W, useId as Zt, useImperativeHandle as Qt, useLayoutEffect as $t, useMemo as G, useRef as en, useState as K } from "react";
|
|
105
|
+
import { Fragment as tn, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
106
|
+
import { createPortal as nn } from "react-dom";
|
|
107
|
+
//#region src/components/Alert/Alert.module.scss
|
|
108
|
+
var rn = "ids-alert-v5209", an = "ids-alert--icon-v5209", on = "ids-alert--heading-v5209", sn = "ids-alert--wrapper-v5209", cn = "ids-alert--footer-v5209", ln = "ids-alert--danger-v5209", un = "ids-alert--info-v5209", dn = "ids-alert--success-v5209", fn = "ids-alert--warning-v5209", pn = {
|
|
109
|
+
alert: rn,
|
|
110
|
+
icon: an,
|
|
111
|
+
heading: on,
|
|
112
|
+
"iress-u-text": "ids-alert--iress-u-text-v5209",
|
|
113
|
+
wrapper: sn,
|
|
114
|
+
footer: cn,
|
|
115
|
+
danger: ln,
|
|
116
|
+
info: un,
|
|
117
|
+
success: dn,
|
|
118
|
+
warning: fn
|
|
119
|
+
}, mn = {
|
|
120
|
+
icon: "ids-icon-v5209",
|
|
121
|
+
"flip-horizontal": "ids-icon--flip-horizontal-v5209",
|
|
122
|
+
"flip-vertical": "ids-icon--flip-vertical-v5209",
|
|
123
|
+
"flip-both": "ids-icon--flip-both-v5209",
|
|
124
|
+
"rotate-180": "ids-icon--rotate-180-v5209",
|
|
125
|
+
"rotate-270": "ids-icon--rotate-270-v5209",
|
|
126
|
+
"rotate-90": "ids-icon--rotate-90-v5209",
|
|
127
|
+
"spin-half": "ids-icon--spin-half-v5209",
|
|
128
|
+
"iress-icon-rotation": "ids-icon--iress-icon-rotation-v5209",
|
|
129
|
+
"spin-1": "ids-icon--spin-1-v5209",
|
|
130
|
+
"spin-2": "ids-icon--spin-2-v5209",
|
|
131
|
+
"spin-3": "ids-icon--spin-3-v5209",
|
|
132
|
+
"mode-body": "ids-icon--mode-body-v5209",
|
|
133
|
+
"mode-muted": "ids-icon--mode-muted-v5209",
|
|
134
|
+
"mode-primary": "ids-icon--mode-primary-v5209",
|
|
135
|
+
"mode-info": "ids-icon--mode-info-v5209",
|
|
136
|
+
"mode-success": "ids-icon--mode-success-v5209",
|
|
137
|
+
"mode-warning": "ids-icon--mode-warning-v5209",
|
|
138
|
+
"mode-danger": "ids-icon--mode-danger-v5209",
|
|
139
|
+
"mode-positive": "ids-icon--mode-positive-v5209",
|
|
140
|
+
"mode-negative": "ids-icon--mode-negative-v5209"
|
|
141
|
+
}, Y = /* @__PURE__ */ e(n(), 1), X = U(({ name: e, screenreaderText: t, set: n = "fal", rotate: r, fixedWidth: i, flip: a, size: o, spin: s, mode: c, className: l, ...u }, d) => /* @__PURE__ */ q("span", {
|
|
142
|
+
ref: d,
|
|
143
|
+
role: "img",
|
|
144
|
+
className: (0, Y.default)(l, {
|
|
145
|
+
[mn.icon]: !0,
|
|
146
|
+
["fa-" + e]: !0,
|
|
147
|
+
[n]: !!n,
|
|
148
|
+
"fa-fw": !!i,
|
|
149
|
+
["fa-" + o]: o !== void 0,
|
|
150
|
+
[mn[`mode-${c}`]]: c !== void 0,
|
|
151
|
+
[mn[`flip-${a}`]]: a !== void 0,
|
|
152
|
+
[mn[`rotate-${r}`]]: r !== void 0,
|
|
153
|
+
[mn[`spin-${s}`]]: s !== void 0
|
|
154
|
+
}),
|
|
155
|
+
...t === void 0 || t === "" ? { "aria-hidden": "true" } : { "aria-label": t },
|
|
156
|
+
...u
|
|
157
|
+
}));
|
|
158
|
+
X.displayName = "IressIcon", X.Spin = b, X.Size = y, X.Flip = g, X.Rotate = _, X.Set = v, X.Mode = m;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/components/Alert/Alert.tsx
|
|
161
|
+
var hn = ({ children: e, className: n, footer: r, heading: i, headingLevel: a = "h2", headingText: o, status: s = "info", ...c }) => /* @__PURE__ */ J(x, {
|
|
162
|
+
className: (0, Y.default)(n, `${pn.alert} ${pn[s]} iress-u-inline iress--gutter--sm iress--no-wrap`),
|
|
163
|
+
...c,
|
|
164
|
+
children: [/* @__PURE__ */ q(X, {
|
|
165
|
+
name: t[s],
|
|
166
|
+
screenreaderText: `${s}: `,
|
|
167
|
+
size: "lg",
|
|
168
|
+
fixedWidth: !0,
|
|
169
|
+
className: pn.icon
|
|
170
|
+
}), /* @__PURE__ */ J("div", {
|
|
171
|
+
className: pn.wrapper,
|
|
172
|
+
children: [
|
|
173
|
+
(i ?? o) && /* @__PURE__ */ q("div", {
|
|
174
|
+
className: pn.heading,
|
|
175
|
+
children: /* @__PURE__ */ q(w, {
|
|
176
|
+
component: "IressAlert",
|
|
177
|
+
heading: i,
|
|
178
|
+
headingText: o,
|
|
179
|
+
HeadingTag: a,
|
|
180
|
+
"data-testid": S(c["data-testid"], "heading")
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
e,
|
|
184
|
+
r && /* @__PURE__ */ q("div", {
|
|
185
|
+
className: pn.footer,
|
|
186
|
+
children: r
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
})]
|
|
190
|
+
});
|
|
191
|
+
hn.HeadingLevel = c, hn.Status = f;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/components/Input/Input.module.scss
|
|
194
|
+
var gn = "ids-input-v5209", _n = "ids-input--readonly-v5209", vn = "ids-input--wrapper-v5209", yn = "ids-input--addon-v5209", bn = "ids-input--inline-wrapper-v5209", xn = "ids-input--internal-v5209", Sn = "ids-input--prepend-v5209", Cn = "ids-input--append-v5209", wn = "ids-input--align-right-v5209", Tn = "ids-input--watermark-v5209", En = "ids-input--form-control-v5209", Z = {
|
|
195
|
+
input: gn,
|
|
196
|
+
readonly: _n,
|
|
197
|
+
"ids-field-group--join": "ids-field-group--join-v5209",
|
|
198
|
+
"ids-field-group--fields": "ids-field-group--fields-v5209",
|
|
199
|
+
"ids-field": "ids-field-v5209",
|
|
200
|
+
wrapper: vn,
|
|
201
|
+
addon: yn,
|
|
202
|
+
inlineWrapper: bn,
|
|
203
|
+
internal: xn,
|
|
204
|
+
prepend: Sn,
|
|
205
|
+
append: Cn,
|
|
206
|
+
alignRight: wn,
|
|
207
|
+
watermark: Tn,
|
|
208
|
+
formControl: En
|
|
209
|
+
}, Dn = { spinner: "ids-spinner-v5209" }, On = ({ className: e, name: t = "spinner-third", spin: n = "half", ...r }) => /* @__PURE__ */ q(X, {
|
|
210
|
+
...r,
|
|
211
|
+
className: (0, Y.default)(e, Dn.spinner),
|
|
212
|
+
name: t,
|
|
213
|
+
spin: n
|
|
214
|
+
}), kn = U(({ append: e, children: t, className: n, "data-testid": r, defaultValue: i, loading: a, prepend: s, style: c, watermark: l, width: u, value: d, inline: f, alignRight: p, ...m }, h) => {
|
|
215
|
+
le({
|
|
216
|
+
component: "IressReadonly",
|
|
217
|
+
defaultValue: i
|
|
218
|
+
});
|
|
219
|
+
let g = (0, Y.default)(Z.input, Z.readonly, n, o.FormElement, {
|
|
220
|
+
[`${o.Width}--${u}`]: u?.includes("perc"),
|
|
221
|
+
[Z.watermark]: l
|
|
222
|
+
}), _ = (0, Y.default)(n, V.formControl, V.readonly, Z.readonlyControl, {
|
|
223
|
+
[`${o.Width}--${u}`]: u && !u?.includes("perc"),
|
|
224
|
+
[V.readonlyAlignRight]: p
|
|
225
|
+
}), v = ue(i), y = ue(d);
|
|
226
|
+
return /* @__PURE__ */ J("div", {
|
|
227
|
+
className: g,
|
|
228
|
+
"data-testid": r,
|
|
229
|
+
style: c,
|
|
230
|
+
children: [/* @__PURE__ */ J("div", {
|
|
231
|
+
className: (0, Y.default)(Z.wrapper, o.FormElementInner, { [Z.inlineWrapper]: f }),
|
|
232
|
+
children: [
|
|
233
|
+
s && /* @__PURE__ */ q("div", {
|
|
234
|
+
className: `${Z.addon} ${Z.prepend}`,
|
|
235
|
+
children: s
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ q("div", {
|
|
238
|
+
className: _,
|
|
239
|
+
children: t ?? y ?? v
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ q("div", {
|
|
242
|
+
className: Z.internal,
|
|
243
|
+
children: a && /* @__PURE__ */ q(On, { screenreaderText: a === !0 ? "loading" : a })
|
|
244
|
+
}),
|
|
245
|
+
e && /* @__PURE__ */ q("div", {
|
|
246
|
+
className: `${Z.addon} ${Z.append}`,
|
|
247
|
+
children: e
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
}), /* @__PURE__ */ q("input", {
|
|
251
|
+
...m,
|
|
252
|
+
defaultValue: v,
|
|
253
|
+
type: "hidden",
|
|
254
|
+
ref: h,
|
|
255
|
+
"data-testid": S(r, "input"),
|
|
256
|
+
value: y
|
|
257
|
+
})]
|
|
258
|
+
});
|
|
259
|
+
}), An = U((e, t) => {
|
|
260
|
+
let { loading: n = !1, clearable: r = !1, defaultValue: i, onClear: a, width: s, prepend: c, append: l, onChange: u, className: d, watermark: f, readOnly: p, formatter: m, type: h, inline: g, alignRight: _, ...v } = e;
|
|
261
|
+
le({
|
|
262
|
+
component: "IressInput",
|
|
263
|
+
defaultValue: i
|
|
264
|
+
});
|
|
265
|
+
let y = en(null), b = en(null), { value: x, setValue: S } = N({
|
|
266
|
+
component: "IressInput",
|
|
267
|
+
defaultValue: i,
|
|
268
|
+
value: e.value
|
|
269
|
+
}), C = B(x), [w, T] = K(!1), E = G(() => m && !w ? m(x) : C, [
|
|
270
|
+
m,
|
|
271
|
+
x,
|
|
272
|
+
C,
|
|
273
|
+
w
|
|
274
|
+
]), D = G(() => m && !w ? "text" : h, [
|
|
275
|
+
m,
|
|
276
|
+
w,
|
|
277
|
+
h
|
|
278
|
+
]);
|
|
279
|
+
if (Qt(t, () => y.current), p) return /* @__PURE__ */ q(kn, {
|
|
280
|
+
...v,
|
|
281
|
+
defaultValue: void 0,
|
|
282
|
+
value: x,
|
|
283
|
+
alignRight: _,
|
|
284
|
+
append: l,
|
|
285
|
+
className: d,
|
|
286
|
+
children: E
|
|
287
|
+
});
|
|
288
|
+
let O = (e) => {
|
|
289
|
+
S(""), y.current?.focus();
|
|
290
|
+
let t = new Event("change", { bubbles: !0 });
|
|
291
|
+
Object.defineProperty(t, "target", {
|
|
292
|
+
writable: !1,
|
|
293
|
+
value: {
|
|
294
|
+
value: "",
|
|
295
|
+
...e.target
|
|
296
|
+
}
|
|
297
|
+
}), a?.(t);
|
|
298
|
+
}, k = (e) => {
|
|
299
|
+
let t = e.target.value;
|
|
300
|
+
S(t), u?.(e, t);
|
|
301
|
+
};
|
|
302
|
+
return /* @__PURE__ */ q("div", {
|
|
303
|
+
className: (0, Y.default)(Z.input, d, o.FormElement, {
|
|
304
|
+
[`${o.Width}--${s}`]: s?.includes("perc"),
|
|
305
|
+
[Z.watermark]: f
|
|
306
|
+
}),
|
|
307
|
+
"data-testid": v["data-testid"],
|
|
308
|
+
children: /* @__PURE__ */ J("div", {
|
|
309
|
+
className: (0, Y.default)(Z.wrapper, o.FormElementInner, { [Z.inlineWrapper]: g }),
|
|
310
|
+
children: [
|
|
311
|
+
c && /* @__PURE__ */ q("div", {
|
|
312
|
+
className: `${Z.addon} ${Z.prepend}`,
|
|
313
|
+
children: c
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ q(oe, {
|
|
316
|
+
...v,
|
|
317
|
+
className: (0, Y.default)({
|
|
318
|
+
[`${o.Width}--${s}`]: s && !s?.includes("perc"),
|
|
319
|
+
[Z.alignRight]: _
|
|
320
|
+
}),
|
|
321
|
+
value: E,
|
|
322
|
+
onChange: k,
|
|
323
|
+
onFocus: (e) => {
|
|
324
|
+
T(!0), v?.onFocus?.(e), b.current ? b.current = null : queueMicrotask(() => e.target.select());
|
|
325
|
+
},
|
|
326
|
+
onMouseDown: (e) => {
|
|
327
|
+
v?.onMouseDown?.(e), b.current = !0;
|
|
328
|
+
},
|
|
329
|
+
onBlur: (...e) => {
|
|
330
|
+
T(!1), v?.onBlur?.(...e);
|
|
331
|
+
},
|
|
332
|
+
type: D,
|
|
333
|
+
ref: y
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ J("div", {
|
|
336
|
+
className: Z.internal,
|
|
337
|
+
children: [n && /* @__PURE__ */ q(On, { screenreaderText: n === !0 ? "loading" : n }), C && r && /* @__PURE__ */ q(ae, { onClick: O })]
|
|
338
|
+
}),
|
|
339
|
+
l && /* @__PURE__ */ q("div", {
|
|
340
|
+
className: `${Z.addon} ${Z.append}`,
|
|
341
|
+
children: l
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
An.Type = p, An.Width = a, An.InputMode = se;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/components/RichSelect/RichSelect.module.scss
|
|
350
|
+
var jn = "ids-rich-select-v5209", Mn = "ids-rich-select--popover-content-v5209", Nn = "ids-rich-select--auto-width-v5209", Pn = "ids-rich-select--dropdown-selected-heading-v5209", Fn = "ids-rich-select--dropdown-clear-v5209", In = "ids-rich-select--wrapper-v5209", Ln = {
|
|
351
|
+
richSelect: jn,
|
|
352
|
+
"ids-selectTags": "ids-select-tags-v5209",
|
|
353
|
+
popoverContent: Mn,
|
|
354
|
+
"ids-selectSearchInput": "ids-select-search-input-v5209",
|
|
355
|
+
"ids-select-body": "ids-select-body-v5209",
|
|
356
|
+
autoWidth: Nn,
|
|
357
|
+
dropdownSelectedHeading: Pn,
|
|
358
|
+
dropdownClear: Fn,
|
|
359
|
+
wrapper: In
|
|
360
|
+
}, Rn = "ids-select-label-v5209", zn = "ids-select-label--contents-v5209", Bn = "ids-select-label--placeholder-v5209", Vn = "ids-select-label--prepend-v5209", Hn = "ids-select-label--append-v5209", Un = {
|
|
361
|
+
selectLabel: Rn,
|
|
362
|
+
"pseudo-focus-all": "ids-select-label--pseudo-focus-all-v5209",
|
|
363
|
+
"pseudo-focus-visible": "ids-select-label--pseudo-focus-visible-v5209",
|
|
364
|
+
contents: zn,
|
|
365
|
+
placeholder: Bn,
|
|
366
|
+
prepend: Vn,
|
|
367
|
+
append: Hn
|
|
368
|
+
}, Wn = ({ loading: e, ...t }) => e ? /* @__PURE__ */ q(On, {
|
|
369
|
+
...t,
|
|
370
|
+
fixedWidth: !0,
|
|
371
|
+
screenreaderText: e === !0 ? "Loading" : e
|
|
372
|
+
}) : null, Gn = U(({ append: e, attrs: t, children: n, className: r, fluid: i = !1, href: a, loading: s = !1, mode: c = "secondary", prepend: l, rel: u, target: d, type: f = "button", noWrap: p = !1, onClick: m, value: h, ...g }, _) => {
|
|
373
|
+
let v = Zt(), y = Se({ value: h ?? (typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? n : void 0) }), b = {
|
|
374
|
+
[_e.Base]: !0,
|
|
375
|
+
[_e.Fluid]: i === !0,
|
|
376
|
+
[`${_e.Mode}--${c}`]: !y,
|
|
377
|
+
[_e.NoWrap]: p === !0,
|
|
378
|
+
[_e.Loading]: s,
|
|
379
|
+
[`${_e.Fluid}--${i}`]: typeof i == "string"
|
|
380
|
+
}, x = a === void 0 ? "button" : "a", S = x === "button" ? {
|
|
381
|
+
type: f,
|
|
382
|
+
"aria-describedby": s ? v : void 0
|
|
383
|
+
} : {
|
|
384
|
+
href: a,
|
|
385
|
+
rel: u,
|
|
386
|
+
target: d
|
|
387
|
+
}, C = (e) => {
|
|
388
|
+
s || (m?.(e), y?.toggle());
|
|
389
|
+
};
|
|
390
|
+
return /* @__PURE__ */ J(x, {
|
|
391
|
+
className: (0, Y.default)(r, y?.className, o.FormElement, o.FormElementInner, b),
|
|
392
|
+
...S,
|
|
393
|
+
...t,
|
|
394
|
+
...y?.props,
|
|
395
|
+
...g,
|
|
396
|
+
onClick: C,
|
|
397
|
+
ref: _,
|
|
398
|
+
children: [
|
|
399
|
+
l && /* @__PURE__ */ q("span", {
|
|
400
|
+
className: s === !0 ? o.Hidden : _e.Prepend,
|
|
401
|
+
children: l
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ q(Wn, {
|
|
404
|
+
loading: s,
|
|
405
|
+
id: v
|
|
406
|
+
}),
|
|
407
|
+
n,
|
|
408
|
+
e
|
|
409
|
+
]
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
Gn.Mode = ve, Gn.Type = ye, Gn.Fluid = r;
|
|
413
|
+
var Kn = { closeButton: "ids-close-button-v5209" }, qn = U(({ screenreaderText: e = "Close button", className: t, ...n }, r) => /* @__PURE__ */ q(Gn, {
|
|
414
|
+
className: (0, Y.default)(t, Kn.closeButton),
|
|
415
|
+
mode: "tertiary",
|
|
416
|
+
...n,
|
|
417
|
+
ref: r,
|
|
418
|
+
children: /* @__PURE__ */ q(X, {
|
|
419
|
+
name: "times",
|
|
420
|
+
screenreaderText: e
|
|
421
|
+
})
|
|
422
|
+
}));
|
|
423
|
+
qn.displayName = "IressCloseButton";
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/components/RichSelect/SelectLabel/SelectLabel.tsx
|
|
426
|
+
var Jn = ({ append: e = /* @__PURE__ */ q(X, {
|
|
427
|
+
name: "chevron-down",
|
|
428
|
+
size: "xs"
|
|
429
|
+
}), className: t, placeholder: n, prepend: r, selected: i, selectedOptionsText: a = "{{numOptions}} selected", ...s }) => {
|
|
430
|
+
let c = M(i), l = G(() => c.length ? c.length === 1 ? c[0].label : ge(c, a) : n, [
|
|
431
|
+
n,
|
|
432
|
+
c,
|
|
433
|
+
a
|
|
434
|
+
]);
|
|
435
|
+
return /* @__PURE__ */ J("button", {
|
|
436
|
+
...s,
|
|
437
|
+
type: "button",
|
|
438
|
+
className: (0, Y.default)(t, Un.selectLabel, _e.Base, o.FormElementInner),
|
|
439
|
+
children: [
|
|
440
|
+
r && /* @__PURE__ */ q("span", {
|
|
441
|
+
className: (0, Y.default)(_e.Prepend, Un.prepend),
|
|
442
|
+
children: r
|
|
443
|
+
}),
|
|
444
|
+
/* @__PURE__ */ q(x, {
|
|
445
|
+
className: (0, Y.default)(Un.contents, { [Un.placeholder]: !c.length }),
|
|
446
|
+
children: l
|
|
447
|
+
}),
|
|
448
|
+
e && /* @__PURE__ */ q("span", {
|
|
449
|
+
className: Un.append,
|
|
450
|
+
children: e
|
|
451
|
+
})
|
|
452
|
+
]
|
|
453
|
+
});
|
|
454
|
+
}, Yn = "ids-select-tags-v5209", Xn = "ids-select-tags--placeholder-v5209", Zn = "ids-select-tags--prepend-v5209", Qn = "ids-select-tags--append-v5209", $n = "ids-select-tags--tag-v5209", er = "ids-select-tags--tags-list-v5209", tr = {
|
|
455
|
+
selectTags: Yn,
|
|
456
|
+
placeholder: Xn,
|
|
457
|
+
prepend: Zn,
|
|
458
|
+
append: Qn,
|
|
459
|
+
"ids-menuItem": "ids-menu-item-v5209",
|
|
460
|
+
"ids-clear-button--clear": "ids-clear-button--clear-v5209",
|
|
461
|
+
tag: $n,
|
|
462
|
+
tagsList: er
|
|
463
|
+
}, nr = (e, t) => {
|
|
464
|
+
if (!e?.api.elements.reference || !t) return;
|
|
465
|
+
let n = e.getFocusableActivator(), r = F(e.api.elements.reference).filter((e) => e !== n);
|
|
466
|
+
if (r.length < 1) n?.focus();
|
|
467
|
+
else {
|
|
468
|
+
let e = r.indexOf(t.currentTarget), i = r.filter((e) => e !== t.currentTarget), a = Math.max(e - 1, 0);
|
|
469
|
+
!i[a] && i[0] ? i[0].focus() : i[0] ? i[a].focus() : n?.focus();
|
|
470
|
+
}
|
|
471
|
+
}, rr = ({ "data-testid": e, limit: t = 5, onDelete: n, onDeleteAll: r, onToggleActions: i, selectedArray: a, selectedOptionsText: o }) => {
|
|
472
|
+
let [s, c] = K(!1), l = re(), u = Yt((e, t) => {
|
|
473
|
+
n?.(a.find((t) => t.label === e), t), t.stopPropagation(), nr(l, t);
|
|
474
|
+
}, [
|
|
475
|
+
n,
|
|
476
|
+
l,
|
|
477
|
+
a
|
|
478
|
+
]), d = Yt((e) => {
|
|
479
|
+
r?.(e), l?.getFocusableActivator()?.focus();
|
|
480
|
+
}, [r, l]);
|
|
481
|
+
return s && a.length || !t || a.length <= t ? a.map((t) => /* @__PURE__ */ q($r, {
|
|
482
|
+
className: tr.tag,
|
|
483
|
+
"data-testid": S(e, "tag"),
|
|
484
|
+
deleteButtonText: `Delete ${t.label}`,
|
|
485
|
+
onDelete: u,
|
|
486
|
+
children: t.label
|
|
487
|
+
}, ue(t.value) ?? t.label)) : /* @__PURE__ */ q($r, {
|
|
488
|
+
className: tr.tag,
|
|
489
|
+
"data-testid": S(e, "tag"),
|
|
490
|
+
deleteButton: /* @__PURE__ */ q(L, {
|
|
491
|
+
activator: /* @__PURE__ */ q(Gn, {
|
|
492
|
+
mode: "tertiary",
|
|
493
|
+
children: /* @__PURE__ */ q(X, {
|
|
494
|
+
name: "chevron-circle-down",
|
|
495
|
+
screenreaderText: "Actions"
|
|
496
|
+
})
|
|
497
|
+
}),
|
|
498
|
+
onActivated: () => i?.(!0),
|
|
499
|
+
onClick: (e) => {
|
|
500
|
+
e.stopPropagation(), nr(l, e);
|
|
501
|
+
},
|
|
502
|
+
onDeactivated: () => i?.(!1),
|
|
503
|
+
children: /* @__PURE__ */ J(De, { children: [/* @__PURE__ */ q(wr, {
|
|
504
|
+
onClick: () => c(!0),
|
|
505
|
+
children: "Expand all"
|
|
506
|
+
}), /* @__PURE__ */ q(wr, {
|
|
507
|
+
onClick: d,
|
|
508
|
+
children: "Delete all"
|
|
509
|
+
})] })
|
|
510
|
+
}),
|
|
511
|
+
children: ge(a, o)
|
|
512
|
+
});
|
|
513
|
+
}, ir = ({ append: e = /* @__PURE__ */ q(Gn, {
|
|
514
|
+
mode: "tertiary",
|
|
515
|
+
role: "combobox",
|
|
516
|
+
"aria-label": "Select",
|
|
517
|
+
children: /* @__PURE__ */ q(X, {
|
|
518
|
+
name: "chevron-down",
|
|
519
|
+
size: "xs"
|
|
520
|
+
})
|
|
521
|
+
}), className: t, "data-testid": n, limit: r = 5, onDelete: i, onDeleteAll: a, onToggleActions: s, placeholder: c, prepend: l, selected: u, selectedOptionsText: d = "{{numOptions}} selected", ...f }) => {
|
|
522
|
+
let p = G(() => M(u), [u]), m = !p.length && c, h = !!p.length;
|
|
523
|
+
return /* @__PURE__ */ J(x, {
|
|
524
|
+
...f,
|
|
525
|
+
className: (0, Y.default)(t, tr.selectTags, _e.Base, o.FormElementInner),
|
|
526
|
+
children: [
|
|
527
|
+
l && /* @__PURE__ */ q("span", {
|
|
528
|
+
className: tr.prepend,
|
|
529
|
+
children: l
|
|
530
|
+
}),
|
|
531
|
+
m && /* @__PURE__ */ q("span", {
|
|
532
|
+
className: (0, Y.default)(tr.placeholder),
|
|
533
|
+
children: c
|
|
534
|
+
}),
|
|
535
|
+
h && /* @__PURE__ */ q(ci, {
|
|
536
|
+
gutter: "sm",
|
|
537
|
+
className: tr.tagsList,
|
|
538
|
+
children: /* @__PURE__ */ q(rr, {
|
|
539
|
+
"data-testid": n,
|
|
540
|
+
limit: r,
|
|
541
|
+
onDelete: i,
|
|
542
|
+
onDeleteAll: a,
|
|
543
|
+
onToggleActions: s,
|
|
544
|
+
selectedArray: p,
|
|
545
|
+
selectedOptionsText: d
|
|
546
|
+
})
|
|
547
|
+
}),
|
|
548
|
+
e && /* @__PURE__ */ q("span", {
|
|
549
|
+
className: tr.append,
|
|
550
|
+
children: e
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
});
|
|
554
|
+
}, ar = (e, t = {}) => {
|
|
555
|
+
let n = or(t);
|
|
556
|
+
return Object.keys(n).filter((e) => !!n[e]).map((t) => `${e}--${t}`);
|
|
557
|
+
}, or = (e = {}) => P.reduce((t, n, r) => (t[n] = e[n] ?? t[P[r - 1]], t), {}), sr = ({ children: e, hiddenOn: t, visuallyHidden: n, className: r, ...i }) => /* @__PURE__ */ q("div", {
|
|
558
|
+
className: (0, Y.default)(r, ar(n ? Ce.VisuallyHidden : Ce.TotallyHidden, t)),
|
|
559
|
+
...i,
|
|
560
|
+
children: e
|
|
561
|
+
}), cr = ({ async: e, id: t, error: n, loading: r, multiSelect: i, onChange: a, placeholder: o, renderLabel: s, setShow: c, setValue: l, show: u, value: d }) => s ? s({
|
|
562
|
+
close: () => c(!1),
|
|
563
|
+
error: n,
|
|
564
|
+
loading: r,
|
|
565
|
+
setValue: l,
|
|
566
|
+
show: u,
|
|
567
|
+
value: d
|
|
568
|
+
}) : i ? /* @__PURE__ */ q(ir, {
|
|
569
|
+
append: /* @__PURE__ */ J(Gn, {
|
|
570
|
+
mode: "tertiary",
|
|
571
|
+
role: e ? void 0 : "combobox",
|
|
572
|
+
children: [/* @__PURE__ */ q(X, {
|
|
573
|
+
name: "chevron-down",
|
|
574
|
+
size: "xs"
|
|
575
|
+
}), /* @__PURE__ */ J(sr, {
|
|
576
|
+
visuallyHidden: !0,
|
|
577
|
+
hiddenOn: { xs: !0 },
|
|
578
|
+
children: [
|
|
579
|
+
"Selected:",
|
|
580
|
+
" ",
|
|
581
|
+
M(d).length ? M(d).map((e) => e.label).join(", ") : "None"
|
|
582
|
+
]
|
|
583
|
+
})]
|
|
584
|
+
}),
|
|
585
|
+
id: t,
|
|
586
|
+
onDelete: (e) => {
|
|
587
|
+
if (!e) return;
|
|
588
|
+
let t = M(d).filter((t) => t.label !== e.label);
|
|
589
|
+
l(t), a?.(de(t), t);
|
|
590
|
+
},
|
|
591
|
+
onDeleteAll: () => {
|
|
592
|
+
l([]), a?.(de([]), []);
|
|
593
|
+
},
|
|
594
|
+
onToggleActions: () => c(!1),
|
|
595
|
+
placeholder: o,
|
|
596
|
+
selected: d
|
|
597
|
+
}) : /* @__PURE__ */ q(Jn, {
|
|
598
|
+
id: t,
|
|
599
|
+
placeholder: o,
|
|
600
|
+
role: e ? void 0 : "combobox",
|
|
601
|
+
selected: d
|
|
602
|
+
}), lr = {
|
|
603
|
+
selectSearch: "ids-select-search-v5209",
|
|
604
|
+
content: "ids-select-search--content-v5209",
|
|
605
|
+
"ids-selectBody": "ids-select-body-v5209"
|
|
606
|
+
}, ur = {
|
|
607
|
+
selectBody: "ids-select-body-v5209",
|
|
608
|
+
children: "ids-select-body--children-v5209"
|
|
609
|
+
}, dr = ({ className: e, contentClassName: t, onKeyDown: n, ...r }) => {
|
|
610
|
+
let i = re();
|
|
611
|
+
return /* @__PURE__ */ q(z, {
|
|
612
|
+
...r,
|
|
613
|
+
className: (0, Y.default)(lr.selectSearch, ur.selectBody, e),
|
|
614
|
+
contentClassName: (0, Y.default)(lr.content, ur.children, t),
|
|
615
|
+
displayMode: "inline",
|
|
616
|
+
onKeyDown: (e) => {
|
|
617
|
+
n?.(e), i && ie(i, e);
|
|
618
|
+
},
|
|
619
|
+
show: !0
|
|
620
|
+
});
|
|
621
|
+
}, fr = ({ minSearchLength: e = 1, multiSelect: t, onChange: n, query: r, results: i, value: a, shouldShowInstructions: o, shouldShowNoResults: s }) => /* @__PURE__ */ q(Dr, {
|
|
622
|
+
heading: t ? "Search results" : void 0,
|
|
623
|
+
items: i,
|
|
624
|
+
multiSelect: t,
|
|
625
|
+
noResults: (() => {
|
|
626
|
+
if (r) {
|
|
627
|
+
if (o) return `Type at least ${e} character${e === 1 ? "" : "s"} to search`;
|
|
628
|
+
if (s) return "No results found";
|
|
629
|
+
}
|
|
630
|
+
})(),
|
|
631
|
+
onChange: n,
|
|
632
|
+
selected: a,
|
|
633
|
+
hideSelectedItems: t
|
|
634
|
+
}), pr = ({ error: e }) => e ? /* @__PURE__ */ q(hn, {
|
|
635
|
+
className: "iress-m--sm",
|
|
636
|
+
status: "danger",
|
|
637
|
+
children: typeof e == "string" ? e : /* @__PURE__ */ J(tn, { children: [
|
|
638
|
+
"An unknown error occurred.",
|
|
639
|
+
/* @__PURE__ */ q("br", {}),
|
|
640
|
+
" Please contact support if the error persists."
|
|
641
|
+
] })
|
|
642
|
+
}) : null, mr = ({ autoHighlight: e, error: t, loading: n, minSearchLength: r, multiSelect: i, onChange: a, onClear: o, query: s, results: c, setQuery: l, show: u, value: d, shouldShowInstructions: f, shouldShowNoResults: p }) => {
|
|
643
|
+
let m = M(d).map((e) => {
|
|
644
|
+
let { formattedLabel: t, ...n } = e;
|
|
645
|
+
return n;
|
|
646
|
+
}), h = !t && (!!c?.length || s && !n), g = !!m.length && i, _ = h && g, v = en(null), y = Zt();
|
|
647
|
+
W(() => {
|
|
648
|
+
u || l?.("");
|
|
649
|
+
}, [u, l]), $t(() => {
|
|
650
|
+
u && v.current?.input?.focus({ preventScroll: !0 });
|
|
651
|
+
}, [u]);
|
|
652
|
+
let b = g ? m.length + 1 : 0, x = s && h ? b : g ? 1 : 0;
|
|
653
|
+
return /* @__PURE__ */ J(dr, {
|
|
654
|
+
activator: /* @__PURE__ */ q(Nr, {
|
|
655
|
+
"aria-label": "Search",
|
|
656
|
+
loading: n,
|
|
657
|
+
onChange: (e) => l?.(e.target.value),
|
|
658
|
+
ref: v,
|
|
659
|
+
placeholder: "Search and select",
|
|
660
|
+
value: s
|
|
661
|
+
}),
|
|
662
|
+
autoHighlight: e,
|
|
663
|
+
contentClassName: Ln.searchResults,
|
|
664
|
+
focusStartIndex: e ? x : void 0,
|
|
665
|
+
children: [
|
|
666
|
+
g && /* @__PURE__ */ q(Dr, {
|
|
667
|
+
"aria-labelledby": y,
|
|
668
|
+
heading: /* @__PURE__ */ q(br, {
|
|
669
|
+
clearAll: !0,
|
|
670
|
+
onClearAll: (e) => {
|
|
671
|
+
o?.(e), v.current?.focus();
|
|
672
|
+
},
|
|
673
|
+
children: /* @__PURE__ */ J("h2", {
|
|
674
|
+
id: y,
|
|
675
|
+
children: [
|
|
676
|
+
"Selected (",
|
|
677
|
+
m.length,
|
|
678
|
+
")"
|
|
679
|
+
]
|
|
680
|
+
})
|
|
681
|
+
}),
|
|
682
|
+
items: m,
|
|
683
|
+
multiSelect: i,
|
|
684
|
+
onChange: a,
|
|
685
|
+
selected: d
|
|
686
|
+
}),
|
|
687
|
+
_ && /* @__PURE__ */ q(xr, { gutter: "none" }),
|
|
688
|
+
h && /* @__PURE__ */ q(fr, {
|
|
689
|
+
minSearchLength: r,
|
|
690
|
+
multiSelect: i,
|
|
691
|
+
onChange: a,
|
|
692
|
+
query: s,
|
|
693
|
+
results: c,
|
|
694
|
+
value: d,
|
|
695
|
+
shouldShowInstructions: f,
|
|
696
|
+
shouldShowNoResults: p
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ q(pr, { error: t })
|
|
699
|
+
]
|
|
700
|
+
});
|
|
701
|
+
}, hr = ({ autoHighlight: e, debouncedQuery: t, error: n, initialOptions: r, loading: i, minSearchLength: a, multiSelect: o, onChange: s, options: c, query: l, renderOptions: u, renderOptionsFooter: d, results: f, setQuery: p, setShow: m, setValue: h, show: g, value: _, shouldShowInstructions: v, shouldShowNoResults: y }) => {
|
|
702
|
+
let b = typeof c == "function", x = r ?? (b ? [] : c), S = f.length ? f : x, C = Yt((e) => {
|
|
703
|
+
h(e), s?.(de(e), e), o || m(!1);
|
|
704
|
+
}, [
|
|
705
|
+
m,
|
|
706
|
+
h,
|
|
707
|
+
s,
|
|
708
|
+
o
|
|
709
|
+
]), w = Yt((e) => {
|
|
710
|
+
e.stopPropagation(), h([]), s?.(de([]), []);
|
|
711
|
+
}, [h, s]), T = G(() => ({
|
|
712
|
+
close: () => m(!1),
|
|
713
|
+
debouncedQuery: t,
|
|
714
|
+
error: n,
|
|
715
|
+
loading: i,
|
|
716
|
+
query: l,
|
|
717
|
+
results: S,
|
|
718
|
+
setValue: h,
|
|
719
|
+
setQuery: p,
|
|
720
|
+
show: g,
|
|
721
|
+
value: _
|
|
722
|
+
}), [
|
|
723
|
+
t,
|
|
724
|
+
n,
|
|
725
|
+
i,
|
|
726
|
+
S,
|
|
727
|
+
l,
|
|
728
|
+
p,
|
|
729
|
+
m,
|
|
730
|
+
h,
|
|
731
|
+
g,
|
|
732
|
+
_
|
|
733
|
+
]);
|
|
734
|
+
return u ? u(T) : b ? /* @__PURE__ */ J(tn, { children: [/* @__PURE__ */ q(mr, {
|
|
735
|
+
autoHighlight: e,
|
|
736
|
+
error: n,
|
|
737
|
+
loading: i,
|
|
738
|
+
minSearchLength: a,
|
|
739
|
+
multiSelect: o,
|
|
740
|
+
onChange: C,
|
|
741
|
+
onClear: w,
|
|
742
|
+
query: l,
|
|
743
|
+
results: f,
|
|
744
|
+
setQuery: p,
|
|
745
|
+
show: g,
|
|
746
|
+
value: _,
|
|
747
|
+
shouldShowInstructions: v,
|
|
748
|
+
shouldShowNoResults: y
|
|
749
|
+
}), d?.(T)] }) : /* @__PURE__ */ J(tn, { children: [/* @__PURE__ */ q(Dr, {
|
|
750
|
+
items: S,
|
|
751
|
+
multiSelect: o,
|
|
752
|
+
onChange: C,
|
|
753
|
+
selected: _,
|
|
754
|
+
selectedFirst: !0
|
|
755
|
+
}), d?.(T)] });
|
|
756
|
+
}, gr = U(({ align: e = "bottom-start", autoHighlight: t = !0, className: n, debounceThreshold: r, defaultValue: i, footer: a, header: s, id: c, initialOptions: l, matchActivatorWidth: u = !0, minSearchLength: d, name: f, multiSelect: p, onActivated: m, onDeactivated: h, onChange: g, onBlur: _, options: v, placeholder: y, readonly: b, renderHiddenInput: x, renderLabel: S, renderOptions: C, renderOptionsFooter: w, required: T, type: E, value: D, width: O = "100perc", virtualFocus: k, ...ee }, te) => {
|
|
757
|
+
le({
|
|
758
|
+
component: "IressRichSelect",
|
|
759
|
+
defaultValue: i
|
|
760
|
+
});
|
|
761
|
+
let [A, j] = K(!1), [ne, M] = K(""), [N, P] = K(void 0), { value: F, setValue: I, getValuesString: re, getLabelsString: ie } = he({
|
|
762
|
+
component: "IressRichSelect",
|
|
763
|
+
defaultValue: i,
|
|
764
|
+
multiple: p,
|
|
765
|
+
value: D
|
|
766
|
+
}), R = en(null), z = en(null), { debouncedQuery: B, error: ae, results: V, stopSearch: oe, loading: se, shouldShowInstructions: ce, shouldShowNoResults: ue } = fe({
|
|
767
|
+
debounceThreshold: r,
|
|
768
|
+
initialOptions: l,
|
|
769
|
+
minSearchLength: d,
|
|
770
|
+
options: v,
|
|
771
|
+
query: ne
|
|
772
|
+
});
|
|
773
|
+
Qt(te, () => R.current ? {
|
|
774
|
+
...R.current,
|
|
775
|
+
focus: () => R.current?.getActivator()?.focus(),
|
|
776
|
+
blur: () => R.current?.getActivator()?.blur(),
|
|
777
|
+
hiddenInput: z.current ?? void 0
|
|
778
|
+
} : { hiddenInput: z.current ?? void 0 }), W(() => {
|
|
779
|
+
if (A) {
|
|
780
|
+
if (m?.(), u && R.current) {
|
|
781
|
+
let e = R.current.getActivator();
|
|
782
|
+
e && P(e.getBoundingClientRect().width);
|
|
783
|
+
}
|
|
784
|
+
} else h?.();
|
|
785
|
+
}, [A, u]);
|
|
786
|
+
let de = Yt((e) => {
|
|
787
|
+
if (!_) return;
|
|
788
|
+
let t = e.currentTarget, n = e.relatedTarget;
|
|
789
|
+
!A && (!n || !t.contains(n)) && _(e), e.stopPropagation();
|
|
790
|
+
}, [_, A]);
|
|
791
|
+
if (b) return /* @__PURE__ */ q(kn, {
|
|
792
|
+
value: re(),
|
|
793
|
+
children: ie(", ")
|
|
794
|
+
});
|
|
795
|
+
let pe = typeof v == "function", me = k ?? !pe, ge = E ?? (pe ? void 0 : "listbox"), _e = () => {
|
|
796
|
+
j(!0);
|
|
797
|
+
}, ve = () => {
|
|
798
|
+
j(!1), oe();
|
|
799
|
+
};
|
|
800
|
+
return /* @__PURE__ */ J(tn, { children: [/* @__PURE__ */ q(L, {
|
|
801
|
+
...ee,
|
|
802
|
+
activator: /* @__PURE__ */ q(cr, {
|
|
803
|
+
async: pe,
|
|
804
|
+
error: ae,
|
|
805
|
+
id: c,
|
|
806
|
+
loading: se,
|
|
807
|
+
multiSelect: p,
|
|
808
|
+
onChange: g,
|
|
809
|
+
placeholder: y,
|
|
810
|
+
renderLabel: S,
|
|
811
|
+
setValue: I,
|
|
812
|
+
setShow: j,
|
|
813
|
+
show: A,
|
|
814
|
+
value: F
|
|
815
|
+
}),
|
|
816
|
+
align: e,
|
|
817
|
+
className: (0, Y.default)(n, Ln.richSelect, {
|
|
818
|
+
[o.IgnoreStack]: !!O,
|
|
819
|
+
[`${o.Width}--${O}`]: !!O
|
|
820
|
+
}),
|
|
821
|
+
contentClassName: (0, Y.default)(Ln.popoverContent, { [Ln.autoWidth]: u }),
|
|
822
|
+
style: u && N ? { "--activator-width": `${N}px` } : void 0,
|
|
823
|
+
matchActivatorWidth: !0,
|
|
824
|
+
onActivated: _e,
|
|
825
|
+
onDeactivated: ve,
|
|
826
|
+
ref: R,
|
|
827
|
+
show: A,
|
|
828
|
+
type: ge,
|
|
829
|
+
virtualFocus: me,
|
|
830
|
+
onBlur: de,
|
|
831
|
+
children: /* @__PURE__ */ J("div", {
|
|
832
|
+
className: Ln.wrapper,
|
|
833
|
+
children: [
|
|
834
|
+
s,
|
|
835
|
+
/* @__PURE__ */ q(hr, {
|
|
836
|
+
autoHighlight: t,
|
|
837
|
+
debouncedQuery: B,
|
|
838
|
+
error: ae,
|
|
839
|
+
initialOptions: l,
|
|
840
|
+
loading: se,
|
|
841
|
+
minSearchLength: d,
|
|
842
|
+
multiSelect: p,
|
|
843
|
+
onChange: g,
|
|
844
|
+
options: v,
|
|
845
|
+
query: ne,
|
|
846
|
+
renderOptions: C,
|
|
847
|
+
renderOptionsFooter: w,
|
|
848
|
+
results: V,
|
|
849
|
+
setQuery: M,
|
|
850
|
+
setShow: j,
|
|
851
|
+
setValue: I,
|
|
852
|
+
show: A,
|
|
853
|
+
value: F,
|
|
854
|
+
shouldShowInstructions: ce,
|
|
855
|
+
shouldShowNoResults: ue
|
|
856
|
+
}),
|
|
857
|
+
a
|
|
858
|
+
]
|
|
859
|
+
})
|
|
860
|
+
}), /* @__PURE__ */ q(we, {
|
|
861
|
+
"data-testid": ee["data-testid"],
|
|
862
|
+
getValuesString: re,
|
|
863
|
+
name: f,
|
|
864
|
+
renderHiddenInput: x,
|
|
865
|
+
required: T,
|
|
866
|
+
value: F,
|
|
867
|
+
ref: z
|
|
868
|
+
})] });
|
|
869
|
+
});
|
|
870
|
+
gr.displayName = "IressRichSelect";
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/components/RichSelect/SelectBody/SelectBody.tsx
|
|
873
|
+
var _r = ({ children: e, className: t, footer: n, header: r, ...i }) => /* @__PURE__ */ J(x, {
|
|
874
|
+
...i,
|
|
875
|
+
className: (0, Y.default)(t, ur.selectBody),
|
|
876
|
+
children: [
|
|
877
|
+
r && /* @__PURE__ */ q("div", { children: r }),
|
|
878
|
+
/* @__PURE__ */ q("div", {
|
|
879
|
+
className: ur.children,
|
|
880
|
+
children: e
|
|
881
|
+
}),
|
|
882
|
+
n && /* @__PURE__ */ q("div", { children: n })
|
|
883
|
+
]
|
|
884
|
+
}), vr = ({ fluid: e = !0, heading: t, label: n = "New option", loading: r, onCreate: i, prepend: a = /* @__PURE__ */ q(X, {
|
|
885
|
+
name: "plus",
|
|
886
|
+
screenreaderText: "Add"
|
|
887
|
+
}), ...o }) => {
|
|
888
|
+
let s = `${Te({ id: o.id })}--label`, c = typeof t == "string";
|
|
889
|
+
return /* @__PURE__ */ J(De, {
|
|
890
|
+
...o,
|
|
891
|
+
"aria-labelledby": c ? s : o["aria-labelledby"],
|
|
892
|
+
role: "menu",
|
|
893
|
+
fluid: e,
|
|
894
|
+
children: [c ? /* @__PURE__ */ q(Cr, {
|
|
895
|
+
id: s,
|
|
896
|
+
children: t
|
|
897
|
+
}) : t, /* @__PURE__ */ q(wr, {
|
|
898
|
+
prepend: a,
|
|
899
|
+
onClick: i,
|
|
900
|
+
loading: r,
|
|
901
|
+
children: n
|
|
902
|
+
})]
|
|
903
|
+
});
|
|
904
|
+
}, yr = U((e, t) => {
|
|
905
|
+
let n = en(null), { isActiveInPopover: r, ...i } = R("", { onKeyDown: e.onKeyDown });
|
|
906
|
+
return Qt(t, () => n.current), /* @__PURE__ */ q(Gn, {
|
|
907
|
+
...e,
|
|
908
|
+
...i,
|
|
909
|
+
className: (0, Y.default)(Ln.dropdownClear, { [_e.Active]: r }),
|
|
910
|
+
mode: "tertiary",
|
|
911
|
+
ref: (e) => {
|
|
912
|
+
n.current = e, i?.ref?.(n.current);
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
}), br = ({ children: e, className: t, clearAll: n, onClearAll: r, role: i = "option", ...a }) => /* @__PURE__ */ q(Sr, {
|
|
916
|
+
...a,
|
|
917
|
+
className: (0, Y.default)(Ln.dropdownSelectedHeading, t),
|
|
918
|
+
role: i,
|
|
919
|
+
children: /* @__PURE__ */ J(ci, {
|
|
920
|
+
horizontalAlign: "between",
|
|
921
|
+
verticalAlign: "middle",
|
|
922
|
+
children: [e, n && /* @__PURE__ */ q(yr, {
|
|
923
|
+
onClick: r,
|
|
924
|
+
onKeyDown: (e) => {
|
|
925
|
+
e.key === "Enter" && (e.preventDefault(), r?.(e));
|
|
926
|
+
},
|
|
927
|
+
children: typeof n == "boolean" ? "Clear all" : n
|
|
928
|
+
})]
|
|
929
|
+
})
|
|
930
|
+
}), xr = (e) => {
|
|
931
|
+
let t = Ee();
|
|
932
|
+
return /* @__PURE__ */ q(Ke, {
|
|
933
|
+
...e,
|
|
934
|
+
role: t?.role === "menu" ? void 0 : "presentation"
|
|
935
|
+
});
|
|
936
|
+
}, Sr = ({ append: e, children: t, className: n, divider: r, prepend: i, role: a, ...o }) => {
|
|
937
|
+
let s = Ee(), c = ke() ?? a;
|
|
938
|
+
return /* @__PURE__ */ J(x, {
|
|
939
|
+
...o,
|
|
940
|
+
className: (0, Y.default)(n, Oe.menuItem, Oe.text, {
|
|
941
|
+
[Oe.divider]: r,
|
|
942
|
+
[Oe[`menu--${s?.layout}`]]: !!s?.layout
|
|
943
|
+
}),
|
|
944
|
+
role: c,
|
|
945
|
+
children: [
|
|
946
|
+
i && /* @__PURE__ */ q("div", {
|
|
947
|
+
className: Oe.textPrepend,
|
|
948
|
+
children: i
|
|
949
|
+
}),
|
|
950
|
+
/* @__PURE__ */ q("div", {
|
|
951
|
+
className: Oe.contents,
|
|
952
|
+
children: t
|
|
953
|
+
}),
|
|
954
|
+
e && /* @__PURE__ */ q("div", {
|
|
955
|
+
className: Oe.textAppend,
|
|
956
|
+
children: e
|
|
957
|
+
})
|
|
958
|
+
]
|
|
959
|
+
});
|
|
960
|
+
}, Cr = ({ children: e, className: t, level: n = "h2", ...r }) => /* @__PURE__ */ q(Sr, {
|
|
961
|
+
...r,
|
|
962
|
+
className: (0, Y.default)(t, Oe.heading),
|
|
963
|
+
children: /* @__PURE__ */ q(n, { children: e })
|
|
964
|
+
});
|
|
965
|
+
Cr.Level = c;
|
|
966
|
+
var wr = U(({ append: e, canToggle: t, children: n, className: r, divider: i, onClick: a, onKeyDown: o, prepend: s, role: c, selected: l, value: u, ...d }, f) => {
|
|
967
|
+
let p = ke() ?? c, m = Ae({
|
|
968
|
+
selected: l,
|
|
969
|
+
value: u
|
|
970
|
+
}), { isActiveInPopover: h, ...g } = Ne({
|
|
971
|
+
canToggle: t,
|
|
972
|
+
onClick: a,
|
|
973
|
+
onKeyDown: o,
|
|
974
|
+
role: p,
|
|
975
|
+
selected: l,
|
|
976
|
+
value: u
|
|
977
|
+
}), _ = Me({
|
|
978
|
+
append: e,
|
|
979
|
+
children: n,
|
|
980
|
+
className: r,
|
|
981
|
+
"data-testid": d["data-testid"],
|
|
982
|
+
divider: i,
|
|
983
|
+
prepend: s,
|
|
984
|
+
role: p,
|
|
985
|
+
selected: l,
|
|
986
|
+
value: u
|
|
987
|
+
}, h), v = en(null);
|
|
988
|
+
return Qt(f, () => v.current), Pe(/* @__PURE__ */ q(Gn, {
|
|
989
|
+
...m,
|
|
990
|
+
...g,
|
|
991
|
+
..._,
|
|
992
|
+
...d
|
|
993
|
+
}), p);
|
|
994
|
+
}), Tr = (e) => (C("IressMenu: mapMenuItems has been deprecated and will be removed in a future version of IDS, please map and render the items array directly in your application instead", "warn"), e?.length ? e.map(({ label: e, href: t, onClick: n, divider: r, testId: i, headingLevel: a, selected: o, value: s, key: c }, l) => {
|
|
995
|
+
let u = c ?? String(s ?? l);
|
|
996
|
+
return a ? /* @__PURE__ */ q(Cr, {
|
|
997
|
+
level: a,
|
|
998
|
+
divider: r,
|
|
999
|
+
"data-testid": S(i, "iress-text"),
|
|
1000
|
+
children: e
|
|
1001
|
+
}, u) : /* @__PURE__ */ q(wr, {
|
|
1002
|
+
onClick: n,
|
|
1003
|
+
divider: r,
|
|
1004
|
+
selected: o,
|
|
1005
|
+
"data-testid": S(i, "iress-button"),
|
|
1006
|
+
value: s,
|
|
1007
|
+
href: t,
|
|
1008
|
+
children: e
|
|
1009
|
+
}, u);
|
|
1010
|
+
}) : null), Er = ({ className: e, divider: t, formattedLabel: n, formattedMeta: r, hiddenOnMobile: i, label: a, meta: s, value: c, append: l, canToggle: u, onClick: d, onKeyDown: f, prepend: p, role: m, selected: h, "data-testid": g, "aria-describedby": _, "aria-label": v, "aria-labelledby": y, id: b }) => {
|
|
1011
|
+
if (t) return /* @__PURE__ */ q(xr, {});
|
|
1012
|
+
let x = r === void 0 ? s : r;
|
|
1013
|
+
return /* @__PURE__ */ J(wr, {
|
|
1014
|
+
append: l,
|
|
1015
|
+
canToggle: u,
|
|
1016
|
+
className: (0, Y.default)(e, { [o.HiddenMobile]: i }),
|
|
1017
|
+
onClick: d,
|
|
1018
|
+
onKeyDown: f,
|
|
1019
|
+
prepend: p,
|
|
1020
|
+
role: m,
|
|
1021
|
+
selected: h,
|
|
1022
|
+
value: c ?? a,
|
|
1023
|
+
"data-testid": g,
|
|
1024
|
+
"aria-describedby": _,
|
|
1025
|
+
"aria-label": v,
|
|
1026
|
+
"aria-labelledby": y,
|
|
1027
|
+
id: b,
|
|
1028
|
+
children: [n ?? a, x && /* @__PURE__ */ q("span", {
|
|
1029
|
+
className: "iress-display--block",
|
|
1030
|
+
children: x
|
|
1031
|
+
})]
|
|
1032
|
+
});
|
|
1033
|
+
}, Dr = ({ heading: e, hideSelectedItems: t, items: n = [], limitDesktop: r, limitMobile: i, multiSelect: a, noResults: o, onChange: s, selected: c, selectedFirst: l, ...u }) => {
|
|
1034
|
+
let d = `${Te({ id: u.id })}--label`, f = G(() => Fe(c, a), [a, c]), p = G(() => {
|
|
1035
|
+
let e = l ? Or(n, c, f) : n;
|
|
1036
|
+
if (t) {
|
|
1037
|
+
let t = M(f);
|
|
1038
|
+
e = e.filter((e) => !t.includes(ue(e.value) ?? e.label));
|
|
1039
|
+
}
|
|
1040
|
+
return kr(e, r, i);
|
|
1041
|
+
}, [
|
|
1042
|
+
t,
|
|
1043
|
+
n,
|
|
1044
|
+
r,
|
|
1045
|
+
i,
|
|
1046
|
+
f,
|
|
1047
|
+
c,
|
|
1048
|
+
l
|
|
1049
|
+
]), m = p.length === 0, h = Yt((e) => {
|
|
1050
|
+
let t = Ar(n, c, e);
|
|
1051
|
+
s?.(a ? t : t[0]);
|
|
1052
|
+
}, [
|
|
1053
|
+
n,
|
|
1054
|
+
a,
|
|
1055
|
+
s,
|
|
1056
|
+
c
|
|
1057
|
+
]);
|
|
1058
|
+
return /* @__PURE__ */ J(De, {
|
|
1059
|
+
...u,
|
|
1060
|
+
"aria-labelledby": typeof e == "string" ? d : u["aria-labelledby"],
|
|
1061
|
+
multiSelect: a,
|
|
1062
|
+
onChange: h,
|
|
1063
|
+
role: "listbox",
|
|
1064
|
+
selected: f,
|
|
1065
|
+
children: [
|
|
1066
|
+
typeof e == "string" ? /* @__PURE__ */ q(Cr, {
|
|
1067
|
+
id: d,
|
|
1068
|
+
children: e
|
|
1069
|
+
}) : e,
|
|
1070
|
+
p.map((e, t) => /* @__PURE__ */ qt(Er, {
|
|
1071
|
+
...e,
|
|
1072
|
+
"data-testid": S(u?.["data-testid"], "menu-item"),
|
|
1073
|
+
key: `${B(e.value ?? e.label)}-${t}`
|
|
1074
|
+
})),
|
|
1075
|
+
m && (typeof o == "string" ? /* @__PURE__ */ q(Sr, { children: o }) : o)
|
|
1076
|
+
]
|
|
1077
|
+
});
|
|
1078
|
+
}, Or = (e, t, n) => {
|
|
1079
|
+
let r = M(t), i = M(n), a = e.filter((e) => !i.includes(e.value ?? e.label));
|
|
1080
|
+
return r.length && a.length ? r.concat([{
|
|
1081
|
+
label: "",
|
|
1082
|
+
value: "",
|
|
1083
|
+
divider: !0
|
|
1084
|
+
}]).concat(a) : r.concat(a);
|
|
1085
|
+
}, kr = (e, t, n) => e.map((e, t) => ({
|
|
1086
|
+
...e,
|
|
1087
|
+
hiddenOnMobile: n ? t > n - 1 : !1
|
|
1088
|
+
})).slice(0, t ?? e.length), Ar = (e, t, n) => {
|
|
1089
|
+
let r = M(t);
|
|
1090
|
+
return M(n).map((t) => jr(e, r, t)).filter((e) => e !== void 0);
|
|
1091
|
+
}, jr = (e, t, n) => e?.find((e) => e.value === n || e.value === void 0 && e.label === n) ?? t.find((e) => e.value === n || e.value === void 0 && e.label === n), Mr = {
|
|
1092
|
+
selectSearchInput: "ids-select-search-input-v5209",
|
|
1093
|
+
"ids-input": "ids-input-v5209",
|
|
1094
|
+
"ids-input--wrapper": "ids-input--wrapper-v5209",
|
|
1095
|
+
"ids-input--addon": "ids-input--addon-v5209",
|
|
1096
|
+
"ids-input--prepend": "ids-input--prepend-v5209",
|
|
1097
|
+
"ids-input-base--form-control": "ids-input-base--form-control-v5209",
|
|
1098
|
+
"ids-input--internal": "ids-input--internal-v5209"
|
|
1099
|
+
}, Nr = U(({ autoComplete: e = "off", className: t, placeholder: n = "Search", prepend: r = /* @__PURE__ */ q(X, { name: "search" }), watermark: i = !0, ...a }, o) => {
|
|
1100
|
+
let s = en(null), { isActiveInPopover: c, ...l } = R();
|
|
1101
|
+
return Qt(o, () => s.current), /* @__PURE__ */ q(An, {
|
|
1102
|
+
...a,
|
|
1103
|
+
...l,
|
|
1104
|
+
tabIndex: void 0,
|
|
1105
|
+
autoComplete: e,
|
|
1106
|
+
className: (0, Y.default)(t, Mr.selectSearchInput, { [Mr.isActiveInPopover]: c }),
|
|
1107
|
+
placeholder: n,
|
|
1108
|
+
prepend: r,
|
|
1109
|
+
ref: (e) => {
|
|
1110
|
+
s.current = e, l?.ref?.(s.current?.input ?? null);
|
|
1111
|
+
},
|
|
1112
|
+
watermark: i
|
|
1113
|
+
});
|
|
1114
|
+
});
|
|
1115
|
+
Nr.displayName = "IressSelectSearchInput";
|
|
1116
|
+
//#endregion
|
|
1117
|
+
//#region src/components/Autocomplete/Autocomplete.tsx
|
|
1118
|
+
var Pr = U(({ alwaysShowOnFocus: e, append: t = /* @__PURE__ */ q(X, { name: "search" }), autoComplete: n = "off", autoSelect: r = !0, className: i, clearable: a = !0, "data-testid": o, debounceThreshold: s, defaultValue: c, errorText: l = /* @__PURE__ */ q(hn, {
|
|
1119
|
+
status: "danger",
|
|
1120
|
+
children: "An unknown error occurred. Please contact support if the error persists."
|
|
1121
|
+
}), initialOptions: u, limitDesktop: d = 12, limitMobile: f = 6, minSearchLength: p, noResultsText: m, onChange: h, onClear: g, onFocus: _, options: v, popoverProps: { autoHighlight: y = !1, append: b, prepend: x, ...C } = {}, readOnly: w, value: D, watermark: O = !0, ...k }, ee) => {
|
|
1122
|
+
let [te, A] = K(!1), { value: j, setValue: ne } = N({
|
|
1123
|
+
component: "IressAutocomplete",
|
|
1124
|
+
defaultValue: c,
|
|
1125
|
+
value: D
|
|
1126
|
+
}), [P, F] = K(!1), { clearError: I, debouncedQuery: re, error: ie, loading: L, results: R, startSearch: B, stopSearch: ae, shouldShowInstructions: V, shouldShowNoResults: oe } = fe({
|
|
1127
|
+
debounceThreshold: s,
|
|
1128
|
+
initialOptions: u,
|
|
1129
|
+
minSearchLength: p,
|
|
1130
|
+
options: v,
|
|
1131
|
+
query: ue(j)
|
|
1132
|
+
});
|
|
1133
|
+
if (W(() => {
|
|
1134
|
+
P && !te && R.length > 0 && A(!0);
|
|
1135
|
+
}, [
|
|
1136
|
+
R.length,
|
|
1137
|
+
te,
|
|
1138
|
+
P
|
|
1139
|
+
]), W(() => {
|
|
1140
|
+
ie && A(!0);
|
|
1141
|
+
}, [ie]), w) return /* @__PURE__ */ q(kn, { value: j });
|
|
1142
|
+
let se = (e, t) => {
|
|
1143
|
+
h?.(e, t), ne(t), F(!!t);
|
|
1144
|
+
}, ce = (e) => {
|
|
1145
|
+
g?.(e), ne("");
|
|
1146
|
+
}, le = (e) => {
|
|
1147
|
+
_?.(e), u?.length && A(!0);
|
|
1148
|
+
}, pe = (e) => {
|
|
1149
|
+
k.onKeyDown?.(e), e.key === "ArrowDown" && (!te || !P) && (R.length || B(!0), F(!0), A(!0));
|
|
1150
|
+
}, he = (e) => {
|
|
1151
|
+
let t = M(e)?.[0];
|
|
1152
|
+
h?.(de(t?.label), t?.label, t), ne(t?.label), A(!1), F(!1);
|
|
1153
|
+
}, ge = () => {
|
|
1154
|
+
(!e || !j) && ae(), I(), A(!1), j && F(!1);
|
|
1155
|
+
};
|
|
1156
|
+
return /* @__PURE__ */ J(z, {
|
|
1157
|
+
...C,
|
|
1158
|
+
activator: /* @__PURE__ */ q(An, {
|
|
1159
|
+
...k,
|
|
1160
|
+
append: t,
|
|
1161
|
+
autoComplete: n,
|
|
1162
|
+
clearable: a,
|
|
1163
|
+
"data-testid": S(o, "input"),
|
|
1164
|
+
loading: L,
|
|
1165
|
+
onChange: se,
|
|
1166
|
+
onClear: ce,
|
|
1167
|
+
onFocus: le,
|
|
1168
|
+
onKeyDown: pe,
|
|
1169
|
+
value: j,
|
|
1170
|
+
watermark: O,
|
|
1171
|
+
ref: ee
|
|
1172
|
+
}),
|
|
1173
|
+
autoHighlight: y,
|
|
1174
|
+
className: (0, Y.default)(i, C.className, T.autocomplete),
|
|
1175
|
+
contentClassName: (0, Y.default)(C.contentClassName, T.popoverContent),
|
|
1176
|
+
"data-testid": o,
|
|
1177
|
+
minLength: 0,
|
|
1178
|
+
onActivated: () => (P || e) && A(!0),
|
|
1179
|
+
onDeactivated: ge,
|
|
1180
|
+
show: te,
|
|
1181
|
+
type: "listbox",
|
|
1182
|
+
children: [
|
|
1183
|
+
R.length > 0 && /* @__PURE__ */ J(tn, { children: [
|
|
1184
|
+
x,
|
|
1185
|
+
/* @__PURE__ */ q(Dr, {
|
|
1186
|
+
changeOnBlur: r,
|
|
1187
|
+
className: T.optionList,
|
|
1188
|
+
"data-testid": S(o, "menu"),
|
|
1189
|
+
items: R,
|
|
1190
|
+
limitDesktop: d,
|
|
1191
|
+
limitMobile: f,
|
|
1192
|
+
onChange: he,
|
|
1193
|
+
selected: { label: re }
|
|
1194
|
+
}),
|
|
1195
|
+
b
|
|
1196
|
+
] }),
|
|
1197
|
+
ie && l,
|
|
1198
|
+
V && !ie && /* @__PURE__ */ q(me, {
|
|
1199
|
+
minSearchLength: p ?? 1,
|
|
1200
|
+
styles: T
|
|
1201
|
+
}),
|
|
1202
|
+
oe && !ie && /* @__PURE__ */ q(E, {
|
|
1203
|
+
noResultsText: m,
|
|
1204
|
+
styles: T
|
|
1205
|
+
})
|
|
1206
|
+
]
|
|
1207
|
+
});
|
|
1208
|
+
});
|
|
1209
|
+
Pr.displayName = "IressAutocomplete";
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/components/ButtonGroup/ButtonGroup.tsx
|
|
1212
|
+
var Fr = ({ children: e, className: t, "data-testid": n, defaultSelected: r, hiddenLabel: i, label: a, multiple: s, onChange: c, options: l, selected: u, ...d }) => {
|
|
1213
|
+
let f = Te({ id: d.id }), p = `${f}--label`, m = G(() => typeof a == "string" ? /* @__PURE__ */ q("div", {
|
|
1214
|
+
id: p,
|
|
1215
|
+
className: (0, Y.default)(xe.label, { [o.SROnly]: i }),
|
|
1216
|
+
"data-testid": S(n, "label"),
|
|
1217
|
+
children: a
|
|
1218
|
+
}) : Gt(a, { id: p }), [
|
|
1219
|
+
n,
|
|
1220
|
+
i,
|
|
1221
|
+
p,
|
|
1222
|
+
a
|
|
1223
|
+
]);
|
|
1224
|
+
return /* @__PURE__ */ q(be, {
|
|
1225
|
+
defaultSelected: r,
|
|
1226
|
+
multiple: s,
|
|
1227
|
+
onChange: c,
|
|
1228
|
+
selected: u,
|
|
1229
|
+
children: /* @__PURE__ */ J("div", {
|
|
1230
|
+
className: (0, Y.default)(t, xe.buttonGroup),
|
|
1231
|
+
id: f,
|
|
1232
|
+
"data-testid": n,
|
|
1233
|
+
...d,
|
|
1234
|
+
children: [m, /* @__PURE__ */ J("div", {
|
|
1235
|
+
role: "group",
|
|
1236
|
+
"aria-labelledby": p,
|
|
1237
|
+
className: xe.values,
|
|
1238
|
+
children: [e, M(l).map((e) => /* @__PURE__ */ q(Gn, {
|
|
1239
|
+
"data-testid": S(n, "button__button"),
|
|
1240
|
+
children: e
|
|
1241
|
+
}, e))]
|
|
1242
|
+
})]
|
|
1243
|
+
})
|
|
1244
|
+
});
|
|
1245
|
+
}, Ir = "ids-checkbox--label-v5209", Lr = "ids-checkbox--mark-v5209", Rr = "ids-checkbox--checked-v5209", zr = "ids-checkbox--indeterminate-v5209", Br = "ids-checkbox-v5209", Vr = "ids-checkbox--focus-v5209", Hr = "ids-checkbox--hidden-control-v5209", Ur = "ids-checkbox--input-v5209", Wr = "ids-checkbox--touch-v5209", Gr = "ids-checkbox--hidden-label-v5209", Kr = "ids-checkbox--label-span-v5209", qr = {
|
|
1246
|
+
label: Ir,
|
|
1247
|
+
mark: Lr,
|
|
1248
|
+
checked: Rr,
|
|
1249
|
+
indeterminate: zr,
|
|
1250
|
+
checkbox: Br,
|
|
1251
|
+
"ids-checkboxMark": "ids-checkbox-mark-v5209",
|
|
1252
|
+
focus: Vr,
|
|
1253
|
+
hiddenControl: Hr,
|
|
1254
|
+
input: Ur,
|
|
1255
|
+
touch: Wr,
|
|
1256
|
+
hiddenLabel: Gr,
|
|
1257
|
+
labelSpan: Kr
|
|
1258
|
+
}, Jr = U(({ checked: e, className: t, defaultChecked: n, hiddenControl: r, hiddenLabel: i, indeterminate: a, id: s, name: c, onChange: l, value: u, children: d, readOnly: f, touch: p, ...m }, h) => {
|
|
1259
|
+
le({
|
|
1260
|
+
component: "IressCheckbox",
|
|
1261
|
+
defaultValue: n,
|
|
1262
|
+
message: "Using the `defaultChecked` prop on an `IressCheckbox` inside an `IressForm` component is not supported. Please use the `defaultValue` prop on the `IressFormField`, or use `defaultValues` on the `IressForm` component (recommended) to ensure a single source of truth for your form."
|
|
1263
|
+
});
|
|
1264
|
+
let g = en(null), _ = g.current, v = Zt(), y = s ?? v, [b, x] = K(a ?? !1), S = Xt(Le), C = S ? void 0 : n, w = S ? M(S.value).includes(u) : e, T = S?.hiddenCheckbox ?? r, E = S?.touch ?? p, D = S?.readonly ?? f, O = S?.name ?? c, { value: k, setValue: ee, isControlled: te } = N({
|
|
1265
|
+
component: "IressCheckbox",
|
|
1266
|
+
propName: "checked",
|
|
1267
|
+
defaultValue: C,
|
|
1268
|
+
value: w
|
|
1269
|
+
}), A = te ? a : b, j = Yt((e) => {
|
|
1270
|
+
te || x(!1), ee(e.target.checked), l?.(e, u), S?.onChange?.(e, u);
|
|
1271
|
+
}, [
|
|
1272
|
+
S,
|
|
1273
|
+
te,
|
|
1274
|
+
l,
|
|
1275
|
+
ee,
|
|
1276
|
+
u
|
|
1277
|
+
]);
|
|
1278
|
+
return Qt(h, () => ({
|
|
1279
|
+
focus: () => _?.focus(),
|
|
1280
|
+
blur: () => _?.blur(),
|
|
1281
|
+
input: _,
|
|
1282
|
+
check: (e) => {
|
|
1283
|
+
ee(e);
|
|
1284
|
+
},
|
|
1285
|
+
reset: () => {
|
|
1286
|
+
ee(!1);
|
|
1287
|
+
}
|
|
1288
|
+
})), D ? k ? /* @__PURE__ */ q(kn, {
|
|
1289
|
+
...m,
|
|
1290
|
+
width: void 0,
|
|
1291
|
+
value: B(u),
|
|
1292
|
+
children: d
|
|
1293
|
+
}) : null : /* @__PURE__ */ J("div", {
|
|
1294
|
+
className: (0, Y.default)(t, {
|
|
1295
|
+
[o.FormElement]: !0,
|
|
1296
|
+
[qr.checkbox]: !0,
|
|
1297
|
+
[qr.checked]: k,
|
|
1298
|
+
[qr.hiddenControl]: T,
|
|
1299
|
+
[qr.hiddenLabel]: i,
|
|
1300
|
+
[qr.indeterminate]: A,
|
|
1301
|
+
[qr.touch]: E
|
|
1302
|
+
}),
|
|
1303
|
+
children: [/* @__PURE__ */ q("input", {
|
|
1304
|
+
...m,
|
|
1305
|
+
value: B(u),
|
|
1306
|
+
type: "checkbox",
|
|
1307
|
+
id: y,
|
|
1308
|
+
defaultChecked: te ? void 0 : k,
|
|
1309
|
+
checked: te ? k : void 0,
|
|
1310
|
+
className: (0, Y.default)(qr.input, o.SROnly),
|
|
1311
|
+
onChange: j,
|
|
1312
|
+
ref: g,
|
|
1313
|
+
name: O
|
|
1314
|
+
}), /* @__PURE__ */ J("label", {
|
|
1315
|
+
htmlFor: y,
|
|
1316
|
+
className: (0, Y.default)({ [qr.label]: !0 }),
|
|
1317
|
+
children: [!T && /* @__PURE__ */ q(je, {
|
|
1318
|
+
className: qr.mark,
|
|
1319
|
+
checked: k,
|
|
1320
|
+
indeterminate: A
|
|
1321
|
+
}), /* @__PURE__ */ q("span", {
|
|
1322
|
+
className: (0, Y.default)(qr.labelSpan, { [o.SROnly]: i }),
|
|
1323
|
+
children: d
|
|
1324
|
+
})]
|
|
1325
|
+
})]
|
|
1326
|
+
});
|
|
1327
|
+
});
|
|
1328
|
+
Jr.displayName = "IressCheckbox";
|
|
1329
|
+
//#endregion
|
|
1330
|
+
//#region src/components/Combobox/components/ComboboxResultsDescriptor.tsx
|
|
1331
|
+
var Yr = ({ loading: e, noResultsText: t = "No results", results: n = [], show: r, value: i, ...a }) => {
|
|
1332
|
+
let s = G(() => e ? "loading" : r && !n.length ? t : r && n.length ? ge(n, "{{numOptions}} results") : ge(i) || "None selected", [
|
|
1333
|
+
e,
|
|
1334
|
+
t,
|
|
1335
|
+
n,
|
|
1336
|
+
r,
|
|
1337
|
+
i
|
|
1338
|
+
]);
|
|
1339
|
+
return /* @__PURE__ */ q("div", {
|
|
1340
|
+
...a,
|
|
1341
|
+
className: o.SROnly,
|
|
1342
|
+
children: s
|
|
1343
|
+
});
|
|
1344
|
+
}, Xr = ({ append: e, dataTestId: t, noResultsText: n, prepend: r, showNoResults: i, showResults: a, ...o }) => /* @__PURE__ */ J(tn, { children: [a && /* @__PURE__ */ J(tn, { children: [
|
|
1345
|
+
r,
|
|
1346
|
+
/* @__PURE__ */ q(Dr, {
|
|
1347
|
+
...o,
|
|
1348
|
+
className: Be.optionList,
|
|
1349
|
+
"data-testid": S(t, "menu")
|
|
1350
|
+
}),
|
|
1351
|
+
e
|
|
1352
|
+
] }), i && /* @__PURE__ */ q(E, {
|
|
1353
|
+
noResultsText: n,
|
|
1354
|
+
styles: Be
|
|
1355
|
+
})] }), Zr = U(({ append: e = /* @__PURE__ */ q(X, { name: "search" }), autoComplete: t = "off", autoSelect: n = !0, className: r, clearable: i = !0, "data-testid": a, debounceThreshold: o, defaultValue: s, hiddenInputProps: c, id: l, initialOptions: u, limitDesktop: d = 12, limitMobile: f = 6, name: p, noResultsText: m, onBlur: h, onChange: g, onClear: _, onFocus: v, onKeyDown: y, options: b, popoverProps: { append: x, prepend: C, ...w } = {}, readOnly: T, required: E, value: D, watermark: O = !0, ...k }, ee) => {
|
|
1356
|
+
le({
|
|
1357
|
+
component: "IressCombobox",
|
|
1358
|
+
defaultValue: s
|
|
1359
|
+
});
|
|
1360
|
+
let te = Te({ id: l }), A = `${te}-sr-text`, j = en(null), [ne, N] = K(!1), { value: P, setValue: F, getLabelsString: I, getValuesString: re } = he({
|
|
1361
|
+
component: "IressCombobox",
|
|
1362
|
+
defaultValue: s,
|
|
1363
|
+
value: D
|
|
1364
|
+
}), [ie, L] = K(""), [R, B] = K(I()), { debouncedQuery: ae, loading: V, results: oe, stopSearch: se, shouldShowInstructions: ce, shouldShowDebounceWaiting: ue, shouldShowNoResults: pe, displayResults: me } = fe({
|
|
1365
|
+
debounceThreshold: o,
|
|
1366
|
+
initialOptions: u,
|
|
1367
|
+
options: b,
|
|
1368
|
+
query: ie
|
|
1369
|
+
}), ge = He({
|
|
1370
|
+
debouncedQuery: ae,
|
|
1371
|
+
loading: V,
|
|
1372
|
+
results: oe,
|
|
1373
|
+
shouldShowInstructions: ce,
|
|
1374
|
+
shouldShowDebounceWaiting: ue,
|
|
1375
|
+
shouldShowNoResults: pe,
|
|
1376
|
+
displayResults: me
|
|
1377
|
+
}), _e = Ue({
|
|
1378
|
+
autoSelect: n,
|
|
1379
|
+
debouncedQuery: ae,
|
|
1380
|
+
debounceThreshold: o,
|
|
1381
|
+
onChange: g,
|
|
1382
|
+
queryRef: j,
|
|
1383
|
+
results: oe,
|
|
1384
|
+
setTypedQuery: B,
|
|
1385
|
+
setValue: F
|
|
1386
|
+
});
|
|
1387
|
+
if (T) return /* @__PURE__ */ q(kn, {
|
|
1388
|
+
value: re(),
|
|
1389
|
+
children: I()
|
|
1390
|
+
});
|
|
1391
|
+
let ve = (e) => {
|
|
1392
|
+
let t = e.target.value;
|
|
1393
|
+
L(t), B(t), t || (F(void 0), g?.(de(void 0), void 0), u && N(!0));
|
|
1394
|
+
}, ye = (e) => {
|
|
1395
|
+
_?.(e), L(""), B(""), F(void 0), N(!1);
|
|
1396
|
+
}, be = (e) => {
|
|
1397
|
+
v?.(e), ie || L(R);
|
|
1398
|
+
}, xe = (e) => {
|
|
1399
|
+
h?.(e), B(P ? I() : "");
|
|
1400
|
+
}, Se = (e) => {
|
|
1401
|
+
y?.(e), _e.setKeyPressed(e.nativeEvent);
|
|
1402
|
+
}, Ce = (e) => {
|
|
1403
|
+
let t = M(e)?.[0];
|
|
1404
|
+
F(t), g?.(de(t), t), B(t?.label), N(!1);
|
|
1405
|
+
}, we = () => {
|
|
1406
|
+
N(!1), se();
|
|
1407
|
+
}, Ee = (e) => {
|
|
1408
|
+
e !== null && (_e.setKeyPressed(void 0), _e.highlightQueryByActiveIndex(e));
|
|
1409
|
+
};
|
|
1410
|
+
return /* @__PURE__ */ J("div", {
|
|
1411
|
+
className: (0, Y.default)(r, Be.combobox),
|
|
1412
|
+
"data-testid": a,
|
|
1413
|
+
children: [
|
|
1414
|
+
/* @__PURE__ */ q(z, {
|
|
1415
|
+
...w,
|
|
1416
|
+
activator: /* @__PURE__ */ q(An, {
|
|
1417
|
+
...k,
|
|
1418
|
+
append: e,
|
|
1419
|
+
autoComplete: t,
|
|
1420
|
+
"aria-describedby": A,
|
|
1421
|
+
clearable: i,
|
|
1422
|
+
loading: V,
|
|
1423
|
+
"data-testid": S(a, "input"),
|
|
1424
|
+
id: te,
|
|
1425
|
+
onBlur: xe,
|
|
1426
|
+
onChange: ve,
|
|
1427
|
+
onClear: ye,
|
|
1428
|
+
onFocus: be,
|
|
1429
|
+
onKeyDown: Se,
|
|
1430
|
+
ref: j,
|
|
1431
|
+
value: R,
|
|
1432
|
+
watermark: O
|
|
1433
|
+
}),
|
|
1434
|
+
className: (0, Y.default)(r, Be.popover),
|
|
1435
|
+
contentClassName: Be.popoverContent,
|
|
1436
|
+
minLength: u?.length ? 0 : k.minLength,
|
|
1437
|
+
onActivated: () => N(!0),
|
|
1438
|
+
onDeactivated: we,
|
|
1439
|
+
onNavigate: Ee,
|
|
1440
|
+
show: ne,
|
|
1441
|
+
type: "listbox",
|
|
1442
|
+
"data-testid": S(a, "popover"),
|
|
1443
|
+
children: /* @__PURE__ */ q(Xr, {
|
|
1444
|
+
append: x,
|
|
1445
|
+
dataTestId: a,
|
|
1446
|
+
limitDesktop: d,
|
|
1447
|
+
limitMobile: f,
|
|
1448
|
+
noResultsText: m,
|
|
1449
|
+
onChange: Ce,
|
|
1450
|
+
prepend: C,
|
|
1451
|
+
items: oe,
|
|
1452
|
+
selected: P,
|
|
1453
|
+
showNoResults: ge.showNoResults,
|
|
1454
|
+
showResults: ge.showResults
|
|
1455
|
+
})
|
|
1456
|
+
}),
|
|
1457
|
+
/* @__PURE__ */ q(Ve, {
|
|
1458
|
+
hiddenInputProps: c,
|
|
1459
|
+
dataTestId: a,
|
|
1460
|
+
name: p,
|
|
1461
|
+
ref: ee,
|
|
1462
|
+
required: E,
|
|
1463
|
+
value: re()
|
|
1464
|
+
}),
|
|
1465
|
+
/* @__PURE__ */ q(Yr, {
|
|
1466
|
+
"data-testid": S(a, "results-sr-text"),
|
|
1467
|
+
id: A,
|
|
1468
|
+
loading: V,
|
|
1469
|
+
noResultsText: m,
|
|
1470
|
+
results: oe
|
|
1471
|
+
})
|
|
1472
|
+
]
|
|
1473
|
+
});
|
|
1474
|
+
});
|
|
1475
|
+
Zr.displayName = "IressCombobox", Zr.DisplayMode = i, Zr.Width = a;
|
|
1476
|
+
var Qr = {
|
|
1477
|
+
tag: "ids-tag-v5209",
|
|
1478
|
+
content: "ids-tag--content-v5209",
|
|
1479
|
+
"ids-menuItem": "ids-menu-item-v5209",
|
|
1480
|
+
"ids-closeButton": "ids-close-button-v5209",
|
|
1481
|
+
"ids-popover--activator": "ids-popover--activator-v5209"
|
|
1482
|
+
}, $r = ({ children: e, className: t, "data-testid": n, deleteButton: r, deleteButtonText: i = "Delete", onDelete: a, onDeleteButtonBlur: o, ...s }) => {
|
|
1483
|
+
let c = en(null);
|
|
1484
|
+
return /* @__PURE__ */ J("div", {
|
|
1485
|
+
className: (0, Y.default)(t, "iress-u-text", Qr.tag),
|
|
1486
|
+
"data-testid": n,
|
|
1487
|
+
...s,
|
|
1488
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1489
|
+
ref: c,
|
|
1490
|
+
className: Qr.content,
|
|
1491
|
+
children: e
|
|
1492
|
+
}), r ?? /* @__PURE__ */ q(qn, {
|
|
1493
|
+
onClick: (e) => a?.(c.current?.textContent ?? "", e),
|
|
1494
|
+
onBlur: o,
|
|
1495
|
+
screenreaderText: i,
|
|
1496
|
+
"data-testid": S(n, "delete-button__button")
|
|
1497
|
+
})]
|
|
1498
|
+
});
|
|
1499
|
+
}, ei = "ids-tag-list-input--input-v5209", ti = "ids-tag-list-input--readonly-v5209", ni = "ids-tag-list-input-v5209 ids-tag-list-input--input-v5209", ri = "ids-tag-list-input--tag-list-input__label-v5209", ii = "ids-tag-list-input--tag-list-input__items-v5209", ai = "ids-tag-list-input--tag-list-input__items-inner-v5209", oi = "ids-tag-list-input--focus-v5209", si = {
|
|
1500
|
+
input: ei,
|
|
1501
|
+
readonly: ti,
|
|
1502
|
+
"ids-field-group--join": "ids-field-group--join-v5209",
|
|
1503
|
+
"ids-field-group--fields": "ids-field-group--fields-v5209",
|
|
1504
|
+
"ids-field": "ids-field-v5209",
|
|
1505
|
+
tagListInput: ni,
|
|
1506
|
+
"ids-input--addon": "ids-input--addon-v5209",
|
|
1507
|
+
"ids-clear-button--clear": "ids-clear-button--clear-v5209",
|
|
1508
|
+
tagListInput__label: ri,
|
|
1509
|
+
tagListInput__items: ii,
|
|
1510
|
+
"ids-input--watermark": "ids-input--watermark-v5209",
|
|
1511
|
+
"ids-inline": "ids-inline-v5209",
|
|
1512
|
+
"ids-input": "ids-input-v5209",
|
|
1513
|
+
tagListInput__itemsInner: ai,
|
|
1514
|
+
"iress-u-inline": "ids-tag-list-input--iress-u-inline-v5209",
|
|
1515
|
+
"ids-tag": "ids-tag-v5209",
|
|
1516
|
+
"pseudo-focus": "ids-tag-list-input--pseudo-focus-v5209",
|
|
1517
|
+
focus: oi
|
|
1518
|
+
}, ci = ({ children: e, className: t, gutter: n = "none", horizontalAlign: r = "left", noWrap: i = !1, verticalAlign: a = "top", ...o }) => {
|
|
1519
|
+
let s = {
|
|
1520
|
+
[`${We.HorizontalAlign}--${r}`]: !0,
|
|
1521
|
+
[We.NoWrap]: i,
|
|
1522
|
+
[`${We.VerticalAlign}--${a}`]: !0
|
|
1523
|
+
};
|
|
1524
|
+
return /* @__PURE__ */ q("div", {
|
|
1525
|
+
className: (0, Y.default)(t, We.Base, Re(We.Gutter, n, "none"), s),
|
|
1526
|
+
...o,
|
|
1527
|
+
children: e
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
ci.Gutter = s, ci.HorizontalAlign = l, ci.VerticalAlign = h;
|
|
1531
|
+
//#endregion
|
|
1532
|
+
//#region src/components/Tag/components/TagListInput/TagListInput.tsx
|
|
1533
|
+
var li = ({ "data-testid": e, deleteButton: t, onTagDelete: n, onTagDeleteAll: r, onTagDeleteButtonBlur: i, selectedOptionsTagText: a, tags: o = [], tagLimit: s = 5 }) => o.length <= s ? o.map((r) => /* @__PURE__ */ q($r, {
|
|
1534
|
+
deleteButton: t,
|
|
1535
|
+
deleteButtonText: `Delete ${r}`,
|
|
1536
|
+
onDelete: n,
|
|
1537
|
+
onDeleteButtonBlur: i,
|
|
1538
|
+
"data-testid": S(e, "tag"),
|
|
1539
|
+
children: r
|
|
1540
|
+
}, r)) : /* @__PURE__ */ J($r, {
|
|
1541
|
+
deleteButton: t,
|
|
1542
|
+
onDelete: r,
|
|
1543
|
+
onDeleteButtonBlur: i,
|
|
1544
|
+
"data-testid": S(e, "tag"),
|
|
1545
|
+
children: [
|
|
1546
|
+
String(o.length) || "0",
|
|
1547
|
+
" ",
|
|
1548
|
+
a
|
|
1549
|
+
]
|
|
1550
|
+
}), ui = U(({ append: e, children: t, className: n, "data-testid": r, deleteButton: i, onTagDelete: a, onTagDeleteAll: o, onTagDeleteButtonBlur: s, prepend: c, selectedOptionsTagText: l = "selected", styles: u, tags: d = [], tagLimit: f = 5, watermark: p, ...m }, h) => {
|
|
1551
|
+
let g = (e) => u?.[e] ?? si[e];
|
|
1552
|
+
return /* @__PURE__ */ q("div", {
|
|
1553
|
+
className: (0, Y.default)(n, g("tagListInput")),
|
|
1554
|
+
"data-testid": r,
|
|
1555
|
+
children: /* @__PURE__ */ J("div", {
|
|
1556
|
+
className: (0, Y.default)(g("tagListInput__items"), { [Z.watermark]: p }),
|
|
1557
|
+
"data-testid": S(r, "items"),
|
|
1558
|
+
children: [
|
|
1559
|
+
c && /* @__PURE__ */ q("div", {
|
|
1560
|
+
className: (0, Y.default)({ [Z.addon]: !0 }),
|
|
1561
|
+
children: c
|
|
1562
|
+
}),
|
|
1563
|
+
/* @__PURE__ */ q("div", {
|
|
1564
|
+
className: g("tagListInput__itemsInner"),
|
|
1565
|
+
children: /* @__PURE__ */ J(ci, {
|
|
1566
|
+
gutter: "xs",
|
|
1567
|
+
verticalAlign: "middle",
|
|
1568
|
+
children: [
|
|
1569
|
+
/* @__PURE__ */ q(li, {
|
|
1570
|
+
"data-testid": r,
|
|
1571
|
+
deleteButton: i,
|
|
1572
|
+
onTagDelete: a,
|
|
1573
|
+
onTagDeleteAll: o,
|
|
1574
|
+
onTagDeleteButtonBlur: s,
|
|
1575
|
+
selectedOptionsTagText: l,
|
|
1576
|
+
tags: d,
|
|
1577
|
+
tagLimit: f
|
|
1578
|
+
}),
|
|
1579
|
+
t,
|
|
1580
|
+
/* @__PURE__ */ q(An, {
|
|
1581
|
+
...m,
|
|
1582
|
+
className: g("tagListInput__element"),
|
|
1583
|
+
autoComplete: "off",
|
|
1584
|
+
"data-testid": S(r, "input"),
|
|
1585
|
+
ref: h
|
|
1586
|
+
})
|
|
1587
|
+
]
|
|
1588
|
+
})
|
|
1589
|
+
}),
|
|
1590
|
+
e && /* @__PURE__ */ q("div", {
|
|
1591
|
+
className: (0, Y.default)({
|
|
1592
|
+
[Z.addon]: !0,
|
|
1593
|
+
[Z.append]: !0
|
|
1594
|
+
}),
|
|
1595
|
+
children: e
|
|
1596
|
+
})
|
|
1597
|
+
]
|
|
1598
|
+
})
|
|
1599
|
+
});
|
|
1600
|
+
});
|
|
1601
|
+
ui.displayName = "TagListInput";
|
|
1602
|
+
//#endregion
|
|
1603
|
+
//#region src/components/Combobox/MultiCombobox/MultiCombobox.tsx
|
|
1604
|
+
var di = U(({ append: e = /* @__PURE__ */ q(X, { name: "search" }), autoComplete: t = "off", autoSelect: n = !0, className: r, clearable: i = !0, "data-testid": a, debounceThreshold: o, defaultValue: s, hiddenInputProps: c, id: l, initialOptions: u, limitDesktop: d = 12, limitMobile: f = 6, multiOptionTagLimit: p = 4, name: m, noResultsText: h, onChange: g, onClear: _, options: v, popoverProps: { autoHighlight: y = !1, append: b, prepend: x, ...C } = {}, readOnly: w, required: T, selectedOptionsTagText: E = "options selected", type: D = "search", value: O, watermark: k = !0, ...ee }, te) => {
|
|
1605
|
+
le({
|
|
1606
|
+
component: "IressMultiCombobox",
|
|
1607
|
+
defaultValue: s
|
|
1608
|
+
});
|
|
1609
|
+
let A = Te({ id: l }), j = `${A}-sr-text`, [ne, N] = K(!1), { value: P, setValue: F, getValuesString: I, getLabelsArray: re, getLabelsString: ie } = he({
|
|
1610
|
+
component: "IressMultiCombobox",
|
|
1611
|
+
defaultValue: s,
|
|
1612
|
+
multiple: !0,
|
|
1613
|
+
value: O
|
|
1614
|
+
}), [L, R] = K(""), { debouncedQuery: B, loading: ae, results: V, stopSearch: oe, shouldShowInstructions: se, shouldShowDebounceWaiting: ce, shouldShowNoResults: ue, displayResults: pe } = fe({
|
|
1615
|
+
debounceThreshold: o,
|
|
1616
|
+
initialOptions: u,
|
|
1617
|
+
options: v,
|
|
1618
|
+
query: L
|
|
1619
|
+
}), me = He({
|
|
1620
|
+
debouncedQuery: B,
|
|
1621
|
+
loading: ae,
|
|
1622
|
+
results: V,
|
|
1623
|
+
shouldShowInstructions: se,
|
|
1624
|
+
shouldShowDebounceWaiting: ce,
|
|
1625
|
+
shouldShowNoResults: ue,
|
|
1626
|
+
displayResults: pe
|
|
1627
|
+
});
|
|
1628
|
+
if (w) return /* @__PURE__ */ q(kn, {
|
|
1629
|
+
value: I(),
|
|
1630
|
+
children: ie(", ")
|
|
1631
|
+
});
|
|
1632
|
+
let ge = (e) => {
|
|
1633
|
+
R(e.target.value);
|
|
1634
|
+
}, _e = (e) => {
|
|
1635
|
+
_?.(e), R(""), F([]);
|
|
1636
|
+
}, ve = (e) => {
|
|
1637
|
+
if (!L && e.key === "Backspace") {
|
|
1638
|
+
let e = M(P).slice(0, -1);
|
|
1639
|
+
g?.(de(e), e), F(e);
|
|
1640
|
+
}
|
|
1641
|
+
}, ye = (e) => {
|
|
1642
|
+
let t = [], n = M(e).filter((e) => {
|
|
1643
|
+
let n = e.value ?? e.label;
|
|
1644
|
+
return t.includes(n) ? !1 : (t.push(n), !0);
|
|
1645
|
+
});
|
|
1646
|
+
g?.(de(n), n), F(n);
|
|
1647
|
+
}, be = (e) => {
|
|
1648
|
+
let t = M(P).filter((t) => t.label !== e);
|
|
1649
|
+
g?.(de(t), t), F(t);
|
|
1650
|
+
}, xe = () => {
|
|
1651
|
+
g?.(de([]), []), F([]);
|
|
1652
|
+
}, Se = () => {
|
|
1653
|
+
N(!1), oe();
|
|
1654
|
+
};
|
|
1655
|
+
return /* @__PURE__ */ J("div", {
|
|
1656
|
+
className: (0, Y.default)(r, Be.combobox),
|
|
1657
|
+
"data-testid": a,
|
|
1658
|
+
children: [
|
|
1659
|
+
/* @__PURE__ */ q(z, {
|
|
1660
|
+
...C,
|
|
1661
|
+
activator: /* @__PURE__ */ q(ui, {
|
|
1662
|
+
...ee,
|
|
1663
|
+
append: e,
|
|
1664
|
+
"aria-describedby": j,
|
|
1665
|
+
autoComplete: t,
|
|
1666
|
+
clearable: i,
|
|
1667
|
+
"data-testid": S(a, "input"),
|
|
1668
|
+
id: A,
|
|
1669
|
+
loading: ae,
|
|
1670
|
+
minLength: u?.length ? 0 : ee.minLength,
|
|
1671
|
+
onChange: ge,
|
|
1672
|
+
onClear: _e,
|
|
1673
|
+
onKeyDown: ve,
|
|
1674
|
+
onTagDelete: be,
|
|
1675
|
+
onTagDeleteAll: xe,
|
|
1676
|
+
selectedOptionsTagText: E,
|
|
1677
|
+
tagLimit: p,
|
|
1678
|
+
tags: re(),
|
|
1679
|
+
type: D,
|
|
1680
|
+
value: L,
|
|
1681
|
+
watermark: k
|
|
1682
|
+
}),
|
|
1683
|
+
autoHighlight: y,
|
|
1684
|
+
className: (0, Y.default)(r, Be.input),
|
|
1685
|
+
contentClassName: Be.popoverContent,
|
|
1686
|
+
onActivated: () => N(!0),
|
|
1687
|
+
onDeactivated: Se,
|
|
1688
|
+
show: ne,
|
|
1689
|
+
type: "listbox",
|
|
1690
|
+
"data-testid": S(a, "popover"),
|
|
1691
|
+
children: /* @__PURE__ */ q(Xr, {
|
|
1692
|
+
append: b,
|
|
1693
|
+
changeOnBlur: n,
|
|
1694
|
+
dataTestId: a,
|
|
1695
|
+
limitDesktop: d,
|
|
1696
|
+
limitMobile: f,
|
|
1697
|
+
multiSelect: !0,
|
|
1698
|
+
noResultsText: h,
|
|
1699
|
+
onChange: ye,
|
|
1700
|
+
prepend: x,
|
|
1701
|
+
items: V,
|
|
1702
|
+
selected: P,
|
|
1703
|
+
selectedFirst: !0,
|
|
1704
|
+
showNoResults: me.showNoResults,
|
|
1705
|
+
showResults: me.showResults
|
|
1706
|
+
})
|
|
1707
|
+
}),
|
|
1708
|
+
/* @__PURE__ */ q(Ve, {
|
|
1709
|
+
hiddenInputProps: c,
|
|
1710
|
+
dataTestId: a,
|
|
1711
|
+
name: m,
|
|
1712
|
+
ref: te,
|
|
1713
|
+
required: T,
|
|
1714
|
+
value: I()
|
|
1715
|
+
}),
|
|
1716
|
+
/* @__PURE__ */ q(Yr, {
|
|
1717
|
+
"data-testid": S(a, "results-sr-text"),
|
|
1718
|
+
id: j,
|
|
1719
|
+
loading: ae,
|
|
1720
|
+
noResultsText: h,
|
|
1721
|
+
results: V
|
|
1722
|
+
})
|
|
1723
|
+
]
|
|
1724
|
+
});
|
|
1725
|
+
});
|
|
1726
|
+
di.displayName = "IressMultiCombobox";
|
|
1727
|
+
//#endregion
|
|
1728
|
+
//#region src/components/Field/Field.module.scss
|
|
1729
|
+
var fi = "ids-field-v5209", pi = "ids-field--field-group-v5209", mi = "ids-field--invalid-v5209", hi = "ids-field--label-v5209", gi = "ids-field--hidden-label-v5209", _i = "ids-field--hint-v5209", vi = "ids-field--error-summary-v5209", yi = {
|
|
1730
|
+
field: fi,
|
|
1731
|
+
fieldGroup: pi,
|
|
1732
|
+
invalid: mi,
|
|
1733
|
+
"ids-combobox": "ids-combobox-v5209",
|
|
1734
|
+
"ids-validationMessage": "ids-validation-message-v5209",
|
|
1735
|
+
label: hi,
|
|
1736
|
+
hiddenLabel: gi,
|
|
1737
|
+
"ids-input--readonly": "ids-input--readonly-v5209",
|
|
1738
|
+
hint: _i,
|
|
1739
|
+
errorSummary: vi
|
|
1740
|
+
}, bi = ({ error: e, errorMessages: t, hiddenLabel: n, hint: r, "data-parent-testid": i }) => /* @__PURE__ */ J(tn, { children: [
|
|
1741
|
+
r && /* @__PURE__ */ q("div", {
|
|
1742
|
+
className: (0, Y.default)(yi.hint, { [o.SROnly]: n }),
|
|
1743
|
+
"data-testid": S(i, "hint"),
|
|
1744
|
+
children: r
|
|
1745
|
+
}),
|
|
1746
|
+
e,
|
|
1747
|
+
t && /* @__PURE__ */ q(Qe, {
|
|
1748
|
+
className: yi.errorSummary,
|
|
1749
|
+
messages: Je(t, "message"),
|
|
1750
|
+
"data-testid": S(i, "error")
|
|
1751
|
+
})
|
|
1752
|
+
] }), xi = ({ children: e, className: t, "data-testid": n, error: r, errorMessages: i, hiddenLabel: a, hint: o, htmlFor: s, label: c, optional: l, required: u, readOnly: d, ...f }) => {
|
|
1753
|
+
let p = G(() => !!r || i?.length, [r, i?.length]), m = G(() => !o && !r && !i?.length ? null : /* @__PURE__ */ q(bi, {
|
|
1754
|
+
hint: o,
|
|
1755
|
+
error: r,
|
|
1756
|
+
errorMessages: i,
|
|
1757
|
+
hiddenLabel: a,
|
|
1758
|
+
"data-parent-testid": n
|
|
1759
|
+
}), [
|
|
1760
|
+
n,
|
|
1761
|
+
r,
|
|
1762
|
+
i,
|
|
1763
|
+
a,
|
|
1764
|
+
o
|
|
1765
|
+
]), h = s;
|
|
1766
|
+
return h === void 0 && Jt(e) && (h = M(e)[0].props.id), /* @__PURE__ */ J("div", {
|
|
1767
|
+
className: (0, Y.default)(t, {
|
|
1768
|
+
[yi.field]: !0,
|
|
1769
|
+
[yi.invalid]: p,
|
|
1770
|
+
[yi.hiddenLabel]: a === !0
|
|
1771
|
+
}),
|
|
1772
|
+
"data-testid": n,
|
|
1773
|
+
...f,
|
|
1774
|
+
children: [/* @__PURE__ */ q(qe, {
|
|
1775
|
+
append: m,
|
|
1776
|
+
className: yi.label,
|
|
1777
|
+
"data-testid": S(n, "label"),
|
|
1778
|
+
hiddenLabel: a,
|
|
1779
|
+
htmlFor: h,
|
|
1780
|
+
optional: l,
|
|
1781
|
+
required: d ? !1 : !!u,
|
|
1782
|
+
children: c
|
|
1783
|
+
}), e]
|
|
1784
|
+
});
|
|
1785
|
+
}, Si = "ids-field-group--field-v5209", Ci = "ids-field-group-v5209", wi = "ids-field-group--invalid-v5209", Ti = "ids-field-group--label-v5209", Ei = "ids-field-group--hidden-label-v5209", Di = "ids-field-group--legend-v5209", Oi = "ids-field-group--hint-v5209", ki = "ids-field-group--fields-v5209", Ai = "ids-field-group--inline-v5209", ji = "ids-field-group--join-v5209", Mi = {
|
|
1786
|
+
field: Si,
|
|
1787
|
+
fieldGroup: Ci,
|
|
1788
|
+
invalid: wi,
|
|
1789
|
+
"ids-combobox": "ids-combobox-v5209",
|
|
1790
|
+
"ids-validationMessage": "ids-validation-message-v5209",
|
|
1791
|
+
label: Ti,
|
|
1792
|
+
hiddenLabel: Ei,
|
|
1793
|
+
"ids-input--readonly": "ids-input--readonly-v5209",
|
|
1794
|
+
"ids-label--hidden": "ids-label--hidden-v5209",
|
|
1795
|
+
legend: Di,
|
|
1796
|
+
hint: Oi,
|
|
1797
|
+
fields: ki,
|
|
1798
|
+
inline: Ai,
|
|
1799
|
+
join: ji,
|
|
1800
|
+
"ids-field": "ids-field-v5209",
|
|
1801
|
+
"ids-field--invalid": "ids-field--invalid-v5209"
|
|
1802
|
+
}, Ni = ({ children: e, className: t, "data-testid": n, error: r, errorMessages: i, hiddenLabel: a, hint: o, inline: s, join: c, label: l, optional: u, required: d, ...f }) => {
|
|
1803
|
+
let p = G(() => !!r || i?.length, [r, i?.length]), m = G(() => !o && !r && !i?.length ? null : /* @__PURE__ */ q(bi, {
|
|
1804
|
+
hint: o,
|
|
1805
|
+
error: r,
|
|
1806
|
+
errorMessages: i,
|
|
1807
|
+
hiddenLabel: a,
|
|
1808
|
+
"data-parent-testid": n
|
|
1809
|
+
}), [
|
|
1810
|
+
n,
|
|
1811
|
+
r,
|
|
1812
|
+
i,
|
|
1813
|
+
a,
|
|
1814
|
+
o
|
|
1815
|
+
]);
|
|
1816
|
+
return /* @__PURE__ */ J("fieldset", {
|
|
1817
|
+
className: (0, Y.default)(t, Mi.fieldGroup, {
|
|
1818
|
+
[Mi.inline]: s,
|
|
1819
|
+
[Mi.invalid]: p,
|
|
1820
|
+
[Mi.hiddenLabel]: a,
|
|
1821
|
+
[Mi.join]: c
|
|
1822
|
+
}),
|
|
1823
|
+
"data-testid": n,
|
|
1824
|
+
...f,
|
|
1825
|
+
children: [/* @__PURE__ */ q(Ye, {
|
|
1826
|
+
append: m,
|
|
1827
|
+
className: Mi.legend,
|
|
1828
|
+
"data-testid": S(n, "legend"),
|
|
1829
|
+
hiddenLabel: a,
|
|
1830
|
+
optional: u,
|
|
1831
|
+
required: d,
|
|
1832
|
+
children: l
|
|
1833
|
+
}), /* @__PURE__ */ q("div", {
|
|
1834
|
+
className: Mi.fields,
|
|
1835
|
+
children: e
|
|
1836
|
+
})]
|
|
1837
|
+
});
|
|
1838
|
+
}, Pi = {
|
|
1839
|
+
filter: "ids-filter-v5209",
|
|
1840
|
+
chevron: "ids-filter--chevron-v5209",
|
|
1841
|
+
searchInput: "ids-filter--search-input-v5209",
|
|
1842
|
+
optionList: "ids-filter--option-list-v5209",
|
|
1843
|
+
noResults: "ids-filter--no-results-v5209",
|
|
1844
|
+
utilsWithReset: "ids-filter--utils-with-reset-v5209",
|
|
1845
|
+
utilsSearchable: "ids-filter--utils-searchable-v5209",
|
|
1846
|
+
optionContent: "ids-filter--option-content-v5209",
|
|
1847
|
+
optionMeta: "ids-filter--option-meta-v5209",
|
|
1848
|
+
optionMetaText: "ids-filter--option-meta-text-v5209",
|
|
1849
|
+
reset: "ids-filter--reset-v5209"
|
|
1850
|
+
}, Fi = U((e, t) => {
|
|
1851
|
+
let n = en(null), { isActiveInPopover: r, ...i } = R();
|
|
1852
|
+
return Qt(t, () => n.current), /* @__PURE__ */ q(An, {
|
|
1853
|
+
...e,
|
|
1854
|
+
...i,
|
|
1855
|
+
autoCorrect: "off",
|
|
1856
|
+
className: (0, Y.default)(Pi.searchInput, { [Pi.isActiveInPopover]: r }),
|
|
1857
|
+
ref: (e) => {
|
|
1858
|
+
n.current = e, i?.ref?.(n.current?.input ?? null);
|
|
1859
|
+
},
|
|
1860
|
+
type: "search"
|
|
1861
|
+
});
|
|
1862
|
+
});
|
|
1863
|
+
Fi.displayName = "FilterSearch";
|
|
1864
|
+
//#endregion
|
|
1865
|
+
//#region src/components/Filter/components/FilterResetButton.tsx
|
|
1866
|
+
var Ii = U((e, t) => {
|
|
1867
|
+
let n = en(null), { isActiveInPopover: r, ...i } = R();
|
|
1868
|
+
return Qt(t, () => n.current), /* @__PURE__ */ q(Gn, {
|
|
1869
|
+
...e,
|
|
1870
|
+
...i,
|
|
1871
|
+
className: (0, Y.default)(Pi.reset, { [Pi.isActiveInPopover]: r }),
|
|
1872
|
+
mode: Gn.Mode.Link,
|
|
1873
|
+
ref: (e) => {
|
|
1874
|
+
n.current = e, i?.ref?.(n.current);
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
});
|
|
1878
|
+
Ii.displayName = "FilterResetButton";
|
|
1879
|
+
//#endregion
|
|
1880
|
+
//#region src/components/Filter/Filter.tsx
|
|
1881
|
+
var Li = { align: "bottom-start" }, Ri = U(({ children: e, className: t, "data-testid": n, debounceThreshold: r, defaultValue: i, id: a, initialOptions: o, inputProps: s = {
|
|
1882
|
+
clearable: !0,
|
|
1883
|
+
prepend: /* @__PURE__ */ q(X, { name: "search" }),
|
|
1884
|
+
watermark: !0
|
|
1885
|
+
}, limitDesktop: c = 12, limitMobile: l = 6, label: u, multiSelect: d, onChange: f, onReset: p, options: m, popoverProps: { append: h, prepend: g, ..._ } = Li, searchable: v, searchNoResultsText: y, selectedOptionsText: b, value: x, visibleResetButton: C, ...w }, T) => {
|
|
1886
|
+
let D = Te({ id: a }), O = `${D}-sr-text`, k = en(null), ee = G(() => v ?? typeof m == "function", [m, v]), te = {
|
|
1887
|
+
clearable: !0,
|
|
1888
|
+
prepend: /* @__PURE__ */ q(X, { name: "search" }),
|
|
1889
|
+
watermark: !0,
|
|
1890
|
+
...s
|
|
1891
|
+
}, A = {
|
|
1892
|
+
...Li,
|
|
1893
|
+
..._
|
|
1894
|
+
}, { value: j, setValue: ne } = he({
|
|
1895
|
+
component: "IressFilter",
|
|
1896
|
+
defaultValue: i,
|
|
1897
|
+
multiple: d,
|
|
1898
|
+
value: x
|
|
1899
|
+
}), [M, N] = K(""), [P, F] = K(!1), I = (e) => {
|
|
1900
|
+
N(e.target.value);
|
|
1901
|
+
}, re = () => {
|
|
1902
|
+
N("");
|
|
1903
|
+
}, ie = (e) => {
|
|
1904
|
+
f?.(e), ne(e), d || F(!1);
|
|
1905
|
+
}, R = () => {
|
|
1906
|
+
ne(void 0), p?.(), d || F(!1);
|
|
1907
|
+
};
|
|
1908
|
+
Qt(T, () => ({
|
|
1909
|
+
element: k.current ?? void 0,
|
|
1910
|
+
clearSearch: () => N(""),
|
|
1911
|
+
reset: () => ne(i)
|
|
1912
|
+
}));
|
|
1913
|
+
let { debouncedQuery: z, loading: B, results: ae, shouldShowInstructions: V, shouldShowDebounceWaiting: oe, shouldShowNoResults: se, displayResults: ce } = fe({
|
|
1914
|
+
debounceThreshold: r,
|
|
1915
|
+
initialOptions: o ?? (typeof m == "function" ? void 0 : m),
|
|
1916
|
+
options: m,
|
|
1917
|
+
query: M
|
|
1918
|
+
}), le = Xe({
|
|
1919
|
+
debouncedQuery: z,
|
|
1920
|
+
loading: B,
|
|
1921
|
+
results: ae,
|
|
1922
|
+
shouldShowInstructions: V,
|
|
1923
|
+
shouldShowDebounceWaiting: oe,
|
|
1924
|
+
shouldShowNoResults: se,
|
|
1925
|
+
displayResults: ce,
|
|
1926
|
+
searchable: ee,
|
|
1927
|
+
visibleResetButton: C
|
|
1928
|
+
});
|
|
1929
|
+
return /* @__PURE__ */ J("div", {
|
|
1930
|
+
...w,
|
|
1931
|
+
className: (0, Y.default)(t, Pi.filter, {
|
|
1932
|
+
[Pi.multiSelect]: d,
|
|
1933
|
+
[Pi.searchable]: v
|
|
1934
|
+
}),
|
|
1935
|
+
"data-testid": n,
|
|
1936
|
+
id: D,
|
|
1937
|
+
ref: k,
|
|
1938
|
+
children: [
|
|
1939
|
+
/* @__PURE__ */ J(L, {
|
|
1940
|
+
...A,
|
|
1941
|
+
activator: /* @__PURE__ */ J(Gn, {
|
|
1942
|
+
"aria-describedby": O,
|
|
1943
|
+
"data-testid": S(n, "activator-button__button"),
|
|
1944
|
+
onClick: () => F(!0),
|
|
1945
|
+
children: [/* @__PURE__ */ q(Ze, {
|
|
1946
|
+
label: u,
|
|
1947
|
+
selectedOptionsText: b,
|
|
1948
|
+
value: j
|
|
1949
|
+
}), /* @__PURE__ */ q("span", { className: Pi.chevron })]
|
|
1950
|
+
}),
|
|
1951
|
+
"data-testid": S(n, "popover"),
|
|
1952
|
+
show: P,
|
|
1953
|
+
onActivated: () => F(!0),
|
|
1954
|
+
onDeactivated: () => F(!1),
|
|
1955
|
+
type: "listbox",
|
|
1956
|
+
children: [
|
|
1957
|
+
g,
|
|
1958
|
+
le.showHeader && /* @__PURE__ */ J(tn, { children: [/* @__PURE__ */ J(pe, {
|
|
1959
|
+
background: "transparent",
|
|
1960
|
+
children: [ee && /* @__PURE__ */ q(Fi, {
|
|
1961
|
+
...te,
|
|
1962
|
+
className: Pi.searchInput,
|
|
1963
|
+
"data-testid": S(n, "input"),
|
|
1964
|
+
loading: B,
|
|
1965
|
+
onChange: I,
|
|
1966
|
+
onClear: re
|
|
1967
|
+
}), C && /* @__PURE__ */ q(Ii, {
|
|
1968
|
+
"data-testid": S(n, "reset-button"),
|
|
1969
|
+
onClick: R,
|
|
1970
|
+
children: typeof C == "string" ? C : "Reset filter"
|
|
1971
|
+
})]
|
|
1972
|
+
}), /* @__PURE__ */ q(Ke, { gutter: "none" })] }),
|
|
1973
|
+
le.showResults && /* @__PURE__ */ q(Dr, {
|
|
1974
|
+
className: Pi.optionList,
|
|
1975
|
+
"data-testid": S(n, "menu"),
|
|
1976
|
+
items: ae,
|
|
1977
|
+
limitDesktop: c,
|
|
1978
|
+
limitMobile: l,
|
|
1979
|
+
multiSelect: d,
|
|
1980
|
+
onChange: ie,
|
|
1981
|
+
selected: j,
|
|
1982
|
+
selectedFirst: d
|
|
1983
|
+
}),
|
|
1984
|
+
le.showNoResults && /* @__PURE__ */ q(E, {
|
|
1985
|
+
noResultsText: y,
|
|
1986
|
+
styles: Pi
|
|
1987
|
+
}),
|
|
1988
|
+
h
|
|
1989
|
+
]
|
|
1990
|
+
}),
|
|
1991
|
+
e,
|
|
1992
|
+
/* @__PURE__ */ q(Yr, {
|
|
1993
|
+
"data-testid": S(n, "results-sr-text"),
|
|
1994
|
+
id: O,
|
|
1995
|
+
loading: B,
|
|
1996
|
+
noResultsText: y,
|
|
1997
|
+
results: ae
|
|
1998
|
+
})
|
|
1999
|
+
]
|
|
2000
|
+
});
|
|
2001
|
+
});
|
|
2002
|
+
Ri.displayName = "IressFilter";
|
|
2003
|
+
//#endregion
|
|
2004
|
+
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
2005
|
+
var zi = (e) => e.type === "checkbox", Bi = (e) => e instanceof Date, Vi = (e) => e == null, Hi = (e) => typeof e == "object", Ui = (e) => !Vi(e) && !Array.isArray(e) && Hi(e) && !Bi(e), Wi = (e) => Ui(e) && e.target ? zi(e.target) ? e.target.checked : e.target.value : e, Gi = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ki = (e, t) => e.has(Gi(t)), qi = (e) => {
|
|
2006
|
+
let t = e.constructor && e.constructor.prototype;
|
|
2007
|
+
return Ui(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2008
|
+
}, Ji = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
2009
|
+
function Yi(e) {
|
|
2010
|
+
let t, n = Array.isArray(e);
|
|
2011
|
+
if (e instanceof Date) t = new Date(e);
|
|
2012
|
+
else if (e instanceof Set) t = new Set(e);
|
|
2013
|
+
else if (!(Ji && (e instanceof Blob || e instanceof FileList)) && (n || Ui(e))) if (t = n ? [] : {}, !n && !qi(e)) t = e;
|
|
2014
|
+
else for (let n in e) e.hasOwnProperty(n) && (t[n] = Yi(e[n]));
|
|
2015
|
+
else return e;
|
|
2016
|
+
return t;
|
|
2017
|
+
}
|
|
2018
|
+
var Xi = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Zi = (e) => e === void 0, Q = (e, t, n) => {
|
|
2019
|
+
if (!t || !Ui(e)) return n;
|
|
2020
|
+
let r = Xi(t.split(/[,[\].]+?/)).reduce((e, t) => Vi(e) ? e : e[t], e);
|
|
2021
|
+
return Zi(r) || r === e ? Zi(e[t]) ? n : e[t] : r;
|
|
2022
|
+
}, Qi = (e) => typeof e == "boolean", $i = (e) => /^\w*$/.test(e), ea = (e) => Xi(e.replace(/["|']|\]/g, "").split(/\.|\[/)), $ = (e, t, n) => {
|
|
2023
|
+
let r = -1, i = $i(t) ? [t] : ea(t), a = i.length, o = a - 1;
|
|
2024
|
+
for (; ++r < a;) {
|
|
2025
|
+
let t = i[r], a = n;
|
|
2026
|
+
if (r !== o) {
|
|
2027
|
+
let n = e[t];
|
|
2028
|
+
a = Ui(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
2029
|
+
}
|
|
2030
|
+
if (t === "__proto__") return;
|
|
2031
|
+
e[t] = a, e = e[t];
|
|
2032
|
+
}
|
|
2033
|
+
return e;
|
|
2034
|
+
}, ta = {
|
|
2035
|
+
BLUR: "blur",
|
|
2036
|
+
FOCUS_OUT: "focusout",
|
|
2037
|
+
CHANGE: "change"
|
|
2038
|
+
}, na = {
|
|
2039
|
+
onBlur: "onBlur",
|
|
2040
|
+
onChange: "onChange",
|
|
2041
|
+
onSubmit: "onSubmit",
|
|
2042
|
+
onTouched: "onTouched",
|
|
2043
|
+
all: "all"
|
|
2044
|
+
}, ra = {
|
|
2045
|
+
max: "max",
|
|
2046
|
+
min: "min",
|
|
2047
|
+
maxLength: "maxLength",
|
|
2048
|
+
minLength: "minLength",
|
|
2049
|
+
pattern: "pattern",
|
|
2050
|
+
required: "required",
|
|
2051
|
+
validate: "validate"
|
|
2052
|
+
}, ia = H.createContext(null), aa = () => H.useContext(ia), oa = (e) => {
|
|
2053
|
+
let { children: t, ...n } = e;
|
|
2054
|
+
return H.createElement(ia.Provider, { value: n }, t);
|
|
2055
|
+
}, sa = (e, t, n, r = !0) => {
|
|
2056
|
+
let i = { defaultValues: t._defaultValues };
|
|
2057
|
+
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
2058
|
+
let i = a;
|
|
2059
|
+
return t._proxyFormState[i] !== na.all && (t._proxyFormState[i] = !r || na.all), n && (n[i] = !0), e[i];
|
|
2060
|
+
} });
|
|
2061
|
+
return i;
|
|
2062
|
+
}, ca = (e) => Ui(e) && !Object.keys(e).length, la = (e, t, n, r) => {
|
|
2063
|
+
n(e);
|
|
2064
|
+
let { name: i, ...a } = e;
|
|
2065
|
+
return ca(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((e) => t[e] === (!r || na.all));
|
|
2066
|
+
}, ua = (e) => Array.isArray(e) ? e : [e], da = (e, t, n) => !e || !t || e === t || ua(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e)));
|
|
2067
|
+
function fa(e) {
|
|
2068
|
+
let t = H.useRef(e);
|
|
2069
|
+
t.current = e, H.useEffect(() => {
|
|
2070
|
+
let n = !e.disabled && t.current.subject && t.current.subject.subscribe({ next: t.current.next });
|
|
2071
|
+
return () => {
|
|
2072
|
+
n && n.unsubscribe();
|
|
2073
|
+
};
|
|
2074
|
+
}, [e.disabled]);
|
|
2075
|
+
}
|
|
2076
|
+
function pa(e) {
|
|
2077
|
+
let t = aa(), { control: n = t.control, disabled: r, name: i, exact: a } = e || {}, [o, s] = H.useState(n._formState), c = H.useRef(!0), l = H.useRef({
|
|
2078
|
+
isDirty: !1,
|
|
2079
|
+
isLoading: !1,
|
|
2080
|
+
dirtyFields: !1,
|
|
2081
|
+
touchedFields: !1,
|
|
2082
|
+
validatingFields: !1,
|
|
2083
|
+
isValidating: !1,
|
|
2084
|
+
isValid: !1,
|
|
2085
|
+
errors: !1
|
|
2086
|
+
}), u = H.useRef(i);
|
|
2087
|
+
return u.current = i, fa({
|
|
2088
|
+
disabled: r,
|
|
2089
|
+
next: (e) => c.current && da(u.current, e.name, a) && la(e, l.current, n._updateFormState) && s({
|
|
2090
|
+
...n._formState,
|
|
2091
|
+
...e
|
|
2092
|
+
}),
|
|
2093
|
+
subject: n._subjects.state
|
|
2094
|
+
}), H.useEffect(() => (c.current = !0, l.current.isValid && n._updateValid(!0), () => {
|
|
2095
|
+
c.current = !1;
|
|
2096
|
+
}), [n]), sa(o, n, l.current, !1);
|
|
2097
|
+
}
|
|
2098
|
+
var ma = (e) => typeof e == "string", ha = (e, t, n, r, i) => ma(e) ? (r && t.watch.add(e), Q(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), Q(n, e))) : (r && (t.watchAll = !0), n);
|
|
2099
|
+
function ga(e) {
|
|
2100
|
+
let t = aa(), { control: n = t.control, name: r, defaultValue: i, disabled: a, exact: o } = e || {}, s = H.useRef(r);
|
|
2101
|
+
s.current = r, fa({
|
|
2102
|
+
disabled: a,
|
|
2103
|
+
subject: n._subjects.values,
|
|
2104
|
+
next: (e) => {
|
|
2105
|
+
da(s.current, e.name, o) && l(Yi(ha(s.current, n._names, e.values || n._formValues, !1, i)));
|
|
2106
|
+
}
|
|
2107
|
+
});
|
|
2108
|
+
let [c, l] = H.useState(n._getWatch(r, i));
|
|
2109
|
+
return H.useEffect(() => n._removeUnmounted()), c;
|
|
2110
|
+
}
|
|
2111
|
+
function _a(e) {
|
|
2112
|
+
let t = aa(), { name: n, disabled: r, control: i = t.control, shouldUnregister: a } = e, o = Ki(i._names.array, n), s = ga({
|
|
2113
|
+
control: i,
|
|
2114
|
+
name: n,
|
|
2115
|
+
defaultValue: Q(i._formValues, n, Q(i._defaultValues, n, e.defaultValue)),
|
|
2116
|
+
exact: !0
|
|
2117
|
+
}), c = pa({
|
|
2118
|
+
control: i,
|
|
2119
|
+
name: n,
|
|
2120
|
+
exact: !0
|
|
2121
|
+
}), l = H.useRef(i.register(n, {
|
|
2122
|
+
...e.rules,
|
|
2123
|
+
value: s,
|
|
2124
|
+
...Qi(e.disabled) ? { disabled: e.disabled } : {}
|
|
2125
|
+
}));
|
|
2126
|
+
return H.useEffect(() => {
|
|
2127
|
+
let e = i._options.shouldUnregister || a, t = (e, t) => {
|
|
2128
|
+
let n = Q(i._fields, e);
|
|
2129
|
+
n && n._f && (n._f.mount = t);
|
|
2130
|
+
};
|
|
2131
|
+
if (t(n, !0), e) {
|
|
2132
|
+
let e = Yi(Q(i._options.defaultValues, n));
|
|
2133
|
+
$(i._defaultValues, n, e), Zi(Q(i._formValues, n)) && $(i._formValues, n, e);
|
|
2134
|
+
}
|
|
2135
|
+
return () => {
|
|
2136
|
+
(o ? e && !i._state.action : e) ? i.unregister(n) : t(n, !1);
|
|
2137
|
+
};
|
|
2138
|
+
}, [
|
|
2139
|
+
n,
|
|
2140
|
+
i,
|
|
2141
|
+
o,
|
|
2142
|
+
a
|
|
2143
|
+
]), H.useEffect(() => {
|
|
2144
|
+
Q(i._fields, n) && i._updateDisabledField({
|
|
2145
|
+
disabled: r,
|
|
2146
|
+
fields: i._fields,
|
|
2147
|
+
name: n,
|
|
2148
|
+
value: Q(i._fields, n)._f.value
|
|
2149
|
+
});
|
|
2150
|
+
}, [
|
|
2151
|
+
r,
|
|
2152
|
+
n,
|
|
2153
|
+
i
|
|
2154
|
+
]), {
|
|
2155
|
+
field: {
|
|
2156
|
+
name: n,
|
|
2157
|
+
value: s,
|
|
2158
|
+
...Qi(r) || c.disabled ? { disabled: c.disabled || r } : {},
|
|
2159
|
+
onChange: H.useCallback((e) => l.current.onChange({
|
|
2160
|
+
target: {
|
|
2161
|
+
value: Wi(e),
|
|
2162
|
+
name: n
|
|
2163
|
+
},
|
|
2164
|
+
type: ta.CHANGE
|
|
2165
|
+
}), [n]),
|
|
2166
|
+
onBlur: H.useCallback(() => l.current.onBlur({
|
|
2167
|
+
target: {
|
|
2168
|
+
value: Q(i._formValues, n),
|
|
2169
|
+
name: n
|
|
2170
|
+
},
|
|
2171
|
+
type: ta.BLUR
|
|
2172
|
+
}), [n, i]),
|
|
2173
|
+
ref: H.useCallback((e) => {
|
|
2174
|
+
let t = Q(i._fields, n);
|
|
2175
|
+
t && e && (t._f.ref = {
|
|
2176
|
+
focus: () => e.focus(),
|
|
2177
|
+
select: () => e.select(),
|
|
2178
|
+
setCustomValidity: (t) => e.setCustomValidity(t),
|
|
2179
|
+
reportValidity: () => e.reportValidity()
|
|
2180
|
+
});
|
|
2181
|
+
}, [i._fields, n])
|
|
2182
|
+
},
|
|
2183
|
+
formState: c,
|
|
2184
|
+
fieldState: Object.defineProperties({}, {
|
|
2185
|
+
invalid: {
|
|
2186
|
+
enumerable: !0,
|
|
2187
|
+
get: () => !!Q(c.errors, n)
|
|
2188
|
+
},
|
|
2189
|
+
isDirty: {
|
|
2190
|
+
enumerable: !0,
|
|
2191
|
+
get: () => !!Q(c.dirtyFields, n)
|
|
2192
|
+
},
|
|
2193
|
+
isTouched: {
|
|
2194
|
+
enumerable: !0,
|
|
2195
|
+
get: () => !!Q(c.touchedFields, n)
|
|
2196
|
+
},
|
|
2197
|
+
isValidating: {
|
|
2198
|
+
enumerable: !0,
|
|
2199
|
+
get: () => !!Q(c.validatingFields, n)
|
|
2200
|
+
},
|
|
2201
|
+
error: {
|
|
2202
|
+
enumerable: !0,
|
|
2203
|
+
get: () => Q(c.errors, n)
|
|
2204
|
+
}
|
|
2205
|
+
})
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
var va = (e, t, n, r, i) => t ? {
|
|
2209
|
+
...n[e],
|
|
2210
|
+
types: {
|
|
2211
|
+
...n[e] && n[e].types ? n[e].types : {},
|
|
2212
|
+
[r]: i || !0
|
|
2213
|
+
}
|
|
2214
|
+
} : {}, ya = (e) => ({
|
|
2215
|
+
isOnSubmit: !e || e === na.onSubmit,
|
|
2216
|
+
isOnBlur: e === na.onBlur,
|
|
2217
|
+
isOnChange: e === na.onChange,
|
|
2218
|
+
isOnAll: e === na.all,
|
|
2219
|
+
isOnTouch: e === na.onTouched
|
|
2220
|
+
}), ba = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length)))), xa = (e, t, n, r) => {
|
|
2221
|
+
for (let i of n || Object.keys(e)) {
|
|
2222
|
+
let n = Q(e, i);
|
|
2223
|
+
if (n) {
|
|
2224
|
+
let { _f: e, ...a } = n;
|
|
2225
|
+
if (e) {
|
|
2226
|
+
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
2227
|
+
if (xa(a, t)) break;
|
|
2228
|
+
} else if (Ui(a) && xa(a, t)) break;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
}, Sa = (e, t, n) => {
|
|
2232
|
+
let r = ua(Q(e, n));
|
|
2233
|
+
return $(r, "root", t[n]), $(e, n, r), e;
|
|
2234
|
+
}, Ca = (e) => e.type === "file", wa = (e) => typeof e == "function", Ta = (e) => {
|
|
2235
|
+
if (!Ji) return !1;
|
|
2236
|
+
let t = e ? e.ownerDocument : 0;
|
|
2237
|
+
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2238
|
+
}, Ea = (e) => ma(e), Da = (e) => e.type === "radio", Oa = (e) => e instanceof RegExp, ka = {
|
|
2239
|
+
value: !1,
|
|
2240
|
+
isValid: !1
|
|
2241
|
+
}, Aa = {
|
|
2242
|
+
value: !0,
|
|
2243
|
+
isValid: !0
|
|
2244
|
+
}, ja = (e) => {
|
|
2245
|
+
if (Array.isArray(e)) {
|
|
2246
|
+
if (e.length > 1) {
|
|
2247
|
+
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
2248
|
+
return {
|
|
2249
|
+
value: t,
|
|
2250
|
+
isValid: !!t.length
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !Zi(e[0].attributes.value) ? Zi(e[0].value) || e[0].value === "" ? Aa : {
|
|
2254
|
+
value: e[0].value,
|
|
2255
|
+
isValid: !0
|
|
2256
|
+
} : Aa : ka;
|
|
2257
|
+
}
|
|
2258
|
+
return ka;
|
|
2259
|
+
}, Ma = {
|
|
2260
|
+
isValid: !1,
|
|
2261
|
+
value: null
|
|
2262
|
+
}, Na = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
2263
|
+
isValid: !0,
|
|
2264
|
+
value: t.value
|
|
2265
|
+
} : e, Ma) : Ma;
|
|
2266
|
+
function Pa(e, t, n = "validate") {
|
|
2267
|
+
if (Ea(e) || Array.isArray(e) && e.every(Ea) || Qi(e) && !e) return {
|
|
2268
|
+
type: n,
|
|
2269
|
+
message: Ea(e) ? e : "",
|
|
2270
|
+
ref: t
|
|
2271
|
+
};
|
|
2272
|
+
}
|
|
2273
|
+
var Fa = (e) => Ui(e) && !Oa(e) ? e : {
|
|
2274
|
+
value: e,
|
|
2275
|
+
message: ""
|
|
2276
|
+
}, Ia = async (e, t, n, r, i) => {
|
|
2277
|
+
let { ref: a, refs: o, required: s, maxLength: c, minLength: l, min: u, max: d, pattern: f, validate: p, name: m, valueAsNumber: h, mount: g, disabled: _ } = e._f, v = Q(t, m);
|
|
2278
|
+
if (!g || _) return {};
|
|
2279
|
+
let y = o ? o[0] : a, b = (e) => {
|
|
2280
|
+
r && y.reportValidity && (y.setCustomValidity(Qi(e) ? "" : e || ""), y.reportValidity());
|
|
2281
|
+
}, x = {}, S = Da(a), C = zi(a), w = S || C, T = (h || Ca(a)) && Zi(a.value) && Zi(v) || Ta(a) && a.value === "" || v === "" || Array.isArray(v) && !v.length, E = va.bind(null, m, n, x), D = (e, t, n, r = ra.maxLength, i = ra.minLength) => {
|
|
2282
|
+
let o = e ? t : n;
|
|
2283
|
+
x[m] = {
|
|
2284
|
+
type: e ? r : i,
|
|
2285
|
+
message: o,
|
|
2286
|
+
ref: a,
|
|
2287
|
+
...E(e ? r : i, o)
|
|
2288
|
+
};
|
|
2289
|
+
};
|
|
2290
|
+
if (i ? !Array.isArray(v) || !v.length : s && (!w && (T || Vi(v)) || Qi(v) && !v || C && !ja(o).isValid || S && !Na(o).isValid)) {
|
|
2291
|
+
let { value: e, message: t } = Ea(s) ? {
|
|
2292
|
+
value: !!s,
|
|
2293
|
+
message: s
|
|
2294
|
+
} : Fa(s);
|
|
2295
|
+
if (e && (x[m] = {
|
|
2296
|
+
type: ra.required,
|
|
2297
|
+
message: t,
|
|
2298
|
+
ref: y,
|
|
2299
|
+
...E(ra.required, t)
|
|
2300
|
+
}, !n)) return b(t), x;
|
|
2301
|
+
}
|
|
2302
|
+
if (!T && (!Vi(u) || !Vi(d))) {
|
|
2303
|
+
let e, t, r = Fa(d), i = Fa(u);
|
|
2304
|
+
if (!Vi(v) && !isNaN(v)) {
|
|
2305
|
+
let n = a.valueAsNumber || v && +v;
|
|
2306
|
+
Vi(r.value) || (e = n > r.value), Vi(i.value) || (t = n < i.value);
|
|
2307
|
+
} else {
|
|
2308
|
+
let n = a.valueAsDate || new Date(v), o = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), s = a.type == "time", c = a.type == "week";
|
|
2309
|
+
ma(r.value) && v && (e = s ? o(v) > o(r.value) : c ? v > r.value : n > new Date(r.value)), ma(i.value) && v && (t = s ? o(v) < o(i.value) : c ? v < i.value : n < new Date(i.value));
|
|
2310
|
+
}
|
|
2311
|
+
if ((e || t) && (D(!!e, r.message, i.message, ra.max, ra.min), !n)) return b(x[m].message), x;
|
|
2312
|
+
}
|
|
2313
|
+
if ((c || l) && !T && (ma(v) || i && Array.isArray(v))) {
|
|
2314
|
+
let e = Fa(c), t = Fa(l), r = !Vi(e.value) && v.length > +e.value, i = !Vi(t.value) && v.length < +t.value;
|
|
2315
|
+
if ((r || i) && (D(r, e.message, t.message), !n)) return b(x[m].message), x;
|
|
2316
|
+
}
|
|
2317
|
+
if (f && !T && ma(v)) {
|
|
2318
|
+
let { value: e, message: t } = Fa(f);
|
|
2319
|
+
if (Oa(e) && !v.match(e) && (x[m] = {
|
|
2320
|
+
type: ra.pattern,
|
|
2321
|
+
message: t,
|
|
2322
|
+
ref: a,
|
|
2323
|
+
...E(ra.pattern, t)
|
|
2324
|
+
}, !n)) return b(t), x;
|
|
2325
|
+
}
|
|
2326
|
+
if (p) {
|
|
2327
|
+
if (wa(p)) {
|
|
2328
|
+
let e = Pa(await p(v, t), y);
|
|
2329
|
+
if (e && (x[m] = {
|
|
2330
|
+
...e,
|
|
2331
|
+
...E(ra.validate, e.message)
|
|
2332
|
+
}, !n)) return b(e.message), x;
|
|
2333
|
+
} else if (Ui(p)) {
|
|
2334
|
+
let e = {};
|
|
2335
|
+
for (let r in p) {
|
|
2336
|
+
if (!ca(e) && !n) break;
|
|
2337
|
+
let i = Pa(await p[r](v, t), y, r);
|
|
2338
|
+
i && (e = {
|
|
2339
|
+
...i,
|
|
2340
|
+
...E(r, i.message)
|
|
2341
|
+
}, b(i.message), n && (x[m] = e));
|
|
2342
|
+
}
|
|
2343
|
+
if (!ca(e) && (x[m] = {
|
|
2344
|
+
ref: y,
|
|
2345
|
+
...e
|
|
2346
|
+
}, !n)) return x;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
return b(!0), x;
|
|
2350
|
+
};
|
|
2351
|
+
function La(e, t) {
|
|
2352
|
+
let n = t.slice(0, -1).length, r = 0;
|
|
2353
|
+
for (; r < n;) e = Zi(e) ? r++ : e[t[r++]];
|
|
2354
|
+
return e;
|
|
2355
|
+
}
|
|
2356
|
+
function Ra(e) {
|
|
2357
|
+
for (let t in e) if (e.hasOwnProperty(t) && !Zi(e[t])) return !1;
|
|
2358
|
+
return !0;
|
|
2359
|
+
}
|
|
2360
|
+
function za(e, t) {
|
|
2361
|
+
let n = Array.isArray(t) ? t : $i(t) ? [t] : ea(t), r = n.length === 1 ? e : La(e, n), i = n.length - 1, a = n[i];
|
|
2362
|
+
return r && delete r[a], i !== 0 && (Ui(r) && ca(r) || Array.isArray(r) && Ra(r)) && za(e, n.slice(0, -1)), e;
|
|
2363
|
+
}
|
|
2364
|
+
var Ba = () => {
|
|
2365
|
+
let e = [];
|
|
2366
|
+
return {
|
|
2367
|
+
get observers() {
|
|
2368
|
+
return e;
|
|
2369
|
+
},
|
|
2370
|
+
next: (t) => {
|
|
2371
|
+
for (let n of e) n.next && n.next(t);
|
|
2372
|
+
},
|
|
2373
|
+
subscribe: (t) => (e.push(t), { unsubscribe: () => {
|
|
2374
|
+
e = e.filter((e) => e !== t);
|
|
2375
|
+
} }),
|
|
2376
|
+
unsubscribe: () => {
|
|
2377
|
+
e = [];
|
|
2378
|
+
}
|
|
2379
|
+
};
|
|
2380
|
+
}, Va = (e) => Vi(e) || !Hi(e);
|
|
2381
|
+
function Ha(e, t) {
|
|
2382
|
+
if (Va(e) || Va(t)) return e === t;
|
|
2383
|
+
if (Bi(e) && Bi(t)) return e.getTime() === t.getTime();
|
|
2384
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
2385
|
+
if (n.length !== r.length) return !1;
|
|
2386
|
+
for (let i of n) {
|
|
2387
|
+
let n = e[i];
|
|
2388
|
+
if (!r.includes(i)) return !1;
|
|
2389
|
+
if (i !== "ref") {
|
|
2390
|
+
let e = t[i];
|
|
2391
|
+
if (Bi(n) && Bi(e) || Ui(n) && Ui(e) || Array.isArray(n) && Array.isArray(e) ? !Ha(n, e) : n !== e) return !1;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
return !0;
|
|
2395
|
+
}
|
|
2396
|
+
var Ua = (e) => e.type === "select-multiple", Wa = (e) => Da(e) || zi(e), Ga = (e) => Ta(e) && e.isConnected, Ka = (e) => {
|
|
2397
|
+
for (let t in e) if (wa(e[t])) return !0;
|
|
2398
|
+
return !1;
|
|
2399
|
+
};
|
|
2400
|
+
function qa(e, t = {}) {
|
|
2401
|
+
let n = Array.isArray(e);
|
|
2402
|
+
if (Ui(e) || n) for (let n in e) Array.isArray(e[n]) || Ui(e[n]) && !Ka(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, qa(e[n], t[n])) : Vi(e[n]) || (t[n] = !0);
|
|
2403
|
+
return t;
|
|
2404
|
+
}
|
|
2405
|
+
function Ja(e, t, n) {
|
|
2406
|
+
let r = Array.isArray(e);
|
|
2407
|
+
if (Ui(e) || r) for (let r in e) Array.isArray(e[r]) || Ui(e[r]) && !Ka(e[r]) ? Zi(t) || Va(n[r]) ? n[r] = Array.isArray(e[r]) ? qa(e[r], []) : { ...qa(e[r]) } : Ja(e[r], Vi(t) ? {} : t[r], n[r]) : n[r] = !Ha(e[r], t[r]);
|
|
2408
|
+
return n;
|
|
2409
|
+
}
|
|
2410
|
+
var Ya = (e, t) => Ja(e, t, qa(t)), Xa = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => Zi(e) ? e : t ? e === "" ? NaN : e && +e : n && ma(e) ? new Date(e) : r ? r(e) : e;
|
|
2411
|
+
function Za(e) {
|
|
2412
|
+
let t = e.ref;
|
|
2413
|
+
if (!(e.refs ? e.refs.every((e) => e.disabled) : t.disabled)) return Ca(t) ? t.files : Da(t) ? Na(e.refs).value : Ua(t) ? [...t.selectedOptions].map(({ value: e }) => e) : zi(t) ? ja(e.refs).value : Xa(Zi(t.value) ? e.ref.value : t.value, e);
|
|
2414
|
+
}
|
|
2415
|
+
var Qa = (e, t, n, r) => {
|
|
2416
|
+
let i = {};
|
|
2417
|
+
for (let n of e) {
|
|
2418
|
+
let e = Q(t, n);
|
|
2419
|
+
e && $(i, n, e._f);
|
|
2420
|
+
}
|
|
2421
|
+
return {
|
|
2422
|
+
criteriaMode: n,
|
|
2423
|
+
names: [...e],
|
|
2424
|
+
fields: i,
|
|
2425
|
+
shouldUseNativeValidation: r
|
|
2426
|
+
};
|
|
2427
|
+
}, $a = (e) => Zi(e) ? e : Oa(e) ? e.source : Ui(e) ? Oa(e.value) ? e.value.source : e.value : e, eo = "AsyncFunction", to = (e) => (!e || !e.validate) && !!(wa(e.validate) && e.validate.constructor.name === eo || Ui(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === eo)), no = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2428
|
+
function ro(e, t, n) {
|
|
2429
|
+
let r = Q(e, n);
|
|
2430
|
+
if (r || $i(n)) return {
|
|
2431
|
+
error: r,
|
|
2432
|
+
name: n
|
|
2433
|
+
};
|
|
2434
|
+
let i = n.split(".");
|
|
2435
|
+
for (; i.length;) {
|
|
2436
|
+
let r = i.join("."), a = Q(t, r), o = Q(e, r);
|
|
2437
|
+
if (a && !Array.isArray(a) && n !== r) return { name: n };
|
|
2438
|
+
if (o && o.type) return {
|
|
2439
|
+
name: r,
|
|
2440
|
+
error: o
|
|
2441
|
+
};
|
|
2442
|
+
i.pop();
|
|
2443
|
+
}
|
|
2444
|
+
return { name: n };
|
|
2445
|
+
}
|
|
2446
|
+
var io = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, ao = (e, t) => !Xi(Q(e, t)).length && za(e, t), oo = {
|
|
2447
|
+
mode: na.onSubmit,
|
|
2448
|
+
reValidateMode: na.onChange,
|
|
2449
|
+
shouldFocusError: !0
|
|
2450
|
+
};
|
|
2451
|
+
function so(e = {}) {
|
|
2452
|
+
let t = {
|
|
2453
|
+
...oo,
|
|
2454
|
+
...e
|
|
2455
|
+
}, n = {
|
|
2456
|
+
submitCount: 0,
|
|
2457
|
+
isDirty: !1,
|
|
2458
|
+
isLoading: wa(t.defaultValues),
|
|
2459
|
+
isValidating: !1,
|
|
2460
|
+
isSubmitted: !1,
|
|
2461
|
+
isSubmitting: !1,
|
|
2462
|
+
isSubmitSuccessful: !1,
|
|
2463
|
+
isValid: !1,
|
|
2464
|
+
touchedFields: {},
|
|
2465
|
+
dirtyFields: {},
|
|
2466
|
+
validatingFields: {},
|
|
2467
|
+
errors: t.errors || {},
|
|
2468
|
+
disabled: t.disabled || !1
|
|
2469
|
+
}, r = {}, i = (Ui(t.defaultValues) || Ui(t.values)) && Yi(t.defaultValues || t.values) || {}, a = t.shouldUnregister ? {} : Yi(i), o = {
|
|
2470
|
+
action: !1,
|
|
2471
|
+
mount: !1,
|
|
2472
|
+
watch: !1
|
|
2473
|
+
}, s = {
|
|
2474
|
+
mount: /* @__PURE__ */ new Set(),
|
|
2475
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
2476
|
+
array: /* @__PURE__ */ new Set(),
|
|
2477
|
+
watch: /* @__PURE__ */ new Set()
|
|
2478
|
+
}, c, l = 0, u = {
|
|
2479
|
+
isDirty: !1,
|
|
2480
|
+
dirtyFields: !1,
|
|
2481
|
+
validatingFields: !1,
|
|
2482
|
+
touchedFields: !1,
|
|
2483
|
+
isValidating: !1,
|
|
2484
|
+
isValid: !1,
|
|
2485
|
+
errors: !1
|
|
2486
|
+
}, d = {
|
|
2487
|
+
values: Ba(),
|
|
2488
|
+
array: Ba(),
|
|
2489
|
+
state: Ba()
|
|
2490
|
+
}, f = ya(t.mode), p = ya(t.reValidateMode), m = t.criteriaMode === na.all, h = (e) => (t) => {
|
|
2491
|
+
clearTimeout(l), l = setTimeout(e, t);
|
|
2492
|
+
}, g = async (i) => {
|
|
2493
|
+
if (!e.disabled && (u.isValid || i)) {
|
|
2494
|
+
let e = t.resolver ? ca((await w()).errors) : await E(r, !0);
|
|
2495
|
+
e !== n.isValid && d.state.next({ isValid: e });
|
|
2496
|
+
}
|
|
2497
|
+
}, _ = (t, r) => {
|
|
2498
|
+
!e.disabled && (u.isValidating || u.validatingFields) && ((t || Array.from(s.mount)).forEach((e) => {
|
|
2499
|
+
e && (r ? $(n.validatingFields, e, r) : za(n.validatingFields, e));
|
|
2500
|
+
}), d.state.next({
|
|
2501
|
+
validatingFields: n.validatingFields,
|
|
2502
|
+
isValidating: !ca(n.validatingFields)
|
|
2503
|
+
}));
|
|
2504
|
+
}, v = (t, s = [], c, l, f = !0, p = !0) => {
|
|
2505
|
+
if (l && c && !e.disabled) {
|
|
2506
|
+
if (o.action = !0, p && Array.isArray(Q(r, t))) {
|
|
2507
|
+
let e = c(Q(r, t), l.argA, l.argB);
|
|
2508
|
+
f && $(r, t, e);
|
|
2509
|
+
}
|
|
2510
|
+
if (p && Array.isArray(Q(n.errors, t))) {
|
|
2511
|
+
let e = c(Q(n.errors, t), l.argA, l.argB);
|
|
2512
|
+
f && $(n.errors, t, e), ao(n.errors, t);
|
|
2513
|
+
}
|
|
2514
|
+
if (u.touchedFields && p && Array.isArray(Q(n.touchedFields, t))) {
|
|
2515
|
+
let e = c(Q(n.touchedFields, t), l.argA, l.argB);
|
|
2516
|
+
f && $(n.touchedFields, t, e);
|
|
2517
|
+
}
|
|
2518
|
+
u.dirtyFields && (n.dirtyFields = Ya(i, a)), d.state.next({
|
|
2519
|
+
name: t,
|
|
2520
|
+
isDirty: O(t, s),
|
|
2521
|
+
dirtyFields: n.dirtyFields,
|
|
2522
|
+
errors: n.errors,
|
|
2523
|
+
isValid: n.isValid
|
|
2524
|
+
});
|
|
2525
|
+
} else $(a, t, s);
|
|
2526
|
+
}, y = (e, t) => {
|
|
2527
|
+
$(n.errors, e, t), d.state.next({ errors: n.errors });
|
|
2528
|
+
}, b = (e) => {
|
|
2529
|
+
n.errors = e, d.state.next({
|
|
2530
|
+
errors: n.errors,
|
|
2531
|
+
isValid: !1
|
|
2532
|
+
});
|
|
2533
|
+
}, x = (e, t, n, s) => {
|
|
2534
|
+
let c = Q(r, e);
|
|
2535
|
+
if (c) {
|
|
2536
|
+
let r = Q(a, e, Zi(n) ? Q(i, e) : n);
|
|
2537
|
+
Zi(r) || s && s.defaultChecked || t ? $(a, e, t ? r : Za(c._f)) : te(e, r), o.mount && g();
|
|
2538
|
+
}
|
|
2539
|
+
}, S = (t, a, o, s, c) => {
|
|
2540
|
+
let l = !1, f = !1, p = { name: t };
|
|
2541
|
+
if (!e.disabled) {
|
|
2542
|
+
let e = !!(Q(r, t) && Q(r, t)._f && Q(r, t)._f.disabled);
|
|
2543
|
+
if (!o || s) {
|
|
2544
|
+
u.isDirty && (f = n.isDirty, n.isDirty = p.isDirty = O(), l = f !== p.isDirty);
|
|
2545
|
+
let r = e || Ha(Q(i, t), a);
|
|
2546
|
+
f = !!(!e && Q(n.dirtyFields, t)), r || e ? za(n.dirtyFields, t) : $(n.dirtyFields, t, !0), p.dirtyFields = n.dirtyFields, l ||= u.dirtyFields && f !== !r;
|
|
2547
|
+
}
|
|
2548
|
+
if (o) {
|
|
2549
|
+
let e = Q(n.touchedFields, t);
|
|
2550
|
+
e || ($(n.touchedFields, t, o), p.touchedFields = n.touchedFields, l ||= u.touchedFields && e !== o);
|
|
2551
|
+
}
|
|
2552
|
+
l && c && d.state.next(p);
|
|
2553
|
+
}
|
|
2554
|
+
return l ? p : {};
|
|
2555
|
+
}, C = (t, r, i, a) => {
|
|
2556
|
+
let o = Q(n.errors, t), s = u.isValid && Qi(r) && n.isValid !== r;
|
|
2557
|
+
if (e.delayError && i ? (c = h(() => y(t, i)), c(e.delayError)) : (clearTimeout(l), c = null, i ? $(n.errors, t, i) : za(n.errors, t)), (i ? !Ha(o, i) : o) || !ca(a) || s) {
|
|
2558
|
+
let e = {
|
|
2559
|
+
...a,
|
|
2560
|
+
...s && Qi(r) ? { isValid: r } : {},
|
|
2561
|
+
errors: n.errors,
|
|
2562
|
+
name: t
|
|
2563
|
+
};
|
|
2564
|
+
n = {
|
|
2565
|
+
...n,
|
|
2566
|
+
...e
|
|
2567
|
+
}, d.state.next(e);
|
|
2568
|
+
}
|
|
2569
|
+
}, w = async (e) => {
|
|
2570
|
+
_(e, !0);
|
|
2571
|
+
let n = await t.resolver(a, t.context, Qa(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation));
|
|
2572
|
+
return _(e), n;
|
|
2573
|
+
}, T = async (e) => {
|
|
2574
|
+
let { errors: t } = await w(e);
|
|
2575
|
+
if (e) for (let r of e) {
|
|
2576
|
+
let e = Q(t, r);
|
|
2577
|
+
e ? $(n.errors, r, e) : za(n.errors, r);
|
|
2578
|
+
}
|
|
2579
|
+
else n.errors = t;
|
|
2580
|
+
return t;
|
|
2581
|
+
}, E = async (e, r, i = { valid: !0 }) => {
|
|
2582
|
+
for (let o in e) {
|
|
2583
|
+
let c = e[o];
|
|
2584
|
+
if (c) {
|
|
2585
|
+
let { _f: e, ...l } = c;
|
|
2586
|
+
if (e) {
|
|
2587
|
+
let l = s.array.has(e.name), d = c._f && to(c._f);
|
|
2588
|
+
d && u.validatingFields && _([o], !0);
|
|
2589
|
+
let f = await Ia(c, a, m, t.shouldUseNativeValidation && !r, l);
|
|
2590
|
+
if (d && u.validatingFields && _([o]), f[e.name] && (i.valid = !1, r)) break;
|
|
2591
|
+
!r && (Q(f, e.name) ? l ? Sa(n.errors, f, e.name) : $(n.errors, e.name, f[e.name]) : za(n.errors, e.name));
|
|
2592
|
+
}
|
|
2593
|
+
!ca(l) && await E(l, r, i);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
return i.valid;
|
|
2597
|
+
}, D = () => {
|
|
2598
|
+
for (let e of s.unMount) {
|
|
2599
|
+
let t = Q(r, e);
|
|
2600
|
+
t && (t._f.refs ? t._f.refs.every((e) => !Ga(e)) : !Ga(t._f.ref)) && L(e);
|
|
2601
|
+
}
|
|
2602
|
+
s.unMount = /* @__PURE__ */ new Set();
|
|
2603
|
+
}, O = (t, n) => !e.disabled && (t && n && $(a, t, n), !Ha(P(), i)), k = (e, t, n) => ha(e, s, { ...o.mount ? a : Zi(t) ? i : ma(e) ? { [e]: t } : t }, n, t), ee = (t) => Xi(Q(o.mount ? a : i, t, e.shouldUnregister ? Q(i, t, []) : [])), te = (e, t, n = {}) => {
|
|
2604
|
+
let i = Q(r, e), o = t;
|
|
2605
|
+
if (i) {
|
|
2606
|
+
let n = i._f;
|
|
2607
|
+
n && (!n.disabled && $(a, e, Xa(t, n)), o = Ta(n.ref) && Vi(t) ? "" : t, Ua(n.ref) ? [...n.ref.options].forEach((e) => e.selected = o.includes(e.value)) : n.refs ? zi(n.ref) ? n.refs.length > 1 ? n.refs.forEach((e) => (!e.defaultChecked || !e.disabled) && (e.checked = Array.isArray(o) ? !!o.find((t) => t === e.value) : o === e.value)) : n.refs[0] && (n.refs[0].checked = !!o) : n.refs.forEach((e) => e.checked = e.value === o) : Ca(n.ref) ? n.ref.value = "" : (n.ref.value = o, n.ref.type || d.values.next({
|
|
2608
|
+
name: e,
|
|
2609
|
+
values: { ...a }
|
|
2610
|
+
})));
|
|
2611
|
+
}
|
|
2612
|
+
(n.shouldDirty || n.shouldTouch) && S(e, o, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && N(e);
|
|
2613
|
+
}, A = (e, t, n) => {
|
|
2614
|
+
for (let i in t) {
|
|
2615
|
+
let a = t[i], o = `${e}.${i}`, c = Q(r, o);
|
|
2616
|
+
(s.array.has(e) || Ui(a) || c && !c._f) && !Bi(a) ? A(o, a, n) : te(o, a, n);
|
|
2617
|
+
}
|
|
2618
|
+
}, j = (e, t, c = {}) => {
|
|
2619
|
+
let l = Q(r, e), f = s.array.has(e), p = Yi(t);
|
|
2620
|
+
$(a, e, p), f ? (d.array.next({
|
|
2621
|
+
name: e,
|
|
2622
|
+
values: { ...a }
|
|
2623
|
+
}), (u.isDirty || u.dirtyFields) && c.shouldDirty && d.state.next({
|
|
2624
|
+
name: e,
|
|
2625
|
+
dirtyFields: Ya(i, a),
|
|
2626
|
+
isDirty: O(e, p)
|
|
2627
|
+
})) : l && !l._f && !Vi(p) ? A(e, p, c) : te(e, p, c), ba(e, s) && d.state.next({ ...n }), d.values.next({
|
|
2628
|
+
name: o.mount ? e : void 0,
|
|
2629
|
+
values: { ...a }
|
|
2630
|
+
});
|
|
2631
|
+
}, ne = async (i) => {
|
|
2632
|
+
o.mount = !0;
|
|
2633
|
+
let l = i.target, h = l.name, v = !0, y = Q(r, h), b = () => l.type ? Za(y._f) : Wi(i), x = (e) => {
|
|
2634
|
+
v = Number.isNaN(e) || Bi(e) && isNaN(e.getTime()) || Ha(e, Q(a, h, e));
|
|
2635
|
+
};
|
|
2636
|
+
if (y) {
|
|
2637
|
+
let o, l, T = b(), D = i.type === ta.BLUR || i.type === ta.FOCUS_OUT, O = !no(y._f) && !t.resolver && !Q(n.errors, h) && !y._f.deps || io(D, Q(n.touchedFields, h), n.isSubmitted, p, f), k = ba(h, s, D);
|
|
2638
|
+
$(a, h, T), D ? (y._f.onBlur && y._f.onBlur(i), c && c(0)) : y._f.onChange && y._f.onChange(i);
|
|
2639
|
+
let ee = S(h, T, D, !1), te = !ca(ee) || k;
|
|
2640
|
+
if (!D && d.values.next({
|
|
2641
|
+
name: h,
|
|
2642
|
+
type: i.type,
|
|
2643
|
+
values: { ...a }
|
|
2644
|
+
}), O) return u.isValid && (e.mode === "onBlur" ? D && g() : g()), te && d.state.next({
|
|
2645
|
+
name: h,
|
|
2646
|
+
...k ? {} : ee
|
|
2647
|
+
});
|
|
2648
|
+
if (!D && k && d.state.next({ ...n }), t.resolver) {
|
|
2649
|
+
let { errors: e } = await w([h]);
|
|
2650
|
+
if (x(T), v) {
|
|
2651
|
+
let t = ro(n.errors, r, h), i = ro(e, r, t.name || h);
|
|
2652
|
+
o = i.error, h = i.name, l = ca(e);
|
|
2653
|
+
}
|
|
2654
|
+
} else _([h], !0), o = (await Ia(y, a, m, t.shouldUseNativeValidation))[h], _([h]), x(T), v && (o ? l = !1 : u.isValid && (l = await E(r, !0)));
|
|
2655
|
+
v && (y._f.deps && N(y._f.deps), C(h, l, o, ee));
|
|
2656
|
+
}
|
|
2657
|
+
}, M = (e, t) => {
|
|
2658
|
+
if (Q(n.errors, t) && e.focus) return e.focus(), 1;
|
|
2659
|
+
}, N = async (e, i = {}) => {
|
|
2660
|
+
let a, o, c = ua(e);
|
|
2661
|
+
if (t.resolver) {
|
|
2662
|
+
let t = await T(Zi(e) ? e : c);
|
|
2663
|
+
a = ca(t), o = e ? !c.some((e) => Q(t, e)) : a;
|
|
2664
|
+
} else e ? (o = (await Promise.all(c.map(async (e) => {
|
|
2665
|
+
let t = Q(r, e);
|
|
2666
|
+
return await E(t && t._f ? { [e]: t } : t);
|
|
2667
|
+
}))).every(Boolean), !(!o && !n.isValid) && g()) : o = a = await E(r);
|
|
2668
|
+
return d.state.next({
|
|
2669
|
+
...!ma(e) || u.isValid && a !== n.isValid ? {} : { name: e },
|
|
2670
|
+
...t.resolver || !e ? { isValid: a } : {},
|
|
2671
|
+
errors: n.errors
|
|
2672
|
+
}), i.shouldFocus && !o && xa(r, M, e ? c : s.mount), o;
|
|
2673
|
+
}, P = (e) => {
|
|
2674
|
+
let t = { ...o.mount ? a : i };
|
|
2675
|
+
return Zi(e) ? t : ma(e) ? Q(t, e) : e.map((e) => Q(t, e));
|
|
2676
|
+
}, F = (e, t) => ({
|
|
2677
|
+
invalid: !!Q((t || n).errors, e),
|
|
2678
|
+
isDirty: !!Q((t || n).dirtyFields, e),
|
|
2679
|
+
error: Q((t || n).errors, e),
|
|
2680
|
+
isValidating: !!Q(n.validatingFields, e),
|
|
2681
|
+
isTouched: !!Q((t || n).touchedFields, e)
|
|
2682
|
+
}), I = (e) => {
|
|
2683
|
+
e && ua(e).forEach((e) => za(n.errors, e)), d.state.next({ errors: e ? n.errors : {} });
|
|
2684
|
+
}, re = (e, t, i) => {
|
|
2685
|
+
let a = (Q(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = Q(n.errors, e) || {};
|
|
2686
|
+
$(n.errors, e, {
|
|
2687
|
+
...l,
|
|
2688
|
+
...t,
|
|
2689
|
+
ref: a
|
|
2690
|
+
}), d.state.next({
|
|
2691
|
+
name: e,
|
|
2692
|
+
errors: n.errors,
|
|
2693
|
+
isValid: !1
|
|
2694
|
+
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
2695
|
+
}, ie = (e, t) => wa(e) ? d.values.subscribe({ next: (n) => e(k(void 0, t), n) }) : k(e, t, !0), L = (e, o = {}) => {
|
|
2696
|
+
for (let c of e ? ua(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || (za(r, c), za(a, c)), !o.keepError && za(n.errors, c), !o.keepDirty && za(n.dirtyFields, c), !o.keepTouched && za(n.touchedFields, c), !o.keepIsValidating && za(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && za(i, c);
|
|
2697
|
+
d.values.next({ values: { ...a } }), d.state.next({
|
|
2698
|
+
...n,
|
|
2699
|
+
...o.keepDirty ? { isDirty: O() } : {}
|
|
2700
|
+
}), !o.keepIsValid && g();
|
|
2701
|
+
}, R = ({ disabled: e, name: t, field: n, fields: r, value: i }) => {
|
|
2702
|
+
if (Qi(e) && o.mount || e) {
|
|
2703
|
+
let o = e ? void 0 : Zi(i) ? Za(n ? n._f : Q(r, t)._f) : i;
|
|
2704
|
+
$(a, t, o), S(t, o, !1, !1, !0);
|
|
2705
|
+
}
|
|
2706
|
+
}, z = (n, a = {}) => {
|
|
2707
|
+
let c = Q(r, n), l = Qi(a.disabled) || Qi(e.disabled);
|
|
2708
|
+
return $(r, n, {
|
|
2709
|
+
...c || {},
|
|
2710
|
+
_f: {
|
|
2711
|
+
...c && c._f ? c._f : { ref: { name: n } },
|
|
2712
|
+
name: n,
|
|
2713
|
+
mount: !0,
|
|
2714
|
+
...a
|
|
2715
|
+
}
|
|
2716
|
+
}), s.mount.add(n), c ? R({
|
|
2717
|
+
field: c,
|
|
2718
|
+
disabled: Qi(a.disabled) ? a.disabled : e.disabled,
|
|
2719
|
+
name: n,
|
|
2720
|
+
value: a.value
|
|
2721
|
+
}) : x(n, !0, a.value), {
|
|
2722
|
+
...l ? { disabled: a.disabled || e.disabled } : {},
|
|
2723
|
+
...t.progressive ? {
|
|
2724
|
+
required: !!a.required,
|
|
2725
|
+
min: $a(a.min),
|
|
2726
|
+
max: $a(a.max),
|
|
2727
|
+
minLength: $a(a.minLength),
|
|
2728
|
+
maxLength: $a(a.maxLength),
|
|
2729
|
+
pattern: $a(a.pattern)
|
|
2730
|
+
} : {},
|
|
2731
|
+
name: n,
|
|
2732
|
+
onChange: ne,
|
|
2733
|
+
onBlur: ne,
|
|
2734
|
+
ref: (e) => {
|
|
2735
|
+
if (e) {
|
|
2736
|
+
z(n, a), c = Q(r, n);
|
|
2737
|
+
let t = Zi(e.value) && e.querySelectorAll && e.querySelectorAll("input,select,textarea")[0] || e, o = Wa(t), s = c._f.refs || [];
|
|
2738
|
+
if (o ? s.find((e) => e === t) : t === c._f.ref) return;
|
|
2739
|
+
$(r, n, { _f: {
|
|
2740
|
+
...c._f,
|
|
2741
|
+
...o ? {
|
|
2742
|
+
refs: [
|
|
2743
|
+
...s.filter(Ga),
|
|
2744
|
+
t,
|
|
2745
|
+
...Array.isArray(Q(i, n)) ? [{}] : []
|
|
2746
|
+
],
|
|
2747
|
+
ref: {
|
|
2748
|
+
type: t.type,
|
|
2749
|
+
name: n
|
|
2750
|
+
}
|
|
2751
|
+
} : { ref: t }
|
|
2752
|
+
} }), x(n, !1, void 0, t);
|
|
2753
|
+
} else c = Q(r, n, {}), c._f && (c._f.mount = !1), (t.shouldUnregister || a.shouldUnregister) && !(Ki(s.array, n) && o.action) && s.unMount.add(n);
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
}, B = () => t.shouldFocusError && xa(r, M, s.mount), ae = (e) => {
|
|
2757
|
+
Qi(e) && (d.state.next({ disabled: e }), xa(r, (t, n) => {
|
|
2758
|
+
let i = Q(r, n);
|
|
2759
|
+
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
2760
|
+
t.disabled = i._f.disabled || e;
|
|
2761
|
+
}));
|
|
2762
|
+
}, 0, !1));
|
|
2763
|
+
}, V = (e, i) => async (o) => {
|
|
2764
|
+
let s;
|
|
2765
|
+
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
2766
|
+
let c = Yi(a);
|
|
2767
|
+
if (d.state.next({ isSubmitting: !0 }), t.resolver) {
|
|
2768
|
+
let { errors: e, values: t } = await w();
|
|
2769
|
+
n.errors = e, c = t;
|
|
2770
|
+
} else await E(r);
|
|
2771
|
+
if (za(n.errors, "root"), ca(n.errors)) {
|
|
2772
|
+
d.state.next({ errors: {} });
|
|
2773
|
+
try {
|
|
2774
|
+
await e(c, o);
|
|
2775
|
+
} catch (e) {
|
|
2776
|
+
s = e;
|
|
2777
|
+
}
|
|
2778
|
+
} else i && await i({ ...n.errors }, o), B(), setTimeout(B);
|
|
2779
|
+
if (d.state.next({
|
|
2780
|
+
isSubmitted: !0,
|
|
2781
|
+
isSubmitting: !1,
|
|
2782
|
+
isSubmitSuccessful: ca(n.errors) && !s,
|
|
2783
|
+
submitCount: n.submitCount + 1,
|
|
2784
|
+
errors: n.errors
|
|
2785
|
+
}), s) throw s;
|
|
2786
|
+
}, oe = (e, t = {}) => {
|
|
2787
|
+
Q(r, e) && (Zi(t.defaultValue) ? j(e, Yi(Q(i, e))) : (j(e, t.defaultValue), $(i, e, Yi(t.defaultValue))), t.keepTouched || za(n.touchedFields, e), t.keepDirty || (za(n.dirtyFields, e), n.isDirty = t.defaultValue ? O(e, Yi(Q(i, e))) : O()), t.keepError || (za(n.errors, e), u.isValid && g()), d.state.next({ ...n }));
|
|
2788
|
+
}, se = (t, c = {}) => {
|
|
2789
|
+
let l = t ? Yi(t) : i, f = Yi(l), p = ca(t), m = p ? i : f;
|
|
2790
|
+
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
2791
|
+
if (c.keepDirtyValues) {
|
|
2792
|
+
let e = new Set([...s.mount, ...Object.keys(Ya(i, a))]);
|
|
2793
|
+
for (let t of Array.from(e)) Q(n.dirtyFields, t) ? $(m, t, Q(a, t)) : j(t, Q(m, t));
|
|
2794
|
+
} else {
|
|
2795
|
+
if (Ji && Zi(t)) for (let e of s.mount) {
|
|
2796
|
+
let t = Q(r, e);
|
|
2797
|
+
if (t && t._f) {
|
|
2798
|
+
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
2799
|
+
if (Ta(e)) {
|
|
2800
|
+
let t = e.closest("form");
|
|
2801
|
+
if (t) {
|
|
2802
|
+
t.reset();
|
|
2803
|
+
break;
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
r = {};
|
|
2809
|
+
}
|
|
2810
|
+
a = e.shouldUnregister ? c.keepDefaultValues ? Yi(i) : {} : Yi(m), d.array.next({ values: { ...m } }), d.values.next({ values: { ...m } });
|
|
2811
|
+
}
|
|
2812
|
+
s = {
|
|
2813
|
+
mount: c.keepDirtyValues ? s.mount : /* @__PURE__ */ new Set(),
|
|
2814
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
2815
|
+
array: /* @__PURE__ */ new Set(),
|
|
2816
|
+
watch: /* @__PURE__ */ new Set(),
|
|
2817
|
+
watchAll: !1,
|
|
2818
|
+
focus: ""
|
|
2819
|
+
}, o.mount = !u.isValid || !!c.keepIsValid || !!c.keepDirtyValues, o.watch = !!e.shouldUnregister, d.state.next({
|
|
2820
|
+
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
2821
|
+
isDirty: p ? !1 : c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !Ha(t, i)),
|
|
2822
|
+
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
2823
|
+
dirtyFields: p ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? Ya(i, a) : n.dirtyFields : c.keepDefaultValues && t ? Ya(i, t) : c.keepDirty ? n.dirtyFields : {},
|
|
2824
|
+
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
2825
|
+
errors: c.keepErrors ? n.errors : {},
|
|
2826
|
+
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
2827
|
+
isSubmitting: !1
|
|
2828
|
+
});
|
|
2829
|
+
}, ce = (e, t) => se(wa(e) ? e(a) : e, t);
|
|
2830
|
+
return {
|
|
2831
|
+
control: {
|
|
2832
|
+
register: z,
|
|
2833
|
+
unregister: L,
|
|
2834
|
+
getFieldState: F,
|
|
2835
|
+
handleSubmit: V,
|
|
2836
|
+
setError: re,
|
|
2837
|
+
_executeSchema: w,
|
|
2838
|
+
_getWatch: k,
|
|
2839
|
+
_getDirty: O,
|
|
2840
|
+
_updateValid: g,
|
|
2841
|
+
_removeUnmounted: D,
|
|
2842
|
+
_updateFieldArray: v,
|
|
2843
|
+
_updateDisabledField: R,
|
|
2844
|
+
_getFieldArray: ee,
|
|
2845
|
+
_reset: se,
|
|
2846
|
+
_resetDefaultValues: () => wa(t.defaultValues) && t.defaultValues().then((e) => {
|
|
2847
|
+
ce(e, t.resetOptions), d.state.next({ isLoading: !1 });
|
|
2848
|
+
}),
|
|
2849
|
+
_updateFormState: (e) => {
|
|
2850
|
+
n = {
|
|
2851
|
+
...n,
|
|
2852
|
+
...e
|
|
2853
|
+
};
|
|
2854
|
+
},
|
|
2855
|
+
_disableForm: ae,
|
|
2856
|
+
_subjects: d,
|
|
2857
|
+
_proxyFormState: u,
|
|
2858
|
+
_setErrors: b,
|
|
2859
|
+
get _fields() {
|
|
2860
|
+
return r;
|
|
2861
|
+
},
|
|
2862
|
+
get _formValues() {
|
|
2863
|
+
return a;
|
|
2864
|
+
},
|
|
2865
|
+
get _state() {
|
|
2866
|
+
return o;
|
|
2867
|
+
},
|
|
2868
|
+
set _state(e) {
|
|
2869
|
+
o = e;
|
|
2870
|
+
},
|
|
2871
|
+
get _defaultValues() {
|
|
2872
|
+
return i;
|
|
2873
|
+
},
|
|
2874
|
+
get _names() {
|
|
2875
|
+
return s;
|
|
2876
|
+
},
|
|
2877
|
+
set _names(e) {
|
|
2878
|
+
s = e;
|
|
2879
|
+
},
|
|
2880
|
+
get _formState() {
|
|
2881
|
+
return n;
|
|
2882
|
+
},
|
|
2883
|
+
set _formState(e) {
|
|
2884
|
+
n = e;
|
|
2885
|
+
},
|
|
2886
|
+
get _options() {
|
|
2887
|
+
return t;
|
|
2888
|
+
},
|
|
2889
|
+
set _options(e) {
|
|
2890
|
+
t = {
|
|
2891
|
+
...t,
|
|
2892
|
+
...e
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
},
|
|
2896
|
+
trigger: N,
|
|
2897
|
+
register: z,
|
|
2898
|
+
handleSubmit: V,
|
|
2899
|
+
watch: ie,
|
|
2900
|
+
setValue: j,
|
|
2901
|
+
getValues: P,
|
|
2902
|
+
reset: ce,
|
|
2903
|
+
resetField: oe,
|
|
2904
|
+
clearErrors: I,
|
|
2905
|
+
unregister: L,
|
|
2906
|
+
setError: re,
|
|
2907
|
+
setFocus: (e, t = {}) => {
|
|
2908
|
+
let n = Q(r, e), i = n && n._f;
|
|
2909
|
+
if (i) {
|
|
2910
|
+
let e = i.refs ? i.refs[0] : i.ref;
|
|
2911
|
+
e.focus && (e.focus(), t.shouldSelect && e.select());
|
|
2912
|
+
}
|
|
2913
|
+
},
|
|
2914
|
+
getFieldState: F
|
|
2915
|
+
};
|
|
2916
|
+
}
|
|
2917
|
+
function co(e = {}) {
|
|
2918
|
+
let t = H.useRef(), n = H.useRef(), [r, i] = H.useState({
|
|
2919
|
+
isDirty: !1,
|
|
2920
|
+
isValidating: !1,
|
|
2921
|
+
isLoading: wa(e.defaultValues),
|
|
2922
|
+
isSubmitted: !1,
|
|
2923
|
+
isSubmitting: !1,
|
|
2924
|
+
isSubmitSuccessful: !1,
|
|
2925
|
+
isValid: !1,
|
|
2926
|
+
submitCount: 0,
|
|
2927
|
+
dirtyFields: {},
|
|
2928
|
+
touchedFields: {},
|
|
2929
|
+
validatingFields: {},
|
|
2930
|
+
errors: e.errors || {},
|
|
2931
|
+
disabled: e.disabled || !1,
|
|
2932
|
+
defaultValues: wa(e.defaultValues) ? void 0 : e.defaultValues
|
|
2933
|
+
});
|
|
2934
|
+
t.current ||= {
|
|
2935
|
+
...so(e),
|
|
2936
|
+
formState: r
|
|
2937
|
+
};
|
|
2938
|
+
let a = t.current.control;
|
|
2939
|
+
return a._options = e, fa({
|
|
2940
|
+
subject: a._subjects.state,
|
|
2941
|
+
next: (e) => {
|
|
2942
|
+
la(e, a._proxyFormState, a._updateFormState, !0) && i({ ...a._formState });
|
|
2943
|
+
}
|
|
2944
|
+
}), H.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), H.useEffect(() => {
|
|
2945
|
+
if (a._proxyFormState.isDirty) {
|
|
2946
|
+
let e = a._getDirty();
|
|
2947
|
+
e !== r.isDirty && a._subjects.state.next({ isDirty: e });
|
|
2948
|
+
}
|
|
2949
|
+
}, [a, r.isDirty]), H.useEffect(() => {
|
|
2950
|
+
e.values && !Ha(e.values, n.current) ? (a._reset(e.values, a._options.resetOptions), n.current = e.values, i((e) => ({ ...e }))) : a._resetDefaultValues();
|
|
2951
|
+
}, [e.values, a]), H.useEffect(() => {
|
|
2952
|
+
e.errors && a._setErrors(e.errors);
|
|
2953
|
+
}, [e.errors, a]), H.useEffect(() => {
|
|
2954
|
+
a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
2955
|
+
}), H.useEffect(() => {
|
|
2956
|
+
e.shouldUnregister && a._subjects.values.next({ values: a._getWatch() });
|
|
2957
|
+
}, [e.shouldUnregister, a]), H.useEffect(() => {
|
|
2958
|
+
t.current && (t.current.watch = t.current.watch.bind({}));
|
|
2959
|
+
}, [r]), t.current.formState = sa(r, a), t.current;
|
|
2960
|
+
}
|
|
2961
|
+
var lo = { alert: "ids-form--alert-v5209" }, uo = U(({ alert: e, children: t, "data-testid": n, errorSummaryHeading: r = /* @__PURE__ */ q("h3", { children: "There was a problem submitting this form" }), errorSummaryHeadingText: i, errorSummaryHeadingLevel: a, form: s, gutter: c = "lg", hiddenErrorSummary: l, onSubmit: u, onValidChange: d, onError: f, updateErrorSummaryOnSubmit: p, ...m }, h) => {
|
|
2962
|
+
let g = Te({ id: m.id }), [_, v] = K({}), { handleSubmit: y, reset: b, formState: x } = s, C = en(null), { isValid: w, isSubmitted: T } = x, E = en({}), [D, O] = K(!1), k = !!Object.values(_).filter((e) => !!e).length && !l, ee = k || e;
|
|
2963
|
+
W(() => {
|
|
2964
|
+
p && D && T && (v(() => E.current), O(!1));
|
|
2965
|
+
}, [
|
|
2966
|
+
p,
|
|
2967
|
+
D,
|
|
2968
|
+
T
|
|
2969
|
+
]);
|
|
2970
|
+
let te = Yt((e) => {
|
|
2971
|
+
f?.(e), setTimeout(() => C?.current?.focus()), p && O(!0);
|
|
2972
|
+
}, [f, p]), A = Yt((e) => {
|
|
2973
|
+
y((e) => {
|
|
2974
|
+
u?.(e), v({}), E.current = {};
|
|
2975
|
+
}, te)(e);
|
|
2976
|
+
}, [
|
|
2977
|
+
te,
|
|
2978
|
+
y,
|
|
2979
|
+
u
|
|
2980
|
+
]), j = Yt((e) => {
|
|
2981
|
+
E.current = e();
|
|
2982
|
+
}, []), ne = Yt((e, t) => {
|
|
2983
|
+
t === _[e] || !t && !_[e] || (p ? j(() => [...s.control._names.mount.values()].reduce((n, r) => ({
|
|
2984
|
+
...n,
|
|
2985
|
+
[r]: r === e ? t : E.current[r]
|
|
2986
|
+
}), {})) : v((n) => [...s.control._names.mount.values()].reduce((r, i) => ({
|
|
2987
|
+
...r,
|
|
2988
|
+
[i]: i === e ? t : n[i]
|
|
2989
|
+
}), {})));
|
|
2990
|
+
}, [
|
|
2991
|
+
_,
|
|
2992
|
+
s.control._names.mount,
|
|
2993
|
+
j,
|
|
2994
|
+
p
|
|
2995
|
+
]), M = en(null);
|
|
2996
|
+
Qt(h, () => ({
|
|
2997
|
+
element: M?.current ?? void 0,
|
|
2998
|
+
api: s,
|
|
2999
|
+
submit: () => A(),
|
|
3000
|
+
reset: (e) => b(e)
|
|
3001
|
+
})), W(() => {
|
|
3002
|
+
d?.(w);
|
|
3003
|
+
}, [w, d]);
|
|
3004
|
+
let N = G(() => ({
|
|
3005
|
+
id: g,
|
|
3006
|
+
errorMessages: _,
|
|
3007
|
+
setErrorMessage: ne
|
|
3008
|
+
}), [
|
|
3009
|
+
_,
|
|
3010
|
+
g,
|
|
3011
|
+
ne
|
|
3012
|
+
]);
|
|
3013
|
+
return /* @__PURE__ */ q(ce.Provider, {
|
|
3014
|
+
value: N,
|
|
3015
|
+
children: /* @__PURE__ */ q(oa, {
|
|
3016
|
+
...s,
|
|
3017
|
+
children: /* @__PURE__ */ J("form", {
|
|
3018
|
+
...m,
|
|
3019
|
+
id: g,
|
|
3020
|
+
onSubmit: A,
|
|
3021
|
+
noValidate: !0,
|
|
3022
|
+
"data-testid": n,
|
|
3023
|
+
ref: M,
|
|
3024
|
+
className: (0, Y.default)(m.className, "iress-u-stack", `iress--gutter--${c}`),
|
|
3025
|
+
children: [/* @__PURE__ */ J("div", {
|
|
3026
|
+
role: "alert",
|
|
3027
|
+
tabIndex: -1,
|
|
3028
|
+
className: (0, Y.default)({
|
|
3029
|
+
[lo.alert]: !0,
|
|
3030
|
+
[o.Hidden]: !ee
|
|
3031
|
+
}),
|
|
3032
|
+
ref: C,
|
|
3033
|
+
children: [k ? /* @__PURE__ */ q(hn, {
|
|
3034
|
+
status: "danger",
|
|
3035
|
+
heading: r,
|
|
3036
|
+
headingText: i,
|
|
3037
|
+
headingLevel: a,
|
|
3038
|
+
children: /* @__PURE__ */ q($e, { "data-testid": S(n, "error-summary") })
|
|
3039
|
+
}) : null, e]
|
|
3040
|
+
}), /* @__PURE__ */ q("div", {
|
|
3041
|
+
className: (0, Y.default)({ [o.IgnoreStack]: !k }),
|
|
3042
|
+
children: t
|
|
3043
|
+
})]
|
|
3044
|
+
})
|
|
3045
|
+
})
|
|
3046
|
+
});
|
|
3047
|
+
}), fo = U(({ defaultValues: e, context: t, criteriaMode: n, delayError: r, mode: i = "onSubmit", progressive: a, resetOptions: o, resolver: s, reValidateMode: c = "onChange", shouldFocusError: l, shouldUseNativeValidation: u, shouldUnregister: d, values: f, ...p }, m) => /* @__PURE__ */ q(uo, {
|
|
3048
|
+
form: co({
|
|
3049
|
+
defaultValues: e,
|
|
3050
|
+
context: t,
|
|
3051
|
+
criteriaMode: n,
|
|
3052
|
+
delayError: r,
|
|
3053
|
+
mode: i,
|
|
3054
|
+
progressive: a,
|
|
3055
|
+
resetOptions: o,
|
|
3056
|
+
resolver: s,
|
|
3057
|
+
reValidateMode: c,
|
|
3058
|
+
shouldFocusError: l ?? p.hiddenErrorSummary,
|
|
3059
|
+
shouldUseNativeValidation: u,
|
|
3060
|
+
shouldUnregister: d,
|
|
3061
|
+
values: f
|
|
3062
|
+
}),
|
|
3063
|
+
...p,
|
|
3064
|
+
ref: m
|
|
3065
|
+
}));
|
|
3066
|
+
fo.useForm = co, fo.useFormContext = aa, fo.useWatch = ga;
|
|
3067
|
+
//#endregion
|
|
3068
|
+
//#region src/components/Form/FormField/FormField.tsx
|
|
3069
|
+
var po = ({ control: e, defaultValue: t, name: n, render: r, rules: i, shouldUnregister: a = !1, readOnly: o, ...s }) => {
|
|
3070
|
+
let c = Xt(ce);
|
|
3071
|
+
if (!c) throw Error("IressFormField must be used inside an IressForm. If you need a standalone field, use IressField instead.");
|
|
3072
|
+
let l = fo.useFormContext(), u = e ?? l.control, d = G(() => {
|
|
3073
|
+
if (!o) return i ? tt(i) : void 0;
|
|
3074
|
+
}, [o, i]), { field: f, fieldState: p } = _a({
|
|
3075
|
+
control: e,
|
|
3076
|
+
defaultValue: t,
|
|
3077
|
+
name: n,
|
|
3078
|
+
rules: d,
|
|
3079
|
+
shouldUnregister: typeof a == "boolean" ? a : !1
|
|
3080
|
+
});
|
|
3081
|
+
W(() => () => {
|
|
3082
|
+
typeof a == "object" && u?.unregister(n, a);
|
|
3083
|
+
}, [
|
|
3084
|
+
u,
|
|
3085
|
+
n,
|
|
3086
|
+
a
|
|
3087
|
+
]);
|
|
3088
|
+
let m = G(() => p.error ? et(p.error?.message, p.error?.type, i) : "", [p.error, i]);
|
|
3089
|
+
return W(() => {
|
|
3090
|
+
o ? c.setErrorMessage(n, "") : c.setErrorMessage(n, m);
|
|
3091
|
+
}, [
|
|
3092
|
+
m,
|
|
3093
|
+
c,
|
|
3094
|
+
n,
|
|
3095
|
+
o
|
|
3096
|
+
]), /* @__PURE__ */ q(xi, {
|
|
3097
|
+
errorMessages: m && !o ? [{ message: m }] : void 0,
|
|
3098
|
+
readOnly: o,
|
|
3099
|
+
required: !!d?.required,
|
|
3100
|
+
htmlFor: `${c?.id}__${n}`,
|
|
3101
|
+
...s,
|
|
3102
|
+
children: r({
|
|
3103
|
+
...f,
|
|
3104
|
+
id: `${c?.id}__${n}`
|
|
3105
|
+
})
|
|
3106
|
+
});
|
|
3107
|
+
}, mo = ({ control: e, defaultValue: t, name: n, render: r, rules: i, shouldUnregister: a, ...o }) => {
|
|
3108
|
+
let s = Xt(ce);
|
|
3109
|
+
if (!s) throw Error("IressFormFieldset must be used inside an IressForm. If you need a standalone field, use IressFieldGroup instead.");
|
|
3110
|
+
let c = i ? tt(i) : void 0, { field: l, fieldState: u } = _a({
|
|
3111
|
+
control: e,
|
|
3112
|
+
defaultValue: t,
|
|
3113
|
+
name: n,
|
|
3114
|
+
rules: c,
|
|
3115
|
+
shouldUnregister: a
|
|
3116
|
+
}), d = G(() => u.error ? et(u.error?.message, u.error?.type, i) : "", [u, i]);
|
|
3117
|
+
return W(() => {
|
|
3118
|
+
s.setErrorMessage(n, d);
|
|
3119
|
+
}, [
|
|
3120
|
+
d,
|
|
3121
|
+
s,
|
|
3122
|
+
n
|
|
3123
|
+
]), /* @__PURE__ */ q(Ni, {
|
|
3124
|
+
errorMessages: d ? [{ message: d }] : void 0,
|
|
3125
|
+
required: !!c?.required,
|
|
3126
|
+
...o,
|
|
3127
|
+
children: r({
|
|
3128
|
+
...l,
|
|
3129
|
+
id: `${s?.id}__${n}`
|
|
3130
|
+
})
|
|
3131
|
+
});
|
|
3132
|
+
}, ho = U((e, t) => {
|
|
3133
|
+
let { locale: n = "en-US", currencyCode: r = "AUD", withSymbol: i, formatOptions: a, alignRight: o = !1, type: s = "number", className: c, ...l } = e;
|
|
3134
|
+
return /* @__PURE__ */ q(An, {
|
|
3135
|
+
className: c,
|
|
3136
|
+
formatter: (e) => nt({
|
|
3137
|
+
value: e,
|
|
3138
|
+
locale: n,
|
|
3139
|
+
currencyCode: r,
|
|
3140
|
+
withSymbol: i,
|
|
3141
|
+
formatOptions: a
|
|
3142
|
+
}),
|
|
3143
|
+
type: s,
|
|
3144
|
+
append: /* @__PURE__ */ q(x, {
|
|
3145
|
+
mode: "muted",
|
|
3146
|
+
children: r
|
|
3147
|
+
}),
|
|
3148
|
+
inline: l.readOnly,
|
|
3149
|
+
alignRight: o,
|
|
3150
|
+
ref: t,
|
|
3151
|
+
...l
|
|
3152
|
+
});
|
|
3153
|
+
});
|
|
3154
|
+
ho.displayName = "IressInputCurrency";
|
|
3155
|
+
//#endregion
|
|
3156
|
+
//#region src/components/Modal/Modal.module.scss
|
|
3157
|
+
var go = "ids-modal-v5209", _o = "ids-modal--backdrop-v5209", vo = "ids-modal--initial-v5209", yo = "ids-modal--close-v5209", bo = "ids-modal--open-v5209", xo = "ids-modal--unmounted-v5209", So = "ids-modal--close-button-v5209", Co = "ids-modal--footer-v5209", wo = "ids-modal--fixed-footer-v5209", To = "ids-modal--content-v5209", Eo = {
|
|
3158
|
+
modal: go,
|
|
3159
|
+
backdrop: _o,
|
|
3160
|
+
"size--sm": "ids-modal--size--sm-v5209",
|
|
3161
|
+
"size--lg": "ids-modal--size--lg-v5209",
|
|
3162
|
+
"size--fullpage": "ids-modal--size--fullpage-v5209",
|
|
3163
|
+
"size-xs--fullpage": "ids-modal--size-xs--fullpage-v5209",
|
|
3164
|
+
"size-xs--sm": "ids-modal--size-xs--sm-v5209",
|
|
3165
|
+
"size-xs--md": "ids-modal--size-xs--md-v5209",
|
|
3166
|
+
"size-xs--lg": "ids-modal--size-xs--lg-v5209",
|
|
3167
|
+
"size-sm--fullpage": "ids-modal--size-sm--fullpage-v5209",
|
|
3168
|
+
"size-sm--sm": "ids-modal--size-sm--sm-v5209",
|
|
3169
|
+
"size-sm--md": "ids-modal--size-sm--md-v5209",
|
|
3170
|
+
"size-sm--lg": "ids-modal--size-sm--lg-v5209",
|
|
3171
|
+
"size-md--fullpage": "ids-modal--size-md--fullpage-v5209",
|
|
3172
|
+
"size-md--sm": "ids-modal--size-md--sm-v5209",
|
|
3173
|
+
"size-md--md": "ids-modal--size-md--md-v5209",
|
|
3174
|
+
"size-md--lg": "ids-modal--size-md--lg-v5209",
|
|
3175
|
+
"size-lg--fullpage": "ids-modal--size-lg--fullpage-v5209",
|
|
3176
|
+
"size-lg--sm": "ids-modal--size-lg--sm-v5209",
|
|
3177
|
+
"size-lg--md": "ids-modal--size-lg--md-v5209",
|
|
3178
|
+
"size-lg--lg": "ids-modal--size-lg--lg-v5209",
|
|
3179
|
+
"size-xl--fullpage": "ids-modal--size-xl--fullpage-v5209",
|
|
3180
|
+
"size-xl--sm": "ids-modal--size-xl--sm-v5209",
|
|
3181
|
+
"size-xl--md": "ids-modal--size-xl--md-v5209",
|
|
3182
|
+
"size-xl--lg": "ids-modal--size-xl--lg-v5209",
|
|
3183
|
+
"size-xxl--fullpage": "ids-modal--size-xxl--fullpage-v5209",
|
|
3184
|
+
"size-xxl--sm": "ids-modal--size-xxl--sm-v5209",
|
|
3185
|
+
"size-xxl--md": "ids-modal--size-xxl--md-v5209",
|
|
3186
|
+
"size-xxl--lg": "ids-modal--size-xxl--lg-v5209",
|
|
3187
|
+
static: "ids-modal--static-v5209",
|
|
3188
|
+
initial: vo,
|
|
3189
|
+
close: yo,
|
|
3190
|
+
open: bo,
|
|
3191
|
+
unmounted: xo,
|
|
3192
|
+
closeButton: So,
|
|
3193
|
+
footer: Co,
|
|
3194
|
+
fixedFooter: wo,
|
|
3195
|
+
content: To
|
|
3196
|
+
}, Do = {
|
|
3197
|
+
toaster: "ids-toaster-v5209",
|
|
3198
|
+
"toaster__bottom-end": "ids-toaster--toaster__bottom-end-v5209",
|
|
3199
|
+
"toaster__bottom-start": "ids-toaster--toaster__bottom-start-v5209",
|
|
3200
|
+
"toaster__bottom-center": "ids-toaster--toaster__bottom-center-v5209",
|
|
3201
|
+
"toaster__top-end": "ids-toaster--toaster__top-end-v5209",
|
|
3202
|
+
"toaster__top-start": "ids-toaster--toaster__top-start-v5209",
|
|
3203
|
+
"toaster__top-center": "ids-toaster--toaster__top-center-v5209"
|
|
3204
|
+
}, Oo = ({ children: e, className: t, closeText: n, container: r, "data-testid": i, defaultShow: a = !1, disableBackdropClick: s, fixedFooter: c, footer: l, heading: u, noCloseButton: d, onEntered: f, onExited: p, onShowChange: m, onStatus: h, onTransitionEnd: g, padding: _ = "md", show: v, size: y = "md", static: b, style: w, ...T }) => {
|
|
3205
|
+
let [E, M] = K(a), N = 240, P = it(T.id), F = Te({ id: T.id }), I = `${F}--heading`, re = P.opened || v || E, ie = (e) => {
|
|
3206
|
+
P.show(e), M(e), m?.(e);
|
|
3207
|
+
}, { context: L } = O({
|
|
3208
|
+
open: re,
|
|
3209
|
+
onOpenChange: ie
|
|
3210
|
+
}), R = k([j(L, {
|
|
3211
|
+
enabled: !s,
|
|
3212
|
+
outsidePress: (e) => !e.target.closest(`.${Do.toaster}`),
|
|
3213
|
+
outsidePressEvent: "mousedown"
|
|
3214
|
+
}), ne(L)]);
|
|
3215
|
+
L.refs.floating.current && (N = at(L.refs.floating.current, 1.2, 240));
|
|
3216
|
+
let { isMounted: z, status: B } = D(L, { duration: { close: N } });
|
|
3217
|
+
W(() => {
|
|
3218
|
+
P.opened && v && C("IressModal: Please use either IressModalProvider for uncontrolled components, or the show prop for controlled components, rather than both. If you use both, the open state of the modal will become unpredictable. If you want to show a modal by default in uncontrolled mode, use the defaultShow prop.");
|
|
3219
|
+
}, [P.opened, v]), W(() => {
|
|
3220
|
+
h?.(B);
|
|
3221
|
+
}, [B, h]);
|
|
3222
|
+
let ae = Re("size", y, "fullpage").map((e) => Eo[e]), V = `iress-p--${_}`, oe = (0, Y.default)(Eo.modal, Eo[B], { [Eo.fixedFooter]: c }), se = G(() => typeof u == "string" ? /* @__PURE__ */ q(x, {
|
|
3223
|
+
id: I,
|
|
3224
|
+
element: "h2",
|
|
3225
|
+
"data-testid": S(i, "heading"),
|
|
3226
|
+
children: u
|
|
3227
|
+
}) : u ? Gt(u, { id: I }) : null, [
|
|
3228
|
+
i,
|
|
3229
|
+
I,
|
|
3230
|
+
u
|
|
3231
|
+
]), ce = (e) => {
|
|
3232
|
+
g?.(e), !(!(e.propertyName === "opacity" || !e.propertyName) || e.target !== e.currentTarget) && (B === "open" ? (f?.(), L.refs.floating?.current?.focus()) : B === "close" && p?.());
|
|
3233
|
+
};
|
|
3234
|
+
if (!z) return null;
|
|
3235
|
+
let le = {
|
|
3236
|
+
position: "var(--iress-position, fixed)",
|
|
3237
|
+
...w
|
|
3238
|
+
};
|
|
3239
|
+
return /* @__PURE__ */ q(A, {
|
|
3240
|
+
root: r ?? P?.container,
|
|
3241
|
+
children: /* @__PURE__ */ q(ee, {
|
|
3242
|
+
className: (0, Y.default)(t, Eo.backdrop, Eo[B], ae, o.IgnoreStack, { [Eo.static]: b }),
|
|
3243
|
+
"data-testid": S(i, "backdrop"),
|
|
3244
|
+
lockScroll: !b,
|
|
3245
|
+
style: le,
|
|
3246
|
+
children: /* @__PURE__ */ q(te, {
|
|
3247
|
+
context: L,
|
|
3248
|
+
initialFocus: L.refs.floating,
|
|
3249
|
+
disabled: b,
|
|
3250
|
+
children: /* @__PURE__ */ J("div", {
|
|
3251
|
+
ref: (e) => L.refs.setFloating(e),
|
|
3252
|
+
className: oe,
|
|
3253
|
+
id: F,
|
|
3254
|
+
"data-testid": i,
|
|
3255
|
+
"aria-labelledby": se ? I : void 0,
|
|
3256
|
+
...R.getFloatingProps(T),
|
|
3257
|
+
onTransitionEnd: ce,
|
|
3258
|
+
children: [
|
|
3259
|
+
!d && /* @__PURE__ */ q(qn, {
|
|
3260
|
+
onClick: () => ie(!1),
|
|
3261
|
+
screenreaderText: n,
|
|
3262
|
+
className: Eo.closeButton,
|
|
3263
|
+
"data-testid": S(i, "close-button__button")
|
|
3264
|
+
}),
|
|
3265
|
+
/* @__PURE__ */ J("div", {
|
|
3266
|
+
className: (0, Y.default)(Eo.content, V),
|
|
3267
|
+
"data-testid": S(i, "content"),
|
|
3268
|
+
children: [se, e]
|
|
3269
|
+
}),
|
|
3270
|
+
l && /* @__PURE__ */ q("div", {
|
|
3271
|
+
className: (0, Y.default)(Eo.footer, V),
|
|
3272
|
+
"data-testid": S(i, "footer"),
|
|
3273
|
+
children: l
|
|
3274
|
+
})
|
|
3275
|
+
]
|
|
3276
|
+
})
|
|
3277
|
+
})
|
|
3278
|
+
})
|
|
3279
|
+
});
|
|
3280
|
+
};
|
|
3281
|
+
Oo.Size = u, Oo.Padding = d;
|
|
3282
|
+
//#endregion
|
|
3283
|
+
//#region src/components/Navbar/components/HomeLinkContent.tsx
|
|
3284
|
+
var ko = ({ logoSrc: e, logoFound: t, logoAltText: n, onError: r, dataTestid: i }) => e === "" ? null : t ? /* @__PURE__ */ q(ct, {
|
|
3285
|
+
logoSrc: e,
|
|
3286
|
+
logoAltText: n,
|
|
3287
|
+
onError: r,
|
|
3288
|
+
dataTestid: i
|
|
3289
|
+
}) : /* @__PURE__ */ q(X, {
|
|
3290
|
+
name: "home",
|
|
3291
|
+
screenreaderText: n,
|
|
3292
|
+
size: "2x",
|
|
3293
|
+
className: st.logoIcon
|
|
3294
|
+
}), Ao = ({ homeUrl: e, logoSrc: t, logoFound: n, logoAltText: r, onError: i, dataTestid: a }) => e === "" ? t === "" ? null : /* @__PURE__ */ q(ct, {
|
|
3295
|
+
logoSrc: t,
|
|
3296
|
+
logoAltText: r,
|
|
3297
|
+
onError: i,
|
|
3298
|
+
dataTestid: a
|
|
3299
|
+
}) : /* @__PURE__ */ q("a", {
|
|
3300
|
+
href: e,
|
|
3301
|
+
className: (0, Y.default)(st.logoLink, st.slot),
|
|
3302
|
+
"data-testid": S(a, "logo-link"),
|
|
3303
|
+
children: /* @__PURE__ */ q(ko, {
|
|
3304
|
+
logoSrc: t,
|
|
3305
|
+
logoFound: n,
|
|
3306
|
+
logoAltText: r,
|
|
3307
|
+
onError: i,
|
|
3308
|
+
dataTestid: a
|
|
3309
|
+
})
|
|
3310
|
+
}), jo = ({ logo: e, nav: t, className: n, children: r, breakpoint: i, fixed: a = !1, handledFocus: o = !1, homeUrl: s = "", horizontalAlign: c, logoAltText: l = "", logoSrc: u = "", navLabel: d = "Main navigation", "data-testid": f, ...p }) => {
|
|
3311
|
+
let m = en(null), [h, g] = K(!1), [_, v] = K(!0), [y, b] = K(!0), [x, w] = K({}), T = Yt(() => {
|
|
3312
|
+
let e = y, t = {
|
|
3313
|
+
xs: e,
|
|
3314
|
+
sm: e,
|
|
3315
|
+
md: e,
|
|
3316
|
+
lg: e,
|
|
3317
|
+
xl: e,
|
|
3318
|
+
xxl: e
|
|
3319
|
+
}, n = !1, r;
|
|
3320
|
+
for (r in t) n && (t[r] = !1), r === i && (n = !0);
|
|
3321
|
+
w(t);
|
|
3322
|
+
}, [i, y]);
|
|
3323
|
+
W(() => {
|
|
3324
|
+
let e = setTimeout(() => {
|
|
3325
|
+
T(), t && g(!0);
|
|
3326
|
+
}, 0);
|
|
3327
|
+
return u !== "" && l === "" && C("IressNavbar: You've supplied a logo but no alt text, which is a failure of WCAG Level A Success Criterion 1.1.1 - Non-text content. Set the logoAltText prop to add alt text to the logo.", "warn"), () => clearTimeout(e);
|
|
3328
|
+
}, [
|
|
3329
|
+
T,
|
|
3330
|
+
t,
|
|
3331
|
+
u,
|
|
3332
|
+
l
|
|
3333
|
+
]);
|
|
3334
|
+
let E = Yt(() => {
|
|
3335
|
+
if (!m.current?.classList.contains(st.fixed)) return;
|
|
3336
|
+
let { top: e, height: t } = m.current.getBoundingClientRect(), n = `${e + t}px`, r = document.querySelector("[data-component=\"navbar\"]");
|
|
3337
|
+
r && r.setAttribute("data-sticky-margin", n);
|
|
3338
|
+
}, []), D = Yt(() => {
|
|
3339
|
+
let e = new ResizeObserver(E.bind(m));
|
|
3340
|
+
m.current && e.observe(m.current), document.addEventListener("focus", E.bind(m), !0);
|
|
3341
|
+
}, [E]);
|
|
3342
|
+
W(() => (a && o && D(), () => {
|
|
3343
|
+
document.removeEventListener("focus", E.bind(m), !0);
|
|
3344
|
+
}), [
|
|
3345
|
+
a,
|
|
3346
|
+
o,
|
|
3347
|
+
D,
|
|
3348
|
+
E
|
|
3349
|
+
]);
|
|
3350
|
+
let O = () => {
|
|
3351
|
+
b(!y), T();
|
|
3352
|
+
}, k = (() => {
|
|
3353
|
+
let e = [
|
|
3354
|
+
"xs",
|
|
3355
|
+
"sm",
|
|
3356
|
+
"md",
|
|
3357
|
+
"lg",
|
|
3358
|
+
"xl",
|
|
3359
|
+
"xxl"
|
|
3360
|
+
], t = e.indexOf(i) + 1;
|
|
3361
|
+
return t >= e.length ? {} : { [e[t]]: !0 };
|
|
3362
|
+
})();
|
|
3363
|
+
return /* @__PURE__ */ q("div", {
|
|
3364
|
+
className: (0, Y.default)(n, {
|
|
3365
|
+
[st.navbar]: !0,
|
|
3366
|
+
[st.fixed]: a,
|
|
3367
|
+
[st[`breakpoint--${i}`]]: i !== void 0
|
|
3368
|
+
}),
|
|
3369
|
+
"data-testid": f,
|
|
3370
|
+
ref: m,
|
|
3371
|
+
...p,
|
|
3372
|
+
children: /* @__PURE__ */ q("header", { children: /* @__PURE__ */ J(pe, {
|
|
3373
|
+
padding: "none",
|
|
3374
|
+
background: "transparent",
|
|
3375
|
+
noBorderRadius: !0,
|
|
3376
|
+
className: st.panel,
|
|
3377
|
+
children: [
|
|
3378
|
+
i !== void 0 && /* @__PURE__ */ q(sr, {
|
|
3379
|
+
hiddenOn: k,
|
|
3380
|
+
children: /* @__PURE__ */ q(Gn, {
|
|
3381
|
+
onClick: () => O(),
|
|
3382
|
+
mode: "tertiary",
|
|
3383
|
+
className: st.toggleButton,
|
|
3384
|
+
"data-testid": S(f, "toggle-button__button"),
|
|
3385
|
+
"aria-label": "Toggle navigation",
|
|
3386
|
+
"aria-controls": "iress-navbar__nav-slot",
|
|
3387
|
+
"aria-expanded": !y,
|
|
3388
|
+
children: /* @__PURE__ */ q(X, {
|
|
3389
|
+
name: "bars",
|
|
3390
|
+
size: "2x"
|
|
3391
|
+
})
|
|
3392
|
+
})
|
|
3393
|
+
}),
|
|
3394
|
+
e ? /* @__PURE__ */ q("div", {
|
|
3395
|
+
className: st.logoSlot,
|
|
3396
|
+
children: e
|
|
3397
|
+
}) : /* @__PURE__ */ q(Ao, {
|
|
3398
|
+
homeUrl: s,
|
|
3399
|
+
logoSrc: u,
|
|
3400
|
+
logoFound: _,
|
|
3401
|
+
logoAltText: l,
|
|
3402
|
+
dataTestid: f,
|
|
3403
|
+
onError: () => v(!1)
|
|
3404
|
+
}),
|
|
3405
|
+
/* @__PURE__ */ J("div", {
|
|
3406
|
+
className: (0, Y.default)({
|
|
3407
|
+
[st.content]: !0,
|
|
3408
|
+
[st.contentBetween]: c === "between",
|
|
3409
|
+
[st.contentEnd]: c === "end",
|
|
3410
|
+
[st.contentStart]: c === "start",
|
|
3411
|
+
[st.slot]: !0
|
|
3412
|
+
}),
|
|
3413
|
+
children: [r, h && (i === void 0 ? /* @__PURE__ */ q("nav", {
|
|
3414
|
+
"aria-label": d,
|
|
3415
|
+
className: st.navSlot,
|
|
3416
|
+
"data-testid": S(f, "nav"),
|
|
3417
|
+
children: t
|
|
3418
|
+
}) : /* @__PURE__ */ q(sr, {
|
|
3419
|
+
hiddenOn: x,
|
|
3420
|
+
className: st.navHide,
|
|
3421
|
+
children: /* @__PURE__ */ q("nav", {
|
|
3422
|
+
"aria-label": d,
|
|
3423
|
+
className: st.navSlot,
|
|
3424
|
+
"data-testid": S(f, "nav"),
|
|
3425
|
+
id: "iress-navbar__nav-slot",
|
|
3426
|
+
children: t
|
|
3427
|
+
})
|
|
3428
|
+
}))]
|
|
3429
|
+
})
|
|
3430
|
+
]
|
|
3431
|
+
}) })
|
|
3432
|
+
});
|
|
3433
|
+
};
|
|
3434
|
+
jo.HorizontalAlign = ot, jo.Breakpoint = r;
|
|
3435
|
+
//#endregion
|
|
3436
|
+
//#region src/components/Toaster/Toast/Toast.module.scss
|
|
3437
|
+
var Mo = "ids-toast-v5209", No = "ids-toast--open-v5209", Po = "ids-toast--fade-v5209", Fo = "ids-toast--panel-v5209", Io = "ids-toast--unmounted-v5209", Lo = "ids-toast--toast__icon-v5209", Ro = "ids-toast--toast__wrapper-v5209", zo = "ids-toast--toast__footer-v5209", Bo = {
|
|
3438
|
+
toast: Mo,
|
|
3439
|
+
"start-x": "ids-toast--start-x-v5209",
|
|
3440
|
+
"end-x": "ids-toast--end-x-v5209",
|
|
3441
|
+
open: No,
|
|
3442
|
+
"start-y": "ids-toast--start-y-v5209",
|
|
3443
|
+
"end-y": "ids-toast--end-y-v5209",
|
|
3444
|
+
fade: Po,
|
|
3445
|
+
panel: Fo,
|
|
3446
|
+
"toast--error": "ids-toast--toast--error-v5209",
|
|
3447
|
+
"toast--success": "ids-toast--toast--success-v5209",
|
|
3448
|
+
"toast--info": "ids-toast--toast--info-v5209",
|
|
3449
|
+
unmounted: Io,
|
|
3450
|
+
"iress-u-text": "ids-toast--iress-u-text-v5209",
|
|
3451
|
+
toast__icon: Lo,
|
|
3452
|
+
toast__wrapper: Ro,
|
|
3453
|
+
toast__footer: zo,
|
|
3454
|
+
"toast__close-button": "ids-toast--toast__close-button-v5209"
|
|
3455
|
+
}, Vo = ({ status: e }) => /* @__PURE__ */ q(X, {
|
|
3456
|
+
name: {
|
|
3457
|
+
error: "ban",
|
|
3458
|
+
success: "check",
|
|
3459
|
+
info: "info-square"
|
|
3460
|
+
}[e],
|
|
3461
|
+
screenreaderText: `${e}: `,
|
|
3462
|
+
size: y.Lg,
|
|
3463
|
+
fixedWidth: !0,
|
|
3464
|
+
className: Bo.toast__icon
|
|
3465
|
+
}), Ho = ({ dismissible: e, onClose: t, "data-testid": n }) => {
|
|
3466
|
+
if (e) return /* @__PURE__ */ q(qn, {
|
|
3467
|
+
"data-testid": n,
|
|
3468
|
+
className: Bo["toast__close-button"],
|
|
3469
|
+
onClick: t,
|
|
3470
|
+
screenreaderText: "Dismiss"
|
|
3471
|
+
});
|
|
3472
|
+
}, Uo = ({ actions: e }) => e ? /* @__PURE__ */ q("div", {
|
|
3473
|
+
className: Bo.toast__footer,
|
|
3474
|
+
children: e
|
|
3475
|
+
}) : null, Wo = ({ heading: e, dismissible: t = !0, onClose: n, content: r, children: i, actions: a, "data-testid": o }) => /* @__PURE__ */ J("div", {
|
|
3476
|
+
className: Bo.toast__wrapper,
|
|
3477
|
+
"data-testid": S(o, "content"),
|
|
3478
|
+
children: [
|
|
3479
|
+
e,
|
|
3480
|
+
/* @__PURE__ */ q(Ho, {
|
|
3481
|
+
"data-testid": S(o, "close-button__button"),
|
|
3482
|
+
dismissible: t,
|
|
3483
|
+
onClose: n
|
|
3484
|
+
}),
|
|
3485
|
+
r ?? i,
|
|
3486
|
+
/* @__PURE__ */ q(Uo, { actions: a })
|
|
3487
|
+
]
|
|
3488
|
+
}), Go = ({ heading: e, headingLevel: t, headingText: n, status: r, actions: i, content: a, dismissible: o, onClose: s, children: c, "data-testid": l, className: u, ...d }, f) => /* @__PURE__ */ q("div", {
|
|
3489
|
+
...d,
|
|
3490
|
+
"data-testid": l,
|
|
3491
|
+
className: (0, Y.default)(u, Bo.toast, Bo[`toast--${r}`]),
|
|
3492
|
+
tabIndex: -1,
|
|
3493
|
+
ref: f,
|
|
3494
|
+
children: /* @__PURE__ */ q(pe, {
|
|
3495
|
+
className: (0, Y.default)(We.Base, Bo.panel),
|
|
3496
|
+
children: /* @__PURE__ */ J(ci, {
|
|
3497
|
+
gutter: "sm",
|
|
3498
|
+
verticalAlign: "top",
|
|
3499
|
+
noWrap: !0,
|
|
3500
|
+
children: [/* @__PURE__ */ q(Vo, { status: r }), /* @__PURE__ */ q(Wo, {
|
|
3501
|
+
"data-testid": l,
|
|
3502
|
+
status: r,
|
|
3503
|
+
heading: /* @__PURE__ */ q(w, {
|
|
3504
|
+
component: "IressToast",
|
|
3505
|
+
heading: e,
|
|
3506
|
+
headingText: n,
|
|
3507
|
+
HeadingTag: t,
|
|
3508
|
+
"data-testid": S(l, "heading")
|
|
3509
|
+
}),
|
|
3510
|
+
actions: i,
|
|
3511
|
+
content: a,
|
|
3512
|
+
dismissible: o,
|
|
3513
|
+
onClose: s,
|
|
3514
|
+
children: c
|
|
3515
|
+
})]
|
|
3516
|
+
})
|
|
3517
|
+
})
|
|
3518
|
+
}), Ko = U(Go);
|
|
3519
|
+
Ko.HeadingLevel = c;
|
|
3520
|
+
//#endregion
|
|
3521
|
+
//#region src/components/Toaster/Toast/ToastAnimated.tsx
|
|
3522
|
+
var qo = ({ animation: e, className: t, onClose: n, onTimeout: r, timeout: i = 6e3, ...a }) => {
|
|
3523
|
+
let [o, s] = K(!0), c = 240, { context: l } = O({
|
|
3524
|
+
open: o,
|
|
3525
|
+
onOpenChange: s
|
|
3526
|
+
});
|
|
3527
|
+
l.refs.floating.current && (c = at(l.refs.floating.current));
|
|
3528
|
+
let { isMounted: u, status: d } = D(l, { duration: { close: c } });
|
|
3529
|
+
return W(() => {
|
|
3530
|
+
i && setTimeout(() => {
|
|
3531
|
+
s(!1), setTimeout(() => r?.(), c);
|
|
3532
|
+
}, i);
|
|
3533
|
+
}, [
|
|
3534
|
+
r,
|
|
3535
|
+
i,
|
|
3536
|
+
c
|
|
3537
|
+
]), W(() => {
|
|
3538
|
+
d === "open" && l.refs.floating.current?.focus();
|
|
3539
|
+
}, [d, l.refs.floating]), u ? /* @__PURE__ */ q(Ko, {
|
|
3540
|
+
...a,
|
|
3541
|
+
className: (0, Y.default)(t, Bo[d], Bo[e ?? "fade"]),
|
|
3542
|
+
onClose: (e) => {
|
|
3543
|
+
s(!1), setTimeout(() => n?.(e), c);
|
|
3544
|
+
},
|
|
3545
|
+
ref: (e) => l.refs.setFloating(e)
|
|
3546
|
+
}) : !1;
|
|
3547
|
+
}, Jo = ({ container: e, position: t = "bottom-end", toasts: n = [] }) => {
|
|
3548
|
+
let r = Xt(Yo), i = en(null);
|
|
3549
|
+
return W(() => {
|
|
3550
|
+
if (!e) return;
|
|
3551
|
+
let t = e instanceof HTMLElement ? e : e.current;
|
|
3552
|
+
Object.entries(lt).forEach(([e, n]) => {
|
|
3553
|
+
t?.setAttribute(e, String(n));
|
|
3554
|
+
});
|
|
3555
|
+
}, [e]), n.length ? /* @__PURE__ */ J(tn, { children: [!e && /* @__PURE__ */ q("div", {
|
|
3556
|
+
ref: i,
|
|
3557
|
+
...lt
|
|
3558
|
+
}), /* @__PURE__ */ q(A, {
|
|
3559
|
+
root: e ?? i,
|
|
3560
|
+
children: /* @__PURE__ */ q(dt, {
|
|
3561
|
+
className: (0, Y.default)(o.IgnoreStack, Do.toaster, Do[`toaster__${t}`]),
|
|
3562
|
+
gutter: "md",
|
|
3563
|
+
children: n.map((e) => /* @__PURE__ */ qt(qo, {
|
|
3564
|
+
...e,
|
|
3565
|
+
animation: ut[t],
|
|
3566
|
+
key: e.id,
|
|
3567
|
+
onClose: (t) => {
|
|
3568
|
+
r?.close(e.id, t);
|
|
3569
|
+
},
|
|
3570
|
+
onTimeout: () => r?.close(e.id),
|
|
3571
|
+
timeout: e.timeout
|
|
3572
|
+
}))
|
|
3573
|
+
})
|
|
3574
|
+
})] }) : e ? null : /* @__PURE__ */ q("div", {
|
|
3575
|
+
ref: i,
|
|
3576
|
+
...lt
|
|
3577
|
+
});
|
|
3578
|
+
}, Yo = Kt(void 0), Xo = ({ children: e, ...t }) => {
|
|
3579
|
+
let [n, r] = K([]), [i, a] = K({
|
|
3580
|
+
position: "bottom-end",
|
|
3581
|
+
...t
|
|
3582
|
+
}), o = (e, t) => r((n) => ((n?.find((t) => t.id === e))?.onClose?.(t), n?.filter((t) => t.id !== e))), s = Yt((e) => {
|
|
3583
|
+
let t = `${(/* @__PURE__ */ new Date()).getTime()}`, n = i.position?.includes("top");
|
|
3584
|
+
return r((r = []) => [
|
|
3585
|
+
...n ? [] : r,
|
|
3586
|
+
{
|
|
3587
|
+
...e,
|
|
3588
|
+
id: t
|
|
3589
|
+
},
|
|
3590
|
+
...n ? r : []
|
|
3591
|
+
]), t;
|
|
3592
|
+
}, [i.position]), c = Yt((e, t) => o(e, t), []), l = Yt((e) => {
|
|
3593
|
+
r((t) => t?.map((t) => t.id === e ? {
|
|
3594
|
+
...t,
|
|
3595
|
+
timeout: 100
|
|
3596
|
+
} : t));
|
|
3597
|
+
}, []), u = G(() => ({
|
|
3598
|
+
animateOut: l,
|
|
3599
|
+
show: s,
|
|
3600
|
+
close: c,
|
|
3601
|
+
options: i,
|
|
3602
|
+
setOptions: a
|
|
3603
|
+
}), [
|
|
3604
|
+
l,
|
|
3605
|
+
c,
|
|
3606
|
+
i,
|
|
3607
|
+
s
|
|
3608
|
+
]);
|
|
3609
|
+
return /* @__PURE__ */ J(Yo.Provider, {
|
|
3610
|
+
value: u,
|
|
3611
|
+
children: [e, /* @__PURE__ */ q(Jo, {
|
|
3612
|
+
toasts: n,
|
|
3613
|
+
...i
|
|
3614
|
+
})]
|
|
3615
|
+
});
|
|
3616
|
+
}, Zo = (e) => {
|
|
3617
|
+
let t = Xt(Yo);
|
|
3618
|
+
if (t === void 0) throw Error("useToaster must be used within a IressToasterProvider");
|
|
3619
|
+
let { show: n, setOptions: r, options: i, animateOut: a } = t;
|
|
3620
|
+
return W(() => {
|
|
3621
|
+
e && r({
|
|
3622
|
+
...i,
|
|
3623
|
+
position: e ?? i.position
|
|
3624
|
+
});
|
|
3625
|
+
}, [e]), G(() => ({
|
|
3626
|
+
success: (e) => n({
|
|
3627
|
+
...e,
|
|
3628
|
+
status: "success"
|
|
3629
|
+
}),
|
|
3630
|
+
error: (e) => n({
|
|
3631
|
+
...e,
|
|
3632
|
+
status: "error"
|
|
3633
|
+
}),
|
|
3634
|
+
info: (e) => n({
|
|
3635
|
+
...e,
|
|
3636
|
+
status: "info"
|
|
3637
|
+
}),
|
|
3638
|
+
close: a,
|
|
3639
|
+
options: i
|
|
3640
|
+
}), [
|
|
3641
|
+
a,
|
|
3642
|
+
i,
|
|
3643
|
+
n
|
|
3644
|
+
]);
|
|
3645
|
+
}, Qo = ({ children: e, closeText: t, "data-testid": n, floatingRef: r, footer: i, heading: a, onOpenChange: o, padding: s, ...c }) => /* @__PURE__ */ J("div", {
|
|
3646
|
+
ref: r,
|
|
3647
|
+
...c,
|
|
3648
|
+
"data-testid": n,
|
|
3649
|
+
children: [
|
|
3650
|
+
/* @__PURE__ */ q(qn, {
|
|
3651
|
+
onClick: () => o(!1),
|
|
3652
|
+
screenreaderText: t,
|
|
3653
|
+
className: I.closeButton,
|
|
3654
|
+
"data-testid": S(n, "close-button__button")
|
|
3655
|
+
}),
|
|
3656
|
+
/* @__PURE__ */ J("div", {
|
|
3657
|
+
className: (0, Y.default)(I.content, `iress-p--${s}`),
|
|
3658
|
+
"data-testid": S(n, "content"),
|
|
3659
|
+
children: [a, e]
|
|
3660
|
+
}),
|
|
3661
|
+
i && /* @__PURE__ */ q("div", {
|
|
3662
|
+
className: (0, Y.default)(I.footer, `iress-p--${s}`),
|
|
3663
|
+
"data-testid": S(n, "footer"),
|
|
3664
|
+
children: i
|
|
3665
|
+
})
|
|
3666
|
+
]
|
|
3667
|
+
}), $o = {
|
|
3668
|
+
slideoutPushElement: "ids-slideout-push-element-v5209",
|
|
3669
|
+
right: "ids-slideout-push-element--right-v5209",
|
|
3670
|
+
left: "ids-slideout-push-element--left-v5209",
|
|
3671
|
+
open: "ids-slideout-push-element--open-v5209",
|
|
3672
|
+
"size--sm": "ids-slideout-push-element--size--sm-v5209",
|
|
3673
|
+
"size--md": "ids-slideout-push-element--size--md-v5209",
|
|
3674
|
+
"size--lg": "ids-slideout-push-element--size--lg-v5209"
|
|
3675
|
+
}, es = ({ backdrop: e, children: t, className: n, closeText: r = "Close", container: i, "data-testid": a, defaultShow: s = !1, eleToPush: c, footer: l, heading: u, mode: d = "overlay", onEntered: f, onExited: p, onShowChange: m, onStatus: h, onTransitionEnd: g, padding: _ = "md", position: v = "right", show: y, size: b = "sm", style: w, ...T }) => {
|
|
3676
|
+
let [E, M] = K(s), N = 240, P = en(null), F = _t(T.id), re = Te({ id: T.id }), ie = `${re}--heading`, L = F.opened || y || E, R = (e, t, n) => {
|
|
3677
|
+
F.show(e), M(e), m?.(e, n);
|
|
3678
|
+
}, { context: z } = O({
|
|
3679
|
+
open: L,
|
|
3680
|
+
onOpenChange: R
|
|
3681
|
+
}), B = k([j(z, {
|
|
3682
|
+
enabled: !0,
|
|
3683
|
+
outsidePress: e === !0
|
|
3684
|
+
}), ne(z, { enabled: e === !0 })]);
|
|
3685
|
+
z.refs.floating.current && (N = at(z.refs.floating.current, 1.2, 240));
|
|
3686
|
+
let { isMounted: ae, status: V } = D(z, { duration: N });
|
|
3687
|
+
W(() => {
|
|
3688
|
+
F.opened && y && C("IressSlideout: Please use either IressSlideoutProvider for uncontrolled components, or the show prop for controlled components, rather than both. If you use both, the open state of the slideout will become unpredictable. If you want to show a slideout by default in uncontrolled mode, use the defaultShow prop.");
|
|
3689
|
+
}, [F.opened, y]), W(() => {
|
|
3690
|
+
h?.(V);
|
|
3691
|
+
}, [V, h]), W(() => {
|
|
3692
|
+
if (d === "overlay") P.current = null;
|
|
3693
|
+
else {
|
|
3694
|
+
let e;
|
|
3695
|
+
e = typeof c == "string" ? gt(c) : c instanceof Element ? c : c?.current, P.current = e;
|
|
3696
|
+
}
|
|
3697
|
+
return () => {
|
|
3698
|
+
P.current = null;
|
|
3699
|
+
};
|
|
3700
|
+
}, [c, d]), W(() => {
|
|
3701
|
+
V === "initial" && P?.current?.classList.add($o.slideoutPushElement, $o[v], $o[`size--${b}`]);
|
|
3702
|
+
}, [
|
|
3703
|
+
z.refs.floating,
|
|
3704
|
+
v,
|
|
3705
|
+
b,
|
|
3706
|
+
V
|
|
3707
|
+
]), W(() => {
|
|
3708
|
+
V === "open" && (z.refs.floating?.current?.focus(), P?.current?.classList.add($o.open));
|
|
3709
|
+
}, [
|
|
3710
|
+
z.refs.floating,
|
|
3711
|
+
f,
|
|
3712
|
+
V
|
|
3713
|
+
]), W(() => {
|
|
3714
|
+
V === "close" && P?.current?.classList.remove($o.open);
|
|
3715
|
+
}, [p, V]), W(() => {
|
|
3716
|
+
V === "unmounted" && !P?.current?.classList.contains($o.open) && P?.current?.classList.remove($o.slideoutPushElement, $o[v], $o[`size--${b}`]);
|
|
3717
|
+
}, [
|
|
3718
|
+
v,
|
|
3719
|
+
b,
|
|
3720
|
+
V
|
|
3721
|
+
]), W(() => {
|
|
3722
|
+
V === "open" && P?.current && (P.current.classList.remove($o["size--sm"], $o["size--md"], $o["size--lg"]), P.current.classList.add($o[`size--${b}`]));
|
|
3723
|
+
}, [
|
|
3724
|
+
b,
|
|
3725
|
+
V,
|
|
3726
|
+
P
|
|
3727
|
+
]);
|
|
3728
|
+
let oe = Yt((e) => {
|
|
3729
|
+
g?.(e);
|
|
3730
|
+
let t = v === "right" ? "right" : "left";
|
|
3731
|
+
!(e.propertyName === t || e.propertyName === "opacity" || !e.propertyName) || e.target !== e.currentTarget || (V === "open" ? f?.() : V === "close" && p?.());
|
|
3732
|
+
}, [
|
|
3733
|
+
g,
|
|
3734
|
+
v,
|
|
3735
|
+
V,
|
|
3736
|
+
f,
|
|
3737
|
+
p
|
|
3738
|
+
]), se = G(() => typeof u == "string" ? /* @__PURE__ */ q(x, {
|
|
3739
|
+
id: ie,
|
|
3740
|
+
"data-testid": S(a, "heading"),
|
|
3741
|
+
element: "h2",
|
|
3742
|
+
children: u
|
|
3743
|
+
}) : u ? Gt(u, { id: ie }) : null, [
|
|
3744
|
+
a,
|
|
3745
|
+
ie,
|
|
3746
|
+
u
|
|
3747
|
+
]);
|
|
3748
|
+
if (!ae) return null;
|
|
3749
|
+
let ce = {
|
|
3750
|
+
"aria-labelledby": se ? ie : void 0,
|
|
3751
|
+
children: t,
|
|
3752
|
+
className: (0, Y.default)(I.slideout, I[V], I[v], I[`size--${b}`], o.IgnoreStack, {
|
|
3753
|
+
[I.push]: d === "push" && P.current,
|
|
3754
|
+
[`${n}`]: n && !e
|
|
3755
|
+
}),
|
|
3756
|
+
closeText: r,
|
|
3757
|
+
"data-testid": a,
|
|
3758
|
+
footer: l,
|
|
3759
|
+
floatingRef: (e) => z.refs.setFloating(e),
|
|
3760
|
+
heading: se,
|
|
3761
|
+
id: re,
|
|
3762
|
+
onOpenChange: R,
|
|
3763
|
+
padding: _,
|
|
3764
|
+
...B.getFloatingProps(T),
|
|
3765
|
+
onTransitionEnd: oe
|
|
3766
|
+
};
|
|
3767
|
+
if (e) {
|
|
3768
|
+
let e = {
|
|
3769
|
+
position: "var(--iress-position, fixed)",
|
|
3770
|
+
...w
|
|
3771
|
+
};
|
|
3772
|
+
return /* @__PURE__ */ q(A, {
|
|
3773
|
+
root: i ?? F?.container,
|
|
3774
|
+
children: /* @__PURE__ */ q(ee, {
|
|
3775
|
+
className: (0, Y.default)(n, I.backdrop, I[V], o.IgnoreStack),
|
|
3776
|
+
"data-testid": S(a, "backdrop"),
|
|
3777
|
+
lockScroll: !0,
|
|
3778
|
+
style: e,
|
|
3779
|
+
children: /* @__PURE__ */ q(te, {
|
|
3780
|
+
context: z,
|
|
3781
|
+
initialFocus: z.refs.floating,
|
|
3782
|
+
children: /* @__PURE__ */ q(Qo, {
|
|
3783
|
+
...ce,
|
|
3784
|
+
"data-testid": a
|
|
3785
|
+
})
|
|
3786
|
+
})
|
|
3787
|
+
})
|
|
3788
|
+
});
|
|
3789
|
+
}
|
|
3790
|
+
return /* @__PURE__ */ q(A, {
|
|
3791
|
+
root: i ?? F?.container,
|
|
3792
|
+
children: /* @__PURE__ */ q(Qo, {
|
|
3793
|
+
...ce,
|
|
3794
|
+
style: w,
|
|
3795
|
+
"data-testid": a
|
|
3796
|
+
})
|
|
3797
|
+
});
|
|
3798
|
+
};
|
|
3799
|
+
es.Mode = ft, es.Padding = d, es.Position = pt, es.Size = mt;
|
|
3800
|
+
//#endregion
|
|
3801
|
+
//#region src/components/Provider/Provider.tsx
|
|
3802
|
+
var ts = ({ children: e, container: t, injectPushStyles: n, noIcons: r, position: i, ...a }) => /* @__PURE__ */ J(rt, {
|
|
3803
|
+
container: t,
|
|
3804
|
+
children: [/* @__PURE__ */ q(Xo, {
|
|
3805
|
+
container: t,
|
|
3806
|
+
position: i,
|
|
3807
|
+
children: /* @__PURE__ */ q(ht, {
|
|
3808
|
+
container: t,
|
|
3809
|
+
injectPushStyles: n,
|
|
3810
|
+
...a,
|
|
3811
|
+
children: e
|
|
3812
|
+
})
|
|
3813
|
+
}), !r && nn(/* @__PURE__ */ q("link", {
|
|
3814
|
+
rel: "stylesheet",
|
|
3815
|
+
href: "https://cdn.iress.com/icons/5.15.4/css/combined.min.css"
|
|
3816
|
+
}), document.head, "design-system-icons")]
|
|
3817
|
+
}), ns = {
|
|
3818
|
+
radio: "ids-radio-v5209",
|
|
3819
|
+
input: "ids-radio--input-v5209",
|
|
3820
|
+
label: "ids-radio--label-v5209",
|
|
3821
|
+
touch: "ids-radio--touch-v5209",
|
|
3822
|
+
hiddenControl: "ids-radio--hidden-control-v5209",
|
|
3823
|
+
mark: "ids-radio--mark-v5209"
|
|
3824
|
+
}, rs = () => /* @__PURE__ */ q("svg", {
|
|
3825
|
+
version: "1.1",
|
|
3826
|
+
viewBox: "0 0 200 200",
|
|
3827
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3828
|
+
className: ns.mark,
|
|
3829
|
+
children: /* @__PURE__ */ q("circle", {
|
|
3830
|
+
cx: "100",
|
|
3831
|
+
cy: "100",
|
|
3832
|
+
r: "70"
|
|
3833
|
+
})
|
|
3834
|
+
}), is = U(({ checked: e, children: t, className: n, "data-testid": r, defaultChecked: i, hiddenControl: a, name: o, onChange: s, readOnly: c, required: l, value: u, touch: d, ...f }, p) => {
|
|
3835
|
+
let m = Te(f), h = Xt(vt), g = !!h.onChange, _ = g ? h.value === u : e ?? i;
|
|
3836
|
+
if (g ? h.readonly : c) return _ ? /* @__PURE__ */ q(kn, {
|
|
3837
|
+
...f,
|
|
3838
|
+
width: void 0,
|
|
3839
|
+
value: B(u),
|
|
3840
|
+
children: t
|
|
3841
|
+
}) : null;
|
|
3842
|
+
let v = h.name ?? o, y = h.hiddenRadio ?? a, b = h.required ?? l, x = h.touch ?? d;
|
|
3843
|
+
return /* @__PURE__ */ J("div", {
|
|
3844
|
+
"data-testid": r,
|
|
3845
|
+
className: (0, Y.default)(n, {
|
|
3846
|
+
[ns.radio]: !0,
|
|
3847
|
+
[ns.hiddenControl]: y,
|
|
3848
|
+
[ns.touch]: x
|
|
3849
|
+
}),
|
|
3850
|
+
children: [/* @__PURE__ */ q("input", {
|
|
3851
|
+
...f,
|
|
3852
|
+
type: "radio",
|
|
3853
|
+
id: m,
|
|
3854
|
+
name: v,
|
|
3855
|
+
ref: p,
|
|
3856
|
+
className: ns.input,
|
|
3857
|
+
"data-testid": S(r, "input"),
|
|
3858
|
+
onChange: (e) => {
|
|
3859
|
+
s?.(e, u), h.onChange?.(e, u);
|
|
3860
|
+
},
|
|
3861
|
+
value: String(u),
|
|
3862
|
+
checked: _,
|
|
3863
|
+
required: b
|
|
3864
|
+
}), /* @__PURE__ */ J("label", {
|
|
3865
|
+
htmlFor: m,
|
|
3866
|
+
className: ns.label,
|
|
3867
|
+
children: [!y && /* @__PURE__ */ q(rs, { "data-testid": S(r, "mark") }), t]
|
|
3868
|
+
})]
|
|
3869
|
+
});
|
|
3870
|
+
}), as = ({ children: e, className: t, gutter: n, horizontalAlign: r = "left", useColGap: i, verticalAlign: a = "top", ...o }) => /* @__PURE__ */ q("div", {
|
|
3871
|
+
className: (0, Y.default)(t, Re(yt.Gutter, n, s.None), {
|
|
3872
|
+
[yt.Base]: !0,
|
|
3873
|
+
[`${yt.HorizontalAlign}--${r}`]: !!r,
|
|
3874
|
+
[`${yt.VerticalAlign}--${a}`]: !!a,
|
|
3875
|
+
[yt.UseColGap]: !!i
|
|
3876
|
+
}),
|
|
3877
|
+
...o,
|
|
3878
|
+
children: e
|
|
3879
|
+
});
|
|
3880
|
+
as.Gutter = s, as.HorizontalAlign = l, as.VerticalAlign = h;
|
|
3881
|
+
//#endregion
|
|
3882
|
+
//#region src/components/Select/helpers/nodesToSelectOptions.tsx
|
|
3883
|
+
var os = (e) => M(e).reduce((e, t = {
|
|
3884
|
+
type: St,
|
|
3885
|
+
props: { label: "" },
|
|
3886
|
+
key: ""
|
|
3887
|
+
}) => {
|
|
3888
|
+
if (t.type === "optgroup") e = [...e, {
|
|
3889
|
+
label: t.props.label,
|
|
3890
|
+
children: os(t.props.children)
|
|
3891
|
+
}];
|
|
3892
|
+
else if ([St, "option"].includes(t.type)) {
|
|
3893
|
+
let n = { ...t.props };
|
|
3894
|
+
delete n.children;
|
|
3895
|
+
let r = String(t.props.children);
|
|
3896
|
+
e = [...e, {
|
|
3897
|
+
...n,
|
|
3898
|
+
label: r
|
|
3899
|
+
}];
|
|
3900
|
+
} else (t.props?.children || Array.isArray(t)) && (e = [...e, ...os(t.props?.children ?? t)]);
|
|
3901
|
+
return e;
|
|
3902
|
+
}, []), ss = (e, t = []) => t.reduce((t, n) => t || (n.children ? ss(e, n.children) : B(n.value) === e ? n.value : t), void 0), cs = U(({ children: e, className: t, "data-testid": n, name: r, required: i, width: a, value: o, ...s }, c) => {
|
|
3903
|
+
let l = G(() => String(os(e).find((e) => e.value === o)?.label ?? ""), [e, o]);
|
|
3904
|
+
return /* @__PURE__ */ q(kn, {
|
|
3905
|
+
...s,
|
|
3906
|
+
className: t,
|
|
3907
|
+
"data-testid": S(n, "pseudo"),
|
|
3908
|
+
name: r,
|
|
3909
|
+
ref: c,
|
|
3910
|
+
required: i,
|
|
3911
|
+
width: a,
|
|
3912
|
+
value: ue(o),
|
|
3913
|
+
children: l
|
|
3914
|
+
});
|
|
3915
|
+
});
|
|
3916
|
+
cs.displayName = "SelectReadonly";
|
|
3917
|
+
var ls = U(({ children: e, className: t, "data-testid": n, onChange: r, readonly: i, value: a, defaultValue: s, width: c, style: l, ...u }, d) => {
|
|
3918
|
+
le({
|
|
3919
|
+
component: "IressSelect",
|
|
3920
|
+
defaultValue: s
|
|
3921
|
+
});
|
|
3922
|
+
let f = Te(u), p = en(null), { value: m, setValue: h } = N({
|
|
3923
|
+
component: "IressSelect",
|
|
3924
|
+
defaultValue: s,
|
|
3925
|
+
value: a
|
|
3926
|
+
}), g = Ut.useCallback((t) => ss(t, os(e)), [e]);
|
|
3927
|
+
return Qt(d, () => p.current), /* @__PURE__ */ q("div", {
|
|
3928
|
+
"data-testid": n,
|
|
3929
|
+
className: (0, Y.default)(t, bt.select, o.FormElement, {
|
|
3930
|
+
[o.IgnoreStack]: !!c,
|
|
3931
|
+
[`${o.Width}--${c}`]: !!c
|
|
3932
|
+
}),
|
|
3933
|
+
style: i ? void 0 : l,
|
|
3934
|
+
children: i ? /* @__PURE__ */ q(cs, {
|
|
3935
|
+
"data-testid": S(n, "select"),
|
|
3936
|
+
id: f,
|
|
3937
|
+
name: u.name,
|
|
3938
|
+
ref: (e) => {
|
|
3939
|
+
p.current = e;
|
|
3940
|
+
},
|
|
3941
|
+
style: l,
|
|
3942
|
+
value: m,
|
|
3943
|
+
width: c,
|
|
3944
|
+
children: e
|
|
3945
|
+
}) : /* @__PURE__ */ q(xt, {
|
|
3946
|
+
...u,
|
|
3947
|
+
"data-testid": S(n, "select"),
|
|
3948
|
+
id: f,
|
|
3949
|
+
onChange: (e) => {
|
|
3950
|
+
let t = g(e.currentTarget.value);
|
|
3951
|
+
h(t), r?.(e, t);
|
|
3952
|
+
},
|
|
3953
|
+
ref: (e) => {
|
|
3954
|
+
if (p.current = e, !m && e?.value) {
|
|
3955
|
+
let t = g(e.value);
|
|
3956
|
+
h(t), r?.(de(e.value), t);
|
|
3957
|
+
}
|
|
3958
|
+
},
|
|
3959
|
+
value: m,
|
|
3960
|
+
children: e
|
|
3961
|
+
})
|
|
3962
|
+
});
|
|
3963
|
+
});
|
|
3964
|
+
ls.Width = a;
|
|
3965
|
+
//#endregion
|
|
3966
|
+
//#region src/components/Select/helpers/mapSelectOptions.tsx
|
|
3967
|
+
var us = (e) => (C("IressSelect: mapSelectOptions has been deprecated and will be removed in a future version of IDS, please map and render the items array directly in your application instead.", "warn"), e?.length ? e.map((e, t) => ds(e, t)) : null), ds = ({ children: e, label: t, onClick: n, testId: r, value: i }, a) => e ? /* @__PURE__ */ q("optgroup", {
|
|
3968
|
+
label: String(t),
|
|
3969
|
+
children: us(e)
|
|
3970
|
+
}, a) : /* @__PURE__ */ q(St, {
|
|
3971
|
+
onClick: n,
|
|
3972
|
+
"data-testid": r ? `${r}` : void 0,
|
|
3973
|
+
value: i,
|
|
3974
|
+
children: t
|
|
3975
|
+
}, a), fs = (e = 0, t = 10, n = 1) => {
|
|
3976
|
+
let r = [];
|
|
3977
|
+
for (let i = e; i <= t; i += n) r.push(i);
|
|
3978
|
+
return r;
|
|
3979
|
+
}, ps = U(({ "data-testid": e, defaultValue: t, className: n, formatValue: r, hiddenValueTooltip: i, max: a = 10, min: o = 0, onChange: s, readonly: c, step: l = 1, tickLabels: u, value: d, ...f }, p) => {
|
|
3980
|
+
le({
|
|
3981
|
+
component: "IressSelect",
|
|
3982
|
+
defaultValue: t
|
|
3983
|
+
});
|
|
3984
|
+
let m = Te({ id: f?.id }), h = (typeof u == "boolean" ? fs(o, a, l) : u ?? []).map((e) => typeof e == "number" ? { value: e } : e), { value: g, setValue: _ } = N({
|
|
3985
|
+
component: "IressSlider",
|
|
3986
|
+
defaultValue: d ? void 0 : t ?? o,
|
|
3987
|
+
value: d
|
|
3988
|
+
}), v = Yt(() => {
|
|
3989
|
+
let e = h?.find((e) => e.value === g);
|
|
3990
|
+
return r ? r(g ?? 0, e, c) : e?.label ?? g;
|
|
3991
|
+
}, [
|
|
3992
|
+
h,
|
|
3993
|
+
r,
|
|
3994
|
+
g,
|
|
3995
|
+
c
|
|
3996
|
+
]), y = Yt(() => {
|
|
3997
|
+
let e = Number(((g ?? 0) - o) * 100 / (a - o));
|
|
3998
|
+
return `calc(${e}% + ((var(--iress-thumb-width) / 2) - ${e * .285}px))`;
|
|
3999
|
+
}, [
|
|
4000
|
+
a,
|
|
4001
|
+
o,
|
|
4002
|
+
g
|
|
4003
|
+
]);
|
|
4004
|
+
return c ? /* @__PURE__ */ q(kn, {
|
|
4005
|
+
"data-testid": S(e, "slider"),
|
|
4006
|
+
name: f?.name,
|
|
4007
|
+
value: g,
|
|
4008
|
+
children: v()
|
|
4009
|
+
}) : /* @__PURE__ */ J("div", {
|
|
4010
|
+
className: (0, Y.default)(n, wt.slider),
|
|
4011
|
+
style: { "--iress-thumb-value-offset": y() },
|
|
4012
|
+
"data-testid": e,
|
|
4013
|
+
children: [
|
|
4014
|
+
!i && /* @__PURE__ */ q("output", {
|
|
4015
|
+
className: wt.thumbValue,
|
|
4016
|
+
children: v()
|
|
4017
|
+
}),
|
|
4018
|
+
/* @__PURE__ */ q("input", {
|
|
4019
|
+
className: wt.control,
|
|
4020
|
+
max: a,
|
|
4021
|
+
min: o,
|
|
4022
|
+
step: l,
|
|
4023
|
+
...f,
|
|
4024
|
+
value: g,
|
|
4025
|
+
type: "range",
|
|
4026
|
+
onChange: (e) => {
|
|
4027
|
+
s?.(e, Number(e.target.value)), _(Number(e.target.value));
|
|
4028
|
+
},
|
|
4029
|
+
ref: p,
|
|
4030
|
+
list: `${m}--markers`,
|
|
4031
|
+
"data-testid": S(e, "slider")
|
|
4032
|
+
}),
|
|
4033
|
+
/* @__PURE__ */ q(Tt, {
|
|
4034
|
+
tickLabels: h,
|
|
4035
|
+
id: `${m}--markers`,
|
|
4036
|
+
max: a,
|
|
4037
|
+
min: o,
|
|
4038
|
+
"data-testid": S(e, "datalist")
|
|
4039
|
+
})
|
|
4040
|
+
]
|
|
4041
|
+
});
|
|
4042
|
+
});
|
|
4043
|
+
ps.displayName = "IressSlider";
|
|
4044
|
+
//#endregion
|
|
4045
|
+
//#region src/components/Table/components/TableSortButton.tsx
|
|
4046
|
+
var ms = ({ children: e, label: t = "sortable", noWrap: n = !0, sort: r, toggleSorting: i }) => {
|
|
4047
|
+
let a = r?.desc ? "sort-down" : "sort-up";
|
|
4048
|
+
return /* @__PURE__ */ J("button", {
|
|
4049
|
+
type: "button",
|
|
4050
|
+
className: (0, Y.default)(Dt.sortButton, { [Dt.sortButtonNoWrap]: n }),
|
|
4051
|
+
onClick: i,
|
|
4052
|
+
children: [e, /* @__PURE__ */ q(X, {
|
|
4053
|
+
name: r ? a : "sort",
|
|
4054
|
+
className: Dt.sortIcon,
|
|
4055
|
+
screenreaderText: t
|
|
4056
|
+
})]
|
|
4057
|
+
});
|
|
4058
|
+
}, hs = ({ additionalHeaders: e, children: t, columnApi: n, tableId: r, ...i }) => {
|
|
4059
|
+
let a = Mt({
|
|
4060
|
+
columnApi: n,
|
|
4061
|
+
columnKey: n.id
|
|
4062
|
+
}), o = jt({ columnKey: n.id }), s = Ot()?.getColumnByKey(n.id)?.noWrap;
|
|
4063
|
+
return /* @__PURE__ */ q("th", {
|
|
4064
|
+
...i,
|
|
4065
|
+
id: `${r}__${n.id}`,
|
|
4066
|
+
headers: e,
|
|
4067
|
+
...a?.columnProps,
|
|
4068
|
+
...o,
|
|
4069
|
+
children: n.getCanSort() && a ? /* @__PURE__ */ q(ms, {
|
|
4070
|
+
...a?.buttonProps,
|
|
4071
|
+
noWrap: s,
|
|
4072
|
+
children: t
|
|
4073
|
+
}) : t
|
|
4074
|
+
});
|
|
4075
|
+
}, gs = ({ additionalHeaders: e, className: t, setControlViaRef: n, tableId: r, testId: i }) => {
|
|
4076
|
+
let a = Ot(), o = a?.api.getHeaderGroups();
|
|
4077
|
+
return a?.api.getFlatHeaders()?.length ? o.map((a) => /* @__PURE__ */ q("tr", {
|
|
4078
|
+
"data-testid": S(i, "row", "-"),
|
|
4079
|
+
className: t,
|
|
4080
|
+
id: `${r}--header--${a.id}`,
|
|
4081
|
+
ref: (e) => {
|
|
4082
|
+
let t = `${r}--header--${a.id}`;
|
|
4083
|
+
n?.(t)(e);
|
|
4084
|
+
},
|
|
4085
|
+
children: a.headers.map((t) => /* @__PURE__ */ q(hs, {
|
|
4086
|
+
additionalHeaders: e,
|
|
4087
|
+
columnApi: t.column,
|
|
4088
|
+
tableId: r,
|
|
4089
|
+
"data-testid": S(i?.replace("thead", "header"), t.id),
|
|
4090
|
+
children: t.isPlaceholder ? null : At(t.column.columnDef.header, t.getContext())
|
|
4091
|
+
}, t.id))
|
|
4092
|
+
}, a.id)) : null;
|
|
4093
|
+
}, _s = U(({ caption: e, children: t, columns: n, compact: r = !1, className: i, "data-testid": a, empty: s, hiddenCaption: c, hiddenHeader: l, hover: u, rowProps: d, rows: f = [], scope: p, ...m }, h) => {
|
|
4094
|
+
let g = Te({ id: m.id }), _ = `${g}--caption`, v = (s && Pt(n)) ?? !!f?.length, y = t ?? v;
|
|
4095
|
+
n && !Array.isArray(n) && C("IressTable: Passing columns as an object is deprecated and will be removed in a future version. Please use an array instead.", "warn");
|
|
4096
|
+
let b = S(a, "thead"), x = S(a, "tbody");
|
|
4097
|
+
return /* @__PURE__ */ q("div", {
|
|
4098
|
+
className: (0, Y.default)(Dt.wrapper, { [Dt.compact]: r }),
|
|
4099
|
+
"data-testid": a,
|
|
4100
|
+
children: y && /* @__PURE__ */ q(Nt, {
|
|
4101
|
+
columns: n,
|
|
4102
|
+
rows: f,
|
|
4103
|
+
ref: h,
|
|
4104
|
+
children: /* @__PURE__ */ J("table", {
|
|
4105
|
+
...m,
|
|
4106
|
+
className: (0, Y.default)(i, Dt.table, {
|
|
4107
|
+
[Dt.hover]: u,
|
|
4108
|
+
[Dt.hiddenHeader]: l
|
|
4109
|
+
}),
|
|
4110
|
+
id: g,
|
|
4111
|
+
"data-testid": S(a, "table"),
|
|
4112
|
+
children: [
|
|
4113
|
+
/* @__PURE__ */ q("caption", {
|
|
4114
|
+
id: _,
|
|
4115
|
+
className: (0, Y.default)(Dt.caption, { [o.SROnly]: c }),
|
|
4116
|
+
"data-testid": S(a, "caption"),
|
|
4117
|
+
children: e
|
|
4118
|
+
}),
|
|
4119
|
+
!l && v && /* @__PURE__ */ q("thead", {
|
|
4120
|
+
"data-testid": b,
|
|
4121
|
+
children: /* @__PURE__ */ q(gs, {
|
|
4122
|
+
tableId: g,
|
|
4123
|
+
testId: b
|
|
4124
|
+
})
|
|
4125
|
+
}),
|
|
4126
|
+
v && /* @__PURE__ */ J("tbody", {
|
|
4127
|
+
"data-testid": x,
|
|
4128
|
+
children: [/* @__PURE__ */ q(Ft, {
|
|
4129
|
+
testId: x,
|
|
4130
|
+
tableId: g,
|
|
4131
|
+
rowProps: d,
|
|
4132
|
+
scope: p,
|
|
4133
|
+
hiddenHeader: l
|
|
4134
|
+
}), /* @__PURE__ */ q(kt, { children: s })]
|
|
4135
|
+
}),
|
|
4136
|
+
t
|
|
4137
|
+
]
|
|
4138
|
+
})
|
|
4139
|
+
})
|
|
4140
|
+
});
|
|
4141
|
+
});
|
|
4142
|
+
_s.Scope = Et, _s.useTable = Ot;
|
|
4143
|
+
//#endregion
|
|
4144
|
+
//#region src/components/Table/TableBody/TableBody.tsx
|
|
4145
|
+
var vs = ({ caption: e, hiddenCaption: t, onChange: n, open: r, setController: i, tableId: a }) => {
|
|
4146
|
+
let s = Ot()?.api.getVisibleFlatColumns().length;
|
|
4147
|
+
return s ? /* @__PURE__ */ q("tr", { children: /* @__PURE__ */ q("th", {
|
|
4148
|
+
"aria-expanded": t ? void 0 : r,
|
|
4149
|
+
colSpan: s,
|
|
4150
|
+
className: (0, Y.default)(Dt.rowGroupHeader, { [o.SROnly]: t }),
|
|
4151
|
+
id: `${a}--caption`,
|
|
4152
|
+
onClick: n,
|
|
4153
|
+
scope: "rowgroup",
|
|
4154
|
+
ref: i,
|
|
4155
|
+
children: /* @__PURE__ */ q("button", {
|
|
4156
|
+
className: Dt.activator,
|
|
4157
|
+
type: "button",
|
|
4158
|
+
children: e
|
|
4159
|
+
})
|
|
4160
|
+
}) }) : null;
|
|
4161
|
+
}, ys = ({ children: e, setControlViaRef: t, tableId: n }) => {
|
|
4162
|
+
let r = Ot()?.api.getVisibleFlatColumns().length;
|
|
4163
|
+
if (!e) return null;
|
|
4164
|
+
let i = `${n}--children`;
|
|
4165
|
+
return /* @__PURE__ */ q("tr", {
|
|
4166
|
+
id: i,
|
|
4167
|
+
ref: (e) => t(i)(e),
|
|
4168
|
+
children: /* @__PURE__ */ q("td", {
|
|
4169
|
+
colSpan: r,
|
|
4170
|
+
children: e
|
|
4171
|
+
})
|
|
4172
|
+
});
|
|
4173
|
+
}, bs = ({ caption: e, children: t, columns: n, className: r, "data-testid": i, empty: a, hiddenCaption: o, hiddenHeader: s, onOpened: c, onClosed: l, open: u = !1, rowProps: d, rows: f = [], scope: p, ...m }) => {
|
|
4174
|
+
let [h, g] = K(u), { setController: _, setControlViaRef: v } = It("aria-controls"), y = Te({ id: m.id }), b = t ?? (a && Pt(n)) ?? !!f?.length;
|
|
4175
|
+
if (W(() => {
|
|
4176
|
+
g(u);
|
|
4177
|
+
}, [u]), !b) return null;
|
|
4178
|
+
let x = () => {
|
|
4179
|
+
g(!h), h ? l?.() : c?.();
|
|
4180
|
+
}, C = h || o;
|
|
4181
|
+
return /* @__PURE__ */ q(Nt, {
|
|
4182
|
+
columns: n,
|
|
4183
|
+
rows: f,
|
|
4184
|
+
children: /* @__PURE__ */ J("tbody", {
|
|
4185
|
+
"aria-labelledby": `${y}--caption`,
|
|
4186
|
+
...m,
|
|
4187
|
+
className: (0, Y.default)(r, { [Dt.hiddenHeader]: s }),
|
|
4188
|
+
children: [/* @__PURE__ */ q(vs, {
|
|
4189
|
+
setController: _,
|
|
4190
|
+
caption: e,
|
|
4191
|
+
hiddenCaption: o,
|
|
4192
|
+
onChange: x,
|
|
4193
|
+
open: h,
|
|
4194
|
+
tableId: y
|
|
4195
|
+
}), C && /* @__PURE__ */ J(tn, { children: [
|
|
4196
|
+
!s && /* @__PURE__ */ q(gs, {
|
|
4197
|
+
additionalHeaders: `${y}--caption`,
|
|
4198
|
+
className: Dt.rowGroupColumnHeaders,
|
|
4199
|
+
setControlViaRef: v,
|
|
4200
|
+
tableId: y,
|
|
4201
|
+
testId: S(i, "thead")
|
|
4202
|
+
}),
|
|
4203
|
+
/* @__PURE__ */ q(Ft, {
|
|
4204
|
+
additionalHeaders: `${y}--caption`,
|
|
4205
|
+
tableId: y,
|
|
4206
|
+
rowProps: d,
|
|
4207
|
+
setControlViaRef: v,
|
|
4208
|
+
scope: p,
|
|
4209
|
+
hiddenHeader: s,
|
|
4210
|
+
testId: S(i, "tbody")
|
|
4211
|
+
}),
|
|
4212
|
+
/* @__PURE__ */ q(kt, { children: a }),
|
|
4213
|
+
/* @__PURE__ */ q(ys, {
|
|
4214
|
+
setControlViaRef: v,
|
|
4215
|
+
tableId: y,
|
|
4216
|
+
children: t
|
|
4217
|
+
})
|
|
4218
|
+
] })]
|
|
4219
|
+
})
|
|
4220
|
+
});
|
|
4221
|
+
}, xs = U(({ defaultValue: e, onBlur: t, onChange: n, onExistingTag: r, onKeyDown: i, onTagDelete: a, onTagDeleteAll: o, value: s, ...c }, l) => {
|
|
4222
|
+
let [u, d] = K(""), { value: f, setValue: p } = N({
|
|
4223
|
+
component: "IressTagInput",
|
|
4224
|
+
defaultValue: e,
|
|
4225
|
+
value: s
|
|
4226
|
+
}), m = Yt((e = "") => {
|
|
4227
|
+
if (!e) return;
|
|
4228
|
+
if (f?.includes(e)) {
|
|
4229
|
+
r?.(e);
|
|
4230
|
+
return;
|
|
4231
|
+
}
|
|
4232
|
+
let t = [...f ?? [], e];
|
|
4233
|
+
n?.(de(t), t), p(t);
|
|
4234
|
+
}, [
|
|
4235
|
+
n,
|
|
4236
|
+
r,
|
|
4237
|
+
p,
|
|
4238
|
+
f
|
|
4239
|
+
]), h = (e) => {
|
|
4240
|
+
t?.(e), m(e.currentTarget.value);
|
|
4241
|
+
}, g = (e) => {
|
|
4242
|
+
if (i?.(e), e.key === "Backspace" && !u) {
|
|
4243
|
+
let e = f?.slice(0, -1);
|
|
4244
|
+
n?.(de(e), e), p(e);
|
|
4245
|
+
} else if (e.key === "Enter") {
|
|
4246
|
+
let t = e.currentTarget;
|
|
4247
|
+
m(t.value), d("");
|
|
4248
|
+
}
|
|
4249
|
+
}, _ = (e) => {
|
|
4250
|
+
a?.(e);
|
|
4251
|
+
let t = f?.filter((t) => t !== e);
|
|
4252
|
+
n?.(de(t), t), p(t);
|
|
4253
|
+
}, v = (e) => {
|
|
4254
|
+
o?.(e), n?.(de([]), []), p([]);
|
|
4255
|
+
};
|
|
4256
|
+
return /* @__PURE__ */ q(ui, {
|
|
4257
|
+
...c,
|
|
4258
|
+
onBlur: h,
|
|
4259
|
+
onChange: (e) => d(e.currentTarget.value),
|
|
4260
|
+
onKeyDown: g,
|
|
4261
|
+
onTagDelete: _,
|
|
4262
|
+
onTagDeleteAll: v,
|
|
4263
|
+
ref: l,
|
|
4264
|
+
tags: f,
|
|
4265
|
+
value: u
|
|
4266
|
+
});
|
|
4267
|
+
});
|
|
4268
|
+
xs.displayName = "IressTagInput";
|
|
4269
|
+
var Ss = {
|
|
4270
|
+
position: "ids-default-loading--position-v5209",
|
|
4271
|
+
message: "ids-default-loading--message-v5209"
|
|
4272
|
+
}, Cs = ({ children: e = /* @__PURE__ */ J(ci, {
|
|
4273
|
+
gutter: "sm",
|
|
4274
|
+
verticalAlign: "middle",
|
|
4275
|
+
children: [/* @__PURE__ */ q(On, {}), " This is taking longer than expected..."]
|
|
4276
|
+
}), className: t, screenReaderText: n = "Loading...", timeout: r = 3e3, ...i }) => {
|
|
4277
|
+
let [a, o] = K(!1);
|
|
4278
|
+
return W(() => {
|
|
4279
|
+
let e = setTimeout(() => o(!0), r);
|
|
4280
|
+
return () => {
|
|
4281
|
+
clearTimeout(e);
|
|
4282
|
+
};
|
|
4283
|
+
}, [r]), /* @__PURE__ */ q("div", {
|
|
4284
|
+
...i,
|
|
4285
|
+
className: (0, Y.default)(Ss.position, t, Rt["fade-in"], { [Rt["fade-in--active"]]: a }),
|
|
4286
|
+
children: /* @__PURE__ */ q(x, {
|
|
4287
|
+
className: (0, Y.default)(Ss.message, Rt["slide-in"], { [Rt["slide-in--active"]]: a }),
|
|
4288
|
+
children: a ? e : n
|
|
4289
|
+
})
|
|
4290
|
+
});
|
|
4291
|
+
}, ws = {
|
|
4292
|
+
root: "ids-validate-loading--root-v5209",
|
|
4293
|
+
loading: "ids-validate-loading--loading-v5209",
|
|
4294
|
+
message: "ids-validate-loading--message-v5209",
|
|
4295
|
+
top: "ids-validate-loading--top-v5209",
|
|
4296
|
+
right: "ids-validate-loading--right-v5209"
|
|
4297
|
+
}, Ts = ({ children: e, className: t, loading: n = !1, message: r = "This is taking longer than expected...", pattern: i = "validate", position: a = "bottom", renderButton: o = (e) => /* @__PURE__ */ q(Gn, {
|
|
4298
|
+
...e,
|
|
4299
|
+
type: "submit",
|
|
4300
|
+
children: "Submit"
|
|
4301
|
+
}), timeout: s = 2500, ...c }) => {
|
|
4302
|
+
let [l, u] = K(s === 0 && n);
|
|
4303
|
+
return W(() => {
|
|
4304
|
+
if (!n) {
|
|
4305
|
+
u(!1);
|
|
4306
|
+
return;
|
|
4307
|
+
}
|
|
4308
|
+
let e = setTimeout(() => {
|
|
4309
|
+
u(!0);
|
|
4310
|
+
}, s);
|
|
4311
|
+
return () => clearTimeout(e);
|
|
4312
|
+
}, [n, s]), l ? /* @__PURE__ */ J("div", {
|
|
4313
|
+
className: (0, Y.default)(ws.root, t, {
|
|
4314
|
+
[ws.loading]: n,
|
|
4315
|
+
[ws[a]]: !!a
|
|
4316
|
+
}),
|
|
4317
|
+
...c,
|
|
4318
|
+
children: [
|
|
4319
|
+
o({ loading: n }),
|
|
4320
|
+
e,
|
|
4321
|
+
/* @__PURE__ */ q(x, {
|
|
4322
|
+
className: (0, Y.default)(ws.message, Rt["fade-next"], { [Rt["fade-next-width"]]: a === "right" }),
|
|
4323
|
+
mode: "muted",
|
|
4324
|
+
children: r
|
|
4325
|
+
})
|
|
4326
|
+
]
|
|
4327
|
+
}) : o({
|
|
4328
|
+
loading: n,
|
|
4329
|
+
className: ws.loading
|
|
4330
|
+
});
|
|
4331
|
+
}, Es = {
|
|
4332
|
+
root: "ids-component-loading--root-v5209",
|
|
4333
|
+
loaded: "ids-component-loading--loaded-v5209",
|
|
4334
|
+
message: "ids-component-loading--message-v5209",
|
|
4335
|
+
overlay: "ids-component-loading--overlay-v5209",
|
|
4336
|
+
overlayStrong: "ids-component-loading--overlay-strong-v5209",
|
|
4337
|
+
spinner: "ids-component-loading--spinner-v5209"
|
|
4338
|
+
}, Ds = { chart: /* @__PURE__ */ q(Ct, {
|
|
4339
|
+
mode: "rect",
|
|
4340
|
+
height: "250px"
|
|
4341
|
+
}) }, Os = ({ children: e, className: t, loaded: n, screenReaderText: r = "Loading...", template: i = "chart", timeout: a, update: o, ...s }) => {
|
|
4342
|
+
let [c, l] = K(!1), [u, d] = K(!1), f = G(() => typeof i == "string" && i in Ds ? Ds[i] : i, [i]);
|
|
4343
|
+
return W(() => {
|
|
4344
|
+
let e = setTimeout(() => l(!0), a?.skeleton ?? 0);
|
|
4345
|
+
return () => {
|
|
4346
|
+
clearTimeout(e);
|
|
4347
|
+
};
|
|
4348
|
+
}, [a?.skeleton]), W(() => {
|
|
4349
|
+
if (!o) return;
|
|
4350
|
+
let e = setTimeout(() => d(!0), a?.update ?? 1e3);
|
|
4351
|
+
return () => {
|
|
4352
|
+
clearTimeout(e);
|
|
4353
|
+
};
|
|
4354
|
+
}, [a?.update, o]), n === !0 ? /* @__PURE__ */ J("div", {
|
|
4355
|
+
className: (0, Y.default)(Es.root, Es.loaded, t),
|
|
4356
|
+
...s,
|
|
4357
|
+
children: [
|
|
4358
|
+
e,
|
|
4359
|
+
o && /* @__PURE__ */ q("div", { className: (0, Y.default)(Es.overlay, { [Es.overlayStrong]: u }) }),
|
|
4360
|
+
o && /* @__PURE__ */ J(x, {
|
|
4361
|
+
className: (0, Y.default)(Es.message, Rt["fade-in"], { [Rt["fade-in--active"]]: u && !!o }),
|
|
4362
|
+
children: [
|
|
4363
|
+
/* @__PURE__ */ q(On, { className: Es.spinner }),
|
|
4364
|
+
" ",
|
|
4365
|
+
typeof o == "boolean" ? "Updating..." : o
|
|
4366
|
+
]
|
|
4367
|
+
})
|
|
4368
|
+
]
|
|
4369
|
+
}) : /* @__PURE__ */ J("div", {
|
|
4370
|
+
className: (0, Y.default)(Es.root, t, Rt["fade-in"], { [Rt["fade-in--active"]]: c && !n }),
|
|
4371
|
+
...s,
|
|
4372
|
+
children: [f, /* @__PURE__ */ q(sr, {
|
|
4373
|
+
hiddenOn: { xs: !0 },
|
|
4374
|
+
visuallyHidden: !0,
|
|
4375
|
+
children: r
|
|
4376
|
+
})]
|
|
4377
|
+
});
|
|
4378
|
+
}, ks = {
|
|
4379
|
+
root: "ids-page-loading--root-v5209",
|
|
4380
|
+
critical: "ids-page-loading--critical-v5209",
|
|
4381
|
+
showCritical: "ids-page-loading--show-critical-v5209",
|
|
4382
|
+
skeleton: "ids-page-loading--skeleton-v5209",
|
|
4383
|
+
hideTemplate: "ids-page-loading--hide-template-v5209"
|
|
4384
|
+
}, As = {
|
|
4385
|
+
page: () => /* @__PURE__ */ q(Ge, { children: /* @__PURE__ */ q(as, {
|
|
4386
|
+
gutter: "lg",
|
|
4387
|
+
verticalAlign: "stretch",
|
|
4388
|
+
children: /* @__PURE__ */ q(ze, { children: /* @__PURE__ */ J(dt, {
|
|
4389
|
+
gutter: "md",
|
|
4390
|
+
children: [/* @__PURE__ */ q(Ct, {
|
|
4391
|
+
textVariant: "h2",
|
|
4392
|
+
width: "75%"
|
|
4393
|
+
}), /* @__PURE__ */ q(Ct, {
|
|
4394
|
+
mode: "rect",
|
|
4395
|
+
height: "200px"
|
|
4396
|
+
})]
|
|
4397
|
+
}) })
|
|
4398
|
+
}) }),
|
|
4399
|
+
form: () => /* @__PURE__ */ q(Ge, { children: /* @__PURE__ */ q(as, {
|
|
4400
|
+
gutter: "lg",
|
|
4401
|
+
verticalAlign: "stretch",
|
|
4402
|
+
children: /* @__PURE__ */ q(ze, { children: /* @__PURE__ */ J(dt, {
|
|
4403
|
+
gutter: "md",
|
|
4404
|
+
children: [
|
|
4405
|
+
/* @__PURE__ */ q(Ct, {
|
|
4406
|
+
textVariant: "h2",
|
|
4407
|
+
width: "75%"
|
|
4408
|
+
}),
|
|
4409
|
+
/* @__PURE__ */ q(Ct, {
|
|
4410
|
+
mode: "rect",
|
|
4411
|
+
height: "200px"
|
|
4412
|
+
}),
|
|
4413
|
+
/* @__PURE__ */ q(Ct, {
|
|
4414
|
+
textVariant: "body",
|
|
4415
|
+
width: "100px"
|
|
4416
|
+
})
|
|
4417
|
+
]
|
|
4418
|
+
}) })
|
|
4419
|
+
}) }),
|
|
4420
|
+
dashboard: () => /* @__PURE__ */ q(Ge, { children: /* @__PURE__ */ J(dt, {
|
|
4421
|
+
gutter: "lg",
|
|
4422
|
+
children: [
|
|
4423
|
+
/* @__PURE__ */ J(as, {
|
|
4424
|
+
horizontalAlign: "between",
|
|
4425
|
+
verticalAlign: "middle",
|
|
4426
|
+
children: [/* @__PURE__ */ q(Ct, {
|
|
4427
|
+
textVariant: "h1",
|
|
4428
|
+
width: "25%"
|
|
4429
|
+
}), /* @__PURE__ */ J(ci, {
|
|
4430
|
+
gutter: "lg",
|
|
4431
|
+
children: [/* @__PURE__ */ q(Ct, {
|
|
4432
|
+
textVariant: "lead",
|
|
4433
|
+
width: "200px"
|
|
4434
|
+
}), /* @__PURE__ */ q(Ct, {
|
|
4435
|
+
textVariant: "lead",
|
|
4436
|
+
width: "200px"
|
|
4437
|
+
})]
|
|
4438
|
+
})]
|
|
4439
|
+
}),
|
|
4440
|
+
/* @__PURE__ */ q(Ke, {}),
|
|
4441
|
+
/* @__PURE__ */ J(as, {
|
|
4442
|
+
gutter: "lg",
|
|
4443
|
+
children: [
|
|
4444
|
+
/* @__PURE__ */ q(ze, {
|
|
4445
|
+
span: "4",
|
|
4446
|
+
children: /* @__PURE__ */ q(Ie, {
|
|
4447
|
+
stretch: !0,
|
|
4448
|
+
children: /* @__PURE__ */ J(dt, {
|
|
4449
|
+
gutter: "md",
|
|
4450
|
+
children: [
|
|
4451
|
+
/* @__PURE__ */ q(Ct, {
|
|
4452
|
+
mode: "rect",
|
|
4453
|
+
height: "300px"
|
|
4454
|
+
}),
|
|
4455
|
+
/* @__PURE__ */ q(Ct, {
|
|
4456
|
+
textVariant: "h3",
|
|
4457
|
+
width: "75%"
|
|
4458
|
+
}),
|
|
4459
|
+
/* @__PURE__ */ q(Ct, {
|
|
4460
|
+
textVariant: "body",
|
|
4461
|
+
width: "50%"
|
|
4462
|
+
})
|
|
4463
|
+
]
|
|
4464
|
+
})
|
|
4465
|
+
})
|
|
4466
|
+
}),
|
|
4467
|
+
/* @__PURE__ */ q(ze, {
|
|
4468
|
+
span: "4",
|
|
4469
|
+
children: /* @__PURE__ */ q(Ie, {
|
|
4470
|
+
stretch: !0,
|
|
4471
|
+
children: /* @__PURE__ */ J(dt, {
|
|
4472
|
+
gutter: "md",
|
|
4473
|
+
children: [
|
|
4474
|
+
/* @__PURE__ */ q(Ct, {
|
|
4475
|
+
mode: "rect",
|
|
4476
|
+
height: "300px"
|
|
4477
|
+
}),
|
|
4478
|
+
/* @__PURE__ */ q(Ct, {
|
|
4479
|
+
textVariant: "h3",
|
|
4480
|
+
width: "75%"
|
|
4481
|
+
}),
|
|
4482
|
+
/* @__PURE__ */ q(Ct, {
|
|
4483
|
+
textVariant: "body",
|
|
4484
|
+
width: "50%"
|
|
4485
|
+
})
|
|
4486
|
+
]
|
|
4487
|
+
})
|
|
4488
|
+
})
|
|
4489
|
+
}),
|
|
4490
|
+
/* @__PURE__ */ q(ze, {
|
|
4491
|
+
span: "4",
|
|
4492
|
+
children: /* @__PURE__ */ q(Ie, {
|
|
4493
|
+
stretch: !0,
|
|
4494
|
+
children: /* @__PURE__ */ J(dt, {
|
|
4495
|
+
gutter: "md",
|
|
4496
|
+
children: [
|
|
4497
|
+
/* @__PURE__ */ q(Ct, {
|
|
4498
|
+
mode: "rect",
|
|
4499
|
+
height: "300px"
|
|
4500
|
+
}),
|
|
4501
|
+
/* @__PURE__ */ q(Ct, {
|
|
4502
|
+
textVariant: "h3",
|
|
4503
|
+
width: "75%"
|
|
4504
|
+
}),
|
|
4505
|
+
/* @__PURE__ */ q(Ct, {
|
|
4506
|
+
textVariant: "body",
|
|
4507
|
+
width: "50%"
|
|
4508
|
+
})
|
|
4509
|
+
]
|
|
4510
|
+
})
|
|
4511
|
+
})
|
|
4512
|
+
})
|
|
4513
|
+
]
|
|
4514
|
+
})
|
|
4515
|
+
]
|
|
4516
|
+
}) })
|
|
4517
|
+
}, js = ({ className: e, critical: t, loaded: n, screenReaderText: r = "Loading...", template: i = "page", timeout: a = 500, ...o }) => {
|
|
4518
|
+
let [s, c] = K(!1), l = !!t, u = n !== !0 && s, [d, f] = K(!1), p = G(() => {
|
|
4519
|
+
if (typeof i == "string" && i in As) {
|
|
4520
|
+
let e = As[i];
|
|
4521
|
+
return /* @__PURE__ */ q(e, {});
|
|
4522
|
+
}
|
|
4523
|
+
return i;
|
|
4524
|
+
}, [i]);
|
|
4525
|
+
return W(() => {
|
|
4526
|
+
let e = setTimeout(() => c(!0), a);
|
|
4527
|
+
return () => {
|
|
4528
|
+
clearTimeout(e);
|
|
4529
|
+
};
|
|
4530
|
+
}, [a]), W(() => {
|
|
4531
|
+
let e = setTimeout(() => c(!0), a);
|
|
4532
|
+
return () => {
|
|
4533
|
+
clearTimeout(e);
|
|
4534
|
+
};
|
|
4535
|
+
}, [a]), W(() => {
|
|
4536
|
+
if (!t) return;
|
|
4537
|
+
let e = setTimeout(() => f(!0), 200);
|
|
4538
|
+
return () => {
|
|
4539
|
+
clearTimeout(e);
|
|
4540
|
+
};
|
|
4541
|
+
}, [t]), /* @__PURE__ */ J("div", {
|
|
4542
|
+
...o,
|
|
4543
|
+
className: (0, Y.default)(e, ks.root, Rt["fade-in"], {
|
|
4544
|
+
[Rt["fade-in--active"]]: u,
|
|
4545
|
+
[ks.hideTemplate]: l,
|
|
4546
|
+
[ks.showCritical]: d
|
|
4547
|
+
}),
|
|
4548
|
+
children: [
|
|
4549
|
+
!d && /* @__PURE__ */ q("div", {
|
|
4550
|
+
className: ks.skeleton,
|
|
4551
|
+
children: p
|
|
4552
|
+
}),
|
|
4553
|
+
l && /* @__PURE__ */ q("div", {
|
|
4554
|
+
className: ks.critical,
|
|
4555
|
+
children: t
|
|
4556
|
+
}),
|
|
4557
|
+
/* @__PURE__ */ q(sr, {
|
|
4558
|
+
hiddenOn: { xs: !0 },
|
|
4559
|
+
visuallyHidden: !0,
|
|
4560
|
+
children: r
|
|
4561
|
+
})
|
|
4562
|
+
]
|
|
4563
|
+
});
|
|
4564
|
+
}, Ms = ({ pattern: e, ...t }) => q(e === "component" ? Os : e === "long" ? Bt : e === "page" ? js : e === "start-up" ? Lt : e === "validate" ? Ts : Cs, { ...t });
|
|
4565
|
+
Ms.shouldRender = zt;
|
|
4566
|
+
//#endregion
|
|
4567
|
+
//#region src/patterns/Loading/LoadingSuspense.tsx
|
|
4568
|
+
var Ns = ({ children: e, delay: t, onLoaded: n, pattern: r, startFrom: i, ...a }) => {
|
|
4569
|
+
let o = G(() => t || (r === "component" || r === "default" || r === "validate" ? 0 : r === "long" ? 1300 : 500), [t, r]), s = G(() => i || (r === "component" || r === "default" || r === "long" ? 0 : 250), [i, r]), c = en(!1), [l, u] = K(!1), d = Ms.shouldRender(l, o, s), f = l && !d;
|
|
4570
|
+
W(() => {
|
|
4571
|
+
n?.();
|
|
4572
|
+
}, [f, n]);
|
|
4573
|
+
let p = () => {
|
|
4574
|
+
c.current || (c.current = !0, u(() => !0));
|
|
4575
|
+
};
|
|
4576
|
+
return r === "component" || r === "validate" ? /* @__PURE__ */ J(tn, { children: [/* @__PURE__ */ q(Ms, {
|
|
4577
|
+
pattern: r,
|
|
4578
|
+
loaded: l,
|
|
4579
|
+
...a,
|
|
4580
|
+
children: f && e
|
|
4581
|
+
}), /* @__PURE__ */ q(Wt, {
|
|
4582
|
+
fallback: null,
|
|
4583
|
+
children: !f && /* @__PURE__ */ q(Ps, {
|
|
4584
|
+
onResolved: p,
|
|
4585
|
+
children: !l && e
|
|
4586
|
+
})
|
|
4587
|
+
})] }) : /* @__PURE__ */ J(tn, { children: [d && /* @__PURE__ */ q(Ms, {
|
|
4588
|
+
pattern: r,
|
|
4589
|
+
loaded: l,
|
|
4590
|
+
...a
|
|
4591
|
+
}), /* @__PURE__ */ q(Wt, {
|
|
4592
|
+
fallback: null,
|
|
4593
|
+
children: f ? e : /* @__PURE__ */ q(Ps, {
|
|
4594
|
+
onResolved: p,
|
|
4595
|
+
children: !l && e
|
|
4596
|
+
})
|
|
4597
|
+
})] });
|
|
4598
|
+
};
|
|
4599
|
+
Ns.use = Ht, Ns.uncache = Vt;
|
|
4600
|
+
var Ps = ({ onResolved: e, children: t }) => (W(() => {
|
|
4601
|
+
e();
|
|
4602
|
+
}, [e]), t);
|
|
4603
|
+
//#endregion
|
|
4604
|
+
export { Xr as $, Ko as A, X as At, fo as B, es as C, Jn as Ct, Yo as D, kn as Dt, Xo as E, An as Et, ko as F, Ni as G, Ri as H, Oo as I, di as J, xi as K, ho as L, Vo as M, jo as N, Jo as O, On as Ot, Ao as P, Zr as Q, mo as R, ts as S, ir as St, Zo as T, Gn as Tt, Ii as U, uo as V, Fi as W, ci as X, ui as Y, $r as Z, cs as _, dr as _t, Ts as a, Dr as at, as as b, ar as bt, bs as c, wr as ct, hs as d, xr as dt, Yr as et, ms as f, br as ft, ls as g, hr as gt, ds as h, gr as ht, Os as i, Nr as it, Go as j, qo as k, hn as kt, _s as l, Cr as lt, us as m, _r as mt, Ms as n, Fr as nt, Cs as o, Er as ot, ps as p, vr as pt, bi as q, js as r, Pr as rt, xs as s, Tr as st, Ns as t, Jr as tt, gs as u, Sr as ut, ss as v, cr as vt, Qo as w, qn as wt, is as x, or as xt, os as y, sr as yt, po as z };
|