@povio/ui 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AriaListBoxProps } from 'react-aria';
|
|
2
2
|
import { SelectBaseProps } from './SelectBase';
|
|
3
3
|
import { SelectItem } from './select.types';
|
|
4
|
-
export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable" | "virtualizerOptions">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
|
|
4
|
+
export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable" | "virtualizerOptions" | "totalItems" | "hasLoadMore">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
|
|
5
5
|
className?: string;
|
|
6
6
|
isScrollable?: boolean;
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, virtualizerOptions, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, virtualizerOptions, totalItems, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,73 +3,185 @@ import { SelectContext } from "./select.context.js";
|
|
|
3
3
|
import { SelectListBoxItem } from "./SelectListBoxItem.js";
|
|
4
4
|
import { SelectListBoxItemSelectAll } from "./SelectListBoxItemSelectAll.js";
|
|
5
5
|
import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
9
|
import { ListBox, ListLayout, Virtualizer } from "react-aria-components";
|
|
9
10
|
//#region src/components/inputs/Selection/shared/SelectListBox.tsx
|
|
10
|
-
var SelectListBox = (
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
var SelectListBox = (t0) => {
|
|
12
|
+
const $ = c(51);
|
|
13
|
+
let className;
|
|
14
|
+
let isSearchable;
|
|
15
|
+
let label;
|
|
16
|
+
let newItemRender;
|
|
17
|
+
let onClose;
|
|
18
|
+
let onLoadMore;
|
|
19
|
+
let props;
|
|
20
|
+
let selectionMode;
|
|
21
|
+
let t1;
|
|
22
|
+
let totalItems;
|
|
23
|
+
let virtualizerOptions;
|
|
24
|
+
if ($[0] !== t0) {
|
|
25
|
+
({label, selectionMode, isSearchable, isScrollable: t1, virtualizerOptions, totalItems, newItemRender, onLoadMore, className, onClose, ...props} = t0);
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
$[1] = className;
|
|
28
|
+
$[2] = isSearchable;
|
|
29
|
+
$[3] = label;
|
|
30
|
+
$[4] = newItemRender;
|
|
31
|
+
$[5] = onClose;
|
|
32
|
+
$[6] = onLoadMore;
|
|
33
|
+
$[7] = props;
|
|
34
|
+
$[8] = selectionMode;
|
|
35
|
+
$[9] = t1;
|
|
36
|
+
$[10] = totalItems;
|
|
37
|
+
$[11] = virtualizerOptions;
|
|
38
|
+
} else {
|
|
39
|
+
className = $[1];
|
|
40
|
+
isSearchable = $[2];
|
|
41
|
+
label = $[3];
|
|
42
|
+
newItemRender = $[4];
|
|
43
|
+
onClose = $[5];
|
|
44
|
+
onLoadMore = $[6];
|
|
45
|
+
props = $[7];
|
|
46
|
+
selectionMode = $[8];
|
|
47
|
+
t1 = $[9];
|
|
48
|
+
totalItems = $[10];
|
|
49
|
+
virtualizerOptions = $[11];
|
|
50
|
+
}
|
|
51
|
+
const isScrollable = t1 === void 0 ? true : t1;
|
|
52
|
+
const { fieldState, onChange, listItems, selectableListItems, selectedIds, isMultiple, onClear, onSelectAll, hasLoadMore } = SelectContext.useSelect();
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[12] !== fieldState || $[13] !== isMultiple || $[14] !== onChange || $[15] !== onClear || $[16] !== onClose || $[17] !== onSelectAll || $[18] !== selectableListItems) {
|
|
55
|
+
t2 = (value) => {
|
|
56
|
+
const ids = Array.from(value);
|
|
57
|
+
if (!isMultiple && ids.length === 0) {
|
|
58
|
+
if (fieldState.value) {
|
|
59
|
+
onClose?.();
|
|
60
|
+
onChange(fieldState.value);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (isMultiple && ids.includes("all-item-id")) {
|
|
65
|
+
if (ids.length > selectableListItems.length) onClear();
|
|
66
|
+
else onSelectAll();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isMultiple) onChange(ids);
|
|
70
|
+
else {
|
|
16
71
|
onClose?.();
|
|
17
|
-
onChange(
|
|
72
|
+
onChange(ids[0]);
|
|
18
73
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
74
|
+
};
|
|
75
|
+
$[12] = fieldState;
|
|
76
|
+
$[13] = isMultiple;
|
|
77
|
+
$[14] = onChange;
|
|
78
|
+
$[15] = onClear;
|
|
79
|
+
$[16] = onClose;
|
|
80
|
+
$[17] = onSelectAll;
|
|
81
|
+
$[18] = selectableListItems;
|
|
82
|
+
$[19] = t2;
|
|
83
|
+
} else t2 = $[19];
|
|
84
|
+
const onSelectionChange = t2;
|
|
85
|
+
let t3;
|
|
86
|
+
if ($[20] !== isSearchable || $[21] !== newItemRender || $[22] !== onLoadMore) {
|
|
87
|
+
t3 = (item) => {
|
|
88
|
+
if (item.isSelectAllItem) return /* @__PURE__ */ jsx(SelectListBoxItemSelectAll, { ...item }, item.id);
|
|
89
|
+
if (item.isLoadingItem) return /* @__PURE__ */ jsx(SelectListBoxLoadingItem, {
|
|
90
|
+
...item,
|
|
91
|
+
onLoadMore
|
|
92
|
+
}, item.id);
|
|
93
|
+
return /* @__PURE__ */ jsx(SelectListBoxItem, {
|
|
94
|
+
...item,
|
|
95
|
+
isSearchable,
|
|
96
|
+
isNewItem: item.isNewItem,
|
|
97
|
+
newItemRender
|
|
98
|
+
}, item.id);
|
|
99
|
+
};
|
|
100
|
+
$[20] = isSearchable;
|
|
101
|
+
$[21] = newItemRender;
|
|
102
|
+
$[22] = onLoadMore;
|
|
103
|
+
$[23] = t3;
|
|
104
|
+
} else t3 = $[23];
|
|
105
|
+
const renderItem = t3;
|
|
106
|
+
if (virtualizerOptions || (totalItems ?? listItems.length) > 100 || hasLoadMore) {
|
|
107
|
+
const t4 = isScrollable ? "max-h-full overflow-y-auto overflow-x-hidden" : "overflow-hidden";
|
|
108
|
+
let t5;
|
|
109
|
+
if ($[24] !== className || $[25] !== t4) {
|
|
110
|
+
t5 = clsx("flex-1 outline-none [&>div:last-child>*]:border-b-0", t4, className);
|
|
111
|
+
$[24] = className;
|
|
112
|
+
$[25] = t4;
|
|
113
|
+
$[26] = t5;
|
|
114
|
+
} else t5 = $[26];
|
|
115
|
+
let t6;
|
|
116
|
+
if ($[27] !== label || $[28] !== listItems || $[29] !== onSelectionChange || $[30] !== props || $[31] !== renderItem || $[32] !== selectedIds || $[33] !== selectionMode || $[34] !== t5) {
|
|
117
|
+
t6 = /* @__PURE__ */ jsx(ListBox, {
|
|
118
|
+
...props,
|
|
119
|
+
"aria-label": label,
|
|
120
|
+
selectionMode,
|
|
121
|
+
className: t5,
|
|
122
|
+
items: listItems,
|
|
123
|
+
selectedKeys: selectedIds,
|
|
124
|
+
onSelectionChange,
|
|
125
|
+
escapeKeyBehavior: "none",
|
|
126
|
+
shouldSelectOnPressUp: true,
|
|
127
|
+
children: renderItem
|
|
128
|
+
});
|
|
129
|
+
$[27] = label;
|
|
130
|
+
$[28] = listItems;
|
|
131
|
+
$[29] = onSelectionChange;
|
|
132
|
+
$[30] = props;
|
|
133
|
+
$[31] = renderItem;
|
|
134
|
+
$[32] = selectedIds;
|
|
135
|
+
$[33] = selectionMode;
|
|
136
|
+
$[34] = t5;
|
|
137
|
+
$[35] = t6;
|
|
138
|
+
} else t6 = $[35];
|
|
139
|
+
let t7;
|
|
140
|
+
if ($[36] !== t6 || $[37] !== virtualizerOptions) {
|
|
141
|
+
t7 = /* @__PURE__ */ jsx(Virtualizer, {
|
|
142
|
+
layout: ListLayout,
|
|
143
|
+
layoutOptions: virtualizerOptions,
|
|
144
|
+
children: t6
|
|
145
|
+
});
|
|
146
|
+
$[36] = t6;
|
|
147
|
+
$[37] = virtualizerOptions;
|
|
148
|
+
$[38] = t7;
|
|
149
|
+
} else t7 = $[38];
|
|
150
|
+
return t7;
|
|
151
|
+
}
|
|
152
|
+
const t4 = isScrollable ? "max-h-full overflow-y-auto overflow-x-hidden" : "overflow-hidden";
|
|
153
|
+
let t5;
|
|
154
|
+
if ($[39] !== className || $[40] !== t4) {
|
|
155
|
+
t5 = clsx("flex-1 outline-none [&>div:last-child]:border-b-0", t4, className);
|
|
156
|
+
$[39] = className;
|
|
157
|
+
$[40] = t4;
|
|
158
|
+
$[41] = t5;
|
|
159
|
+
} else t5 = $[41];
|
|
160
|
+
let t6;
|
|
161
|
+
if ($[42] !== label || $[43] !== listItems || $[44] !== onSelectionChange || $[45] !== props || $[46] !== renderItem || $[47] !== selectedIds || $[48] !== selectionMode || $[49] !== t5) {
|
|
162
|
+
t6 = /* @__PURE__ */ jsx(ListBox, {
|
|
49
163
|
...props,
|
|
50
164
|
"aria-label": label,
|
|
51
165
|
selectionMode,
|
|
52
|
-
className:
|
|
166
|
+
className: t5,
|
|
53
167
|
items: listItems,
|
|
54
168
|
selectedKeys: selectedIds,
|
|
55
169
|
onSelectionChange,
|
|
56
170
|
escapeKeyBehavior: "none",
|
|
57
171
|
shouldSelectOnPressUp: true,
|
|
58
172
|
children: renderItem
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
children: renderItem
|
|
72
|
-
});
|
|
173
|
+
});
|
|
174
|
+
$[42] = label;
|
|
175
|
+
$[43] = listItems;
|
|
176
|
+
$[44] = onSelectionChange;
|
|
177
|
+
$[45] = props;
|
|
178
|
+
$[46] = renderItem;
|
|
179
|
+
$[47] = selectedIds;
|
|
180
|
+
$[48] = selectionMode;
|
|
181
|
+
$[49] = t5;
|
|
182
|
+
$[50] = t6;
|
|
183
|
+
} else t6 = $[50];
|
|
184
|
+
return t6;
|
|
73
185
|
};
|
|
74
186
|
//#endregion
|
|
75
187
|
export { SelectListBox };
|
|
@@ -3,52 +3,102 @@ import "../../../../config/i18n.js";
|
|
|
3
3
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
5
|
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
+
import { useRef } from "react";
|
|
8
9
|
import { ListBoxItem } from "react-aria-components";
|
|
9
10
|
import { useTranslation } from "react-i18next";
|
|
10
11
|
//#region src/components/inputs/Selection/shared/SelectListBoxItem.tsx
|
|
11
|
-
var SelectListBoxItem = (
|
|
12
|
+
var SelectListBoxItem = (t0) => {
|
|
13
|
+
const $ = c(24);
|
|
14
|
+
const { isSearchable, isNewItem, newItemRender, id, label, content, isDisabled } = t0;
|
|
12
15
|
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
13
16
|
const ref = useRef(null);
|
|
14
17
|
const { t } = useTranslation("ui");
|
|
15
18
|
const { selectedIds, isMultiple } = SelectContext.useSelect();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
let t1;
|
|
20
|
+
bb0: {
|
|
21
|
+
if (isNewItem) {
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[0] !== label || $[1] !== newItemRender || $[2] !== t) {
|
|
24
|
+
t2 = newItemRender?.(label) ?? `${t(_temp)} '${label}'`;
|
|
25
|
+
$[0] = label;
|
|
26
|
+
$[1] = newItemRender;
|
|
27
|
+
$[2] = t;
|
|
28
|
+
$[3] = t2;
|
|
29
|
+
} else t2 = $[3];
|
|
30
|
+
t1 = t2;
|
|
31
|
+
break bb0;
|
|
32
|
+
}
|
|
33
|
+
t1 = content ?? label;
|
|
34
|
+
}
|
|
35
|
+
const itemContent = t1;
|
|
36
|
+
const t2 = !isMultiple;
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] !== isNewItem || $[5] !== selectListItemCva || $[6] !== t2) {
|
|
39
|
+
t3 = selectListItemCva({
|
|
40
|
+
isSingle: t2,
|
|
33
41
|
isNewItem
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
});
|
|
43
|
+
$[4] = isNewItem;
|
|
44
|
+
$[5] = selectListItemCva;
|
|
45
|
+
$[6] = t2;
|
|
46
|
+
$[7] = t3;
|
|
47
|
+
} else t3 = $[7];
|
|
48
|
+
let t4;
|
|
49
|
+
if ($[8] !== isMultiple || $[9] !== isSearchable) {
|
|
50
|
+
t4 = isMultiple && !isSearchable && /* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
51
|
+
variant: "default",
|
|
52
|
+
className: "group-focus-visible:outline-none!"
|
|
53
|
+
});
|
|
54
|
+
$[8] = isMultiple;
|
|
55
|
+
$[9] = isSearchable;
|
|
56
|
+
$[10] = t4;
|
|
57
|
+
} else t4 = $[10];
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[11] !== id || $[12] !== isMultiple || $[13] !== isSearchable || $[14] !== selectedIds) {
|
|
60
|
+
t5 = isMultiple && isSearchable && /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: "group",
|
|
62
|
+
"data-rac": "",
|
|
63
|
+
"data-selected": selectedIds.includes(id) || void 0,
|
|
64
|
+
children: /* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
37
65
|
variant: "default",
|
|
38
66
|
className: "group-focus-visible:outline-none!"
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
$[11] = id;
|
|
70
|
+
$[12] = isMultiple;
|
|
71
|
+
$[13] = isSearchable;
|
|
72
|
+
$[14] = selectedIds;
|
|
73
|
+
$[15] = t5;
|
|
74
|
+
} else t5 = $[15];
|
|
75
|
+
let t6;
|
|
76
|
+
if ($[16] !== id || $[17] !== isDisabled || $[18] !== itemContent || $[19] !== label || $[20] !== t3 || $[21] !== t4 || $[22] !== t5) {
|
|
77
|
+
t6 = /* @__PURE__ */ jsxs(ListBoxItem, {
|
|
78
|
+
ref,
|
|
79
|
+
id,
|
|
80
|
+
textValue: label,
|
|
81
|
+
isDisabled,
|
|
82
|
+
className: t3,
|
|
83
|
+
children: [
|
|
84
|
+
t4,
|
|
85
|
+
t5,
|
|
86
|
+
itemContent
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
$[16] = id;
|
|
90
|
+
$[17] = isDisabled;
|
|
91
|
+
$[18] = itemContent;
|
|
92
|
+
$[19] = label;
|
|
93
|
+
$[20] = t3;
|
|
94
|
+
$[21] = t4;
|
|
95
|
+
$[22] = t5;
|
|
96
|
+
$[23] = t6;
|
|
97
|
+
} else t6 = $[23];
|
|
98
|
+
return t6;
|
|
52
99
|
};
|
|
100
|
+
function _temp($) {
|
|
101
|
+
return $.ui.autocomplete.createNewBtn;
|
|
102
|
+
}
|
|
53
103
|
//#endregion
|
|
54
104
|
export { SelectListBoxItem };
|
|
@@ -3,33 +3,86 @@ import "../../../../config/i18n.js";
|
|
|
3
3
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
5
|
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { useRef } from "react";
|
|
8
9
|
import { ListBoxItem } from "react-aria-components";
|
|
9
10
|
import { useTranslation } from "react-i18next";
|
|
10
11
|
//#region src/components/inputs/Selection/shared/SelectListBoxItemSelectAll.tsx
|
|
11
|
-
var SelectListBoxItemSelectAll = (
|
|
12
|
+
var SelectListBoxItemSelectAll = (t0) => {
|
|
13
|
+
const $ = c(18);
|
|
14
|
+
const { id, label, isDisabled } = t0;
|
|
12
15
|
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
13
16
|
const ref = useRef(null);
|
|
14
17
|
const { t } = useTranslation("ui");
|
|
15
18
|
const { selectableListItems, selectedIds } = SelectContext.useSelect();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== label || $[1] !== t) {
|
|
21
|
+
t1 = label || t(_temp);
|
|
22
|
+
$[0] = label;
|
|
23
|
+
$[1] = t;
|
|
24
|
+
$[2] = t1;
|
|
25
|
+
} else t1 = $[2];
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[3] !== selectListItemCva) {
|
|
28
|
+
t2 = selectListItemCva({});
|
|
29
|
+
$[3] = selectListItemCva;
|
|
30
|
+
$[4] = t2;
|
|
31
|
+
} else t2 = $[4];
|
|
32
|
+
const t3 = selectedIds.length === selectableListItems.length || void 0;
|
|
33
|
+
const t4 = selectedIds.length > 0 && selectedIds.length < selectableListItems.length || void 0;
|
|
34
|
+
let t5;
|
|
35
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
|
+
t5 = /* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
37
|
+
variant: "default",
|
|
38
|
+
className: "group-focus-visible:outline-none!"
|
|
39
|
+
});
|
|
40
|
+
$[5] = t5;
|
|
41
|
+
} else t5 = $[5];
|
|
42
|
+
let t6;
|
|
43
|
+
if ($[6] !== t3 || $[7] !== t4) {
|
|
44
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
23
45
|
className: "group",
|
|
24
46
|
"data-rac": "",
|
|
25
|
-
"data-selected":
|
|
26
|
-
"data-indeterminate":
|
|
27
|
-
children:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
47
|
+
"data-selected": t3,
|
|
48
|
+
"data-indeterminate": t4,
|
|
49
|
+
children: t5
|
|
50
|
+
});
|
|
51
|
+
$[6] = t3;
|
|
52
|
+
$[7] = t4;
|
|
53
|
+
$[8] = t6;
|
|
54
|
+
} else t6 = $[8];
|
|
55
|
+
let t7;
|
|
56
|
+
if ($[9] !== t) {
|
|
57
|
+
t7 = t(_temp2);
|
|
58
|
+
$[9] = t;
|
|
59
|
+
$[10] = t7;
|
|
60
|
+
} else t7 = $[10];
|
|
61
|
+
let t8;
|
|
62
|
+
if ($[11] !== id || $[12] !== isDisabled || $[13] !== t1 || $[14] !== t2 || $[15] !== t6 || $[16] !== t7) {
|
|
63
|
+
t8 = /* @__PURE__ */ jsxs(ListBoxItem, {
|
|
64
|
+
ref,
|
|
65
|
+
id,
|
|
66
|
+
textValue: t1,
|
|
67
|
+
isDisabled,
|
|
68
|
+
className: t2,
|
|
69
|
+
children: [t6, t7]
|
|
70
|
+
});
|
|
71
|
+
$[11] = id;
|
|
72
|
+
$[12] = isDisabled;
|
|
73
|
+
$[13] = t1;
|
|
74
|
+
$[14] = t2;
|
|
75
|
+
$[15] = t6;
|
|
76
|
+
$[16] = t7;
|
|
77
|
+
$[17] = t8;
|
|
78
|
+
} else t8 = $[17];
|
|
79
|
+
return t8;
|
|
33
80
|
};
|
|
81
|
+
function _temp($) {
|
|
82
|
+
return $.ui.select.allOption;
|
|
83
|
+
}
|
|
84
|
+
function _temp2($_0) {
|
|
85
|
+
return $_0.ui.select.allOption;
|
|
86
|
+
}
|
|
34
87
|
//#endregion
|
|
35
88
|
export { SelectListBoxItemSelectAll };
|
|
@@ -4,37 +4,86 @@ import "../../../../config/i18n.js";
|
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
5
|
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
6
|
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import { useCallback } from "react";
|
|
9
9
|
import { ListBoxItem } from "react-aria-components";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
//#region src/components/inputs/Selection/shared/SelectListBoxLoadingItem.tsx
|
|
12
|
-
var SelectListBoxLoadingItem = (
|
|
12
|
+
var SelectListBoxLoadingItem = (t0) => {
|
|
13
|
+
const $ = c(20);
|
|
14
|
+
const { id, label, onLoadMore } = t0;
|
|
13
15
|
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
14
16
|
const { t } = useTranslation("ui");
|
|
15
17
|
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== hasLoadMore || $[1] !== isDebouncing || $[2] !== isLoading || $[3] !== onLoadMore) {
|
|
20
|
+
t1 = () => {
|
|
18
21
|
if (!isDebouncing && !isLoading && hasLoadMore) onLoadMore?.();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
};
|
|
23
|
+
$[0] = hasLoadMore;
|
|
24
|
+
$[1] = isDebouncing;
|
|
25
|
+
$[2] = isLoading;
|
|
26
|
+
$[3] = onLoadMore;
|
|
27
|
+
$[4] = t1;
|
|
28
|
+
} else t1 = $[4];
|
|
29
|
+
const onIntersection = t1;
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[5] !== onIntersection) {
|
|
32
|
+
t2 = {
|
|
33
|
+
onIntersection,
|
|
34
|
+
rootMargin: "40px"
|
|
35
|
+
};
|
|
36
|
+
$[5] = onIntersection;
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
} else t2 = $[6];
|
|
39
|
+
const { ref } = useIntersectionObserver(t2);
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[7] !== label || $[8] !== t) {
|
|
42
|
+
t3 = label || t(_temp);
|
|
43
|
+
$[7] = label;
|
|
44
|
+
$[8] = t;
|
|
45
|
+
$[9] = t3;
|
|
46
|
+
} else t3 = $[9];
|
|
47
|
+
let t4;
|
|
48
|
+
if ($[10] !== selectListItemCva) {
|
|
49
|
+
t4 = selectListItemCva({});
|
|
50
|
+
$[10] = selectListItemCva;
|
|
51
|
+
$[11] = t4;
|
|
52
|
+
} else t4 = $[11];
|
|
53
|
+
let t5;
|
|
54
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
55
|
+
t5 = /* @__PURE__ */ jsx(Loader, {});
|
|
56
|
+
$[12] = t5;
|
|
57
|
+
} else t5 = $[12];
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[13] !== ref) {
|
|
60
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
33
61
|
ref,
|
|
34
62
|
className: "flex flex-1 justify-center text-interactive-text-primary-idle",
|
|
35
|
-
children:
|
|
36
|
-
})
|
|
37
|
-
|
|
63
|
+
children: t5
|
|
64
|
+
});
|
|
65
|
+
$[13] = ref;
|
|
66
|
+
$[14] = t6;
|
|
67
|
+
} else t6 = $[14];
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[15] !== id || $[16] !== t3 || $[17] !== t4 || $[18] !== t6) {
|
|
70
|
+
t7 = /* @__PURE__ */ jsx(ListBoxItem, {
|
|
71
|
+
id,
|
|
72
|
+
textValue: t3,
|
|
73
|
+
isDisabled: true,
|
|
74
|
+
className: t4,
|
|
75
|
+
children: t6
|
|
76
|
+
});
|
|
77
|
+
$[15] = id;
|
|
78
|
+
$[16] = t3;
|
|
79
|
+
$[17] = t4;
|
|
80
|
+
$[18] = t6;
|
|
81
|
+
$[19] = t7;
|
|
82
|
+
} else t7 = $[19];
|
|
83
|
+
return t7;
|
|
38
84
|
};
|
|
85
|
+
function _temp($) {
|
|
86
|
+
return $.ui.loadingState.text;
|
|
87
|
+
}
|
|
39
88
|
//#endregion
|
|
40
89
|
export { SelectListBoxLoadingItem };
|