@mittwald/flow-react-components 1.6.0-next.3 → 1.6.0-next.31
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/AGENTS.md +132 -88
- package/USAGE.md +7 -2
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_10.locale.mjs +3 -3
- package/dist/js/_virtual/_11.locale.mjs +3 -9
- package/dist/js/_virtual/_12.locale.mjs +9 -3
- package/dist/js/_virtual/_13.locale.mjs +3 -9
- package/dist/js/_virtual/_14.locale.mjs +5 -505
- package/dist/js/_virtual/_15.locale.mjs +505 -5
- package/dist/js/_virtual/_16.locale.mjs +9 -3
- package/dist/js/_virtual/_17.locale.mjs +3 -63
- package/dist/js/_virtual/_18.locale.mjs +77 -3
- package/dist/js/_virtual/_19.locale.mjs +3 -9
- package/dist/js/_virtual/_20.locale.mjs +5 -5
- package/dist/js/_virtual/_21.locale.mjs +5 -11
- package/dist/js/_virtual/_22.locale.mjs +15 -3
- package/dist/js/_virtual/_23.locale.mjs +3 -15
- package/dist/js/_virtual/_24.locale.mjs +15 -3
- package/dist/js/_virtual/_25.locale.mjs +3 -33
- package/dist/js/_virtual/_26.locale.mjs +29 -5
- package/dist/js/_virtual/_27.locale.mjs +9 -3
- package/dist/js/_virtual/_28.locale.mjs +3 -3
- package/dist/js/_virtual/_29.locale.mjs +3 -93
- package/dist/js/_virtual/_30.locale.mjs +93 -3
- package/dist/js/_virtual/_31.locale.mjs +3 -9
- package/dist/js/_virtual/_32.locale.mjs +9 -3
- package/dist/js/_virtual/_33.locale.mjs +3 -9
- package/dist/js/_virtual/_34.locale.mjs +5 -7
- package/dist/js/_virtual/_35.locale.mjs +7 -13
- package/dist/js/_virtual/_36.locale.mjs +23 -0
- package/dist/js/_virtual/_4.locale.mjs +3 -9
- package/dist/js/_virtual/_5.locale.mjs +9 -3
- package/dist/js/_virtual/_6.locale.mjs +3 -21
- package/dist/js/_virtual/_7.locale.mjs +21 -3
- package/dist/js/_virtual/_8.locale.mjs +3 -3
- package/dist/js/_virtual/_9.locale.mjs +3 -3
- package/dist/js/default.mjs +4 -3
- package/dist/js/flr-universal.mjs +2 -1
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +3 -3
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Activity/Activity.mjs +1 -1
- package/dist/js/packages/components/src/components/Activity/Activity.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
- package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs +4 -0
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +1 -1
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -8
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/ChartTooltip/TooltipProgressBar.mjs +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +4 -4
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +41 -12
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs +29 -16
- package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +4 -3
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +3 -2
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSelectAll/ContextMenuSelectAll.mjs +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +1 -1
- package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs +1 -1
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +6 -2
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs +40 -8
- package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCard/components/DeleteButton/DeleteButton.mjs +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ImageCropper/ImageCropper.mjs +1 -1
- package/dist/js/packages/components/src/components/Kbd/Kbd.mjs +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +1 -5
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/LightBoxGallery.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs +1 -1
- package/dist/js/packages/components/src/components/Link/components/LinkIcon/LinkIcon.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/EmptySearchResultView/EmptySearchResultView.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/EmptyView/EmptyView.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/Footer.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/components/PaginationInfos/PaginationInfos.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +7 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +6 -4
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +17 -10
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -0
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -2
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs +3 -0
- package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs +5 -9
- package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +8 -12
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs +31 -0
- package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +1 -1
- package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs +21 -0
- package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/List.mjs +1 -0
- package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +20 -7
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs +28 -1
- package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/views/EmptyView/EmptyView.mjs +1 -1
- package/dist/js/packages/components/src/components/Markdown/Markdown.mjs +29 -11
- package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs +1 -1
- package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs +8 -0
- package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs.map +1 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ModeButton.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/useFileUpload.mjs +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +32 -3
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +1 -3
- package/dist/js/packages/components/src/components/Message/Message.mjs +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MessageThread/components/MessageSeparator/MessageSeparator.mjs +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +3 -2
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +1 -3
- package/dist/js/packages/components/src/components/Notification/Notification.mjs +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +2 -3
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Option/Option.module.mjs +1 -3
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +2 -2
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs +5 -4
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarValue.mjs +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +2 -3
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/Rating.mjs +12 -11
- package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +3 -4
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs +10 -6
- package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -4
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
- package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +2 -3
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +2 -3
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SkeletonMode/SkeletonMode.mjs +1 -1
- package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs +4 -3
- package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +48 -42
- package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +1 -1
- package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
- package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/Tabs.mjs +6 -8
- package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/Tabs.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/FallbackTab/FallbackTab.mjs +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/TabList/TabList.mjs +0 -3
- package/dist/js/packages/components/src/components/Tabs/components/TabList/TabList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +12 -9
- package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +4 -2
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +15 -2
- package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Wrap/Wrap.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +2 -2
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs +1 -1
- package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
- package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
- package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
- package/dist/js/packages/components-base/src/index.mjs +4 -2
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
- package/dist/types/_bundled/flow-components-base/index.d.ts +3 -1
- package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
- package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
- package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
- package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
- package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/types/components/DonutChart/DonutChart.d.ts +1 -4
- package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
- package/dist/types/components/List/components/Items/components/Item/Item.d.ts +2 -0
- package/dist/types/components/List/components/Items/components/Item/hooks/useGridItemProps.d.ts +1 -0
- package/dist/types/components/List/components/ListSummary/ListSummary.d.ts +3 -2
- package/dist/types/components/List/components/Table/components/Row.d.ts +13 -0
- package/dist/types/components/List/hooks/useLatestOnAction.d.ts +7 -0
- package/dist/types/components/List/index.d.ts +2 -0
- package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
- package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
- package/dist/types/components/List/model/filter/types.d.ts +23 -1
- package/dist/types/components/List/model/item/ItemView.d.ts +34 -11
- package/dist/types/components/List/model/table/TableRow.d.ts +14 -0
- package/dist/types/components/List/model/table/types.d.ts +17 -1
- package/dist/types/components/List/typedList.d.ts +1 -0
- package/dist/types/components/Markdown/lib/isExternalHref.d.ts +1 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -4
- package/dist/types/components/Rating/Rating.d.ts +5 -5
- package/dist/types/components/Section/context.d.ts +28 -0
- package/dist/types/components/Wrap/Wrap.d.ts +5 -0
- package/dist/types/index/flr-universal.d.ts +1 -1
- package/package.json +12 -12
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
- package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
- package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
|
@@ -7,6 +7,7 @@ import { Item } from "./components/Item/Item.mjs";
|
|
|
7
7
|
import ItemsGridListView from "../../../../views/ItemsGridListView.mjs";
|
|
8
8
|
import { FallbackItems } from "./components/FallbackItems/FallbackItems.mjs";
|
|
9
9
|
import { useInfiniteScrollTrigger } from "../../hooks/useInfiniteScrollTrigger.mjs";
|
|
10
|
+
import { useLatestOnAction } from "../../hooks/useLatestOnAction.mjs";
|
|
10
11
|
import clsx from "clsx";
|
|
11
12
|
import { jsx } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/List/components/Items/Items.tsx
|
|
@@ -17,11 +18,13 @@ var Items = () => {
|
|
|
17
18
|
const isInitiallyLoading = list.loader.useIsInitiallyLoading();
|
|
18
19
|
const isLoadingMore = list.loader.useIsLoadingMore();
|
|
19
20
|
const { triggerRef, triggerIndex } = useInfiniteScrollTrigger();
|
|
21
|
+
const onAction = useLatestOnAction(list);
|
|
20
22
|
if (!list.itemView) return null;
|
|
21
23
|
const items = list.items.entries.map((item, index) => /* @__PURE__ */ jsx(Item, {
|
|
22
24
|
data: item.data,
|
|
23
25
|
id: item.id,
|
|
24
26
|
list,
|
|
27
|
+
onAction,
|
|
25
28
|
isTile: tiles,
|
|
26
29
|
triggerRef: index === triggerIndex ? triggerRef : void 0
|
|
27
30
|
}, item.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/Items/Items.tsx"],"sourcesContent":["import Item from \"@/components/List/components/Items/components/Item/Item\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport DivView from \"@/views/DivView\";\nimport ItemsGridListView from \"@/views/ItemsGridListView\";\nimport clsx from \"clsx\";\nimport type { FC } from \"react\";\nimport styles from \"./Items.module.scss\";\nimport { FallbackItems } from \"./components/FallbackItems\";\nimport { useInfiniteScrollTrigger } from \"@/components/List/hooks/useInfiniteScrollTrigger\";\n\nexport const Items: FC = () => {\n const list = useList();\n const tiles = list.viewMode.isTiles;\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const isLoadingMore = list.loader.useIsLoadingMore();\n\n const { triggerRef, triggerIndex } = useInfiniteScrollTrigger();\n\n if (!list.itemView) {\n return null;\n }\n\n const items = list.items.entries.map((item, index) => (\n <Item\n key={item.id}\n data={item.data}\n id={item.id}\n list={list}\n isTile={tiles}\n triggerRef={index === triggerIndex ? triggerRef : undefined}\n />\n ));\n\n const rootClassName = clsx(\n styles.items,\n isLoading && !(list.infiniteScroll && isLoadingMore) && styles.isLoading,\n tiles && styles.tiles,\n );\n\n const {\n \"aria-labelledby\": ariaLabelledby,\n \"aria-label\": ariaLabel,\n ...rest\n } = list.componentProps;\n\n return (\n <DivView aria-hidden={isInitiallyLoading} aria-busy={isLoading}>\n <ItemsGridListView\n className={rootClassName}\n {...rest}\n aria-labelledby={ariaLabel ? undefined : ariaLabelledby}\n aria-label={ariaLabel}\n layout={tiles ? \"grid\" : \"stack\"}\n tileMaxWidth={list.itemView.tileMaxWidth}\n >\n {items.length === 0 && isInitiallyLoading ? <FallbackItems /> : items}\n </ItemsGridListView>\n </DivView>\n );\n};\n\nexport default Items;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Items.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/Items/Items.tsx"],"sourcesContent":["import Item from \"@/components/List/components/Items/components/Item/Item\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport DivView from \"@/views/DivView\";\nimport ItemsGridListView from \"@/views/ItemsGridListView\";\nimport clsx from \"clsx\";\nimport type { FC } from \"react\";\nimport styles from \"./Items.module.scss\";\nimport { FallbackItems } from \"./components/FallbackItems\";\nimport { useInfiniteScrollTrigger } from \"@/components/List/hooks/useInfiniteScrollTrigger\";\nimport { useLatestOnAction } from \"@/components/List/hooks/useLatestOnAction\";\n\nexport const Items: FC = () => {\n const list = useList();\n const tiles = list.viewMode.isTiles;\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const isLoadingMore = list.loader.useIsLoadingMore();\n\n const { triggerRef, triggerIndex } = useInfiniteScrollTrigger();\n\n const onAction = useLatestOnAction(list);\n\n if (!list.itemView) {\n return null;\n }\n\n const items = list.items.entries.map((item, index) => (\n <Item\n key={item.id}\n data={item.data}\n id={item.id}\n list={list}\n onAction={onAction}\n isTile={tiles}\n triggerRef={index === triggerIndex ? triggerRef : undefined}\n />\n ));\n\n const rootClassName = clsx(\n styles.items,\n isLoading && !(list.infiniteScroll && isLoadingMore) && styles.isLoading,\n tiles && styles.tiles,\n );\n\n const {\n \"aria-labelledby\": ariaLabelledby,\n \"aria-label\": ariaLabel,\n ...rest\n } = list.componentProps;\n\n return (\n <DivView aria-hidden={isInitiallyLoading} aria-busy={isLoading}>\n <ItemsGridListView\n className={rootClassName}\n {...rest}\n aria-labelledby={ariaLabel ? undefined : ariaLabelledby}\n aria-label={ariaLabel}\n layout={tiles ? \"grid\" : \"stack\"}\n tileMaxWidth={list.itemView.tileMaxWidth}\n >\n {items.length === 0 && isInitiallyLoading ? <FallbackItems /> : items}\n </ItemsGridListView>\n </DivView>\n );\n};\n\nexport default Items;\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAa,cAAkB;CAC7B,MAAM,OAAO,QAAQ;CACrB,MAAM,QAAQ,KAAK,SAAS;CAC5B,MAAM,YAAY,KAAK,OAAO,aAAa;CAC3C,MAAM,qBAAqB,KAAK,OAAO,sBAAsB;CAC7D,MAAM,gBAAgB,KAAK,OAAO,iBAAiB;CAEnD,MAAM,EAAE,YAAY,iBAAiB,yBAAyB;CAE9D,MAAM,WAAW,kBAAkB,IAAI;CAEvC,IAAI,CAAC,KAAK,UACR,OAAO;CAGT,MAAM,QAAQ,KAAK,MAAM,QAAQ,KAAK,MAAM,UAC1C,oBAAC,MAAD;EAEE,MAAM,KAAK;EACX,IAAI,KAAK;EACH;EACI;EACV,QAAQ;EACR,YAAY,UAAU,eAAe,aAAa,KAAA;CACnD,GAPM,KAAK,EAOX,CACF;CAED,MAAM,gBAAgB,KACpBA,qBAAO,OACP,aAAa,EAAE,KAAK,kBAAkB,kBAAkBA,qBAAO,WAC/D,SAASA,qBAAO,KAClB;CAEA,MAAM,EACJ,mBAAmB,gBACnB,cAAc,WACd,GAAG,SACD,KAAK;CAET,OACE,oBAAC,SAAD;EAAS,eAAa;EAAoB,aAAW;EACnD,UAAA,oBAAC,mBAAD;GACE,WAAW;GACX,GAAI;GACJ,mBAAiB,YAAY,KAAA,IAAY;GACzC,cAAY;GACZ,QAAQ,QAAQ,SAAS;GACzB,cAAc,KAAK,SAAS;GAE3B,UAAA,MAAM,WAAW,KAAK,qBAAqB,oBAAC,eAAD,CAAgB,CAAA,IAAI;EAC/C,CAAA;CACZ,CAAA;AAEb"}
|
package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs
CHANGED
|
@@ -36,7 +36,7 @@ var ItemImpl = (props) => {
|
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
var Item = memo(ItemImpl, (prev, next) => prev.id === next.id && prev.data === next.data && prev.triggerRef === next.triggerRef && prev.isTile === next.isTile && prev.
|
|
39
|
+
var Item = memo(ItemImpl, (prev, next) => prev.id === next.id && prev.data === next.data && prev.triggerRef === next.triggerRef && prev.isTile === next.isTile && !!prev.onAction === !!next.onAction && prev.list.accordion === next.list.accordion && !!prev.list.itemView?.rendersSameFor(next.list.itemView, next.data));
|
|
40
40
|
Item.displayName = "Item";
|
|
41
41
|
var ItemContainer = (props) => {
|
|
42
42
|
const list = useList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.mjs","names":["styles"],"sources":["../../../../../../../../../../../src/components/List/components/Items/components/Item/Item.tsx"],"sourcesContent":["import { useGridItemProps } from \"@/components/List/components/Items/components/Item/hooks/useGridItemProps\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport type ListModel from \"@/components/List/model/List\";\nimport ItemsGridListItemView from \"@/views/ItemsGridListItemView\";\nimport { mergeRefs } from \"@react-aria/utils\";\nimport type { FC, PropsWithChildren, Ref } from \"react\";\nimport { memo, Suspense } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport styles from \"./Item.module.scss\";\nimport { ItemLoadingView } from \"./components/ItemLoadingView/ItemLoadingView\";\n\ninterface Props extends PropsWithChildren {\n id: Key;\n data: never;\n triggerRef?: Ref<HTMLDivElement>;\n list: ListModel<never>;\n isTile: boolean;\n}\n\nconst ItemImpl = (props: Props) => {\n const { id, data, triggerRef, list, isTile } = props;\n\n const itemView = list.itemView;\n\n const { gridItemProps, children } = useGridItemProps(props, list);\n\n if (!itemView) {\n return null;\n }\n\n const textValue = itemView.textValue ? itemView.textValue(data) : undefined;\n const href = itemView.href ? itemView.href(data) : undefined;\n const hasAction = !!gridItemProps.onAction || !!href;\n\n const existingRef = \"ref\" in gridItemProps ? gridItemProps.ref : undefined;\n const gridItemPropsWithRef = triggerRef\n ? { ...gridItemProps, ref: mergeRefs(existingRef, triggerRef) }\n : gridItemProps;\n\n return (\n <ItemsGridListItemView\n id={id}\n textValue={textValue}\n href={href}\n target={itemView.target}\n hasAction={hasAction}\n isTile={isTile}\n {...gridItemPropsWithRef}\n >\n <Suspense fallback={<ItemLoadingView />}>{children}</Suspense>\n </ItemsGridListItemView>\n );\n};\n\n// The list model is rebuilt on every render, so it cannot be compared by\n// identity — but everything an item renders from it can.
|
|
1
|
+
{"version":3,"file":"Item.mjs","names":["styles"],"sources":["../../../../../../../../../../../src/components/List/components/Items/components/Item/Item.tsx"],"sourcesContent":["import { useGridItemProps } from \"@/components/List/components/Items/components/Item/hooks/useGridItemProps\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport type ListModel from \"@/components/List/model/List\";\nimport ItemsGridListItemView from \"@/views/ItemsGridListItemView\";\nimport { mergeRefs } from \"@react-aria/utils\";\nimport type { FC, PropsWithChildren, Ref } from \"react\";\nimport { memo, Suspense } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport styles from \"./Item.module.scss\";\nimport { ItemLoadingView } from \"./components/ItemLoadingView/ItemLoadingView\";\n\ninterface Props extends PropsWithChildren {\n id: Key;\n data: never;\n triggerRef?: Ref<HTMLDivElement>;\n list: ListModel<never>;\n isTile: boolean;\n /** Stable invoker of the list's latest `onAction` */\n onAction?: (data: never) => void;\n}\n\nconst ItemImpl = (props: Props) => {\n const { id, data, triggerRef, list, isTile } = props;\n\n const itemView = list.itemView;\n\n const { gridItemProps, children } = useGridItemProps(props, list);\n\n if (!itemView) {\n return null;\n }\n\n const textValue = itemView.textValue ? itemView.textValue(data) : undefined;\n const href = itemView.href ? itemView.href(data) : undefined;\n const hasAction = !!gridItemProps.onAction || !!href;\n\n const existingRef = \"ref\" in gridItemProps ? gridItemProps.ref : undefined;\n const gridItemPropsWithRef = triggerRef\n ? { ...gridItemProps, ref: mergeRefs(existingRef, triggerRef) }\n : gridItemProps;\n\n return (\n <ItemsGridListItemView\n id={id}\n textValue={textValue}\n href={href}\n target={itemView.target}\n hasAction={hasAction}\n isTile={isTile}\n {...gridItemPropsWithRef}\n >\n <Suspense fallback={<ItemLoadingView />}>{children}</Suspense>\n </ItemsGridListItemView>\n );\n};\n\n// The list model is rebuilt on every render, so it cannot be compared by\n// identity — but everything an item renders from it can. The render function\n// counts by its `renderDependencies`, or else by its identity: an inline one\n// changes whenever the consumer re-renders, so parent state no longer leaves\n// an item frozen on the values it first saw (#3065), while loading more still\n// skips the re-render. `onAction` arrives as a stable invoker of the latest\n// handler, and `textValue`/`href` count by their result.\nexport const Item = memo(\n ItemImpl,\n (prev, next) =>\n prev.id === next.id &&\n prev.data === next.data &&\n prev.triggerRef === next.triggerRef &&\n prev.isTile === next.isTile &&\n !!prev.onAction === !!next.onAction &&\n prev.list.accordion === next.list.accordion &&\n !!prev.list.itemView?.rendersSameFor(next.list.itemView, next.data),\n);\nItem.displayName = \"Item\";\n\ninterface ItemContainerProps extends PropsWithChildren {\n id?: Key;\n data?: never;\n}\n\nexport const ItemContainer: FC<ItemContainerProps> = (props) => {\n const list = useList();\n return (\n <ItemsGridListItemView\n textValue=\"-\"\n className={styles.item}\n isTile={list.viewMode.isTiles}\n >\n {props.children}\n </ItemsGridListItemView>\n );\n};\n\nexport default Item;\n"],"mappings":";;;;;;;;;;;AAqBA,IAAM,YAAY,UAAiB;CACjC,MAAM,EAAE,IAAI,MAAM,YAAY,MAAM,WAAW;CAE/C,MAAM,WAAW,KAAK;CAEtB,MAAM,EAAE,eAAe,aAAa,iBAAiB,OAAO,IAAI;CAEhE,IAAI,CAAC,UACH,OAAO;CAGT,MAAM,YAAY,SAAS,YAAY,SAAS,UAAU,IAAI,IAAI,KAAA;CAClE,MAAM,OAAO,SAAS,OAAO,SAAS,KAAK,IAAI,IAAI,KAAA;CACnD,MAAM,YAAY,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC;CAEhD,MAAM,cAAc,SAAS,gBAAgB,cAAc,MAAM,KAAA;CACjE,MAAM,uBAAuB,aACzB;EAAE,GAAG;EAAe,KAAK,UAAU,aAAa,UAAU;CAAE,IAC5D;CAEJ,OACE,oBAAC,uBAAD;EACM;EACO;EACL;EACN,QAAQ,SAAS;EACN;EACH;EACR,GAAI;EAEJ,UAAA,oBAAC,UAAD;GAAU,UAAU,oBAAC,iBAAD,CAAkB,CAAA;GAAI;EAAmB,CAAA;CACxC,CAAA;AAE3B;AASA,IAAa,OAAO,KAClB,WACC,MAAM,SACL,KAAK,OAAO,KAAK,MACjB,KAAK,SAAS,KAAK,QACnB,KAAK,eAAe,KAAK,cACzB,KAAK,WAAW,KAAK,UACrB,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,KAAK,YAC3B,KAAK,KAAK,cAAc,KAAK,KAAK,aAClC,CAAC,CAAC,KAAK,KAAK,UAAU,eAAe,KAAK,KAAK,UAAU,KAAK,IAAI,CACtE;AACA,KAAK,cAAc;AAOnB,IAAa,iBAAyC,UAAU;CAC9D,MAAM,OAAO,QAAQ;CACrB,OACE,oBAAC,uBAAD;EACE,WAAU;EACV,WAAWA,oBAAO;EAClB,QAAQ,KAAK,SAAS;EAErB,UAAA,MAAM;CACc,CAAA;AAE3B"}
|
|
@@ -4,7 +4,7 @@ import { IconChevronDown } from "../../../../../../Icon/components/icons/IconChe
|
|
|
4
4
|
import { IconChevronUp } from "../../../../../../Icon/components/icons/IconChevronUp.mjs";
|
|
5
5
|
import { useLocalizedStringFormatter } from "../../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
6
6
|
import ButtonView from "../../../../../../../views/ButtonView.mjs";
|
|
7
|
-
import __locale_default from "../../../../../../../../../../_virtual/
|
|
7
|
+
import __locale_default from "../../../../../../../../../../_virtual/_18.locale.mjs";
|
|
8
8
|
import ListItemView_module_default from "../../../../ListItemView/ListItemView.module.mjs";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/List/components/Items/components/Item/components/AccordionButton.tsx
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { IconContextMenu } from "../../../../../../../Icon/components/icons/IconContextMenu.mjs";
|
|
4
4
|
import { useLocalizedStringFormatter } from "../../../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
5
5
|
import ButtonView from "../../../../../../../../views/ButtonView.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../../../../../../_virtual/_18.locale.mjs";
|
|
7
7
|
import ContextMenuTriggerView from "../../../../../../../../views/ContextMenuTriggerView.mjs";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.tsx
|
|
@@ -7,9 +7,8 @@ import { useEffect, useId, useRef, useState } from "react";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx
|
|
9
9
|
var useGridItemProps = (props, list) => {
|
|
10
|
-
const { data, children: childrenFromProps } = props;
|
|
10
|
+
const { data, onAction, children: childrenFromProps } = props;
|
|
11
11
|
const itemView = list.itemView;
|
|
12
|
-
const onAction = list.onAction;
|
|
13
12
|
const [isExpanded, setIsExpanded] = useState(itemView?.defaultExpanded?.(data) ?? false);
|
|
14
13
|
const contentElementId = useId();
|
|
15
14
|
const itemRef = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridItemProps.mjs","names":[],"sources":["../../../../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport type List from \"@/components/List/model/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n}\n\nexport const useGridItemProps = (props: P, list: List<never>) => {\n const { data, children: childrenFromProps } = props;\n const itemView = list.itemView;\n
|
|
1
|
+
{"version":3,"file":"useGridItemProps.mjs","names":[],"sources":["../../../../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport type List from \"@/components/List/model/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n onAction?: (data: never) => void;\n}\n\nexport const useGridItemProps = (props: P, list: List<never>) => {\n const { data, onAction, children: childrenFromProps } = props;\n const itemView = list.itemView;\n\n const [isExpanded, setIsExpanded] = useState(\n itemView?.defaultExpanded?.(data) ?? false,\n );\n const contentElementId = useId();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const accordion = list.accordion;\n const children = childrenFromProps ?? itemView?.render(data);\n\n useEffect(() => {\n if (accordion) {\n itemRef.current?.setAttribute(\"aria-expanded\", String(isExpanded));\n itemRef.current?.setAttribute(\"aria-controls\", contentElementId);\n }\n }, [isExpanded, contentElementId, itemRef.current, accordion]);\n\n if (!accordion) {\n return {\n gridItemProps: {\n onAction: onAction\n ? () => {\n onAction?.(data);\n }\n : undefined,\n },\n children,\n };\n }\n\n const toggleAccordion = () => {\n setIsExpanded((current) => !current);\n onAction?.(data);\n };\n\n const propsContext: PropsContext = {\n Content: {\n id: dynamic((p) => (p.slot === \"bottom\" ? contentElementId : undefined)),\n wrapWith: dynamic((p) =>\n p.slot === \"bottom\" ? (\n <AccordionButton\n contentElementId={contentElementId}\n toggle={toggleAccordion}\n isExpanded={isExpanded}\n />\n ) : undefined,\n ),\n },\n };\n\n return {\n gridItemProps: {\n ref: itemRef,\n onAction: toggleAccordion,\n },\n children: (\n <PropsContextProvider\n props={propsContext}\n dependencies={[contentElementId, isExpanded]}\n >\n {children}\n </PropsContextProvider>\n ),\n };\n};\n"],"mappings":";;;;;;;;AAYA,IAAa,oBAAoB,OAAU,SAAsB;CAC/D,MAAM,EAAE,MAAM,UAAU,UAAU,sBAAsB;CACxD,MAAM,WAAW,KAAK;CAEtB,MAAM,CAAC,YAAY,iBAAiB,SAClC,UAAU,kBAAkB,IAAI,KAAK,KACvC;CACA,MAAM,mBAAmB,MAAM;CAC/B,MAAM,UAAU,OAAuB,IAAI;CAE3C,MAAM,YAAY,KAAK;CACvB,MAAM,WAAW,qBAAqB,UAAU,OAAO,IAAI;CAE3D,gBAAgB;EACd,IAAI,WAAW;GACb,QAAQ,SAAS,aAAa,iBAAiB,OAAO,UAAU,CAAC;GACjE,QAAQ,SAAS,aAAa,iBAAiB,gBAAgB;EACjE;CACF,GAAG;EAAC;EAAY;EAAkB,QAAQ;EAAS;CAAS,CAAC;CAE7D,IAAI,CAAC,WACH,OAAO;EACL,eAAe,EACb,UAAU,iBACA;GACJ,WAAW,IAAI;EACjB,IACA,KAAA,EACN;EACA;CACF;CAGF,MAAM,wBAAwB;EAC5B,eAAe,YAAY,CAAC,OAAO;EACnC,WAAW,IAAI;CACjB;CAEA,MAAM,eAA6B,EACjC,SAAS;EACP,IAAI,SAAS,MAAO,EAAE,SAAS,WAAW,mBAAmB,KAAA,CAAU;EACvE,UAAU,SAAS,MACjB,EAAE,SAAS,WACT,oBAAC,iBAAD;GACoB;GAClB,QAAQ;GACI;EACb,CAAA,IACC,KAAA,CACN;CACF,EACF;CAEA,OAAO;EACL,eAAe;GACb,KAAK;GACL,UAAU;EACZ;EACA,UACE,oBAAC,sBAAD;GACE,OAAO;GACP,cAAc,CAAC,kBAAkB,UAAU;GAE1C;EACmB,CAAA;CAE1B;AACF"}
|
package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
+
import { useLabelledBySectionHeading } from "../../../../../Section/context.mjs";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import * as Aria from "react-aria-components";
|
|
5
6
|
//#region src/components/List/components/Items/views/GridList/GridList.tsx
|
|
6
7
|
/** @flr-generate all */
|
|
7
8
|
var GridList = (props) => {
|
|
8
9
|
const { tileMaxWidth, emptyView, ...rest } = props;
|
|
10
|
+
const ariaLabelledBy = useLabelledBySectionHeading(rest);
|
|
9
11
|
return /* @__PURE__ */ jsx(Aria.GridList, {
|
|
10
12
|
...rest,
|
|
13
|
+
"aria-labelledby": ariaLabelledBy,
|
|
11
14
|
renderEmptyState: () => emptyView,
|
|
12
15
|
style: { gridTemplateColumns: `repeat(auto-fill, minmax(${tileMaxWidth}px, 1fr))` }
|
|
13
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridList.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Items/views/GridList/GridList.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { FC, ReactNode } from \"react\";\n\nexport type GridListProps = Aria.GridListProps<never> & {\n tileMaxWidth: number;\n emptyView?: ReactNode;\n};\n\n/** @flr-generate all */\nexport const GridList: FC<GridListProps> = (props) => {\n const { tileMaxWidth, emptyView, ...rest } = props;\n\n return (\n <Aria.GridList\n {...rest}\n renderEmptyState={() => emptyView}\n style={{\n gridTemplateColumns: `repeat(auto-fill, minmax(${tileMaxWidth}px, 1fr))`,\n }}\n />\n );\n};\n\nexport default GridList;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridList.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Items/views/GridList/GridList.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { FC, ReactNode } from \"react\";\nimport { useLabelledBySectionHeading } from \"@/components/Section/context\";\n\nexport type GridListProps = Aria.GridListProps<never> & {\n tileMaxWidth: number;\n emptyView?: ReactNode;\n};\n\n/** @flr-generate all */\nexport const GridList: FC<GridListProps> = (props) => {\n const { tileMaxWidth, emptyView, ...rest } = props;\n const ariaLabelledBy = useLabelledBySectionHeading(rest);\n\n return (\n <Aria.GridList\n {...rest}\n aria-labelledby={ariaLabelledBy}\n renderEmptyState={() => emptyView}\n style={{\n gridTemplateColumns: `repeat(auto-fill, minmax(${tileMaxWidth}px, 1fr))`,\n }}\n />\n );\n};\n\nexport default GridList;\n"],"mappings":";;;;;;;AAUA,IAAa,YAA+B,UAAU;CACpD,MAAM,EAAE,cAAc,WAAW,GAAG,SAAS;CAC7C,MAAM,iBAAiB,4BAA4B,IAAI;CAEvD,OACE,oBAAC,KAAK,UAAN;EACE,GAAI;EACJ,mBAAiB;EACjB,wBAAwB;EACxB,OAAO,EACL,qBAAqB,4BAA4B,aAAa,WAChE;CACD,CAAA;AAEL"}
|
package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs
CHANGED
|
@@ -7,18 +7,14 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
//#region src/components/List/components/ListSummary/ListSummary.tsx
|
|
8
8
|
/** @flr-generate all */
|
|
9
9
|
var ListSummary = flowComponent("ListSummary", (props) => {
|
|
10
|
-
const {
|
|
10
|
+
const { position = "top", className, ...rest } = props;
|
|
11
11
|
if (position === "bottom") return /* @__PURE__ */ jsx("footer", {
|
|
12
|
-
|
|
13
|
-
className: clsx(ListSummary_module_default.listSummary, ListSummary_module_default.bottom)
|
|
14
|
-
...props,
|
|
15
|
-
children
|
|
12
|
+
...rest,
|
|
13
|
+
className: clsx(ListSummary_module_default.listSummary, ListSummary_module_default.bottom, className)
|
|
16
14
|
});
|
|
17
15
|
return /* @__PURE__ */ jsx("header", {
|
|
18
|
-
|
|
19
|
-
className: clsx(ListSummary_module_default.listSummary, ListSummary_module_default.top)
|
|
20
|
-
...props,
|
|
21
|
-
children
|
|
16
|
+
...rest,
|
|
17
|
+
className: clsx(ListSummary_module_default.listSummary, ListSummary_module_default.top, className)
|
|
22
18
|
});
|
|
23
19
|
});
|
|
24
20
|
//#endregion
|
package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListSummary.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/ListSummary/ListSummary.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListSummary.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\n\nexport interface ListSummaryProps\n extends FlowComponentProps, PropsWithChildren {\n /** Whether the summary is placed above or underneath the list @default
|
|
1
|
+
{"version":3,"file":"ListSummary.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/ListSummary/ListSummary.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListSummary.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\n\nexport interface ListSummaryProps\n extends PropsWithClassName, FlowComponentProps, PropsWithChildren {\n /** Whether the summary is placed above or underneath the list @default \"top\" */\n position?: \"top\" | \"bottom\";\n}\n\n/** @flr-generate all */\nexport const ListSummary = flowComponent(\"ListSummary\", (props) => {\n const { position = \"top\", className, ...rest } = props;\n\n if (position === \"bottom\") {\n return (\n <footer\n {...rest}\n className={clsx(styles.listSummary, styles.bottom, className)}\n />\n );\n }\n\n return (\n <header\n {...rest}\n className={clsx(styles.listSummary, styles.top, className)}\n />\n );\n});\n\nexport default ListSummary;\n"],"mappings":";;;;;;;;AAcA,IAAa,cAAc,cAAc,gBAAgB,UAAU;CACjE,MAAM,EAAE,WAAW,OAAO,WAAW,GAAG,SAAS;CAEjD,IAAI,aAAa,UACf,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,WAAW,KAAKA,2BAAO,aAAaA,2BAAO,QAAQ,SAAS;CAC7D,CAAA;CAIL,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,WAAW,KAAKA,2BAAO,aAAaA,2BAAO,KAAK,SAAS;CAC1D,CAAA;AAEL,CAAC"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { useList } from "../../hooks/useList.mjs";
|
|
4
4
|
import { useInfiniteScrollTrigger } from "../../hooks/useInfiniteScrollTrigger.mjs";
|
|
5
|
+
import { useLatestOnAction } from "../../hooks/useLatestOnAction.mjs";
|
|
5
6
|
import Table_module_default from "./Table.module.mjs";
|
|
6
7
|
import TableView from "../../../../views/TableView.mjs";
|
|
7
8
|
import TableHeaderView from "../../../../views/TableHeaderView.mjs";
|
|
8
9
|
import TableBodyView from "../../../../views/TableBodyView.mjs";
|
|
9
|
-
import TableRowView from "../../../../views/TableRowView.mjs";
|
|
10
|
-
import TableCellView from "../../../../views/TableCellView.mjs";
|
|
11
10
|
import TableColumnView from "../../../../views/TableColumnView.mjs";
|
|
12
11
|
import { TableBodyLoadingView } from "./components/TableBodyLoadingView.mjs";
|
|
12
|
+
import { Row } from "./components/Row.mjs";
|
|
13
13
|
import clsx from "clsx";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/List/components/Table/Table.tsx
|
|
@@ -21,19 +21,15 @@ var Table = () => {
|
|
|
21
21
|
const isInitiallyLoading = list.loader.useIsInitiallyLoading();
|
|
22
22
|
const isLoadingMore = list.loader.useIsLoadingMore();
|
|
23
23
|
const { triggerRef, triggerIndex } = useInfiniteScrollTrigger();
|
|
24
|
+
const onAction = useLatestOnAction(list);
|
|
24
25
|
if (!table || listIsEmpty) return null;
|
|
25
|
-
const rowAction = table.list.onAction;
|
|
26
26
|
const tableClassName = clsx(Table_module_default.table, isLoading && !(list.infiniteScroll && isLoadingMore) && Table_module_default.isLoading, table.componentProps.className);
|
|
27
|
-
const rows = list.items.entries.map((item, index) => /* @__PURE__ */ jsx(
|
|
28
|
-
className: clsx(Table_module_default.row, rowAction && Table_module_default.hasAction, table.body.row.componentProps.className),
|
|
27
|
+
const rows = list.items.entries.map((item, index) => /* @__PURE__ */ jsx(Row, {
|
|
29
28
|
id: item.id,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...cell.componentProps,
|
|
35
|
-
children: cell.renderFn ? cell.renderFn(item.data, list) : void 0
|
|
36
|
-
}, i))
|
|
29
|
+
data: item.data,
|
|
30
|
+
list,
|
|
31
|
+
onAction,
|
|
32
|
+
triggerRef: index === triggerIndex ? triggerRef : void 0
|
|
37
33
|
}, item.id));
|
|
38
34
|
return /* @__PURE__ */ jsxs(TableView, {
|
|
39
35
|
...list.componentProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.scss\";\nimport clsx from \"clsx\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport
|
|
1
|
+
{"version":3,"file":"Table.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.scss\";\nimport clsx from \"clsx\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport TableColumnView from \"@/views/TableColumnView\";\nimport { TableBodyLoadingView } from \"@/components/List/components/Table/components/TableBodyLoadingView\";\nimport { useInfiniteScrollTrigger } from \"@/components/List/hooks/useInfiniteScrollTrigger\";\nimport { useLatestOnAction } from \"@/components/List/hooks/useLatestOnAction\";\nimport { Row } from \"@/components/List/components/Table/components/Row\";\n\nexport const Table: FC = () => {\n const list = useList();\n const table = list.table;\n const listIsEmpty = list.useIsEmpty();\n\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const isLoadingMore = list.loader.useIsLoadingMore();\n\n const { triggerRef, triggerIndex } = useInfiniteScrollTrigger();\n const onAction = useLatestOnAction(list);\n\n if (!table || listIsEmpty) {\n return null;\n }\n\n const tableClassName = clsx(\n styles.table,\n isLoading && !(list.infiniteScroll && isLoadingMore) && styles.isLoading,\n table.componentProps.className,\n );\n\n const rows = list.items.entries.map((item, index) => (\n <Row\n key={item.id}\n id={item.id}\n data={item.data}\n list={list}\n onAction={onAction}\n triggerRef={index === triggerIndex ? triggerRef : undefined}\n />\n ));\n\n return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\n aria-hidden={isInitiallyLoading}\n aria-busy={isLoading}\n >\n <TableHeaderView {...table.header.componentProps}>\n {table.header.columns.map((col, i) => (\n <TableColumnView key={i} {...col.componentProps} />\n ))}\n </TableHeaderView>\n <TableBodyView {...table.body.componentProps}>\n {isInitiallyLoading ? <TableBodyLoadingView /> : rows}\n </TableBodyView>\n </TableView>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAa,cAAkB;CAC7B,MAAM,OAAO,QAAQ;CACrB,MAAM,QAAQ,KAAK;CACnB,MAAM,cAAc,KAAK,WAAW;CAEpC,MAAM,YAAY,KAAK,OAAO,aAAa;CAC3C,MAAM,qBAAqB,KAAK,OAAO,sBAAsB;CAC7D,MAAM,gBAAgB,KAAK,OAAO,iBAAiB;CAEnD,MAAM,EAAE,YAAY,iBAAiB,yBAAyB;CAC9D,MAAM,WAAW,kBAAkB,IAAI;CAEvC,IAAI,CAAC,SAAS,aACZ,OAAO;CAGT,MAAM,iBAAiB,KACrBA,qBAAO,OACP,aAAa,EAAE,KAAK,kBAAkB,kBAAkBA,qBAAO,WAC/D,MAAM,eAAe,SACvB;CAEA,MAAM,OAAO,KAAK,MAAM,QAAQ,KAAK,MAAM,UACzC,oBAAC,KAAD;EAEE,IAAI,KAAK;EACT,MAAM,KAAK;EACL;EACI;EACV,YAAY,UAAU,eAAe,aAAa,KAAA;CACnD,GANM,KAAK,EAMX,CACF;CAED,OACE,qBAAC,WAAD;EACE,GAAI,KAAK;EACT,GAAI,MAAM;EACV,WAAW;EACX,eAAa;EACb,aAAW;EALb,UAAA,CAOE,oBAAC,iBAAD;GAAiB,GAAI,MAAM,OAAO;GAC/B,UAAA,MAAM,OAAO,QAAQ,KAAK,KAAK,MAC9B,oBAAC,iBAAD,EAAyB,GAAI,IAAI,eAAiB,GAA5B,CAA4B,CACnD;EACc,CAAA,GACjB,oBAAC,eAAD;GAAe,GAAI,MAAM,KAAK;GAC3B,UAAA,qBAAqB,oBAAC,sBAAD,CAAuB,CAAA,IAAI;EACpC,CAAA,CACN;;AAEf"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import Table_module_default from "../Table.module.mjs";
|
|
4
|
+
import TableRowView from "../../../../../views/TableRowView.mjs";
|
|
5
|
+
import TableCellView from "../../../../../views/TableCellView.mjs";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { memo } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/List/components/Table/components/Row.tsx
|
|
10
|
+
var RowImpl = (props) => {
|
|
11
|
+
const { id, data, list, onAction, triggerRef } = props;
|
|
12
|
+
const row = list.table?.body.row;
|
|
13
|
+
if (!row) return null;
|
|
14
|
+
return /* @__PURE__ */ jsx(TableRowView, {
|
|
15
|
+
...row.componentProps,
|
|
16
|
+
className: clsx(Table_module_default.row, onAction && Table_module_default.hasAction, row.componentProps.className),
|
|
17
|
+
id,
|
|
18
|
+
onAction: onAction ? () => onAction(data) : void 0,
|
|
19
|
+
...triggerRef ? { ref: triggerRef } : {},
|
|
20
|
+
children: row.cells.map((cell, i) => /* @__PURE__ */ jsx(TableCellView, {
|
|
21
|
+
...cell.componentProps,
|
|
22
|
+
children: cell.renderFn ? cell.renderFn(data, list) : void 0
|
|
23
|
+
}, i))
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var Row = memo(RowImpl, (prev, next) => prev.id === next.id && prev.data === next.data && prev.triggerRef === next.triggerRef && !!prev.onAction === !!next.onAction && !!prev.list.table?.body.row.rendersSameAs(next.list.table?.body.row));
|
|
27
|
+
Row.displayName = "Row";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Row, Row as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Row.mjs.map
|
package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.mjs","names":["styles"],"sources":["../../../../../../../../../../src/components/List/components/Table/components/Row.tsx"],"sourcesContent":["import type { Ref } from \"react\";\nimport { memo } from \"react\";\nimport clsx from \"clsx\";\nimport type { Key } from \"react-aria-components\";\nimport type ListModel from \"@/components/List/model/List\";\nimport TableRowView from \"@/views/TableRowView\";\nimport TableCellView from \"@/views/TableCellView\";\nimport styles from \"../Table.module.scss\";\n\ninterface Props {\n id: Key;\n data: never;\n list: ListModel<never>;\n /** Stable invoker of the list's latest `onAction` */\n onAction?: (data: never) => void;\n triggerRef?: Ref<HTMLTableRowElement>;\n}\n\nconst RowImpl = (props: Props) => {\n const { id, data, list, onAction, triggerRef } = props;\n const row = list.table?.body.row;\n\n if (!row) {\n return null;\n }\n\n return (\n <TableRowView\n {...row.componentProps}\n className={clsx(\n styles.row,\n onAction && styles.hasAction,\n row.componentProps.className,\n )}\n id={id}\n onAction={onAction ? () => onAction(data) : undefined}\n {...(triggerRef ? { ref: triggerRef } : {})}\n >\n {row.cells.map((cell, i) => (\n <TableCellView key={i} {...cell.componentProps}>\n {cell.renderFn ? cell.renderFn(data, list) : undefined}\n </TableCellView>\n ))}\n </TableRowView>\n );\n};\n\n// The list model is rebuilt on every render, so it cannot be compared by\n// identity. A row that declares `renderDependencies` re-renders only when its data,\n// those dependencies or a cell's props change — the cells' render functions\n// count by the dependencies. Without them, rows re-render with the list.\nexport const Row = memo(\n RowImpl,\n (prev, next) =>\n prev.id === next.id &&\n prev.data === next.data &&\n prev.triggerRef === next.triggerRef &&\n !!prev.onAction === !!next.onAction &&\n !!prev.list.table?.body.row.rendersSameAs(next.list.table?.body.row),\n);\nRow.displayName = \"Row\";\n\nexport default Row;\n"],"mappings":";;;;;;;;;AAkBA,IAAM,WAAW,UAAiB;CAChC,MAAM,EAAE,IAAI,MAAM,MAAM,UAAU,eAAe;CACjD,MAAM,MAAM,KAAK,OAAO,KAAK;CAE7B,IAAI,CAAC,KACH,OAAO;CAGT,OACE,oBAAC,cAAD;EACE,GAAI,IAAI;EACR,WAAW,KACTA,qBAAO,KACP,YAAYA,qBAAO,WACnB,IAAI,eAAe,SACrB;EACI;EACJ,UAAU,iBAAiB,SAAS,IAAI,IAAI,KAAA;EAC5C,GAAK,aAAa,EAAE,KAAK,WAAW,IAAI,CAAC;EAExC,UAAA,IAAI,MAAM,KAAK,MAAM,MACpB,oBAAC,eAAD;GAAuB,GAAI,KAAK;GAC7B,UAAA,KAAK,WAAW,KAAK,SAAS,MAAM,IAAI,IAAI,KAAA;EAChC,GAFK,CAEL,CAChB;CACW,CAAA;AAElB;AAMA,IAAa,MAAM,KACjB,UACC,MAAM,SACL,KAAK,OAAO,KAAK,MACjB,KAAK,SAAS,KAAK,QACnB,KAAK,eAAe,KAAK,cACzB,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,KAAK,YAC3B,CAAC,CAAC,KAAK,KAAK,OAAO,KAAK,IAAI,cAAc,KAAK,KAAK,OAAO,KAAK,GAAG,CACvE;AACA,IAAI,cAAc"}
|
package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
|
-
import __locale_default from "../../../../../../_virtual/
|
|
4
|
+
import __locale_default from "../../../../../../_virtual/_18.locale.mjs";
|
|
5
5
|
import { useList } from "./useList.mjs";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
7
|
import { announce } from "@react-aria/live-announcer";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
4
|
+
//#region src/components/List/hooks/useLatestOnAction.ts
|
|
5
|
+
/**
|
|
6
|
+
* A stable invoker of the list's latest `onAction`, or `undefined` without one.
|
|
7
|
+
* An event handler only ever needs to be the latest one, so items and rows do
|
|
8
|
+
* not re-render for an inline `onAction`.
|
|
9
|
+
*/
|
|
10
|
+
var useLatestOnAction = (list) => {
|
|
11
|
+
const onActionRef = useRef(list.onAction);
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
onActionRef.current = list.onAction;
|
|
14
|
+
});
|
|
15
|
+
const invokeOnAction = useCallback((data) => onActionRef.current?.(data), []);
|
|
16
|
+
return list.onAction ? invokeOnAction : void 0;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useLatestOnAction };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useLatestOnAction.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLatestOnAction.mjs","names":[],"sources":["../../../../../../../../src/components/List/hooks/useLatestOnAction.ts"],"sourcesContent":["import { useCallback, useLayoutEffect, useRef } from \"react\";\nimport type List from \"@/components/List/model/List\";\n\n/**\n * A stable invoker of the list's latest `onAction`, or `undefined` without one.\n * An event handler only ever needs to be the latest one, so items and rows do\n * not re-render for an inline `onAction`.\n */\nexport const useLatestOnAction = (list: List<never>) => {\n const onActionRef = useRef(list.onAction);\n useLayoutEffect(() => {\n onActionRef.current = list.onAction;\n });\n const invokeOnAction = useCallback(\n (data: never) => onActionRef.current?.(data),\n [],\n );\n return list.onAction ? invokeOnAction : undefined;\n};\n"],"mappings":";;;;;;;;;AAQA,IAAa,qBAAqB,SAAsB;CACtD,MAAM,cAAc,OAAO,KAAK,QAAQ;CACxC,sBAAsB;EACpB,YAAY,UAAU,KAAK;CAC7B,CAAC;CACD,MAAM,iBAAiB,aACpB,SAAgB,YAAY,UAAU,IAAI,GAC3C,CAAC,CACH;CACA,OAAO,KAAK,WAAW,iBAAiB,KAAA;AAC1C"}
|
|
@@ -43,6 +43,7 @@ var List = class List {
|
|
|
43
43
|
const { settingStorageKey, itemView, table, filters = [], sorting = [], batchesController, onChange, loader, search, onAction, getItemId, defaultViewMode, accordion = false, infiniteScroll = false, loadingItemsCount = 5, settingsStorageDefaults, emptyView, emptySearchResultView, ...componentProps } = shape;
|
|
44
44
|
const warnDeprecation = useWarnDeprecation();
|
|
45
45
|
if (itemView?.fallback !== void 0) warnDeprecation("The 'fallback' prop is deprecated and will be removed in a future release. Use 'loadingView' instead.");
|
|
46
|
+
if (itemView?.dependencies !== void 0) warnDeprecation("The 'dependencies' prop of 'List.Item' is deprecated and will be removed in a future release. Use 'renderDependencies' instead.");
|
|
46
47
|
this.settingsStorageDefaults = settingsStorageDefaults;
|
|
47
48
|
const generalSettingsStore = useSettings();
|
|
48
49
|
this.settingsStorage = settingStorageKey && generalSettingsStore ? new ListSettingsStore(this, generalSettingsStore, { storageKey: settingStorageKey }) : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.mjs","names":["BatchesController"],"sources":["../../../../../../../../src/components/List/model/List.ts"],"sourcesContent":["import { ItemCollection } from \"@/components/List/model/item/ItemCollection\";\nimport { BatchesController } from \"@/components/List/model/pagination/BatchesController\";\nimport { Filter } from \"./filter/Filter\";\nimport { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport ReactTable from \"@/components/List/model/ReactTable\";\nimport type {\n EmptyViewType,\n GetItemId,\n ItemActionFn,\n ListSettingsStorageDefaults,\n ListShape,\n ListSupportedComponentProps,\n} from \"@/components/List/model/types\";\nimport { IncrementalLoader } from \"@/components/List/model/loading/IncrementalLoader\";\nimport invariant from \"invariant\";\nimport { Search } from \"@/components/List/model/search/Search\";\nimport { ItemView } from \"@/components/List/model/item/ItemView\";\nimport { Table } from \"@/components/List/model/table/Table\";\nimport { useEffect, type ReactNode } from \"react\";\nimport { ListSettingsStore } from \"./ListSettingsStore\";\nimport { ListViewMode } from \"./ListViewMode\";\nimport { useSettings } from \"@/components/SettingsProvider/SettingsProvider\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport type {\n ListModelContext,\n ListSettingsPort,\n} from \"@mittwald/flow-components-base\";\nimport type { Table as ReactTableInstance } from \"@tanstack/table-core\";\n\nexport class List<T = unknown, TMeta = unknown> implements ListModelContext<T> {\n public readonly filters: (\n Filter<T, never, never> | DateRangeFilter<T, never>\n )[];\n public readonly itemView?: ItemView<T>;\n public readonly table?: Table<T>;\n public readonly search?: Search<T>;\n public readonly sorting: Sorting<T>[];\n public readonly items: ItemCollection<T>;\n public readonly reactTable: ReactTable<T>;\n public readonly batches: BatchesController<T>;\n public readonly loader: IncrementalLoader<T>;\n public readonly onAction?: ItemActionFn<T>;\n public readonly accordion: boolean;\n public readonly infiniteScroll: boolean;\n public readonly getItemId?: GetItemId<T>;\n public readonly componentProps: ListSupportedComponentProps;\n public metadata?: TMeta;\n public readonly settingsStorage?: ListSettingsStore<T>;\n public readonly loadingItemsCount;\n public readonly viewMode: ListViewMode<T>;\n public readonly emptyView?: ReactNode;\n public readonly emptySearchResultView?: ReactNode;\n public readonly settingsStorageDefaults?: ListSettingsStorageDefaults;\n\n public constructor(shape: ListShape<T, TMeta>) {\n const {\n settingStorageKey,\n itemView,\n table,\n filters = [],\n sorting = [],\n batchesController,\n onChange,\n loader,\n search,\n onAction,\n getItemId,\n defaultViewMode,\n accordion = false,\n infiniteScroll = false,\n loadingItemsCount = 5,\n settingsStorageDefaults,\n emptyView,\n emptySearchResultView,\n ...componentProps\n } = shape;\n\n const warnDeprecation = useWarnDeprecation();\n if (itemView?.fallback !== undefined) {\n warnDeprecation(\n \"The 'fallback' prop is deprecated and will be removed in a future release. Use 'loadingView' instead.\",\n );\n }\n\n this.settingsStorageDefaults = settingsStorageDefaults;\n const generalSettingsStore = useSettings();\n\n this.settingsStorage =\n settingStorageKey && generalSettingsStore\n ? new ListSettingsStore(this, generalSettingsStore, {\n storageKey: settingStorageKey,\n })\n : undefined;\n\n this.items = new ItemCollection(this);\n this.filters = filters.map((shape) =>\n shape.mode === \"dateRange\"\n ? new DateRangeFilter(this, shape)\n : new Filter(this, shape),\n );\n this.sorting = sorting.map((shape) => new Sorting<T>(this, shape));\n this.search = search ? new Search(this, search) : undefined;\n this.itemView = itemView ? new ItemView(this, itemView) : undefined;\n this.accordion = accordion;\n this.infiniteScroll = infiniteScroll;\n this.table = table ? new Table(this, table) : undefined;\n this.batches = new BatchesController(this, batchesController);\n\n /*\n * The controller no longer subscribes itself: the filters and the search\n * are this list's, and handing a list of concrete filters to a shared\n * model is the `Table<never>` variance trap. `IncrementalLoader` still\n * subscribes in its own constructor, which runs right after this, so the\n * order of the two resets is unchanged.\n */\n this.filters.forEach((f) => f.onFilterUpdated(() => this.batches.reset()));\n this.search?.onUpdated(() => this.batches.reset());\n this.componentProps = componentProps;\n /*\n * Before the loader: its state takes `getItemId` over in its constructor,\n * and a loader built first would never deduplicate.\n */\n this.getItemId = getItemId;\n this.loader = IncrementalLoader.useNew<T>(this, loader);\n this.onAction = onAction;\n this.loadingItemsCount = loadingItemsCount;\n this.reactTable = ReactTable.useNew(this, onChange, {\n manualFiltering: this.loader.manualFiltering,\n manualPagination: this.loader.manualPagination,\n manualSorting: this.loader.manualSorting,\n });\n this.viewMode = ListViewMode.useNew(this, { defaultViewMode });\n this.emptyView = emptyView;\n this.emptySearchResultView = emptySearchResultView;\n\n useEffect(() => {\n this.filters.forEach((f) => f.deleteUnknownFilterValues());\n }, [this.filters]);\n }\n\n /*\n * `ListModelContext` — what the shared model in\n * `@mittwald/flow-components-base` reaches for, so `Sorting` and `Search` can\n * keep being handed the list itself. Getters, because the model is built\n * before the table is.\n */\n public get dataTable(): ReactTableInstance<T> {\n return this.reactTable.table;\n }\n\n public get settings(): ListSettingsPort | undefined {\n return this.settingsStorage;\n }\n\n public get settingsDefaults(): ListSettingsStorageDefaults | undefined {\n return this.settingsStorageDefaults;\n }\n\n public getEmptyViewType(): EmptyViewType {\n return this.hasActiveFilters || this.search?.isSet ? \"search\" : \"list\";\n }\n\n public get hasActiveFilters(): boolean {\n return this.filters.some((f) => f.isActive());\n }\n\n public get visibleSorting() {\n return this.sorting.filter((s) => s.initialEnabled !== \"hidden\");\n }\n\n public static useNew<T, TMeta = unknown>(\n shape: ListShape<T, TMeta>,\n ): List<T, TMeta> {\n return new List<T, TMeta>(shape);\n }\n\n public getSorting(id: string): Sorting<T> {\n const sorting = this.sorting.find((s) => s.id === id);\n invariant(!!sorting, `Could not get Sorting (ID: ${id})`);\n return sorting;\n }\n\n public clearSorting(): void {\n return this.sorting.forEach((s) => s.clear());\n }\n\n public resetFilters(): void {\n return this.filters.forEach((f) => f.resetValues());\n }\n\n public clearFilters(): void {\n return this.filters.forEach((f) => f.clear());\n }\n\n public useIsEmpty(): boolean {\n return !this.loader.useIsLoading() && this.items.entries.length === 0;\n }\n}\n\nexport default List;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAa,OAAb,MAAa,KAAkE;CAC7E;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAmB,OAA4B;EAC7C,MAAM,EACJ,mBACA,UACA,OACA,UAAU,CAAC,GACX,UAAU,CAAC,GACX,mBACA,UACA,QACA,QACA,UACA,WACA,iBACA,YAAY,OACZ,iBAAiB,OACjB,oBAAoB,GACpB,yBACA,WACA,uBACA,GAAG,mBACD;EAEJ,MAAM,kBAAkB,mBAAmB;EAC3C,IAAI,UAAU,aAAa,KAAA,GACzB,gBACE,uGACF;EAGF,KAAK,0BAA0B;EAC/B,MAAM,uBAAuB,YAAY;EAEzC,KAAK,kBACH,qBAAqB,uBACjB,IAAI,kBAAkB,MAAM,sBAAsB,EAChD,YAAY,kBACd,CAAC,IACD,KAAA;EAEN,KAAK,QAAQ,IAAI,eAAe,IAAI;EACpC,KAAK,UAAU,QAAQ,KAAK,UAC1B,MAAM,SAAS,cACX,IAAI,gBAAgB,MAAM,KAAK,IAC/B,IAAI,OAAO,MAAM,KAAK,CAC5B;EACA,KAAK,UAAU,QAAQ,KAAK,UAAU,IAAI,QAAW,MAAM,KAAK,CAAC;EACjE,KAAK,SAAS,SAAS,IAAI,OAAO,MAAM,MAAM,IAAI,KAAA;EAClD,KAAK,WAAW,WAAW,IAAI,SAAS,MAAM,QAAQ,IAAI,KAAA;EAC1D,KAAK,YAAY;EACjB,KAAK,iBAAiB;EACtB,KAAK,QAAQ,QAAQ,IAAI,MAAM,MAAM,KAAK,IAAI,KAAA;EAC9C,KAAK,UAAU,IAAIA,sBAAkB,MAAM,iBAAiB;EAS5D,KAAK,QAAQ,SAAS,MAAM,EAAE,sBAAsB,KAAK,QAAQ,MAAM,CAAC,CAAC;EACzE,KAAK,QAAQ,gBAAgB,KAAK,QAAQ,MAAM,CAAC;EACjD,KAAK,iBAAiB;EAKtB,KAAK,YAAY;EACjB,KAAK,SAAS,kBAAkB,OAAU,MAAM,MAAM;EACtD,KAAK,WAAW;EAChB,KAAK,oBAAoB;EACzB,KAAK,aAAa,WAAW,OAAO,MAAM,UAAU;GAClD,iBAAiB,KAAK,OAAO;GAC7B,kBAAkB,KAAK,OAAO;GAC9B,eAAe,KAAK,OAAO;EAC7B,CAAC;EACD,KAAK,WAAW,aAAa,OAAO,MAAM,EAAE,gBAAgB,CAAC;EAC7D,KAAK,YAAY;EACjB,KAAK,wBAAwB;EAE7B,gBAAgB;GACd,KAAK,QAAQ,SAAS,MAAM,EAAE,0BAA0B,CAAC;EAC3D,GAAG,CAAC,KAAK,OAAO,CAAC;CACnB;CAQA,IAAW,YAAmC;EAC5C,OAAO,KAAK,WAAW;CACzB;CAEA,IAAW,WAAyC;EAClD,OAAO,KAAK;CACd;CAEA,IAAW,mBAA4D;EACrE,OAAO,KAAK;CACd;CAEA,mBAAyC;EACvC,OAAO,KAAK,oBAAoB,KAAK,QAAQ,QAAQ,WAAW;CAClE;CAEA,IAAW,mBAA4B;EACrC,OAAO,KAAK,QAAQ,MAAM,MAAM,EAAE,SAAS,CAAC;CAC9C;CAEA,IAAW,iBAAiB;EAC1B,OAAO,KAAK,QAAQ,QAAQ,MAAM,EAAE,mBAAmB,QAAQ;CACjE;CAEA,OAAc,OACZ,OACgB;EAChB,OAAO,IAAI,KAAe,KAAK;CACjC;CAEA,WAAkB,IAAwB;EACxC,MAAM,UAAU,KAAK,QAAQ,MAAM,MAAM,EAAE,OAAO,EAAE;EACpD,UAAU,CAAC,CAAC,SAAS,8BAA8B,GAAG,EAAE;EACxD,OAAO;CACT;CAEA,eAA4B;EAC1B,OAAO,KAAK,QAAQ,SAAS,MAAM,EAAE,MAAM,CAAC;CAC9C;CAEA,eAA4B;EAC1B,OAAO,KAAK,QAAQ,SAAS,MAAM,EAAE,YAAY,CAAC;CACpD;CAEA,eAA4B;EAC1B,OAAO,KAAK,QAAQ,SAAS,MAAM,EAAE,MAAM,CAAC;CAC9C;CAEA,aAA6B;EAC3B,OAAO,CAAC,KAAK,OAAO,aAAa,KAAK,KAAK,MAAM,QAAQ,WAAW;CACtE;AACF"}
|
|
1
|
+
{"version":3,"file":"List.mjs","names":["BatchesController"],"sources":["../../../../../../../../src/components/List/model/List.ts"],"sourcesContent":["import { ItemCollection } from \"@/components/List/model/item/ItemCollection\";\nimport { BatchesController } from \"@/components/List/model/pagination/BatchesController\";\nimport { Filter } from \"./filter/Filter\";\nimport { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport ReactTable from \"@/components/List/model/ReactTable\";\nimport type {\n EmptyViewType,\n GetItemId,\n ItemActionFn,\n ListSettingsStorageDefaults,\n ListShape,\n ListSupportedComponentProps,\n} from \"@/components/List/model/types\";\nimport { IncrementalLoader } from \"@/components/List/model/loading/IncrementalLoader\";\nimport invariant from \"invariant\";\nimport { Search } from \"@/components/List/model/search/Search\";\nimport { ItemView } from \"@/components/List/model/item/ItemView\";\nimport { Table } from \"@/components/List/model/table/Table\";\nimport { useEffect, type ReactNode } from \"react\";\nimport { ListSettingsStore } from \"./ListSettingsStore\";\nimport { ListViewMode } from \"./ListViewMode\";\nimport { useSettings } from \"@/components/SettingsProvider/SettingsProvider\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport type {\n ListModelContext,\n ListSettingsPort,\n} from \"@mittwald/flow-components-base\";\nimport type { Table as ReactTableInstance } from \"@tanstack/table-core\";\n\nexport class List<T = unknown, TMeta = unknown> implements ListModelContext<T> {\n public readonly filters: (\n Filter<T, never, never> | DateRangeFilter<T, never>\n )[];\n public readonly itemView?: ItemView<T>;\n public readonly table?: Table<T>;\n public readonly search?: Search<T>;\n public readonly sorting: Sorting<T>[];\n public readonly items: ItemCollection<T>;\n public readonly reactTable: ReactTable<T>;\n public readonly batches: BatchesController<T>;\n public readonly loader: IncrementalLoader<T>;\n public readonly onAction?: ItemActionFn<T>;\n public readonly accordion: boolean;\n public readonly infiniteScroll: boolean;\n public readonly getItemId?: GetItemId<T>;\n public readonly componentProps: ListSupportedComponentProps;\n public metadata?: TMeta;\n public readonly settingsStorage?: ListSettingsStore<T>;\n public readonly loadingItemsCount;\n public readonly viewMode: ListViewMode<T>;\n public readonly emptyView?: ReactNode;\n public readonly emptySearchResultView?: ReactNode;\n public readonly settingsStorageDefaults?: ListSettingsStorageDefaults;\n\n public constructor(shape: ListShape<T, TMeta>) {\n const {\n settingStorageKey,\n itemView,\n table,\n filters = [],\n sorting = [],\n batchesController,\n onChange,\n loader,\n search,\n onAction,\n getItemId,\n defaultViewMode,\n accordion = false,\n infiniteScroll = false,\n loadingItemsCount = 5,\n settingsStorageDefaults,\n emptyView,\n emptySearchResultView,\n ...componentProps\n } = shape;\n\n const warnDeprecation = useWarnDeprecation();\n if (itemView?.fallback !== undefined) {\n warnDeprecation(\n \"The 'fallback' prop is deprecated and will be removed in a future release. Use 'loadingView' instead.\",\n );\n }\n if (itemView?.dependencies !== undefined) {\n warnDeprecation(\n \"The 'dependencies' prop of 'List.Item' is deprecated and will be removed in a future release. Use 'renderDependencies' instead.\",\n );\n }\n\n this.settingsStorageDefaults = settingsStorageDefaults;\n const generalSettingsStore = useSettings();\n\n this.settingsStorage =\n settingStorageKey && generalSettingsStore\n ? new ListSettingsStore(this, generalSettingsStore, {\n storageKey: settingStorageKey,\n })\n : undefined;\n\n this.items = new ItemCollection(this);\n this.filters = filters.map((shape) =>\n shape.mode === \"dateRange\"\n ? new DateRangeFilter(this, shape)\n : new Filter(this, shape),\n );\n this.sorting = sorting.map((shape) => new Sorting<T>(this, shape));\n this.search = search ? new Search(this, search) : undefined;\n this.itemView = itemView ? new ItemView(this, itemView) : undefined;\n this.accordion = accordion;\n this.infiniteScroll = infiniteScroll;\n this.table = table ? new Table(this, table) : undefined;\n this.batches = new BatchesController(this, batchesController);\n\n /*\n * The controller no longer subscribes itself: the filters and the search\n * are this list's, and handing a list of concrete filters to a shared\n * model is the `Table<never>` variance trap. `IncrementalLoader` still\n * subscribes in its own constructor, which runs right after this, so the\n * order of the two resets is unchanged.\n */\n this.filters.forEach((f) => f.onFilterUpdated(() => this.batches.reset()));\n this.search?.onUpdated(() => this.batches.reset());\n this.componentProps = componentProps;\n /*\n * Before the loader: its state takes `getItemId` over in its constructor,\n * and a loader built first would never deduplicate.\n */\n this.getItemId = getItemId;\n this.loader = IncrementalLoader.useNew<T>(this, loader);\n this.onAction = onAction;\n this.loadingItemsCount = loadingItemsCount;\n this.reactTable = ReactTable.useNew(this, onChange, {\n manualFiltering: this.loader.manualFiltering,\n manualPagination: this.loader.manualPagination,\n manualSorting: this.loader.manualSorting,\n });\n this.viewMode = ListViewMode.useNew(this, { defaultViewMode });\n this.emptyView = emptyView;\n this.emptySearchResultView = emptySearchResultView;\n\n useEffect(() => {\n this.filters.forEach((f) => f.deleteUnknownFilterValues());\n }, [this.filters]);\n }\n\n /*\n * `ListModelContext` — what the shared model in\n * `@mittwald/flow-components-base` reaches for, so `Sorting` and `Search` can\n * keep being handed the list itself. Getters, because the model is built\n * before the table is.\n */\n public get dataTable(): ReactTableInstance<T> {\n return this.reactTable.table;\n }\n\n public get settings(): ListSettingsPort | undefined {\n return this.settingsStorage;\n }\n\n public get settingsDefaults(): ListSettingsStorageDefaults | undefined {\n return this.settingsStorageDefaults;\n }\n\n public getEmptyViewType(): EmptyViewType {\n return this.hasActiveFilters || this.search?.isSet ? \"search\" : \"list\";\n }\n\n public get hasActiveFilters(): boolean {\n return this.filters.some((f) => f.isActive());\n }\n\n public get visibleSorting() {\n return this.sorting.filter((s) => s.initialEnabled !== \"hidden\");\n }\n\n public static useNew<T, TMeta = unknown>(\n shape: ListShape<T, TMeta>,\n ): List<T, TMeta> {\n return new List<T, TMeta>(shape);\n }\n\n public getSorting(id: string): Sorting<T> {\n const sorting = this.sorting.find((s) => s.id === id);\n invariant(!!sorting, `Could not get Sorting (ID: ${id})`);\n return sorting;\n }\n\n public clearSorting(): void {\n return this.sorting.forEach((s) => s.clear());\n }\n\n public resetFilters(): void {\n return this.filters.forEach((f) => f.resetValues());\n }\n\n public clearFilters(): void {\n return this.filters.forEach((f) => f.clear());\n }\n\n public useIsEmpty(): boolean {\n return !this.loader.useIsLoading() && this.items.entries.length === 0;\n }\n}\n\nexport default List;\n"],"mappings":"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"}
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { ListDateRangeFilter } from "../../../../../../components-base/src/list/filter/ListDateRangeFilter.mjs";
|
|
4
4
|
import "../../../../../../components-base/src/index.mjs";
|
|
5
|
+
import { omit } from "remeda";
|
|
5
6
|
//#region src/components/List/model/filter/DateRangeFilter.tsx
|
|
6
7
|
/**
|
|
7
8
|
* React's date-range filter.
|
|
8
9
|
*
|
|
9
10
|
* The column, the comparison and the stored value are `ListDateRangeFilter` in
|
|
10
11
|
* `@mittwald/flow-components-base`, so the Vue binding filters the same dates
|
|
11
|
-
* the same way. What is left here
|
|
12
|
-
* Flow's `RangeCalendar` props
|
|
12
|
+
* the same way. What is left here are the options of the fields that pick the
|
|
13
|
+
* range: Flow's `RangeCalendar` props, or with `granularity: "minute"` those of
|
|
14
|
+
* the date and time fields.
|
|
13
15
|
*/
|
|
14
16
|
var DateRangeFilter = class extends ListDateRangeFilter {
|
|
15
17
|
dateRangeOptions;
|
|
@@ -17,6 +19,17 @@ var DateRangeFilter = class extends ListDateRangeFilter {
|
|
|
17
19
|
super(context, shape);
|
|
18
20
|
this.dateRangeOptions = shape.dateRangeOptions;
|
|
19
21
|
}
|
|
22
|
+
get granularity() {
|
|
23
|
+
return this.dateRangeOptions?.granularity ?? "day";
|
|
24
|
+
}
|
|
25
|
+
get rangeCalendarProps() {
|
|
26
|
+
const options = this.dateRangeOptions ?? {};
|
|
27
|
+
return options.granularity === "minute" ? {} : omit(options, ["granularity"]);
|
|
28
|
+
}
|
|
29
|
+
get dateTimeRangeOptions() {
|
|
30
|
+
const options = this.dateRangeOptions;
|
|
31
|
+
return options?.granularity === "minute" ? options : void 0;
|
|
32
|
+
}
|
|
20
33
|
getValue() {
|
|
21
34
|
return super.getValue();
|
|
22
35
|
}
|
package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeFilter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/DateRangeFilter.tsx"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type { ListModelContext } from \"@mittwald/flow-components-base\";\nimport type {
|
|
1
|
+
{"version":3,"file":"DateRangeFilter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/DateRangeFilter.tsx"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type { ListModelContext } from \"@mittwald/flow-components-base\";\nimport type {\n DateRangeFilterOptions,\n DateRangeFilterValue,\n FilterShape,\n} from \"@/components/List/model/filter/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type { RangeCalendarProps } from \"@/components/Calendar\";\nimport type { ReactNode } from \"react\";\nimport { omit } from \"remeda\";\nimport type { List } from \"@/components/List/model/List\";\nimport type { FilterValue } from \"@/components/List/model/filter/FilterValue\";\n\n/**\n * React's date-range filter.\n *\n * The column, the comparison and the stored value are `ListDateRangeFilter` in\n * `@mittwald/flow-components-base`, so the Vue binding filters the same dates\n * the same way. What is left here are the options of the fields that pick the\n * range: Flow's `RangeCalendar` props, or with `granularity: \"minute\"` those of\n * the date and time fields.\n */\nexport class DateRangeFilter<\n T = never,\n TProp extends PropertyName<T> = never,\n> extends ListDateRangeFilter<T, TProp, ReactNode> {\n public readonly dateRangeOptions?: DateRangeFilterOptions;\n\n public constructor(\n context: ListModelContext<T>,\n shape: FilterShape<T, TProp, never>,\n ) {\n super(context, shape as never);\n this.dateRangeOptions = shape.dateRangeOptions;\n }\n\n public get granularity(): \"day\" | \"minute\" {\n return this.dateRangeOptions?.granularity ?? \"day\";\n }\n\n public get rangeCalendarProps(): RangeCalendarProps {\n const options = this.dateRangeOptions ?? {};\n return options.granularity === \"minute\"\n ? {}\n : omit(options, [\"granularity\"]);\n }\n\n public get dateTimeRangeOptions() {\n const options = this.dateRangeOptions;\n return options?.granularity === \"minute\" ? options : undefined;\n }\n\n /*\n * Narrowed back to `@internationalized/date`'s types, because that is what\n * the calendar and the date fields take. The shared class is typed on the\n * numbers a date is made of, which every date library agrees on and nothing\n * else does.\n */\n public override getValue(): DateRangeFilterValue | null {\n return super.getValue() as DateRangeFilterValue | null;\n }\n\n public override setValue(range: DateRangeFilterValue | null): void {\n super.setValue(range);\n }\n\n /** The list this filter belongs to — `context`, typed as React's `List`. */\n public get list(): List<T> {\n return this.context as List<T>;\n }\n\n /* As in `Filter`: created by this filter, so each one's `filter` is React's. */\n public override get values(): FilterValue[] {\n return super.values as FilterValue[];\n }\n\n public override getArrayValue(): FilterValue[] {\n return super.getArrayValue() as FilterValue[];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,IAAa,kBAAb,cAGU,oBAAyC;CACjD;CAEA,YACE,SACA,OACA;EACA,MAAM,SAAS,KAAc;EAC7B,KAAK,mBAAmB,MAAM;CAChC;CAEA,IAAW,cAAgC;EACzC,OAAO,KAAK,kBAAkB,eAAe;CAC/C;CAEA,IAAW,qBAAyC;EAClD,MAAM,UAAU,KAAK,oBAAoB,CAAC;EAC1C,OAAO,QAAQ,gBAAgB,WAC3B,CAAC,IACD,KAAK,SAAS,CAAC,aAAa,CAAC;CACnC;CAEA,IAAW,uBAAuB;EAChC,MAAM,UAAU,KAAK;EACrB,OAAO,SAAS,gBAAgB,WAAW,UAAU,KAAA;CACvD;CAQA,WAAwD;EACtD,OAAO,MAAM,SAAS;CACxB;CAEA,SAAyB,OAA0C;EACjE,MAAM,SAAS,KAAK;CACtB;;CAGA,IAAW,OAAgB;EACzB,OAAO,KAAK;CACd;CAGA,IAAoB,SAAwB;EAC1C,OAAO,MAAM;CACf;CAEA,gBAA+C;EAC7C,OAAO,MAAM,cAAc;CAC7B;AACF"}
|
package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { resolveListDateRange } from "../../../../../../components-base/src/list/filter/dateRange.mjs";
|
|
4
|
+
import "../../../../../../components-base/src/index.mjs";
|
|
5
|
+
//#region src/components/List/model/filter/resolveDateRangeFilterValue.ts
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the value of a date range filter to the instants it spans, for
|
|
8
|
+
* filtering on the server side. Both bounds are inclusive: a date covers its
|
|
9
|
+
* whole day and a date with time its whole minute, in the user's local time
|
|
10
|
+
* zone. A missing side has no bound.
|
|
11
|
+
*/
|
|
12
|
+
var resolveDateRangeFilterValue = (range) => resolveListDateRange(range);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { resolveDateRangeFilterValue };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=resolveDateRangeFilterValue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDateRangeFilterValue.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/resolveDateRangeFilterValue.ts"],"sourcesContent":["import { resolveListDateRange } from \"@mittwald/flow-components-base\";\nimport type { DateRangeFilterValue } from \"@/components/List/model/filter/types\";\n\n/**\n * Resolves the value of a date range filter to the instants it spans, for\n * filtering on the server side. Both bounds are inclusive: a date covers its\n * whole day and a date with time its whole minute, in the user's local time\n * zone. A missing side has no bound.\n */\nexport const resolveDateRangeFilterValue = (\n range: DateRangeFilterValue,\n): { start?: Date; end?: Date } => resolveListDateRange(range);\n"],"mappings":";;;;;;;;;;;AASA,IAAa,+BACX,UACiC,qBAAqB,KAAK"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
+
import { isShallowEqual } from "remeda";
|
|
4
5
|
//#region src/components/List/model/item/ItemView.ts
|
|
5
|
-
var dependenciesAreEqual = (a, b) => a === b || !!a && !!b && a.length === b.length && a.every((dependency, index) => Object.is(dependency, b[index]));
|
|
6
6
|
var ItemView = class ItemView {
|
|
7
7
|
list;
|
|
8
8
|
textValue;
|
|
@@ -13,10 +13,12 @@ var ItemView = class ItemView {
|
|
|
13
13
|
showTiles;
|
|
14
14
|
showList;
|
|
15
15
|
tileMaxWidth;
|
|
16
|
+
renderDependencies;
|
|
16
17
|
dependencies;
|
|
17
18
|
renderFn;
|
|
19
|
+
lastComparison;
|
|
18
20
|
constructor(list, shape = {}) {
|
|
19
|
-
const { fallback, loadingView = fallback, textValue, href, target, defaultExpanded, renderFn, showTiles, showList = true, tileMaxWidth = 230, dependencies } = shape;
|
|
21
|
+
const { fallback, loadingView = fallback, textValue, href, target, defaultExpanded, renderFn, showTiles, showList = true, tileMaxWidth = 230, renderDependencies, dependencies } = shape;
|
|
20
22
|
this.list = list;
|
|
21
23
|
this.textValue = textValue;
|
|
22
24
|
this.renderFn = renderFn;
|
|
@@ -27,16 +29,27 @@ var ItemView = class ItemView {
|
|
|
27
29
|
this.showTiles = showTiles;
|
|
28
30
|
this.showList = showList;
|
|
29
31
|
this.tileMaxWidth = tileMaxWidth;
|
|
32
|
+
this.renderDependencies = renderDependencies;
|
|
30
33
|
this.dependencies = dependencies;
|
|
31
34
|
}
|
|
32
35
|
static fallbackRenderItemFn = (item) => createElement("pre", void 0, JSON.stringify(item));
|
|
33
36
|
/**
|
|
34
|
-
* Whether `other` would render
|
|
35
|
-
*
|
|
36
|
-
* and the dependencies
|
|
37
|
+
* Whether `other` would render the item holding `data` identically. The
|
|
38
|
+
* render function counts by its `renderDependencies` where given, otherwise
|
|
39
|
+
* by its identity and the deprecated `dependencies`. `textValue` and `href`
|
|
40
|
+
* count by what they return for `data`, so inline functions do not re-render
|
|
41
|
+
* the item. `defaultExpanded` is read on mount only, so it does not count at
|
|
42
|
+
* all.
|
|
37
43
|
*/
|
|
38
|
-
|
|
39
|
-
return !!other &&
|
|
44
|
+
rendersSameFor(other, data) {
|
|
45
|
+
return !!other && this.rendersSameContentAs(other) && this.textValue?.(data) === other.textValue?.(data) && this.href?.(data) === other.href?.(data) && this.target === other.target;
|
|
46
|
+
}
|
|
47
|
+
rendersSameContentAs(other) {
|
|
48
|
+
if (this.lastComparison?.other !== other) this.lastComparison = {
|
|
49
|
+
other,
|
|
50
|
+
result: this.renderDependencies || other.renderDependencies ? isShallowEqual(this.renderDependencies, other.renderDependencies) : this.renderFn === other.renderFn && isShallowEqual(this.dependencies, other.dependencies)
|
|
51
|
+
};
|
|
52
|
+
return this.lastComparison.result;
|
|
40
53
|
}
|
|
41
54
|
render(data) {
|
|
42
55
|
return (this.renderFn ?? ItemView.fallbackRenderItemFn)(data, this.list);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemView.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/item/ItemView.ts"],"sourcesContent":["import type {\n DependencyList,\n HTMLAttributeAnchorTarget,\n ReactElement,\n ReactNode,\n} from \"react\";\nimport { createElement } from \"react\";\nimport type { RenderItemFn } from \"@/components/List/model/item/types\";\nimport type List from \"@/components/List/model/List\";\n\nexport interface ItemViewShape<T> {\n textValue?: (data: T) => string;\n href?: (data: T) => string;\n target?: HTMLAttributeAnchorTarget;\n defaultExpanded?: (data: T) => boolean;\n renderFn?: RenderItemFn<T>;\n /** @deprecated Use loadingView instead */\n fallback?: ReactElement;\n loadingView?: ReactElement;\n showList?: boolean;\n showTiles?: boolean;\n tileMaxWidth?: number;\n /**\n *
|
|
1
|
+
{"version":3,"file":"ItemView.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/item/ItemView.ts"],"sourcesContent":["import type {\n DependencyList,\n HTMLAttributeAnchorTarget,\n ReactElement,\n ReactNode,\n} from \"react\";\nimport { createElement } from \"react\";\nimport type { RenderItemFn } from \"@/components/List/model/item/types\";\nimport type List from \"@/components/List/model/List\";\nimport { isShallowEqual } from \"remeda\";\n\nexport interface ItemViewShape<T> {\n /**\n * Runs on every render of the list to tell whether the item changed, so it\n * should be cheap and pure.\n */\n textValue?: (data: T) => string;\n /**\n * Runs on every render of the list to tell whether the item changed, so it\n * should be cheap and pure.\n */\n href?: (data: T) => string;\n target?: HTMLAttributeAnchorTarget;\n defaultExpanded?: (data: T) => boolean;\n renderFn?: RenderItemFn<T>;\n /** @deprecated Use loadingView instead */\n fallback?: ReactElement;\n loadingView?: ReactElement;\n showList?: boolean;\n showTiles?: boolean;\n tileMaxWidth?: number;\n /**\n * Everything the render function reads besides the item's data.\n *\n * With `renderDependencies`, an item re-renders only when its data or one of\n * these values changes. The render function's identity no longer counts, so a\n * function written inline in JSX keeps the item from re-rendering on every\n * render of its parent. List every value it reads from outside the item,\n * including state read through the `list` argument — one left out keeps the\n * item on the value it last rendered.\n *\n * Without it, an item re-renders whenever its render function changes\n * identity, which an inline function does on every render of its parent.\n */\n renderDependencies?: DependencyList;\n /**\n * @deprecated Use `renderDependencies` instead. `dependencies` only adds to\n * the render function's identity, so an inline render function still\n * re-renders the item on every render of its parent.\n */\n dependencies?: DependencyList;\n}\n\nexport class ItemView<T> {\n public readonly list: List<T>;\n public readonly textValue?: (data: T) => string;\n public readonly href?: (data: T) => string;\n public readonly target?: HTMLAttributeAnchorTarget;\n public readonly defaultExpanded?: (data: T) => boolean;\n public readonly loadingView?: ReactElement;\n public readonly showTiles?: boolean;\n public readonly showList?: boolean;\n public readonly tileMaxWidth: number;\n public readonly renderDependencies?: DependencyList;\n public readonly dependencies?: DependencyList;\n private readonly renderFn?: RenderItemFn<T>;\n private lastComparison?: { other: ItemView<T>; result: boolean };\n\n public constructor(list: List<T>, shape: ItemViewShape<T> = {}) {\n const {\n fallback,\n loadingView = fallback,\n textValue,\n href,\n target,\n defaultExpanded,\n renderFn,\n showTiles,\n showList = true,\n tileMaxWidth = 230,\n renderDependencies,\n dependencies,\n } = shape;\n this.list = list;\n this.textValue = textValue;\n this.renderFn = renderFn;\n this.href = href;\n this.target = target;\n this.defaultExpanded = defaultExpanded;\n this.loadingView = loadingView;\n this.showTiles = showTiles;\n this.showList = showList;\n this.tileMaxWidth = tileMaxWidth;\n this.renderDependencies = renderDependencies;\n this.dependencies = dependencies;\n }\n\n private static fallbackRenderItemFn: RenderItemFn<never> = (item) =>\n createElement(\"pre\", undefined, JSON.stringify(item));\n\n /**\n * Whether `other` would render the item holding `data` identically. The\n * render function counts by its `renderDependencies` where given, otherwise\n * by its identity and the deprecated `dependencies`. `textValue` and `href`\n * count by what they return for `data`, so inline functions do not re-render\n * the item. `defaultExpanded` is read on mount only, so it does not count at\n * all.\n */\n public rendersSameFor(other: ItemView<T> | undefined, data: T): boolean {\n return (\n !!other &&\n this.rendersSameContentAs(other) &&\n this.textValue?.(data) === other.textValue?.(data) &&\n this.href?.(data) === other.href?.(data) &&\n this.target === other.target\n );\n }\n\n // Every item of a render shares one item view, so the result is cached for\n // the last `other`.\n private rendersSameContentAs(other: ItemView<T>): boolean {\n if (this.lastComparison?.other !== other) {\n this.lastComparison = {\n other,\n result:\n this.renderDependencies || other.renderDependencies\n ? isShallowEqual(this.renderDependencies, other.renderDependencies)\n : this.renderFn === other.renderFn &&\n isShallowEqual(this.dependencies, other.dependencies),\n };\n }\n return this.lastComparison.result;\n }\n\n public render(data: T): ReactNode {\n const renderFn = (this.renderFn ??\n ItemView.fallbackRenderItemFn) as RenderItemFn<T>;\n return renderFn(data as never, this.list);\n }\n}\n"],"mappings":";;;;;AAqDA,IAAa,WAAb,MAAa,SAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAmB,MAAe,QAA0B,CAAC,GAAG;EAC9D,MAAM,EACJ,UACA,cAAc,UACd,WACA,MACA,QACA,iBACA,UACA,WACA,WAAW,MACX,eAAe,KACf,oBACA,iBACE;EACJ,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,OAAO;EACZ,KAAK,SAAS;EACd,KAAK,kBAAkB;EACvB,KAAK,cAAc;EACnB,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,eAAe;EACpB,KAAK,qBAAqB;EAC1B,KAAK,eAAe;CACtB;CAEA,OAAe,wBAA6C,SAC1D,cAAc,OAAO,KAAA,GAAW,KAAK,UAAU,IAAI,CAAC;;;;;;;;;CAUtD,eAAsB,OAAgC,MAAkB;EACtE,OACE,CAAC,CAAC,SACF,KAAK,qBAAqB,KAAK,KAC/B,KAAK,YAAY,IAAI,MAAM,MAAM,YAAY,IAAI,KACjD,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,IAAI,KACvC,KAAK,WAAW,MAAM;CAE1B;CAIA,qBAA6B,OAA6B;EACxD,IAAI,KAAK,gBAAgB,UAAU,OACjC,KAAK,iBAAiB;GACpB;GACA,QACE,KAAK,sBAAsB,MAAM,qBAC7B,eAAe,KAAK,oBAAoB,MAAM,kBAAkB,IAChE,KAAK,aAAa,MAAM,YACxB,eAAe,KAAK,cAAc,MAAM,YAAY;EAC5D;EAEF,OAAO,KAAK,eAAe;CAC7B;CAEA,OAAc,MAAoB;EAGhC,QAFkB,KAAK,YACrB,SAAS,qBAAA,CACK,MAAe,KAAK,IAAI;CAC1C;AACF"}
|
|
@@ -7,7 +7,7 @@ var TableCell = class {
|
|
|
7
7
|
componentProps;
|
|
8
8
|
loadingView;
|
|
9
9
|
constructor(row, shape = {}) {
|
|
10
|
-
const { renderFn, loadingView, ...rest } = shape;
|
|
10
|
+
const { renderFn, loadingView, children: ignoredChildren, ...rest } = shape;
|
|
11
11
|
this.row = row;
|
|
12
12
|
this.renderFn = renderFn;
|
|
13
13
|
this.componentProps = rest;
|