@cube-dev/ui-kit 0.215.2 → 0.216.1
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/CHANGELOG.md +24 -0
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/AutoCollapseObserver.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/Button/index.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/types.d.ts +4 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +2 -1
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +21 -16
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +7 -11
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +20 -0
- package/dist/components/fields/ListBox/ListBox.js +274 -80
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/empty-row.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +1 -1
- package/dist/components/fields/Picker/Picker.js +4 -14
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/joined-styles.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useSuffixSpace.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +1 -1
- package/dist/components/fields/ToggleGroup/context.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/NavTabs/NavTabs.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/scroll-tab-into-strip.js +1 -1
- package/dist/components/navigation/Tabs/segmented-styles.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +25 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +3 -2
- package/dist/i18n/locales/en-US/uikit.js +3 -2
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -0
- package/dist/i18n/locales/es-ES/uikit.js +3 -2
- package/dist/i18n/locales/es-MX/uikit.js +3 -2
- package/dist/i18n/locales/fr-FR/uikit.js +3 -2
- package/dist/i18n/locales/it-IT/uikit.js +3 -2
- package/dist/i18n/locales/ja-JP/uikit.js +3 -2
- package/dist/i18n/locales/nb-NO/uikit.js +3 -2
- package/dist/i18n/locales/pt-BR/uikit.js +3 -2
- package/dist/i18n/locales/pt-PT/uikit.js +3 -2
- package/dist/i18n/locales/sv-SE/uikit.js +3 -2
- package/dist/i18n/locales/vi-VN/uikit.js +3 -2
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/layout-scale.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/componentBaseProps.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/pickBaseCustomizationProps.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/useOverlayPosition.js +139 -37
- package/dist/utils/react/useOverlayPosition.js.map +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/package.json +2 -1
- package/src/components/fields/FilterListBox/FilterListBox.docs.mdx +23 -0
- package/src/components/fields/FilterPicker/FilterPicker.docs.mdx +35 -1
- package/src/components/fields/ListBox/ListBox.docs.mdx +33 -0
- package/src/components/overlays/Dialog/DialogTrigger.docs.mdx +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.216.1 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { pickBaseCustomizationProps } from "../../../utils/react/pickBaseCustomizationProps.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
5
5
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
6
6
|
import { Icon } from "../../../icons/Icon.js";
|
|
7
7
|
import { CheckIcon } from "../../../icons/CheckIcon.js";
|
|
8
|
+
import { LoadingIcon } from "../../../icons/LoadingIcon.js";
|
|
8
9
|
import { useWarn } from "../../../_internal/hooks/use-warn.js";
|
|
9
10
|
import { CollectionItem as _CollectionItem, filterCollectionItemProps, filterSelectionItemProps, getValueSelectionState } from "../../CollectionItem.js";
|
|
10
11
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -23,13 +24,13 @@ import { DraggableListBox } from "./DraggableListBox.js";
|
|
|
23
24
|
import { EMPTY_ROW_STYLES } from "./empty-row.js";
|
|
24
25
|
import { c } from "react/compiler-runtime";
|
|
25
26
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
26
|
-
import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
27
|
+
import { forwardRef, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef } from "react";
|
|
27
28
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
-
import { mergeProps, useDraggableItem, useDropIndicator, useFocusRing, useKeyboard, useListBox, useListBoxSection, useOption } from "react-aria";
|
|
29
|
+
import { VisuallyHidden, mergeProps, useDraggableItem, useDropIndicator, useFocusRing, useKeyboard, useListBox, useListBoxSection, useOption } from "react-aria";
|
|
29
30
|
import { Section, useListState } from "react-stately";
|
|
30
31
|
import { useHover as useHover$1 } from "@react-aria/interactions";
|
|
31
32
|
import { IconMinus } from "@tabler/icons-react";
|
|
32
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
33
|
+
import { elementScroll, observeElementOffset, useVirtualizer } from "@tanstack/react-virtual";
|
|
33
34
|
//#region src/components/fields/ListBox/ListBox.tsx
|
|
34
35
|
const ListBoxWrapperElement = tasty({
|
|
35
36
|
qa: "ListBox",
|
|
@@ -168,6 +169,25 @@ const ListBoxDropIndicatorElement = tasty({
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
});
|
|
172
|
+
const LoadMoreSentinelElement = tasty({
|
|
173
|
+
as: "li",
|
|
174
|
+
styles: {
|
|
175
|
+
display: "block",
|
|
176
|
+
height: 0,
|
|
177
|
+
margin: {
|
|
178
|
+
"": "(-1 * $list-gap) top",
|
|
179
|
+
"virtualized | sections": 0
|
|
180
|
+
},
|
|
181
|
+
position: {
|
|
182
|
+
"": false,
|
|
183
|
+
virtualized: "absolute"
|
|
184
|
+
},
|
|
185
|
+
inset: {
|
|
186
|
+
"": false,
|
|
187
|
+
virtualized: "$list-virtual-height 0 auto 0"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
171
191
|
const SectionWrapperElement = tasty({
|
|
172
192
|
as: "li",
|
|
173
193
|
styles: { display: "block" }
|
|
@@ -250,6 +270,19 @@ function renderCheckboxIcon({ isSelected, isDisabled, isFocused, isHovered, isIn
|
|
|
250
270
|
})
|
|
251
271
|
});
|
|
252
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Where a list starts in its scroll element: below its own top margin. From
|
|
275
|
+
* layout, not client rects: a scaled ancestor (a popover's opening animation,
|
|
276
|
+
* a zoomed page) scales those but not the scroll offset.
|
|
277
|
+
*/
|
|
278
|
+
function getListOffset(list, scrollElement) {
|
|
279
|
+
if (!list || !scrollElement) return 0;
|
|
280
|
+
return list.offsetParent === scrollElement ? list.offsetTop : list.offsetTop - scrollElement.offsetTop - scrollElement.clientTop;
|
|
281
|
+
}
|
|
282
|
+
/** The loading row's key, for the virtualizer and React. */
|
|
283
|
+
const LOADING_ROW_KEY = "__ListBoxLoadingMore__";
|
|
284
|
+
/** The least `loadMoreMargin` defaults to, in pixels, for a short list. */
|
|
285
|
+
const MIN_LOAD_MORE_MARGIN = 200;
|
|
253
286
|
/** A collection with no options, for a list state that isn't needed. */
|
|
254
287
|
const NO_OPTIONS = {
|
|
255
288
|
children: [],
|
|
@@ -494,7 +527,7 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
494
527
|
return fieldProps;
|
|
495
528
|
} });
|
|
496
529
|
const { t } = useI18n();
|
|
497
|
-
let { qa, label, extra, id, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, listStyles, optionStyles, optionHighlight, sectionStyles, headingStyles, listGap, listRef, message, description, styles, mods: externalMods, size = "medium", labelSuffix, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, shouldUseVirtualFocus, isFocusWithin, onSelectionChange, disableSelectionToggle = false, allowDuplicateSelectionEvents, stateRef, focusOnHover, header, footer, headerStyles, footerStyles, onEscape, isCheckable, onOptionClick, showSelectAll, selectAllLabel, allValueProps, filter, emptyLabel = t("listBox.noItems", "No items"), shape = "card", isReorderable = false, onReorder, form } = props;
|
|
530
|
+
let { qa, label, extra, id, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, listStyles, optionStyles, optionHighlight, sectionStyles, headingStyles, listGap, listRef, message, description, styles, mods: externalMods, size = "medium", labelSuffix, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, shouldUseVirtualFocus, isFocusWithin, onSelectionChange, disableSelectionToggle = false, allowDuplicateSelectionEvents, stateRef, focusOnHover, header, footer, headerStyles, footerStyles, onEscape, isCheckable, onOptionClick, showSelectAll, selectAllLabel, allValueProps, filter, emptyLabel = t("listBox.noItems", "No items"), shape = "card", isReorderable = false, onReorder, onLoadMore, hasMore = false, isLoadingMore = false, loadMoreMargin, form } = props;
|
|
498
531
|
const lastSelectedKeyRef = useRef(null);
|
|
499
532
|
const externalSelectionHandler = onSelectionChange || props.onChange;
|
|
500
533
|
const wrappedOnSelectionChange = useMemo(() => {
|
|
@@ -588,9 +621,11 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
588
621
|
const itemsArray = useMemo(() => [...listState.collection], [listState.collection]);
|
|
589
622
|
const hasSections = useMemo(() => itemsArray.some((i) => i.type === "section"), [itemsArray]);
|
|
590
623
|
const shouldVirtualize = !hasSections && !isReorderable;
|
|
624
|
+
const canLoadMore = !!onLoadMore && hasMore;
|
|
591
625
|
const { listBoxProps, labelProps } = useListBox({
|
|
592
626
|
...props,
|
|
593
627
|
id,
|
|
628
|
+
shouldFocusWrap: props.shouldFocusWrap && !canLoadMore,
|
|
594
629
|
isVirtualized: !isReorderable,
|
|
595
630
|
shouldUseVirtualFocus: shouldUseVirtualFocus ?? false,
|
|
596
631
|
escapeKeyBehavior: onEscape ? "none" : "clearSelection",
|
|
@@ -601,17 +636,20 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
601
636
|
const { isFocused: isSelectAllFocused, focusProps: selectAllFocusProps } = useFocus$1();
|
|
602
637
|
const isListFocused = !isSelectAllFocused && (isFocusWithin ?? (shouldUseVirtualFocus || listState.selectionManager.isFocused));
|
|
603
638
|
const scrollRef = useRef(null);
|
|
639
|
+
const listOffset = () => getListOffset(listRef.current, scrollRef.current);
|
|
604
640
|
const rowVirtualizer = useVirtualizer({
|
|
605
|
-
count: shouldVirtualize ? itemsArray.length : 0,
|
|
641
|
+
count: shouldVirtualize ? itemsArray.length + (isLoadingMore ? 1 : 0) : 0,
|
|
606
642
|
getScrollElement: () => scrollRef.current,
|
|
607
|
-
getItemKey: (index) => itemsArray[index]?.key ??
|
|
643
|
+
getItemKey: (index) => itemsArray[index]?.key ?? LOADING_ROW_KEY,
|
|
608
644
|
estimateSize: (index_0) => {
|
|
609
645
|
const currentItem = itemsArray[index_0];
|
|
610
646
|
if (currentItem?.props?.description) return SIZES.XL;
|
|
611
647
|
return SIZES[SIZE_NAME_TO_KEY[currentItem?.props?.size] ?? SIZE_NAME_TO_KEY[size]];
|
|
612
648
|
},
|
|
613
649
|
gap: listGap ?? 1,
|
|
614
|
-
overscan: 10
|
|
650
|
+
overscan: 10,
|
|
651
|
+
observeElementOffset: (instance, onOffset) => observeElementOffset(instance, (offset, isScrolling) => onOffset(Math.max(offset - listOffset(), 0), isScrolling)),
|
|
652
|
+
scrollToFn: (offset_0, options, instance_0) => elementScroll(offset_0 > 0 ? offset_0 + listOffset() : offset_0, options, instance_0)
|
|
615
653
|
});
|
|
616
654
|
useEffect(() => {
|
|
617
655
|
if (shouldVirtualize) rowVirtualizer.measure();
|
|
@@ -651,16 +689,49 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
651
689
|
shouldVirtualize,
|
|
652
690
|
rowVirtualizer
|
|
653
691
|
]);
|
|
692
|
+
const sentinelRef = useRef(null);
|
|
693
|
+
const loadMore = useEffectEvent(() => onLoadMore?.());
|
|
694
|
+
useEffect(() => {
|
|
695
|
+
const root = scrollRef.current;
|
|
696
|
+
const sentinel = sentinelRef.current;
|
|
697
|
+
if (!canLoadMore || isLoadingMore || !root || !sentinel) return;
|
|
698
|
+
if (typeof IntersectionObserver === "undefined") return;
|
|
699
|
+
const margin = loadMoreMargin ?? Math.max(root.clientHeight, MIN_LOAD_MORE_MARGIN);
|
|
700
|
+
const observer = new IntersectionObserver((entries) => {
|
|
701
|
+
if (entries.some((entry) => entry.isIntersecting)) loadMore();
|
|
702
|
+
}, {
|
|
703
|
+
root,
|
|
704
|
+
rootMargin: `0px 0px ${margin}px 0px`
|
|
705
|
+
});
|
|
706
|
+
observer.observe(sentinel);
|
|
707
|
+
return () => observer.disconnect();
|
|
708
|
+
}, [
|
|
709
|
+
canLoadMore,
|
|
710
|
+
isLoadingMore,
|
|
711
|
+
loadMoreMargin,
|
|
712
|
+
itemsArray.length
|
|
713
|
+
]);
|
|
714
|
+
const loadingRowRef = useRef(null);
|
|
715
|
+
useLayoutEffect(() => {
|
|
716
|
+
const scrollElement_0 = scrollRef.current;
|
|
717
|
+
const row = loadingRowRef.current;
|
|
718
|
+
if (!isLoadingMore || !scrollElement_0 || !row) return;
|
|
719
|
+
const { scrollTop: scrollTop_0, scrollHeight, clientHeight } = scrollElement_0;
|
|
720
|
+
const rowBlock = row.offsetHeight + (listGap ?? 1);
|
|
721
|
+
if (scrollHeight - scrollTop_0 - clientHeight <= rowBlock + 1) scrollElement_0.scrollTop = scrollHeight;
|
|
722
|
+
}, [isLoadingMore, listGap]);
|
|
654
723
|
const mergedListBoxProps = mergeProps$1(listBoxProps, keyboardProps, listElementFocusProps, { "aria-invalid": isInvalid || void 0 });
|
|
655
724
|
if (isDisabled) delete mergedListBoxProps.tabIndex;
|
|
656
|
-
const
|
|
725
|
+
const hasNoOptions = listState.collection.size === 0;
|
|
726
|
+
const isEmpty = hasNoOptions && !isLoadingMore;
|
|
657
727
|
const emptyLabelId = `${listBoxProps.id}-empty`;
|
|
658
|
-
|
|
728
|
+
const loadingMoreLabelId = `${listBoxProps.id}-loading-more`;
|
|
729
|
+
if (hasNoOptions) mergedListBoxProps["aria-describedby"] = [mergedListBoxProps["aria-describedby"], isEmpty ? emptyLabelId : loadingMoreLabelId].filter(Boolean).join(" ");
|
|
659
730
|
const orderedKeys = useMemo(() => {
|
|
660
731
|
if (!isReorderable) return [];
|
|
661
732
|
return itemsArray.filter((i_0) => i_0.type === "item").map((i_1) => String(i_1.key));
|
|
662
733
|
}, [isReorderable, itemsArray]);
|
|
663
|
-
const isCardFocused = isFocused ||
|
|
734
|
+
const isCardFocused = isFocused || hasNoOptions && isListElementFocused;
|
|
664
735
|
const mods = useMemo(() => ({
|
|
665
736
|
...getValidationMods({
|
|
666
737
|
isInvalid,
|
|
@@ -684,6 +755,22 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
684
755
|
]);
|
|
685
756
|
const customizationProps = pickBaseCustomizationProps(props);
|
|
686
757
|
const listGapTokens = listGap == null ? void 0 : { "$list-gap": `${listGap}px` };
|
|
758
|
+
const loadingMoreLabel = t("listBox.loadingMore", "Loading more…");
|
|
759
|
+
const loadMoreSentinel = canLoadMore ? /* @__PURE__ */ jsx(LoadMoreSentinelElement, {
|
|
760
|
+
ref: sentinelRef,
|
|
761
|
+
qa: "ListBoxLoadMoreSentinel",
|
|
762
|
+
role: "presentation",
|
|
763
|
+
"aria-hidden": "true",
|
|
764
|
+
mods: {
|
|
765
|
+
virtualized: shouldVirtualize,
|
|
766
|
+
sections: hasSections
|
|
767
|
+
}
|
|
768
|
+
}) : null;
|
|
769
|
+
const loadingMoreRow = isLoadingMore && !shouldVirtualize ? /* @__PURE__ */ jsx(LoadingMoreRow, {
|
|
770
|
+
rowRef: loadingRowRef,
|
|
771
|
+
size,
|
|
772
|
+
label: loadingMoreLabel
|
|
773
|
+
}) : null;
|
|
687
774
|
const listBoxField = /* @__PURE__ */ jsxs(ListBoxWrapperElement, {
|
|
688
775
|
ref,
|
|
689
776
|
qa: "ListBoxWrapper",
|
|
@@ -725,7 +812,7 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
725
812
|
listRef,
|
|
726
813
|
orderedKeys,
|
|
727
814
|
onReorder,
|
|
728
|
-
children: (dragState, dropState, collectionProps) => /* @__PURE__ */
|
|
815
|
+
children: (dragState, dropState, collectionProps) => /* @__PURE__ */ jsxs(ListElement, {
|
|
729
816
|
...customizationProps,
|
|
730
817
|
qa: qa || "ListBox",
|
|
731
818
|
...mergeProps$1(mergedListBoxProps, withoutWholeListDropProps(collectionProps)),
|
|
@@ -742,25 +829,29 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
742
829
|
},
|
|
743
830
|
"data-shape": shape,
|
|
744
831
|
"data-input-type": "listbox",
|
|
745
|
-
children:
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
832
|
+
children: [
|
|
833
|
+
itemsArray.filter((item_0) => item_0.type === "item").map((item_1) => /* @__PURE__ */ jsx(Option, {
|
|
834
|
+
size,
|
|
835
|
+
item: item_1,
|
|
836
|
+
state: listState,
|
|
837
|
+
styles: optionStyles,
|
|
838
|
+
highlight: optionHighlight,
|
|
839
|
+
isParentDisabled: isDisabled,
|
|
840
|
+
isInvalid,
|
|
841
|
+
isValid,
|
|
842
|
+
focusOnHover,
|
|
843
|
+
isListFocused,
|
|
844
|
+
isCheckable,
|
|
845
|
+
lastFocusSourceRef,
|
|
846
|
+
dragState,
|
|
847
|
+
dropState,
|
|
848
|
+
onClick: onOptionClick
|
|
849
|
+
}, item_1.key)),
|
|
850
|
+
loadingMoreRow,
|
|
851
|
+
loadMoreSentinel
|
|
852
|
+
]
|
|
762
853
|
})
|
|
763
|
-
}) : /* @__PURE__ */
|
|
854
|
+
}) : /* @__PURE__ */ jsxs(ListElement, {
|
|
764
855
|
...customizationProps,
|
|
765
856
|
qa: qa || "ListBox",
|
|
766
857
|
...mergedListBoxProps,
|
|
@@ -780,73 +871,90 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
780
871
|
},
|
|
781
872
|
"data-shape": shape,
|
|
782
873
|
"data-input-type": "listbox",
|
|
783
|
-
children:
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
virtualRef: rowVirtualizer.measureElement,
|
|
798
|
-
virtualOffset: virtualItem.start,
|
|
799
|
-
virtualIndex: virtualItem.index,
|
|
800
|
-
lastFocusSourceRef,
|
|
801
|
-
onClick: onOptionClick
|
|
802
|
-
}, item_2.key);
|
|
803
|
-
}) : (() => {
|
|
804
|
-
const renderedItems = [];
|
|
805
|
-
let isFirstSection = true;
|
|
806
|
-
for (const item_3 of listState.collection) if (item_3.type === "section") {
|
|
807
|
-
if (!isFirstSection) renderedItems.push(/* @__PURE__ */ jsx(StyledDivider, { role: "presentation" }, `divider-${String(item_3.key)}`));
|
|
808
|
-
renderedItems.push(/* @__PURE__ */ jsx(ListBoxSection, {
|
|
809
|
-
item: item_3,
|
|
874
|
+
children: [
|
|
875
|
+
shouldVirtualize ? rowVirtualizer.getVirtualItems().map((virtualItem) => {
|
|
876
|
+
const item_2 = itemsArray[virtualItem.index];
|
|
877
|
+
if (!item_2) return /* @__PURE__ */ jsx(LoadingMoreRow, {
|
|
878
|
+
rowRef: loadingRowRef,
|
|
879
|
+
size,
|
|
880
|
+
label: loadingMoreLabel,
|
|
881
|
+
virtualRef: rowVirtualizer.measureElement,
|
|
882
|
+
virtualOffset: virtualItem.start,
|
|
883
|
+
virtualIndex: virtualItem.index
|
|
884
|
+
}, LOADING_ROW_KEY);
|
|
885
|
+
return /* @__PURE__ */ jsx(Option, {
|
|
886
|
+
size,
|
|
887
|
+
item: item_2,
|
|
810
888
|
state: listState,
|
|
811
|
-
optionStyles,
|
|
812
|
-
optionHighlight,
|
|
813
|
-
headingStyles,
|
|
814
|
-
sectionStyles,
|
|
889
|
+
styles: optionStyles,
|
|
890
|
+
highlight: optionHighlight,
|
|
815
891
|
isParentDisabled: isDisabled,
|
|
816
892
|
isInvalid,
|
|
817
893
|
isValid,
|
|
818
894
|
focusOnHover,
|
|
819
895
|
isListFocused,
|
|
820
896
|
isCheckable,
|
|
897
|
+
virtualRef: rowVirtualizer.measureElement,
|
|
898
|
+
virtualOffset: virtualItem.start,
|
|
899
|
+
virtualIndex: virtualItem.index,
|
|
900
|
+
lastFocusSourceRef,
|
|
901
|
+
onClick: onOptionClick
|
|
902
|
+
}, item_2.key);
|
|
903
|
+
}) : (() => {
|
|
904
|
+
const renderedItems = [];
|
|
905
|
+
let isFirstSection = true;
|
|
906
|
+
for (const item_3 of listState.collection) if (item_3.type === "section") {
|
|
907
|
+
if (!isFirstSection) renderedItems.push(/* @__PURE__ */ jsx(StyledDivider, { role: "presentation" }, `divider-${String(item_3.key)}`));
|
|
908
|
+
renderedItems.push(/* @__PURE__ */ jsx(ListBoxSection, {
|
|
909
|
+
item: item_3,
|
|
910
|
+
state: listState,
|
|
911
|
+
optionStyles,
|
|
912
|
+
optionHighlight,
|
|
913
|
+
headingStyles,
|
|
914
|
+
sectionStyles,
|
|
915
|
+
isParentDisabled: isDisabled,
|
|
916
|
+
isInvalid,
|
|
917
|
+
isValid,
|
|
918
|
+
focusOnHover,
|
|
919
|
+
isListFocused,
|
|
920
|
+
isCheckable,
|
|
921
|
+
size,
|
|
922
|
+
lastFocusSourceRef,
|
|
923
|
+
onClick: onOptionClick
|
|
924
|
+
}, item_3.key));
|
|
925
|
+
isFirstSection = false;
|
|
926
|
+
} else renderedItems.push(/* @__PURE__ */ jsx(Option, {
|
|
821
927
|
size,
|
|
928
|
+
item: item_3,
|
|
929
|
+
state: listState,
|
|
930
|
+
styles: optionStyles,
|
|
931
|
+
highlight: optionHighlight,
|
|
932
|
+
isParentDisabled: isDisabled,
|
|
933
|
+
isInvalid,
|
|
934
|
+
isValid,
|
|
935
|
+
focusOnHover,
|
|
936
|
+
isListFocused,
|
|
937
|
+
isCheckable,
|
|
822
938
|
lastFocusSourceRef,
|
|
823
939
|
onClick: onOptionClick
|
|
824
940
|
}, item_3.key));
|
|
825
|
-
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
styles: optionStyles,
|
|
831
|
-
highlight: optionHighlight,
|
|
832
|
-
isParentDisabled: isDisabled,
|
|
833
|
-
isInvalid,
|
|
834
|
-
isValid,
|
|
835
|
-
focusOnHover,
|
|
836
|
-
isListFocused,
|
|
837
|
-
isCheckable,
|
|
838
|
-
lastFocusSourceRef,
|
|
839
|
-
onClick: onOptionClick
|
|
840
|
-
}, item_3.key));
|
|
841
|
-
return renderedItems;
|
|
842
|
-
})()
|
|
941
|
+
return renderedItems;
|
|
942
|
+
})(),
|
|
943
|
+
loadingMoreRow,
|
|
944
|
+
loadMoreSentinel
|
|
945
|
+
]
|
|
843
946
|
})]
|
|
844
947
|
}),
|
|
845
948
|
footer ? /* @__PURE__ */ jsx(StyledFooter, {
|
|
846
949
|
styles: footerStyles,
|
|
847
950
|
"data-size": size,
|
|
848
951
|
children: footer
|
|
849
|
-
}) : /* @__PURE__ */ jsx("div", { role: "presentation" })
|
|
952
|
+
}) : /* @__PURE__ */ jsx("div", { role: "presentation" }),
|
|
953
|
+
onLoadMore || isLoadingMore ? /* @__PURE__ */ jsx(LoadingMoreStatus, {
|
|
954
|
+
id: loadingMoreLabelId,
|
|
955
|
+
label: loadingMoreLabel,
|
|
956
|
+
isLoading: isLoadingMore
|
|
957
|
+
}) : null
|
|
850
958
|
]
|
|
851
959
|
});
|
|
852
960
|
return wrapWithField(listBoxField, {
|
|
@@ -994,6 +1102,92 @@ function Option({ size = "medium", item, state, styles, highlight, isParentDisab
|
|
|
994
1102
|
})
|
|
995
1103
|
] });
|
|
996
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* The row after the last option while more options load. Not an option, so a
|
|
1107
|
+
* viewer can neither focus nor select it, and hidden from assistive tech: the
|
|
1108
|
+
* list's status region announces the loading instead.
|
|
1109
|
+
*/
|
|
1110
|
+
function LoadingMoreRow(t0) {
|
|
1111
|
+
const $ = c(15);
|
|
1112
|
+
const { size, label, rowRef, virtualRef, virtualOffset, virtualIndex } = t0;
|
|
1113
|
+
let t1;
|
|
1114
|
+
if ($[0] !== rowRef || $[1] !== virtualRef) {
|
|
1115
|
+
t1 = () => {
|
|
1116
|
+
virtualRef?.(rowRef.current);
|
|
1117
|
+
};
|
|
1118
|
+
$[0] = rowRef;
|
|
1119
|
+
$[1] = virtualRef;
|
|
1120
|
+
$[2] = t1;
|
|
1121
|
+
} else t1 = $[2];
|
|
1122
|
+
useLayoutEffect(t1);
|
|
1123
|
+
let t2;
|
|
1124
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1125
|
+
t2 = /* @__PURE__ */ jsx(LoadingIcon, {});
|
|
1126
|
+
$[3] = t2;
|
|
1127
|
+
} else t2 = $[3];
|
|
1128
|
+
const t3 = virtualOffset == null ? void 0 : `${virtualOffset}px`;
|
|
1129
|
+
let t4;
|
|
1130
|
+
if ($[4] !== t3) {
|
|
1131
|
+
t4 = { "$option-virtual-offset": t3 };
|
|
1132
|
+
$[4] = t3;
|
|
1133
|
+
$[5] = t4;
|
|
1134
|
+
} else t4 = $[5];
|
|
1135
|
+
const t5 = virtualOffset != null;
|
|
1136
|
+
let t6;
|
|
1137
|
+
if ($[6] !== t5) {
|
|
1138
|
+
t6 = { virtual: t5 };
|
|
1139
|
+
$[6] = t5;
|
|
1140
|
+
$[7] = t6;
|
|
1141
|
+
} else t6 = $[7];
|
|
1142
|
+
let t7;
|
|
1143
|
+
if ($[8] !== label || $[9] !== rowRef || $[10] !== size || $[11] !== t4 || $[12] !== t6 || $[13] !== virtualIndex) {
|
|
1144
|
+
t7 = /* @__PURE__ */ jsx(ListBoxItem, {
|
|
1145
|
+
ref: rowRef,
|
|
1146
|
+
qa: "ListBoxLoadingMore",
|
|
1147
|
+
"aria-hidden": "true",
|
|
1148
|
+
"data-size": size,
|
|
1149
|
+
"data-index": virtualIndex,
|
|
1150
|
+
size,
|
|
1151
|
+
preset: "t4",
|
|
1152
|
+
color: "#surface-text-soft-2",
|
|
1153
|
+
icon: t2,
|
|
1154
|
+
tokens: t4,
|
|
1155
|
+
mods: t6,
|
|
1156
|
+
children: label
|
|
1157
|
+
});
|
|
1158
|
+
$[8] = label;
|
|
1159
|
+
$[9] = rowRef;
|
|
1160
|
+
$[10] = size;
|
|
1161
|
+
$[11] = t4;
|
|
1162
|
+
$[12] = t6;
|
|
1163
|
+
$[13] = virtualIndex;
|
|
1164
|
+
$[14] = t7;
|
|
1165
|
+
} else t7 = $[14];
|
|
1166
|
+
return t7;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Tells screen readers that more options are loading. Filled while they load,
|
|
1170
|
+
* and empty otherwise rather than gone: a live region announces a change of its
|
|
1171
|
+
* text, and one inserted already filled is unreliable. Outside the listbox,
|
|
1172
|
+
* which may hold only options and groups.
|
|
1173
|
+
*/
|
|
1174
|
+
function LoadingMoreStatus(t0) {
|
|
1175
|
+
const $ = c(3);
|
|
1176
|
+
const { id, label, isLoading } = t0;
|
|
1177
|
+
const t1 = isLoading ? label : "";
|
|
1178
|
+
let t2;
|
|
1179
|
+
if ($[0] !== id || $[1] !== t1) {
|
|
1180
|
+
t2 = /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", {
|
|
1181
|
+
id,
|
|
1182
|
+
role: "status",
|
|
1183
|
+
children: t1
|
|
1184
|
+
}) });
|
|
1185
|
+
$[0] = id;
|
|
1186
|
+
$[1] = t1;
|
|
1187
|
+
$[2] = t2;
|
|
1188
|
+
} else t2 = $[2];
|
|
1189
|
+
return t2;
|
|
1190
|
+
}
|
|
997
1191
|
function ListBoxDropIndicator(t0) {
|
|
998
1192
|
const $ = c(8);
|
|
999
1193
|
const { target, dropState } = t0;
|