@mittwald/flow-react-components 0.2.0-alpha.769 → 0.2.0-alpha.770
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/assets/doc-properties.json +2952 -979
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs +4 -2
- package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs.map +1 -1
- package/dist/js/default.mjs +2 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/Calendar.mjs +5 -2
- package/dist/js/packages/components/src/components/Calendar/Calendar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/{RangeCalendar.mjs → components/RangeCalendar/RangeCalendar.mjs} +6 -4
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/RangeCalendar.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/types.mjs +8 -0
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/types.mjs.map +1 -0
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +4 -4
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.module.scss.mjs +9 -0
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.module.scss.mjs.map +1 -0
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +10 -3
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.module.scss.mjs +9 -0
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.module.scss.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +13 -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/FilterAccordion.mjs +7 -48
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs +16 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +40 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +54 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +69 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs +5 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.scss.mjs +9 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.scss.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/List.mjs +4 -1
- package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/ReactTable.mjs +1 -1
- package/dist/js/packages/components/src/components/List/model/ReactTable.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +36 -0
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/filter/Filter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/dateRangeFilterFn.mjs +32 -0
- package/dist/js/packages/components/src/components/List/model/filter/dateRangeFilterFn.mjs.map +1 -0
- package/dist/js/packages/components/src/components/propTypes/index.mjs +1 -1
- package/dist/js/packages/components/src/components/propTypes/index.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/date/transformDateValueToDateTime.mjs +14 -0
- package/dist/js/packages/components/src/lib/date/transformDateValueToDateTime.mjs.map +1 -0
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +8 -0
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +1 -0
- package/dist/js/packages/components/src/views/RangeCalendarView.mjs +15 -0
- package/dist/js/packages/components/src/views/RangeCalendarView.mjs.map +1 -0
- package/dist/types/components/Calendar/Calendar.d.ts +2 -1
- package/dist/types/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/components/Calendar/components/RangeCalendar/RangeCalendar.d.ts +7 -0
- package/dist/types/components/Calendar/components/RangeCalendar/RangeCalendar.d.ts.map +1 -0
- package/dist/types/components/Calendar/components/RangeCalendar/index.d.ts +4 -0
- package/dist/types/components/Calendar/components/RangeCalendar/index.d.ts.map +1 -0
- package/dist/types/components/Calendar/components/RangeCalendar/types.d.ts +3 -0
- package/dist/types/components/Calendar/components/RangeCalendar/types.d.ts.map +1 -0
- package/dist/types/components/Calendar/components/RangeCalendar/view.d.ts +8 -0
- package/dist/types/components/Calendar/components/RangeCalendar/view.d.ts.map +1 -0
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Calendar/index.d.ts.map +1 -1
- package/dist/types/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/ActiveFilters/ActiveFilters.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordion.d.ts +2 -1
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordion.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.d.ts +8 -0
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.d.ts.map +1 -0
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.d.ts +8 -0
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.d.ts.map +1 -0
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.d.ts +8 -0
- package/dist/types/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.d.ts.map +1 -0
- package/dist/types/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.d.ts +8 -0
- package/dist/types/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.d.ts.map +1 -0
- package/dist/types/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.d.ts +1 -1
- package/dist/types/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.d.ts.map +1 -1
- package/dist/types/components/List/model/List.d.ts +2 -1
- package/dist/types/components/List/model/List.d.ts.map +1 -1
- package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +16 -0
- package/dist/types/components/List/model/filter/DateRangeFilter.d.ts.map +1 -0
- package/dist/types/components/List/model/filter/Filter.d.ts +1 -1
- package/dist/types/components/List/model/filter/Filter.d.ts.map +1 -1
- package/dist/types/components/List/model/filter/dateRangeFilterFn.d.ts +7 -0
- package/dist/types/components/List/model/filter/dateRangeFilterFn.d.ts.map +1 -0
- package/dist/types/components/List/model/filter/types.d.ts +5 -1
- package/dist/types/components/List/model/filter/types.d.ts.map +1 -1
- package/dist/types/components/List/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/List/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/public.d.ts +1 -0
- package/dist/types/components/public.d.ts.map +1 -1
- package/dist/types/lib/date/transformDateValueToDateTime.d.ts +4 -0
- package/dist/types/lib/date/transformDateValueToDateTime.d.ts.map +1 -0
- package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +3 -0
- package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts.map +1 -0
- package/dist/types/views/RangeCalendarView.d.ts +5 -0
- package/dist/types/views/RangeCalendarView.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/js/packages/components/src/components/Calendar/RangeCalendar.mjs.map +0 -1
- package/dist/types/components/Calendar/RangeCalendar.d.ts +0 -4
- package/dist/types/components/Calendar/RangeCalendar.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
const locales = {"de-DE": { "list.
|
|
3
|
+
const locales = {"de-DE": { "list.dateRange": `Zeitraum`,
|
|
4
|
+
"list.filters": `Filter`,
|
|
4
5
|
"list.filters.all": `Alle Filter`,
|
|
5
6
|
"list.filters.clear": `Filter entfernen`,
|
|
6
7
|
"list.filters.clearSelection": `Auswahl aufheben`,
|
|
@@ -23,7 +24,8 @@ const locales = {"de-DE": { "list.filters": `Filter`,
|
|
|
23
24
|
"list.sorting": `Sortierung`,
|
|
24
25
|
"list.toggleExpandButton.collapse": `Weniger anzeigen`,
|
|
25
26
|
"list.toggleExpandButton.expand": `Mehr anzeigen`,
|
|
26
|
-
},"en-US": { "list.
|
|
27
|
+
},"en-US": { "list.dateRange": `Date range`,
|
|
28
|
+
"list.filters": `Filters`,
|
|
27
29
|
"list.filters.all": `All filters`,
|
|
28
30
|
"list.filters.clear": `Clear filters`,
|
|
29
31
|
"list.filters.clearSelection": `Clear selection`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/js/default.mjs
CHANGED
|
@@ -22,6 +22,8 @@ export { BigNumber } from './packages/components/src/components/BigNumber/BigNum
|
|
|
22
22
|
export { Breadcrumb } from './packages/components/src/components/Breadcrumb/Breadcrumb.mjs';
|
|
23
23
|
export { BrowserOnly } from './packages/components/src/components/BrowserOnly/BrowserOnly.mjs';
|
|
24
24
|
export { Button } from './packages/components/src/components/Button/Button.mjs';
|
|
25
|
+
export { RangeCalendar } from './packages/components/src/components/Calendar/components/RangeCalendar/RangeCalendar.mjs';
|
|
26
|
+
export { isDateRangeValue } from './packages/components/src/components/Calendar/components/RangeCalendar/types.mjs';
|
|
25
27
|
export { CartesianChart } from './packages/components/src/components/CartesianChart/CartesianChart.mjs';
|
|
26
28
|
export { Area } from './packages/components/src/components/CartesianChart/components/Area/Area.mjs';
|
|
27
29
|
export { Line } from './packages/components/src/components/CartesianChart/components/Line/Line.mjs';
|
package/dist/js/default.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,9 +5,12 @@ import 'react';
|
|
|
5
5
|
import * as Aria from 'react-aria-components';
|
|
6
6
|
import styles from './Calendar.module.scss.mjs';
|
|
7
7
|
import { CalendarHeader } from './components/CalendarHeader/CalendarHeader.mjs';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
|
|
9
|
-
const Calendar = () => {
|
|
10
|
-
|
|
10
|
+
const Calendar = (props) => {
|
|
11
|
+
const { className } = props;
|
|
12
|
+
const rootClassName = clsx(styles.calendar, className);
|
|
13
|
+
return /* @__PURE__ */ jsxs(Aria.Calendar, { className: rootClassName, children: [
|
|
11
14
|
/* @__PURE__ */ jsx(CalendarHeader, {}),
|
|
12
15
|
/* @__PURE__ */ jsx(Aria.CalendarGrid, { weekdayStyle: "short", children: (date) => /* @__PURE__ */ jsx(Aria.CalendarCell, { date }) })
|
|
13
16
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.mjs","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"@/components/Calendar/Calendar.module.scss\";\nimport CalendarHeader from \"./components/CalendarHeader\";\n\nexport const Calendar: FC = () => {\n return (\n <Aria.Calendar className={
|
|
1
|
+
{"version":3,"file":"Calendar.mjs","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"@/components/Calendar/Calendar.module.scss\";\nimport CalendarHeader from \"./components/CalendarHeader\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\n\nexport const Calendar: FC<PropsWithClassName> = (props) => {\n const { className } = props;\n\n const rootClassName = clsx(styles.calendar, className);\n\n return (\n <Aria.Calendar className={rootClassName}>\n <CalendarHeader />\n <Aria.CalendarGrid weekdayStyle=\"short\">\n {(date) => <Aria.CalendarCell date={date} />}\n </Aria.CalendarGrid>\n </Aria.Calendar>\n );\n};\n\nexport default Calendar;\n"],"names":[],"mappings":";;;;;;;AAQO,MAAM,QAAA,GAAmC,CAAC,KAAA,KAAU;AACzD,EAAA,MAAM,EAAE,WAAU,GAAI,KAAA;AAEtB,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,SAAS,CAAA;AAErD,EAAA,uBACE,IAAA,CAAC,IAAA,CAAK,QAAA,EAAL,EAAc,WAAW,aAAA,EACxB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA;AAAA,oBAChB,GAAA,CAAC,IAAA,CAAK,YAAA,EAAL,EAAkB,YAAA,EAAa,OAAA,EAC7B,QAAA,EAAA,CAAC,IAAA,qBAAS,GAAA,CAAC,IAAA,CAAK,YAAA,EAAL,EAAkB,MAAY,CAAA,EAC5C;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import * as Aria from 'react-aria-components';
|
|
6
|
-
import styles from '
|
|
7
|
-
import { CalendarHeader } from '
|
|
6
|
+
import styles from '../../Calendar.module.scss.mjs';
|
|
7
|
+
import { CalendarHeader } from '../CalendarHeader/CalendarHeader.mjs';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
|
|
10
|
-
const RangeCalendar = () => {
|
|
11
|
-
|
|
10
|
+
const RangeCalendar = (props) => {
|
|
11
|
+
const { className, ...rest } = props;
|
|
12
|
+
const rootClassName = clsx(styles.calendar, styles.range, className);
|
|
13
|
+
return /* @__PURE__ */ jsxs(Aria.RangeCalendar, { ...rest, className: rootClassName, children: [
|
|
12
14
|
/* @__PURE__ */ jsx(CalendarHeader, {}),
|
|
13
15
|
/* @__PURE__ */ jsx(Aria.CalendarGrid, { children: (date) => /* @__PURE__ */ jsx(Aria.CalendarCell, { date }) })
|
|
14
16
|
] });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeCalendar.mjs","sources":["../../../../../../../../../src/components/Calendar/components/RangeCalendar/RangeCalendar.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"@/components/Calendar/Calendar.module.scss\";\nimport CalendarHeader from \"../CalendarHeader\";\nimport clsx from \"clsx\";\n\nexport type RangeCalendarProps = Omit<\n Aria.RangeCalendarProps<Aria.DateValue>,\n \"children\"\n>;\n\n/** @flr-generate all */\nexport const RangeCalendar: FC<RangeCalendarProps> = (props) => {\n const { className, ...rest } = props;\n\n const rootClassName = clsx(styles.calendar, styles.range, className);\n\n return (\n <Aria.RangeCalendar {...rest} className={rootClassName}>\n <CalendarHeader />\n <Aria.CalendarGrid>\n {(date) => <Aria.CalendarCell date={date} />}\n </Aria.CalendarGrid>\n </Aria.RangeCalendar>\n );\n};\n\nexport default RangeCalendar;\n"],"names":[],"mappings":";;;;;;;AAYO,MAAM,aAAA,GAAwC,CAAC,KAAA,KAAU;AAC9D,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,KAAA;AAE/B,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,MAAA,CAAO,OAAO,SAAS,CAAA;AAEnE,EAAA,4BACG,IAAA,CAAK,aAAA,EAAL,EAAoB,GAAG,IAAA,EAAM,WAAW,aAAA,EACvC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA;AAAA,oBAChB,GAAA,CAAC,IAAA,CAAK,YAAA,EAAL,EACE,QAAA,EAAA,CAAC,IAAA,qBAAS,GAAA,CAAC,IAAA,CAAK,YAAA,EAAL,EAAkB,IAAA,EAAY,CAAA,EAC5C;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/types.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../../../../../../src/components/Calendar/components/RangeCalendar/types.ts"],"sourcesContent":["import type { DateRange } from \"react-aria-components\";\n\nexport function isDateRangeValue(value: unknown): value is DateRange {\n return !!(\n value &&\n typeof value === \"object\" &&\n \"start\" in value &&\n \"end\" in value\n );\n}\n"],"names":[],"mappings":"AAEO,SAAS,iBAAiB,KAAA,EAAoC;AACnE,EAAA,OAAO,CAAC,EACN,KAAA,IACA,OAAO,UAAU,QAAA,IACjB,OAAA,IAAW,SACX,KAAA,IAAS,KAAA,CAAA;AAEb;;;;"}
|
|
@@ -7,7 +7,6 @@ import '../../lib/propsContext/propsContext.mjs';
|
|
|
7
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
8
|
import * as Aria from 'react-aria-components';
|
|
9
9
|
import { DateInput } from './components/DateInput/DateInput.mjs';
|
|
10
|
-
import formFieldStyles from '../FormField/FormField.module.scss.mjs';
|
|
11
10
|
import { Popover } from '../Popover/Popover.mjs';
|
|
12
11
|
import 'mobx';
|
|
13
12
|
import 'remeda';
|
|
@@ -22,6 +21,7 @@ import '../Icon/components/IconSetProvider.mjs';
|
|
|
22
21
|
import '../Icon/Icon.mjs';
|
|
23
22
|
import '../../views/IconView.mjs';
|
|
24
23
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
24
|
+
import styles from './DatePicker.module.scss.mjs';
|
|
25
25
|
|
|
26
26
|
const DatePicker = flowComponent("DatePicker", (props) => {
|
|
27
27
|
const { children, className, onChange, ref, ...rest } = props;
|
|
@@ -31,14 +31,14 @@ const DatePicker = flowComponent("DatePicker", (props) => {
|
|
|
31
31
|
fieldProps,
|
|
32
32
|
fieldPropsContext
|
|
33
33
|
} = useFieldComponent(props);
|
|
34
|
-
const rootClassName = clsx(
|
|
34
|
+
const rootClassName = clsx(fieldProps.className, className);
|
|
35
35
|
const popoverController = useOverlayController("Popover");
|
|
36
36
|
return /* @__PURE__ */ jsxs(
|
|
37
37
|
Aria.DatePicker,
|
|
38
38
|
{
|
|
39
39
|
...rest,
|
|
40
40
|
...fieldProps,
|
|
41
|
-
className:
|
|
41
|
+
className: rootClassName,
|
|
42
42
|
onOpenChange: (v) => popoverController.setOpen(v),
|
|
43
43
|
isOpen: popoverController.isOpen,
|
|
44
44
|
onChange: (value) => {
|
|
@@ -57,7 +57,7 @@ const DatePicker = flowComponent("DatePicker", (props) => {
|
|
|
57
57
|
placement: "bottom end",
|
|
58
58
|
isDialogContent: true,
|
|
59
59
|
controller: popoverController,
|
|
60
|
-
children: /* @__PURE__ */ jsx(Calendar, {})
|
|
60
|
+
children: /* @__PURE__ */ jsx(Calendar, { className: styles.calendar })
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport
|
|
1
|
+
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DatePicker\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,EAAc,CAAC,KAAA,KAAU;AAC/D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,UAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAExD,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,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|
|
|
5
5
|
import '../../lib/propsContext/propsContext.mjs';
|
|
6
6
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
7
|
import * as Aria from 'react-aria-components';
|
|
8
|
+
import '../Popover/components/PopoverTrigger/PopoverTrigger.mjs';
|
|
8
9
|
import { Popover } from '../Popover/Popover.mjs';
|
|
9
|
-
import
|
|
10
|
+
import 'react';
|
|
11
|
+
import '../Button/Button.mjs';
|
|
12
|
+
import '@mittwald/flow-icons';
|
|
13
|
+
import '../Icon/components/IconSetProvider.mjs';
|
|
14
|
+
import '../Icon/Icon.mjs';
|
|
15
|
+
import '../../views/IconView.mjs';
|
|
16
|
+
import { RangeCalendar } from '../Calendar/components/RangeCalendar/RangeCalendar.mjs';
|
|
10
17
|
import { DateRangeInput } from './components/DateRangeInput/DateRangeInput.mjs';
|
|
11
18
|
import 'mobx';
|
|
12
|
-
import 'react';
|
|
13
19
|
import 'remeda';
|
|
14
20
|
import '@react-aria/utils';
|
|
15
21
|
import 'dot-prop';
|
|
16
22
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
17
23
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
18
24
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
25
|
+
import styles from './DateRangePicker.module.scss.mjs';
|
|
19
26
|
|
|
20
27
|
const DateRangePicker = flowComponent("DateRangePicker", (props) => {
|
|
21
28
|
const { children, className, onChange, ref, ...rest } = props;
|
|
@@ -50,7 +57,7 @@ const DateRangePicker = flowComponent("DateRangePicker", (props) => {
|
|
|
50
57
|
placement: "bottom end",
|
|
51
58
|
isDialogContent: true,
|
|
52
59
|
controller: popoverController,
|
|
53
|
-
children: /* @__PURE__ */ jsx(RangeCalendar, {})
|
|
60
|
+
children: /* @__PURE__ */ jsx(RangeCalendar, { className: styles.calendar })
|
|
54
61
|
}
|
|
55
62
|
)
|
|
56
63
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover
|
|
1
|
+
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover\";\nimport { RangeCalendar } from \"@/components/Calendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DateRangePicker.module.scss\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DateRangePicker\n {...rest}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,eAAA,GAAkB,aAAA,CAAc,iBAAA,EAAmB,CAAC,KAAA,KAAU;AACzE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,UAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAExD,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,EAAA,MAAM,iBAAA,GAAoB,qBAAqB,SAAS,CAAA;AAExD,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,eAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,aAAA;AAAA,MACX,YAAA,EAAc,CAAC,CAAA,KAAM,iBAAA,CAAkB,QAAQ,CAAC,CAAA;AAAA,MAChD,QAAQ,iBAAA,CAAkB,MAAA;AAAA,MAC1B,QAAA,EAAU,CAAC,KAAA,KAAU;AACnB,QAAA,IAAI,QAAA,EAAU;AACZ,UAAA,QAAA,CAAS,KAAK,CAAA;AAAA,QAChB;AACA,QAAA,iBAAA,CAAkB,KAAA,EAAM;AAAA,MAC1B,CAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAY,KAAA,CAAM,UAAA,EAAY,GAAA,EAAU,CAAA;AAAA,0BACxD,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,YAAA;AAAA,cACV,eAAA,EAAe,IAAA;AAAA,cACf,UAAA,EAAY,iBAAA;AAAA,cAEZ,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,SAAA,EAAW,MAAA,CAAO,QAAA,EAAU;AAAA;AAAA;AAC7C,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -26,12 +26,23 @@ import BadgeView from '../../../../../../views/BadgeView.mjs';
|
|
|
26
26
|
import TooltipTriggerView from '../../../../../../views/TooltipTriggerView.mjs';
|
|
27
27
|
import TextView from '../../../../../../views/TextView.mjs';
|
|
28
28
|
import { Filter } from '../../../../model/filter/Filter.mjs';
|
|
29
|
+
import { transformDateValueToFormattedDate } from '../../../../../../lib/date/transformDateValueToFormattedDate.mjs';
|
|
30
|
+
import { DateRangeFilter } from '../../../../model/filter/DateRangeFilter.mjs';
|
|
29
31
|
|
|
30
32
|
const ActiveFilters = observer(() => {
|
|
31
33
|
const list = useList();
|
|
32
34
|
const formatter = useLocalizedStringFormatter(locales);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
+
const activeFilters = list.filters.flatMap((f) => {
|
|
36
|
+
if (f instanceof DateRangeFilter) {
|
|
37
|
+
const value = f.getValue();
|
|
38
|
+
if (value) {
|
|
39
|
+
return [
|
|
40
|
+
/* @__PURE__ */ jsx(BadgeView, { onClose: () => f.clear(), children: /* @__PURE__ */ jsx(TextView, { children: `${transformDateValueToFormattedDate(value.start)} - ${transformDateValueToFormattedDate(value.end)}` }) }, f.name)
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return f.values.filter((v) => v.isActive).map((v) => /* @__PURE__ */ jsx(BadgeView, { onClose: () => v.deactivate(), children: /* @__PURE__ */ jsx(TextView, { children: v.render() }) }, v.id));
|
|
45
|
+
});
|
|
35
46
|
const storingAvailable = list.filters.some((f) => f.isStoringAvailable());
|
|
36
47
|
const hasChanges = list.filters.some((f) => f.hasChanges());
|
|
37
48
|
const storeFiltersButton = storingAvailable && hasChanges && /* @__PURE__ */ jsxs(TooltipTriggerView, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveFilters.mjs","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 { Translate } from \"@/lib/react/components/Translate\";\nimport { observer } from \"mobx-react-lite\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { TooltipTrigger } from \"@/components/Tooltip\";\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\";\n\nexport const ActiveFilters: FC = observer(() => {\n const list = useList();\n const formatter = useLocalizedStringFormatter(locales);\n\n const
|
|
1
|
+
{"version":3,"file":"ActiveFilters.mjs","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 { Translate } from \"@/lib/react/components/Translate\";\nimport { observer } from \"mobx-react-lite\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { TooltipTrigger } from \"@/components/Tooltip\";\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 { transformDateValueToFormattedDate } from \"@/lib/date/transformDateValueToFormattedDate\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\n\nexport const ActiveFilters: FC = observer(() => {\n const list = useList();\n const formatter = useLocalizedStringFormatter(locales);\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 key={f.name} onClose={() => f.clear()}>\n <TextView>\n {`${transformDateValueToFormattedDate(value.start)} - ${transformDateValueToFormattedDate(value.end)}`}\n </TextView>\n </BadgeView>,\n ];\n }\n }\n\n return f.values\n .filter((v) => v.isActive)\n .map((v) => (\n <BadgeView key={v.id} onClose={() => v.deactivate()}>\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>\n <TooltipView>\n <Translate locales={locales}>list.filters.store</Translate>\n </TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() =>\n Filter.storeFilters(list, { autosave: false, manualSave: true })\n }\n aria-label={formatter.format(\"list.filters.store\")}\n >\n <IconSave />\n </ButtonView>\n </TooltipTriggerView>\n );\n\n const resetFiltersButton = hasChanges ? (\n <TooltipTrigger>\n <TooltipView>\n <Translate locales={locales}>list.filters.reset</Translate>\n </TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() => list.resetFilters()}\n aria-label={formatter.format(\"list.filters.reset\")}\n >\n <IconUndo />\n </ButtonView>\n </TooltipTrigger>\n ) : undefined;\n\n const removeAllFiltersButton =\n activeFilters.length > 1 ? (\n <TooltipTrigger>\n <TooltipView>\n <Translate locales={locales}>list.filters.clear</Translate>\n </TooltipView>\n <ButtonView\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n onPress={() => list.clearFilters()}\n >\n <IconClose />\n </ButtonView>\n </TooltipTrigger>\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,aAAA,GAAoB,SAAS,MAAM;AAC9C,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,SAAA,GAAY,4BAA4B,OAAO,CAAA;AAErD,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,OAAA,CAAQ,OAAA,CAAQ,CAAC,CAAA,KAAM;AAChD,IAAA,IAAI,aAAa,eAAA,EAAiB;AAChC,MAAA,MAAM,KAAA,GAAQ,EAAE,QAAA,EAAS;AACzB,MAAA,IAAI,KAAA,EAAO;AACT,QAAA,OAAO;AAAA,0BACL,GAAA,CAAC,aAAuB,OAAA,EAAS,MAAM,EAAE,KAAA,EAAM,EAC7C,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EACE,QAAA,EAAA,CAAA,EAAG,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A,IACD,CAAC,kBAAA,EACD;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,MAAA,CAAO,aAAA,EACxB,QAAA,EAAA;AAAA,IAAA,aAAA;AAAA,IACA,kBAAA;AAAA,IACA,kBAAA;AAAA,IACA;AAAA,GAAA,EACH,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1,63 +1,22 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import {
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import AccordionView from '../../../../../../views/AccordionView.mjs';
|
|
6
6
|
import HeadingView from '../../../../../../views/HeadingView.mjs';
|
|
7
7
|
import ContentView from '../../../../../../views/ContentView.mjs';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
13
|
-
import { Flex } from '../../../../../Flex/Flex.mjs';
|
|
14
|
-
import { useLocalizedStringFormatter } from 'react-aria';
|
|
15
|
-
import locales from '../../../../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
8
|
+
import { FilterAccordionRadioGroup } from './FilterAccordionRadioGroup.mjs';
|
|
9
|
+
import { FilterAccordionCheckboxGroup } from './FilterAccordionCheckboxGroup.mjs';
|
|
10
|
+
import { FilterAccordionDateRange } from './FilterAccordionDateRange.mjs';
|
|
11
|
+
import { DateRangeFilter } from '../../../../model/filter/DateRangeFilter.mjs';
|
|
16
12
|
|
|
17
13
|
const FilterAccordion = (props) => {
|
|
18
14
|
const { filter } = props;
|
|
19
|
-
const activeKeys = filter.values.filter((v) => v.isActive).map((v) => v.id);
|
|
20
15
|
const name = filter.name ?? filter.property;
|
|
21
|
-
const
|
|
16
|
+
const content = filter instanceof DateRangeFilter ? /* @__PURE__ */ jsx(FilterAccordionDateRange, { filter }) : filter.mode === "one" ? /* @__PURE__ */ jsx(FilterAccordionRadioGroup, { filter }) : /* @__PURE__ */ jsx(FilterAccordionCheckboxGroup, { filter });
|
|
22
17
|
return /* @__PURE__ */ jsxs(AccordionView, { children: [
|
|
23
18
|
/* @__PURE__ */ jsx(HeadingView, { children: name }),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
filter.mode === "one" && /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "m", children: [
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
27
|
-
RadioGroupView,
|
|
28
|
-
{
|
|
29
|
-
value: activeKeys[0],
|
|
30
|
-
m: [1, 1],
|
|
31
|
-
"aria-label": name,
|
|
32
|
-
children: filter.values.map((v) => /* @__PURE__ */ jsx(
|
|
33
|
-
RadioView,
|
|
34
|
-
{
|
|
35
|
-
value: v.id,
|
|
36
|
-
onPress: () => {
|
|
37
|
-
if (!v.isActive) {
|
|
38
|
-
v.toggle();
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
children: v.render()
|
|
42
|
-
},
|
|
43
|
-
v.id
|
|
44
|
-
))
|
|
45
|
-
},
|
|
46
|
-
activeKeys[0]
|
|
47
|
-
),
|
|
48
|
-
activeKeys.length > 0 && /* @__PURE__ */ jsx(
|
|
49
|
-
ButtonView,
|
|
50
|
-
{
|
|
51
|
-
size: "s",
|
|
52
|
-
color: "secondary",
|
|
53
|
-
variant: "soft",
|
|
54
|
-
onPress: () => filter.clear(),
|
|
55
|
-
children: stringFormatter.format("list.filters.clearSelection")
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
] }),
|
|
59
|
-
filter.mode !== "one" && /* @__PURE__ */ jsx(CheckboxGroupView, { value: activeKeys, m: [1, 1], "aria-label": name, children: filter.values.map((v) => /* @__PURE__ */ jsx(CheckboxView, { value: v.id, onPress: () => v.toggle(), children: v.render() }, v.id)) })
|
|
60
|
-
] })
|
|
19
|
+
/* @__PURE__ */ jsx(ContentView, { children: content })
|
|
61
20
|
] });
|
|
62
21
|
};
|
|
63
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordion.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContentView from \"@/views/ContentView\";\nimport
|
|
1
|
+
{"version":3,"file":"FilterAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordion.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContentView from \"@/views/ContentView\";\nimport type { Filter } from \"@/components/List/model/filter/Filter\";\nimport { FilterAccordionRadioGroup } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup\";\nimport { FilterAccordionCheckboxGroup } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup\";\nimport { FilterAccordionDateRange } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\n\ninterface Props {\n filter: Filter | DateRangeFilter;\n}\n\nexport const FilterAccordion: FC<Props> = (props) => {\n const { filter } = props;\n\n const name = filter.name ?? filter.property;\n\n const content =\n filter instanceof DateRangeFilter ? (\n <FilterAccordionDateRange filter={filter} />\n ) : filter.mode === \"one\" ? (\n <FilterAccordionRadioGroup filter={filter} />\n ) : (\n <FilterAccordionCheckboxGroup filter={filter} />\n );\n\n return (\n <AccordionView>\n <HeadingView>{name}</HeadingView>\n <ContentView>{content}</ContentView>\n </AccordionView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,eAAA,GAA6B,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,QAAA;AAEnC,EAAA,MAAM,UACJ,MAAA,YAAkB,eAAA,mBAChB,GAAA,CAAC,wBAAA,EAAA,EAAyB,QAAgB,CAAA,GACxC,MAAA,CAAO,IAAA,KAAS,KAAA,uBACjB,yBAAA,EAAA,EAA0B,MAAA,EAAgB,CAAA,mBAE3C,GAAA,CAAC,gCAA6B,MAAA,EAAgB,CAAA;AAGlD,EAAA,4BACG,aAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,eAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,oBACnB,GAAA,CAAC,eAAa,QAAA,EAAA,OAAA,EAAQ;AAAA,GAAA,EACxB,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import CheckboxGroupView from '../../../../../../views/CheckboxGroupView.mjs';
|
|
6
|
+
import CheckboxView from '../../../../../../views/CheckboxView.mjs';
|
|
7
|
+
|
|
8
|
+
const FilterAccordionCheckboxGroup = (props) => {
|
|
9
|
+
const { filter } = props;
|
|
10
|
+
const activeKeys = filter.values.filter((v) => v.isActive).map((v) => v.id);
|
|
11
|
+
const name = filter.name ?? filter.property;
|
|
12
|
+
return /* @__PURE__ */ jsx(CheckboxGroupView, { value: activeKeys, m: [1, 1], "aria-label": name, children: filter.values.map((v) => /* @__PURE__ */ jsx(CheckboxView, { value: v.id, onPress: () => v.toggle(), children: v.render() }, v.id)) });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { FilterAccordionCheckboxGroup };
|
|
16
|
+
//# sourceMappingURL=FilterAccordionCheckboxGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterAccordionCheckboxGroup.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport CheckboxGroupView from \"@/views/CheckboxGroupView\";\nimport CheckboxView from \"@/views/CheckboxView\";\nimport type { Filter } from \"@/components/List/model/filter/Filter\";\n\ninterface Props {\n filter: Filter;\n}\n\nexport const FilterAccordionCheckboxGroup: FC<Props> = (props) => {\n const { filter } = props;\n\n const activeKeys = filter.values.filter((v) => v.isActive).map((v) => v.id);\n\n const name = filter.name ?? filter.property;\n\n return (\n <CheckboxGroupView value={activeKeys} m={[1, 1]} aria-label={name}>\n {filter.values.map((v) => (\n <CheckboxView key={v.id} value={v.id} onPress={() => v.toggle()}>\n {v.render()}\n </CheckboxView>\n ))}\n </CheckboxGroupView>\n );\n};\n"],"names":[],"mappings":";;;;;AASO,MAAM,4BAAA,GAA0C,CAAC,KAAA,KAAU;AAChE,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAQ,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAE1E,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,QAAA;AAEnC,EAAA,uBACE,GAAA,CAAC,iBAAA,EAAA,EAAkB,KAAA,EAAO,UAAA,EAAY,GAAG,CAAC,CAAA,EAAG,CAAC,CAAA,EAAG,YAAA,EAAY,IAAA,EAC1D,QAAA,EAAA,MAAA,CAAO,MAAA,CAAO,IAAI,CAAC,CAAA,qBAClB,GAAA,CAAC,YAAA,EAAA,EAAwB,KAAA,EAAO,CAAA,CAAE,EAAA,EAAI,OAAA,EAAS,MAAM,CAAA,CAAE,MAAA,EAAO,EAC3D,QAAA,EAAA,CAAA,CAAE,MAAA,EAAO,EAAA,EADO,CAAA,CAAE,EAErB,CACD,CAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
6
|
+
import { Flex } from '../../../../../Flex/Flex.mjs';
|
|
7
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
8
|
+
import locales from '../../../../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
9
|
+
import RangeCalendarView from '../../../../../../views/RangeCalendarView.mjs';
|
|
10
|
+
|
|
11
|
+
const FilterAccordionDateRange = (props) => {
|
|
12
|
+
const { filter } = props;
|
|
13
|
+
const currentValue = filter.getValue();
|
|
14
|
+
const stringFormatter = useLocalizedStringFormatter(locales);
|
|
15
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "m", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
RangeCalendarView,
|
|
18
|
+
{
|
|
19
|
+
...filter.dateRangeOptions,
|
|
20
|
+
value: currentValue,
|
|
21
|
+
onChange: (range) => {
|
|
22
|
+
filter.setValue(range);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
currentValue && /* @__PURE__ */ jsx(
|
|
27
|
+
ButtonView,
|
|
28
|
+
{
|
|
29
|
+
size: "s",
|
|
30
|
+
color: "secondary",
|
|
31
|
+
variant: "soft",
|
|
32
|
+
onPress: () => filter.clear(),
|
|
33
|
+
children: stringFormatter.format("list.filters.clearSelection")
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { FilterAccordionDateRange };
|
|
40
|
+
//# sourceMappingURL=FilterAccordionDateRange.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterAccordionDateRange.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { Flex } from \"@/components/Flex\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\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);\n\n return (\n <Flex direction=\"column\" gap=\"m\">\n <RangeCalendarView\n {...filter.dateRangeOptions}\n value={currentValue}\n onChange={(range) => {\n filter.setValue(range);\n }}\n />\n {currentValue && (\n <ButtonView\n size=\"s\"\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => filter.clear()}\n >\n {stringFormatter.format(\"list.filters.clearSelection\")}\n </ButtonView>\n )}\n </Flex>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAYO,MAAM,wBAAA,GAAsC,CAAC,KAAA,KAAU;AAC5D,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,YAAA,GAAe,OAAO,QAAA,EAAS;AAErC,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS,KAAI,GAAA,EAC3B,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACE,GAAG,MAAA,CAAO,gBAAA;AAAA,QACX,KAAA,EAAO,YAAA;AAAA,QACP,QAAA,EAAU,CAAC,KAAA,KAAU;AACnB,UAAA,MAAA,CAAO,SAAS,KAAK,CAAA;AAAA,QACvB;AAAA;AAAA,KACF;AAAA,IACC,YAAA,oBACC,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,GAAA;AAAA,QACL,KAAA,EAAM,WAAA;AAAA,QACN,OAAA,EAAQ,MAAA;AAAA,QACR,OAAA,EAAS,MAAM,MAAA,CAAO,KAAA,EAAM;AAAA,QAE3B,QAAA,EAAA,eAAA,CAAgB,OAAO,6BAA6B;AAAA;AAAA;AACvD,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import RadioGroupView from '../../../../../../views/RadioGroupView.mjs';
|
|
6
|
+
import RadioView from '../../../../../../views/RadioView.mjs';
|
|
7
|
+
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
8
|
+
import { Flex } from '../../../../../Flex/Flex.mjs';
|
|
9
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
10
|
+
import locales from '../../../../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
11
|
+
|
|
12
|
+
const FilterAccordionRadioGroup = (props) => {
|
|
13
|
+
const { filter } = props;
|
|
14
|
+
const activeKeys = filter.values.filter((v) => v.isActive).map((v) => v.id);
|
|
15
|
+
const name = filter.name ?? filter.property;
|
|
16
|
+
const stringFormatter = useLocalizedStringFormatter(locales);
|
|
17
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "m", children: [
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
RadioGroupView,
|
|
20
|
+
{
|
|
21
|
+
value: activeKeys[0],
|
|
22
|
+
m: [1, 1],
|
|
23
|
+
"aria-label": name,
|
|
24
|
+
children: filter.values.map((v) => /* @__PURE__ */ jsx(
|
|
25
|
+
RadioView,
|
|
26
|
+
{
|
|
27
|
+
value: v.id,
|
|
28
|
+
onPress: () => {
|
|
29
|
+
if (!v.isActive) {
|
|
30
|
+
v.toggle();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
children: v.render()
|
|
34
|
+
},
|
|
35
|
+
v.id
|
|
36
|
+
))
|
|
37
|
+
},
|
|
38
|
+
activeKeys[0]
|
|
39
|
+
),
|
|
40
|
+
activeKeys.length > 0 && /* @__PURE__ */ jsx(
|
|
41
|
+
ButtonView,
|
|
42
|
+
{
|
|
43
|
+
size: "s",
|
|
44
|
+
color: "secondary",
|
|
45
|
+
variant: "soft",
|
|
46
|
+
onPress: () => filter.clear(),
|
|
47
|
+
children: stringFormatter.format("list.filters.clearSelection")
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { FilterAccordionRadioGroup };
|
|
54
|
+
//# sourceMappingURL=FilterAccordionRadioGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterAccordionRadioGroup.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport RadioGroupView from \"@/views/RadioGroupView\";\nimport RadioView from \"@/views/RadioView\";\nimport type { Filter } from \"@/components/List/model/filter/Filter\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { Flex } from \"@/components/Flex\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n filter: Filter;\n}\n\nexport const FilterAccordionRadioGroup: FC<Props> = (props) => {\n const { filter } = props;\n\n const activeKeys = filter.values.filter((v) => v.isActive).map((v) => v.id);\n\n const name = filter.name ?? filter.property;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <Flex direction=\"column\" gap=\"m\">\n <RadioGroupView\n value={activeKeys[0]}\n m={[1, 1]}\n key={activeKeys[0]}\n aria-label={name}\n >\n {filter.values.map((v) => (\n <RadioView\n key={v.id}\n value={v.id}\n onPress={() => {\n if (!v.isActive) {\n v.toggle();\n }\n }}\n >\n {v.render()}\n </RadioView>\n ))}\n </RadioGroupView>\n {activeKeys.length > 0 && (\n <ButtonView\n size=\"s\"\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => filter.clear()}\n >\n {stringFormatter.format(\"list.filters.clearSelection\")}\n </ButtonView>\n )}\n </Flex>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAaO,MAAM,yBAAA,GAAuC,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAQ,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAE1E,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,QAAA;AAEnC,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS,KAAI,GAAA,EAC3B,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,WAAW,CAAC,CAAA;AAAA,QACnB,CAAA,EAAG,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,QAER,YAAA,EAAY,IAAA;AAAA,QAEX,QAAA,EAAA,MAAA,CAAO,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,qBAClB,GAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YAEC,OAAO,CAAA,CAAE,EAAA;AAAA,YACT,SAAS,MAAM;AACb,cAAA,IAAI,CAAC,EAAE,QAAA,EAAU;AACf,gBAAA,CAAA,CAAE,MAAA,EAAO;AAA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