@mittwald/flow-react-components 0.2.0-alpha.623 → 0.2.0-alpha.624
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 +6 -0
- package/dist/assets/doc-properties.json +3668 -3630
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs +1 -0
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/components/src/components/FileDropZone/FileDropZone.mjs +17 -15
- package/dist/js/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs +35 -31
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/Filters/CombinedFilterMenu.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/components/Filters/CombinedFilterMenu.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/Filters/FilterMenuList.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/components/Filters/FilterMenuList.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/Settings/SortingMenuItem.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/components/Settings/SortingMenuItem.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/Settings/ViewModeMenu.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/components/Settings/ViewModeMenu.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/lib.mjs +4 -3
- package/dist/js/components/src/components/List/components/Header/lib.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +5 -4
- package/dist/js/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/ListItemView/ListItemView.mjs +2 -1
- package/dist/js/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Table/Table.mjs +4 -3
- package/dist/js/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/components/src/components/propTypes/index.mjs +1 -0
- package/dist/js/components/src/components/propTypes/index.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +1 -0
- package/dist/js/flr-universal.mjs.map +1 -1
- package/dist/types/components/FileDropZone/FileDropZone.d.ts.map +1 -1
- package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts +4 -3
- package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -1
- package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/propTypes/index.d.ts +2 -0
- package/dist/types/components/propTypes/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -61,6 +61,7 @@ import '../FileCardList/FileCardList.mjs';
|
|
|
61
61
|
import '../FileDropZone/FileDropZone.mjs';
|
|
62
62
|
import '../FileField/FileField.mjs';
|
|
63
63
|
import '../Header/Header.mjs';
|
|
64
|
+
import '../IllustratedMessage/IllustratedMessage.mjs';
|
|
64
65
|
import '../Image/Image.mjs';
|
|
65
66
|
import '../Initials/Initials.mjs';
|
|
66
67
|
import '../Label/Label.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.mjs","sources":["../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import * as Recharts from \"recharts\";\nimport React, {\n Children,\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type FC,\n type PropsWithChildren,\n type ReactElement,\n type SVGProps,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport Wrap from \"../Wrap\";\nimport { CartesianGrid } from \"../public\";\n\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof Recharts.ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps\n extends Pick<\n ComponentProps<typeof Recharts.ComposedChart>,\n \"data\" | \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n height?: string;\n /** View that is provided when data is empty/undefined */\n emptyView?: React.ComponentType<CartesianChartEmptyViewProps>;\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView: EmptyView,\n ...rest\n } = props;\n const rootClassName = clsx(styles.cartesianChart, className);\n\n const otherChildren: ReactElement[] = [];\n const gridChildren: ReactElement[] = [];\n\n Children.forEach(children, (child) => {\n if (!child) return;\n const element = child as ReactElement;\n\n if (element.type === CartesianGrid) {\n gridChildren.push(element);\n } else {\n otherChildren.push(element);\n }\n });\n\n const showEmptyView = (!data || data.length === 0) && EmptyView;\n\n const chartContainerRef = useRef<HTMLDivElement>(null);\n const [viewDimensions, setViewDimensions] = useState<Partial<\n SVGProps<SVGForeignObjectElement>\n > | null>(null);\n\n // resizing the foreignObject for the EmptyView on size changes\n useEffect(() => {\n if (showEmptyView) {\n const updateDimensions = () => {\n const svg = chartContainerRef.current?.querySelector(\n \"svg\",\n ) as SVGSVGElement | null;\n if (!svg) return;\n\n const clip = svg.querySelector(\"clipPath rect\");\n if (clip) {\n const x = parseFloat(clip.getAttribute(\"x\") ?? \"0\");\n const y = parseFloat(clip.getAttribute(\"y\") ?? \"0\");\n const width = parseFloat(clip.getAttribute(\"width\") ?? \"0\");\n const height = parseFloat(clip.getAttribute(\"height\") ?? \"0\");\n setViewDimensions({ x, y, width, height });\n }\n };\n\n updateDimensions();\n\n const container = chartContainerRef.current;\n const observer = new ResizeObserver(updateDimensions);\n if (container) observer.observe(container);\n\n return () => {\n observer.disconnect();\n };\n }\n }, [showEmptyView]);\n\n return (\n <Wrap if={height}>\n <div\n style={{ height, flex: flexGrow ? 1 : undefined }}\n ref={chartContainerRef}\n >\n <Recharts.ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n >\n <Recharts.ComposedChart\n data={data}\n className={rootClassName}\n {...rest}\n >\n {!showEmptyView && gridChildren}\n {otherChildren}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <div className={styles.emptyViewContainer}>\n <EmptyView data={data} />\n </div>\n </foreignObject>\n )}\n </Recharts.ComposedChart>\n </Recharts.ResponsiveContainer>\n </div>\n </Wrap>\n );\n};\n\nexport default CartesianChart;\n"],"names":["height"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartesianChart.mjs","sources":["../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import * as Recharts from \"recharts\";\nimport React, {\n Children,\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type FC,\n type PropsWithChildren,\n type ReactElement,\n type SVGProps,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport Wrap from \"../Wrap\";\nimport { CartesianGrid } from \"../public\";\n\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof Recharts.ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps\n extends Pick<\n ComponentProps<typeof Recharts.ComposedChart>,\n \"data\" | \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n height?: string;\n /** View that is provided when data is empty/undefined */\n emptyView?: React.ComponentType<CartesianChartEmptyViewProps>;\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView: EmptyView,\n ...rest\n } = props;\n const rootClassName = clsx(styles.cartesianChart, className);\n\n const otherChildren: ReactElement[] = [];\n const gridChildren: ReactElement[] = [];\n\n Children.forEach(children, (child) => {\n if (!child) return;\n const element = child as ReactElement;\n\n if (element.type === CartesianGrid) {\n gridChildren.push(element);\n } else {\n otherChildren.push(element);\n }\n });\n\n const showEmptyView = (!data || data.length === 0) && EmptyView;\n\n const chartContainerRef = useRef<HTMLDivElement>(null);\n const [viewDimensions, setViewDimensions] = useState<Partial<\n SVGProps<SVGForeignObjectElement>\n > | null>(null);\n\n // resizing the foreignObject for the EmptyView on size changes\n useEffect(() => {\n if (showEmptyView) {\n const updateDimensions = () => {\n const svg = chartContainerRef.current?.querySelector(\n \"svg\",\n ) as SVGSVGElement | null;\n if (!svg) return;\n\n const clip = svg.querySelector(\"clipPath rect\");\n if (clip) {\n const x = parseFloat(clip.getAttribute(\"x\") ?? \"0\");\n const y = parseFloat(clip.getAttribute(\"y\") ?? \"0\");\n const width = parseFloat(clip.getAttribute(\"width\") ?? \"0\");\n const height = parseFloat(clip.getAttribute(\"height\") ?? \"0\");\n setViewDimensions({ x, y, width, height });\n }\n };\n\n updateDimensions();\n\n const container = chartContainerRef.current;\n const observer = new ResizeObserver(updateDimensions);\n if (container) observer.observe(container);\n\n return () => {\n observer.disconnect();\n };\n }\n }, [showEmptyView]);\n\n return (\n <Wrap if={height}>\n <div\n style={{ height, flex: flexGrow ? 1 : undefined }}\n ref={chartContainerRef}\n >\n <Recharts.ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n >\n <Recharts.ComposedChart\n data={data}\n className={rootClassName}\n {...rest}\n >\n {!showEmptyView && gridChildren}\n {otherChildren}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <div className={styles.emptyViewContainer}>\n <EmptyView data={data} />\n </div>\n </foreignObject>\n )}\n </Recharts.ComposedChart>\n </Recharts.ResponsiveContainer>\n </div>\n </Wrap>\n );\n};\n\nexport default CartesianChart;\n"],"names":["height"],"mappings":";;;;;;;;;;;;;;;;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AA,EAAkB;AAAA;AAAA,YAEhB,KAAA,EAAO,CAAA;AAAA,YACP,MAAA,EAAQ;AAAA,WACV;AAAA,UAEA,QAAA,kBAAA,IAAA;AAAA,YAAC,QAAA,CAAS,aAAA;AAAA,YAAT;AAAA,cACC,IAAA;AAAA,cACA,SAAA,EAAW,aAAA;AAAA,cACV,GAAG,IAAA;AAAA,cAEH,QAAA,EAAA;AAAA,gBAAA,CAAC,aAAA,IAAiB,YAAA;AAAA,gBAClB,aAAA;AAAA,gBACA,aAAA,IAAiB,cAAA,oBAChB,GAAA,CAAC,eAAA,EAAA,EAAe,GAAG,cAAA,EACjB,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,kBAAA,EACrB,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,IAAA,EAAY,GACzB,CAAA,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA;AACF;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -39,21 +39,23 @@ const FileDropZone = flowComponent(
|
|
|
39
39
|
);
|
|
40
40
|
const propsContext = {
|
|
41
41
|
...fieldPropsContext,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
IllustratedMessage: {
|
|
43
|
+
FileField: {
|
|
44
|
+
name,
|
|
45
|
+
onChange: onChangeDropZone,
|
|
46
|
+
ref: fileFieldRef,
|
|
47
|
+
accept,
|
|
48
|
+
multiple,
|
|
49
|
+
Button: { variant: "outline", color: "dark" },
|
|
50
|
+
isDisabled,
|
|
51
|
+
isReadOnly
|
|
52
|
+
},
|
|
53
|
+
Heading: {
|
|
54
|
+
className: styles.heading
|
|
55
|
+
},
|
|
56
|
+
Icon: { className: styles.icon },
|
|
57
|
+
Text: { className: styles.text }
|
|
58
|
+
}
|
|
57
59
|
};
|
|
58
60
|
const onDropHandler = async (event) => {
|
|
59
61
|
if (isReadOnly) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { addAwaitedArrayBuffer } from \"@mittwald/flow-core\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n FileField: {\n
|
|
1
|
+
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { addAwaitedArrayBuffer } from \"@mittwald/flow-core\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const fileDropItems = event.items.filter(\n (file) => file.kind === \"file\",\n ) as Aria.FileDropItem[];\n\n const files = await Promise.all(\n fileDropItems\n .filter((f) => !accept || accept?.includes(f.type))\n .map(async (f) => {\n const file = await f.getFile();\n return await addAwaitedArrayBuffer(file);\n }),\n );\n\n if (files.length > 0) {\n const fileTransfer = new DataTransfer();\n for (const file of multiple ? files : [files[0]]) {\n if (file) {\n fileTransfer.items.add(file);\n }\n }\n\n onChangeDropZone?.(fileTransfer.files);\n if (fileFieldRef.current) {\n fileFieldRef.current.files = fileTransfer.files;\n }\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.DropZone\n className={rootClassName}\n onDrop={onDropHandler}\n isDisabled={isDisabled}\n data-readonly={isReadOnly}\n >\n <IllustratedMessage color=\"dark\">{children}</IllustratedMessage>\n </Aria.DropZone>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n },\n);\n\nexport default FileDropZone;\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,YAAA,GAAsC,aAAA;AAAA,EACjD,cAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,gBAAA;AAAA,MACV,QAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,KAAA;AAEJ,IAAA,MAAM;AAAA,MACJ,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,IA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7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
|
+
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
9
|
|
|
9
|
-
const IllustratedMessage = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
10
|
+
const IllustratedMessage = flowComponent(
|
|
11
|
+
"IllustratedMessage",
|
|
12
|
+
(props) => {
|
|
13
|
+
const { className, children, color = "primary", ...rest } = props;
|
|
14
|
+
const rootClassName = clsx(
|
|
15
|
+
styles.illustratedMessage,
|
|
16
|
+
className,
|
|
17
|
+
styles[color]
|
|
18
|
+
);
|
|
19
|
+
const lightOrDarkColor = color === "dark" || color === "light" ? color : void 0;
|
|
20
|
+
const propsContext = {
|
|
21
|
+
Icon: {
|
|
22
|
+
className: styles.icon,
|
|
23
|
+
size: "l"
|
|
24
|
+
},
|
|
25
|
+
Heading: {
|
|
26
|
+
className: styles.heading,
|
|
27
|
+
color: lightOrDarkColor
|
|
28
|
+
},
|
|
29
|
+
Text: {
|
|
30
|
+
className: styles.text,
|
|
31
|
+
color: lightOrDarkColor
|
|
32
|
+
},
|
|
33
|
+
Button: {
|
|
34
|
+
color: lightOrDarkColor ?? "accent"
|
|
35
|
+
},
|
|
36
|
+
ActionGroup: {
|
|
37
|
+
className: styles.actionGroup
|
|
38
|
+
},
|
|
39
|
+
ProgressBar: { className: styles.progressBar }
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsx("div", { ...rest, className: rootClassName, children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children }) });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
40
44
|
|
|
41
45
|
export { IllustratedMessage, IllustratedMessage as default };
|
|
42
46
|
//# sourceMappingURL=IllustratedMessage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps,
|
|
1
|
+
{"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>,\n FlowComponentProps {\n /** The color of the illustrated message. @default \"primary\" */\n color?: \"primary\" | \"danger\" | \"light\" | \"dark\";\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"primary\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n className,\n styles[color],\n );\n\n const lightOrDarkColor =\n color === \"dark\" || color === \"light\" ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color: lightOrDarkColor,\n },\n Text: {\n className: styles.text,\n color: lightOrDarkColor,\n },\n Button: {\n color: lightOrDarkColor ?? \"accent\",\n },\n ActionGroup: {\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,kBAAA,GAAqB,aAAA;AAAA,EAChC,oBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,QAAQ,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AAE5D,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,kBAAA;AAAA,MACP,SAAA;AAAA,MACA,OAAO,KAAK;AAAA,KACd;AAEA,IAAA,MAAM,gBAAA,GACJ,KAAA,KAAU,MAAA,IAAU,KAAA,KAAU,UAAU,KAAA,GAAQ,MAAA;AAElD,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,WAAW,MAAA,CAAO,OAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,OAAO,gBAAA,IAAoB;AAAA,OAC7B;AAAA,MACA,WAAA,EAAa;AAAA,QACX,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,WAAA,EAAa,EAAE,SAAA,EAAW,MAAA,CAAO,WAAA;AAAY,KAC/C;AAEA,IAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EACxB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -9,15 +9,16 @@ import { IconFilter } from '../../../../../Icon/components/icons/IconFilter.mjs'
|
|
|
9
9
|
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
10
10
|
import 'invariant';
|
|
11
11
|
import 'react-aria-components';
|
|
12
|
-
import '
|
|
13
|
-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
14
|
-
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
12
|
+
import '../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
15
13
|
import '../../../../../Heading/Heading.mjs';
|
|
16
14
|
import '../../../../../Text/Text.mjs';
|
|
17
15
|
import locales from '../../../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
18
16
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
17
|
+
import 'clsx';
|
|
19
18
|
import '@mittwald/react-tunnel';
|
|
20
19
|
import '../../../../../../views/ListItemViewContentView.mjs';
|
|
20
|
+
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
21
|
+
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
21
22
|
import ContextMenuTriggerView from '../../../../../../views/ContextMenuTriggerView.mjs';
|
|
22
23
|
import '../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
23
24
|
import '../../../ListSummary/ListSummary.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CombinedFilterMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Filters/CombinedFilterMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport HeadingView from \"@/views/HeadingView\";\nimport { FilterMenuItem } from \"@/components/List/components/Header/components/Filters/FilterMenuItem\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContextMenuSectionView from \"@/views/ContextMenuSectionView\";\nimport SeparatorView from \"@/views/SeparatorView\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\nexport const CombinedFilterMenu: FC = () => {\n const list = useList();\n\n const filters = list.filters;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n if (filters.length === 0) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n className={styles.mobile}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.filters\")}\n >\n <IconFilter />\n </ButtonView>\n <ContextMenuView>\n {filters.map((f, i) => {\n const activeFilterKeys = f.values\n .filter((v) => v.isActive)\n .map((v) => v.id);\n\n return (\n <React.Fragment key={f.property}>\n <ContextMenuSectionView\n selectionMode={f.mode === \"one\" ? \"single\" : \"multiple\"}\n selectedKeys={activeFilterKeys}\n >\n <HeadingView>{f.name ?? f.property}</HeadingView>\n {f.values.map((v) => (\n <FilterMenuItem key={v.id} filterValue={v} />\n ))}\n </ContextMenuSectionView>\n {i + 1 < filters.length && <SeparatorView />}\n </React.Fragment>\n );\n })}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CombinedFilterMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Filters/CombinedFilterMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport HeadingView from \"@/views/HeadingView\";\nimport { FilterMenuItem } from \"@/components/List/components/Header/components/Filters/FilterMenuItem\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContextMenuSectionView from \"@/views/ContextMenuSectionView\";\nimport SeparatorView from \"@/views/SeparatorView\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\nexport const CombinedFilterMenu: FC = () => {\n const list = useList();\n\n const filters = list.filters;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n if (filters.length === 0) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n className={styles.mobile}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.filters\")}\n >\n <IconFilter />\n </ButtonView>\n <ContextMenuView>\n {filters.map((f, i) => {\n const activeFilterKeys = f.values\n .filter((v) => v.isActive)\n .map((v) => v.id);\n\n return (\n <React.Fragment key={f.property}>\n <ContextMenuSectionView\n selectionMode={f.mode === \"one\" ? \"single\" : \"multiple\"}\n selectedKeys={activeFilterKeys}\n >\n <HeadingView>{f.name ?? f.property}</HeadingView>\n {f.values.map((v) => (\n <FilterMenuItem key={v.id} filterValue={v} />\n ))}\n </ContextMenuSectionView>\n {i + 1 < filters.length && <SeparatorView />}\n </React.Fragment>\n );\n })}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,qBAAyB,MAAM;AAC1C,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,UAAU,IAAA,CAAK,OAAA;AAErB,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,4BACG,sBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,WAAWA,YAAA,CAAO,MAAA;AAAA,QAClB,OAAA,EAAQ,SAAA;AAAA,QACR,KAAA,EAAM,WAAA;AAAA,QACN,YAAA,E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-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
9
|
-
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
|
+
import '../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
10
8
|
import '@tabler/icons-react';
|
|
11
9
|
import '../../../../../Icon/Icon.mjs';
|
|
12
10
|
import '../../../../../../views/IconView.mjs';
|
|
13
11
|
import '../../../../../Heading/Heading.mjs';
|
|
14
12
|
import '../../../../../Text/Text.mjs';
|
|
15
13
|
import 'react-aria';
|
|
14
|
+
import 'clsx';
|
|
16
15
|
import '@mittwald/react-tunnel';
|
|
17
16
|
import '../../../../../../views/ListItemViewContentView.mjs';
|
|
17
|
+
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
18
|
+
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
18
19
|
import '../../../../../../views/ButtonView.mjs';
|
|
19
20
|
import '../../../../../../views/ContextMenuTriggerView.mjs';
|
|
20
21
|
import '../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterMenuList.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Filters/FilterMenuList.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { useList } from \"@/components/List\";\nimport { FilterMenu } from \"@/components/List/components/Header/components/Filters/FilterMenu\";\n\nexport const FilterMenuList: FC = () => {\n const list = useList();\n\n return list.filters.map((filter) => (\n <FilterMenu key={filter.property} filter={filter} />\n ));\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterMenuList.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Filters/FilterMenuList.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { useList } from \"@/components/List\";\nimport { FilterMenu } from \"@/components/List/components/Header/components/Filters/FilterMenu\";\n\nexport const FilterMenuList: FC = () => {\n const list = useList();\n\n return list.filters.map((filter) => (\n <FilterMenu key={filter.property} filter={filter} />\n ));\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,iBAAqB,MAAM;AACtC,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,GAAA,CAAI,CAAC,MAAA,yBACtB,UAAA,EAAA,EAAiC,MAAA,EAAA,EAAjB,MAAA,CAAO,QAA0B,CACnD,CAAA;AACH;;;;"}
|
|
@@ -5,17 +5,18 @@ import 'react';
|
|
|
5
5
|
import MenuItemView from '../../../../../../views/MenuItemView.mjs';
|
|
6
6
|
import 'invariant';
|
|
7
7
|
import 'react-aria-components';
|
|
8
|
-
import '
|
|
9
|
-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
10
|
-
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
|
+
import '../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
11
9
|
import '@tabler/icons-react';
|
|
12
10
|
import '../../../../../Icon/Icon.mjs';
|
|
13
11
|
import '../../../../../../views/IconView.mjs';
|
|
14
12
|
import '../../../../../Heading/Heading.mjs';
|
|
15
13
|
import '../../../../../Text/Text.mjs';
|
|
16
14
|
import 'react-aria';
|
|
15
|
+
import 'clsx';
|
|
17
16
|
import '@mittwald/react-tunnel';
|
|
18
17
|
import '../../../../../../views/ListItemViewContentView.mjs';
|
|
18
|
+
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
19
|
+
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
19
20
|
import '../../../../../../views/ButtonView.mjs';
|
|
20
21
|
import '../../../../../../views/ContextMenuTriggerView.mjs';
|
|
21
22
|
import '../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/SortingMenuItem.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport type { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport { useList } from \"@/components/List\";\n\ninterface Props {\n sorting: Sorting<never>;\n}\n\nexport const SortingMenuItem: FC<Props> = (props) => {\n const { sorting } = props;\n\n const list = useList();\n\n return (\n <MenuItemView\n id={sorting.id}\n onAction={() => {\n list.getSorting(sorting.id).enable();\n }}\n >\n {sorting.name ?? sorting.property}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/SortingMenuItem.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport type { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport { useList } from \"@/components/List\";\n\ninterface Props {\n sorting: Sorting<never>;\n}\n\nexport const SortingMenuItem: FC<Props> = (props) => {\n const { sorting } = props;\n\n const list = useList();\n\n return (\n <MenuItemView\n id={sorting.id}\n onAction={() => {\n list.getSorting(sorting.id).enable();\n }}\n >\n {sorting.name ?? sorting.property}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,eAAA,GAA6B,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM,EAAE,SAAQ,GAAI,KAAA;AAEpB,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,IAAI,OAAA,CAAQ,EAAA;AAAA,MACZ,UAAU,MAAM;AACd,QAAA,IAAA,CAAK,UAAA,CAAW,OAAA,CAAQ,EAAE,CAAA,CAAE,MAAA,EAAO;AAAA,MACrC,CAAA;AAAA,MAEC,QAAA,EAAA,OAAA,CAAQ,QAAQ,OAAA,CAAQ;AAAA;AAAA,GAC3B;AAEJ;;;;"}
|
|
@@ -6,17 +6,18 @@ import { useLocalizedStringFormatter } from 'react-aria';
|
|
|
6
6
|
import 'invariant';
|
|
7
7
|
import 'react-aria-components';
|
|
8
8
|
import 'react';
|
|
9
|
-
import '
|
|
10
|
-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
11
|
-
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
|
+
import '../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
12
10
|
import '@tabler/icons-react';
|
|
13
11
|
import '../../../../../Icon/Icon.mjs';
|
|
14
12
|
import '../../../../../../views/IconView.mjs';
|
|
15
13
|
import { IconView } from '../../../../../Icon/components/icons/IconView.mjs';
|
|
16
14
|
import '../../../../../Heading/Heading.mjs';
|
|
17
15
|
import '../../../../../Text/Text.mjs';
|
|
16
|
+
import 'clsx';
|
|
18
17
|
import '@mittwald/react-tunnel';
|
|
19
18
|
import '../../../../../../views/ListItemViewContentView.mjs';
|
|
19
|
+
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
20
|
+
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
20
21
|
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
21
22
|
import ContextMenuTriggerView from '../../../../../../views/ContextMenuTriggerView.mjs';
|
|
22
23
|
import '../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/ViewModeMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { useList } from \"@/components/List\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport { ViewModeMenuItem } from \"@/components/List/components/Header/components/Settings/ViewModeMenuItem\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\nexport const ViewModeMenu: FC = () => {\n const stringFormatter = useLocalizedStringFormatter(locales);\n const list = useList();\n const selectedViewMode = list.viewMode;\n\n const availableViewModes = useAvailableViewModes();\n\n if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.settings\")}\n className={styles.desktop}\n >\n <TextView>\n {stringFormatter.format(`list.settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenuView selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n {availableViewModes.map((viewMode) => (\n <ViewModeMenuItem viewMode={viewMode} key={viewMode} />\n ))}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/ViewModeMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { useList } from \"@/components/List\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport { ViewModeMenuItem } from \"@/components/List/components/Header/components/Settings/ViewModeMenuItem\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\nexport const ViewModeMenu: FC = () => {\n const stringFormatter = useLocalizedStringFormatter(locales);\n const list = useList();\n const selectedViewMode = list.viewMode;\n\n const availableViewModes = useAvailableViewModes();\n\n if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.settings\")}\n className={styles.desktop}\n >\n <TextView>\n {stringFormatter.format(`list.settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenuView selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n {availableViewModes.map((viewMode) => (\n <ViewModeMenuItem viewMode={viewMode} key={viewMode} />\n ))}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAmB,MAAM;AACpC,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAC3D,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,mBAAmB,IAAA,CAAK,QAAA;AAE9B,EAAA,MAAM,qBAAqB,qBAAA,EAAsB;AAEjD,EAAA,IAAI,kBAAA,CAAmB,UAAU,CAAA,EAAG;AAClC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,4BACG,sBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,SAAA;AAAA,QACR,KAAA,EAAM,WAAA;AAAA,QACN,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,eAAe,CAAA;AAAA,QAClD,WAAWA,YAAA,CAAO,OAAA;AAAA,QAElB,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,YACE,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,uBAAA,EAA0B,gBAAgB,EAAE,CAAA,EACtE,CAAA;AAAA,8BACC,QAAA,EAAA,EAAS;AAAA;AAAA;AAAA,KACZ;AAAA,wBACC,eAAA,EAAA,EAAgB,aAAA,EAAc,QAAA,EAAS,YAAA,EAAc,CAAC,gBAAgB,CAAA,EACpE,QAAA,EAAA,kBAAA,CAAmB,GAAA,CAAI,CAAC,QAAA,qBACvB,GAAA,CAAC,oBAAiB,QAAA,EAAA,EAAyB,QAAU,CACtD,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -5,9 +5,7 @@ import 'react';
|
|
|
5
5
|
import MenuItemView from '../../../../../../views/MenuItemView.mjs';
|
|
6
6
|
import 'invariant';
|
|
7
7
|
import 'react-aria-components';
|
|
8
|
-
import '
|
|
9
|
-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
10
|
-
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
|
+
import '../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
11
9
|
import '@tabler/icons-react';
|
|
12
10
|
import '../../../../../Icon/Icon.mjs';
|
|
13
11
|
import '../../../../../../views/IconView.mjs';
|
|
@@ -15,8 +13,11 @@ import '../../../../../Heading/Heading.mjs';
|
|
|
15
13
|
import '../../../../../Text/Text.mjs';
|
|
16
14
|
import locales from '../../../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
17
15
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
16
|
+
import 'clsx';
|
|
18
17
|
import '@mittwald/react-tunnel';
|
|
19
18
|
import '../../../../../../views/ListItemViewContentView.mjs';
|
|
19
|
+
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
20
|
+
import '../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
20
21
|
import '../../../../../../views/ButtonView.mjs';
|
|
21
22
|
import '../../../../../../views/ContextMenuTriggerView.mjs';
|
|
22
23
|
import '../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n viewMode: ListViewMode;\n}\n\nexport const ViewModeMenuItem: FC<Props> = (props) => {\n const { viewMode } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <MenuItemView\n id={viewMode}\n onAction={() => {\n list.setViewMode(viewMode);\n }}\n >\n {stringFormatter.format(`list.settings.viewMode.${viewMode}`)}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n viewMode: ListViewMode;\n}\n\nexport const ViewModeMenuItem: FC<Props> = (props) => {\n const { viewMode } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <MenuItemView\n id={viewMode}\n onAction={() => {\n list.setViewMode(viewMode);\n }}\n >\n {stringFormatter.format(`list.settings.viewMode.${viewMode}`)}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,gBAAA,GAA8B,CAAC,KAAA,KAAU;AACpD,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAI,QAAA;AAAA,MACJ,UAAU,MAAM;AACd,QAAA,IAAA,CAAK,YAAY,QAAQ,CAAA;AAAA,MAC3B,CAAA;AAAA,MAEC,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,uBAAA,EAA0B,QAAQ,CAAA,CAAE;AAAA;AAAA,GAC9D;AAEJ;;;;"}
|
|
@@ -4,17 +4,18 @@ import 'invariant';
|
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-aria-components';
|
|
6
6
|
import 'react';
|
|
7
|
-
import '
|
|
8
|
-
import '../../../../lib/propsContext/propsContext.mjs';
|
|
9
|
-
import '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
|
+
import '../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
10
8
|
import '@tabler/icons-react';
|
|
11
9
|
import '../../../Icon/Icon.mjs';
|
|
12
10
|
import '../../../../views/IconView.mjs';
|
|
13
11
|
import '../../../Heading/Heading.mjs';
|
|
14
12
|
import '../../../Text/Text.mjs';
|
|
15
13
|
import 'react-aria';
|
|
14
|
+
import 'clsx';
|
|
16
15
|
import '@mittwald/react-tunnel';
|
|
17
16
|
import '../../../../views/ListItemViewContentView.mjs';
|
|
17
|
+
import '../../../../lib/propsContext/propsContext.mjs';
|
|
18
|
+
import '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
18
19
|
import '../../../../views/ButtonView.mjs';
|
|
19
20
|
import '../../../../views/ContextMenuTriggerView.mjs';
|
|
20
21
|
import '../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","sources":["../../../../../../../../src/components/List/components/Header/lib.ts"],"sourcesContent":["import type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\n\nexport const useAvailableViewModes = () => {\n const list = useList();\n\n const availableViewModes: ListViewMode[] = [];\n\n if (list.itemView?.showList) {\n availableViewModes.push(\"list\");\n }\n if (list.table) {\n availableViewModes.push(\"table\");\n }\n if (list.itemView?.showTiles) {\n availableViewModes.push(\"tiles\");\n }\n\n return availableViewModes;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.mjs","sources":["../../../../../../../../src/components/List/components/Header/lib.ts"],"sourcesContent":["import type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\n\nexport const useAvailableViewModes = () => {\n const list = useList();\n\n const availableViewModes: ListViewMode[] = [];\n\n if (list.itemView?.showList) {\n availableViewModes.push(\"list\");\n }\n if (list.table) {\n availableViewModes.push(\"table\");\n }\n if (list.itemView?.showTiles) {\n availableViewModes.push(\"tiles\");\n }\n\n return availableViewModes;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,wBAAwB,MAAM;AACzC,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,qBAAqC,EAAC;AAE5C,EAAA,IAAI,IAAA,CAAK,UAAU,QAAA,EAAU;AAC3B,IAAA,kBAAA,CAAmB,KAAK,MAAM,CAAA;AAAA,EAChC;AACA,EAAA,IAAI,KAAK,KAAA,EAAO;AACd,IAAA,kBAAA,CAAmB,KAAK,OAAO,CAAA;AAAA,EACjC;AACA,EAAA,IAAI,IAAA,CAAK,UAAU,SAAA,EAAW;AAC5B,IAAA,kBAAA,CAAmB,KAAK,OAAO,CAAA;AAAA,EACjC;AAEA,EAAA,OAAO,kBAAA;AACT;;;;"}
|
|
@@ -4,18 +4,19 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useState, useId, useRef, useEffect } from 'react';
|
|
5
5
|
import 'invariant';
|
|
6
6
|
import 'react-aria-components';
|
|
7
|
-
import '
|
|
8
|
-
import { dynamic } from '../../../../../../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
9
|
-
import '../../../../../../../lib/propsContext/propsContext.mjs';
|
|
10
|
-
import { PropsContextProvider } from '../../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
|
+
import '../../../../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
11
8
|
import '@tabler/icons-react';
|
|
12
9
|
import '../../../../../../Icon/Icon.mjs';
|
|
13
10
|
import '../../../../../../../views/IconView.mjs';
|
|
14
11
|
import '../../../../../../Heading/Heading.mjs';
|
|
15
12
|
import '../../../../../../Text/Text.mjs';
|
|
16
13
|
import 'react-aria';
|
|
14
|
+
import 'clsx';
|
|
17
15
|
import '@mittwald/react-tunnel';
|
|
18
16
|
import '../../../../../../../views/ListItemViewContentView.mjs';
|
|
17
|
+
import { dynamic } from '../../../../../../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
18
|
+
import '../../../../../../../lib/propsContext/propsContext.mjs';
|
|
19
|
+
import { PropsContextProvider } from '../../../../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
19
20
|
import '../../../../../../../views/ButtonView.mjs';
|
|
20
21
|
import '../../../../../../../views/ContextMenuTriggerView.mjs';
|
|
21
22
|
import '../../../../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridItemProps.mjs","sources":["../../../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { useList } from \"@/components/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n}\n\nexport const useGridItemProps = (props: P) => {\n const { data, children: childrenFromProps } = props;\n const list = useList();\n const itemView = list.itemView;\n const onAction = list.onAction;\n\n const [isExpanded, setIsExpanded] = useState(\n itemView?.defaultExpanded?.(data) ?? false,\n );\n const contentElementId = useId();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const accordion = list.accordion;\n const children = childrenFromProps ?? itemView?.render(data);\n\n useEffect(() => {\n if (accordion) {\n itemRef.current?.setAttribute(\"aria-expanded\", String(isExpanded));\n itemRef.current?.setAttribute(\"aria-controls\", contentElementId);\n }\n }, [isExpanded, contentElementId, itemRef.current, accordion]);\n\n if (!accordion) {\n return {\n gridItemProps: {\n onAction: onAction\n ? () => {\n onAction?.(data);\n }\n : undefined,\n },\n children,\n };\n }\n\n const toggleAccordion = () => {\n setIsExpanded((current) => !current);\n onAction?.(data);\n };\n\n const propsContext: PropsContext = {\n Content: {\n id: dynamic((p) => (p.slot === \"bottom\" ? contentElementId : undefined)),\n wrapWith: dynamic((p) =>\n p.slot === \"bottom\" ? (\n <AccordionButton\n contentElementId={contentElementId}\n toggle={toggleAccordion}\n isExpanded={isExpanded}\n />\n ) : undefined,\n ),\n },\n };\n\n return {\n gridItemProps: {\n ref: itemRef,\n onAction: toggleAccordion,\n },\n children: (\n <PropsContextProvider\n props={propsContext}\n dependencies={[contentElementId, isExpanded]}\n >\n {children}\n </PropsContextProvider>\n ),\n };\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGridItemProps.mjs","sources":["../../../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { useList } from \"@/components/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n}\n\nexport const useGridItemProps = (props: P) => {\n const { data, children: childrenFromProps } = props;\n const list = useList();\n const itemView = list.itemView;\n const onAction = list.onAction;\n\n const [isExpanded, setIsExpanded] = useState(\n itemView?.defaultExpanded?.(data) ?? false,\n );\n const contentElementId = useId();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const accordion = list.accordion;\n const children = childrenFromProps ?? itemView?.render(data);\n\n useEffect(() => {\n if (accordion) {\n itemRef.current?.setAttribute(\"aria-expanded\", String(isExpanded));\n itemRef.current?.setAttribute(\"aria-controls\", contentElementId);\n }\n }, [isExpanded, contentElementId, itemRef.current, accordion]);\n\n if (!accordion) {\n return {\n gridItemProps: {\n onAction: onAction\n ? () => {\n onAction?.(data);\n }\n : undefined,\n },\n children,\n };\n }\n\n const toggleAccordion = () => {\n setIsExpanded((current) => !current);\n onAction?.(data);\n };\n\n const propsContext: PropsContext = {\n Content: {\n id: dynamic((p) => (p.slot === \"bottom\" ? contentElementId : undefined)),\n wrapWith: dynamic((p) =>\n p.slot === \"bottom\" ? (\n <AccordionButton\n contentElementId={contentElementId}\n toggle={toggleAccordion}\n isExpanded={isExpanded}\n />\n ) : undefined,\n ),\n },\n };\n\n return {\n gridItemProps: {\n ref: itemRef,\n onAction: toggleAccordion,\n },\n children: (\n <PropsContextProvider\n props={propsContext}\n dependencies={[contentElementId, isExpanded]}\n >\n {children}\n </PropsContextProvider>\n ),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAAa;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAU,iBAAA,EAAkB,GAAI,KAAA;AAC9C,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,WAAW,IAAA,CAAK,QAAA;AACtB,EAAA,MAAM,WAAW,IAAA,CAAK,QAAA;AAEtB,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAA;AAAA,IAClC,QAAA,EAAU,eAAA,GAAkB,IAAI,CAAA,IAAK;AAAA,GACvC;AACA,EAAA,MAAM,mBAAmB,KAAA,EAAM;AAC/B,EAAA,MAAM,OAAA,GAAU,OAAuB,IAAI,CAAA;AAE3C,EAAA,MAAM,YAAY,IAAA,CAAK,SAAA;AACvB,EAAA,MAAM,QAAA,GAAW,iBAAA,I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A,QAAA,kBACE,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,YAAA;AAAA,QACP,YAAA,EAAc,CAAC,gBAAA,EAAkB,UAAU,CAAA;AAAA,QAE1C;AAAA;AAAA;AACH,GAEJ;AACF;;;;"}
|
|
@@ -11,13 +11,14 @@ import { OptionsButton } from '../Items/components/Item/components/OptionsButton
|
|
|
11
11
|
import 'invariant';
|
|
12
12
|
import 'react-aria-components';
|
|
13
13
|
import 'react';
|
|
14
|
-
import '
|
|
14
|
+
import '../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
15
15
|
import '@tabler/icons-react';
|
|
16
16
|
import '../../../Icon/Icon.mjs';
|
|
17
17
|
import '../../../../views/IconView.mjs';
|
|
18
18
|
import '../../../Heading/Heading.mjs';
|
|
19
19
|
import '../../../Text/Text.mjs';
|
|
20
20
|
import 'react-aria';
|
|
21
|
+
import 'clsx';
|
|
21
22
|
import '../../../ColumnLayout/ColumnLayout.mjs';
|
|
22
23
|
import '../ListSummary/ListSummary.mjs';
|
|
23
24
|
import { useList } from '../../hooks/useList.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemView.mjs","sources":["../../../../../../../../src/components/List/components/ListItemView/ListItemView.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { useList } from \"@/components/List\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\n\nexport type ListItemViewProps = PropsWithChildren &\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">;\n\nexport const ListItemView = (props: ListItemViewProps) => {\n const { children, s, m, l } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnelId: \"button\",\n placement: \"bottom right\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnelId: \"button\",\n size: dynamic(() => (useList().viewMode === \"tiles\" ? \"s\" : \"m\")),\n },\n ActionGroup: {\n tunnelId: \"button\",\n Button: {\n tunnelId: null,\n },\n },\n Avatar: {\n tunnelId: \"avatar\",\n },\n Heading: {\n tunnelId: \"title\",\n },\n Text: {\n tunnelId: \"text\",\n },\n Content: {\n tunnelId: dynamic((p) => (p.slot === \"bottom\" ? \"bottom\" : undefined)),\n },\n Checkbox: {\n tunnelId: \"checkbox\",\n },\n };\n\n return (\n <TunnelProvider>\n <ListItemViewContentView\n viewMode={list.viewMode}\n title={<TunnelExit id=\"title\" />}\n avatar={<TunnelExit id=\"avatar\" />}\n button={<TunnelExit id=\"button\" />}\n subTitle={<TunnelExit id=\"text\" />}\n bottom={<TunnelExit id=\"bottom\" />}\n checkbox={<TunnelExit id=\"checkbox\" />}\n s={s}\n m={m}\n l={l}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ListItemViewContentView>\n </TunnelProvider>\n );\n};\n\nexport default ListItemView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemView.mjs","sources":["../../../../../../../../src/components/List/components/ListItemView/ListItemView.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { useList } from \"@/components/List\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\n\nexport type ListItemViewProps = PropsWithChildren &\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">;\n\nexport const ListItemView = (props: ListItemViewProps) => {\n const { children, s, m, l } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnelId: \"button\",\n placement: \"bottom right\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnelId: \"button\",\n size: dynamic(() => (useList().viewMode === \"tiles\" ? \"s\" : \"m\")),\n },\n ActionGroup: {\n tunnelId: \"button\",\n Button: {\n tunnelId: null,\n },\n },\n Avatar: {\n tunnelId: \"avatar\",\n },\n Heading: {\n tunnelId: \"title\",\n },\n Text: {\n tunnelId: \"text\",\n },\n Content: {\n tunnelId: dynamic((p) => (p.slot === \"bottom\" ? \"bottom\" : undefined)),\n },\n Checkbox: {\n tunnelId: \"checkbox\",\n },\n };\n\n return (\n <TunnelProvider>\n <ListItemViewContentView\n viewMode={list.viewMode}\n title={<TunnelExit id=\"title\" />}\n avatar={<TunnelExit id=\"avatar\" />}\n button={<TunnelExit id=\"button\" />}\n subTitle={<TunnelExit id=\"text\" />}\n bottom={<TunnelExit id=\"bottom\" />}\n checkbox={<TunnelExit id=\"checkbox\" />}\n s={s}\n m={m}\n l={l}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ListItemViewContentView>\n </TunnelProvider>\n );\n};\n\nexport default ListItemView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM,EAAE,QAAA,EAAU,CAAA,EAAG,CAAA,EAAG,GAAE,GAAI,KAAA;AAC9B,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,cAAA;AAAA,MACX,QAAA,kBAAU,GAAA,CAAC,aAAA,EAAA,EAAc,SAAA,EAAW,OAAO,MAAA,EAAQ;AAAA,K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A,EAAW,EAAA,EAAG,UAAA,EAAW,CAAA;AAAA,MACpC,CAAA;AAAA,MACA,CAAA;AAAA,MACA,CAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -4,17 +4,18 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import 'invariant';
|
|
5
5
|
import 'react-aria-components';
|
|
6
6
|
import 'react';
|
|
7
|
-
import
|
|
8
|
-
import '../../../../lib/propsContext/propsContext.mjs';
|
|
9
|
-
import '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
|
+
import '../../../IllustratedMessage/IllustratedMessage.mjs';
|
|
10
8
|
import '@tabler/icons-react';
|
|
11
9
|
import '../../../Icon/Icon.mjs';
|
|
12
10
|
import '../../../../views/IconView.mjs';
|
|
13
11
|
import '../../../Heading/Heading.mjs';
|
|
14
12
|
import '../../../Text/Text.mjs';
|
|
15
13
|
import 'react-aria';
|
|
14
|
+
import clsx from 'clsx';
|
|
16
15
|
import '@mittwald/react-tunnel';
|
|
17
16
|
import '../../../../views/ListItemViewContentView.mjs';
|
|
17
|
+
import '../../../../lib/propsContext/propsContext.mjs';
|
|
18
|
+
import '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
18
19
|
import '../../../../views/ButtonView.mjs';
|
|
19
20
|
import '../../../../views/ContextMenuTriggerView.mjs';
|
|
20
21
|
import '../../../ColumnLayout/ColumnLayout.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","sources":["../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport ListEmptyViewView from \"@/views/ListEmptyViewView\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport TableRowView from \"@/views/TableRowView\";\nimport TableCellView from \"@/views/TableCellView\";\nimport TableColumnView from \"@/views/TableColumnView\";\nimport { TableBodyLoadingView } from \"@/components/List/components/Table/components/TableBodyLoadingView\";\n\nexport const Table: FC = () => {\n const list = useList();\n const table = list.table;\n const listIsEmpty = list.useIsEmpty();\n\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!table) {\n return null;\n }\n\n if (listIsEmpty) {\n return <ListEmptyViewView />;\n }\n\n const rowAction = table.list.onAction;\n\n const tableClassName = clsx(\n styles.table,\n isLoading && styles.isLoading,\n table.componentProps.className,\n );\n\n const rows = list.items.entries.map((item) => (\n <TableRowView\n className={(props) =>\n clsx(\n styles.row,\n rowAction && styles.hasAction,\n table.body.row.componentProps.className,\n props.isSelected && styles.isSelected,\n )\n }\n key={item.id}\n id={item.id}\n onAction={rowAction ? () => rowAction(item.data) : undefined}\n {...table.body.row.componentProps}\n >\n {table.body.row?.cells.map((cell, i) => (\n <TableCellView key={i} {...cell.componentProps}>\n {cell.renderFn ? cell.renderFn(item.data, list) : undefined}\n </TableCellView>\n ))}\n </TableRowView>\n ));\n\n return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\n aria-hidden={isInitiallyLoading}\n aria-busy={isLoading}\n >\n <TableHeaderView {...table.header.componentProps}>\n {table.header.columns.map((col, i) => (\n <TableColumnView key={i} {...col.componentProps} />\n ))}\n </TableHeaderView>\n <TableBodyView {...table.body.componentProps}>\n {isInitiallyLoading ? <TableBodyLoadingView /> : rows}\n </TableBodyView>\n </TableView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.mjs","sources":["../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport ListEmptyViewView from \"@/views/ListEmptyViewView\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport TableRowView from \"@/views/TableRowView\";\nimport TableCellView from \"@/views/TableCellView\";\nimport TableColumnView from \"@/views/TableColumnView\";\nimport { TableBodyLoadingView } from \"@/components/List/components/Table/components/TableBodyLoadingView\";\n\nexport const Table: FC = () => {\n const list = useList();\n const table = list.table;\n const listIsEmpty = list.useIsEmpty();\n\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!table) {\n return null;\n }\n\n if (listIsEmpty) {\n return <ListEmptyViewView />;\n }\n\n const rowAction = table.list.onAction;\n\n const tableClassName = clsx(\n styles.table,\n isLoading && styles.isLoading,\n table.componentProps.className,\n );\n\n const rows = list.items.entries.map((item) => (\n <TableRowView\n className={(props) =>\n clsx(\n styles.row,\n rowAction && styles.hasAction,\n table.body.row.componentProps.className,\n props.isSelected && styles.isSelected,\n )\n }\n key={item.id}\n id={item.id}\n onAction={rowAction ? () => rowAction(item.data) : undefined}\n {...table.body.row.componentProps}\n >\n {table.body.row?.cells.map((cell, i) => (\n <TableCellView key={i} {...cell.componentProps}>\n {cell.renderFn ? cell.renderFn(item.data, list) : undefined}\n </TableCellView>\n ))}\n </TableRowView>\n ));\n\n return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\n aria-hidden={isInitiallyLoading}\n aria-busy={isLoading}\n >\n <TableHeaderView {...table.header.componentProps}>\n {table.header.columns.map((col, i) => (\n <TableColumnView key={i} {...col.componentProps} />\n ))}\n </TableHeaderView>\n <TableBodyView {...table.body.componentProps}>\n {isInitiallyLoading ? <TableBodyLoadingView /> : rows}\n </TableBodyView>\n </TableView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,QAAY,MAAM;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