@povio/ui 2.1.14 → 2.1.16
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/README.md +80 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +197 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +209 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { ListBoxItem } from "react-aria-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
6
|
-
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
const SelectListBoxItemSelectAll = ({ id, label, isDisabled }) => {
|
|
10
|
-
const ref = useRef(null);
|
|
11
|
-
const { t } = useTranslation(ns);
|
|
12
|
-
const { selectableListItems, selectedIds } = SelectContext.useSelect();
|
|
13
|
-
return /* @__PURE__ */ jsxs(
|
|
14
|
-
ListBoxItem,
|
|
15
|
-
{
|
|
16
|
-
ref,
|
|
17
|
-
id,
|
|
18
|
-
textValue: label || t(($) => $.ui.select.allOption),
|
|
19
|
-
isDisabled,
|
|
20
|
-
className: selectListBoxItemClass,
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: "group",
|
|
26
|
-
"data-rac": "",
|
|
27
|
-
"data-selected": selectedIds.length === selectableListItems.length || void 0,
|
|
28
|
-
"data-indeterminate": selectedIds.length > 0 && selectedIds.length < selectableListItems.length || void 0,
|
|
29
|
-
children: /* @__PURE__ */ jsx(
|
|
30
|
-
CheckboxCheckmark,
|
|
31
|
-
{
|
|
32
|
-
variant: "default",
|
|
33
|
-
className: "group-focus-visible:!outline-none"
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
t(($) => $.ui.select.allOption)
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
SelectListBoxItemSelectAll
|
|
45
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { ListBoxItem } from "react-aria-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
6
|
-
import { SelectContext } from "./select.context.js";
|
|
7
|
-
import { Loader } from "../../../status/Loader/Loader.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
10
|
-
const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
11
|
-
const { t } = useTranslation(ns);
|
|
12
|
-
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
13
|
-
const onIntersection = useCallback(() => {
|
|
14
|
-
if (!isDebouncing && !isLoading && hasLoadMore) {
|
|
15
|
-
onLoadMore?.();
|
|
16
|
-
}
|
|
17
|
-
}, [isDebouncing, isLoading, hasLoadMore, onLoadMore]);
|
|
18
|
-
const { setRef } = useIntersectionObserver({
|
|
19
|
-
onIntersection,
|
|
20
|
-
rootMargin: "40px"
|
|
21
|
-
});
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
ListBoxItem,
|
|
24
|
-
{
|
|
25
|
-
id,
|
|
26
|
-
textValue: label || t(($) => $.ui.loadingState.text),
|
|
27
|
-
isDisabled: true,
|
|
28
|
-
className: selectListBoxItemClass,
|
|
29
|
-
children: /* @__PURE__ */ jsx(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
ref: (ref) => {
|
|
33
|
-
setRef(ref);
|
|
34
|
-
return () => {
|
|
35
|
-
setRef(null);
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
className: "flex flex-1 justify-center text-interactive-text-primary-idle",
|
|
39
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
SelectListBoxLoadingItem
|
|
47
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
5
|
-
import { SelectContext } from "./select.context.js";
|
|
6
|
-
import { ns } from "../../../../config/i18n.js";
|
|
7
|
-
const SelectListBoxSelectionBar = ({ className }) => {
|
|
8
|
-
const { t } = useTranslation(ns);
|
|
9
|
-
const { onClear, onSelectAll } = SelectContext.useSelect();
|
|
10
|
-
return /* @__PURE__ */ jsxs(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
className: clsx(
|
|
14
|
-
"flex items-center justify-between border-elevation-outline-default-1 border-b px-4 py-3",
|
|
15
|
-
className
|
|
16
|
-
),
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
TextButton,
|
|
20
|
-
{
|
|
21
|
-
type: "button",
|
|
22
|
-
color: "primary",
|
|
23
|
-
onPress: onSelectAll,
|
|
24
|
-
children: t(($) => $.ui.select.selectAll)
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
TextButton,
|
|
29
|
-
{
|
|
30
|
-
type: "button",
|
|
31
|
-
color: "secondary",
|
|
32
|
-
onPress: onClear,
|
|
33
|
-
children: t(($) => $.ui.select.clearSelection)
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
SelectListBoxSelectionBar
|
|
42
|
-
};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
import { useLabel } from "react-aria";
|
|
5
|
-
import { DialogTrigger } from "react-aria-components";
|
|
6
|
-
import { FormField } from "../../FormField/FormField.js";
|
|
7
|
-
import { FormFieldHeader } from "../../FormField/FormFieldHeader.js";
|
|
8
|
-
import { FormFieldHeaderClose } from "../../FormField/FormFieldHeaderClose.js";
|
|
9
|
-
import { TextInput } from "../../Input/TextInput/TextInput.js";
|
|
10
|
-
import { SelectInput } from "./SelectInput.js";
|
|
11
|
-
import { SelectListBox } from "./SelectListBox.js";
|
|
12
|
-
import { SelectListBoxSelectionBar } from "./SelectListBoxSelectionBar.js";
|
|
13
|
-
import { SelectContext } from "./select.context.js";
|
|
14
|
-
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
15
|
-
const SelectMobile = ({
|
|
16
|
-
ref,
|
|
17
|
-
error,
|
|
18
|
-
showSelectionContent,
|
|
19
|
-
inputClassName,
|
|
20
|
-
containerClassName,
|
|
21
|
-
customTrigger,
|
|
22
|
-
onBlur,
|
|
23
|
-
...props
|
|
24
|
-
}) => {
|
|
25
|
-
const {
|
|
26
|
-
label,
|
|
27
|
-
tooltipText,
|
|
28
|
-
helperText,
|
|
29
|
-
isRequired,
|
|
30
|
-
rightContent,
|
|
31
|
-
isHeaderHidden,
|
|
32
|
-
headerClassName,
|
|
33
|
-
errorClassName,
|
|
34
|
-
placeholder,
|
|
35
|
-
variant,
|
|
36
|
-
isDisabled,
|
|
37
|
-
className,
|
|
38
|
-
hideLabel,
|
|
39
|
-
hideDropdownIcon,
|
|
40
|
-
isSearchable,
|
|
41
|
-
isClearable,
|
|
42
|
-
as,
|
|
43
|
-
collapseAfter,
|
|
44
|
-
selectedTagsType
|
|
45
|
-
} = props;
|
|
46
|
-
const formFieldProps = {
|
|
47
|
-
error,
|
|
48
|
-
label,
|
|
49
|
-
tooltipText,
|
|
50
|
-
helperText,
|
|
51
|
-
isRequired,
|
|
52
|
-
rightContent,
|
|
53
|
-
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
54
|
-
hideLabel,
|
|
55
|
-
isDisabled,
|
|
56
|
-
headerClassName,
|
|
57
|
-
errorClassName
|
|
58
|
-
};
|
|
59
|
-
const { labelProps, fieldProps } = useLabel({ label });
|
|
60
|
-
const headerProps = {
|
|
61
|
-
label,
|
|
62
|
-
tooltipText,
|
|
63
|
-
helperText,
|
|
64
|
-
isRequired,
|
|
65
|
-
rightContent,
|
|
66
|
-
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
67
|
-
isDisabled,
|
|
68
|
-
className: headerClassName,
|
|
69
|
-
labelProps
|
|
70
|
-
};
|
|
71
|
-
const { fieldState, isOpen, setIsOpen, onInputChange, isMultiple } = SelectContext.useSelect();
|
|
72
|
-
const searchInputRef = useRef(null);
|
|
73
|
-
const dialogTriggerProps = {
|
|
74
|
-
isOpen,
|
|
75
|
-
onOpenChange: setIsOpen
|
|
76
|
-
};
|
|
77
|
-
return /* @__PURE__ */ jsx(
|
|
78
|
-
FormField,
|
|
79
|
-
{
|
|
80
|
-
...formFieldProps,
|
|
81
|
-
as,
|
|
82
|
-
labelProps,
|
|
83
|
-
className: clsx("w-full", containerClassName),
|
|
84
|
-
children: /* @__PURE__ */ jsxs(DialogTrigger, { ...dialogTriggerProps, children: [
|
|
85
|
-
customTrigger ? /* @__PURE__ */ jsx(
|
|
86
|
-
"div",
|
|
87
|
-
{
|
|
88
|
-
...fieldProps,
|
|
89
|
-
ref,
|
|
90
|
-
children: customTrigger
|
|
91
|
-
}
|
|
92
|
-
) : /* @__PURE__ */ jsx(
|
|
93
|
-
SelectInput,
|
|
94
|
-
{
|
|
95
|
-
ref,
|
|
96
|
-
placeholder,
|
|
97
|
-
variant,
|
|
98
|
-
as,
|
|
99
|
-
isDisabled,
|
|
100
|
-
isInvalid: !!error,
|
|
101
|
-
className,
|
|
102
|
-
hideDropdownIcon,
|
|
103
|
-
isSearchable: false,
|
|
104
|
-
isClearable,
|
|
105
|
-
showSelectionContent,
|
|
106
|
-
onBlur,
|
|
107
|
-
fieldProps,
|
|
108
|
-
headerProps,
|
|
109
|
-
collapseAfter,
|
|
110
|
-
selectedTagsType
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
BottomSheet,
|
|
115
|
-
{
|
|
116
|
-
isOpen,
|
|
117
|
-
onOpenChange: setIsOpen,
|
|
118
|
-
onStateChange: (state) => {
|
|
119
|
-
if (state === "opened") {
|
|
120
|
-
searchInputRef.current?.focus();
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
label,
|
|
124
|
-
footer: isMultiple && /* @__PURE__ */ jsx(SelectListBoxSelectionBar, {}),
|
|
125
|
-
isDismissable: true,
|
|
126
|
-
children: (close) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
127
|
-
isSearchable ? /* @__PURE__ */ jsx(
|
|
128
|
-
TextInput,
|
|
129
|
-
{
|
|
130
|
-
ref: searchInputRef,
|
|
131
|
-
label,
|
|
132
|
-
placeholder,
|
|
133
|
-
value: fieldState.inputValue,
|
|
134
|
-
onChange: onInputChange,
|
|
135
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
136
|
-
inputClassName,
|
|
137
|
-
className: "mb-1-5 px-4 pt-3"
|
|
138
|
-
}
|
|
139
|
-
) : /* @__PURE__ */ jsx(
|
|
140
|
-
FormFieldHeader,
|
|
141
|
-
{
|
|
142
|
-
label,
|
|
143
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
144
|
-
className: "!mb-1-5 px-4 pt-3"
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ jsx(
|
|
148
|
-
SelectListBox,
|
|
149
|
-
{
|
|
150
|
-
...props,
|
|
151
|
-
autoFocus: !isSearchable,
|
|
152
|
-
isScrollable: false,
|
|
153
|
-
onClose: close
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
] })
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
] })
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
};
|
|
163
|
-
export {
|
|
164
|
-
SelectMobile
|
|
165
|
-
};
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useMemo, useState, useRef, useEffect, useCallback, use } from "react";
|
|
3
|
-
import { useSelectItems, NewItemId } from "./useSelectItems.js";
|
|
4
|
-
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
5
|
-
var SelectContext;
|
|
6
|
-
((SelectContext2) => {
|
|
7
|
-
const Context = createContext({});
|
|
8
|
-
const defaultMapInitialToSelectItem = (item) => ({
|
|
9
|
-
id: item.id,
|
|
10
|
-
label: item.label ?? item.name ?? ""
|
|
11
|
-
});
|
|
12
|
-
SelectContext2.Provider = ({
|
|
13
|
-
items,
|
|
14
|
-
onInputChange,
|
|
15
|
-
onSearchChange,
|
|
16
|
-
showSelectAllOption,
|
|
17
|
-
showNewItemOption,
|
|
18
|
-
newItemMinLength,
|
|
19
|
-
onNewItemOption,
|
|
20
|
-
isLoading,
|
|
21
|
-
hasLoadMore,
|
|
22
|
-
isClientSearchDisabled,
|
|
23
|
-
children,
|
|
24
|
-
mapInitialToSelectItem = defaultMapInitialToSelectItem,
|
|
25
|
-
...props
|
|
26
|
-
}) => {
|
|
27
|
-
const isMultiple = props.selectionMode === "multiple";
|
|
28
|
-
const initialSelectedItems = useMemo(() => {
|
|
29
|
-
if (!props.initialSelection) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
if (Array.isArray(props.initialSelection)) {
|
|
33
|
-
return props.initialSelection.map(mapInitialToSelectItem);
|
|
34
|
-
}
|
|
35
|
-
return mapInitialToSelectItem(props.initialSelection);
|
|
36
|
-
}, [props.initialSelection, mapInitialToSelectItem]);
|
|
37
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
38
|
-
const [fieldState, setFieldState] = useState({
|
|
39
|
-
value: props.value ?? (isMultiple ? [] : null),
|
|
40
|
-
inputValue: "",
|
|
41
|
-
searchValue: ""
|
|
42
|
-
});
|
|
43
|
-
const { callback: onSearchChangeDebounced, isDebouncing } = useDebounceCallback(onSearchChange);
|
|
44
|
-
const [showAll, setShowAll] = useState(false);
|
|
45
|
-
const [cachedItems, setCachedItems] = useState(items);
|
|
46
|
-
const valueRef = useRef(initialSelectedItems);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (!isLoading) {
|
|
49
|
-
setCachedItems(items);
|
|
50
|
-
}
|
|
51
|
-
}, [isLoading, items]);
|
|
52
|
-
const { allItems, allListItems, listItems, selectableListItems } = useSelectItems({
|
|
53
|
-
initialSelectedItems,
|
|
54
|
-
selectedItems: valueRef.current,
|
|
55
|
-
cachedItems,
|
|
56
|
-
inputValue: fieldState.inputValue,
|
|
57
|
-
showAll,
|
|
58
|
-
isMultiple,
|
|
59
|
-
showSelectAllOption,
|
|
60
|
-
showNewItemOption,
|
|
61
|
-
newItemMinLength,
|
|
62
|
-
isLoading,
|
|
63
|
-
hasLoadMore,
|
|
64
|
-
isClientSearchDisabled
|
|
65
|
-
});
|
|
66
|
-
const selectedItems = useMemo(
|
|
67
|
-
() => allItems.filter(
|
|
68
|
-
({ id }) => Array.isArray(fieldState.value) ? fieldState.value.includes(id) : id === fieldState.value
|
|
69
|
-
),
|
|
70
|
-
[allItems, fieldState.value]
|
|
71
|
-
);
|
|
72
|
-
const selectedIds = useMemo(() => selectedItems.map(({ id }) => id), [selectedItems]);
|
|
73
|
-
const getItem = useCallback(
|
|
74
|
-
(value2) => allItems.find((item) => item && item.id === value2) ?? null,
|
|
75
|
-
[allItems]
|
|
76
|
-
);
|
|
77
|
-
const updateValue = useCallback(
|
|
78
|
-
(value2) => {
|
|
79
|
-
if (Array.isArray(value2)) {
|
|
80
|
-
valueRef.current = value2.map((id) => getItem(id)).filter((item) => item !== null);
|
|
81
|
-
} else {
|
|
82
|
-
valueRef.current = getItem(value2);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
[getItem]
|
|
86
|
-
);
|
|
87
|
-
const getValueIds = () => Array.isArray(valueRef.current) ? valueRef.current.map(({ id }) => id) : valueRef.current?.id ?? null;
|
|
88
|
-
const emitStateChanges = useCallback(
|
|
89
|
-
(changes, skipSelectionChange) => {
|
|
90
|
-
const valueChanged = JSON.stringify(changes.value) !== JSON.stringify(getValueIds());
|
|
91
|
-
if (valueChanged) {
|
|
92
|
-
updateValue(changes.value);
|
|
93
|
-
if (!skipSelectionChange) {
|
|
94
|
-
if (isMultiple) {
|
|
95
|
-
props.onChange?.(changes.value);
|
|
96
|
-
} else {
|
|
97
|
-
props.onChange?.(changes.value);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (changes.inputValue !== fieldState.inputValue) {
|
|
102
|
-
onInputChange?.(changes.inputValue);
|
|
103
|
-
}
|
|
104
|
-
if (changes.searchValue !== fieldState.searchValue) {
|
|
105
|
-
onSearchChangeDebounced?.(changes.searchValue);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
[fieldState, isMultiple, props, onInputChange, onSearchChangeDebounced, updateValue]
|
|
109
|
-
);
|
|
110
|
-
const syncFieldState = (value2) => {
|
|
111
|
-
const newFieldState = {
|
|
112
|
-
value: value2,
|
|
113
|
-
inputValue: isMultiple || Array.isArray(value2) ? fieldState.inputValue : getItem(value2)?.label ?? "",
|
|
114
|
-
searchValue: ""
|
|
115
|
-
};
|
|
116
|
-
setFieldState(newFieldState);
|
|
117
|
-
emitStateChanges(newFieldState, true);
|
|
118
|
-
if (!isMultiple) {
|
|
119
|
-
setShowAll(true);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
const value2 = props.value ?? null;
|
|
124
|
-
if (JSON.stringify(value2) !== JSON.stringify(fieldState.value)) {
|
|
125
|
-
syncFieldState(value2);
|
|
126
|
-
} else {
|
|
127
|
-
updateValue(value2);
|
|
128
|
-
}
|
|
129
|
-
}, [props.value]);
|
|
130
|
-
useEffect(() => {
|
|
131
|
-
if (!isMultiple && fieldState.value && fieldState.inputValue === "" && getItem(fieldState.value)?.label) {
|
|
132
|
-
syncFieldState(fieldState.value);
|
|
133
|
-
}
|
|
134
|
-
}, [allListItems]);
|
|
135
|
-
const handleInputChange = useCallback(
|
|
136
|
-
(inputValue) => {
|
|
137
|
-
const newFieldState = {
|
|
138
|
-
value: isMultiple || inputValue !== "" ? fieldState.value : null,
|
|
139
|
-
inputValue,
|
|
140
|
-
searchValue: inputValue
|
|
141
|
-
};
|
|
142
|
-
setFieldState(newFieldState);
|
|
143
|
-
emitStateChanges(newFieldState);
|
|
144
|
-
setShowAll(false);
|
|
145
|
-
if (!isOpen && inputValue !== "" && props.isSearchable) {
|
|
146
|
-
setIsOpen(true);
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
// oxlint-disable-next-line exhaustive-deps
|
|
150
|
-
[emitStateChanges, fieldState.value, isMultiple]
|
|
151
|
-
);
|
|
152
|
-
const onChange = useCallback(
|
|
153
|
-
(value2) => {
|
|
154
|
-
if (value2 === NewItemId) {
|
|
155
|
-
onNewItemOption?.(fieldState.inputValue);
|
|
156
|
-
} else {
|
|
157
|
-
const newFieldState = {
|
|
158
|
-
value: value2,
|
|
159
|
-
inputValue: isMultiple || Array.isArray(value2) ? "" : getItem(value2)?.label ?? "",
|
|
160
|
-
searchValue: ""
|
|
161
|
-
};
|
|
162
|
-
setFieldState(newFieldState);
|
|
163
|
-
emitStateChanges(newFieldState);
|
|
164
|
-
}
|
|
165
|
-
if (!isMultiple) {
|
|
166
|
-
setIsOpen(false);
|
|
167
|
-
setShowAll(true);
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
[emitStateChanges, onNewItemOption, fieldState.inputValue, getItem, isMultiple]
|
|
171
|
-
);
|
|
172
|
-
const onClear = useCallback(() => {
|
|
173
|
-
if (!valueRef.current || Array.isArray(valueRef.current) && valueRef.current.length === 0) {
|
|
174
|
-
setFieldState((prev) => ({
|
|
175
|
-
...prev,
|
|
176
|
-
inputValue: ""
|
|
177
|
-
}));
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (isMultiple) {
|
|
181
|
-
onChange([]);
|
|
182
|
-
} else {
|
|
183
|
-
onChange(null);
|
|
184
|
-
}
|
|
185
|
-
}, [isMultiple, onChange]);
|
|
186
|
-
const onSelectAll = useCallback(() => {
|
|
187
|
-
onChange(selectableListItems.map(({ id }) => id));
|
|
188
|
-
}, [selectableListItems, onChange]);
|
|
189
|
-
const onRemove = useCallback(
|
|
190
|
-
(value2) => {
|
|
191
|
-
if (isMultiple && Array.isArray(fieldState.value)) {
|
|
192
|
-
onChange(fieldState.value.filter((id) => id !== value2));
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
[isMultiple, fieldState.value, onChange]
|
|
196
|
-
);
|
|
197
|
-
const value = useMemo(
|
|
198
|
-
() => ({
|
|
199
|
-
fieldState,
|
|
200
|
-
isOpen,
|
|
201
|
-
setIsOpen,
|
|
202
|
-
isDebouncing,
|
|
203
|
-
onInputChange: handleInputChange,
|
|
204
|
-
onChange,
|
|
205
|
-
onClear,
|
|
206
|
-
onSelectAll,
|
|
207
|
-
onRemove,
|
|
208
|
-
listItems,
|
|
209
|
-
selectableListItems,
|
|
210
|
-
selectedItems,
|
|
211
|
-
selectedIds,
|
|
212
|
-
isMultiple,
|
|
213
|
-
isLoading,
|
|
214
|
-
hasLoadMore
|
|
215
|
-
}),
|
|
216
|
-
[
|
|
217
|
-
fieldState,
|
|
218
|
-
isOpen,
|
|
219
|
-
setIsOpen,
|
|
220
|
-
isDebouncing,
|
|
221
|
-
handleInputChange,
|
|
222
|
-
onChange,
|
|
223
|
-
onClear,
|
|
224
|
-
onSelectAll,
|
|
225
|
-
onRemove,
|
|
226
|
-
listItems,
|
|
227
|
-
selectableListItems,
|
|
228
|
-
selectedIds,
|
|
229
|
-
selectedItems,
|
|
230
|
-
isMultiple,
|
|
231
|
-
isLoading,
|
|
232
|
-
hasLoadMore
|
|
233
|
-
]
|
|
234
|
-
);
|
|
235
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
236
|
-
};
|
|
237
|
-
SelectContext2.useSelect = () => {
|
|
238
|
-
const select = use(Context);
|
|
239
|
-
return select;
|
|
240
|
-
};
|
|
241
|
-
})(SelectContext || (SelectContext = {}));
|
|
242
|
-
export {
|
|
243
|
-
SelectContext
|
|
244
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { useFilter } from "react-aria-components";
|
|
3
|
-
const SelectAllItemId = "all-item-id";
|
|
4
|
-
const SelectAllItem = (inputValue) => ({
|
|
5
|
-
id: SelectAllItemId,
|
|
6
|
-
label: inputValue,
|
|
7
|
-
isSelectAllItem: true
|
|
8
|
-
});
|
|
9
|
-
const NewItemId = "new-item-id";
|
|
10
|
-
const NewItem = (inputValue) => ({
|
|
11
|
-
id: NewItemId,
|
|
12
|
-
label: inputValue,
|
|
13
|
-
isNewItem: true
|
|
14
|
-
});
|
|
15
|
-
const LoadingItemId = "loading-item-id";
|
|
16
|
-
const LoadingItem = (inputValue) => ({
|
|
17
|
-
id: LoadingItemId,
|
|
18
|
-
label: inputValue,
|
|
19
|
-
isLoadingItem: true
|
|
20
|
-
});
|
|
21
|
-
const ReservedItemIds = [SelectAllItemId, NewItemId, LoadingItemId];
|
|
22
|
-
function useSelectItems({
|
|
23
|
-
initialSelectedItems,
|
|
24
|
-
selectedItems,
|
|
25
|
-
cachedItems,
|
|
26
|
-
inputValue,
|
|
27
|
-
showAll,
|
|
28
|
-
isMultiple,
|
|
29
|
-
showSelectAllOption,
|
|
30
|
-
showNewItemOption,
|
|
31
|
-
newItemMinLength = 3,
|
|
32
|
-
isLoading,
|
|
33
|
-
hasLoadMore,
|
|
34
|
-
isClientSearchDisabled
|
|
35
|
-
}) {
|
|
36
|
-
const { contains } = useFilter({ sensitivity: "base" });
|
|
37
|
-
const allListItems = useMemo(() => {
|
|
38
|
-
const showSelectAllItem = isMultiple && showSelectAllOption && inputValue.length === 0 && !hasLoadMore;
|
|
39
|
-
const showNewItem = showNewItemOption && inputValue.length >= newItemMinLength && !cachedItems.find((item) => contains(item.label, inputValue));
|
|
40
|
-
const showLoadingItem = isLoading || hasLoadMore;
|
|
41
|
-
return [
|
|
42
|
-
...showSelectAllItem ? [SelectAllItem(inputValue)] : [],
|
|
43
|
-
...cachedItems,
|
|
44
|
-
...showNewItem ? [NewItem(inputValue)] : [],
|
|
45
|
-
...showLoadingItem ? [LoadingItem(inputValue)] : []
|
|
46
|
-
];
|
|
47
|
-
}, [
|
|
48
|
-
isMultiple,
|
|
49
|
-
showNewItemOption,
|
|
50
|
-
inputValue,
|
|
51
|
-
newItemMinLength,
|
|
52
|
-
cachedItems,
|
|
53
|
-
contains,
|
|
54
|
-
isLoading,
|
|
55
|
-
hasLoadMore,
|
|
56
|
-
showSelectAllOption
|
|
57
|
-
]);
|
|
58
|
-
const allItems = useMemo(() => {
|
|
59
|
-
const items = [
|
|
60
|
-
...Array.isArray(initialSelectedItems) ? initialSelectedItems : [initialSelectedItems],
|
|
61
|
-
...Array.isArray(selectedItems) ? selectedItems : [selectedItems],
|
|
62
|
-
...allListItems
|
|
63
|
-
].filter((item) => !!item);
|
|
64
|
-
const allItemsMap = /* @__PURE__ */ new Map();
|
|
65
|
-
items.forEach((item) => allItemsMap.set(item.id, item));
|
|
66
|
-
return Array.from(allItemsMap.values());
|
|
67
|
-
}, [allListItems, initialSelectedItems, selectedItems]);
|
|
68
|
-
const filteredListItems = useMemo(
|
|
69
|
-
() => allListItems.filter((item) => contains(item.label, inputValue)),
|
|
70
|
-
[allListItems, contains, inputValue]
|
|
71
|
-
);
|
|
72
|
-
const listItems = useMemo(
|
|
73
|
-
() => showAll || isClientSearchDisabled ? allListItems : filteredListItems,
|
|
74
|
-
[showAll, isClientSearchDisabled, allListItems, filteredListItems]
|
|
75
|
-
);
|
|
76
|
-
const selectableListItems = useMemo(
|
|
77
|
-
() => listItems.filter((item) => !item.isDisabled && !ReservedItemIds.includes(String(item.id))),
|
|
78
|
-
[listItems]
|
|
79
|
-
);
|
|
80
|
-
return {
|
|
81
|
-
allItems,
|
|
82
|
-
allListItems,
|
|
83
|
-
filteredListItems,
|
|
84
|
-
listItems,
|
|
85
|
-
selectableListItems
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
LoadingItemId,
|
|
90
|
-
NewItemId,
|
|
91
|
-
ReservedItemIds,
|
|
92
|
-
SelectAllItemId,
|
|
93
|
-
useSelectItems
|
|
94
|
-
};
|