@mittwald/flow-react-components 1.6.0-next.24 → 1.6.0-next.26
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/USAGE.md +5 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_18.locale.mjs +14 -0
- package/dist/js/default.mjs +3 -2
- package/dist/js/flr-universal.mjs +2 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +5 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +5 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +16 -9
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs +1 -1
- package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
- package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
- package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
- package/dist/js/packages/components-base/src/index.mjs +4 -2
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
- package/dist/types/_bundled/flow-components-base/index.d.ts +3 -1
- package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
- package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
- package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
- package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
- package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
- package/dist/types/components/List/index.d.ts +2 -0
- package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
- package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
- package/dist/types/components/List/model/filter/types.d.ts +23 -1
- package/dist/types/index/flr-universal.d.ts +1 -1
- package/package.json +10 -10
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
- package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
- package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
var __locale_default = {
|
|
5
5
|
"de-DE": {
|
|
6
6
|
"dateRange": "Zeitraum",
|
|
7
|
+
"dateRange.endBeforeStart": "Das Ende darf nicht vor dem Start liegen.",
|
|
8
|
+
"dateRange.endDate": "Enddatum",
|
|
9
|
+
"dateRange.endTime": "Endzeit",
|
|
10
|
+
"dateRange.from": "ab {date}",
|
|
11
|
+
"dateRange.startDate": "Startdatum",
|
|
12
|
+
"dateRange.startTime": "Startzeit",
|
|
13
|
+
"dateRange.until": "bis {date}",
|
|
7
14
|
"filters": "Filter",
|
|
8
15
|
"filters.all": "Alle Filter",
|
|
9
16
|
"filters.clear": "Filter entfernen",
|
|
@@ -35,6 +42,13 @@ var __locale_default = {
|
|
|
35
42
|
},
|
|
36
43
|
"en-US": {
|
|
37
44
|
"dateRange": "Date range",
|
|
45
|
+
"dateRange.endBeforeStart": "The end must not be before the start.",
|
|
46
|
+
"dateRange.endDate": "End date",
|
|
47
|
+
"dateRange.endTime": "End time",
|
|
48
|
+
"dateRange.from": "from {date}",
|
|
49
|
+
"dateRange.startDate": "Start date",
|
|
50
|
+
"dateRange.startTime": "Start time",
|
|
51
|
+
"dateRange.until": "until {date}",
|
|
38
52
|
"filters": "Filters",
|
|
39
53
|
"filters.all": "All filters",
|
|
40
54
|
"filters.clear": "Clear filters",
|
package/dist/js/default.mjs
CHANGED
|
@@ -278,6 +278,7 @@ import { LightBoxGalleryItem } from "./packages/components/src/components/LightB
|
|
|
278
278
|
import { OverlayContent } from "./packages/components/src/components/Overlay/components/OverlayContent.mjs";
|
|
279
279
|
import { Overlay } from "./packages/components/src/components/Overlay/Overlay.mjs";
|
|
280
280
|
import { LightBox } from "./packages/components/src/components/LightBox/LightBox.mjs";
|
|
281
|
+
import { resolveDateRangeFilterValue } from "./packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs";
|
|
281
282
|
import { SortingFunctions } from "./packages/components/src/components/List/model/sorting/SortingFunctions.mjs";
|
|
282
283
|
import { GridList } from "./packages/components/src/components/List/components/Items/views/GridList/GridList.mjs";
|
|
283
284
|
import { GridListItem } from "./packages/components/src/components/List/components/Items/views/GridListItem/GridListItem.mjs";
|
|
@@ -290,6 +291,7 @@ import { useList } from "./packages/components/src/components/List/hooks/useList
|
|
|
290
291
|
import { useListMetadata } from "./packages/components/src/components/List/hooks/useListMetadata.mjs";
|
|
291
292
|
import { Render } from "./packages/components/src/lib/react/components/Render/Render.mjs";
|
|
292
293
|
import { SearchField } from "./packages/components/src/components/SearchField/SearchField.mjs";
|
|
294
|
+
import { TimeField } from "./packages/components/src/components/TimeField/TimeField.mjs";
|
|
293
295
|
import { Section } from "./packages/components/src/components/Section/Section.mjs";
|
|
294
296
|
import { RadioGroup } from "./packages/components/src/components/RadioGroup/RadioGroup.mjs";
|
|
295
297
|
import { Radio } from "./packages/components/src/components/RadioGroup/components/Radio/Radio.mjs";
|
|
@@ -337,7 +339,6 @@ import { Tabs } from "./packages/components/src/components/Tabs/Tabs.mjs";
|
|
|
337
339
|
import { TabTitle } from "./packages/components/src/components/Tabs/components/TabTitle/TabTitle.mjs";
|
|
338
340
|
import { Tab } from "./packages/components/src/components/Tabs/components/Tab/Tab.mjs";
|
|
339
341
|
import { TextField } from "./packages/components/src/components/TextField/TextField.mjs";
|
|
340
|
-
import { TimeField } from "./packages/components/src/components/TimeField/TimeField.mjs";
|
|
341
342
|
import { Truncate } from "./packages/components/src/components/Truncate/Truncate.mjs";
|
|
342
343
|
import { TunnelEntry } from "./packages/components/src/components/TunnelEntry/TunnelEntry.mjs";
|
|
343
|
-
export { AbortActionError, AccentBox, Accordion, AccordionGroup, Action, ActionBatch, ActionGroup, Activity, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, AreaDot, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentDefaultsContext, ComponentDefaultsProvider, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningContext, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, EmptyView, EmptyViewContainer, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, GridList, GridListItem, Header, HeaderNavigation, Heading, Icon, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, IntlProvider, Kbd, Label, LabeledValue, LayoutCard, Legend, LegendItem, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListSorting, ListStaticData, ListSummary, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, Overlay, OverlayContent, OverlayController, OverlayTrigger, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, PropsContextProvider, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, Render, RouterProvider, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, Skeleton, SkeletonMode, SkeletonText, Slider, SortingFunctions, SuspenseTrigger, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, ThemedHtml, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, TypedArea, TypedBar, TypedChartGrid, TypedChartLegend, TypedChartTooltip, TypedLine, TypedList, TypedListFilter, TypedListItem, TypedListLoaderAsync, TypedListSorting, TypedListStaticData, TypedXAxis, TypedYAxis, Wrap, XAxis, YAxis, abortAction, builtInComponentDefaults, dynamic, eventHandlerContext, flags, getRemoteEvent, getResolvedTheme, getTheme, iconCategories, isDateRangeValue, overlayTriggersTunneledTo, propsContext, setTheme, sortByDachFirst, themeHtmlAttribute, typedCartesianChart, typedList, useAriaAnnounceSuspense, useComponentDefaults, useControlledRemoteValueProps, useDesignTokens, useIsMounted, useLanguage, useList, useListMetadata, useLocalizedStringFormatter, useModalController, useNotificationController, useOnChange, useOverlayController, useProps, useTheme as useStoredTheme, useResolvedTheme as useTheme, useTranslationProvider, useWarnDeprecation };
|
|
344
|
+
export { AbortActionError, AccentBox, Accordion, AccordionGroup, Action, ActionBatch, ActionGroup, Activity, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, AreaDot, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentDefaultsContext, ComponentDefaultsProvider, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningContext, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, EmptyView, EmptyViewContainer, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, GridList, GridListItem, Header, HeaderNavigation, Heading, Icon, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, IntlProvider, Kbd, Label, LabeledValue, LayoutCard, Legend, LegendItem, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListSorting, ListStaticData, ListSummary, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, Overlay, OverlayContent, OverlayController, OverlayTrigger, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, PropsContextProvider, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, Render, RouterProvider, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, Skeleton, SkeletonMode, SkeletonText, Slider, SortingFunctions, SuspenseTrigger, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, ThemedHtml, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, TypedArea, TypedBar, TypedChartGrid, TypedChartLegend, TypedChartTooltip, TypedLine, TypedList, TypedListFilter, TypedListItem, TypedListLoaderAsync, TypedListSorting, TypedListStaticData, TypedXAxis, TypedYAxis, Wrap, XAxis, YAxis, abortAction, builtInComponentDefaults, dynamic, eventHandlerContext, flags, getRemoteEvent, getResolvedTheme, getTheme, iconCategories, isDateRangeValue, overlayTriggersTunneledTo, propsContext, resolveDateRangeFilterValue, setTheme, sortByDachFirst, themeHtmlAttribute, typedCartesianChart, typedList, useAriaAnnounceSuspense, useComponentDefaults, useControlledRemoteValueProps, useDesignTokens, useIsMounted, useLanguage, useList, useListMetadata, useLocalizedStringFormatter, useModalController, useNotificationController, useOnChange, useOverlayController, useProps, useTheme as useStoredTheme, useResolvedTheme as useTheme, useTranslationProvider, useWarnDeprecation };
|
|
@@ -153,6 +153,7 @@ import { PopoverTrigger } from "./packages/components/src/components/Popover/com
|
|
|
153
153
|
import { IntlProvider } from "./packages/components/src/components/IntlProvider/IntlProvider.mjs";
|
|
154
154
|
import { LightBoxTrigger } from "./packages/components/src/components/LightBox/components/LightBoxTrigger/LightBoxTrigger.mjs";
|
|
155
155
|
import { LightBox } from "./packages/components/src/components/LightBox/LightBox.mjs";
|
|
156
|
+
import { resolveDateRangeFilterValue } from "./packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs";
|
|
156
157
|
import { ListItemView } from "./packages/components/src/components/List/components/ListItemView/ListItemView.mjs";
|
|
157
158
|
import { ModalTrigger } from "./packages/components/src/components/Modal/components/ModalTrigger/ModalTrigger.mjs";
|
|
158
159
|
import { Modal } from "./packages/components/src/components/Modal/Modal.mjs";
|
|
@@ -160,4 +161,4 @@ import { SettingsProvider } from "./packages/components/src/components/SettingsP
|
|
|
160
161
|
import { List } from "./packages/components/src/components/List/List.mjs";
|
|
161
162
|
import { typedList } from "./packages/components/src/components/List/typedList.mjs";
|
|
162
163
|
import { NotificationProvider, useNotificationController } from "./packages/components/src/components/NotificationProvider/NotificationProvider.mjs";
|
|
163
|
-
export { Action, ActionBatch, BrowserOnly, ComponentDefaultsProvider, CountryOptions, DeprecationWarningProvider, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IntlProvider, LightBox, LightBoxTrigger, List, ListItemView, Modal, ModalTrigger, NotificationProvider, OverlayController, Popover, PopoverTrigger, SettingsProvider, Wrap, typedList, useControlledRemoteValueProps, useIsMounted, useLanguage, useModalController, useNotificationController, useOnChange, useOverlayController, useProps };
|
|
164
|
+
export { Action, ActionBatch, BrowserOnly, ComponentDefaultsProvider, CountryOptions, DeprecationWarningProvider, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IntlProvider, LightBox, LightBoxTrigger, List, ListItemView, Modal, ModalTrigger, NotificationProvider, OverlayController, Popover, PopoverTrigger, SettingsProvider, Wrap, resolveDateRangeFilterValue, typedList, useControlledRemoteValueProps, useIsMounted, useLanguage, useModalController, useNotificationController, useOnChange, useOverlayController, useProps };
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import { IconClose } from "../../../../../Icon/components/icons/IconClose.mjs";
|
|
4
4
|
import { IconSave } from "../../../../../Icon/components/icons/IconSave.mjs";
|
|
5
5
|
import { IconUndo } from "../../../../../Icon/components/icons/IconUndo.mjs";
|
|
6
|
+
import { useLanguage } from "../../../../../../lib/hooks/useLanguage.mjs";
|
|
6
7
|
import { useLocalizedStringFormatter } from "../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
8
|
+
import { formatListDateRange } from "../../../../../../../../components-base/src/list/filter/formatDateRange.mjs";
|
|
9
|
+
import "../../../../../../../../components-base/src/index.mjs";
|
|
7
10
|
import ButtonView from "../../../../../../views/ButtonView.mjs";
|
|
8
11
|
import DivView from "../../../../../../views/DivView.mjs";
|
|
9
12
|
import __locale_default from "../../../../../../../../../_virtual/_18.locale.mjs";
|
|
@@ -14,7 +17,6 @@ import TooltipView from "../../../../../../views/TooltipView.mjs";
|
|
|
14
17
|
import BadgeView from "../../../../../../views/BadgeView.mjs";
|
|
15
18
|
import TooltipTriggerView from "../../../../../../views/TooltipTriggerView.mjs";
|
|
16
19
|
import { Filter } from "../../../../model/filter/Filter.mjs";
|
|
17
|
-
import { transformDateValueToFormattedDate } from "../../../../../../lib/date/transformDateValueToFormattedDate.mjs";
|
|
18
20
|
import { DateRangeFilter } from "../../../../model/filter/DateRangeFilter.mjs";
|
|
19
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
22
|
import { observer } from "mobx-react-lite";
|
|
@@ -23,13 +25,14 @@ var ActiveFilters = observer((props) => {
|
|
|
23
25
|
const { isDisabled } = props;
|
|
24
26
|
const list = useList();
|
|
25
27
|
const formatter = useLocalizedStringFormatter(__locale_default, "List");
|
|
28
|
+
const locale = useLanguage();
|
|
26
29
|
const activeFilters = list.filters.flatMap((f) => {
|
|
27
30
|
if (f instanceof DateRangeFilter) {
|
|
28
31
|
const value = f.getValue();
|
|
29
32
|
if (value) return [/* @__PURE__ */ jsx(BadgeView, {
|
|
30
33
|
onClose: () => f.clear(),
|
|
31
34
|
isDisabled,
|
|
32
|
-
children: /* @__PURE__ */ jsx(TextView, { children:
|
|
35
|
+
children: /* @__PURE__ */ jsx(TextView, { children: formatListDateRange(value, locale, formatter.format) })
|
|
33
36
|
}, f.name)];
|
|
34
37
|
}
|
|
35
38
|
return f.values.filter((v) => v.isActive).map((v) => /* @__PURE__ */ jsx(BadgeView, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveFilters.mjs","names":["locales","styles"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/ActiveFilters/ActiveFilters.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport styles from \"./ActiveFilters.module.scss\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { observer } from \"mobx-react-lite\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport {\n IconClose,\n IconSave,\n IconUndo,\n} from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TooltipView from \"@/views/TooltipView\";\nimport DivView from \"@/views/DivView\";\nimport BadgeView from \"@/views/BadgeView\";\nimport TooltipTriggerView from \"@/views/TooltipTriggerView\";\nimport TextView from \"@/views/TextView\";\nimport { Filter } from \"@/components/List/model/filter/Filter\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActiveFilters.mjs","names":["locales","styles"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/ActiveFilters/ActiveFilters.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport styles from \"./ActiveFilters.module.scss\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { observer } from \"mobx-react-lite\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport {\n IconClose,\n IconSave,\n IconUndo,\n} from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TooltipView from \"@/views/TooltipView\";\nimport DivView from \"@/views/DivView\";\nimport BadgeView from \"@/views/BadgeView\";\nimport TooltipTriggerView from \"@/views/TooltipTriggerView\";\nimport TextView from \"@/views/TextView\";\nimport { Filter } from \"@/components/List/model/filter/Filter\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\nimport { useLanguage } from \"@/lib/hooks/useLanguage\";\nimport { formatListDateRange } from \"@mittwald/flow-components-base\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const ActiveFilters: FC<Props> = observer((props) => {\n const { isDisabled } = props;\n const list = useList();\n const formatter = useLocalizedStringFormatter(locales, \"List\");\n const locale = useLanguage();\n\n const activeFilters = list.filters.flatMap((f) => {\n if (f instanceof DateRangeFilter) {\n const value = f.getValue();\n if (value) {\n return [\n <BadgeView\n key={f.name}\n onClose={() => f.clear()}\n isDisabled={isDisabled}\n >\n <TextView>\n {formatListDateRange(value, locale, formatter.format)}\n </TextView>\n </BadgeView>,\n ];\n }\n }\n\n return f.values\n .filter((v) => v.isActive)\n .map((v) => (\n <BadgeView\n key={v.id}\n onClose={() => v.deactivate()}\n isDisabled={isDisabled}\n >\n <TextView>{v.render()}</TextView>\n </BadgeView>\n ));\n });\n\n const storingAvailable = list.filters.some((f) => f.isStoringAvailable());\n const hasChanges = list.filters.some((f) => f.hasChanges());\n\n const storeFiltersButton = storingAvailable && hasChanges && (\n <TooltipTriggerView isDisabled={isDisabled}>\n <TooltipView>{formatter.format(\"filters.store\")}</TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() =>\n Filter.storeFilters(list, list.filters, {\n autosave: false,\n manualSave: true,\n })\n }\n aria-label={formatter.format(\"filters.store\")}\n >\n <IconSave />\n </ButtonView>\n </TooltipTriggerView>\n );\n\n const resetFiltersButton = hasChanges ? (\n <TooltipTriggerView isDisabled={isDisabled}>\n <TooltipView>{formatter.format(\"filters.reset\")}</TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() => list.resetFilters()}\n aria-label={formatter.format(\"filters.reset\")}\n >\n <IconUndo />\n </ButtonView>\n </TooltipTriggerView>\n ) : undefined;\n\n const removeAllFiltersButton =\n activeFilters.length > 1 ? (\n <TooltipTriggerView isDisabled={isDisabled}>\n <TooltipView>{formatter.format(\"filters.clear\")}</TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() => list.clearFilters()}\n aria-label={formatter.format(\"filters.clear\")}\n >\n <IconClose />\n </ButtonView>\n </TooltipTriggerView>\n ) : undefined;\n\n if (\n activeFilters.length === 0 &&\n !storeFiltersButton &&\n !resetFiltersButton\n ) {\n return null;\n }\n\n return (\n <DivView className={styles.activeFilters}>\n {activeFilters}\n {storeFiltersButton}\n {resetFiltersButton}\n {removeAllFiltersButton}\n </DivView>\n );\n});\n\nexport default ActiveFilters;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,gBAA2B,UAAU,UAAU;CAC1D,MAAM,EAAE,eAAe;CACvB,MAAM,OAAO,QAAQ;CACrB,MAAM,YAAY,4BAA4BA,kBAAS,MAAM;CAC7D,MAAM,SAAS,YAAY;CAE3B,MAAM,gBAAgB,KAAK,QAAQ,SAAS,MAAM;EAChD,IAAI,aAAa,iBAAiB;GAChC,MAAM,QAAQ,EAAE,SAAS;GACzB,IAAI,OACF,OAAO,CACL,oBAAC,WAAD;IAEE,eAAe,EAAE,MAAM;IACX;IAEZ,UAAA,oBAAC,UAAD,EAAA,UACG,oBAAoB,OAAO,QAAQ,UAAU,MAAM,EAC5C,CAAA;GACD,GAPJ,EAAE,IAOE,CACb;EAEJ;EAEA,OAAO,EAAE,OACN,QAAQ,MAAM,EAAE,QAAQ,CAAC,CACzB,KAAK,MACJ,oBAAC,WAAD;GAEE,eAAe,EAAE,WAAW;GAChB;GAEZ,UAAA,oBAAC,UAAD,EAAA,UAAW,EAAE,OAAO,EAAY,CAAA;EACvB,GALJ,EAAE,EAKE,CACZ;CACL,CAAC;CAED,MAAM,mBAAmB,KAAK,QAAQ,MAAM,MAAM,EAAE,mBAAmB,CAAC;CACxE,MAAM,aAAa,KAAK,QAAQ,MAAM,MAAM,EAAE,WAAW,CAAC;CAE1D,MAAM,qBAAqB,oBAAoB,cAC7C,qBAAC,oBAAD;EAAgC;EAAhC,UAAA,CACE,oBAAC,aAAD,EAAA,UAAc,UAAU,OAAO,eAAe,EAAe,CAAA,GAC7D,oBAAC,YAAD;GACE,MAAK;GACL,SAAQ;GACR,OAAM;GACN,eACE,OAAO,aAAa,MAAM,KAAK,SAAS;IACtC,UAAU;IACV,YAAY;GACd,CAAC;GAEH,cAAY,UAAU,OAAO,eAAe;GAE5C,UAAA,oBAAC,UAAD,CAAW,CAAA;EACD,CAAA,CACM;;CAGtB,MAAM,qBAAqB,aACzB,qBAAC,oBAAD;EAAgC;EAAhC,UAAA,CACE,oBAAC,aAAD,EAAA,UAAc,UAAU,OAAO,eAAe,EAAe,CAAA,GAC7D,oBAAC,YAAD;GACE,MAAK;GACL,SAAQ;GACR,OAAM;GACN,eAAe,KAAK,aAAa;GACjC,cAAY,UAAU,OAAO,eAAe;GAE5C,UAAA,oBAAC,UAAD,CAAW,CAAA;EACD,CAAA,CACM;CAClB,CAAA,IAAA,KAAA;CAEJ,MAAM,yBACJ,cAAc,SAAS,IACrB,qBAAC,oBAAD;EAAgC;EAAhC,UAAA,CACE,oBAAC,aAAD,EAAA,UAAc,UAAU,OAAO,eAAe,EAAe,CAAA,GAC7D,oBAAC,YAAD;GACE,MAAK;GACL,SAAQ;GACR,OAAM;GACN,eAAe,KAAK,aAAa;GACjC,cAAY,UAAU,OAAO,eAAe;GAE5C,UAAA,oBAAC,WAAD,CAAY,CAAA;EACF,CAAA,CACM;CAClB,CAAA,IAAA,KAAA;CAEN,IACE,cAAc,WAAW,KACzB,CAAC,sBACD,CAAC,oBAED,OAAO;CAGT,OACE,qBAAC,SAAD;EAAS,WAAWC,6BAAO;EAA3B,UAAA;GACG;GACA;GACA;GACA;EACM;;AAEb,CAAC"}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import ButtonView from "../../../../../../views/ButtonView.mjs";
|
|
5
|
+
import { isDateRangeValue } from "../../../../../Calendar/components/RangeCalendar/types.mjs";
|
|
5
6
|
import __locale_default from "../../../../../../../../../_virtual/_18.locale.mjs";
|
|
6
7
|
import RangeCalendarView from "../../../../../../views/RangeCalendarView.mjs";
|
|
8
|
+
import { DateTimeRangeFields } from "../DateTimeRangeFields/DateTimeRangeFields.mjs";
|
|
7
9
|
import FlexView from "../../../../../../views/FlexView.mjs";
|
|
8
10
|
import "react";
|
|
9
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -15,9 +17,9 @@ var FilterAccordionDateRange = (props) => {
|
|
|
15
17
|
return /* @__PURE__ */ jsxs(FlexView, {
|
|
16
18
|
direction: "column",
|
|
17
19
|
gap: "m",
|
|
18
|
-
children: [/* @__PURE__ */ jsx(RangeCalendarView, {
|
|
19
|
-
...filter.
|
|
20
|
-
value: currentValue,
|
|
20
|
+
children: [filter.granularity === "minute" ? /* @__PURE__ */ jsx(DateTimeRangeFields, { filter }) : /* @__PURE__ */ jsx(RangeCalendarView, {
|
|
21
|
+
...filter.rangeCalendarProps,
|
|
22
|
+
value: isDateRangeValue(currentValue) ? currentValue : null,
|
|
21
23
|
onChange: (range) => {
|
|
22
24
|
filter.setValue(range);
|
|
23
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterAccordionDateRange.mjs","names":["locales"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport ButtonView from \"@/views/ButtonView\";\nimport FlexView from \"@/views/FlexView\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport RangeCalendarView from \"@/views/RangeCalendarView\";\nimport type { AnyDateRangeFilter } from \"@/components/List/model/filter/types\";\n\ninterface Props {\n filter: AnyDateRangeFilter;\n}\n\nexport const FilterAccordionDateRange: FC<Props> = (props) => {\n const { filter } = props;\n\n const currentValue = filter.getValue();\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n return (\n <FlexView direction=\"column\" gap=\"m\">\n <RangeCalendarView\n
|
|
1
|
+
{"version":3,"file":"FilterAccordionDateRange.mjs","names":["locales"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport ButtonView from \"@/views/ButtonView\";\nimport FlexView from \"@/views/FlexView\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport RangeCalendarView from \"@/views/RangeCalendarView\";\nimport type { AnyDateRangeFilter } from \"@/components/List/model/filter/types\";\nimport { isDateRangeValue } from \"@/components/Calendar\";\nimport { DateTimeRangeFields } from \"@/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields\";\n\ninterface Props {\n filter: AnyDateRangeFilter;\n}\n\nexport const FilterAccordionDateRange: FC<Props> = (props) => {\n const { filter } = props;\n\n const currentValue = filter.getValue();\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n return (\n <FlexView direction=\"column\" gap=\"m\">\n {filter.granularity === \"minute\" ? (\n <DateTimeRangeFields filter={filter} />\n ) : (\n <RangeCalendarView\n {...filter.rangeCalendarProps}\n value={isDateRangeValue(currentValue) ? currentValue : null}\n onChange={(range) => {\n filter.setValue(range);\n }}\n />\n )}\n {currentValue && (\n <ButtonView\n size=\"s\"\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => filter.clear()}\n >\n {stringFormatter.format(\"filters.clearSelection\")}\n </ButtonView>\n )}\n </FlexView>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAcA,IAAa,4BAAuC,UAAU;CAC5D,MAAM,EAAE,WAAW;CAEnB,MAAM,eAAe,OAAO,SAAS;CAErC,MAAM,kBAAkB,4BAA4BA,kBAAS,MAAM;CAEnE,OACE,qBAAC,UAAD;EAAU,WAAU;EAAS,KAAI;EAAjC,UAAA,CACG,OAAO,gBAAgB,WACtB,oBAAC,qBAAD,EAA6B,OAAS,CAAA,IAEtC,oBAAC,mBAAD;GACE,GAAI,OAAO;GACX,OAAO,iBAAiB,YAAY,IAAI,eAAe;GACvD,WAAW,UAAU;IACnB,OAAO,SAAS,KAAK;GACvB;EACD,CAAA,GAEF,gBACC,oBAAC,YAAD;GACE,MAAK;GACL,OAAM;GACN,SAAQ;GACR,eAAe,OAAO,MAAM;GAE3B,UAAA,gBAAgB,OAAO,wBAAwB;EACtC,CAAA,CAEN;;AAEd"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useLocalizedStringFormatter } from "../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
|
+
import { getListDateTimeRangeUpdate, isListDateTimeRangeEndBeforeStart, listDateTimeRangeFieldsFromValue, toListCalendarDate, toListTime } from "../../../../../../../../components-base/src/list/filter/dateTimeRangeFields.mjs";
|
|
5
|
+
import "../../../../../../../../components-base/src/index.mjs";
|
|
6
|
+
import DivView from "../../../../../../views/DivView.mjs";
|
|
7
|
+
import __locale_default from "../../../../../../../../../_virtual/_18.locale.mjs";
|
|
8
|
+
import DatePickerView from "../../../../../../views/DatePickerView.mjs";
|
|
9
|
+
import TimeFieldView from "../../../../../../views/TimeFieldView.mjs";
|
|
10
|
+
import LabelView from "../../../../../../views/LabelView.mjs";
|
|
11
|
+
import FieldErrorView from "../../../../../../views/FieldErrorView.mjs";
|
|
12
|
+
import DateTimeRangeFields_module_default from "./DateTimeRangeFields.module.mjs";
|
|
13
|
+
import clsx from "clsx";
|
|
14
|
+
import { useId, useState } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
//#region src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.tsx
|
|
17
|
+
var DateTimeRangeFields = (props) => {
|
|
18
|
+
const { filter, className } = props;
|
|
19
|
+
const stringFormatter = useLocalizedStringFormatter(__locale_default, "List");
|
|
20
|
+
const value = filter.getValue();
|
|
21
|
+
const [appliedValue, setAppliedValue] = useState(value);
|
|
22
|
+
const [fields, setFields] = useState(() => listDateTimeRangeFieldsFromValue(value));
|
|
23
|
+
if (value !== appliedValue) {
|
|
24
|
+
setAppliedValue(value);
|
|
25
|
+
setFields(listDateTimeRangeFieldsFromValue(value));
|
|
26
|
+
}
|
|
27
|
+
const options = filter.dateTimeRangeOptions;
|
|
28
|
+
const minValue = toListCalendarDate(options?.minValue);
|
|
29
|
+
const maxValue = toListCalendarDate(options?.maxValue);
|
|
30
|
+
const update = (change) => {
|
|
31
|
+
const next = {
|
|
32
|
+
...fields,
|
|
33
|
+
...change
|
|
34
|
+
};
|
|
35
|
+
setFields(next);
|
|
36
|
+
const newValue = getListDateTimeRangeUpdate(next, appliedValue, options);
|
|
37
|
+
if (newValue === void 0) return;
|
|
38
|
+
setAppliedValue(newValue);
|
|
39
|
+
if (newValue) filter.setValue(newValue);
|
|
40
|
+
else filter.clear();
|
|
41
|
+
};
|
|
42
|
+
const rangeErrorId = useId();
|
|
43
|
+
const hasRangeError = isListDateTimeRangeEndBeforeStart(fields);
|
|
44
|
+
const describedBy = hasRangeError ? rangeErrorId : void 0;
|
|
45
|
+
return /* @__PURE__ */ jsxs(DivView, {
|
|
46
|
+
className: clsx(DateTimeRangeFields_module_default.dateTimeRangeFields, className),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(DatePickerView, {
|
|
49
|
+
value: fields.startDate,
|
|
50
|
+
onChange: (date) => update({ startDate: toListCalendarDate(date) }),
|
|
51
|
+
minValue,
|
|
52
|
+
maxValue,
|
|
53
|
+
"aria-describedby": describedBy,
|
|
54
|
+
isDateUnavailable: options?.isDateUnavailable,
|
|
55
|
+
children: [/* @__PURE__ */ jsx(LabelView, {
|
|
56
|
+
optional: false,
|
|
57
|
+
children: stringFormatter.format("dateRange.startDate")
|
|
58
|
+
}), /* @__PURE__ */ jsx(FieldErrorView, {})]
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx(TimeFieldView, {
|
|
61
|
+
value: fields.startTime,
|
|
62
|
+
onChange: (time) => update({ startTime: toListTime(time) }),
|
|
63
|
+
"aria-describedby": describedBy,
|
|
64
|
+
children: /* @__PURE__ */ jsx(LabelView, {
|
|
65
|
+
optional: false,
|
|
66
|
+
children: stringFormatter.format("dateRange.startTime")
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsxs(DatePickerView, {
|
|
70
|
+
value: fields.endDate,
|
|
71
|
+
onChange: (date) => update({ endDate: toListCalendarDate(date) }),
|
|
72
|
+
minValue,
|
|
73
|
+
maxValue,
|
|
74
|
+
"aria-describedby": describedBy,
|
|
75
|
+
isDateUnavailable: options?.isDateUnavailable,
|
|
76
|
+
children: [/* @__PURE__ */ jsx(LabelView, {
|
|
77
|
+
optional: false,
|
|
78
|
+
children: stringFormatter.format("dateRange.endDate")
|
|
79
|
+
}), /* @__PURE__ */ jsx(FieldErrorView, {})]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx(TimeFieldView, {
|
|
82
|
+
value: fields.endTime,
|
|
83
|
+
onChange: (time) => update({ endTime: toListTime(time) }),
|
|
84
|
+
"aria-describedby": describedBy,
|
|
85
|
+
children: /* @__PURE__ */ jsx(LabelView, {
|
|
86
|
+
optional: false,
|
|
87
|
+
children: stringFormatter.format("dateRange.endTime")
|
|
88
|
+
})
|
|
89
|
+
}),
|
|
90
|
+
hasRangeError && /* @__PURE__ */ jsx(FieldErrorView, {
|
|
91
|
+
id: rangeErrorId,
|
|
92
|
+
className: DateTimeRangeFields_module_default.rangeError,
|
|
93
|
+
children: stringFormatter.format("dateRange.endBeforeStart")
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { DateTimeRangeFields, DateTimeRangeFields as default };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=DateTimeRangeFields.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeRangeFields.mjs","names":["locales","styles"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.tsx"],"sourcesContent":["import { type FC, useId, useState } from \"react\";\nimport {\n getListDateTimeRangeUpdate,\n isListDateTimeRangeEndBeforeStart,\n listDateTimeRangeFieldsFromValue,\n toListCalendarDate,\n toListTime,\n type ListDateTimeRangeFields,\n} from \"@mittwald/flow-components-base\";\nimport clsx from \"clsx\";\nimport DatePickerView from \"@/views/DatePickerView\";\nimport TimeFieldView from \"@/views/TimeFieldView\";\nimport LabelView from \"@/views/LabelView\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport DivView from \"@/views/DivView\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport type { AnyDateRangeFilter } from \"@/components/List/model/filter/types\";\nimport styles from \"./DateTimeRangeFields.module.scss\";\n\ninterface Props {\n filter: AnyDateRangeFilter;\n className?: string;\n}\n\nexport const DateTimeRangeFields: FC<Props> = (props) => {\n const { filter, className } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const value = filter.getValue();\n const [appliedValue, setAppliedValue] = useState(value);\n const [fields, setFields] = useState(() =>\n listDateTimeRangeFieldsFromValue(value),\n );\n\n if (value !== appliedValue) {\n setAppliedValue(value);\n setFields(listDateTimeRangeFieldsFromValue(value));\n }\n\n const options = filter.dateTimeRangeOptions;\n const minValue = toListCalendarDate(options?.minValue);\n const maxValue = toListCalendarDate(options?.maxValue);\n\n const update = (change: Partial<ListDateTimeRangeFields>) => {\n const next = { ...fields, ...change };\n setFields(next);\n\n const newValue = getListDateTimeRangeUpdate(next, appliedValue, options);\n if (newValue === undefined) {\n return;\n }\n\n setAppliedValue(newValue);\n\n if (newValue) {\n filter.setValue(newValue);\n } else {\n filter.clear();\n }\n };\n\n const rangeErrorId = useId();\n const hasRangeError = isListDateTimeRangeEndBeforeStart(fields);\n const describedBy = hasRangeError ? rangeErrorId : undefined;\n\n return (\n <DivView className={clsx(styles.dateTimeRangeFields, className)}>\n <DatePickerView\n value={fields.startDate}\n onChange={(date) => update({ startDate: toListCalendarDate(date) })}\n minValue={minValue}\n maxValue={maxValue}\n aria-describedby={describedBy}\n isDateUnavailable={options?.isDateUnavailable}\n >\n <LabelView optional={false}>\n {stringFormatter.format(\"dateRange.startDate\")}\n </LabelView>\n <FieldErrorView />\n </DatePickerView>\n <TimeFieldView\n value={fields.startTime}\n onChange={(time) => update({ startTime: toListTime(time) })}\n aria-describedby={describedBy}\n >\n <LabelView optional={false}>\n {stringFormatter.format(\"dateRange.startTime\")}\n </LabelView>\n </TimeFieldView>\n <DatePickerView\n value={fields.endDate}\n onChange={(date) => update({ endDate: toListCalendarDate(date) })}\n minValue={minValue}\n maxValue={maxValue}\n aria-describedby={describedBy}\n isDateUnavailable={options?.isDateUnavailable}\n >\n <LabelView optional={false}>\n {stringFormatter.format(\"dateRange.endDate\")}\n </LabelView>\n <FieldErrorView />\n </DatePickerView>\n <TimeFieldView\n value={fields.endTime}\n onChange={(time) => update({ endTime: toListTime(time) })}\n aria-describedby={describedBy}\n >\n <LabelView optional={false}>\n {stringFormatter.format(\"dateRange.endTime\")}\n </LabelView>\n </TimeFieldView>\n {hasRangeError && (\n <FieldErrorView id={rangeErrorId} className={styles.rangeError}>\n {stringFormatter.format(\"dateRange.endBeforeStart\")}\n </FieldErrorView>\n )}\n </DivView>\n );\n};\n\nexport default DateTimeRangeFields;\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,IAAa,uBAAkC,UAAU;CACvD,MAAM,EAAE,QAAQ,cAAc;CAE9B,MAAM,kBAAkB,4BAA4BA,kBAAS,MAAM;CAEnE,MAAM,QAAQ,OAAO,SAAS;CAC9B,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CACtD,MAAM,CAAC,QAAQ,aAAa,eAC1B,iCAAiC,KAAK,CACxC;CAEA,IAAI,UAAU,cAAc;EAC1B,gBAAgB,KAAK;EACrB,UAAU,iCAAiC,KAAK,CAAC;CACnD;CAEA,MAAM,UAAU,OAAO;CACvB,MAAM,WAAW,mBAAmB,SAAS,QAAQ;CACrD,MAAM,WAAW,mBAAmB,SAAS,QAAQ;CAErD,MAAM,UAAU,WAA6C;EAC3D,MAAM,OAAO;GAAE,GAAG;GAAQ,GAAG;EAAO;EACpC,UAAU,IAAI;EAEd,MAAM,WAAW,2BAA2B,MAAM,cAAc,OAAO;EACvE,IAAI,aAAa,KAAA,GACf;EAGF,gBAAgB,QAAQ;EAExB,IAAI,UACF,OAAO,SAAS,QAAQ;OAExB,OAAO,MAAM;CAEjB;CAEA,MAAM,eAAe,MAAM;CAC3B,MAAM,gBAAgB,kCAAkC,MAAM;CAC9D,MAAM,cAAc,gBAAgB,eAAe,KAAA;CAEnD,OACE,qBAAC,SAAD;EAAS,WAAW,KAAKC,mCAAO,qBAAqB,SAAS;EAA9D,UAAA;GACE,qBAAC,gBAAD;IACE,OAAO,OAAO;IACd,WAAW,SAAS,OAAO,EAAE,WAAW,mBAAmB,IAAI,EAAE,CAAC;IACxD;IACA;IACV,oBAAkB;IAClB,mBAAmB,SAAS;IAN9B,UAAA,CAQE,oBAAC,WAAD;KAAW,UAAU;KAClB,UAAA,gBAAgB,OAAO,qBAAqB;IACpC,CAAA,GACX,oBAAC,gBAAD,CAAiB,CAAA,CACH;;GAChB,oBAAC,eAAD;IACE,OAAO,OAAO;IACd,WAAW,SAAS,OAAO,EAAE,WAAW,WAAW,IAAI,EAAE,CAAC;IAC1D,oBAAkB;IAElB,UAAA,oBAAC,WAAD;KAAW,UAAU;KAClB,UAAA,gBAAgB,OAAO,qBAAqB;IACpC,CAAA;GACE,CAAA;GACf,qBAAC,gBAAD;IACE,OAAO,OAAO;IACd,WAAW,SAAS,OAAO,EAAE,SAAS,mBAAmB,IAAI,EAAE,CAAC;IACtD;IACA;IACV,oBAAkB;IAClB,mBAAmB,SAAS;IAN9B,UAAA,CAQE,oBAAC,WAAD;KAAW,UAAU;KAClB,UAAA,gBAAgB,OAAO,mBAAmB;IAClC,CAAA,GACX,oBAAC,gBAAD,CAAiB,CAAA,CACH;;GAChB,oBAAC,eAAD;IACE,OAAO,OAAO;IACd,WAAW,SAAS,OAAO,EAAE,SAAS,WAAW,IAAI,EAAE,CAAC;IACxD,oBAAkB;IAElB,UAAA,oBAAC,WAAD;KAAW,UAAU;KAClB,UAAA,gBAAgB,OAAO,mBAAmB;IAClC,CAAA;GACE,CAAA;GACd,iBACC,oBAAC,gBAAD;IAAgB,IAAI;IAAc,WAAWA,mCAAO;IACjD,UAAA,gBAAgB,OAAO,0BAA0B;GACpC,CAAA;EAEX;;AAEb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
//#region src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.scss
|
|
4
|
+
var dateTimeRangeFields = "flow--list--header--date-time-range-fields";
|
|
5
|
+
var rangeError = "flow--list--header--date-time-range-fields--range-error";
|
|
6
|
+
var DateTimeRangeFields_module_default = {
|
|
7
|
+
dateTimeRangeFields,
|
|
8
|
+
rangeError
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { dateTimeRangeFields, DateTimeRangeFields_module_default as default, rangeError };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=DateTimeRangeFields.module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeRangeFields.module.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.scss"],"sourcesContent":[".dateTimeRangeFields {\n display: grid;\n\n /* Fixed widths that fit the widest value or placeholder (en-US date, 24h\n time), so typing does not resize the popover */\n grid-template-columns: minmax(0, 9.25rem) minmax(0, 6.25rem);\n gap: var(--column-layout--gap--m);\n\n /* An error wraps instead of widening the popover */\n :global(.flow--field-error) {\n contain: inline-size;\n }\n}\n\n.rangeError {\n grid-column: 1 / -1;\n}\n"],"mappings":""}
|
|
@@ -5,12 +5,14 @@ import { useLocalizedStringFormatter } from "../../../../../TranslationProvider/
|
|
|
5
5
|
import { useOverlayController } from "../../../../../../lib/controller/overlay/useOverlayController.mjs";
|
|
6
6
|
import { Popover } from "../../../../../Popover/Popover.mjs";
|
|
7
7
|
import ButtonView from "../../../../../../views/ButtonView.mjs";
|
|
8
|
+
import { isDateRangeValue } from "../../../../../Calendar/components/RangeCalendar/types.mjs";
|
|
8
9
|
import { PopoverTrigger } from "../../../../../Popover/components/PopoverTrigger/PopoverTrigger.mjs";
|
|
9
10
|
import __locale_default from "../../../../../../../../../_virtual/_18.locale.mjs";
|
|
10
11
|
import TextView from "../../../../../../views/TextView.mjs";
|
|
11
12
|
import Header_module_default from "../../Header.module.mjs";
|
|
12
13
|
import FilterContextMenus_module_default from "./FilterContextMenus.module.mjs";
|
|
13
14
|
import RangeCalendarView from "../../../../../../views/RangeCalendarView.mjs";
|
|
15
|
+
import { DateTimeRangeFields } from "../DateTimeRangeFields/DateTimeRangeFields.mjs";
|
|
14
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
17
|
//#region src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.tsx
|
|
16
18
|
var DateRangeFilterPopover = (props) => {
|
|
@@ -18,6 +20,19 @@ var DateRangeFilterPopover = (props) => {
|
|
|
18
20
|
const { name, property } = filter;
|
|
19
21
|
const stringFormatter = useLocalizedStringFormatter(__locale_default, "List");
|
|
20
22
|
const controller = useOverlayController("Popover");
|
|
23
|
+
const value = filter.getValue();
|
|
24
|
+
const fields = filter.granularity === "minute" ? /* @__PURE__ */ jsx(DateTimeRangeFields, {
|
|
25
|
+
filter,
|
|
26
|
+
className: FilterContextMenus_module_default.dateTimeRange
|
|
27
|
+
}) : /* @__PURE__ */ jsx(RangeCalendarView, {
|
|
28
|
+
...filter.rangeCalendarProps,
|
|
29
|
+
value: isDateRangeValue(value) ? value : null,
|
|
30
|
+
onChange: (range) => {
|
|
31
|
+
filter.setValue(range);
|
|
32
|
+
controller.close();
|
|
33
|
+
},
|
|
34
|
+
className: FilterContextMenus_module_default.calendar
|
|
35
|
+
});
|
|
21
36
|
return /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
22
37
|
controller,
|
|
23
38
|
children: [/* @__PURE__ */ jsxs(ButtonView, {
|
|
@@ -30,15 +45,7 @@ var DateRangeFilterPopover = (props) => {
|
|
|
30
45
|
placement: "bottom end",
|
|
31
46
|
isDialogContent: true,
|
|
32
47
|
"aria-label": stringFormatter.format("dateRange"),
|
|
33
|
-
children:
|
|
34
|
-
...filter.dateRangeOptions,
|
|
35
|
-
value: filter.getValue(),
|
|
36
|
-
onChange: (range) => {
|
|
37
|
-
filter.setValue(range);
|
|
38
|
-
controller.close();
|
|
39
|
-
},
|
|
40
|
-
className: FilterContextMenus_module_default.calendar
|
|
41
|
-
})
|
|
48
|
+
children: fields
|
|
42
49
|
})]
|
|
43
50
|
});
|
|
44
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeFilterPopover.mjs","names":["locales","
|
|
1
|
+
{"version":3,"file":"DateRangeFilterPopover.mjs","names":["locales","styles","headerStyles"],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport ButtonView from \"@/views/ButtonView\";\nimport headerStyles from \"@/components/List/components/Header/Header.module.scss\";\nimport TextView from \"@/views/TextView\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { Popover, PopoverTrigger } from \"@/components/Popover\";\nimport styles from \"./FilterContextMenus.module.scss\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport RangeCalendarView from \"@/views/RangeCalendarView\";\nimport type { AnyDateRangeFilter } from \"@/components/List/model/filter/types\";\nimport { isDateRangeValue } from \"@/components/Calendar\";\nimport { DateTimeRangeFields } from \"@/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields\";\n\ninterface Props {\n filter: AnyDateRangeFilter;\n isDisabled?: boolean;\n}\n\nexport const DateRangeFilterPopover: FC<Props> = (props) => {\n const { filter, isDisabled } = props;\n\n const { name, property } = filter;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const controller = useOverlayController(\"Popover\");\n\n const value = filter.getValue();\n\n const fields =\n filter.granularity === \"minute\" ? (\n <DateTimeRangeFields filter={filter} className={styles.dateTimeRange} />\n ) : (\n <RangeCalendarView\n {...filter.rangeCalendarProps}\n value={isDateRangeValue(value) ? value : null}\n onChange={(range) => {\n filter.setValue(range);\n controller.close();\n }}\n className={styles.calendar}\n />\n );\n\n return (\n <PopoverTrigger controller={controller}>\n <ButtonView\n className={headerStyles.hideOnMobile}\n variant=\"outline\"\n color=\"secondary\"\n isDisabled={isDisabled}\n >\n <TextView>{name ?? property}</TextView>\n <IconFilter />\n </ButtonView>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n aria-label={stringFormatter.format(\"dateRange\")}\n >\n {fields}\n </Popover>\n </PopoverTrigger>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,IAAa,0BAAqC,UAAU;CAC1D,MAAM,EAAE,QAAQ,eAAe;CAE/B,MAAM,EAAE,MAAM,aAAa;CAE3B,MAAM,kBAAkB,4BAA4BA,kBAAS,MAAM;CAEnE,MAAM,aAAa,qBAAqB,SAAS;CAEjD,MAAM,QAAQ,OAAO,SAAS;CAE9B,MAAM,SACJ,OAAO,gBAAgB,WACrB,oBAAC,qBAAD;EAA6B;EAAQ,WAAWC,kCAAO;CAAgB,CAAA,IAEvE,oBAAC,mBAAD;EACE,GAAI,OAAO;EACX,OAAO,iBAAiB,KAAK,IAAI,QAAQ;EACzC,WAAW,UAAU;GACnB,OAAO,SAAS,KAAK;GACrB,WAAW,MAAM;EACnB;EACA,WAAWA,kCAAO;CACnB,CAAA;CAGL,OACE,qBAAC,gBAAD;EAA4B;EAA5B,UAAA,CACE,qBAAC,YAAD;GACE,WAAWC,sBAAa;GACxB,SAAQ;GACR,OAAM;GACM;GAJd,UAAA,CAME,oBAAC,UAAD,EAAA,UAAW,QAAQ,SAAmB,CAAA,GACtC,oBAAC,YAAD,CAAa,CAAA,CACH;EACZ,CAAA,GAAA,oBAAC,SAAD;GACE,WAAU;GACV,iBAAA;GACA,cAAY,gBAAgB,OAAO,WAAW;GAE7C,UAAA;EACM,CAAA,CACK;;AAEpB"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
//#region src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.scss
|
|
4
4
|
var calendar = "flow--list--header--filter-context-menu--calendar";
|
|
5
|
-
var
|
|
5
|
+
var dateTimeRange = "flow--list--header--filter-context-menu--date-time-range";
|
|
6
|
+
var FilterContextMenus_module_default = {
|
|
7
|
+
calendar,
|
|
8
|
+
dateTimeRange
|
|
9
|
+
};
|
|
6
10
|
//#endregion
|
|
7
|
-
export { calendar, FilterContextMenus_module_default as default };
|
|
11
|
+
export { calendar, dateTimeRange, FilterContextMenus_module_default as default };
|
|
8
12
|
|
|
9
13
|
//# sourceMappingURL=FilterContextMenus.module.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterContextMenus.module.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.scss"],"sourcesContent":[".calendar {\n padding: var(--popover--padding--m);\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"FilterContextMenus.module.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.scss"],"sourcesContent":[".calendar {\n padding: var(--popover--padding--m);\n}\n\n.dateTimeRange {\n padding: var(--popover--padding--m);\n}\n"],"mappings":""}
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { ListDateRangeFilter } from "../../../../../../components-base/src/list/filter/ListDateRangeFilter.mjs";
|
|
4
4
|
import "../../../../../../components-base/src/index.mjs";
|
|
5
|
+
import { omit } from "remeda";
|
|
5
6
|
//#region src/components/List/model/filter/DateRangeFilter.tsx
|
|
6
7
|
/**
|
|
7
8
|
* React's date-range filter.
|
|
8
9
|
*
|
|
9
10
|
* The column, the comparison and the stored value are `ListDateRangeFilter` in
|
|
10
11
|
* `@mittwald/flow-components-base`, so the Vue binding filters the same dates
|
|
11
|
-
* the same way. What is left here
|
|
12
|
-
* Flow's `RangeCalendar` props
|
|
12
|
+
* the same way. What is left here are the options of the fields that pick the
|
|
13
|
+
* range: Flow's `RangeCalendar` props, or with `granularity: "minute"` those of
|
|
14
|
+
* the date and time fields.
|
|
13
15
|
*/
|
|
14
16
|
var DateRangeFilter = class extends ListDateRangeFilter {
|
|
15
17
|
dateRangeOptions;
|
|
@@ -17,6 +19,17 @@ var DateRangeFilter = class extends ListDateRangeFilter {
|
|
|
17
19
|
super(context, shape);
|
|
18
20
|
this.dateRangeOptions = shape.dateRangeOptions;
|
|
19
21
|
}
|
|
22
|
+
get granularity() {
|
|
23
|
+
return this.dateRangeOptions?.granularity ?? "day";
|
|
24
|
+
}
|
|
25
|
+
get rangeCalendarProps() {
|
|
26
|
+
const options = this.dateRangeOptions ?? {};
|
|
27
|
+
return options.granularity === "minute" ? {} : omit(options, ["granularity"]);
|
|
28
|
+
}
|
|
29
|
+
get dateTimeRangeOptions() {
|
|
30
|
+
const options = this.dateRangeOptions;
|
|
31
|
+
return options?.granularity === "minute" ? options : void 0;
|
|
32
|
+
}
|
|
20
33
|
getValue() {
|
|
21
34
|
return super.getValue();
|
|
22
35
|
}
|
package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeFilter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/DateRangeFilter.tsx"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type { ListModelContext } from \"@mittwald/flow-components-base\";\nimport type {
|
|
1
|
+
{"version":3,"file":"DateRangeFilter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/DateRangeFilter.tsx"],"sourcesContent":["import { ListDateRangeFilter } from \"@mittwald/flow-components-base\";\nimport type { ListModelContext } from \"@mittwald/flow-components-base\";\nimport type {\n DateRangeFilterOptions,\n DateRangeFilterValue,\n FilterShape,\n} from \"@/components/List/model/filter/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type { RangeCalendarProps } from \"@/components/Calendar\";\nimport type { ReactNode } from \"react\";\nimport { omit } from \"remeda\";\nimport type { List } from \"@/components/List/model/List\";\nimport type { FilterValue } from \"@/components/List/model/filter/FilterValue\";\n\n/**\n * React's date-range filter.\n *\n * The column, the comparison and the stored value are `ListDateRangeFilter` in\n * `@mittwald/flow-components-base`, so the Vue binding filters the same dates\n * the same way. What is left here are the options of the fields that pick the\n * range: Flow's `RangeCalendar` props, or with `granularity: \"minute\"` those of\n * the date and time fields.\n */\nexport class DateRangeFilter<\n T = never,\n TProp extends PropertyName<T> = never,\n> extends ListDateRangeFilter<T, TProp, ReactNode> {\n public readonly dateRangeOptions?: DateRangeFilterOptions;\n\n public constructor(\n context: ListModelContext<T>,\n shape: FilterShape<T, TProp, never>,\n ) {\n super(context, shape as never);\n this.dateRangeOptions = shape.dateRangeOptions;\n }\n\n public get granularity(): \"day\" | \"minute\" {\n return this.dateRangeOptions?.granularity ?? \"day\";\n }\n\n public get rangeCalendarProps(): RangeCalendarProps {\n const options = this.dateRangeOptions ?? {};\n return options.granularity === \"minute\"\n ? {}\n : omit(options, [\"granularity\"]);\n }\n\n public get dateTimeRangeOptions() {\n const options = this.dateRangeOptions;\n return options?.granularity === \"minute\" ? options : undefined;\n }\n\n /*\n * Narrowed back to `@internationalized/date`'s types, because that is what\n * the calendar and the date fields take. The shared class is typed on the\n * numbers a date is made of, which every date library agrees on and nothing\n * else does.\n */\n public override getValue(): DateRangeFilterValue | null {\n return super.getValue() as DateRangeFilterValue | null;\n }\n\n public override setValue(range: DateRangeFilterValue | null): void {\n super.setValue(range);\n }\n\n /** The list this filter belongs to — `context`, typed as React's `List`. */\n public get list(): List<T> {\n return this.context as List<T>;\n }\n\n /* As in `Filter`: created by this filter, so each one's `filter` is React's. */\n public override get values(): FilterValue[] {\n return super.values as FilterValue[];\n }\n\n public override getArrayValue(): FilterValue[] {\n return super.getArrayValue() as FilterValue[];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,IAAa,kBAAb,cAGU,oBAAyC;CACjD;CAEA,YACE,SACA,OACA;EACA,MAAM,SAAS,KAAc;EAC7B,KAAK,mBAAmB,MAAM;CAChC;CAEA,IAAW,cAAgC;EACzC,OAAO,KAAK,kBAAkB,eAAe;CAC/C;CAEA,IAAW,qBAAyC;EAClD,MAAM,UAAU,KAAK,oBAAoB,CAAC;EAC1C,OAAO,QAAQ,gBAAgB,WAC3B,CAAC,IACD,KAAK,SAAS,CAAC,aAAa,CAAC;CACnC;CAEA,IAAW,uBAAuB;EAChC,MAAM,UAAU,KAAK;EACrB,OAAO,SAAS,gBAAgB,WAAW,UAAU,KAAA;CACvD;CAQA,WAAwD;EACtD,OAAO,MAAM,SAAS;CACxB;CAEA,SAAyB,OAA0C;EACjE,MAAM,SAAS,KAAK;CACtB;;CAGA,IAAW,OAAgB;EACzB,OAAO,KAAK;CACd;CAGA,IAAoB,SAAwB;EAC1C,OAAO,MAAM;CACf;CAEA,gBAA+C;EAC7C,OAAO,MAAM,cAAc;CAC7B;AACF"}
|
package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { resolveListDateRange } from "../../../../../../components-base/src/list/filter/dateRange.mjs";
|
|
4
|
+
import "../../../../../../components-base/src/index.mjs";
|
|
5
|
+
//#region src/components/List/model/filter/resolveDateRangeFilterValue.ts
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the value of a date range filter to the instants it spans, for
|
|
8
|
+
* filtering on the server side. Both bounds are inclusive: a date covers its
|
|
9
|
+
* whole day and a date with time its whole minute, in the user's local time
|
|
10
|
+
* zone. A missing side has no bound.
|
|
11
|
+
*/
|
|
12
|
+
var resolveDateRangeFilterValue = (range) => resolveListDateRange(range);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { resolveDateRangeFilterValue };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=resolveDateRangeFilterValue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDateRangeFilterValue.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/resolveDateRangeFilterValue.ts"],"sourcesContent":["import { resolveListDateRange } from \"@mittwald/flow-components-base\";\nimport type { DateRangeFilterValue } from \"@/components/List/model/filter/types\";\n\n/**\n * Resolves the value of a date range filter to the instants it spans, for\n * filtering on the server side. Both bounds are inclusive: a date covers its\n * whole day and a date with time its whole minute, in the user's local time\n * zone. A missing side has no bound.\n */\nexport const resolveDateRangeFilterValue = (\n range: DateRangeFilterValue,\n): { start?: Date; end?: Date } => resolveListDateRange(range);\n"],"mappings":";;;;;;;;;;;AASA,IAAa,+BACX,UACiC,qBAAqB,KAAK"}
|
package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { PropsContextProvider } from "../../../../lib/propsContext/components/PropsContextProvider.mjs";
|
|
4
4
|
import dynamic from "../../../../lib/propsContext/dynamicProps/dynamic.mjs";
|
|
5
5
|
import { useLocalizedStringFormatter } from "../../../../components/TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
6
|
+
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
6
7
|
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
7
8
|
import __locale_default from "../../../../../../../_virtual/_36.locale.mjs";
|
|
8
|
-
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
9
9
|
import { useUpdateFormDefaultValue } from "./hooks/useUpdateFormDefaultValue.mjs";
|
|
10
10
|
import "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
4
3
|
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
4
|
+
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
5
5
|
import { useMountedFormRootErrorComponent } from "./useMountedFormRootErrorComponent.mjs";
|
|
6
6
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/integrations/react-hook-form/components/FormRootError/FormRootError.tsx
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { viewComponentContext } from "../lib/viewComponentContext/viewComponentContext.mjs";
|
|
4
|
+
import { DatePicker } from "../components/DatePicker/DatePicker.mjs";
|
|
5
|
+
import { memo, useContext } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/views/DatePickerView.tsx
|
|
8
|
+
var DatePickerView = memo((props) => {
|
|
9
|
+
const View = useContext(viewComponentContext)["DatePicker"] ?? DatePicker;
|
|
10
|
+
return /* @__PURE__ */ jsx(View, { ...props });
|
|
11
|
+
});
|
|
12
|
+
DatePickerView.displayName = "DatePickerView";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DatePickerView as default };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=DatePickerView.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePickerView.mjs","names":[],"sources":["../../../../../../src/views/DatePickerView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { memo, type FC, useContext } from \"react\";\nimport {\n DatePicker,\n type DatePickerProps,\n} from \"@/components/DatePicker/DatePicker\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst DatePickerView: FC<DatePickerProps> = memo((props) => {\n const View = useContext(viewComponentContext)[\"DatePicker\"] ?? DatePicker;\n return <View {...props} />;\n});\nDatePickerView.displayName = \"DatePickerView\";\n\nexport default DatePickerView;\n"],"mappings":";;;;;;;AASA,IAAM,iBAAsC,MAAM,UAAU;CAC1D,MAAM,OAAO,WAAW,oBAAoB,CAAC,CAAC,iBAAiB;CAC/D,OAAO,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAC3B,CAAC;AACD,eAAe,cAAc"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { viewComponentContext } from "../lib/viewComponentContext/viewComponentContext.mjs";
|
|
4
|
+
import { Label } from "../components/Label/Label.mjs";
|
|
5
|
+
import { memo, useContext } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/views/LabelView.tsx
|
|
8
|
+
var LabelView = memo((props) => {
|
|
9
|
+
const View = useContext(viewComponentContext)["Label"] ?? Label;
|
|
10
|
+
return /* @__PURE__ */ jsx(View, { ...props });
|
|
11
|
+
});
|
|
12
|
+
LabelView.displayName = "LabelView";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { LabelView as default };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=LabelView.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelView.mjs","names":[],"sources":["../../../../../../src/views/LabelView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { memo, type FC, useContext } from \"react\";\nimport { Label, type LabelProps } from \"@/components/Label/Label\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst LabelView: FC<LabelProps> = memo((props) => {\n const View = useContext(viewComponentContext)[\"Label\"] ?? Label;\n return <View {...props} />;\n});\nLabelView.displayName = \"LabelView\";\n\nexport default LabelView;\n"],"mappings":";;;;;;;AAMA,IAAM,YAA4B,MAAM,UAAU;CAChD,MAAM,OAAO,WAAW,oBAAoB,CAAC,CAAC,YAAY;CAC1D,OAAO,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAC3B,CAAC;AACD,UAAU,cAAc"}
|