@m4l/components 9.38.0 → 9.39.0
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/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
- package/components/DynamicFilter/DynamicFilter.styles.js +82 -60
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +1 -0
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -1
- package/components/DynamicFilter/hooks/useChipsOverflow.js +50 -44
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +1 -0
- package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicFilter/slots/SlotsEnum.js +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +3 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +43 -39
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +26 -19
- package/components/DynamicSort/DynamicSort.js +6 -6
- package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
- package/components/DynamicSort/DynamicSort.styles.js +40 -14
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +3 -0
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
- package/components/DynamicSort/slots/DynamicSortSlots.js +44 -40
- package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -0
- package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicSort/slots/SlotsEnum.js +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +2 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +70 -54
- package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts +5 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts.map +1 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +23 -21
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +15 -17
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +2 -0
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +58 -46
- package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +30 -30
- package/components/DynamicSort/types.d.ts +6 -0
- package/components/DynamicSort/types.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/constants.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/constants.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/constants.js +4 -3
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +2 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +2 -2
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +19 -15
- package/hooks/useDynamicFilterAndSort/styles.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/styles.js +58 -37
- package/hooks/useDynamicFilterAndSort/types.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +204 -172
- package/package.json +8 -8
|
@@ -1,196 +1,215 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useEnvironment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { DynamicFilter as
|
|
5
|
-
import { DynamicSort as
|
|
6
|
-
import { ToggleIconButton as
|
|
7
|
-
import { getPropDataTestId as
|
|
8
|
-
import { COOKIE_APPLIED_FILTERS as
|
|
9
|
-
import { ICON_PATH_FILTER as
|
|
10
|
-
import { DynamicFilterAndSortSlots as
|
|
11
|
-
import { StackLeftActionsStyled as
|
|
12
|
-
import { deepEqual as
|
|
13
|
-
import { getPurgedCookie as
|
|
14
|
-
import { useWindowToolsMF as
|
|
15
|
-
import { DICCTIONARY as
|
|
16
|
-
|
|
1
|
+
import { jsxs as H, jsx as f, Fragment as De } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useEnvironment as be, useModuleDictionary as Te } from "@m4l/core";
|
|
3
|
+
import { useState as g, useRef as F, useCallback as l, useEffect as _e, useMemo as h, useReducer as Ie } from "react";
|
|
4
|
+
import { DynamicFilter as Oe } from "../../components/DynamicFilter/DynamicFilter.js";
|
|
5
|
+
import { DynamicSort as ke } from "../../components/DynamicSort/DynamicSort.js";
|
|
6
|
+
import { ToggleIconButton as ue } from "../../components/extended/mui/ToggleIconButton/ToggleIconButton.js";
|
|
7
|
+
import { getPropDataTestId as V } from "../../test/getNameDataTestId.js";
|
|
8
|
+
import { COOKIE_APPLIED_FILTERS as $, COOKIE_APPLIED_SORTS as P, M4LDYNAMIC_KEY_FILTER_AND_SORT as z, STACK_NARROW_BREAKPOINT_PX as Ee } from "./constants.js";
|
|
9
|
+
import { ICON_PATH_FILTER as xe, ICON_PATH_SORT as $e, ASSETS as Pe } from "./icons.js";
|
|
10
|
+
import { DynamicFilterAndSortSlots as Y } from "./slots/DynamicFilterAndSortEnum.js";
|
|
11
|
+
import { StackLeftActionsStyled as Ke, StackRightActionsStyled as Le, ActionRefreshStyled as fe, SeparatorStyled as Ne, StackCustomHeaderStyled as Me } from "./slots/DynamicFilterAndSortSlots.js";
|
|
12
|
+
import { deepEqual as me } from "fast-equals";
|
|
13
|
+
import { getPurgedCookie as de } from "./helpers.js";
|
|
14
|
+
import { useWindowToolsMF as Be } from "../../components/WindowBase/hooks/useWindowToolsMF/index.js";
|
|
15
|
+
import { DICCTIONARY as He } from "../../components/DynamicFilter/dictionary.js";
|
|
16
|
+
import { Divider as Ve } from "../../components/extended/mui/Divider/Divider.js";
|
|
17
|
+
const ot = (ge) => {
|
|
17
18
|
const {
|
|
18
19
|
fields: o,
|
|
19
20
|
sorts: r,
|
|
20
|
-
onChangeFilterSort:
|
|
21
|
-
dataTestId:
|
|
22
|
-
withAllField:
|
|
23
|
-
rightActions:
|
|
24
|
-
initialFilterToggleed:
|
|
25
|
-
initialSortToggleed:
|
|
26
|
-
prefixCookie:
|
|
27
|
-
setCookie:
|
|
28
|
-
getCookie:
|
|
29
|
-
filterSortAutomatic:
|
|
30
|
-
visibleRefresh:
|
|
31
|
-
withExternalRefresh:
|
|
32
|
-
} =
|
|
33
|
-
filter:
|
|
34
|
-
sort:
|
|
35
|
-
})), [
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
onChangeFilterSort: S,
|
|
22
|
+
dataTestId: p,
|
|
23
|
+
withAllField: j,
|
|
24
|
+
rightActions: q,
|
|
25
|
+
initialFilterToggleed: he = !0,
|
|
26
|
+
initialSortToggleed: Se = !0,
|
|
27
|
+
prefixCookie: c,
|
|
28
|
+
setCookie: y,
|
|
29
|
+
getCookie: W,
|
|
30
|
+
filterSortAutomatic: m = !0,
|
|
31
|
+
visibleRefresh: K = !1,
|
|
32
|
+
withExternalRefresh: U
|
|
33
|
+
} = ge, { host_static_assets: v, environment_assets: R } = be(), [i, A] = g(() => ({
|
|
34
|
+
filter: he,
|
|
35
|
+
sort: Se
|
|
36
|
+
})), [w] = g(() => de(
|
|
37
|
+
W?.(
|
|
38
|
+
c ? `${c}_${$}` : $
|
|
38
39
|
)
|
|
39
|
-
)), [D] =
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
)), [D] = g(() => de(
|
|
41
|
+
W?.(
|
|
42
|
+
c ? `${c}_${P}` : P
|
|
42
43
|
)
|
|
43
|
-
)),
|
|
44
|
-
|
|
44
|
+
)), b = F(0), a = F(null), s = F(null), [T, pe] = g(!1), L = F(null), C = F(null), X = l((e) => {
|
|
45
|
+
if (L.current?.disconnect(), C.current !== null && (cancelAnimationFrame(C.current), C.current = null), !e || typeof ResizeObserver > "u")
|
|
46
|
+
return;
|
|
47
|
+
const t = (d) => pe(d > 0 && d < Ee);
|
|
48
|
+
t(e.getBoundingClientRect().width), C.current = requestAnimationFrame(
|
|
49
|
+
() => t(e.getBoundingClientRect().width)
|
|
50
|
+
);
|
|
51
|
+
const u = new ResizeObserver((d) => {
|
|
52
|
+
t(d[0]?.contentRect.width ?? 0);
|
|
53
|
+
});
|
|
54
|
+
u.observe(e), L.current = u;
|
|
55
|
+
}, []);
|
|
56
|
+
_e(
|
|
57
|
+
() => () => {
|
|
58
|
+
L.current?.disconnect(), C.current !== null && cancelAnimationFrame(C.current);
|
|
59
|
+
},
|
|
60
|
+
[]
|
|
61
|
+
);
|
|
62
|
+
const [_, N] = g(!1), [I, M] = g(!1), { toast: G } = Be(), { getLabel: J } = Te(), [B, O] = g(() => ({
|
|
63
|
+
filter: w?.length === 0,
|
|
45
64
|
sort: D?.length === 0
|
|
46
|
-
})),
|
|
47
|
-
() =>
|
|
48
|
-
[
|
|
49
|
-
),
|
|
50
|
-
eventFilters: { filters:
|
|
65
|
+
})), Ce = h(
|
|
66
|
+
() => i.filter || i.sort,
|
|
67
|
+
[i]
|
|
68
|
+
), k = `${v}/${R}/${Pe.refresh}`, n = F({
|
|
69
|
+
eventFilters: { filters: w, rawFilters: [] },
|
|
51
70
|
eventSorts: { sorts: D, rawSorts: [] }
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
},
|
|
71
|
+
}), Q = (e) => {
|
|
72
|
+
A((t) => ({ ...t, [e]: !t[e] }));
|
|
73
|
+
}, E = l(() => {
|
|
55
74
|
if (o.some((e) => e.presence === "fixed")) {
|
|
56
75
|
const e = n.current?.eventFilters?.filters;
|
|
57
76
|
return !(!e || e.length === 0);
|
|
58
77
|
}
|
|
59
78
|
return !0;
|
|
60
|
-
}, [n, o]), [
|
|
79
|
+
}, [n, o]), [Z, ee] = Ie(
|
|
61
80
|
(e, t) => ({ ...e, [t]: !e[t] }),
|
|
62
81
|
{ filters: !1, sorts: !1 }
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
-
}, [
|
|
82
|
+
), te = l(() => {
|
|
83
|
+
N(!0);
|
|
84
|
+
}, [N]), re = l(
|
|
66
85
|
(e, t) => {
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
O((u) => ({ ...u, filter: e.length === 0 })), n.current?.eventFilters?.filters && !me(n.current?.eventFilters?.filters, e) && y?.(
|
|
87
|
+
c ? `${c}_${$}` : $,
|
|
69
88
|
"window",
|
|
70
89
|
e
|
|
71
90
|
), n.current = {
|
|
72
91
|
...n.current,
|
|
73
92
|
eventFilters: { filters: e, rawFilters: t }
|
|
74
|
-
}, (
|
|
93
|
+
}, (b.current > 0 || b.current === 0 && !r) && S(n.current), b.current++, ee("filters"), N(!1);
|
|
75
94
|
},
|
|
76
|
-
[
|
|
77
|
-
),
|
|
78
|
-
|
|
79
|
-
}, [
|
|
95
|
+
[S, c, y, O, r]
|
|
96
|
+
), ne = l(() => {
|
|
97
|
+
M(!0);
|
|
98
|
+
}, [M]), ie = l(
|
|
80
99
|
(e, t) => {
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
O((u) => ({ ...u, sort: e.length === 0 })), n.current?.eventSorts?.sorts && !me(n.current?.eventSorts?.sorts, e) && y?.(
|
|
101
|
+
c ? `${c}_${P}` : P,
|
|
83
102
|
"window",
|
|
84
103
|
e
|
|
85
104
|
), n.current = {
|
|
86
105
|
...n.current,
|
|
87
106
|
eventSorts: { sorts: e, rawSorts: t }
|
|
88
|
-
},
|
|
107
|
+
}, E() ? S(n.current) : b.current++, M(!1), ee("sorts");
|
|
89
108
|
},
|
|
90
109
|
[
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
S,
|
|
111
|
+
c,
|
|
112
|
+
y,
|
|
113
|
+
O,
|
|
114
|
+
E
|
|
96
115
|
]
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
{ title:
|
|
116
|
+
), x = l(() => {
|
|
117
|
+
m ? E() ? S(n.current) : G(
|
|
118
|
+
{ title: J(He.error_invalid_filters_before) },
|
|
100
119
|
{ type: "error" }
|
|
101
|
-
) : (
|
|
120
|
+
) : (a.current && a.current.fireOnChangeFilter(), s.current && s.current.fireOnChangeSort());
|
|
102
121
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
]),
|
|
109
|
-
() => /* @__PURE__ */
|
|
110
|
-
|
|
122
|
+
m,
|
|
123
|
+
J,
|
|
124
|
+
E,
|
|
125
|
+
S,
|
|
126
|
+
G
|
|
127
|
+
]), Fe = h(
|
|
128
|
+
() => /* @__PURE__ */ H(
|
|
129
|
+
Ke,
|
|
111
130
|
{
|
|
112
131
|
direction: "row",
|
|
113
|
-
...
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
132
|
+
...V(
|
|
133
|
+
z,
|
|
134
|
+
Y.stackLeftActions,
|
|
135
|
+
p
|
|
117
136
|
),
|
|
118
137
|
children: [
|
|
119
138
|
o && o.length > 0 && /* @__PURE__ */ f(
|
|
120
|
-
|
|
139
|
+
ue,
|
|
121
140
|
{
|
|
122
141
|
badgeProps: {
|
|
123
142
|
variant: "dot",
|
|
124
|
-
invisible:
|
|
143
|
+
invisible: B.filter,
|
|
125
144
|
color: "primary"
|
|
126
145
|
},
|
|
127
|
-
icon: `${
|
|
128
|
-
isToggled:
|
|
129
|
-
onToggle: () =>
|
|
146
|
+
icon: `${v}/${R}/${xe}`,
|
|
147
|
+
isToggled: i.filter,
|
|
148
|
+
onToggle: () => Q("filter")
|
|
130
149
|
}
|
|
131
150
|
),
|
|
132
151
|
r && r.length > 0 && /* @__PURE__ */ f(
|
|
133
|
-
|
|
152
|
+
ue,
|
|
134
153
|
{
|
|
135
154
|
badgeProps: {
|
|
136
155
|
variant: "dot",
|
|
137
|
-
invisible:
|
|
156
|
+
invisible: B.sort,
|
|
138
157
|
color: "primary"
|
|
139
158
|
},
|
|
140
|
-
icon: `${
|
|
141
|
-
isToggled:
|
|
142
|
-
onToggle: () =>
|
|
159
|
+
icon: `${v}/${R}/${$e}`,
|
|
160
|
+
isToggled: i.sort,
|
|
161
|
+
onToggle: () => Q("sort")
|
|
143
162
|
}
|
|
144
163
|
)
|
|
145
164
|
]
|
|
146
165
|
}
|
|
147
166
|
),
|
|
148
167
|
[
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
168
|
+
i,
|
|
169
|
+
B,
|
|
170
|
+
v,
|
|
171
|
+
R,
|
|
172
|
+
p,
|
|
154
173
|
o,
|
|
155
174
|
r
|
|
156
175
|
]
|
|
157
|
-
),
|
|
158
|
-
() => /* @__PURE__ */
|
|
159
|
-
|
|
176
|
+
), ye = h(
|
|
177
|
+
() => /* @__PURE__ */ H(
|
|
178
|
+
Le,
|
|
160
179
|
{
|
|
161
180
|
direction: "row",
|
|
162
|
-
...
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
181
|
+
...V(
|
|
182
|
+
z,
|
|
183
|
+
Y.stackRightActions,
|
|
184
|
+
p
|
|
166
185
|
),
|
|
167
186
|
children: [
|
|
168
187
|
/* @__PURE__ */ f(
|
|
169
|
-
|
|
188
|
+
fe,
|
|
170
189
|
{
|
|
171
190
|
ownerState: {
|
|
172
|
-
isDirty:
|
|
173
|
-
automatic:
|
|
191
|
+
isDirty: _ || I,
|
|
192
|
+
automatic: m
|
|
174
193
|
},
|
|
175
|
-
icon:
|
|
194
|
+
icon: k,
|
|
176
195
|
"aria-label": "refresh",
|
|
177
|
-
onClick:
|
|
196
|
+
onClick: x,
|
|
178
197
|
variant: "outline"
|
|
179
198
|
}
|
|
180
199
|
),
|
|
181
|
-
|
|
200
|
+
q
|
|
182
201
|
]
|
|
183
202
|
}
|
|
184
203
|
),
|
|
185
|
-
[
|
|
186
|
-
),
|
|
204
|
+
[p, _, I, m, k, x, q]
|
|
205
|
+
), oe = l(() => s.current ? s.current.getCurrentSorts() : [], [s]), se = l(
|
|
187
206
|
(e) => {
|
|
188
|
-
if (
|
|
189
|
-
const t = r?.find((
|
|
207
|
+
if (s.current) {
|
|
208
|
+
const t = r?.find((d) => d.name === e.columnKey), u = t?.presence === "fixed";
|
|
190
209
|
switch (e.action) {
|
|
191
210
|
case "add": {
|
|
192
|
-
const
|
|
193
|
-
id:
|
|
211
|
+
const d = {
|
|
212
|
+
id: s.current.getNewId(),
|
|
194
213
|
field: {
|
|
195
214
|
name: e.columnKey,
|
|
196
215
|
type: t?.type || "string",
|
|
@@ -198,108 +217,121 @@ const Ge = (ue) => {
|
|
|
198
217
|
label: e.label
|
|
199
218
|
},
|
|
200
219
|
isSet: !0,
|
|
201
|
-
fixed:
|
|
220
|
+
fixed: u,
|
|
202
221
|
fieldType: t?.type || "string",
|
|
203
222
|
operator: e.direction
|
|
204
223
|
};
|
|
205
|
-
|
|
224
|
+
A((we) => ({ ...we, sort: !0 })), s.current.addExternalSort(d);
|
|
206
225
|
break;
|
|
207
226
|
}
|
|
208
227
|
case "remove":
|
|
209
|
-
|
|
228
|
+
u || s.current.removeExternalSort(
|
|
210
229
|
e.columnKey
|
|
211
230
|
);
|
|
212
231
|
break;
|
|
213
232
|
}
|
|
214
233
|
}
|
|
215
234
|
},
|
|
216
|
-
[
|
|
217
|
-
),
|
|
235
|
+
[s, r]
|
|
236
|
+
), le = l(
|
|
218
237
|
(e) => {
|
|
219
|
-
if (
|
|
238
|
+
if (a.current)
|
|
220
239
|
switch (e.action) {
|
|
221
240
|
case "add":
|
|
222
|
-
|
|
241
|
+
A((t) => ({ ...t, filter: !0 })), a.current.addExternalFilter(e.columnKey);
|
|
223
242
|
break;
|
|
224
243
|
case "openPopoverMenuFields":
|
|
225
|
-
|
|
244
|
+
A((t) => ({ ...t, filter: !0 })), a.current.openPopoverMenuFields();
|
|
226
245
|
break;
|
|
227
246
|
default:
|
|
228
247
|
return;
|
|
229
248
|
}
|
|
230
249
|
},
|
|
231
|
-
[
|
|
232
|
-
),
|
|
233
|
-
() => /* @__PURE__ */
|
|
250
|
+
[a]
|
|
251
|
+
), ce = l(() => a.current ? a.current.getCurrentFilters() : [], [a]), ae = h(
|
|
252
|
+
() => /* @__PURE__ */ H(De, { children: [
|
|
234
253
|
/* @__PURE__ */ f(
|
|
235
|
-
|
|
254
|
+
Oe,
|
|
236
255
|
{
|
|
237
|
-
ref:
|
|
238
|
-
visibleRefresh:
|
|
239
|
-
automatic:
|
|
256
|
+
ref: a,
|
|
257
|
+
visibleRefresh: K,
|
|
258
|
+
automatic: m,
|
|
240
259
|
fields: o,
|
|
241
|
-
initialAppliedFilters:
|
|
242
|
-
onChangeFilters:
|
|
243
|
-
withAllField:
|
|
244
|
-
onDirty:
|
|
260
|
+
initialAppliedFilters: w,
|
|
261
|
+
onChangeFilters: re,
|
|
262
|
+
withAllField: j,
|
|
263
|
+
onDirty: te
|
|
245
264
|
}
|
|
246
265
|
),
|
|
247
266
|
r ? /* @__PURE__ */ f(
|
|
248
|
-
|
|
267
|
+
ke,
|
|
249
268
|
{
|
|
250
|
-
ref:
|
|
251
|
-
visibleRefresh:
|
|
252
|
-
automatic:
|
|
269
|
+
ref: s,
|
|
270
|
+
visibleRefresh: K,
|
|
271
|
+
automatic: m,
|
|
253
272
|
fields: r,
|
|
254
273
|
initialAppliedSorts: D,
|
|
255
|
-
onChangeSorts:
|
|
256
|
-
onDirty:
|
|
274
|
+
onChangeSorts: ie,
|
|
275
|
+
onDirty: ne,
|
|
276
|
+
leadingSeparator: /* @__PURE__ */ f(
|
|
277
|
+
Ne,
|
|
278
|
+
{
|
|
279
|
+
ownerState: {
|
|
280
|
+
showDynamicFilter: i.filter,
|
|
281
|
+
showDynamicSort: i.sort,
|
|
282
|
+
isNarrow: T
|
|
283
|
+
},
|
|
284
|
+
children: /* @__PURE__ */ f(Ve, { orientation: "vertical", customVariant: "solid" })
|
|
285
|
+
}
|
|
286
|
+
)
|
|
257
287
|
}
|
|
258
288
|
) : null,
|
|
259
|
-
|
|
260
|
-
|
|
289
|
+
U && /* @__PURE__ */ f(
|
|
290
|
+
fe,
|
|
261
291
|
{
|
|
262
292
|
ownerState: {
|
|
263
|
-
automatic:
|
|
264
|
-
isDirty:
|
|
293
|
+
automatic: m,
|
|
294
|
+
isDirty: _ || I
|
|
265
295
|
},
|
|
266
|
-
icon:
|
|
296
|
+
icon: k,
|
|
267
297
|
"aria-label": "refresh",
|
|
268
|
-
onClick:
|
|
298
|
+
onClick: x
|
|
269
299
|
}
|
|
270
300
|
)
|
|
271
301
|
] }),
|
|
272
|
-
[
|
|
273
|
-
),
|
|
302
|
+
[K, m, o, w, re, j, te, r, D, ie, ne, U, _, I, k, x, i, T]
|
|
303
|
+
), ve = h(
|
|
274
304
|
() => /* @__PURE__ */ f(
|
|
275
|
-
|
|
305
|
+
Me,
|
|
276
306
|
{
|
|
307
|
+
ref: X,
|
|
277
308
|
direction: "row",
|
|
278
309
|
ownerState: {
|
|
279
|
-
showDynamicFilter:
|
|
280
|
-
showDynamicSort:
|
|
310
|
+
showDynamicFilter: i.filter,
|
|
311
|
+
showDynamicSort: i.sort,
|
|
312
|
+
isNarrow: T
|
|
281
313
|
},
|
|
282
|
-
...
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
314
|
+
...V(
|
|
315
|
+
z,
|
|
316
|
+
Y.stackCustomHeader,
|
|
317
|
+
p
|
|
286
318
|
),
|
|
287
|
-
children:
|
|
319
|
+
children: ae
|
|
288
320
|
}
|
|
289
321
|
),
|
|
290
|
-
[
|
|
291
|
-
),
|
|
322
|
+
[i, p, ae, T, X]
|
|
323
|
+
), Re = h(() => {
|
|
292
324
|
if (!(!r || r.length === 0))
|
|
293
325
|
return {
|
|
294
326
|
sortsColumns: r.map((e) => e.name),
|
|
295
|
-
sortsApplied:
|
|
327
|
+
sortsApplied: oe().map((e) => ({
|
|
296
328
|
columnKey: e.field.name,
|
|
297
329
|
removable: !e.fixed,
|
|
298
330
|
direction: e.operator
|
|
299
331
|
})),
|
|
300
|
-
onChange:
|
|
332
|
+
onChange: se
|
|
301
333
|
};
|
|
302
|
-
}, [r,
|
|
334
|
+
}, [r, Z.sorts, oe, se]), Ae = h(() => {
|
|
303
335
|
if (!(!o || o.length === 0))
|
|
304
336
|
return {
|
|
305
337
|
filterColumns: o.map((e) => ({
|
|
@@ -307,22 +339,22 @@ const Ge = (ue) => {
|
|
|
307
339
|
multiple: e.multiple || !1,
|
|
308
340
|
skipColumnValidation: e.skipColumnValidation || !1
|
|
309
341
|
})),
|
|
310
|
-
filtersApplied:
|
|
342
|
+
filtersApplied: ce().map((e) => ({
|
|
311
343
|
columnKey: e.field.name,
|
|
312
344
|
isValid: e.isSet
|
|
313
345
|
})),
|
|
314
|
-
onChange:
|
|
346
|
+
onChange: le
|
|
315
347
|
};
|
|
316
|
-
}, [o,
|
|
348
|
+
}, [o, Z.filters, ce, le]);
|
|
317
349
|
return {
|
|
318
|
-
leftActions:
|
|
319
|
-
rightActions:
|
|
320
|
-
visibleCustomHeader:
|
|
321
|
-
customHeaderComponent:
|
|
322
|
-
externalSortSettings:
|
|
323
|
-
externalFilterSettings:
|
|
350
|
+
leftActions: Fe,
|
|
351
|
+
rightActions: ye,
|
|
352
|
+
visibleCustomHeader: Ce,
|
|
353
|
+
customHeaderComponent: ve,
|
|
354
|
+
externalSortSettings: Re,
|
|
355
|
+
externalFilterSettings: Ae
|
|
324
356
|
};
|
|
325
357
|
};
|
|
326
358
|
export {
|
|
327
|
-
|
|
359
|
+
ot as useDynamicFilterAndSort
|
|
328
360
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.39.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -52,24 +52,24 @@
|
|
|
52
52
|
"@hookform/resolvers": "2.9.11",
|
|
53
53
|
"nprogress": "0.2.0",
|
|
54
54
|
"react-transition-group": "4.4.5",
|
|
55
|
-
"react-rnd": "10.5.2",
|
|
56
|
-
"@mui/x-date-pickers": "6.20.2",
|
|
57
|
-
"react-dropzone": "14.4.1",
|
|
58
55
|
"react-color": "2.19.3",
|
|
59
56
|
"react-draggable": "4.5.0",
|
|
60
57
|
"react-spinners": "0.13.8",
|
|
58
|
+
"react-dropzone": "14.4.1",
|
|
59
|
+
"@mui/x-date-pickers": "6.20.2",
|
|
60
|
+
"react-rnd": "10.5.2",
|
|
61
61
|
"chart.js": "4.5.1",
|
|
62
62
|
"chartjs-chart-error-bars": "4.4.5",
|
|
63
63
|
"qrcode.react": "3.2.0",
|
|
64
|
-
"simplebar-react": "3.2.6",
|
|
65
|
-
"react-simple-code-editor": "0.14.1",
|
|
66
|
-
"react-resizable-panels": "2.1.9",
|
|
67
64
|
"react-data-grid": "7.0.0-beta.47",
|
|
68
65
|
"react-dnd": "16.0.1",
|
|
69
66
|
"react-dnd-html5-backend": "16.0.1",
|
|
67
|
+
"react-simple-code-editor": "0.14.1",
|
|
68
|
+
"react-resizable-panels": "2.1.9",
|
|
69
|
+
"simplebar-react": "3.2.6",
|
|
70
70
|
"date-fns": "2.30.0",
|
|
71
|
-
"react-resizable": "3.1.3",
|
|
72
71
|
"react-window": "1.8.11",
|
|
72
|
+
"react-resizable": "3.1.3",
|
|
73
73
|
"@tanstack/react-virtual": "3.13.23"
|
|
74
74
|
}
|
|
75
75
|
}
|