@astryxdesign/core 0.1.6 → 0.1.7-canary.04cd8f7
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/CHANGELOG.md +68 -0
- package/README.md +25 -14
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +4 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +4 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +8 -6
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +4 -1
- package/dist/Button/Button.d.ts +10 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +49 -6
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +27 -11
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +29 -7
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +8 -5
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -1
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +9 -2
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +6 -2
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +6 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -2
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +8 -2
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +3 -1
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +3 -1
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +13 -8
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +12 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +43 -6
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +4 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +4 -2
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +3 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +3 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +10 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +71 -53
- package/dist/Collapsible/Collapsible.d.ts +11 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +36 -4
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +8 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +4 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +4 -1
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +8 -4
- package/dist/ContextMenu/index.d.ts +3 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +7 -1
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +10 -5
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +11 -6
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +15 -7
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +15 -12
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +7 -3
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +19 -9
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +89 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +170 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +70 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
- package/dist/DropdownMenu/index.d.ts +5 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +10 -1
- package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemRoles.js +15 -0
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +11 -1
- package/dist/Icon/Icon.d.ts +17 -12
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +28 -20
- package/dist/Kbd/Kbd.js +1 -1
- package/dist/Layer/useLayer.d.ts +10 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +23 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +6 -4
- package/dist/Link/Link.d.ts +5 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +32 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +10 -8
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +4 -2
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -1
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -1
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +13 -6
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +5 -1
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -1
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +38 -11
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +4 -1
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +22 -12
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +26 -20
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +34 -21
- package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +19 -9
- package/dist/PowerSearch/index.d.ts +2 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/index.js +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
- package/dist/PowerSearch/types.d.ts +28 -2
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +15 -8
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +4 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +52 -14
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +3 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +5 -3
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +7 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +6 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +5 -3
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +56 -19
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +12 -5
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +8 -6
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +1 -1
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +5 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +6 -4
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -2
- package/dist/Table/plugins/tree/index.d.ts +5 -0
- package/dist/Table/plugins/tree/index.d.ts.map +1 -0
- package/dist/Table/plugins/tree/index.js +4 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
- package/dist/Table/types.d.ts +17 -10
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +6 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +5 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +8 -2
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +7 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +18 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +3 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +8 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +3 -1
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +8 -1
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +4 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +5 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +8 -4
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -0
- package/dist/astryx.css +38 -4
- package/dist/astryx.umd.js +62 -60
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts +145 -0
- package/dist/authoring/doc.d.ts.map +1 -0
- package/dist/authoring/doc.js +100 -0
- package/dist/authoring/index.d.ts +29 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +28 -0
- package/dist/authoring/integration.d.ts +35 -0
- package/dist/authoring/integration.d.ts.map +1 -0
- package/dist/authoring/integration.js +30 -0
- package/dist/authoring/template.d.ts +66 -0
- package/dist/authoring/template.d.ts.map +1 -0
- package/dist/authoring/template.js +55 -0
- package/dist/config.d.ts +80 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +40 -0
- package/dist/docs-types.d.ts +13 -4
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.d.ts +12 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
- package/dist/i18n/InternationalizationContext.js +29 -0
- package/dist/i18n/InternationalizationProvider.d.ts +61 -0
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
- package/dist/i18n/InternationalizationProvider.js +44 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +21 -0
- package/dist/i18n/resolve.d.ts +22 -0
- package/dist/i18n/resolve.d.ts.map +1 -0
- package/dist/i18n/resolve.js +141 -0
- package/dist/i18n/translator.d.ts +25 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n/translator.js +1 -0
- package/dist/i18n/types.d.ts +47 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/i18n/useTranslator.d.ts +15 -0
- package/dist/i18n/useTranslator.d.ts.map +1 -0
- package/dist/i18n/useTranslator.js +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/theme/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +0 -3
- package/dist/utils/color.d.ts +13 -1
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +23 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/locales/en.json +754 -0
- package/locales/pseudo.json +566 -0
- package/package.json +23 -2
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- package/src/AppShell/AppShell.doc.mjs +8 -2
- package/src/AppShell/AppShell.tsx +3 -1
- package/src/AvatarGroup/AvatarGroup.tsx +4 -1
- package/src/Banner/Banner.tsx +10 -5
- package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
- package/src/Button/Button.doc.mjs +8 -0
- package/src/Button/Button.test.tsx +27 -0
- package/src/Button/Button.tsx +51 -5
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.test.tsx +103 -2
- package/src/Calendar/Calendar.tsx +29 -6
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Carousel/Carousel.tsx +10 -7
- package/src/Chat/ChatComposer.tsx +5 -1
- package/src/Chat/ChatComposerDrawer.tsx +9 -2
- package/src/Chat/ChatComposerInput.tsx +10 -4
- package/src/Chat/ChatLayout.test.tsx +127 -2
- package/src/Chat/ChatLayout.tsx +5 -12
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/ChatMessage.tsx +5 -1
- package/src/Chat/ChatMessageBubble.tsx +2 -0
- package/src/Chat/ChatMessageList.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.tsx +2 -0
- package/src/Chat/ChatMessageMetadata.tsx +15 -9
- package/src/Chat/ChatPastedTextToken.tsx +3 -1
- package/src/Chat/ChatSendButton.tsx +3 -1
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/index.ts +1 -0
- package/src/Chat/useChatStreamScroll.test.tsx +168 -0
- package/src/Chat/useChatStreamScroll.ts +67 -11
- package/src/Chat/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
- package/src/CheckboxInput/CheckboxInput.tsx +4 -2
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
- package/src/CheckboxList/CheckboxList.tsx +2 -0
- package/src/CheckboxList/CheckboxListItem.tsx +7 -1
- package/src/Citation/Citation.tsx +4 -2
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
- package/src/CodeBlock/CodeBlock.tsx +91 -40
- package/src/Collapsible/Collapsible.doc.mjs +7 -0
- package/src/Collapsible/Collapsible.test.tsx +80 -0
- package/src/Collapsible/Collapsible.tsx +58 -5
- package/src/CommandPalette/CommandPalette.tsx +10 -3
- package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
- package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
- package/src/CommandPalette/CommandPaletteList.tsx +4 -1
- package/src/ContextMenu/ContextMenu.test.tsx +75 -1
- package/src/ContextMenu/ContextMenu.tsx +14 -6
- package/src/ContextMenu/index.ts +15 -0
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.test.tsx +17 -5
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.tsx +14 -6
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +17 -7
- package/src/Dialog/Dialog.tsx +11 -15
- package/src/Dialog/DialogHeader.tsx +7 -3
- package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
- package/src/DropdownMenu/DropdownMenu.tsx +23 -14
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +237 -0
- package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +119 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
- package/src/DropdownMenu/index.ts +23 -3
- package/src/DropdownMenu/menuItemRoles.ts +22 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +3 -3
- package/src/Field/FieldLabel.doc.mjs +1 -1
- package/src/FileInput/FileInput.test.tsx +40 -1
- package/src/FileInput/FileInput.tsx +12 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/Icon/Icon.test.tsx +46 -0
- package/src/Icon/Icon.tsx +37 -24
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Kbd/Kbd.test.tsx +26 -0
- package/src/Kbd/Kbd.tsx +1 -1
- package/src/Layer/useLayer.doc.mjs +8 -5
- package/src/Layer/useLayer.test.tsx +136 -1
- package/src/Layer/useLayer.tsx +34 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -1
- package/src/Markdown/Markdown.tsx +12 -4
- package/src/MobileNav/MobileNav.tsx +4 -2
- package/src/MobileNav/MobileNavToggle.tsx +5 -3
- package/src/MoreMenu/MoreMenu.tsx +4 -1
- package/src/MultiSelector/MultiSelector.tsx +14 -5
- package/src/NumberInput/NumberInput.doc.mjs +2 -2
- package/src/NumberInput/NumberInput.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Pagination/Pagination.tsx +35 -12
- package/src/Popover/usePopover.tsx +6 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
- package/src/PowerSearch/PowerSearch.tsx +22 -10
- package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
- package/src/PowerSearch/PowerSearchToken.tsx +17 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
- package/src/PowerSearch/formatFilterValue.test.ts +282 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -8
- package/src/PowerSearch/index.ts +5 -0
- package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
- package/src/PowerSearch/types.ts +33 -9
- package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
- package/src/PowerSearch/usePowerSearchSource.ts +17 -8
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/Resizable/ResizeHandle.tsx +4 -1
- package/src/Section/Section.doc.mjs +4 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.doc.mjs +6 -3
- package/src/Selector/Selector.test.tsx +114 -6
- package/src/Selector/Selector.tsx +68 -17
- package/src/Selector/SelectorOption.doc.mjs +1 -1
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavCollapseButton.tsx +3 -1
- package/src/SideNav/SideNavHeading.tsx +5 -3
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +3 -1
- package/src/Slider/Slider.doc.mjs +2 -2
- package/src/Stack/Stack.doc.mjs +10 -10
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +66 -0
- package/src/TabList/TabList.tsx +12 -1
- package/src/TabList/TabMenu.tsx +4 -1
- package/src/Table/BaseTable.tsx +36 -19
- package/src/Table/Table.doc.mjs +2 -0
- package/src/Table/Table.test.tsx +132 -1
- package/src/Table/Table.tsx +6 -4
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +7 -5
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -8
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -1
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +4 -4
- package/src/Table/plugins/tree/index.ts +12 -0
- package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
- package/src/Table/types.ts +18 -12
- package/src/Table/useBaseTablePlugins.ts +6 -2
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +3 -3
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Table/useTableTreeData.doc.mjs +75 -0
- package/src/Table/useTableTreeState.doc.mjs +98 -0
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextInput/TextInput.doc.mjs +1 -1
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +4 -2
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.tsx +6 -2
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +120 -7
- package/src/Timestamp/Timestamp.tsx +21 -1
- package/src/Toast/Toast.tsx +3 -1
- package/src/Toast/ToastViewport.tsx +3 -1
- package/src/Token/Token.tsx +4 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.tsx +4 -4
- package/src/Toolbar/Toolbar.doc.mjs +1 -1
- package/src/Toolbar/Toolbar.tsx +10 -3
- package/src/TopNav/TopNav.doc.mjs +1 -0
- package/src/TopNav/TopNav.test.tsx +30 -0
- package/src/TopNav/TopNav.tsx +6 -4
- package/src/TopNav/TopNavHeading.tsx +5 -3
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListItem.tsx +6 -1
- package/src/Typeahead/BaseTypeahead.tsx +11 -4
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.tsx +3 -1
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
- package/src/authoring/doc.ts +166 -0
- package/src/authoring/index.test.ts +52 -0
- package/src/authoring/index.ts +50 -0
- package/src/authoring/integration.ts +42 -0
- package/src/authoring/template.ts +74 -0
- package/src/config.test.ts +16 -0
- package/src/config.ts +92 -0
- package/src/docPropLiterals.test.ts +938 -0
- package/src/docs-types.ts +15 -10
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +82 -0
- package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
- package/src/i18n/__tests__/resolve.test.ts +284 -0
- package/src/i18n/index.ts +32 -0
- package/src/i18n/resolve.ts +165 -0
- package/src/i18n/translator.ts +31 -0
- package/src/i18n/types.ts +53 -0
- package/src/i18n/useTranslator.doc.mjs +46 -0
- package/src/i18n/useTranslator.ts +50 -0
- package/src/index.ts +3 -0
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +1 -1
- package/src/theme/hct.ts +0 -4
- package/src/utils/color.test.ts +101 -1
- package/src/utils/color.ts +23 -1
- package/src/utils/index.ts +8 -1
- package/dist/NavItem/index.d.ts +0 -9
- package/dist/NavItem/index.d.ts.map +0 -1
- package/dist/NavItem/index.js +0 -10
- package/src/NavItem/index.ts +0 -11
|
@@ -18,9 +18,11 @@ import { Selector } from "../Selector/index.js";
|
|
|
18
18
|
import { HStack, VStack } from "../Stack/index.js";
|
|
19
19
|
import { Icon } from "../Icon/index.js";
|
|
20
20
|
import { TreeList } from "../TreeList/index.js";
|
|
21
|
+
import { useTranslator } from "../i18n/index.js";
|
|
21
22
|
import "../theme/tokens.stylex.js";
|
|
22
23
|
import { spacingVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
23
24
|
import { PowerSearchValueEditor } from "./PowerSearchValueEditor.js";
|
|
25
|
+
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
24
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
27
|
// =============================================================================
|
|
26
28
|
// Editable filter state for recursive nesting
|
|
@@ -129,6 +131,7 @@ function NestedSubFilterRow({
|
|
|
129
131
|
onChange,
|
|
130
132
|
isReadOnly
|
|
131
133
|
}) {
|
|
134
|
+
const t = useTranslator();
|
|
132
135
|
const fieldOptions = useMemo(() => config.getVisibleFields().map(field => ({
|
|
133
136
|
value: field.key,
|
|
134
137
|
label: field.label
|
|
@@ -137,9 +140,9 @@ function NestedSubFilterRow({
|
|
|
137
140
|
const operators = config.getVisibleOperators(subFilter.field);
|
|
138
141
|
return operators.map(op => ({
|
|
139
142
|
value: op.key,
|
|
140
|
-
label: op
|
|
143
|
+
label: resolveOperatorLabel(op, t)
|
|
141
144
|
}));
|
|
142
|
-
}, [config, subFilter.field]);
|
|
145
|
+
}, [config, subFilter.field, t]);
|
|
143
146
|
const currentOperator = subFilter.operator ? config.getOperator(subFilter.field, subFilter.operator) : undefined;
|
|
144
147
|
const operatorValue = currentOperator?.value;
|
|
145
148
|
const isEmptyType = operatorValue?.type === 'empty';
|
|
@@ -179,7 +182,7 @@ function NestedSubFilterRow({
|
|
|
179
182
|
className: "x2lah0s x1oysuqx"
|
|
180
183
|
},
|
|
181
184
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
182
|
-
label:
|
|
185
|
+
label: t('@astryx.powersearch.editor.field'),
|
|
183
186
|
isLabelHidden: true,
|
|
184
187
|
options: fieldOptions,
|
|
185
188
|
value: subFilter.field,
|
|
@@ -192,7 +195,7 @@ function NestedSubFilterRow({
|
|
|
192
195
|
className: "x2lah0s xzjbwwf"
|
|
193
196
|
},
|
|
194
197
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
195
|
-
label:
|
|
198
|
+
label: t('@astryx.powersearch.editor.operator'),
|
|
196
199
|
isLabelHidden: true,
|
|
197
200
|
options: operatorOptions,
|
|
198
201
|
value: subFilter.operator,
|
|
@@ -227,6 +230,7 @@ function NestedEditor({
|
|
|
227
230
|
onPartialFilterChange,
|
|
228
231
|
isReadOnly
|
|
229
232
|
}) {
|
|
233
|
+
const t = useTranslator();
|
|
230
234
|
const [subFilters, setSubFilters] = useState(() => {
|
|
231
235
|
if (partialFilter.value && partialFilter.value.type === 'nested') {
|
|
232
236
|
return partialFilter.value.value.map(f => initEditableFilter(config, f));
|
|
@@ -294,7 +298,7 @@ function NestedEditor({
|
|
|
294
298
|
children.push({
|
|
295
299
|
id: `${itemPath.join('-')}-add`,
|
|
296
300
|
label: /*#__PURE__*/_jsx(Button, {
|
|
297
|
-
label:
|
|
301
|
+
label: t('@astryx.powersearch.editor.addFilter'),
|
|
298
302
|
onClick: () => handleAdd(itemPath),
|
|
299
303
|
variant: "ghost",
|
|
300
304
|
size: "sm"
|
|
@@ -312,7 +316,7 @@ function NestedEditor({
|
|
|
312
316
|
isExpanded: true,
|
|
313
317
|
children,
|
|
314
318
|
endContent: !isReadOnly ? /*#__PURE__*/_jsx(Button, {
|
|
315
|
-
label:
|
|
319
|
+
label: t('@astryx.powersearch.editor.removeFilter'),
|
|
316
320
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
317
321
|
icon: "close",
|
|
318
322
|
size: "sm"
|
|
@@ -334,7 +338,7 @@ function NestedEditor({
|
|
|
334
338
|
isReadOnly: isReadOnly
|
|
335
339
|
}),
|
|
336
340
|
endContent: !isReadOnly ? /*#__PURE__*/_jsx(Button, {
|
|
337
|
-
label:
|
|
341
|
+
label: t('@astryx.powersearch.editor.removeFilter'),
|
|
338
342
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
339
343
|
icon: "close",
|
|
340
344
|
size: "sm"
|
|
@@ -353,7 +357,7 @@ function NestedEditor({
|
|
|
353
357
|
treeChildren.push({
|
|
354
358
|
id: 'add-filter',
|
|
355
359
|
label: /*#__PURE__*/_jsx(Button, {
|
|
356
|
-
label:
|
|
360
|
+
label: t('@astryx.powersearch.editor.addFilter'),
|
|
357
361
|
onClick: () => handleAdd([]),
|
|
358
362
|
variant: "ghost",
|
|
359
363
|
size: "sm"
|
|
@@ -369,7 +373,7 @@ function NestedEditor({
|
|
|
369
373
|
className: "x1iyjqo2 x2lah0s"
|
|
370
374
|
},
|
|
371
375
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
372
|
-
label:
|
|
376
|
+
label: t('@astryx.powersearch.editor.groupOperator'),
|
|
373
377
|
isLabelHidden: true,
|
|
374
378
|
options: operatorOptions,
|
|
375
379
|
value: partialFilter.operator,
|
|
@@ -377,7 +381,7 @@ function NestedEditor({
|
|
|
377
381
|
isDisabled: isReadOnly,
|
|
378
382
|
size: "md"
|
|
379
383
|
})
|
|
380
|
-
}) : operatorOptions[0]?.label ?? '
|
|
384
|
+
}) : operatorOptions[0]?.label ?? t('@astryx.powersearch.editor.group')
|
|
381
385
|
});
|
|
382
386
|
const items = [{
|
|
383
387
|
id: 'nested-root',
|
|
@@ -401,9 +405,11 @@ export function PowerSearchEditPopover({
|
|
|
401
405
|
mode,
|
|
402
406
|
onSave,
|
|
403
407
|
onCancel,
|
|
404
|
-
saveButtonLabel
|
|
408
|
+
saveButtonLabel: saveButtonLabelFromProps,
|
|
405
409
|
isReadOnly = false
|
|
406
410
|
}) {
|
|
411
|
+
const t = useTranslator();
|
|
412
|
+
const saveButtonLabel = saveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
|
|
407
413
|
const [partialFilter, setPartialFilter] = useState(initialFilter);
|
|
408
414
|
const valueEditorRef = useRef(null);
|
|
409
415
|
|
|
@@ -432,9 +438,9 @@ export function PowerSearchEditPopover({
|
|
|
432
438
|
const operators = config.getVisibleOperators(partialFilter.field);
|
|
433
439
|
return operators.map(op => ({
|
|
434
440
|
value: op.key,
|
|
435
|
-
label: op
|
|
441
|
+
label: resolveOperatorLabel(op, t)
|
|
436
442
|
}));
|
|
437
|
-
}, [config, partialFilter.field]);
|
|
443
|
+
}, [config, partialFilter.field, t]);
|
|
438
444
|
const handleFieldChange = useCallback(fieldKey => {
|
|
439
445
|
const defaultOp = config.getDefaultOperator(fieldKey);
|
|
440
446
|
setPartialFilter({
|
|
@@ -531,7 +537,7 @@ export function PowerSearchEditPopover({
|
|
|
531
537
|
className: "x1iyjqo2 xs83m0k xeuugli"
|
|
532
538
|
},
|
|
533
539
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
534
|
-
label:
|
|
540
|
+
label: t('@astryx.powersearch.editor.field'),
|
|
535
541
|
isLabelHidden: true,
|
|
536
542
|
options: fieldOptions,
|
|
537
543
|
value: partialFilter.field,
|
|
@@ -557,14 +563,14 @@ export function PowerSearchEditPopover({
|
|
|
557
563
|
gap: 2,
|
|
558
564
|
hAlign: "between",
|
|
559
565
|
children: [!isReadOnly && mode === 'edit' ? /*#__PURE__*/_jsx(Button, {
|
|
560
|
-
label:
|
|
566
|
+
label: t('@astryx.powersearch.editor.delete'),
|
|
561
567
|
onClick: handleDelete,
|
|
562
568
|
variant: "ghost",
|
|
563
569
|
size: "sm"
|
|
564
570
|
}) : /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsxs(HStack, {
|
|
565
571
|
gap: 2,
|
|
566
572
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
567
|
-
label:
|
|
573
|
+
label: t('@astryx.powersearch.editor.cancel'),
|
|
568
574
|
onClick: onCancel,
|
|
569
575
|
variant: "ghost",
|
|
570
576
|
size: "sm"
|
|
@@ -596,7 +602,7 @@ export function PowerSearchEditPopover({
|
|
|
596
602
|
className: "x1iyjqo2 xs83m0k xeuugli"
|
|
597
603
|
},
|
|
598
604
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
599
|
-
label:
|
|
605
|
+
label: t('@astryx.powersearch.editor.field'),
|
|
600
606
|
isLabelHidden: true,
|
|
601
607
|
options: fieldOptions,
|
|
602
608
|
value: partialFilter.field,
|
|
@@ -609,7 +615,7 @@ export function PowerSearchEditPopover({
|
|
|
609
615
|
className: "x1iyjqo2 x2lah0s"
|
|
610
616
|
},
|
|
611
617
|
children: /*#__PURE__*/_jsx(Selector, {
|
|
612
|
-
label:
|
|
618
|
+
label: t('@astryx.powersearch.editor.operator'),
|
|
613
619
|
isLabelHidden: true,
|
|
614
620
|
options: operatorOptions,
|
|
615
621
|
value: partialFilter.operator,
|
|
@@ -640,14 +646,14 @@ export function PowerSearchEditPopover({
|
|
|
640
646
|
gap: 2,
|
|
641
647
|
hAlign: "between",
|
|
642
648
|
children: [!isReadOnly && mode === 'edit' ? /*#__PURE__*/_jsx(Button, {
|
|
643
|
-
label:
|
|
649
|
+
label: t('@astryx.powersearch.editor.delete'),
|
|
644
650
|
onClick: handleDelete,
|
|
645
651
|
variant: "ghost",
|
|
646
652
|
size: "sm"
|
|
647
653
|
}) : /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsxs(HStack, {
|
|
648
654
|
gap: 2,
|
|
649
655
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
650
|
-
label:
|
|
656
|
+
label: t('@astryx.powersearch.editor.cancel'),
|
|
651
657
|
onClick: onCancel,
|
|
652
658
|
variant: "ghost",
|
|
653
659
|
size: "sm"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAQnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,GACX,EAAE,qBAAqB,qBA4CvB;yBArDe,gBAAgB"}
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import * as stylex from '@stylexjs/stylex';
|
|
13
13
|
import { Token } from "../Token/index.js";
|
|
14
|
+
import { useTranslator } from "../i18n/index.js";
|
|
14
15
|
import "../theme/tokens.stylex.js";
|
|
15
16
|
import { fontWeightVars } from "../theme/tokens.stylex.js";
|
|
16
17
|
import { formatFilterValue } from "./formatFilterValue.js";
|
|
18
|
+
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
17
19
|
import { useInternalConfig } from "./useInternalConfig.js";
|
|
18
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
21
|
/**
|
|
@@ -34,11 +36,13 @@ export function PowerSearchToken({
|
|
|
34
36
|
isDisabled
|
|
35
37
|
}) {
|
|
36
38
|
const config = useInternalConfig(configProp);
|
|
39
|
+
const t = useTranslator();
|
|
37
40
|
const fieldLabel = field.label;
|
|
38
|
-
const
|
|
41
|
+
const resolvedOperatorLabel = resolveOperatorLabel(operator, t);
|
|
42
|
+
const operatorLabel = resolvedOperatorLabel ? `: ${resolvedOperatorLabel}` : '';
|
|
39
43
|
const tokenLabel = `${fieldLabel}${operatorLabel}`;
|
|
40
|
-
const adjustedMaxLength = Math.max(maxLength - fieldLabel.length -
|
|
41
|
-
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength);
|
|
44
|
+
const adjustedMaxLength = Math.max(maxLength - fieldLabel.length - resolvedOperatorLabel.length, 10);
|
|
45
|
+
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength, t);
|
|
42
46
|
const valueContent = valueStr ? /*#__PURE__*/_jsx("span", {
|
|
43
47
|
...{
|
|
44
48
|
className: "x1lvx875"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAGZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAGZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAexD,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAwkBD,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,2BAA2B,4BA0H7B"}
|
|
@@ -20,6 +20,7 @@ import { TimeInput } from "../TimeInput/index.js";
|
|
|
20
20
|
import { Selector } from "../Selector/index.js";
|
|
21
21
|
import { Tokenizer } from "../Tokenizer/index.js";
|
|
22
22
|
import { Typeahead } from "../Typeahead/index.js";
|
|
23
|
+
import { useTranslator } from "../i18n/index.js";
|
|
23
24
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
25
|
// =============================================================================
|
|
25
26
|
// Helpers
|
|
@@ -53,6 +54,7 @@ function StringEditor({
|
|
|
53
54
|
onChange,
|
|
54
55
|
onEnter: _onEnter
|
|
55
56
|
}) {
|
|
57
|
+
const t = useTranslator();
|
|
56
58
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
57
59
|
|
|
58
60
|
// When a searchSource is provided, render a typeahead instead of a plain
|
|
@@ -63,7 +65,7 @@ function StringEditor({
|
|
|
63
65
|
label: currentValue
|
|
64
66
|
} : null;
|
|
65
67
|
return /*#__PURE__*/_jsx(Typeahead, {
|
|
66
|
-
label:
|
|
68
|
+
label: t('@astryx.powersearch.valueEditor.value'),
|
|
67
69
|
isLabelHidden: true,
|
|
68
70
|
searchSource: operatorValue.searchSource,
|
|
69
71
|
value: selectedItem,
|
|
@@ -80,15 +82,15 @@ function StringEditor({
|
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
|
-
placeholder:
|
|
85
|
+
placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
|
|
84
86
|
debounceMs: 150
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
return /*#__PURE__*/_jsx(TextInput, {
|
|
88
|
-
label:
|
|
90
|
+
label: t('@astryx.powersearch.valueEditor.value'),
|
|
89
91
|
isLabelHidden: true,
|
|
90
92
|
value: currentValue,
|
|
91
|
-
placeholder:
|
|
93
|
+
placeholder: t('@astryx.powersearch.valueEditor.enterValuePlaceholder'),
|
|
92
94
|
onChange: value => {
|
|
93
95
|
onChange({
|
|
94
96
|
type: 'string',
|
|
@@ -102,6 +104,7 @@ function StringListEditor({
|
|
|
102
104
|
filterValue,
|
|
103
105
|
onChange
|
|
104
106
|
}) {
|
|
107
|
+
const t = useTranslator();
|
|
105
108
|
const currentValue = useMemo(() => {
|
|
106
109
|
if (filterValue?.type !== 'string_list') {
|
|
107
110
|
return [];
|
|
@@ -126,7 +129,7 @@ function StringListEditor({
|
|
|
126
129
|
// or when isArbitraryStringAllowed is explicitly set (#1107).
|
|
127
130
|
const hasCreate = operatorValue.isArbitraryStringAllowed || !operatorValue.searchSource;
|
|
128
131
|
return /*#__PURE__*/_jsx(Tokenizer, {
|
|
129
|
-
label:
|
|
132
|
+
label: t('@astryx.powersearch.valueEditor.values'),
|
|
130
133
|
isLabelHidden: true,
|
|
131
134
|
searchSource: source,
|
|
132
135
|
value: currentValue,
|
|
@@ -136,7 +139,7 @@ function StringListEditor({
|
|
|
136
139
|
value: items.map(item => item.label)
|
|
137
140
|
});
|
|
138
141
|
},
|
|
139
|
-
placeholder:
|
|
142
|
+
placeholder: t('@astryx.powersearch.valueEditor.addValuesPlaceholder'),
|
|
140
143
|
debounceMs: operatorValue.searchSource ? 150 : 0,
|
|
141
144
|
hasCreate: hasCreate
|
|
142
145
|
});
|
|
@@ -146,9 +149,10 @@ function IntegerEditor({
|
|
|
146
149
|
filterValue,
|
|
147
150
|
onChange
|
|
148
151
|
}) {
|
|
152
|
+
const t = useTranslator();
|
|
149
153
|
const currentValue = filterValue?.type === 'integer' ? filterValue.value : undefined;
|
|
150
154
|
return /*#__PURE__*/_jsx(NumberInput, {
|
|
151
|
-
label:
|
|
155
|
+
label: t('@astryx.powersearch.valueEditor.value'),
|
|
152
156
|
isLabelHidden: true,
|
|
153
157
|
value: currentValue ?? null,
|
|
154
158
|
onChange: value => {
|
|
@@ -161,7 +165,7 @@ function IntegerEditor({
|
|
|
161
165
|
max: operatorValue.maxValue,
|
|
162
166
|
units: operatorValue.units,
|
|
163
167
|
isIntegerOnly: true,
|
|
164
|
-
placeholder:
|
|
168
|
+
placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')
|
|
165
169
|
});
|
|
166
170
|
}
|
|
167
171
|
function FloatEditor({
|
|
@@ -169,9 +173,10 @@ function FloatEditor({
|
|
|
169
173
|
filterValue,
|
|
170
174
|
onChange
|
|
171
175
|
}) {
|
|
176
|
+
const t = useTranslator();
|
|
172
177
|
const currentValue = filterValue?.type === 'float' ? filterValue.value : undefined;
|
|
173
178
|
return /*#__PURE__*/_jsx(NumberInput, {
|
|
174
|
-
label:
|
|
179
|
+
label: t('@astryx.powersearch.valueEditor.value'),
|
|
175
180
|
isLabelHidden: true,
|
|
176
181
|
value: currentValue ?? null,
|
|
177
182
|
onChange: value => {
|
|
@@ -183,7 +188,7 @@ function FloatEditor({
|
|
|
183
188
|
min: operatorValue.minValue,
|
|
184
189
|
max: operatorValue.maxValue,
|
|
185
190
|
units: operatorValue.units,
|
|
186
|
-
placeholder:
|
|
191
|
+
placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')
|
|
187
192
|
});
|
|
188
193
|
}
|
|
189
194
|
function TimeEditor({
|
|
@@ -191,9 +196,10 @@ function TimeEditor({
|
|
|
191
196
|
filterValue,
|
|
192
197
|
onChange
|
|
193
198
|
}) {
|
|
199
|
+
const t = useTranslator();
|
|
194
200
|
const currentValue = filterValue?.type === 'time' ? filterValue.value : undefined;
|
|
195
201
|
return /*#__PURE__*/_jsx(TimeInput, {
|
|
196
|
-
label:
|
|
202
|
+
label: t('@astryx.powersearch.valueEditor.time'),
|
|
197
203
|
isLabelHidden: true,
|
|
198
204
|
value: currentValue,
|
|
199
205
|
onChange: value => {
|
|
@@ -212,6 +218,7 @@ function DateAbsoluteEditor({
|
|
|
212
218
|
filterValue,
|
|
213
219
|
onChange
|
|
214
220
|
}) {
|
|
221
|
+
const t = useTranslator();
|
|
215
222
|
// Convert unixSeconds to ISO date string for the date input
|
|
216
223
|
const currentValue = useMemo(() => {
|
|
217
224
|
if (filterValue?.type !== 'date_absolute') {
|
|
@@ -221,7 +228,7 @@ function DateAbsoluteEditor({
|
|
|
221
228
|
return date.toISOString().split('T')[0];
|
|
222
229
|
}, [filterValue]);
|
|
223
230
|
return /*#__PURE__*/_jsx(DateInput, {
|
|
224
|
-
label:
|
|
231
|
+
label: t('@astryx.powersearch.valueEditor.date'),
|
|
225
232
|
isLabelHidden: true,
|
|
226
233
|
value: currentValue,
|
|
227
234
|
onChange: value => {
|
|
@@ -240,6 +247,7 @@ function DateRelativeEditor({
|
|
|
240
247
|
filterValue,
|
|
241
248
|
onChange
|
|
242
249
|
}) {
|
|
250
|
+
const t = useTranslator();
|
|
243
251
|
const currentValue = filterValue?.type === 'date_relative' ? filterValue.value : undefined;
|
|
244
252
|
const options = useMemo(() => {
|
|
245
253
|
const result = [];
|
|
@@ -276,7 +284,7 @@ function DateRelativeEditor({
|
|
|
276
284
|
return result;
|
|
277
285
|
}, [operatorValue.isPastAllowed, operatorValue.isFutureAllowed]);
|
|
278
286
|
return /*#__PURE__*/_jsx(Selector, {
|
|
279
|
-
label:
|
|
287
|
+
label: t('@astryx.powersearch.valueEditor.relativeDate'),
|
|
280
288
|
isLabelHidden: true,
|
|
281
289
|
options: options,
|
|
282
290
|
value: currentValue,
|
|
@@ -292,6 +300,7 @@ function DateRangeEditor({
|
|
|
292
300
|
filterValue,
|
|
293
301
|
onChange
|
|
294
302
|
}) {
|
|
303
|
+
const t = useTranslator();
|
|
295
304
|
const startValue = useMemo(() => {
|
|
296
305
|
if (filterValue?.type !== 'date_range') {
|
|
297
306
|
return undefined;
|
|
@@ -346,12 +355,12 @@ function DateRangeEditor({
|
|
|
346
355
|
}, [filterValue, onChange]);
|
|
347
356
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
348
357
|
children: [/*#__PURE__*/_jsx(DateInput, {
|
|
349
|
-
label:
|
|
358
|
+
label: t('@astryx.powersearch.valueEditor.startDate'),
|
|
350
359
|
isLabelHidden: true,
|
|
351
360
|
value: startValue,
|
|
352
361
|
onChange: handleStartChange
|
|
353
362
|
}), /*#__PURE__*/_jsx(DateInput, {
|
|
354
|
-
label:
|
|
363
|
+
label: t('@astryx.powersearch.valueEditor.endDate'),
|
|
355
364
|
isLabelHidden: true,
|
|
356
365
|
value: endValue,
|
|
357
366
|
onChange: handleEndChange
|
|
@@ -363,13 +372,14 @@ function EnumEditor({
|
|
|
363
372
|
filterValue,
|
|
364
373
|
onChange
|
|
365
374
|
}) {
|
|
375
|
+
const t = useTranslator();
|
|
366
376
|
const currentValue = filterValue?.type === 'enum' ? filterValue.value : undefined;
|
|
367
377
|
const options = useMemo(() => operatorValue.values.map(item => ({
|
|
368
378
|
value: item.value,
|
|
369
379
|
label: item.label
|
|
370
380
|
})), [operatorValue.values]);
|
|
371
381
|
return /*#__PURE__*/_jsx(Selector, {
|
|
372
|
-
label:
|
|
382
|
+
label: t('@astryx.powersearch.valueEditor.value'),
|
|
373
383
|
isLabelHidden: true,
|
|
374
384
|
options: options,
|
|
375
385
|
value: currentValue,
|
|
@@ -386,6 +396,7 @@ function EnumListEditor({
|
|
|
386
396
|
filterValue,
|
|
387
397
|
onChange
|
|
388
398
|
}) {
|
|
399
|
+
const t = useTranslator();
|
|
389
400
|
const items = useMemo(() => enumItemsToSearchableItems(operatorValue.values), [operatorValue.values]);
|
|
390
401
|
const source = useMemo(() => createStaticSource(items), [items]);
|
|
391
402
|
const currentValue = useMemo(() => {
|
|
@@ -401,7 +412,7 @@ function EnumListEditor({
|
|
|
401
412
|
});
|
|
402
413
|
}, [filterValue, operatorValue.values]);
|
|
403
414
|
return /*#__PURE__*/_jsx(Tokenizer, {
|
|
404
|
-
label:
|
|
415
|
+
label: t('@astryx.powersearch.valueEditor.values'),
|
|
405
416
|
isLabelHidden: true,
|
|
406
417
|
searchSource: source,
|
|
407
418
|
value: currentValue,
|
|
@@ -411,7 +422,7 @@ function EnumListEditor({
|
|
|
411
422
|
value: selectedItems.map(item => item.id)
|
|
412
423
|
});
|
|
413
424
|
},
|
|
414
|
-
placeholder:
|
|
425
|
+
placeholder: t('@astryx.powersearch.valueEditor.selectValuesPlaceholder'),
|
|
415
426
|
hasEntriesOnFocus: true,
|
|
416
427
|
debounceMs: 0
|
|
417
428
|
});
|
|
@@ -421,6 +432,7 @@ function EntityListEditor({
|
|
|
421
432
|
filterValue,
|
|
422
433
|
onChange
|
|
423
434
|
}) {
|
|
435
|
+
const t = useTranslator();
|
|
424
436
|
const source = useMemo(() => {
|
|
425
437
|
if (operatorValue.searchSource) {
|
|
426
438
|
return operatorValue.searchSource;
|
|
@@ -445,7 +457,7 @@ function EntityListEditor({
|
|
|
445
457
|
}));
|
|
446
458
|
}, [filterValue]);
|
|
447
459
|
return /*#__PURE__*/_jsx(Tokenizer, {
|
|
448
|
-
label:
|
|
460
|
+
label: t('@astryx.powersearch.valueEditor.entities'),
|
|
449
461
|
isLabelHidden: true,
|
|
450
462
|
searchSource: source,
|
|
451
463
|
value: currentValue,
|
|
@@ -466,7 +478,7 @@ function EntityListEditor({
|
|
|
466
478
|
});
|
|
467
479
|
},
|
|
468
480
|
renderItem: operatorValue.renderItem,
|
|
469
|
-
placeholder:
|
|
481
|
+
placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
|
|
470
482
|
debounceMs: operatorValue.searchSource ? 150 : 0
|
|
471
483
|
});
|
|
472
484
|
}
|
|
@@ -476,6 +488,7 @@ function CustomEditor({
|
|
|
476
488
|
onChange,
|
|
477
489
|
isDisabled
|
|
478
490
|
}) {
|
|
491
|
+
const t = useTranslator();
|
|
479
492
|
const currentValue = filterValue?.type === 'custom' ? filterValue.value : null;
|
|
480
493
|
const EditorComponent = operatorValue.Editor;
|
|
481
494
|
return /*#__PURE__*/_jsx(EditorComponent, {
|
|
@@ -488,7 +501,7 @@ function CustomEditor({
|
|
|
488
501
|
});
|
|
489
502
|
}
|
|
490
503
|
},
|
|
491
|
-
placeholder:
|
|
504
|
+
placeholder: t('@astryx.powersearch.valueEditor.enterValuePlaceholder'),
|
|
492
505
|
value: currentValue
|
|
493
506
|
});
|
|
494
507
|
}
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { OperatorValue, FilterValue } from './types';
|
|
11
11
|
import type { InternalConfig } from './useInternalConfig';
|
|
12
|
-
|
|
12
|
+
import type { TranslatorFn } from '../i18n';
|
|
13
|
+
export declare function formatFilterValue(_config: InternalConfig, operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, t: TranslatorFn, timezoneID?: string): string;
|
|
13
14
|
//# sourceMappingURL=formatFilterValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AA8C1C,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,YAAY,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAsHR"}
|
|
@@ -41,10 +41,10 @@ function formatRelativeDate(value) {
|
|
|
41
41
|
// value is stored as a descriptive string like "7d" or "1w"
|
|
42
42
|
return value;
|
|
43
43
|
}
|
|
44
|
-
function formatDateRange(_value) {
|
|
45
|
-
return '
|
|
44
|
+
function formatDateRange(_value, t) {
|
|
45
|
+
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
46
46
|
}
|
|
47
|
-
export function formatFilterValue(_config, operatorValue, filterValue, maxLength, timezoneID) {
|
|
47
|
+
export function formatFilterValue(_config, operatorValue, filterValue, maxLength, t, timezoneID) {
|
|
48
48
|
switch (filterValue.type) {
|
|
49
49
|
case 'empty':
|
|
50
50
|
return '';
|
|
@@ -72,7 +72,9 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
72
72
|
if (joined.length <= maxLength) {
|
|
73
73
|
return joined;
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return t('@astryx.powersearch.valueEditor.itemsCount', {
|
|
76
|
+
count: items.length
|
|
77
|
+
});
|
|
76
78
|
}
|
|
77
79
|
case 'enum_list':
|
|
78
80
|
{
|
|
@@ -89,12 +91,16 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
89
91
|
if (joined.length <= maxLength) {
|
|
90
92
|
return joined;
|
|
91
93
|
}
|
|
92
|
-
return
|
|
94
|
+
return t('@astryx.powersearch.valueEditor.itemsCount', {
|
|
95
|
+
count: labels.length
|
|
96
|
+
});
|
|
93
97
|
}
|
|
94
98
|
if (items.length === 1) {
|
|
95
99
|
return truncate(items[0], maxLength);
|
|
96
100
|
}
|
|
97
|
-
return
|
|
101
|
+
return t('@astryx.powersearch.valueEditor.itemsCount', {
|
|
102
|
+
count: items.length
|
|
103
|
+
});
|
|
98
104
|
}
|
|
99
105
|
case 'entity_list':
|
|
100
106
|
{
|
|
@@ -109,7 +115,9 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
109
115
|
if (joined.length <= maxLength) {
|
|
110
116
|
return joined;
|
|
111
117
|
}
|
|
112
|
-
return
|
|
118
|
+
return t('@astryx.powersearch.valueEditor.entitiesCount', {
|
|
119
|
+
count: entities.length
|
|
120
|
+
});
|
|
113
121
|
}
|
|
114
122
|
case 'time':
|
|
115
123
|
return filterValue.value;
|
|
@@ -118,7 +126,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
118
126
|
case 'date_relative':
|
|
119
127
|
return formatRelativeDate(filterValue.value);
|
|
120
128
|
case 'date_range':
|
|
121
|
-
return formatDateRange(filterValue.value);
|
|
129
|
+
return formatDateRange(filterValue.value, t);
|
|
122
130
|
case 'custom':
|
|
123
131
|
if (operatorValue.type === 'custom') {
|
|
124
132
|
return truncate(operatorValue.getString(filterValue.value), maxLength);
|
|
@@ -127,7 +135,9 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
127
135
|
case 'nested':
|
|
128
136
|
{
|
|
129
137
|
const count = filterValue.value.length;
|
|
130
|
-
return
|
|
138
|
+
return t('@astryx.powersearch.valueEditor.filtersCount', {
|
|
139
|
+
count
|
|
140
|
+
});
|
|
131
141
|
}
|
|
132
142
|
default:
|
|
133
143
|
return '';
|
|
@@ -10,7 +10,8 @@ export { PowerSearch } from './PowerSearch';
|
|
|
10
10
|
export type { PowerSearchProps, PowerSearchSize } from './PowerSearch';
|
|
11
11
|
export { PowerSearchToken } from './PowerSearchToken';
|
|
12
12
|
export { PowerSearchFilterEditor } from './PowerSearchFilterEditor';
|
|
13
|
+
export { resolveOperatorLabel } from './resolveOperatorLabel';
|
|
13
14
|
export { createPowerSearchConfig, usePowerSearchConfig, } from './usePowerSearchConfig';
|
|
14
15
|
export type { FieldDefinition, InferData } from './usePowerSearchConfig';
|
|
15
|
-
export type { PowerSearchConfig, PowerSearchField, PowerSearchOperator, OperatorValue, EmptyOperatorValue, StringOperatorValue, StringListOperatorValue, IntegerOperatorValue, FloatOperatorValue, TimeOperatorValue, DateAbsoluteOperatorValue, DateRelativeOperatorValue, DateRangeOperatorValue, EnumOperatorValue, EnumListOperatorValue, EntityListOperatorValue, CustomOperatorValue, NestedOperatorValue, FilterValue, FilterValueEmpty, FilterValueString, FilterValueStringList, FilterValueInteger, FilterValueFloat, FilterValueTime, FilterValueDateAbsolute, FilterValueDateRelative, FilterValueDateRange, FilterValueEnum, FilterValueEnumList, FilterValueEntityList, FilterValueCustom, FilterValueNested, PowerSearchFilter, PartialFilter, EnumItem, PowerSearchEntity, DateTimeRange, DateTimeRangePart, DateRangeFilterPreset, RelativeDateFilterPreset, OperatorTokenizationConfig, PowerSearchChangeType, PowerSearchHandle, PowerSearchTokenProps, PowerSearchEditorProps, PowerSearchComponentOverride, PowerSearchComponents, } from './types';
|
|
16
|
+
export type { PowerSearchConfig, PowerSearchField, PowerSearchOperator, PowerSearchOperatorBase, PowerSearchOperatorWithLabel, PowerSearchOperatorWithI18nKey, OperatorValue, EmptyOperatorValue, StringOperatorValue, StringListOperatorValue, IntegerOperatorValue, FloatOperatorValue, TimeOperatorValue, DateAbsoluteOperatorValue, DateRelativeOperatorValue, DateRangeOperatorValue, EnumOperatorValue, EnumListOperatorValue, EntityListOperatorValue, CustomOperatorValue, NestedOperatorValue, FilterValue, FilterValueEmpty, FilterValueString, FilterValueStringList, FilterValueInteger, FilterValueFloat, FilterValueTime, FilterValueDateAbsolute, FilterValueDateRelative, FilterValueDateRange, FilterValueEnum, FilterValueEnumList, FilterValueEntityList, FilterValueCustom, FilterValueNested, PowerSearchFilter, PartialFilter, EnumItem, PowerSearchEntity, DateTimeRange, DateTimeRangePart, DateRangeFilterPreset, RelativeDateFilterPreset, OperatorTokenizationConfig, PowerSearchChangeType, PowerSearchHandle, PowerSearchTokenProps, PowerSearchEditorProps, PowerSearchComponentOverride, PowerSearchComponents, } from './types';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEvE,YAAY,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEvE,YAAY,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAG9B,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EAGnB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAGjB,iBAAiB,EACjB,aAAa,EAGb,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EAGjB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -13,4 +13,5 @@
|
|
|
13
13
|
export { PowerSearch } from "./PowerSearch.js";
|
|
14
14
|
export { PowerSearchToken } from "./PowerSearchToken.js";
|
|
15
15
|
export { PowerSearchFilterEditor } from "./PowerSearchFilterEditor.js";
|
|
16
|
+
export { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
16
17
|
export { createPowerSearchConfig, usePowerSearchConfig } from "./usePowerSearchConfig.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file resolveOperatorLabel.ts
|
|
3
|
+
* @input PowerSearchOperator + translator function
|
|
4
|
+
* @output Display string for the operator label
|
|
5
|
+
* @position Shared label-resolution helper used at every render site that
|
|
6
|
+
* reads an operator's display text (PowerSearch.tsx, PowerSearchToken.tsx,
|
|
7
|
+
* PowerSearchEditPopover.tsx, usePowerSearchSource.ts).
|
|
8
|
+
*
|
|
9
|
+
* A PowerSearchOperator is a discriminated union of two variants:
|
|
10
|
+
* - `{key, value, label}` — consumer-supplied raw text (used verbatim)
|
|
11
|
+
* - `{key, value, i18nKey}` — catalog-driven text (looked up via t())
|
|
12
|
+
*
|
|
13
|
+
* Astryx's shipped default operators use the i18nKey variant; consumers
|
|
14
|
+
* writing custom operators typically use the label variant.
|
|
15
|
+
*
|
|
16
|
+
* SYNC: When modified, update:
|
|
17
|
+
* - /packages/core/src/PowerSearch/types.ts (PowerSearchOperator type)
|
|
18
|
+
* - /packages/core/src/PowerSearch/index.ts (re-export)
|
|
19
|
+
*/
|
|
20
|
+
import type { TranslatorFn } from '../i18n';
|
|
21
|
+
import type { PowerSearchOperator } from './types';
|
|
22
|
+
export declare function resolveOperatorLabel(operator: PowerSearchOperator, t: TranslatorFn): string;
|
|
23
|
+
//# sourceMappingURL=resolveOperatorLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveOperatorLabel.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/resolveOperatorLabel.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEjD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,CAAC,EAAE,YAAY,GACd,MAAM,CAKR"}
|