@mittwald/flow-remote-vue-components 1.6.0-next.6 → 1.6.0-next.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/js/RemoteRoot.mjs +1 -2
- package/dist/js/components-base/src/action/ActionState.mjs +1 -2
- package/dist/js/components-base/src/index.mjs +5 -2
- package/dist/js/components-base/src/lib/array.mjs +1 -2
- package/dist/js/components-base/src/list/ListModelContext.mjs +1 -2
- package/dist/js/components-base/src/list/filter/ListDateRangeFilter.mjs +2 -2
- package/dist/js/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
- package/dist/js/components-base/src/list/filter/ListFilter.mjs +5 -3
- package/dist/js/components-base/src/list/filter/ListFilter.mjs.map +1 -1
- package/dist/js/components-base/src/list/filter/ListFilterValue.mjs +1 -2
- package/dist/js/components-base/src/list/filter/dateRange.mjs +38 -15
- package/dist/js/components-base/src/list/filter/dateRange.mjs.map +1 -1
- package/dist/js/components-base/src/list/filter/dateTimeRangeFields.mjs +52 -0
- package/dist/js/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
- package/dist/js/components-base/src/list/filter/formatDateRange.mjs +24 -0
- package/dist/js/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
- package/dist/js/components-base/src/list/item/ListItem.mjs +1 -2
- package/dist/js/components-base/src/list/item/ListItemCollection.mjs +1 -2
- package/dist/js/components-base/src/list/loading/ListLoaderState.mjs +11 -7
- package/dist/js/components-base/src/list/loading/ListLoaderState.mjs.map +1 -1
- package/dist/js/components-base/src/list/loading/types.mjs +1 -2
- package/dist/js/components-base/src/list/pagination/ListBatchesController.mjs +1 -2
- package/dist/js/components-base/src/list/search/ListSearch.mjs +1 -2
- package/dist/js/components-base/src/list/sorting/ListSorting.mjs +1 -2
- package/dist/js/components-base/src/list/table/ListTable.mjs +1 -2
- package/dist/js/components-base/src/list/viewMode/ListViewMode.mjs +1 -2
- package/dist/js/components-base/src/overlay/OverlayState.mjs +193 -0
- package/dist/js/components-base/src/overlay/OverlayState.mjs.map +1 -0
- package/dist/js/index.mjs +2 -1
- package/dist/js/remote-vue-components/src/auto-generated/AccentBox.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Accordion.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/AccordionGroup.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ActionGroup.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Alert.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/AlertBadge.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/AlertIcon.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/AlertText.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Align.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Area.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Autocomplete.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Avatar.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/AvatarStack.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Badge.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Bar.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/BigNumber.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Breadcrumb.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Breadcrumb.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Button.mjs +2 -2
- package/dist/js/remote-vue-components/src/auto-generated/Button.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/CartesianChart.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/CartesianGrid.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ChartGrid.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ChartLegend.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ChartTooltip.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Chat.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Checkbox.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Checkbox.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/CheckboxButton.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/CheckboxButton.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/CheckboxGroup.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/CheckboxGroup.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ClearPropsContext.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/CoachMark.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/CoachMark.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/CodeBlock.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/CodeEditor.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Color.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ColumnLayout.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Combine.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ComboBox.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ComboBox.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ComponentPropsContextProvider.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Content.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenu.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenu.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenuContent.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenuContent.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenuSection.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ContextMenuTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ContextualHelp.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ContextualHelp.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ContextualHelpTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/CopyButton.mjs +2 -2
- package/dist/js/remote-vue-components/src/auto-generated/CopyButton.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/CounterBadge.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/DatePicker.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/DatePicker.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/DateRangePicker.mjs +2 -2
- package/dist/js/remote-vue-components/src/auto-generated/DateRangePicker.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/DialogTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Div.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/DonutChart.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/DonutChart.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/FieldDescription.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/FieldError.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/FieldError.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/FileCard.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/FileCardList.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/FileDropZone.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/FileField.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Flex.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Header.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/HeaderNavigation.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Heading.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Icon.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/IllustratedMessage.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Image.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ImageCropper.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Initials.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/InlineCode.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ItemsGridList.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ItemsGridList.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ItemsGridListItem.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ItemsGridListItem.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Kbd.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Label.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/LabeledValue.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/LayoutCard.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Legend.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/LightBoxGallery.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/LightBoxGalleryItem.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Line.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Link.mjs +2 -2
- package/dist/js/remote-vue-components/src/auto-generated/Link.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/ListEmptyView.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ListEmptyViewContainer.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ListItemViewContent.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ListSummary.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/LoadingSpinner.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Markdown.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/MarkdownEditor.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/MarkdownEditor.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/MenuItem.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/MenuItem.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/MenuTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Message.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/MessageSeparator.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/MessageThread.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Navigation.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/NavigationGroup.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Notification.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/NumberField.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/NumberField.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Option.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Option.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/OverlayContent.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/PasswordCreationField.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/PasswordCreationField.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/PopoverContent.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/ProgressBar.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/ProgressBar.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Radio.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Radio.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/RadioButton.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/RadioButton.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/RadioGroup.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/RadioGroup.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/RangeCalendar.mjs +2 -2
- package/dist/js/remote-vue-components/src/auto-generated/RangeCalendar.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Rating.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Rating.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/RatingSegment.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/RatingSegment.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/SearchField.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/SearchField.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Section.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Segment.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Segment.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/SegmentedControl.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/SegmentedControl.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Select.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Select.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Separator.mjs +6 -3
- package/dist/js/remote-vue-components/src/auto-generated/Separator.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Skeleton.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/SkeletonMode.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/SkeletonText.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Slider.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Slider.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Switch.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Switch.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Tab.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Tab.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TabNavigation.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/TabTitle.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TabTitle.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Table.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Table.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableBody.mjs +6 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableBody.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableCell.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableCell.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableColumn.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableColumn.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableFooterRow.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableFooterRow.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableHeader.mjs +6 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableHeader.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TableRow.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TableRow.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Tabs.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Tabs.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Text.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/TextArea.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TextArea.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TextField.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TextField.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TimeField.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/TimeField.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/Tooltip.mjs +3 -3
- package/dist/js/remote-vue-components/src/auto-generated/Tooltip.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/auto-generated/TooltipTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/TranslationProvider.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/Truncate.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/TunnelEntry.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/XAxis.mjs +1 -2
- package/dist/js/remote-vue-components/src/auto-generated/YAxis.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/Action.mjs +2 -3
- package/dist/js/remote-vue-components/src/components/ActionBatch.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/BrowserOnly.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/CountryOptions.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/DeprecationWarningProvider.mjs +16 -11
- package/dist/js/remote-vue-components/src/components/DeprecationWarningProvider.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/components/Form.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/LoadingIndicator.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/NotificationProvider.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/SettingsProvider.mjs +1 -2
- package/dist/js/remote-vue-components/src/components/Wrap.mjs +1 -2
- package/dist/js/remote-vue-components/src/composables/remoteContext.mjs +1 -2
- package/dist/js/remote-vue-components/src/composables/useComponentUsage.mjs +1 -2
- package/dist/js/remote-vue-components/src/composables/useIsMounted.mjs +1 -2
- package/dist/js/remote-vue-components/src/composables/useOnChange.mjs +1 -2
- package/dist/js/remote-vue-components/src/composables/useWatchPathname.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/IconSetProvider.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAI.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAIHosting.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAnalytics.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconApp.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAscending.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAttachment.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconAutoresponder.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconBackLink.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconBackup.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconBold.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCamera.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCertificate.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconChangelog.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCheck.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCheckboxChecked.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCheckboxEmpty.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCheckboxIndeterminate.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconChevronDown.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconChevronLeft.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconChevronRight.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconChevronUp.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconClose.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCode.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContainer.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContextMenu.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContextMenuVertical.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContract.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContractPartner.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconContributor.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCopy.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCronjob.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconCustomer.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDanger.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDashboard.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDatabase.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDate.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDelete.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDeliveryBox.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDescending.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDesktop.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDirectory.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDnsSubZone.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDnsZone.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDomain.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconDownload.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconEdit.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconEmail.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconEmailArchive.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconExtension.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconExternalLink.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconFailed.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconFeedback.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconFile.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconFilter.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconForwardAddress.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconForwardLink.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconHide.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconHome.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconImage.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconInfo.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconInvite.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconInvoice.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconItalic.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconKnowledgeHint.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLanguage.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLeadFyndr.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLink.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLock.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLockOpen.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconLogout.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMainUser.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMarketplace.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMaximize.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMember.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMenu.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMinimize.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMinus.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMittwald.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMobile.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMonitoring.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconMove.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconNewsletter.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconNotification.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconNumber.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconOrder.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconOrderedList.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPassword.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPath.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPause.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPayment.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPending.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPicture.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconPlus.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconProject.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconQuote.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconRadioOff.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconRadioOn.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconRedo.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconRefresh.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconRegistry.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSave.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSearch.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSecurity.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSend.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconServer.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSettings.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconShare.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconShow.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSorting.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSsh.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSshKey.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSshSftp.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconStack.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconStar.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconStarFilled.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconStart.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconStrikeThrough.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSubdomain.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSucceeded.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSuccess.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconSupport.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconTerminate.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconTicket.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconTime.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconUnavailable.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconUndo.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconUnorderedList.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconUpload.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconUser.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconVhost.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconView.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconVolume.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/components/IconWarning.mjs +1 -2
- package/dist/js/remote-vue-components/src/icons/lib/createIcon.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/composition.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/controlledRemoteValue.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/createFlowRemoteComponent.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/handlers.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/isRenderError.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/mobxSelector.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/propKeys.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/stringifyError.mjs +1 -2
- package/dist/js/remote-vue-components/src/lib/vModel.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/ActiveFilters.mjs +6 -4
- package/dist/js/remote-vue-components/src/list/ActiveFilters.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/list/AllFiltersModal.mjs +4 -4
- package/dist/js/remote-vue-components/src/list/AllFiltersModal.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/list/ComposableLoader.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/DateTimeRangeFields.mjs +99 -0
- package/dist/js/remote-vue-components/src/list/DateTimeRangeFields.mjs.map +1 -0
- package/dist/js/remote-vue-components/src/list/Footer.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/Header.mjs +13 -9
- package/dist/js/remote-vue-components/src/list/Header.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/list/Item.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/Items.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/List.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/ListItemView.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/Table.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/dateRangeFilter.mjs +15 -8
- package/dist/js/remote-vue-components/src/list/dateRangeFilter.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/list/itemContext.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/listContext.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/locales.mjs +15 -2
- package/dist/js/remote-vue-components/src/list/locales.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/list/metadata.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/model.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/settings.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/setupComponents.mjs +1 -2
- package/dist/js/remote-vue-components/src/list/styles.mjs +8 -3
- package/dist/js/remote-vue-components/src/list/styles.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/overlays/LightBox.mjs +1 -2
- package/dist/js/remote-vue-components/src/overlays/Modal.mjs +15 -20
- package/dist/js/remote-vue-components/src/overlays/Modal.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/overlays/Popover.mjs +1 -2
- package/dist/js/remote-vue-components/src/overlays/childProps.mjs +1 -2
- package/dist/js/remote-vue-components/src/overlays/createOverlayTrigger.mjs +1 -2
- package/dist/js/remote-vue-components/src/overlays/locales.mjs +1 -2
- package/dist/js/remote-vue-components/src/overlays/overlayController.mjs +58 -65
- package/dist/js/remote-vue-components/src/overlays/overlayController.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/overlays/triggers.mjs +1 -2
- package/dist/js/remote-vue-components/src/version.mjs +2 -3
- package/dist/types/_bundled/flow-components-base/index.d.ts +4 -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/_bundled/flow-components-base/list/loading/ListLoaderState.d.ts +5 -0
- package/dist/types/_bundled/flow-components-base/overlay/OverlayState.d.ts +94 -0
- package/dist/types/components/DeprecationWarningProvider.d.ts +2 -4
- package/dist/types/list/DateTimeRangeFields.d.ts +43 -0
- package/dist/types/list/dateRangeFilter.d.ts +6 -6
- package/dist/types/list/index.d.ts +1 -0
- package/dist/types/list/locales.d.ts +14 -0
- package/dist/types/list/styles.d.ts +6 -0
- package/dist/types/list/types.d.ts +8 -2
- package/dist/types/overlays/Modal.d.ts +2 -2
- package/dist/types/overlays/overlayController.d.ts +28 -18
- package/package.json +14 -14
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { composition } from "../lib/composition.mjs";
|
|
2
|
+
import { DatePicker } from "../auto-generated/DatePicker.mjs";
|
|
3
|
+
import { Div } from "../auto-generated/Div.mjs";
|
|
4
|
+
import { FieldError } from "../auto-generated/FieldError.mjs";
|
|
5
|
+
import { Label } from "../auto-generated/Label.mjs";
|
|
6
|
+
import { TimeField } from "../auto-generated/TimeField.mjs";
|
|
7
|
+
import watchMobxValue from "../lib/mobxSelector.mjs";
|
|
8
|
+
import { getListDateTimeRangeUpdate, isListDateTimeRangeEndBeforeStart, listDateTimeRangeFieldsFromValue, toListCalendarDate, toListTime } from "../../../components-base/src/list/filter/dateTimeRangeFields.mjs";
|
|
9
|
+
import "../../../components-base/src/index.mjs";
|
|
10
|
+
import { injectListModel } from "./listContext.mjs";
|
|
11
|
+
import { useListTexts } from "./locales.mjs";
|
|
12
|
+
import { className, dateTimeRangeStyles } from "./styles.mjs";
|
|
13
|
+
import { defineComponent, h, shallowRef, useId, watch } from "vue";
|
|
14
|
+
// src/list/DateTimeRangeFields.ts
|
|
15
|
+
/**
|
|
16
|
+
* Flow's `DateTimeRangeFields`: start and end, each a date and a time, for a
|
|
17
|
+
* filter with `granularity: "minute"`.
|
|
18
|
+
*
|
|
19
|
+
* Which input is valid and when it applies is `components-base`'s
|
|
20
|
+
* (`getListDateTimeRangeUpdate`), so both bindings apply the same ranges. What
|
|
21
|
+
* is held here is the input itself, which may be invalid for a while — a year
|
|
22
|
+
* typed digit by digit, an end before its start — while the filter keeps the
|
|
23
|
+
* last valid range.
|
|
24
|
+
*/
|
|
25
|
+
var DateTimeRangeFields = defineComponent({
|
|
26
|
+
name: "ListDateTimeRangeFields",
|
|
27
|
+
props: {
|
|
28
|
+
filter: {
|
|
29
|
+
type: Object,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
class: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: void 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setup(props) {
|
|
38
|
+
const list = injectListModel();
|
|
39
|
+
const texts = useListTexts();
|
|
40
|
+
const rangeErrorId = useId();
|
|
41
|
+
const tableRevision = watchMobxValue(() => list.listTable.revision);
|
|
42
|
+
let appliedValue = props.filter.getValue();
|
|
43
|
+
const fields = shallowRef(listDateTimeRangeFieldsFromValue(appliedValue));
|
|
44
|
+
watch(tableRevision, () => {
|
|
45
|
+
const value = props.filter.getValue();
|
|
46
|
+
if (value !== appliedValue) {
|
|
47
|
+
appliedValue = value;
|
|
48
|
+
fields.value = listDateTimeRangeFieldsFromValue(value);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const update = (change) => {
|
|
52
|
+
const next = {
|
|
53
|
+
...fields.value,
|
|
54
|
+
...change
|
|
55
|
+
};
|
|
56
|
+
fields.value = next;
|
|
57
|
+
const newValue = getListDateTimeRangeUpdate(next, appliedValue, props.filter.dateTimeRangeLimits);
|
|
58
|
+
if (newValue === void 0) return;
|
|
59
|
+
appliedValue = newValue;
|
|
60
|
+
if (newValue) props.filter.setValue(newValue);
|
|
61
|
+
else props.filter.clear();
|
|
62
|
+
};
|
|
63
|
+
const label = (key) => () => h(Label, { optional: false }, () => texts.value(key));
|
|
64
|
+
return () => {
|
|
65
|
+
const limits = props.filter.dateTimeRangeLimits;
|
|
66
|
+
const minValue = toListCalendarDate(limits?.minValue);
|
|
67
|
+
const maxValue = toListCalendarDate(limits?.maxValue);
|
|
68
|
+
const hasRangeError = isListDateTimeRangeEndBeforeStart(fields.value);
|
|
69
|
+
const describedBy = hasRangeError ? rangeErrorId : void 0;
|
|
70
|
+
const datePicker = (side, labelKey) => h(DatePicker, {
|
|
71
|
+
value: fields.value[side],
|
|
72
|
+
onChange: (date) => update({ [side]: toListCalendarDate(date) }),
|
|
73
|
+
minValue,
|
|
74
|
+
maxValue,
|
|
75
|
+
"aria-describedby": describedBy,
|
|
76
|
+
isDateUnavailable: limits?.isDateUnavailable
|
|
77
|
+
}, () => [label(labelKey)(), h(FieldError)]);
|
|
78
|
+
const timeField = (side, labelKey) => h(TimeField, {
|
|
79
|
+
value: fields.value[side],
|
|
80
|
+
onChange: (time) => update({ [side]: toListTime(time) }),
|
|
81
|
+
"aria-describedby": describedBy
|
|
82
|
+
}, label(labelKey));
|
|
83
|
+
return h(Div, { class: className(dateTimeRangeStyles.fields, props.class) }, () => [
|
|
84
|
+
datePicker("startDate", "dateRange.startDate"),
|
|
85
|
+
timeField("startTime", "dateRange.startTime"),
|
|
86
|
+
datePicker("endDate", "dateRange.endDate"),
|
|
87
|
+
timeField("endTime", "dateRange.endTime"),
|
|
88
|
+
hasRangeError ? h(FieldError, {
|
|
89
|
+
id: rangeErrorId,
|
|
90
|
+
class: dateTimeRangeStyles.rangeError
|
|
91
|
+
}, () => texts.value("dateRange.endBeforeStart")) : null
|
|
92
|
+
]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
composition(DateTimeRangeFields);
|
|
97
|
+
export { DateTimeRangeFields, DateTimeRangeFields as default };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=DateTimeRangeFields.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeRangeFields.mjs","names":[],"sources":["../../../../../src/list/DateTimeRangeFields.ts"],"sourcesContent":["import {\n DatePicker,\n Div,\n FieldError,\n Label,\n TimeField,\n} from \"@/auto-generated\";\nimport { watchMobxValue } from \"@/lib/mobxSelector\";\nimport {\n getListDateTimeRangeUpdate,\n isListDateTimeRangeEndBeforeStart,\n listDateTimeRangeFieldsFromValue,\n toListCalendarDate,\n toListTime,\n type ListDateRange,\n type ListDateTimeRangeFields,\n type ListDateTimeRangeLimits,\n} from \"@mittwald/flow-components-base\";\nimport {\n defineComponent,\n h,\n shallowRef,\n useId,\n watch,\n type PropType,\n} from \"vue\";\nimport { composition } from \"@/lib/composition\";\nimport { injectListModel } from \"./listContext\";\nimport { useListTexts, type ListTextKey } from \"./locales\";\nimport { className, dateTimeRangeStyles } from \"./styles\";\n\n/** What the fields need of a date-range filter, and nothing more. */\nexport interface DateTimeRangeFilter {\n readonly dateTimeRangeLimits?: ListDateTimeRangeLimits;\n getValue(): ListDateRange | null;\n setValue(range: ListDateRange): void;\n clear(): void;\n}\n\n/**\n * Flow's `DateTimeRangeFields`: start and end, each a date and a time, for a\n * filter with `granularity: \"minute\"`.\n *\n * Which input is valid and when it applies is `components-base`'s\n * (`getListDateTimeRangeUpdate`), so both bindings apply the same ranges. What\n * is held here is the input itself, which may be invalid for a while — a year\n * typed digit by digit, an end before its start — while the filter keeps the\n * last valid range.\n */\nexport const DateTimeRangeFields = defineComponent({\n name: \"ListDateTimeRangeFields\",\n\n props: {\n filter: {\n type: Object as PropType<DateTimeRangeFilter>,\n required: true,\n },\n class: { type: String, default: undefined },\n },\n\n setup(props) {\n const list = injectListModel();\n const texts = useListTexts();\n const rangeErrorId = useId();\n\n /* The filter's value is table state, read through the table's revision. */\n const tableRevision = watchMobxValue(() => list.listTable.revision);\n\n let appliedValue = props.filter.getValue();\n const fields = shallowRef(listDateTimeRangeFieldsFromValue(appliedValue));\n\n /* A range set elsewhere — the chip, \"Reset filters\" — replaces the input. */\n watch(tableRevision, () => {\n const value = props.filter.getValue();\n if (value !== appliedValue) {\n appliedValue = value;\n fields.value = listDateTimeRangeFieldsFromValue(value);\n }\n });\n\n const update = (change: Partial<ListDateTimeRangeFields>) => {\n const next = { ...fields.value, ...change };\n fields.value = next;\n\n const newValue = getListDateTimeRangeUpdate(\n next,\n appliedValue,\n props.filter.dateTimeRangeLimits,\n );\n if (newValue === undefined) {\n return;\n }\n\n appliedValue = newValue;\n\n if (newValue) {\n props.filter.setValue(newValue);\n } else {\n props.filter.clear();\n }\n };\n\n const label = (key: ListTextKey) => () =>\n h(Label, { optional: false }, () => texts.value(key));\n\n return () => {\n const limits = props.filter.dateTimeRangeLimits;\n const minValue = toListCalendarDate(limits?.minValue);\n const maxValue = toListCalendarDate(limits?.maxValue);\n const hasRangeError = isListDateTimeRangeEndBeforeStart(fields.value);\n const describedBy = hasRangeError ? rangeErrorId : undefined;\n\n const datePicker = (\n side: \"startDate\" | \"endDate\",\n labelKey: ListTextKey,\n ) =>\n h(\n DatePicker,\n {\n value: fields.value[side],\n onChange: (date: Parameters<typeof toListCalendarDate>[0]) =>\n update({ [side]: toListCalendarDate(date) }),\n minValue,\n maxValue,\n \"aria-describedby\": describedBy,\n isDateUnavailable: limits?.isDateUnavailable,\n } as never,\n () => [label(labelKey)(), h(FieldError)],\n );\n\n const timeField = (\n side: \"startTime\" | \"endTime\",\n labelKey: ListTextKey,\n ) =>\n h(\n TimeField,\n {\n value: fields.value[side],\n onChange: (time: Parameters<typeof toListTime>[0]) =>\n update({ [side]: toListTime(time) }),\n \"aria-describedby\": describedBy,\n } as never,\n label(labelKey),\n );\n\n return h(\n Div,\n { class: className(dateTimeRangeStyles.fields, props.class) },\n () => [\n datePicker(\"startDate\", \"dateRange.startDate\"),\n timeField(\"startTime\", \"dateRange.startTime\"),\n datePicker(\"endDate\", \"dateRange.endDate\"),\n timeField(\"endTime\", \"dateRange.endTime\"),\n hasRangeError\n ? h(\n FieldError,\n { id: rangeErrorId, class: dateTimeRangeStyles.rangeError },\n () => texts.value(\"dateRange.endBeforeStart\"),\n )\n : null,\n ],\n );\n };\n },\n});\n\ncomposition(DateTimeRangeFields);\n\nexport default DateTimeRangeFields;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa,sBAAsB,gBAAgB;CACjD,MAAM;CAEN,OAAO;EACL,QAAQ;GACN,MAAM;GACN,UAAU;EACZ;EACA,OAAO;GA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,aAEA,EACE,WACA;IACE,OAAO,OAAO,MAAM;IACpB,WAAW,SACT,OAAO,GAAG,OAAO,WAAW,IAAI,EAAE,CAAC;IACrC,oBAAoB;GACtB,GACA,MAAM,QAAQ,CAChB;GAEF,OAAO,EACL,KACA,EAAE,OAAO,UAAU,oBAAoB,QAAQ,MAAM,KAAK,EAAE,SACtD;IACJ,WAAW,aAAa,qBAAqB;IAC7C,UAAU,aAAa,qBAAqB;IAC5C,WAAW,WAAW,mBAAmB;IACzC,UAAU,WAAW,mBAAmB;IACxC,gBACI,EACE,YACA;KAAE,IAAI;KAAc,OAAO,oBAAoB;IAAW,SACpD,MAAM,MAAM,0BAA0B,CAC9C,IACA;GACN,CACF;EACF;CACF;AACF,CAAC;AAED,YAAY,mBAAmB"}
|
|
@@ -8,7 +8,7 @@ import { injectListModel } from "./listContext.mjs";
|
|
|
8
8
|
import { useListTexts } from "./locales.mjs";
|
|
9
9
|
import { listStyles } from "./styles.mjs";
|
|
10
10
|
import { defineComponent, h } from "vue";
|
|
11
|
-
|
|
11
|
+
// src/list/Footer.ts
|
|
12
12
|
/** How many items are shown, and the way to ask for more. */
|
|
13
13
|
var Footer = defineComponent({
|
|
14
14
|
name: "ListFooter",
|
|
@@ -47,7 +47,6 @@ var Footer = defineComponent({
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
composition(Footer);
|
|
50
|
-
//#endregion
|
|
51
50
|
export { Footer, Footer as default };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=Footer.mjs.map
|
|
@@ -16,16 +16,16 @@ import watchMobxValue from "../lib/mobxSelector.mjs";
|
|
|
16
16
|
import { createOverlayController } from "../overlays/overlayController.mjs";
|
|
17
17
|
import { injectListModel } from "./listContext.mjs";
|
|
18
18
|
import { useListTexts } from "./locales.mjs";
|
|
19
|
-
import { listStyles } from "./styles.mjs";
|
|
19
|
+
import { dateTimeRangeStyles, listStyles } from "./styles.mjs";
|
|
20
20
|
import { Popover } from "../overlays/Popover.mjs";
|
|
21
21
|
import { PopoverTrigger } from "../overlays/triggers.mjs";
|
|
22
22
|
import { isDateRangeFilter } from "./dateRangeFilter.mjs";
|
|
23
23
|
import { ActiveFilters } from "./ActiveFilters.mjs";
|
|
24
|
+
import { DateTimeRangeFields } from "./DateTimeRangeFields.mjs";
|
|
24
25
|
import { AllFiltersModal } from "./AllFiltersModal.mjs";
|
|
25
26
|
import { defineComponent, h, onBeforeUnmount, ref, watch } from "vue";
|
|
26
|
-
|
|
27
|
+
// src/list/Header.ts
|
|
27
28
|
var autoSubmitTimeout = 500;
|
|
28
|
-
var dateRangeCalendarClass = "flow--list--header--filter-context-menu--calendar";
|
|
29
29
|
var availableViewModes = (shape) => {
|
|
30
30
|
const modes = [];
|
|
31
31
|
if (shape.itemView?.showList) modes.push("list");
|
|
@@ -67,11 +67,12 @@ var renderSortingMenu = (list, texts, isDisabled) => {
|
|
|
67
67
|
}, () => `${sorting.name ?? String(sorting.property)} ${sorting.directionName ?? ""}`.trim())))]);
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
70
|
-
* A date-range filter is a calendar in a popover, not a menu of values
|
|
70
|
+
* A date-range filter is a calendar in a popover, not a menu of values — or,
|
|
71
|
+
* with `granularity: "minute"`, date and time fields.
|
|
71
72
|
*
|
|
72
73
|
* The same shape Flow's React list gives it — the calendar closes the popover
|
|
73
74
|
* when a range is picked, because a range is complete the moment its second end
|
|
74
|
-
* is.
|
|
75
|
+
* is. The fields leave it open: they apply as they are typed.
|
|
75
76
|
*/
|
|
76
77
|
var renderDateRangeFilter = (filter, isDisabled, calendarLabel, controller) => h(PopoverTrigger, {
|
|
77
78
|
key: filter.storageKey,
|
|
@@ -80,9 +81,12 @@ var renderDateRangeFilter = (filter, isDisabled, calendarLabel, controller) => h
|
|
|
80
81
|
placement: "bottom end",
|
|
81
82
|
isDialogContent: true,
|
|
82
83
|
"aria-label": calendarLabel
|
|
83
|
-
}, () => h(
|
|
84
|
-
|
|
85
|
-
class:
|
|
84
|
+
}, () => filter.granularity === "minute" ? h(DateTimeRangeFields, {
|
|
85
|
+
filter,
|
|
86
|
+
class: dateTimeRangeStyles.popover
|
|
87
|
+
}) : h(RangeCalendar, {
|
|
88
|
+
...filter.rangeCalendarProps,
|
|
89
|
+
class: dateTimeRangeStyles.calendar,
|
|
86
90
|
value: filter.getValue(),
|
|
87
91
|
onChange: (range) => {
|
|
88
92
|
filter.setValue(range);
|
|
@@ -185,6 +189,7 @@ var Header = defineComponent({
|
|
|
185
189
|
viewModes: modes
|
|
186
190
|
}),
|
|
187
191
|
list.search ? h(SearchField, {
|
|
192
|
+
key: isDisabled ? "disabled" : "enabled",
|
|
188
193
|
class: listStyles.searchField,
|
|
189
194
|
isDisabled,
|
|
190
195
|
autoFocus: searchShape?.autoFocus,
|
|
@@ -201,7 +206,6 @@ var Header = defineComponent({
|
|
|
201
206
|
}
|
|
202
207
|
});
|
|
203
208
|
composition(Header);
|
|
204
|
-
//#endregion
|
|
205
209
|
export { Header, Header as default };
|
|
206
210
|
|
|
207
211
|
//# sourceMappingURL=Header.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.mjs","names":[],"sources":["../../../../../src/list/Header.ts"],"sourcesContent":["import {\n Button,\n ContextMenu,\n ContextMenuTrigger,\n Div,\n MenuItem,\n RangeCalendar,\n SearchField,\n Text,\n} from \"@/auto-generated\";\nimport { Popover } from \"@/overlays/Popover\";\nimport { PopoverTrigger } from \"@/overlays/triggers\";\nimport {\n IconAscending,\n IconDescending,\n IconFilter,\n IconSorting,\n IconView,\n} from \"@/icons\";\nimport { watchMobxValue } from \"@/lib/mobxSelector\";\nimport {\n createOverlayController,\n type OverlayController,\n} from \"@/overlays/overlayController\";\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n ref,\n watch,\n type VNodeChild,\n} from \"vue\";\nimport { ActiveFilters } from \"./ActiveFilters\";\nimport { AllFiltersModal } from \"./AllFiltersModal\";\nimport { isDateRangeFilter } from \"./dateRangeFilter\";\nimport { injectListModel, type AnyListModel } from \"./listContext\";\nimport { useListTexts, type ListTextFormatter } from \"./locales\";\nimport type { ListRenderShape } from \"./model\";\nimport { listStyles } from \"./styles\";\nimport type { ListRendered } from \"./types\";\nimport { composition } from \"@/lib/composition\";\n\nconst autoSubmitTimeout = 500;\n\n/* `FilterContextMenus.module.scss`'s `.calendar`. */\nconst dateRangeCalendarClass =\n \"flow--list--header--filter-context-menu--calendar\";\n\n/*\n * What the header needs of a sorting and of a filter, and nothing more.\n *\n * Not the classes themselves: a list of concrete filters is not assignable to\n * a list of generic ones, because a row model sits in a contravariant position\n * deep inside `Column`, so `Table<any>` and `Table<never>` never meet. Reading\n * only the members it renders keeps the header out of that entirely.\n */\ninterface HeaderSorting {\n readonly id: string;\n readonly name?: string;\n readonly property: unknown;\n readonly direction: \"asc\" | \"desc\";\n readonly directionName?: string;\n isSorted(): boolean;\n enable(): void;\n}\n\ninterface HeaderFilterValue {\n readonly id: string;\n readonly isActive: boolean;\n toggle(): void;\n render(): ListRendered;\n}\n\ninterface HeaderDateRangeFilter {\n readonly storageKey: string;\n readonly name?: string;\n readonly property: unknown;\n readonly dateRangeOptions?: Record<string, unknown>;\n getValue(): unknown;\n setValue(range: unknown): void;\n}\n\ninterface HeaderFilter {\n readonly storageKey: string;\n readonly mode: string;\n readonly priority: \"primary\" | \"secondary\";\n readonly name?: string;\n readonly property: unknown;\n readonly values: HeaderFilterValue[];\n readonly isSelectAllAvailable: boolean;\n selectAll(): void;\n setActiveValueIds(ids: Iterable<unknown>): void;\n}\n\n/** Which layouts this list can actually show. */\ntype ViewMode = \"list\" | \"table\" | \"tiles\";\n\nconst availableViewModes = (shape: ListRenderShape<never>): ViewMode[] => {\n const modes: ViewMode[] = [];\n if (shape.itemView?.showList) {\n modes.push(\"list\");\n }\n if (shape.table) {\n modes.push(\"table\");\n }\n if (shape.itemView?.showTiles) {\n modes.push(\"tiles\");\n }\n return modes;\n};\n\nconst outlineButton = (isDisabled: boolean) => ({\n variant: \"outline\" as const,\n color: \"secondary\" as const,\n class: listStyles.hideOnMobile,\n isDisabled,\n});\n\nconst renderViewModeMenu = (\n list: AnyListModel,\n modes: ViewMode[],\n texts: ListTextFormatter,\n isDisabled: boolean,\n selected: ViewMode,\n): VNodeChild => {\n if (modes.length <= 1) {\n return null;\n }\n\n return h(ContextMenuTrigger, null, () => [\n h(\n Button,\n { ...outlineButton(isDisabled), \"aria-label\": texts(\"settings\") },\n () => [\n h(Text, null, () => texts(`settings.viewMode.${selected}`)),\n h(IconView),\n ],\n ),\n h(ContextMenu, { selectionMode: \"single\", selectedKeys: [selected] }, () =>\n modes.map((mode) =>\n h(\n MenuItem,\n { key: mode, id: mode, onAction: () => list.viewMode.set(mode) },\n () => texts(`settings.viewMode.${mode}`),\n ),\n ),\n ),\n ]);\n};\n\nconst renderSortingMenu = (\n list: AnyListModel,\n texts: ListTextFormatter,\n isDisabled: boolean,\n): VNodeChild => {\n const sortings = list.visibleSorting as HeaderSorting[];\n\n if (sortings.length === 0) {\n return null;\n }\n\n const active = sortings.find((s) => s.isSorted());\n\n return h(ContextMenuTrigger, null, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () =>\n active ? (active.name ?? String(active.property)) : texts(\"sorting\"),\n ),\n h(\n active\n ? active.direction === \"asc\"\n ? IconAscending\n : IconDescending\n : IconSorting,\n ),\n ]),\n h(\n ContextMenu,\n {\n selectionMode: \"single\",\n selectedKeys: active ? [active.id] : [],\n },\n () =>\n sortings.map((sorting) =>\n h(\n MenuItem,\n {\n key: sorting.id,\n id: sorting.id,\n onAction: () => sorting.enable(),\n },\n () =>\n `${sorting.name ?? String(sorting.property)} ${sorting.directionName ?? \"\"}`.trim(),\n ),\n ),\n ),\n ]);\n};\n\n/**\n * A date-range filter is a calendar in a popover, not a menu of values.\n *\n * The same shape Flow's React list gives it — the calendar closes the popover\n * when a range is picked, because a range is complete the moment its second end\n * is.\n */\nconst renderDateRangeFilter = (\n filter: HeaderDateRangeFilter,\n isDisabled: boolean,\n calendarLabel: string,\n controller: OverlayController,\n): VNodeChild =>\n h(PopoverTrigger, { key: filter.storageKey, controller }, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () => filter.name ?? String(filter.property)),\n h(IconFilter),\n ]),\n h(\n Popover,\n {\n placement: \"bottom end\",\n isDialogContent: true,\n \"aria-label\": calendarLabel,\n },\n () =>\n /*\n * Cast at the call, because the options are whatever the consumer\n * handed the filter: an open record does not match a typed component's\n * props, and TypeScript then resolves `h` to its instance overload.\n */\n h(RangeCalendar, {\n ...filter.dateRangeOptions,\n class: dateRangeCalendarClass,\n value: filter.getValue(),\n onChange: (range: unknown) => {\n filter.setValue(range);\n controller.close();\n },\n } as never),\n ),\n ]);\n\nconst renderFilterMenu = (\n filter: HeaderFilter,\n isDisabled: boolean,\n): VNodeChild => {\n const selectionMode = filter.mode === \"one\" ? \"single\" : \"multiple\";\n const values = filter.values;\n\n return h(ContextMenuTrigger, { key: filter.storageKey }, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () => filter.name ?? String(filter.property)),\n h(IconFilter),\n ]),\n h(\n ContextMenu,\n {\n selectionMode,\n selectedKeys: values.filter((v) => v.isActive).map((v) => v.id),\n /*\n * Flow's: a multiple-choice menu reports its whole selection, and the\n * \"Select all\" entry the host adds reports it as `\"all\"`.\n */\n onSelectionChange:\n selectionMode === \"multiple\"\n ? (keys: unknown) =>\n keys === \"all\"\n ? filter.selectAll()\n : filter.setActiveValueIds(keys as Iterable<unknown>)\n : undefined,\n showSelectAll: filter.isSelectAllAvailable,\n },\n () =>\n values.map((value) =>\n h(\n MenuItem,\n {\n key: value.id,\n id: value.id,\n /* A multiple choice goes through `onSelectionChange`. */\n onAction: () => {\n if (selectionMode === \"single\" && !value.isActive) {\n value.toggle();\n }\n },\n },\n () => value.render(),\n ),\n ),\n ),\n ]);\n};\n\n/**\n * The list's controls: layout, sorting, filters, search — plus the app's own\n * `ActionGroup`, which the `List` hands over as the `actions` slot.\n *\n * Each one is a remote element the host materialises — a context menu trigger\n * with a button and a menu — and what they act on is the shared model, so a\n * filter behaves here exactly as it does in React.\n */\nexport const Header = defineComponent({\n name: \"ListHeader\",\n\n setup(_props, { slots }) {\n const list = injectListModel();\n const texts = useListTexts();\n\n const isEmpty = watchMobxValue(() => list.isEmpty);\n const isInitiallyLoading = watchMobxValue(\n () => list.loaderState.isInitiallyLoading,\n );\n const emptyViewType = watchMobxValue(() => list.getEmptyViewType());\n const viewMode = watchMobxValue(() => list.viewMode.value);\n /* Filters and sortings read the table, so they follow its revision. */\n const tableRevision = watchMobxValue(() => list.listTable.revision);\n const renderShape = watchMobxValue(() => list.renderShape);\n\n /*\n * One controller per date filter, kept for as long as the header is.\n * Created in the render it would be a new one every time — and a range\n * takes two clicks, so the popover would forget the first between them.\n */\n const dateControllers = new Map<string, OverlayController>();\n const dateController = (key: string): OverlayController => {\n const existing = dateControllers.get(key);\n if (existing) {\n return existing;\n }\n const created = createOverlayController();\n dateControllers.set(key, created);\n return created;\n };\n\n /*\n * Flow's `DefaultSearchFieldRender`: the field holds what is typed, and a\n * search is submitted after a pause — or, with `autoSubmit={false}`, on\n * Enter. Escape and the clear button clear at once.\n */\n const searchShape = list.shape.search;\n const autoSubmit = searchShape?.autoSubmit !== false;\n const searchInput = ref(list.search?.value ?? \"\");\n let previousSearch = \"\";\n let submitTimeout: ReturnType<typeof setTimeout> | undefined;\n\n const submitSearch = () => {\n if (searchInput.value.trim() === \"\") {\n list.search?.setValue(undefined);\n } else if (previousSearch !== searchInput.value) {\n previousSearch = searchInput.value;\n list.search?.setValue(searchInput.value);\n }\n };\n\n const clearSearch = () => {\n clearTimeout(submitTimeout);\n list.search?.setValue(undefined);\n searchInput.value = \"\";\n };\n\n watch(searchInput, () => {\n clearTimeout(submitTimeout);\n if (autoSubmit) {\n submitTimeout = setTimeout(submitSearch, autoSubmitTimeout);\n }\n });\n\n /* A search set from outside the field — a reset — shows in it. */\n const searchValue = watchMobxValue(() => {\n void list.listTable.revision;\n return list.search?.value;\n });\n watch(searchValue, (value) => {\n searchInput.value = value ?? \"\";\n });\n\n const onSearchKeyUp = (event: { key?: string } | undefined) => {\n if (event?.key === \"Enter\" && !autoSubmit) {\n submitSearch();\n } else if (event?.key === \"Escape\") {\n clearSearch();\n }\n };\n\n onBeforeUnmount(() => clearTimeout(submitTimeout));\n\n return () => {\n void tableRevision.value;\n\n const noItemsAvailable = isEmpty.value && emptyViewType.value === \"list\";\n const isDisabled = isInitiallyLoading.value || noItemsAvailable;\n const modes = availableViewModes(renderShape.value);\n\n const actions = slots.actions?.();\n\n /*\n * The header is rendered even with nothing in it, because Flow's is: it\n * holds the app's own `ActionGroup`, and a list that gained one would\n * otherwise change the DOM around it.\n *\n * Asked of the model rather than of what the options rendered — the\n * all-filters modal decides for itself whether it has anything to show.\n */\n const hasOptions =\n list.filters.length > 0 ||\n list.visibleSorting.length > 0 ||\n !!list.search ||\n modes.length > 1;\n\n /*\n * Nothing to show yet and nothing to configure it with: Flow hides the\n * header rather than dropping it, so what an app put in it keeps its\n * state across the switch to and from the empty view.\n */\n if (noItemsAvailable) {\n return h(\n Div,\n { class: listStyles.hideVisuallyActions, \"aria-hidden\": true },\n /*\n * Same nesting and same classes as the branch below, which is what\n * Flow's comment on this branch asks for — the tunnel's content has\n * to survive the switch. React arrives at the inner class by reusing\n * the element rather than by setting it: a `className` that goes from\n * set to undefined never reaches the host, so the previous one stays.\n *\n * `[actions, null]`, not `actions`: Vue wraps a nested array in a\n * fragment, so only the same array shape keeps the actions at the\n * same position in the same fragment — anything else remounts them,\n * and a modal open from the header closes.\n */\n () =>\n h(Div, { class: listStyles.headerContent }, () => [actions, null]),\n );\n }\n\n const options: VNodeChild[] = [\n renderViewModeMenu(\n list,\n modes,\n texts.value,\n isDisabled,\n viewMode.value,\n ),\n renderSortingMenu(list, texts.value, isDisabled),\n /*\n * Primary only. A secondary filter is reachable through the\n * all-filters modal, which is the whole reason that modal shows on\n * desktop at all.\n */\n ...(list.filters as HeaderFilter[])\n .filter((filter) => filter.priority === \"primary\")\n .map((filter) =>\n isDateRangeFilter(filter)\n ? renderDateRangeFilter(\n filter as unknown as HeaderDateRangeFilter,\n isDisabled,\n texts.value(\"dateRange\"),\n dateController(filter.storageKey),\n )\n : renderFilterMenu(filter, isDisabled),\n ),\n h(AllFiltersModal, { isDisabled, viewModes: modes }),\n list.search\n ? h(SearchField, {\n class: listStyles.searchField,\n isDisabled,\n autoFocus: searchShape?.autoFocus,\n value: searchInput.value,\n onChange: (value: string) => {\n searchInput.value = value;\n },\n onKeyUp: onSearchKeyUp,\n onClear: clearSearch,\n })\n : null,\n ];\n\n return h(\n Div,\n {\n class: [\n listStyles.header,\n list.search ? listStyles.headerWithSearch : undefined,\n ]\n .filter(Boolean)\n .join(\" \"),\n },\n () => [\n h(Div, { class: listStyles.headerContent }, () => [\n actions,\n hasOptions\n ? h(Div, { class: listStyles.headerOptions }, () => options)\n : null,\n ]),\n h(ActiveFilters, { isDisabled }),\n ],\n );\n };\n },\n});\n\ncomposition(Header);\n\nexport default Header;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAM,oBAAoB;AAG1B,IAAM,yBACJ;AAmDF,IAAM,sBAAsB,UAA8C;CACxE,MAAM,QAAoB,CAAC;CAC3B,IAAI,MAAM,UAAU,UAClB,MAAM,KAAK,MAAM;CAEnB,IAAI,MAAM,OACR,MAAM,KAAK,OAAO;CAEpB,IAAI,MAAM,UAAU,WAClB,MAAM,KAAK,OAAO;CAEpB,OAAO;AACT;AAEA,IAAM,iBAAiB,gBAAyB;CAC9C,SAAS;CACT,OAAO;CACP,OAAO,WAAW;CAClB;AACF;AAEA,IAAM,sBACJ,MACA,OACA,OACA,YACA,aACe;CACf,IAAI,MAAM,UAAU,GAClB,OAAO;CAGT,OAAO,EAAE,oBAAoB,YAAY,CACvC,EACE,QACA;EAAE,GAAG,cAAc,UAAU;EAAG,cAAc,MAAM,UAAU;CAAE,SAC1D,CAC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KAAK;GAElD,MAAM,UAAU,MAAM,UAAU;GAUhC,MAAM,aACJ,KAAK,QAAQ,SAAS,KACtB,KAAK,eAAe,SAAS,KAC7B,CAAC,CAAC,KAAK,UACP,MAAM,SAAS;GAOjB,IAAI,kBACF,OAAO,EACL,KACA;IAAE,OAAO,WAAW;IAAqB,eAAe;GAAK,SAc3D,EAAE,KAAK,EAAE,OAAO,WAAW,cAAc,SAAS,CAAC,SAAS,IAAI,CAAC,CACrE;GAGF,MAAM,UAAwB;IAC5B,mBACE,MACA,OACA,MAAM,OACN,YACA,SAAS,KACX;IACA,kBAAkB,MAAM,MAAM,OAAO,UAAU;IAM/C,GAAI,KAAK,QACN,QAAQ,WAAW,OAAO,aAAa,SAAS,CAAC,CACjD,KAAK,WACJ,kBAAkB,MAAM,IACpB,sBACE,QACA,YACA,MAAM,MAAM,WAAW,GACvB,eAAe,OAAO,UAAU,CAClC,IACA,iBAAiB,QAAQ,UAAU,CACzC;IACF,EAAE,iBAAiB;KAAE;KAAY,WAAW;IAAM,CAAC;IACnD,KAAK,SACD,EAAE,aAAa;KACb,OAAO,WAAW;KAClB;KACA,WAAW,aAAa;KACxB,OAAO,YAAY;KACnB,WAAW,UAAkB;MAC3B,YAAY,QAAQ;KACtB;KACA,SAAS;KACT,SAAS;IACX,CAAC,IACD;GACN;GAEA,OAAO,EACL,KACA,EACE,OAAO,CACL,WAAW,QACX,KAAK,SAAS,WAAW,mBAAmB,KAAA,CAC9C,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,EACb,SACM,CACJ,EAAE,KAAK,EAAE,OAAO,WAAW,cAAc,SAAS,CAChD,SACA,aACI,EAAE,KAAK,EAAE,OAAO,WAAW,cAAc,SAAS,OAAO,IACzD,IACN,CAAC,GACD,EAAE,eAAe,EAAE,WAAW,CAAC,CACjC,CACF;EACF;CACF;AACF,CAAC;AAED,YAAY,MAAM"}
|
|
1
|
+
{"version":3,"file":"Header.mjs","names":[],"sources":["../../../../../src/list/Header.ts"],"sourcesContent":["import {\n Button,\n ContextMenu,\n ContextMenuTrigger,\n Div,\n MenuItem,\n RangeCalendar,\n SearchField,\n Text,\n} from \"@/auto-generated\";\nimport { Popover } from \"@/overlays/Popover\";\nimport { PopoverTrigger } from \"@/overlays/triggers\";\nimport {\n IconAscending,\n IconDescending,\n IconFilter,\n IconSorting,\n IconView,\n} from \"@/icons\";\nimport { watchMobxValue } from \"@/lib/mobxSelector\";\nimport {\n createOverlayController,\n type OverlayController,\n} from \"@/overlays/overlayController\";\nimport {\n defineComponent,\n h,\n onBeforeUnmount,\n ref,\n watch,\n type VNodeChild,\n} from \"vue\";\nimport { ActiveFilters } from \"./ActiveFilters\";\nimport { AllFiltersModal } from \"./AllFiltersModal\";\nimport { isDateRangeFilter } from \"./dateRangeFilter\";\nimport {\n DateTimeRangeFields,\n type DateTimeRangeFilter,\n} from \"./DateTimeRangeFields\";\nimport { injectListModel, type AnyListModel } from \"./listContext\";\nimport { useListTexts, type ListTextFormatter } from \"./locales\";\nimport type { ListRenderShape } from \"./model\";\nimport { dateTimeRangeStyles, listStyles } from \"./styles\";\nimport type { ListRendered } from \"./types\";\nimport { composition } from \"@/lib/composition\";\nimport type { ListDateRange } from \"@mittwald/flow-components-base\";\n\nconst autoSubmitTimeout = 500;\n\n/*\n * What the header needs of a sorting and of a filter, and nothing more.\n *\n * Not the classes themselves: a list of concrete filters is not assignable to\n * a list of generic ones, because a row model sits in a contravariant position\n * deep inside `Column`, so `Table<any>` and `Table<never>` never meet. Reading\n * only the members it renders keeps the header out of that entirely.\n */\ninterface HeaderSorting {\n readonly id: string;\n readonly name?: string;\n readonly property: unknown;\n readonly direction: \"asc\" | \"desc\";\n readonly directionName?: string;\n isSorted(): boolean;\n enable(): void;\n}\n\ninterface HeaderFilterValue {\n readonly id: string;\n readonly isActive: boolean;\n toggle(): void;\n render(): ListRendered;\n}\n\ninterface HeaderDateRangeFilter extends DateTimeRangeFilter {\n readonly storageKey: string;\n readonly name?: string;\n readonly property: unknown;\n readonly granularity: \"day\" | \"minute\";\n readonly rangeCalendarProps: Record<string, unknown>;\n}\n\ninterface HeaderFilter {\n readonly storageKey: string;\n readonly mode: string;\n readonly priority: \"primary\" | \"secondary\";\n readonly name?: string;\n readonly property: unknown;\n readonly values: HeaderFilterValue[];\n readonly isSelectAllAvailable: boolean;\n selectAll(): void;\n setActiveValueIds(ids: Iterable<unknown>): void;\n}\n\n/** Which layouts this list can actually show. */\ntype ViewMode = \"list\" | \"table\" | \"tiles\";\n\nconst availableViewModes = (shape: ListRenderShape<never>): ViewMode[] => {\n const modes: ViewMode[] = [];\n if (shape.itemView?.showList) {\n modes.push(\"list\");\n }\n if (shape.table) {\n modes.push(\"table\");\n }\n if (shape.itemView?.showTiles) {\n modes.push(\"tiles\");\n }\n return modes;\n};\n\nconst outlineButton = (isDisabled: boolean) => ({\n variant: \"outline\" as const,\n color: \"secondary\" as const,\n class: listStyles.hideOnMobile,\n isDisabled,\n});\n\nconst renderViewModeMenu = (\n list: AnyListModel,\n modes: ViewMode[],\n texts: ListTextFormatter,\n isDisabled: boolean,\n selected: ViewMode,\n): VNodeChild => {\n if (modes.length <= 1) {\n return null;\n }\n\n return h(ContextMenuTrigger, null, () => [\n h(\n Button,\n { ...outlineButton(isDisabled), \"aria-label\": texts(\"settings\") },\n () => [\n h(Text, null, () => texts(`settings.viewMode.${selected}`)),\n h(IconView),\n ],\n ),\n h(ContextMenu, { selectionMode: \"single\", selectedKeys: [selected] }, () =>\n modes.map((mode) =>\n h(\n MenuItem,\n { key: mode, id: mode, onAction: () => list.viewMode.set(mode) },\n () => texts(`settings.viewMode.${mode}`),\n ),\n ),\n ),\n ]);\n};\n\nconst renderSortingMenu = (\n list: AnyListModel,\n texts: ListTextFormatter,\n isDisabled: boolean,\n): VNodeChild => {\n const sortings = list.visibleSorting as HeaderSorting[];\n\n if (sortings.length === 0) {\n return null;\n }\n\n const active = sortings.find((s) => s.isSorted());\n\n return h(ContextMenuTrigger, null, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () =>\n active ? (active.name ?? String(active.property)) : texts(\"sorting\"),\n ),\n h(\n active\n ? active.direction === \"asc\"\n ? IconAscending\n : IconDescending\n : IconSorting,\n ),\n ]),\n h(\n ContextMenu,\n {\n selectionMode: \"single\",\n selectedKeys: active ? [active.id] : [],\n },\n () =>\n sortings.map((sorting) =>\n h(\n MenuItem,\n {\n key: sorting.id,\n id: sorting.id,\n onAction: () => sorting.enable(),\n },\n () =>\n `${sorting.name ?? String(sorting.property)} ${sorting.directionName ?? \"\"}`.trim(),\n ),\n ),\n ),\n ]);\n};\n\n/**\n * A date-range filter is a calendar in a popover, not a menu of values — or,\n * with `granularity: \"minute\"`, date and time fields.\n *\n * The same shape Flow's React list gives it — the calendar closes the popover\n * when a range is picked, because a range is complete the moment its second end\n * is. The fields leave it open: they apply as they are typed.\n */\nconst renderDateRangeFilter = (\n filter: HeaderDateRangeFilter,\n isDisabled: boolean,\n calendarLabel: string,\n controller: OverlayController,\n): VNodeChild =>\n h(PopoverTrigger, { key: filter.storageKey, controller }, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () => filter.name ?? String(filter.property)),\n h(IconFilter),\n ]),\n h(\n Popover,\n {\n placement: \"bottom end\",\n isDialogContent: true,\n \"aria-label\": calendarLabel,\n },\n () =>\n filter.granularity === \"minute\"\n ? h(DateTimeRangeFields, {\n filter,\n class: dateTimeRangeStyles.popover,\n })\n : /*\n * Cast at the call, because the options are whatever the consumer\n * handed the filter: an open record does not match a typed\n * component's props, and TypeScript then resolves `h` to its\n * instance overload.\n */\n h(RangeCalendar, {\n ...filter.rangeCalendarProps,\n class: dateTimeRangeStyles.calendar,\n value: filter.getValue(),\n onChange: (range: ListDateRange) => {\n filter.setValue(range);\n controller.close();\n },\n } as never),\n ),\n ]);\n\nconst renderFilterMenu = (\n filter: HeaderFilter,\n isDisabled: boolean,\n): VNodeChild => {\n const selectionMode = filter.mode === \"one\" ? \"single\" : \"multiple\";\n const values = filter.values;\n\n return h(ContextMenuTrigger, { key: filter.storageKey }, () => [\n h(Button, outlineButton(isDisabled), () => [\n h(Text, null, () => filter.name ?? String(filter.property)),\n h(IconFilter),\n ]),\n h(\n ContextMenu,\n {\n selectionMode,\n selectedKeys: values.filter((v) => v.isActive).map((v) => v.id),\n /*\n * Flow's: a multiple-choice menu reports its whole selection, and the\n * \"Select all\" entry the host adds reports it as `\"all\"`.\n */\n onSelectionChange:\n selectionMode === \"multiple\"\n ? (keys: unknown) =>\n keys === \"all\"\n ? filter.selectAll()\n : filter.setActiveValueIds(keys as Iterable<unknown>)\n : undefined,\n showSelectAll: filter.isSelectAllAvailable,\n },\n () =>\n values.map((value) =>\n h(\n MenuItem,\n {\n key: value.id,\n id: value.id,\n /* A multiple choice goes through `onSelectionChange`. */\n onAction: () => {\n if (selectionMode === \"single\" && !value.isActive) {\n value.toggle();\n }\n },\n },\n () => value.render(),\n ),\n ),\n ),\n ]);\n};\n\n/**\n * The list's controls: layout, sorting, filters, search — plus the app's own\n * `ActionGroup`, which the `List` hands over as the `actions` slot.\n *\n * Each one is a remote element the host materialises — a context menu trigger\n * with a button and a menu — and what they act on is the shared model, so a\n * filter behaves here exactly as it does in React.\n */\nexport const Header = defineComponent({\n name: \"ListHeader\",\n\n setup(_props, { slots }) {\n const list = injectListModel();\n const texts = useListTexts();\n\n const isEmpty = watchMobxValue(() => list.isEmpty);\n const isInitiallyLoading = watchMobxValue(\n () => list.loaderState.isInitiallyLoading,\n );\n const emptyViewType = watchMobxValue(() => list.getEmptyViewType());\n const viewMode = watchMobxValue(() => list.viewMode.value);\n /* Filters and sortings read the table, so they follow its revision. */\n const tableRevision = watchMobxValue(() => list.listTable.revision);\n const renderShape = watchMobxValue(() => list.renderShape);\n\n /*\n * One controller per date filter, kept for as long as the header is.\n * Created in the render it would be a new one every time — and a range\n * takes two clicks, so the popover would forget the first between them.\n */\n const dateControllers = new Map<string, OverlayController>();\n const dateController = (key: string): OverlayController => {\n const existing = dateControllers.get(key);\n if (existing) {\n return existing;\n }\n const created = createOverlayController();\n dateControllers.set(key, created);\n return created;\n };\n\n /*\n * Flow's `DefaultSearchFieldRender`: the field holds what is typed, and a\n * search is submitted after a pause — or, with `autoSubmit={false}`, on\n * Enter. Escape and the clear button clear at once.\n */\n const searchShape = list.shape.search;\n const autoSubmit = searchShape?.autoSubmit !== false;\n const searchInput = ref(list.search?.value ?? \"\");\n let previousSearch = \"\";\n let submitTimeout: ReturnType<typeof setTimeout> | undefined;\n\n const submitSearch = () => {\n if (searchInput.value.trim() === \"\") {\n list.search?.setValue(undefined);\n } else if (previousSearch !== searchInput.value) {\n previousSearch = searchInput.value;\n list.search?.setValue(searchInput.value);\n }\n };\n\n const clearSearch = () => {\n clearTimeout(submitTimeout);\n list.search?.setValue(undefined);\n searchInput.value = \"\";\n };\n\n watch(searchInput, () => {\n clearTimeout(submitTimeout);\n if (autoSubmit) {\n submitTimeout = setTimeout(submitSearch, autoSubmitTimeout);\n }\n });\n\n /* A search set from outside the field — a reset — shows in it. */\n const searchValue = watchMobxValue(() => {\n void list.listTable.revision;\n return list.search?.value;\n });\n watch(searchValue, (value) => {\n searchInput.value = value ?? \"\";\n });\n\n const onSearchKeyUp = (event: { key?: string } | undefined) => {\n if (event?.key === \"Enter\" && !autoSubmit) {\n submitSearch();\n } else if (event?.key === \"Escape\") {\n clearSearch();\n }\n };\n\n onBeforeUnmount(() => clearTimeout(submitTimeout));\n\n return () => {\n void tableRevision.value;\n\n const noItemsAvailable = isEmpty.value && emptyViewType.value === \"list\";\n const isDisabled = isInitiallyLoading.value || noItemsAvailable;\n const modes = availableViewModes(renderShape.value);\n\n const actions = slots.actions?.();\n\n /*\n * The header is rendered even with nothing in it, because Flow's is: it\n * holds the app's own `ActionGroup`, and a list that gained one would\n * otherwise change the DOM around it.\n *\n * Asked of the model rather than of what the options rendered — the\n * all-filters modal decides for itself whether it has anything to show.\n */\n const hasOptions =\n list.filters.length > 0 ||\n list.visibleSorting.length > 0 ||\n !!list.search ||\n modes.length > 1;\n\n /*\n * Nothing to show yet and nothing to configure it with: Flow hides the\n * header rather than dropping it, so what an app put in it keeps its\n * state across the switch to and from the empty view.\n */\n if (noItemsAvailable) {\n return h(\n Div,\n { class: listStyles.hideVisuallyActions, \"aria-hidden\": true },\n /*\n * Same nesting and same classes as the branch below, which is what\n * Flow's comment on this branch asks for — the tunnel's content has\n * to survive the switch. React arrives at the inner class by reusing\n * the element rather than by setting it: a `className` that goes from\n * set to undefined never reaches the host, so the previous one stays.\n *\n * `[actions, null]`, not `actions`: Vue wraps a nested array in a\n * fragment, so only the same array shape keeps the actions at the\n * same position in the same fragment — anything else remounts them,\n * and a modal open from the header closes.\n */\n () =>\n h(Div, { class: listStyles.headerContent }, () => [actions, null]),\n );\n }\n\n const options: VNodeChild[] = [\n renderViewModeMenu(\n list,\n modes,\n texts.value,\n isDisabled,\n viewMode.value,\n ),\n renderSortingMenu(list, texts.value, isDisabled),\n /*\n * Primary only. A secondary filter is reachable through the\n * all-filters modal, which is the whole reason that modal shows on\n * desktop at all.\n */\n ...(list.filters as HeaderFilter[])\n .filter((filter) => filter.priority === \"primary\")\n .map((filter) =>\n isDateRangeFilter(filter)\n ? renderDateRangeFilter(\n filter as unknown as HeaderDateRangeFilter,\n isDisabled,\n texts.value(\"dateRange\"),\n dateController(filter.storageKey),\n )\n : renderFilterMenu(filter, isDisabled),\n ),\n h(AllFiltersModal, { isDisabled, viewModes: modes }),\n list.search\n ? h(SearchField, {\n /* autoFocus acts on mount only — remount once enabled. */\n key: isDisabled ? \"disabled\" : \"enabled\",\n class: listStyles.searchField,\n isDisabled,\n autoFocus: searchShape?.autoFocus,\n value: searchInput.value,\n onChange: (value: string) => {\n searchInput.value = value;\n },\n onKeyUp: onSearchKeyUp,\n onClear: clearSearch,\n })\n : null,\n ];\n\n return h(\n Div,\n {\n class: [\n listStyles.header,\n list.search ? listStyles.headerWithSearch : undefined,\n ]\n .filter(Boolean)\n .join(\" \"),\n },\n () => [\n h(Div, { class: listStyles.headerContent }, () => [\n actions,\n hasOptions\n ? h(Div, { class: listStyles.headerOptions }, () => options)\n : null,\n ]),\n h(ActiveFilters, { isDisabled }),\n ],\n );\n };\n },\n});\n\ncomposition(Header);\n\nexport default Header;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAM,oBAAoB;AAkD1B,IAAM,sBAAsB,UAA8C;CACxE,MAAM,QAAoB,CAAC;CAC3B,IAAI,MAAM,UAAU,UAClB,MAAM,KAAK,MAAM;CAEnB,IAAI,MAAM,OACR,MAAM,KAAK,OAAO;CAEpB,IAAI,MAAM,UAAU,WAClB,MAAM,KAAK,OAAO;CAEpB,OAAO;AACT;AAEA,IAAM,iBAAiB,gBAAyB;CAC9C,SAAS;CACT,OAAO;CACP,OAAO,WAAW;CAClB;AACF;AAEA,IAAM,sBACJ,MACA,OACA,OACA,YACA,aACe;CACf,IAAI,MAAM,UAAU,GAClB,OAAO;CAGT,OAAO,EAAE,oBAAoB,YAAY,CACvC,EACE,QACA;EAAE,GAAG,cAAc,UAAU;EAAG,cAAc,MAAM,UAAU;CAAE,SAC1D,CACJ,EAAE,MAAM,YAAY,MAAM,qBAAqB,UAAU,CAAC,GAC1D,EAAE,QAAQ,CACZ,CACF,GACA,EAAE,aAAa;EAAE,eAAe;EAAU,cAAc,CAAC,QAAQ;CAAE,SACjE,MAAM,KAAK,SACT,EACE,UACA;EAAE,KAAK;EAAM,IAAI;EAAM,gBAAgB,KAAK,SAAS,IAAI,IAAI;CAAE,SACzD,MAAM,qBAAqB,MAAM,CACzC,CACF,CACF,CACF,CAAC;AACH;AAEA,IAAM,qBACJ,MACA,OACA,eACe;CACf,MAAM,WAAW,KAAK;CAEtB,IAAI,SAAS,WAAW,GACtB,OAAO;CAGT,MAAM,SAAS,SAAS,MAAM,MAAM,EAAE,SAAS,CAAC;CAEhD,OAAO,EAAE,oBAAoB,YAAY,CACvC,EAAE,QAAQ,cAAc,UAAU,SAAS,CACzC,E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AW,OAAO,aAAa,SAAS,CAAC,CACjD,KAAK,WACJ,kBAAkB,MAAM,IACpB,sBACE,QACA,YACA,MAAM,MAAM,WAAW,GACvB,eAAe,OAAO,UAAU,CAClC,IACA,iBAAiB,QAAQ,UAAU,CACzC;IACF,EAAE,iBAAiB;KAAE;KAAY,WAAW;IAAM,CAAC;IACnD,KAAK,SACD,EAAE,aAAa;KAEb,KAAK,aAAa,aAAa;KAC/B,OAAO,WAAW;KAClB;KACA,WAAW,aAAa;KACxB,OAAO,YAAY;KACnB,WAAW,UAAkB;MAC3B,YAAY,QAAQ;KACtB;KACA,SAAS;KACT,SAAS;IACX,CAAC,IACD;GACN;GAEA,OAAO,EACL,KACA,EACE,OAAO,CACL,WAAW,QACX,KAAK,SAAS,WAAW,mBAAmB,KAAA,CAC9C,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,EACb,SACM,CACJ,EAAE,KAAK,EAAE,OAAO,WAAW,cAAc,SAAS,CAChD,SACA,aACI,EAAE,KAAK,EAAE,OAAO,WAAW,cAAc,SAAS,OAAO,IACzD,IACN,CAAC,GACD,EAAE,eAAe,EAAE,WAAW,CAAC,CACjC,CACF;EACF;CACF;AACF,CAAC;AAED,YAAY,MAAM"}
|
|
@@ -4,7 +4,7 @@ import watchMobxValue from "../lib/mobxSelector.mjs";
|
|
|
4
4
|
import { injectListModel } from "./listContext.mjs";
|
|
5
5
|
import { provideItemAccordion } from "./itemContext.mjs";
|
|
6
6
|
import { computed, defineComponent, h, ref, useId } from "vue";
|
|
7
|
-
|
|
7
|
+
// src/list/Item.ts
|
|
8
8
|
/**
|
|
9
9
|
* One item of the list.
|
|
10
10
|
*
|
|
@@ -58,7 +58,6 @@ var ListItemRow = defineComponent({
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
composition(ListItemRow);
|
|
61
|
-
//#endregion
|
|
62
61
|
export { ListItemRow, ListItemRow as default };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=Item.mjs.map
|
|
@@ -13,7 +13,7 @@ import { injectListModel } from "./listContext.mjs";
|
|
|
13
13
|
import { className, listStyles } from "./styles.mjs";
|
|
14
14
|
import { ListItemRow } from "./Item.mjs";
|
|
15
15
|
import { defineComponent, h } from "vue";
|
|
16
|
-
|
|
16
|
+
// src/list/Items.ts
|
|
17
17
|
/**
|
|
18
18
|
* The list's items, as a grid list.
|
|
19
19
|
*
|
|
@@ -65,7 +65,6 @@ var Items = defineComponent({
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
composition(Items);
|
|
68
|
-
//#endregion
|
|
69
68
|
export { Items, Items as default };
|
|
70
69
|
|
|
71
70
|
//# sourceMappingURL=Items.mjs.map
|
|
@@ -20,7 +20,7 @@ import { ListModel } from "./model.mjs";
|
|
|
20
20
|
import { useListSettings } from "./settings.mjs";
|
|
21
21
|
import { ListFilter, ListItem, ListLoaderAsync, ListLoaderComposable, ListSearch, ListSorting, ListStaticData, ListTable, ListTableBody, ListTableCell, ListTableColumn, ListTableHeader, ListTableRow, findSetup, findSetups, isListSetupComponent } from "./setupComponents.mjs";
|
|
22
22
|
import { computed, defineComponent, h, onBeforeUnmount, onMounted, watch } from "vue";
|
|
23
|
-
|
|
23
|
+
// src/list/List.ts
|
|
24
24
|
var passesContextOn = /* @__PURE__ */ new Set([
|
|
25
25
|
Action,
|
|
26
26
|
ModalTrigger,
|
|
@@ -286,7 +286,6 @@ var List = defineComponent({
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
composition(List);
|
|
289
|
-
//#endregion
|
|
290
289
|
export { List, List as default };
|
|
291
290
|
|
|
292
291
|
//# sourceMappingURL=List.mjs.map
|
|
@@ -22,7 +22,7 @@ import { itemViewStyles, listStyles } from "./styles.mjs";
|
|
|
22
22
|
import { ModalTrigger, PopoverTrigger } from "../overlays/triggers.mjs";
|
|
23
23
|
import { injectItemAccordion } from "./itemContext.mjs";
|
|
24
24
|
import { Fragment, cloneVNode, defineComponent, h } from "vue";
|
|
25
|
-
|
|
25
|
+
// src/list/ListItemView.ts
|
|
26
26
|
var overlayTriggers = /* @__PURE__ */ new Set([
|
|
27
27
|
ContextMenuTrigger,
|
|
28
28
|
ContextualHelpTrigger,
|
|
@@ -134,7 +134,6 @@ var ListItemView = defineComponent({
|
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
composition(ListItemView);
|
|
137
|
-
//#endregion
|
|
138
137
|
export { ListItemView, ListItemView as default };
|
|
139
138
|
|
|
140
139
|
//# sourceMappingURL=ListItemView.mjs.map
|
|
@@ -10,7 +10,7 @@ import watchMobxValue from "../lib/mobxSelector.mjs";
|
|
|
10
10
|
import { injectListModel } from "./listContext.mjs";
|
|
11
11
|
import { className } from "./styles.mjs";
|
|
12
12
|
import { defineComponent, h } from "vue";
|
|
13
|
-
|
|
13
|
+
// src/list/Table.ts
|
|
14
14
|
var tableStyles = {
|
|
15
15
|
table: "flow--list--table",
|
|
16
16
|
isLoading: "flow--list--table--is-loading",
|
|
@@ -72,7 +72,6 @@ var ListTableView = defineComponent({
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
composition(ListTableView);
|
|
75
|
-
//#endregion
|
|
76
75
|
export { ListTableView, ListTableView as default };
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=Table.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ListDateRangeFilter } from "../../../components-base/src/list/filter/ListDateRangeFilter.mjs";
|
|
2
2
|
import "../../../components-base/src/index.mjs";
|
|
3
|
-
|
|
3
|
+
// src/list/dateRangeFilter.ts
|
|
4
4
|
/**
|
|
5
|
-
* A date-range filter, with the options its
|
|
5
|
+
* A date-range filter, with the options its fields take.
|
|
6
6
|
*
|
|
7
7
|
* The column, the comparison and the stored value are the shared
|
|
8
8
|
* `ListDateRangeFilter`, so a Vue list and a React list filter the same dates
|
|
9
|
-
* the same way. What a binding adds is only what its
|
|
9
|
+
* the same way. What a binding adds is only what its fields accept.
|
|
10
10
|
*/
|
|
11
11
|
var DateRangeFilter = class extends ListDateRangeFilter {
|
|
12
12
|
/** Handed to the `RangeCalendar` — a minimum date, unavailable days, … */
|
|
@@ -15,13 +15,20 @@ var DateRangeFilter = class extends ListDateRangeFilter {
|
|
|
15
15
|
super(context, shape);
|
|
16
16
|
this.dateRangeOptions = shape.dateRangeOptions;
|
|
17
17
|
}
|
|
18
|
+
get granularity() {
|
|
19
|
+
return this.dateRangeOptions?.granularity === "minute" ? "minute" : "day";
|
|
20
|
+
}
|
|
21
|
+
get rangeCalendarProps() {
|
|
22
|
+
if (this.granularity === "minute") return {};
|
|
23
|
+
const { granularity, ...props } = this.dateRangeOptions ?? {};
|
|
24
|
+
return props;
|
|
25
|
+
}
|
|
26
|
+
get dateTimeRangeLimits() {
|
|
27
|
+
return this.granularity === "minute" ? this.dateRangeOptions : void 0;
|
|
28
|
+
}
|
|
18
29
|
};
|
|
19
30
|
/** Whether a filter is one of these, without reaching for the class. */
|
|
20
31
|
var isDateRangeFilter = (filter) => filter.mode === "dateRange";
|
|
21
|
-
|
|
22
|
-
var formatDate = (date) => new Date(date.year, date.month - 1, date.day).toLocaleDateString();
|
|
23
|
-
var formatDateRange = (range) => [range.start, range.end].map((date) => date ? formatDate(date) : "").join(" - ");
|
|
24
|
-
//#endregion
|
|
25
|
-
export { DateRangeFilter, formatDate, formatDateRange, isDateRangeFilter };
|
|
32
|
+
export { DateRangeFilter, isDateRangeFilter };
|
|
26
33
|
|
|
27
34
|
//# sourceMappingURL=dateRangeFilter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangeFilter.mjs","names":[],"sources":["../../../../../src/list/dateRangeFilter.ts"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type {\n
|
|
1
|
+
{"version":3,"file":"dateRangeFilter.mjs","names":[],"sources":["../../../../../src/list/dateRangeFilter.ts"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type {\n ListDateTimeRangeLimits,\n ListModelContext,\n} from \"@mittwald/flow-components-base\";\nimport type { ListRendered, VueListFilterShape } from \"./types\";\n\n/**\n * A date-range filter, with the options its fields take.\n *\n * The column, the comparison and the stored value are the shared\n * `ListDateRangeFilter`, so a Vue list and a React list filter the same dates\n * the same way. What a binding adds is only what its fields accept.\n */\nexport class DateRangeFilter<T = never> extends ListDateRangeFilter<\n T,\n never,\n ListRendered\n> {\n /** Handed to the `RangeCalendar` — a minimum date, unavailable days, … */\n public readonly dateRangeOptions?: Record<string, unknown>;\n\n public constructor(\n context: ListModelContext<T>,\n shape: VueListFilterShape<T>,\n ) {\n super(context, shape as never);\n this.dateRangeOptions = (\n shape as { dateRangeOptions?: Record<string, unknown> }\n ).dateRangeOptions;\n }\n\n public get granularity(): \"day\" | \"minute\" {\n return this.dateRangeOptions?.granularity === \"minute\" ? \"minute\" : \"day\";\n }\n\n public get rangeCalendarProps(): Record<string, unknown> {\n if (this.granularity === \"minute\") {\n return {};\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { granularity, ...props } = this.dateRangeOptions ?? {};\n return props;\n }\n\n public get dateTimeRangeLimits(): ListDateTimeRangeLimits | undefined {\n return this.granularity === \"minute\"\n ? (this.dateRangeOptions as ListDateTimeRangeLimits)\n : undefined;\n }\n}\n\n/** Whether a filter is one of these, without reaching for the class. */\nexport const isDateRangeFilter = (filter: {\n readonly mode: string;\n}): filter is DateRangeFilter<never> => filter.mode === \"dateRange\";\n"],"mappings":";;;;;;;;;;AAcA,IAAa,kBAAb,cAAgD,oBAI9C;;CAEA;CAEA,YACE,SACA,OACA;EACA,MAAM,SAAS,KAAc;EAC7B,KAAK,mBACH,MACA;CACJ;CAEA,IAAW,cAAgC;EACzC,OAAO,KAAK,kBAAkB,gBAAgB,WAAW,WAAW;CACtE;CAEA,IAAW,qBAA8C;EACvD,IAAI,KAAK,gBAAgB,UACvB,OAAO,CAAC;EAGV,MAAM,EAAE,aAAa,GAAG,UAAU,KAAK,oBAAoB,CAAC;EAC5D,OAAO;CACT;CAEA,IAAW,sBAA2D;EACpE,OAAO,KAAK,gBAAgB,WACvB,KAAK,mBACN,KAAA;CACN;AACF;;AAGA,IAAa,qBAAqB,WAEM,OAAO,SAAS"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { inject, provide } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/list/itemContext.ts
|
|
3
3
|
var key = Symbol("flowListItemAccordion");
|
|
4
4
|
var provideItemAccordion = (accordion) => provide(key, accordion);
|
|
5
5
|
/** `undefined` outside a list item. */
|
|
6
6
|
var injectItemAccordion = () => inject(key, void 0);
|
|
7
|
-
//#endregion
|
|
8
7
|
export { injectItemAccordion, provideItemAccordion };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=itemContext.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, provide } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/list/listContext.ts
|
|
3
3
|
var listModelKey = Symbol("flowListModel");
|
|
4
4
|
var provideListModel = (model) => provide(listModelKey, model);
|
|
5
5
|
var injectListModel = () => {
|
|
@@ -7,7 +7,6 @@ var injectListModel = () => {
|
|
|
7
7
|
if (!model) throw new Error("This component must be used inside a <List />.");
|
|
8
8
|
return model;
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { injectListModel, provideListModel };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=listContext.mjs.map
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { useLanguage } from "../composables/remoteContext.mjs";
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/list/locales.ts
|
|
4
4
|
var texts = {
|
|
5
5
|
"en-US": {
|
|
6
6
|
dateRange: "Date range",
|
|
7
|
+
"dateRange.endBeforeStart": "The end must not be before the start.",
|
|
8
|
+
"dateRange.endDate": "End date",
|
|
9
|
+
"dateRange.endTime": "End time",
|
|
10
|
+
"dateRange.from": "from {date}",
|
|
11
|
+
"dateRange.startDate": "Start date",
|
|
12
|
+
"dateRange.startTime": "Start time",
|
|
13
|
+
"dateRange.until": "until {date}",
|
|
7
14
|
filters: "Filters",
|
|
8
15
|
"filters.all": "All filters",
|
|
9
16
|
"filters.clear": "Clear filters",
|
|
@@ -34,6 +41,13 @@ var texts = {
|
|
|
34
41
|
},
|
|
35
42
|
"de-DE": {
|
|
36
43
|
dateRange: "Zeitraum",
|
|
44
|
+
"dateRange.endBeforeStart": "Das Ende darf nicht vor dem Start liegen.",
|
|
45
|
+
"dateRange.endDate": "Enddatum",
|
|
46
|
+
"dateRange.endTime": "Endzeit",
|
|
47
|
+
"dateRange.from": "ab {date}",
|
|
48
|
+
"dateRange.startDate": "Startdatum",
|
|
49
|
+
"dateRange.startTime": "Startzeit",
|
|
50
|
+
"dateRange.until": "bis {date}",
|
|
37
51
|
filters: "Filter",
|
|
38
52
|
"filters.all": "Alle Filter",
|
|
39
53
|
"filters.clear": "Filter entfernen",
|
|
@@ -78,7 +92,6 @@ var useListTexts = () => {
|
|
|
78
92
|
return (key, values = {}) => table[key].replace(/\{(\w+)\}/g, (placeholder, name) => name in values ? String(values[name]) : placeholder);
|
|
79
93
|
});
|
|
80
94
|
};
|
|
81
|
-
//#endregion
|
|
82
95
|
export { texts, useListTexts };
|
|
83
96
|
|
|
84
97
|
//# sourceMappingURL=locales.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.mjs","names":[],"sources":["../../../../../src/list/locales.ts"],"sourcesContent":["import { useLanguage } from \"@/composables/remoteContext\";\nimport { computed, type ComputedRef } from \"vue\";\n\n/*\n * Copied from `packages/components/src/components/List/locales/*.locale.json`.\n *\n * Flow's strings are compiled into the React bundle by a locale plugin and are\n * not importable from a published package, so a Vue binding has to carry its\n * own — the same trade as the overlays' strings (`src/overlays/locales.ts`), at\n * a larger count. A rewording on the Flow side fails\n * `src/tests/CopiedTexts.test.ts`.\n */\nexport const texts = {\n \"en-US\": {\n dateRange: \"Date range\",\n filters: \"Filters\",\n \"filters.all\": \"All filters\",\n \"filters.clear\": \"Clear filters\",\n \"filters.clearSelection\": \"Clear selection\",\n \"filters.deselectAll\": \"Deselect all\",\n \"filters.reset\": \"Reset filters\",\n \"filters.selectAll\": \"Select all\",\n \"filters.store\": \"Store filters\",\n loadingMore: \"Loading more items\",\n \"noItems.heading\": \"No items available\",\n \"noItems.text\":\n \"Once there are items available, they will be displayed here.\",\n \"noResult.heading\": \"No search results found\",\n \"noResult.text\":\n \"Your search did not return any results. Please adjust the search query or your filters.\",\n options: \"Options\",\n paginationInfo: \"Showing {visibleItemsCount} of {totalItemsCount}\",\n reset: \"Reset\",\n /*\n * One key per branch, because Flow's is ICU (`{n, select, 1 {…} other {…}}`)\n * and this binding carries a `{name}` formatter rather than an ICU parser.\n * The two branches are picked in code — see `AllFiltersModal`.\n */\n \"results.show.one\": \"Show {totalItemCount} result\",\n \"results.show.other\": \"Show {totalItemCount} Results\",\n settings: \"Settings\",\n \"settings.viewMode\": \"View\",\n \"settings.viewMode.list\": \"List\",\n \"settings.viewMode.table\": \"Table\",\n \"settings.viewMode.tiles\": \"Tiles\",\n showMore: \"Show more\",\n sorting: \"Sorting\",\n \"toggleExpandButton.collapse\": \"Show less\",\n \"toggleExpandButton.expand\": \"Show more\",\n },\n \"de-DE\": {\n dateRange: \"Zeitraum\",\n filters: \"Filter\",\n \"filters.all\": \"Alle Filter\",\n \"filters.clear\": \"Filter entfernen\",\n \"filters.clearSelection\": \"Auswahl aufheben\",\n \"filters.deselectAll\": \"Alle abwählen\",\n \"filters.reset\": \"Filter zurücksetzen\",\n \"filters.selectAll\": \"Alle auswählen\",\n \"filters.store\": \"Filter speichern\",\n loadingMore: \"Weitere Einträge werden geladen\",\n \"noItems.heading\": \"Keine Einträge vorhanden\",\n \"noItems.text\":\n \"Sobald Einträge vorhanden sind, werden sie hier angezeigt.\",\n \"noResult.heading\": \"Keine Suchergebnisse gefunden\",\n \"noResult.text\":\n \"Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.\",\n options: \"Optionen\",\n paginationInfo:\n \"{visibleItemsCount} von insgesamt {totalItemsCount} angezeigt\",\n reset: \"Zurücksetzen\",\n \"results.show.one\": \"{totalItemCount} Ergebnis anzeigen\",\n \"results.show.other\": \"{totalItemCount} Ergebnisse anzeigen\",\n settings: \"Einstellungen\",\n \"settings.viewMode\": \"Ansicht\",\n \"settings.viewMode.list\": \"Liste\",\n \"settings.viewMode.table\": \"Tabelle\",\n \"settings.viewMode.tiles\": \"Raster\",\n showMore: \"Mehr anzeigen\",\n sorting: \"Sortierung\",\n \"toggleExpandButton.collapse\": \"Weniger anzeigen\",\n \"toggleExpandButton.expand\": \"Mehr anzeigen\",\n },\n} as const;\n\nexport type ListTextKey = keyof (typeof texts)[\"en-US\"];\n\nexport type ListTextFormatter = (\n key: ListTextKey,\n values?: Record<string, string | number>,\n) => string;\n\n/**\n * The list's texts in the host's language.\n *\n * Only `{name}` placeholders, not ICU: the two strings that interpolate count\n * items, and neither pluralizes. A string that needed a plural rule would need\n * a formatter, and the honest fix then is `@flr-generate` on the List rather\n * than an ICU parser in a binding.\n */\nexport const useListTexts = (): ComputedRef<ListTextFormatter> => {\n const language = useLanguage();\n\n return computed(() => {\n const table = language.value?.startsWith(\"de\")\n ? texts[\"de-DE\"]\n : texts[\"en-US\"];\n\n return (key, values = {}) =>\n table[key].replace(/\\{(\\w+)\\}/g, (placeholder, name: string) =>\n name in values ? String(values[name]) : placeholder,\n );\n });\n};\n"],"mappings":";;;AAYA,IAAa,QAAQ;CACnB,SAAS;EACP,WAAW;EACX,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,0BAA0B;EAC1B,uBAAuB;EACvB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;EACb,mBAAmB;EACnB,gBACE;EACF,oBAAoB;EACpB,iBACE;EACF,SAAS;EACT,gBAAgB;EAChB,OAAO;EAMP,oBAAoB;EACpB,sBAAsB;EACtB,UAAU;EACV,qBAAqB;EACrB,0BAA0B;EAC1B,2BAA2B;EAC3B,2BAA2B;EAC3B,UAAU;EACV,SAAS;EACT,+BAA+B;EAC/B,6BAA6B;CAC/B;CACA,SAAS;EACP,WAAW;EACX,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,0BAA0B;EAC1B,uBAAuB;EACvB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;EACb,mBAAmB;EACnB,gBACE;EACF,oBAAoB;EACpB,iBACE;EACF,SAAS;EACT,gBACE;EACF,OAAO;EACP,oBAAoB;EACpB,sBAAsB;EACtB,UAAU;EACV,qBAAqB;EACrB,0BAA0B;EAC1B,2BAA2B;EAC3B,2BAA2B;EAC3B,UAAU;EACV,SAAS;EACT,+BAA+B;EAC/B,6BAA6B;CAC/B;AACF;;;;;;;;;AAiBA,IAAa,qBAAqD;CAChE,MAAM,WAAW,YAAY;CAE7B,OAAO,eAAe;EACpB,MAAM,QAAQ,SAAS,OAAO,WAAW,IAAI,IACzC,MAAM,WACN,MAAM;EAEV,QAAQ,KAAK,SAAS,CAAC,MACrB,MAAM,IAAI,CAAC,QAAQ,eAAe,aAAa,SAC7C,QAAQ,SAAS,OAAO,OAAO,KAAK,IAAI,WAC1C;CACJ,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"locales.mjs","names":[],"sources":["../../../../../src/list/locales.ts"],"sourcesContent":["import { useLanguage } from \"@/composables/remoteContext\";\nimport { computed, type ComputedRef } from \"vue\";\n\n/*\n * Copied from `packages/components/src/components/List/locales/*.locale.json`.\n *\n * Flow's strings are compiled into the React bundle by a locale plugin and are\n * not importable from a published package, so a Vue binding has to carry its\n * own — the same trade as the overlays' strings (`src/overlays/locales.ts`), at\n * a larger count. A rewording on the Flow side fails\n * `src/tests/CopiedTexts.test.ts`.\n */\nexport const texts = {\n \"en-US\": {\n dateRange: \"Date range\",\n \"dateRange.endBeforeStart\": \"The end must not be before the start.\",\n \"dateRange.endDate\": \"End date\",\n \"dateRange.endTime\": \"End time\",\n \"dateRange.from\": \"from {date}\",\n \"dateRange.startDate\": \"Start date\",\n \"dateRange.startTime\": \"Start time\",\n \"dateRange.until\": \"until {date}\",\n filters: \"Filters\",\n \"filters.all\": \"All filters\",\n \"filters.clear\": \"Clear filters\",\n \"filters.clearSelection\": \"Clear selection\",\n \"filters.deselectAll\": \"Deselect all\",\n \"filters.reset\": \"Reset filters\",\n \"filters.selectAll\": \"Select all\",\n \"filters.store\": \"Store filters\",\n loadingMore: \"Loading more items\",\n \"noItems.heading\": \"No items available\",\n \"noItems.text\":\n \"Once there are items available, they will be displayed here.\",\n \"noResult.heading\": \"No search results found\",\n \"noResult.text\":\n \"Your search did not return any results. Please adjust the search query or your filters.\",\n options: \"Options\",\n paginationInfo: \"Showing {visibleItemsCount} of {totalItemsCount}\",\n reset: \"Reset\",\n /*\n * One key per branch, because Flow's is ICU (`{n, select, 1 {…} other {…}}`)\n * and this binding carries a `{name}` formatter rather than an ICU parser.\n * The two branches are picked in code — see `AllFiltersModal`.\n */\n \"results.show.one\": \"Show {totalItemCount} result\",\n \"results.show.other\": \"Show {totalItemCount} Results\",\n settings: \"Settings\",\n \"settings.viewMode\": \"View\",\n \"settings.viewMode.list\": \"List\",\n \"settings.viewMode.table\": \"Table\",\n \"settings.viewMode.tiles\": \"Tiles\",\n showMore: \"Show more\",\n sorting: \"Sorting\",\n \"toggleExpandButton.collapse\": \"Show less\",\n \"toggleExpandButton.expand\": \"Show more\",\n },\n \"de-DE\": {\n dateRange: \"Zeitraum\",\n \"dateRange.endBeforeStart\": \"Das Ende darf nicht vor dem Start liegen.\",\n \"dateRange.endDate\": \"Enddatum\",\n \"dateRange.endTime\": \"Endzeit\",\n \"dateRange.from\": \"ab {date}\",\n \"dateRange.startDate\": \"Startdatum\",\n \"dateRange.startTime\": \"Startzeit\",\n \"dateRange.until\": \"bis {date}\",\n filters: \"Filter\",\n \"filters.all\": \"Alle Filter\",\n \"filters.clear\": \"Filter entfernen\",\n \"filters.clearSelection\": \"Auswahl aufheben\",\n \"filters.deselectAll\": \"Alle abwählen\",\n \"filters.reset\": \"Filter zurücksetzen\",\n \"filters.selectAll\": \"Alle auswählen\",\n \"filters.store\": \"Filter speichern\",\n loadingMore: \"Weitere Einträge werden geladen\",\n \"noItems.heading\": \"Keine Einträge vorhanden\",\n \"noItems.text\":\n \"Sobald Einträge vorhanden sind, werden sie hier angezeigt.\",\n \"noResult.heading\": \"Keine Suchergebnisse gefunden\",\n \"noResult.text\":\n \"Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.\",\n options: \"Optionen\",\n paginationInfo:\n \"{visibleItemsCount} von insgesamt {totalItemsCount} angezeigt\",\n reset: \"Zurücksetzen\",\n \"results.show.one\": \"{totalItemCount} Ergebnis anzeigen\",\n \"results.show.other\": \"{totalItemCount} Ergebnisse anzeigen\",\n settings: \"Einstellungen\",\n \"settings.viewMode\": \"Ansicht\",\n \"settings.viewMode.list\": \"Liste\",\n \"settings.viewMode.table\": \"Tabelle\",\n \"settings.viewMode.tiles\": \"Raster\",\n showMore: \"Mehr anzeigen\",\n sorting: \"Sortierung\",\n \"toggleExpandButton.collapse\": \"Weniger anzeigen\",\n \"toggleExpandButton.expand\": \"Mehr anzeigen\",\n },\n} as const;\n\nexport type ListTextKey = keyof (typeof texts)[\"en-US\"];\n\nexport type ListTextFormatter = (\n key: ListTextKey,\n values?: Record<string, string | number>,\n) => string;\n\n/**\n * The list's texts in the host's language.\n *\n * Only `{name}` placeholders, not ICU: the two strings that interpolate count\n * items, and neither pluralizes. A string that needed a plural rule would need\n * a formatter, and the honest fix then is `@flr-generate` on the List rather\n * than an ICU parser in a binding.\n */\nexport const useListTexts = (): ComputedRef<ListTextFormatter> => {\n const language = useLanguage();\n\n return computed(() => {\n const table = language.value?.startsWith(\"de\")\n ? texts[\"de-DE\"]\n : texts[\"en-US\"];\n\n return (key, values = {}) =>\n table[key].replace(/\\{(\\w+)\\}/g, (placeholder, name: string) =>\n name in values ? String(values[name]) : placeholder,\n );\n });\n};\n"],"mappings":";;;AAYA,IAAa,QAAQ;CACnB,SAAS;EACP,WAAW;EACX,4BAA4B;EAC5B,qBAAqB;EACrB,qBAAqB;EACrB,kBAAkB;EAClB,uBAAuB;EACvB,uBAAuB;EACvB,mBAAmB;EACnB,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,0BAA0B;EAC1B,uBAAuB;EACvB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;EACb,mBAAmB;EACnB,gBACE;EACF,oBAAoB;EACpB,iBACE;EACF,SAAS;EACT,gBAAgB;EAChB,OAAO;EAMP,oBAAoB;EACpB,sBAAsB;EACtB,UAAU;EACV,qBAAqB;EACrB,0BAA0B;EAC1B,2BAA2B;EAC3B,2BAA2B;EAC3B,UAAU;EACV,SAAS;EACT,+BAA+B;EAC/B,6BAA6B;CAC/B;CACA,SAAS;EACP,WAAW;EACX,4BAA4B;EAC5B,qBAAqB;EACrB,qBAAqB;EACrB,kBAAkB;EAClB,uBAAuB;EACvB,uBAAuB;EACvB,mBAAmB;EACnB,SAAS;EACT,eAAe;EACf,iBAAiB;EACjB,0BAA0B;EAC1B,uBAAuB;EACvB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;EACb,mBAAmB;EACnB,gBACE;EACF,oBAAoB;EACpB,iBACE;EACF,SAAS;EACT,gBACE;EACF,OAAO;EACP,oBAAoB;EACpB,sBAAsB;EACtB,UAAU;EACV,qBAAqB;EACrB,0BAA0B;EAC1B,2BAA2B;EAC3B,2BAA2B;EAC3B,UAAU;EACV,SAAS;EACT,+BAA+B;EAC/B,6BAA6B;CAC/B;AACF;;;;;;;;;AAiBA,IAAa,qBAAqD;CAChE,MAAM,WAAW,YAAY;CAE7B,OAAO,eAAe;EACpB,MAAM,QAAQ,SAAS,OAAO,WAAW,IAAI,IACzC,MAAM,WACN,MAAM;EAEV,QAAQ,KAAK,SAAS,CAAC,MACrB,MAAM,IAAI,CAAC,QAAQ,eAAe,aAAa,SAC7C,QAAQ,SAAS,OAAO,OAAO,KAAK,IAAI,WAC1C;CACJ,CAAC;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import watchMobxValue from "../lib/mobxSelector.mjs";
|
|
2
2
|
import { injectListModel } from "./listContext.mjs";
|
|
3
|
-
|
|
3
|
+
// src/list/metadata.ts
|
|
4
4
|
/**
|
|
5
5
|
* What the loader reported beside its data.
|
|
6
6
|
*
|
|
@@ -16,7 +16,6 @@ var useListMetadata = () => {
|
|
|
16
16
|
const list = injectListModel();
|
|
17
17
|
return watchMobxValue(() => list.loaderState.metadata);
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { useListMetadata as default, useListMetadata };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=metadata.mjs.map
|
|
@@ -13,7 +13,7 @@ import { isRef } from "vue";
|
|
|
13
13
|
import { action, makeObservable, observable } from "mobx";
|
|
14
14
|
import { hash } from "object-code";
|
|
15
15
|
import { getCoreRowModel, getFacetedUniqueValues, getFilteredRowModel, getPaginationRowModel, getSortedRowModel } from "@tanstack/table-core";
|
|
16
|
-
|
|
16
|
+
// src/list/model.ts
|
|
17
17
|
var emptyData = [];
|
|
18
18
|
/** The same items in the same order, whether or not it is the same array. */
|
|
19
19
|
var isSameData = (current, next) => current === next || current !== void 0 && current.length === next.length && current.every((item, index) => item === next[index]);
|
|
@@ -386,7 +386,6 @@ var ListModel = class {
|
|
|
386
386
|
return Array.from(defs.values());
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
//#endregion
|
|
390
389
|
export { ListModel };
|
|
391
390
|
|
|
392
391
|
//# sourceMappingURL=model.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { injectSettings } from "../components/SettingsProvider.mjs";
|
|
2
|
-
|
|
2
|
+
// src/list/settings.ts
|
|
3
3
|
/**
|
|
4
4
|
* Which keys survive how.
|
|
5
5
|
*
|
|
@@ -56,7 +56,6 @@ var useListSettings = (storageKey) => {
|
|
|
56
56
|
const store = injectSettings();
|
|
57
57
|
return storageKey && store ? createListSettings(store, storageKey) : void 0;
|
|
58
58
|
};
|
|
59
|
-
//#endregion
|
|
60
59
|
export { createListSettings, useListSettings };
|
|
61
60
|
|
|
62
61
|
//# sourceMappingURL=settings.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeVNodeProps } from "../lib/propKeys.mjs";
|
|
2
2
|
import { Fragment, withCtx } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/list/setupComponents.ts
|
|
4
4
|
/**
|
|
5
5
|
* A list is configured by the elements inside it, not by one big prop.
|
|
6
6
|
*
|
|
@@ -72,7 +72,6 @@ var findSetups = (children, component) => {
|
|
|
72
72
|
return found;
|
|
73
73
|
};
|
|
74
74
|
var findSetup = (children, component) => findSetups(children, component)[0];
|
|
75
|
-
//#endregion
|
|
76
75
|
export { ListFilter, ListItem, ListLoaderAsync, ListLoaderComposable, ListSearch, ListSorting, ListStaticData, ListTable, ListTableBody, ListTableCell, ListTableColumn, ListTableHeader, ListTableRow, findSetup, findSetups, isListSetupComponent };
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=setupComponents.mjs.map
|