@mittwald/flow-react-components 0.2.0-alpha.673 → 0.2.0-alpha.675
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 +12 -0
- package/dist/assets/doc-properties.json +207 -207
- package/dist/css/all.css +1 -1
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs +36 -188
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/components/src/components/CartesianChart/CartesianChart.module.scss.mjs +4 -2
- package/dist/js/components/src/components/CartesianChart/CartesianChart.module.scss.mjs.map +1 -1
- package/dist/js/components/src/components/CartesianChart/hooks/useChartClipRect.mjs +71 -0
- package/dist/js/components/src/components/CartesianChart/hooks/useChartClipRect.mjs.map +1 -0
- package/dist/js/components/src/components/Icon/components/icons/IconAscending.mjs +14 -0
- package/dist/js/components/src/components/Icon/components/icons/IconAscending.mjs.map +1 -0
- package/dist/js/components/src/components/Icon/components/icons/IconDescending.mjs +14 -0
- package/dist/js/components/src/components/Icon/components/icons/IconDescending.mjs.map +1 -0
- package/dist/js/components/src/components/Icon/components/icons/IconFeedback.mjs +14 -0
- package/dist/js/components/src/components/Icon/components/icons/IconFeedback.mjs.map +1 -0
- package/dist/js/components/src/components/Icon/components/icons/IconLanguage.mjs +14 -0
- package/dist/js/components/src/components/Icon/components/icons/IconLanguage.mjs.map +1 -0
- package/dist/js/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +4 -1
- package/dist/js/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs +1 -1
- package/dist/js/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs.map +1 -1
- package/dist/js/components/src/components/List/model/sorting/Sorting.mjs +2 -0
- package/dist/js/components/src/components/List/model/sorting/Sorting.mjs.map +1 -1
- package/dist/js/default.mjs +56 -52
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +58 -52
- package/dist/js/flr-universal.mjs.map +1 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts +6 -5
- package/dist/types/components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/hooks/useChartClipRect.d.ts +2 -0
- package/dist/types/components/CartesianChart/hooks/useChartClipRect.d.ts.map +1 -0
- package/dist/types/components/Icon/components/icons/IconAscending.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/IconAscending.d.ts.map +1 -0
- package/dist/types/components/Icon/components/icons/IconDescending.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/IconDescending.d.ts.map +1 -0
- package/dist/types/components/Icon/components/icons/IconFeedback.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/IconFeedback.d.ts.map +1 -0
- package/dist/types/components/Icon/components/icons/IconLanguage.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/IconLanguage.d.ts.map +1 -0
- package/dist/types/components/Icon/components/icons/index.d.ts +56 -52
- package/dist/types/components/Icon/components/icons/index.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.d.ts.map +1 -1
- package/dist/types/components/List/model/sorting/Sorting.d.ts +1 -0
- package/dist/types/components/List/model/sorting/Sorting.d.ts.map +1 -1
- package/dist/types/components/List/model/sorting/types.d.ts +1 -0
- package/dist/types/components/List/model/sorting/types.d.ts.map +1 -1
- package/dist/types/components/List/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/List/stories/EdgeCases.stories.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,204 +1,52 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { ResponsiveContainer, ComposedChart } from 'recharts';
|
|
5
|
+
import { useMemo, isValidElement } from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import styles from './CartesianChart.module.scss.mjs';
|
|
8
|
+
import { useChartClipRect } from './hooks/useChartClipRect.mjs';
|
|
9
|
+
import DivView from '../../views/DivView.mjs';
|
|
8
10
|
import { Wrap } from '../Wrap/Wrap.mjs';
|
|
9
|
-
import '../AccentBox/AccentBox.mjs';
|
|
10
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
11
|
-
import '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
12
|
-
import '../Button/Button.mjs';
|
|
13
|
-
import '@tabler/icons-react';
|
|
14
|
-
import '../Icon/Icon.mjs';
|
|
15
|
-
import '../../views/IconView.mjs';
|
|
16
|
-
import '@mittwald/react-tunnel';
|
|
17
|
-
import '../Activity/Activity.mjs';
|
|
18
|
-
import '../Action/Action.mjs';
|
|
19
|
-
import 'react-aria';
|
|
20
|
-
import '@react-aria/live-announcer';
|
|
21
|
-
import '../ActionGroup/ActionGroup.mjs';
|
|
22
|
-
import '../Alert/Alert.mjs';
|
|
23
|
-
import '../AlertBadge/AlertBadge.mjs';
|
|
24
|
-
import '../AlertText/AlertText.mjs';
|
|
25
|
-
import '../Align/Align.mjs';
|
|
26
|
-
import '../Autocomplete/Autocomplete.mjs';
|
|
27
|
-
import '../Avatar/Avatar.mjs';
|
|
28
|
-
import '../Badge/Badge.mjs';
|
|
29
|
-
import 'react-aria-components';
|
|
30
|
-
import 'mobx';
|
|
31
|
-
import '../../lib/controller/overlay/context.mjs';
|
|
32
|
-
import 'remeda';
|
|
33
|
-
import '@react-aria/utils';
|
|
34
|
-
import 'dot-prop';
|
|
35
|
-
import '../../lib/tokens/CategoricalColors.mjs';
|
|
36
|
-
import '../Text/Text.mjs';
|
|
37
|
-
import '@mittwald/react-use-promise';
|
|
38
|
-
import '../Heading/Heading.mjs';
|
|
39
|
-
import '../../views/SkeletonTextView.mjs';
|
|
40
|
-
import '../../views/LoadingSpinnerView.mjs';
|
|
41
|
-
import { CartesianGrid } from './components/CartesianGrid/CartesianGrid.mjs';
|
|
42
|
-
import '../Checkbox/Checkbox.mjs';
|
|
43
|
-
import '../CheckboxButton/CheckboxButton.mjs';
|
|
44
|
-
import '../CheckboxGroup/CheckboxGroup.mjs';
|
|
45
|
-
import 'react-syntax-highlighter';
|
|
46
|
-
import '../CopyButton/CopyButton.mjs';
|
|
47
|
-
import '../ColumnLayout/ColumnLayout.mjs';
|
|
48
|
-
import '../ComboBox/ComboBox.mjs';
|
|
49
|
-
import '../../lib/propsContext/components/ComponentPropsContextProvider.mjs';
|
|
50
|
-
import '../Content/Content.mjs';
|
|
51
|
-
import '../ContextMenu/ContextMenu.mjs';
|
|
52
|
-
import '../MenuItem/MenuItem.mjs';
|
|
53
|
-
import '../ContextMenu/components/ContextMenuTrigger/ContextMenuTrigger.mjs';
|
|
54
|
-
import '../ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs';
|
|
55
|
-
import '../ContextualHelp/ContextualHelp.mjs';
|
|
56
|
-
import '../ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs';
|
|
57
|
-
import '../CounterBadge/CounterBadge.mjs';
|
|
58
|
-
import '../CountryOptions/CountryOptions.mjs';
|
|
59
|
-
import '../DatePicker/DatePicker.mjs';
|
|
60
|
-
import '../DateRangePicker/DateRangePicker.mjs';
|
|
61
|
-
import '../FieldDescription/FieldDescription.mjs';
|
|
62
|
-
import '../FieldError/FieldError.mjs';
|
|
63
|
-
import '../FileCard/FileCard.mjs';
|
|
64
|
-
import '../FileCardList/FileCardList.mjs';
|
|
65
|
-
import '../FileDropZone/FileDropZone.mjs';
|
|
66
|
-
import '../FileField/FileField.mjs';
|
|
67
|
-
import '../Header/Header.mjs';
|
|
68
|
-
import '../IllustratedMessage/IllustratedMessage.mjs';
|
|
69
|
-
import '../Image/Image.mjs';
|
|
70
|
-
import '../Initials/Initials.mjs';
|
|
71
|
-
import '../Label/Label.mjs';
|
|
72
|
-
import '../LayoutCard/LayoutCard.mjs';
|
|
73
|
-
import '../OverlayTrigger/components/MenuTrigger/MenuTrigger.mjs';
|
|
74
|
-
import '../../views/DialogTriggerView.mjs';
|
|
75
|
-
import '../LightBox/LightBox.mjs';
|
|
76
|
-
import '../Link/Link.mjs';
|
|
77
|
-
import 'invariant';
|
|
78
|
-
import '../../views/ListItemViewContentView.mjs';
|
|
79
|
-
import '../../views/ButtonView.mjs';
|
|
80
|
-
import '../../views/ContextMenuTriggerView.mjs';
|
|
81
|
-
import '../List/components/ListSummary/ListSummary.mjs';
|
|
82
|
-
import '../List/listContext.mjs';
|
|
83
|
-
import '../List/List.mjs';
|
|
84
|
-
import 'react-markdown';
|
|
85
|
-
import 'remark-gfm';
|
|
86
|
-
import '../MarkdownEditor/MarkdownEditor.mjs';
|
|
87
|
-
import '../Message/Message.mjs';
|
|
88
|
-
import '../MessageThread/MessageThread.mjs';
|
|
89
|
-
import '../Modal/Modal.mjs';
|
|
90
|
-
import '../Navigation/Navigation.mjs';
|
|
91
|
-
import '../Navigation/components/NavigationGroup/NavigationGroup.mjs';
|
|
92
|
-
import '../NotificationProvider/NotificationProvider.mjs';
|
|
93
|
-
import 'luxon';
|
|
94
|
-
import '../NumberField/NumberField.mjs';
|
|
95
|
-
import '../Option/Option.mjs';
|
|
96
|
-
import '../../views/OverlayContentView.mjs';
|
|
97
|
-
import '../PasswordCreationField/PasswordCreationField.mjs';
|
|
98
|
-
import '../Popover/components/PopoverTrigger/PopoverTrigger.mjs';
|
|
99
|
-
import '../Popover/Popover.mjs';
|
|
100
|
-
import '../ProgressBar/ProgressBar.mjs';
|
|
101
|
-
import '../RadioGroup/RadioGroup.mjs';
|
|
102
|
-
import '../RadioGroup/components/Radio/Radio.mjs';
|
|
103
|
-
import '../RadioGroup/components/RadioButton/RadioButton.mjs';
|
|
104
|
-
import '../Rating/Rating.mjs';
|
|
105
|
-
import '../SearchField/SearchField.mjs';
|
|
106
|
-
import '../Section/Section.mjs';
|
|
107
|
-
import '../SegmentedControl/SegmentedControl.mjs';
|
|
108
|
-
import '../SegmentedControl/components/Segment/Segment.mjs';
|
|
109
|
-
import '../Select/Select.mjs';
|
|
110
|
-
import '../SettingsProvider/SettingsProvider.mjs';
|
|
111
|
-
import '../Slider/Slider.mjs';
|
|
112
|
-
import '../SuspenseTrigger/SuspenseTrigger.mjs';
|
|
113
|
-
import '../Switch/Switch.mjs';
|
|
114
|
-
import '../Tabs/Tabs.mjs';
|
|
115
|
-
import '../Tabs/components/Tab/context.mjs';
|
|
116
|
-
import '../TextArea/TextArea.mjs';
|
|
117
|
-
import '../TextField/TextField.mjs';
|
|
118
|
-
import '../TimeField/TimeField.mjs';
|
|
119
|
-
import '../TranslationProvider/TranslationProvider.mjs';
|
|
120
|
-
import 'react-truncate-inside';
|
|
121
11
|
|
|
122
12
|
const CartesianChart = (props) => {
|
|
123
|
-
const {
|
|
124
|
-
|
|
125
|
-
|
|
13
|
+
const { children, data, className, height, flexGrow, emptyView, ...rest } = props;
|
|
14
|
+
const { viewDimensions, ref: containerRef } = useChartClipRect();
|
|
15
|
+
const showEmptyView = !!((!data || data.length === 0) && emptyView);
|
|
16
|
+
const rootClassName = clsx(
|
|
17
|
+
styles.cartesianChart,
|
|
126
18
|
className,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const rootClassName = clsx(styles.cartesianChart, className);
|
|
133
|
-
const otherChildren = [];
|
|
134
|
-
const gridChildren = [];
|
|
135
|
-
Children.forEach(children, (child) => {
|
|
136
|
-
if (!child) return;
|
|
137
|
-
const element = child;
|
|
138
|
-
if (element.type === CartesianGrid) {
|
|
139
|
-
gridChildren.push(element);
|
|
140
|
-
} else {
|
|
141
|
-
otherChildren.push(element);
|
|
19
|
+
showEmptyView && styles.emptyView
|
|
20
|
+
);
|
|
21
|
+
const emptyElement = useMemo(() => {
|
|
22
|
+
if (isValidElement(emptyView)) {
|
|
23
|
+
return emptyView;
|
|
142
24
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const chartContainerRef = useRef(null);
|
|
146
|
-
const [viewDimensions, setViewDimensions] = useState(null);
|
|
147
|
-
useEffect(() => {
|
|
148
|
-
if (showEmptyView) {
|
|
149
|
-
const updateDimensions = () => {
|
|
150
|
-
const svg = chartContainerRef.current?.querySelector(
|
|
151
|
-
"svg"
|
|
152
|
-
);
|
|
153
|
-
if (!svg) return;
|
|
154
|
-
const clip = svg.querySelector("clipPath rect");
|
|
155
|
-
if (clip) {
|
|
156
|
-
const x = parseFloat(clip.getAttribute("x") ?? "0");
|
|
157
|
-
const y = parseFloat(clip.getAttribute("y") ?? "0");
|
|
158
|
-
const width = parseFloat(clip.getAttribute("width") ?? "0");
|
|
159
|
-
const height2 = parseFloat(clip.getAttribute("height") ?? "0");
|
|
160
|
-
setViewDimensions({ x, y, width, height: height2 });
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
updateDimensions();
|
|
164
|
-
const container = chartContainerRef.current;
|
|
165
|
-
const observer = new ResizeObserver(updateDimensions);
|
|
166
|
-
if (container) observer.observe(container);
|
|
167
|
-
return () => {
|
|
168
|
-
observer.disconnect();
|
|
169
|
-
};
|
|
25
|
+
if (!emptyView) {
|
|
26
|
+
return;
|
|
170
27
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
28
|
+
console.warn(
|
|
29
|
+
"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView."
|
|
30
|
+
);
|
|
31
|
+
return null;
|
|
32
|
+
}, [emptyView]);
|
|
33
|
+
return /* @__PURE__ */ jsx(Wrap, { if: height, children: /* @__PURE__ */ jsx("div", { style: { height, flex: flexGrow ? 1 : void 0 }, children: /* @__PURE__ */ jsx(
|
|
34
|
+
ResponsiveContainer,
|
|
174
35
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
{
|
|
188
|
-
data,
|
|
189
|
-
className: rootClassName,
|
|
190
|
-
...rest,
|
|
191
|
-
children: [
|
|
192
|
-
!showEmptyView && gridChildren,
|
|
193
|
-
otherChildren,
|
|
194
|
-
showEmptyView && viewDimensions && /* @__PURE__ */ jsx("foreignObject", { ...viewDimensions, children: /* @__PURE__ */ jsx("div", { className: styles.emptyViewContainer, children: /* @__PURE__ */ jsx(EmptyView, { data }) }) })
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
}
|
|
199
|
-
)
|
|
36
|
+
initialDimension: {
|
|
37
|
+
// fix warning on initial render
|
|
38
|
+
width: 1,
|
|
39
|
+
height: 1
|
|
40
|
+
},
|
|
41
|
+
width: height ? void 0 : "100%",
|
|
42
|
+
aspect: height ? void 0 : 3,
|
|
43
|
+
ref: containerRef,
|
|
44
|
+
children: /* @__PURE__ */ jsxs(ComposedChart, { data, className: rootClassName, ...rest, children: [
|
|
45
|
+
children,
|
|
46
|
+
showEmptyView && viewDimensions && /* @__PURE__ */ jsx("foreignObject", { ...viewDimensions, children: /* @__PURE__ */ jsx(DivView, { className: styles.emptyViewContainer, children: emptyElement }) })
|
|
47
|
+
] })
|
|
200
48
|
}
|
|
201
|
-
) });
|
|
49
|
+
) }) });
|
|
202
50
|
};
|
|
203
51
|
|
|
204
52
|
export { CartesianChart };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.mjs","sources":["../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CartesianChart.mjs","sources":["../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport React, {\n type ComponentProps,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"data\" | \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n height?: string;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\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 { children, data, className, height, flexGrow, emptyView, ...rest } =\n props;\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n className,\n showEmptyView && styles.emptyView,\n );\n\n const emptyElement = useMemo(() => {\n if (isValidElement(emptyView)) {\n return emptyView;\n }\n\n if (!emptyView) {\n return;\n }\n\n console.warn(\n \"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.\",\n );\n return null;\n }, [emptyView]);\n\n return (\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart data={data} className={rootClassName} {...rest}>\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {emptyElement}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n );\n};\n\nexport default CartesianChart;\n"],"names":[],"mappings":";;;;;;;;;AAwCO,M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AAK,YAAA;AAAA,MAEL,+BAAC,aAAA,EAAA,EAAc,IAAA,EAAY,SAAA,EAAW,aAAA,EAAgB,GAAG,IAAA,EACtD,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,QACA,aAAA,IAAiB,cAAA,oBAChB,GAAA,CAAC,eAAA,EAAA,EAAe,GAAG,cAAA,EACjB,QAAA,kBAAA,GAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,MAAA,CAAO,kBAAA,EACxB,QAAA,EAAA,YAAA,EACH,CAAA,EACF;AAAA,OAAA,EAEJ;AAAA;AAAA,KAEJ,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
const cartesianChart = "flow--cartesian-chart";
|
|
4
4
|
const emptyViewContainer = "flow--cartesian-chart--empty-view-container";
|
|
5
|
+
const emptyView = "flow--cartesian-chart--empty-view";
|
|
5
6
|
const styles = {
|
|
6
7
|
cartesianChart: cartesianChart,
|
|
7
|
-
emptyViewContainer: emptyViewContainer
|
|
8
|
+
emptyViewContainer: emptyViewContainer,
|
|
9
|
+
emptyView: emptyView
|
|
8
10
|
};
|
|
9
11
|
|
|
10
|
-
export { cartesianChart, styles as default, emptyViewContainer };
|
|
12
|
+
export { cartesianChart, styles as default, emptyView, emptyViewContainer };
|
|
11
13
|
//# sourceMappingURL=CartesianChart.module.scss.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartesianChart.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { useCallbackRef } from 'use-callback-ref';
|
|
5
|
+
|
|
6
|
+
const useChartClipRect = () => {
|
|
7
|
+
const observerRef = useRef(null);
|
|
8
|
+
const svgRef = useRef(null);
|
|
9
|
+
const [viewDimensions, setViewDimensions] = useState(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
return () => {
|
|
12
|
+
if (observerRef.current) {
|
|
13
|
+
observerRef.current.disconnect();
|
|
14
|
+
observerRef.current = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
const attachContainerRef = useCallbackRef(
|
|
19
|
+
null,
|
|
20
|
+
(div) => {
|
|
21
|
+
if (observerRef.current) {
|
|
22
|
+
observerRef.current.disconnect();
|
|
23
|
+
observerRef.current = null;
|
|
24
|
+
}
|
|
25
|
+
const svg = div?.querySelector("svg") ?? null;
|
|
26
|
+
svgRef.current = svg;
|
|
27
|
+
if (!svg) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const clipRect = svg.querySelector(
|
|
31
|
+
"clipPath rect"
|
|
32
|
+
);
|
|
33
|
+
if (!clipRect) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const observer = new MutationObserver((mutations) => {
|
|
37
|
+
const newViewDimensions = mutations.reduce(
|
|
38
|
+
(acc, mutation) => {
|
|
39
|
+
if (mutation.type !== "attributes" || !mutation.attributeName) {
|
|
40
|
+
return acc;
|
|
41
|
+
}
|
|
42
|
+
const target = mutation.target;
|
|
43
|
+
const attr = mutation.attributeName;
|
|
44
|
+
const value = target.getAttribute(attr);
|
|
45
|
+
if (value) {
|
|
46
|
+
acc = {
|
|
47
|
+
...acc,
|
|
48
|
+
[attr]: value
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return acc;
|
|
52
|
+
},
|
|
53
|
+
viewDimensions ?? { x: "0", y: "0", width: "0", height: "0" }
|
|
54
|
+
);
|
|
55
|
+
setViewDimensions(newViewDimensions);
|
|
56
|
+
});
|
|
57
|
+
observer.observe(clipRect, {
|
|
58
|
+
attributes: true,
|
|
59
|
+
attributeFilter: ["x", "y", "width", "height"],
|
|
60
|
+
attributeOldValue: false,
|
|
61
|
+
childList: false,
|
|
62
|
+
subtree: false
|
|
63
|
+
});
|
|
64
|
+
observerRef.current = observer;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
return { viewDimensions, ref: attachContainerRef };
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { useChartClipRect };
|
|
71
|
+
//# sourceMappingURL=useChartClipRect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartClipRect.mjs","sources":["../../../../../../../src/components/CartesianChart/hooks/useChartClipRect.ts"],"sourcesContent":["import { type SVGProps, useEffect, useRef, useState } from \"react\";\nimport { useCallbackRef } from \"use-callback-ref\";\n\n/** @internal * */\nexport type ViewDimensions = Pick<\n SVGProps<SVGForeignObjectElement>,\n \"x\" | \"y\" | \"width\" | \"height\"\n> | null;\n\n/** @internal * */\nexport const useChartClipRect = () => {\n const observerRef = useRef<MutationObserver>(null);\n const svgRef = useRef<SVGSVGElement>(null);\n\n const [viewDimensions, setViewDimensions] = useState<ViewDimensions>(null);\n\n useEffect(() => {\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n observerRef.current = null;\n }\n };\n }, []);\n\n const attachContainerRef = useCallbackRef(\n null,\n (div: HTMLDivElement | null) => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n observerRef.current = null;\n }\n\n const svg = div?.querySelector(\"svg\") ?? null;\n svgRef.current = svg;\n\n if (!svg) {\n return;\n }\n\n const clipRect = svg.querySelector(\n \"clipPath rect\",\n ) as SVGRectElement | null;\n if (!clipRect) {\n return;\n }\n\n const observer = new MutationObserver((mutations) => {\n const newViewDimensions: ViewDimensions = mutations.reduce(\n (acc, mutation) => {\n if (mutation.type !== \"attributes\" || !mutation.attributeName) {\n return acc;\n }\n\n const target = mutation.target as SVGRectElement;\n const attr = mutation.attributeName as keyof ViewDimensions;\n const value = target.getAttribute(attr);\n\n if (value) {\n acc = {\n ...acc,\n [attr]: value,\n };\n }\n\n return acc;\n },\n viewDimensions ?? { x: \"0\", y: \"0\", width: \"0\", height: \"0\" },\n );\n\n setViewDimensions(newViewDimensions);\n });\n\n observer.observe(clipRect, {\n attributes: true,\n attributeFilter: [\"x\", \"y\", \"width\", \"height\"],\n attributeOldValue: false,\n childList: false,\n subtree: false,\n });\n\n observerRef.current = observer;\n },\n );\n\n return { viewDimensions, ref: attachContainerRef };\n};\n"],"names":[],"mappings":";;;AAUO,MAAM,mBAAmB,MAAM;AACpC,EAAA,MAAM,WAAA,GAAc,OAAyB,IAAI,CAAA;AACjD,EAAA,MAAM,MAAA,GAAS,OAAsB,IAAI,CAAA;AAEzC,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAyB,IAAI,CAAA;AAEzE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,YAAY,OAAA,EAAS;AACvB,QAAA,WAAA,CAAY,QAAQ,UAAA,EAAW;AAC/B,QAAA,WAAA,CAAY,OAAA,GAAU,IAAA;AAAA,MACxB;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,MAAM,kBAAA,GAAqB,cAAA;AAAA,IACzB,IAAA;AAAA,IACA,CAAC,GAAA,KAA+B;AAC9B,MAAA,IAAI,YAAY,OAAA,EAAS;AACvB,QAAA,WAAA,CAAY,QAAQ,UAAA,EAAW;AAC/B,QAAA,WAAA,CAAY,OAAA,GAAU,IAAA;AAAA,MACxB;AAEA,MAAA,MAAM,GAAA,GAAM,GAAA,EAAK,aAAA,CAAc,KAAK,CAAA,IAAK,IAAA;AACzC,MAAA,MAAA,CAAO,OAAA,GAAU,GAAA;AAEjB,MAAA,IAAI,CAAC,GAAA,EAAK;AACR,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,WAAW,GAAA,CAAI,aAAA;AAAA,QACnB;AAAA,OACF;AACA,MAAA,IAAI,CAA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
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { IconSortAscending } from '@tabler/icons-react';
|
|
6
|
+
import '../../Icon.mjs';
|
|
7
|
+
import IconView from '../../../../views/IconView.mjs';
|
|
8
|
+
|
|
9
|
+
const IconAscending = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(IconView, { ...props, children: /* @__PURE__ */ jsx(IconSortAscending, {}) });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { IconAscending };
|
|
14
|
+
//# sourceMappingURL=IconAscending.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconAscending.mjs","sources":["../../../../../../../../src/components/Icon/components/icons/IconAscending.tsx"],"sourcesContent":["/* auto-generated file */\nimport React, { type ComponentProps, type FC } from \"react\";\nimport { IconSortAscending as Tabler } from \"@tabler/icons-react\";\nimport { type Icon } from \"@/components/Icon\";\nimport View from \"@/views/IconView\";\n\nexport const IconAscending: FC<\n Omit<ComponentProps<typeof Icon>, \"children\">\n> = (props) => {\n return (\n <View {...props}>\n <Tabler />\n </View>\n );\n};\n\nexport default IconAscending;\n"],"names":["View","Tabler"],"mappings":";;;;;;AAMO,MAAM,aAAA,GAET,CAAC,KAAA,KAAU;AACb,EAAA,2BACGA,QAAA,EAAA,EAAM,GAAG,KAAA,EACR,QAAA,kBAAA,GAAA,CAACC,qBAAO,CAAA,EACV,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { IconSortDescending } from '@tabler/icons-react';
|
|
6
|
+
import '../../Icon.mjs';
|
|
7
|
+
import IconView from '../../../../views/IconView.mjs';
|
|
8
|
+
|
|
9
|
+
const IconDescending = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(IconView, { ...props, children: /* @__PURE__ */ jsx(IconSortDescending, {}) });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { IconDescending };
|
|
14
|
+
//# sourceMappingURL=IconDescending.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconDescending.mjs","sources":["../../../../../../../../src/components/Icon/components/icons/IconDescending.tsx"],"sourcesContent":["/* auto-generated file */\nimport React, { type ComponentProps, type FC } from \"react\";\nimport { IconSortDescending as Tabler } from \"@tabler/icons-react\";\nimport { type Icon } from \"@/components/Icon\";\nimport View from \"@/views/IconView\";\n\nexport const IconDescending: FC<\n Omit<ComponentProps<typeof Icon>, \"children\">\n> = (props) => {\n return (\n <View {...props}>\n <Tabler />\n </View>\n );\n};\n\nexport default IconDescending;\n"],"names":["View","Tabler"],"mappings":";;;;;;AAMO,MAAM,cAAA,GAET,CAAC,KAAA,KAAU;AACb,EAAA,2BACGA,QAAA,EAAA,EAAM,GAAG,KAAA,EACR,QAAA,kBAAA,GAAA,CAACC,sBAAO,CAAA,EACV,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { IconMessageChatbot } from '@tabler/icons-react';
|
|
6
|
+
import '../../Icon.mjs';
|
|
7
|
+
import IconView from '../../../../views/IconView.mjs';
|
|
8
|
+
|
|
9
|
+
const IconFeedback = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(IconView, { ...props, children: /* @__PURE__ */ jsx(IconMessageChatbot, {}) });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { IconFeedback };
|
|
14
|
+
//# sourceMappingURL=IconFeedback.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconFeedback.mjs","sources":["../../../../../../../../src/components/Icon/components/icons/IconFeedback.tsx"],"sourcesContent":["/* auto-generated file */\nimport React, { type ComponentProps, type FC } from \"react\";\nimport { IconMessageChatbot as Tabler } from \"@tabler/icons-react\";\nimport { type Icon } from \"@/components/Icon\";\nimport View from \"@/views/IconView\";\n\nexport const IconFeedback: FC<Omit<ComponentProps<typeof Icon>, \"children\">> = (\n props,\n) => {\n return (\n <View {...props}>\n <Tabler />\n </View>\n );\n};\n\nexport default IconFeedback;\n"],"names":["View","Tabler"],"mappings":";;;;;;AAMO,MAAM,YAAA,GAAkE,CAC7E,KAAA,KACG;AACH,EAAA,2BACGA,QAAA,EAAA,EAAM,GAAG,KAAA,EACR,QAAA,kBAAA,GAAA,CAACC,sBAAO,CAAA,EACV,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { IconLanguage as IconLanguage$1 } from '@tabler/icons-react';
|
|
6
|
+
import '../../Icon.mjs';
|
|
7
|
+
import IconView from '../../../../views/IconView.mjs';
|
|
8
|
+
|
|
9
|
+
const IconLanguage = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(IconView, { ...props, children: /* @__PURE__ */ jsx(IconLanguage$1, {}) });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { IconLanguage };
|
|
14
|
+
//# sourceMappingURL=IconLanguage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconLanguage.mjs","sources":["../../../../../../../../src/components/Icon/components/icons/IconLanguage.tsx"],"sourcesContent":["/* auto-generated file */\nimport React, { type ComponentProps, type FC } from \"react\";\nimport { IconLanguage as Tabler } from \"@tabler/icons-react\";\nimport { type Icon } from \"@/components/Icon\";\nimport View from \"@/views/IconView\";\n\nexport const IconLanguage: FC<Omit<ComponentProps<typeof Icon>, \"children\">> = (\n props,\n) => {\n return (\n <View {...props}>\n <Tabler />\n </View>\n );\n};\n\nexport default IconLanguage;\n"],"names":["View","Tabler"],"mappings":";;;;;;AAMO,MAAM,YAAA,GAAkE,CAC7E,KAAA,KACG;AACH,EAAA,2BACGA,QAAA,EAAA,EAAM,GAAG,KAAA,EACR,QAAA,kBAAA,GAAA,CAACC,kBAAO,CAAA,EACV,CAAA;AAEJ;;;;"}
|
|
@@ -6,10 +6,12 @@ import locales from '../../../../../../../../_virtual/_.locale.json@8d5024994f97
|
|
|
6
6
|
import { Translate } from '../../../../../../lib/react/components/Translate/Translate.mjs';
|
|
7
7
|
import TextView from '../../../../../../views/TextView.mjs';
|
|
8
8
|
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
9
|
+
import { IconAscending } from '../../../../../Icon/components/icons/IconAscending.mjs';
|
|
9
10
|
import 'react';
|
|
10
11
|
import '@tabler/icons-react';
|
|
11
12
|
import '../../../../../Icon/Icon.mjs';
|
|
12
13
|
import '../../../../../../views/IconView.mjs';
|
|
14
|
+
import { IconDescending } from '../../../../../Icon/components/icons/IconDescending.mjs';
|
|
13
15
|
import { IconSorting } from '../../../../../Icon/components/icons/IconSorting.mjs';
|
|
14
16
|
import headerStyles from '../../Header.module.css.mjs';
|
|
15
17
|
import { SortingMenuItem } from './SortingMenuItem.mjs';
|
|
@@ -24,6 +26,7 @@ const SortingContextMenu = () => {
|
|
|
24
26
|
}
|
|
25
27
|
const labelSorting = list.visibleSorting.find((s) => s.isSorted());
|
|
26
28
|
const text = /* @__PURE__ */ jsx(TextView, { children: labelSorting ? /* @__PURE__ */ jsx(Fragment, { children: labelSorting.name ?? labelSorting.property }) : /* @__PURE__ */ jsx(Translate, { locales, children: "list.sorting" }) });
|
|
29
|
+
const icon = !labelSorting ? /* @__PURE__ */ jsx(IconSorting, {}) : labelSorting?.direction === "asc" ? /* @__PURE__ */ jsx(IconAscending, {}) : /* @__PURE__ */ jsx(IconDescending, {});
|
|
27
30
|
return /* @__PURE__ */ jsxs(ContextMenuTriggerView, { children: [
|
|
28
31
|
/* @__PURE__ */ jsxs(
|
|
29
32
|
ButtonView,
|
|
@@ -33,7 +36,7 @@ const SortingContextMenu = () => {
|
|
|
33
36
|
className: headerStyles.hideOnMobile,
|
|
34
37
|
children: [
|
|
35
38
|
text,
|
|
36
|
-
|
|
39
|
+
icon
|
|
37
40
|
]
|
|
38
41
|
}
|
|
39
42
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingContextMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { Translate } from \"@/lib/react/components/Translate\";\nimport TextView from \"@/views/TextView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport {
|
|
1
|
+
{"version":3,"file":"SortingContextMenu.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { Translate } from \"@/lib/react/components/Translate\";\nimport TextView from \"@/views/TextView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport {\n IconAscending,\n IconDescending,\n IconSorting,\n} from \"@/components/Icon/components/icons\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { SortingMenuItem } from \"@/components/List/components/Header/components/SortingContextMenu/SortingMenuItem\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\nexport const SortingContextMenu: FC = () => {\n const list = useList();\n\n const sortingItems = list.visibleSorting.map((s) => (\n <SortingMenuItem sorting={s} key={s.id} />\n ));\n\n if (sortingItems.length === 0) {\n return null;\n }\n\n const labelSorting = list.visibleSorting.find((s) => s.isSorted());\n\n const text = (\n <TextView>\n {labelSorting ? (\n <>{labelSorting.name ?? labelSorting.property}</>\n ) : (\n <Translate locales={locales}>list.sorting</Translate>\n )}\n </TextView>\n );\n\n const icon = !labelSorting ? (\n <IconSorting />\n ) : labelSorting?.direction === \"asc\" ? (\n <IconAscending />\n ) : (\n <IconDescending />\n );\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n className={styles.hideOnMobile}\n >\n {text}\n {icon}\n </ButtonView>\n <ContextMenuView\n selectionMode=\"single\"\n selectedKeys={labelSorting ? [labelSorting.id] : []}\n >\n {sortingItems}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,MAAM,qBAAyB,MAAM;AAC1C,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,YAAA,GAAe,IAAA,CAAK,cAAA,CAAe,GAAA,CAAI,CAAC,CAAA,qBAC5C,GAAA,CAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,CAAA,EAAA,EAAQ,CAAA,CAAE,EAAI,CACzC,CAAA;AAED,EAAA,IAAI,YAAA,CAAa,WAAW,CAAA,EAAG;AAC7B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,YAAA,GAAe,KAAK,cAAA,CAAe,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,UAAU,CAAA;AAEjE,EAAA,MAAM,IAAA,mBACJ,GAAA,CAAC,QAAA,EAAA,EACE,QAAA,EAAA,YAAA,mCACI,QAAA,EAAA,YAAA,CAAa,IAAA,IAAQ,YAAA,CAAa,QAAA,EAAS,CAAA,mBAE9C,GAAA,CAAC,SAAA,EAAA,EAAU,OAAA,EAAkB,0BAAY,CAAA,EAE7C,CAAA;AAGF,EAAA,MAAM,IAAA,GAAO,CAAC,YAAA,mBACZ,GAAA,CAAC,WAAA,EAAA,EAAY,CAAA,GACX,YAAA,EAAc,SAAA,KAAc,KAAA,mBAC9B,GAAA,CAAC,aAAA,EAAA,EAAc,CAAA,uBAEd,cAAA,EAAA,EAAe,CAAA;AAGlB,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,WAAWA,YAAA,CAAO,YAAA;AAAA,QAEjB,QAAA,EAAA;AAAA,UAAA,IAAA;AAAA,UACA;AAAA;AAAA;AAAA,KACH;AAAA,oBACA,GAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAc,QAAA;AAAA,QACd,cAAc,YAAA,GAAe,CAAC,YAAA,CAAa,EAAE,IAAI,EAAC;AAAA,QAEjD,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/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;
|
|
1
|
+
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/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} ${sorting.directionName ?? \"\"}`.trim()}\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,CAAA,EAAG,OAAA,CAAQ,IAAA,IAAQ,OAAA,CAAQ,QAAQ,IAAI,OAAA,CAAQ,aAAA,IAAiB,EAAE,CAAA,CAAA,CAAG,IAAA;AAAK;AAAA,GAC7E;AAEJ;;;;"}
|
|
@@ -10,6 +10,7 @@ class Sorting {
|
|
|
10
10
|
list;
|
|
11
11
|
property;
|
|
12
12
|
name;
|
|
13
|
+
directionName;
|
|
13
14
|
direction;
|
|
14
15
|
defaultEnabled;
|
|
15
16
|
customSortingFn;
|
|
@@ -17,6 +18,7 @@ class Sorting {
|
|
|
17
18
|
this.list = list;
|
|
18
19
|
this.property = shape.property;
|
|
19
20
|
this.name = shape.name;
|
|
21
|
+
this.directionName = shape.directionName;
|
|
20
22
|
this.direction = shape.direction ?? "asc";
|
|
21
23
|
const storedDefaultEnabled = this.getStoredDefaultEnabled();
|
|
22
24
|
this.defaultEnabled = shape.defaultEnabled === "hidden" ? "hidden" : storedDefaultEnabled ?? shape.defaultEnabled ?? false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sorting.mjs","sources":["../../../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type List from \"@/components/List/model/List\";\nimport type {\n SortingDefaultMode,\n SortingShape,\n} from \"@/components/List/model/sorting/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type {\n Column,\n ColumnDef,\n ColumnSort,\n SortDirection,\n SortingFn,\n} from \"@tanstack/react-table\";\nimport z from \"zod\";\n\nexport class Sorting<T> {\n public static readonly storageSchema = z\n .object({\n direction: z.enum([\"asc\", \"desc\"]),\n property: z.string().or(z.number()),\n })\n .optional();\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly name?: string;\n public readonly direction: SortDirection;\n public readonly defaultEnabled: SortingDefaultMode;\n public readonly customSortingFn?: SortingFn<T>;\n\n public constructor(list: List<T>, shape: SortingShape<T>) {\n this.list = list;\n this.property = shape.property;\n this.name = shape.name;\n this.direction = shape.direction ?? \"asc\";\n const storedDefaultEnabled = this.getStoredDefaultEnabled();\n this.defaultEnabled =\n shape.defaultEnabled === \"hidden\"\n ? \"hidden\"\n : (storedDefaultEnabled ?? shape.defaultEnabled ?? false);\n this.customSortingFn = shape.customSortingFn;\n }\n\n private getStoredDefaultEnabled() {\n const storedSorting = this.list.getStoredSortingDefaultSetting();\n if (!storedSorting) {\n return undefined;\n }\n return (\n storedSorting.property === this.property &&\n storedSorting.direction === this.direction\n );\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableSorting = true;\n if (this.customSortingFn) {\n def.sortingFn = this.customSortingFn;\n }\n }\n\n public getReactTableColumnSort(): ColumnSort {\n return {\n id: this.property as string,\n desc: this.direction === \"desc\",\n };\n }\n\n public isSorted(): boolean {\n const col = this.getTableColumn();\n return col.getIsSorted() == this.direction;\n }\n\n public getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public enable(): void {\n this.list.reactTable\n .getTableColumn(this.property)\n .toggleSorting(this.direction === \"desc\", false);\n this.list.storeSortingSettings(this);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).clearSorting();\n }\n\n public get id(): string {\n return `${this.getTableColumn().id}:${this.direction}`;\n }\n}\n"],"names":[],"mappings":";;AAeO,MAAM,OAAA,CAAW;AAAA,EACtB,OAAuB,aAAA,GAAgB,CAAA,CACpC,MAAA,CAAO;AAAA,IACN,WAAW,CAAA,CAAE,IAAA,CAAK,CAAC,KAAA,EAAO,MAAM,CAAC,CAAA;AAAA,IACjC,UAAU,CAAA,CAAE,MAAA,GAAS,EAAA,CAAG,CAAA,CAAE,QAAQ;AAAA,GACnC,EACA,QAAA,EAAS;AAAA,EACI,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EAET,WAAA,CAAY,MAAe,KAAA,EAAwB;AACxD,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAA,CAAM,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,KAAA,CAAM,IAAA;AAClB,IAAA,IAAA,CAAK,SAAA,GAAY,MAAM,SAAA,IAAa,KAAA;AACpC,IA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AAK,SAAA,KAAc,MAAA,EAAQ,KAAK,CAAA;AACjD,IAAA,IAAA,CAAK,IAAA,CAAK,qBAAqB,IAAI,CAAA;AAAA,EACrC;AAAA,EAEO,KAAA,GAAc;AACnB,IAAA,IAAA,CAAK,KAAK,UAAA,CAAW,cAAA,CAAe,IAAA,CAAK,QAAQ,EAAE,YAAA,EAAa;AAAA,EAClE;AAAA,EAEA,IAAW,EAAA,GAAa;AACtB,IAAA,OAAO,GAAG,IAAA,CAAK,cAAA,GAAiB,EAAE,CAAA,CAAA,EAAI,KAAK,SAAS,CAAA,CAAA;AAAA,EACtD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"Sorting.mjs","sources":["../../../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type List from \"@/components/List/model/List\";\nimport type {\n SortingDefaultMode,\n SortingShape,\n} from \"@/components/List/model/sorting/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type {\n Column,\n ColumnDef,\n ColumnSort,\n SortDirection,\n SortingFn,\n} from \"@tanstack/react-table\";\nimport z from \"zod\";\n\nexport class Sorting<T> {\n public static readonly storageSchema = z\n .object({\n direction: z.enum([\"asc\", \"desc\"]),\n property: z.string().or(z.number()),\n })\n .optional();\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly name?: string;\n public readonly directionName?: string;\n public readonly direction: SortDirection;\n public readonly defaultEnabled: SortingDefaultMode;\n public readonly customSortingFn?: SortingFn<T>;\n\n public constructor(list: List<T>, shape: SortingShape<T>) {\n this.list = list;\n this.property = shape.property;\n this.name = shape.name;\n this.directionName = shape.directionName;\n this.direction = shape.direction ?? \"asc\";\n const storedDefaultEnabled = this.getStoredDefaultEnabled();\n this.defaultEnabled =\n shape.defaultEnabled === \"hidden\"\n ? \"hidden\"\n : (storedDefaultEnabled ?? shape.defaultEnabled ?? false);\n this.customSortingFn = shape.customSortingFn;\n }\n\n private getStoredDefaultEnabled() {\n const storedSorting = this.list.getStoredSortingDefaultSetting();\n if (!storedSorting) {\n return undefined;\n }\n return (\n storedSorting.property === this.property &&\n storedSorting.direction === this.direction\n );\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableSorting = true;\n if (this.customSortingFn) {\n def.sortingFn = this.customSortingFn;\n }\n }\n\n public getReactTableColumnSort(): ColumnSort {\n return {\n id: this.property as string,\n desc: this.direction === \"desc\",\n };\n }\n\n public isSorted(): boolean {\n const col = this.getTableColumn();\n return col.getIsSorted() == this.direction;\n }\n\n public getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public enable(): void {\n this.list.reactTable\n .getTableColumn(this.property)\n .toggleSorting(this.direction === \"desc\", false);\n this.list.storeSortingSettings(this);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).clearSorting();\n }\n\n public get id(): string {\n return `${this.getTableColumn().id}:${this.direction}`;\n }\n}\n"],"names":[],"mappings":";;AAeO,MAAM,OAAA,CAAW;AAAA,EACtB,OAAuB,aAAA,GAAgB,CAAA,CACpC,MAAA,CAAO;AAAA,IACN,WAAW,CAAA,CAAE,IAAA,CAAK,CAAC,KAAA,EAAO,MAAM,CAAC,CAAA;AAAA,IACjC,UAAU,CAAA,CAAE,MAAA,GAAS,EAAA,CAAG,CAAA,CAAE,QAAQ;AAAA,GACnC,EACA,QAAA,EAAS;AAAA,EACI,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EAET,WAAA,CAAY,MAAe,KAAA,EAAwB;AACxD,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAA,CAAM,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,KAAA,CAAM,IAAA;AAClB,IAAA,IAAA,CAAK,gBAAgB,KAAA,CAAM,aAAA;AAC3B,IAAA,IAAA,CAAK,SAAA,GAAY,MAAM,SAAA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