@amateescu/portal-ui-components 0.0.47 → 0.0.49

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.
Files changed (90) hide show
  1. package/dist/Box-DU079Glg.js +57 -0
  2. package/dist/{Button-Bx3LbSbV.js → Button-BgsadnaR.js} +13 -13
  3. package/dist/{ButtonBase-DV7q7wxh.js → ButtonBase-ugYh038t.js} +8 -8
  4. package/dist/{CheckBox-YBX2j1qt.js → CheckBox-D9YmAV-l.js} +1 -1
  5. package/dist/{CircularProgress-BXi3nXc9.js → CircularProgress-D1FWO7Cz.js} +1 -1
  6. package/dist/{Clear-Bz9hw2Wj.js → Clear-B32X2R1T.js} +1 -1
  7. package/dist/Close-IqnCWZPM.js +8 -0
  8. package/dist/{DefaultPropsProvider-ByENA_w0.js → DefaultPropsProvider-BQx1AiAq.js} +20 -19
  9. package/dist/ExpandMore-CHNJSd5N.js +8 -0
  10. package/dist/ListItem-1DiNy9oq.js +422 -0
  11. package/dist/ListItemText-VX0lo95z.js +434 -0
  12. package/dist/Modal-BnD35xWv.js +1325 -0
  13. package/dist/{Search-D_9Ptbky.js → Search-DnJ3yLMg.js} +1 -1
  14. package/dist/assets/PassportDateRangeWrapper.css +1 -1
  15. package/dist/assets/PassportFilter.css +1 -0
  16. package/dist/assets/PassportFilterDrawer.css +1 -0
  17. package/dist/assets/PassportFilterFreeTextFilter.css +1 -0
  18. package/dist/components/LoadingAnimation/LoadingAnimation.js +8 -60
  19. package/dist/components/Login/Login.js +1 -1
  20. package/dist/components/PassportButton/PassportButton.js +1 -1
  21. package/dist/components/PassportDatePicker/PassportDatePicker.js +21 -20
  22. package/dist/components/PassportDateTimePicker/PassportDateTimePicker.js +298 -291
  23. package/dist/components/PassportDatesFilter/PassportDatesFilter.js +24 -26
  24. package/dist/components/PassportFilter/PassportFilter.d.ts +5 -0
  25. package/dist/components/PassportFilter/PassportFilter.d.ts.map +1 -0
  26. package/dist/components/PassportFilter/PassportFilter.js +154 -0
  27. package/dist/components/PassportFilter/PassportFilter.stories.d.ts +13 -0
  28. package/dist/components/PassportFilter/PassportFilter.stories.d.ts.map +1 -0
  29. package/dist/components/PassportFilter/PassportFilter.types.d.ts +61 -0
  30. package/dist/components/PassportFilter/PassportFilter.types.d.ts.map +1 -0
  31. package/dist/components/PassportFilter/PassportFilter.types.js +5 -0
  32. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.d.ts +5 -0
  33. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.d.ts.map +1 -0
  34. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.js +756 -0
  35. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.types.d.ts +28 -0
  36. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.types.d.ts.map +1 -0
  37. package/dist/components/PassportFilter/PassportFilterDrawer/PassportFilterDrawer.types.js +1 -0
  38. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.d.ts +4 -0
  39. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.d.ts.map +1 -0
  40. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.js +94 -0
  41. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.types.d.ts +16 -0
  42. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.types.d.ts.map +1 -0
  43. package/dist/components/PassportFilter/PassportFilterFreeTextButtons/PassportFilterFreeTextButtons.types.js +1 -0
  44. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.d.ts +4 -0
  45. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.d.ts.map +1 -0
  46. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.js +736 -0
  47. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.types.d.ts +37 -0
  48. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.types.d.ts.map +1 -0
  49. package/dist/components/PassportFilter/PassportFilterFreeTextFilter/PassportFilterFreeTextFilter.types.js +1 -0
  50. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.d.ts +4 -0
  51. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.d.ts.map +1 -0
  52. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.js +180 -0
  53. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.types.d.ts +17 -0
  54. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.types.d.ts.map +1 -0
  55. package/dist/components/PassportFilter/PassportFilterSelectionList/PassportFilterSelectionList.types.js +1 -0
  56. package/dist/components/PassportInput/PassportInput.js +2 -2
  57. package/dist/components/PassportMultiSelect/PassportMultiSelect.js +1 -1
  58. package/dist/components/PassportPagination/PassportPagination.js +96 -94
  59. package/dist/components/PassportSearchableMultiSelect/PassportSearchableMultiSelect.js +1 -1
  60. package/dist/components/PassportSearchableMultiSelectDetailed/PassportSearchableMultiSelectDetailed.js +1 -1
  61. package/dist/components/PassportTreeSelect/PassportTreeSelect.js +82 -79
  62. package/dist/components/index.d.ts +1 -0
  63. package/dist/components/index.d.ts.map +1 -1
  64. package/dist/components/index.js +4 -2
  65. package/dist/{createSvgIcon-D5xeIEZ_.js → createSvgIcon-Crk7qT6j.js} +1 -1
  66. package/dist/{extendSxProp-BtJlbIOl.js → extendSxProp-BHclE0DL.js} +1 -1
  67. package/dist/getReactElementRef-CIbXfZbo.js +45 -0
  68. package/dist/index-DfCFE9GG.js +9 -0
  69. package/dist/listItemButtonClasses-BLTBU8Yh.js +476 -0
  70. package/dist/listItemIconClasses-B_UAYnw7.js +9 -0
  71. package/dist/listItemTextClasses-D5in-Wsc.js +9 -0
  72. package/dist/main.js +41 -37
  73. package/dist/portal-utils/arrays.d.ts +2 -0
  74. package/dist/portal-utils/arrays.d.ts.map +1 -0
  75. package/dist/portal-utils/arrays.js +10 -0
  76. package/dist/portal-utils/index.d.ts +1 -0
  77. package/dist/portal-utils/index.d.ts.map +1 -1
  78. package/dist/portal-utils/index.js +17 -15
  79. package/dist/types/index.d.ts +1 -0
  80. package/dist/types/index.d.ts.map +1 -1
  81. package/dist/useControlled-D1L5tREc.js +31 -0
  82. package/dist/useFormControl-Ivp9nwoj.js +53 -0
  83. package/dist/{useMobilePicker-CFsW9hUG.js → useMobilePicker-BombQ5QA.js} +5381 -7587
  84. package/dist/useSlot-B1oIMjd_.js +126 -0
  85. package/dist/useTheme-9dlwNzrD.js +10 -0
  86. package/dist/{useTheme-Cz8ZipjJ.js → useTheme-Dxbczges.js} +3 -3
  87. package/dist/useThemeProps-j6Er0aGl.js +27 -0
  88. package/dist/{useFormControl-MVwkyimi.js → utils-6k-H8qFR.js} +155 -231
  89. package/package.json +1 -1
  90. package/dist/useSlot-Bm5YJQBR.js +0 -160
@@ -0,0 +1,756 @@
1
+ import { jsx as l, jsxs as A, Fragment as le } from "react/jsx-runtime";
2
+ import { c as pe } from "../../../createSvgIcon-Crk7qT6j.js";
3
+ import de from "../PassportFilterSelectionList/PassportFilterSelectionList.js";
4
+ import { PassportButton as J } from "../../PassportButton/PassportButton.js";
5
+ import { E as fe } from "../../../ExpandMore-CHNJSd5N.js";
6
+ import { Accordion as ue, AccordionSummary as me, AccordionDetails as he, Divider as ge, Link as ye } from "@mui/material";
7
+ import * as T from "react";
8
+ import { memo as be, useEffect as ke, useState as xe, useMemo as we, useCallback as F } from "react";
9
+ import { B as ve } from "../../../Box-DU079Glg.js";
10
+ import { createLogger as Te } from "../../../portal-utils/loggerService.js";
11
+ import { P as e, b as Pe, g as Ee, u as Ce, c as U, s as Y, e as $, f as De, m as Z, r as Re } from "../../../DefaultPropsProvider-BQx1AiAq.js";
12
+ import { u as Se } from "../../../index-DfCFE9GG.js";
13
+ import { u as ee } from "../../../useTheme-9dlwNzrD.js";
14
+ import { u as I } from "../../../useSlot-B1oIMjd_.js";
15
+ import { T as Be, g as K, r as Ae, m as Me } from "../../../utils-6k-H8qFR.js";
16
+ import { a as Oe } from "../../../ButtonBase-ugYh038t.js";
17
+ import { g as Ne, e as Le } from "../../../getReactElementRef-CIbXfZbo.js";
18
+ import { o as te, d as _e, H as $e, M as je, P as Fe } from "../../../Modal-BnD35xWv.js";
19
+ import { a as Ie } from "../../../createSimplePaletteValueFilter-Bz8RuRaa.js";
20
+ import { i as ze } from "../../../integerPropType-BihGt2aU.js";
21
+ import '../../../assets/PassportFilterDrawer.css';const He = pe(/* @__PURE__ */ l("path", {
22
+ d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"
23
+ }), "ArrowBack");
24
+ function Ve(o, t, n) {
25
+ const r = t.getBoundingClientRect(), a = n && n.getBoundingClientRect(), g = te(t);
26
+ let u;
27
+ if (t.fakeTransform)
28
+ u = t.fakeTransform;
29
+ else {
30
+ const c = g.getComputedStyle(t);
31
+ u = c.getPropertyValue("-webkit-transform") || c.getPropertyValue("transform");
32
+ }
33
+ let p = 0, s = 0;
34
+ if (u && u !== "none" && typeof u == "string") {
35
+ const c = u.split("(")[1].split(")")[0].split(",");
36
+ p = parseInt(c[4], 10), s = parseInt(c[5], 10);
37
+ }
38
+ return o === "left" ? a ? `translateX(${a.right + p - r.left}px)` : `translateX(${g.innerWidth + p - r.left}px)` : o === "right" ? a ? `translateX(-${r.right - a.left - p}px)` : `translateX(-${r.left + r.width - p}px)` : o === "up" ? a ? `translateY(${a.bottom + s - r.top}px)` : `translateY(${g.innerHeight + s - r.top}px)` : a ? `translateY(-${r.top - a.top + r.height - s}px)` : `translateY(-${r.top + r.height - s}px)`;
39
+ }
40
+ function oe(o) {
41
+ return typeof o == "function" ? o() : o;
42
+ }
43
+ function z(o, t, n) {
44
+ const r = oe(n), a = Ve(o, t, r);
45
+ a && (t.style.webkitTransform = a, t.style.transform = a);
46
+ }
47
+ const re = /* @__PURE__ */ T.forwardRef(function(t, n) {
48
+ const r = ee(), a = {
49
+ enter: r.transitions.easing.easeOut,
50
+ exit: r.transitions.easing.sharp
51
+ }, g = {
52
+ enter: r.transitions.duration.enteringScreen,
53
+ exit: r.transitions.duration.leavingScreen
54
+ }, {
55
+ addEndListener: u,
56
+ appear: p = !0,
57
+ children: s,
58
+ container: c,
59
+ direction: d = "down",
60
+ easing: E = a,
61
+ in: y,
62
+ onEnter: b,
63
+ onEntered: C,
64
+ onEntering: M,
65
+ onExit: k,
66
+ onExited: w,
67
+ onExiting: O,
68
+ style: D,
69
+ timeout: m = g,
70
+ // eslint-disable-next-line react/prop-types
71
+ TransitionComponent: x = Be,
72
+ ...N
73
+ } = t, h = T.useRef(null), L = Oe(Ne(s), h, n), v = (i) => (f) => {
74
+ i && (f === void 0 ? i(h.current) : i(h.current, f));
75
+ }, H = v((i, f) => {
76
+ z(d, i, c), Ae(i), b && b(i, f);
77
+ }), X = v((i, f) => {
78
+ const B = K({
79
+ timeout: m,
80
+ style: D,
81
+ easing: E
82
+ }, {
83
+ mode: "enter"
84
+ });
85
+ i.style.webkitTransition = r.transitions.create("-webkit-transform", {
86
+ ...B
87
+ }), i.style.transition = r.transitions.create("transform", {
88
+ ...B
89
+ }), i.style.webkitTransform = "none", i.style.transform = "none", M && M(i, f);
90
+ }), R = v(C), S = v(O), P = v((i) => {
91
+ const f = K({
92
+ timeout: m,
93
+ style: D,
94
+ easing: E
95
+ }, {
96
+ mode: "exit"
97
+ });
98
+ i.style.webkitTransition = r.transitions.create("-webkit-transform", f), i.style.transition = r.transitions.create("transform", f), z(d, i, c), k && k(i);
99
+ }), V = v((i) => {
100
+ i.style.webkitTransition = "", i.style.transition = "", w && w(i);
101
+ }), W = (i) => {
102
+ u && u(h.current, i);
103
+ }, j = T.useCallback(() => {
104
+ h.current && z(d, h.current, c);
105
+ }, [d, c]);
106
+ return T.useEffect(() => {
107
+ if (y || d === "down" || d === "right")
108
+ return;
109
+ const i = _e(() => {
110
+ h.current && z(d, h.current, c);
111
+ }), f = te(h.current);
112
+ return f.addEventListener("resize", i), () => {
113
+ i.clear(), f.removeEventListener("resize", i);
114
+ };
115
+ }, [d, y, c]), T.useEffect(() => {
116
+ y || j();
117
+ }, [y, j]), /* @__PURE__ */ l(x, {
118
+ nodeRef: h,
119
+ onEnter: H,
120
+ onEntered: R,
121
+ onEntering: X,
122
+ onExit: P,
123
+ onExited: V,
124
+ onExiting: S,
125
+ addEndListener: W,
126
+ appear: p,
127
+ in: y,
128
+ timeout: m,
129
+ ...N,
130
+ children: (i, {
131
+ ownerState: f,
132
+ ...B
133
+ }) => /* @__PURE__ */ T.cloneElement(s, {
134
+ ref: L,
135
+ style: {
136
+ visibility: i === "exited" && !y ? "hidden" : void 0,
137
+ ...D,
138
+ ...s.props.style
139
+ },
140
+ ...B
141
+ })
142
+ });
143
+ });
144
+ process.env.NODE_ENV !== "production" && (re.propTypes = {
145
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
146
+ // │ These PropTypes are generated from the TypeScript type definitions. │
147
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
148
+ // └─────────────────────────────────────────────────────────────────────┘
149
+ /**
150
+ * Add a custom transition end trigger. Called with the transitioning DOM
151
+ * node and a done callback. Allows for more fine grained transition end
152
+ * logic. Note: Timeouts are still used as a fallback if provided.
153
+ */
154
+ addEndListener: e.func,
155
+ /**
156
+ * Perform the enter transition when it first mounts if `in` is also `true`.
157
+ * Set this to `false` to disable this behavior.
158
+ * @default true
159
+ */
160
+ appear: e.bool,
161
+ /**
162
+ * A single child content element.
163
+ */
164
+ children: Le.isRequired,
165
+ /**
166
+ * An HTML element, or a function that returns one.
167
+ * It's used to set the container the Slide is transitioning from.
168
+ */
169
+ container: Ie(e.oneOfType([$e, e.func]), (o) => {
170
+ if (o.open) {
171
+ const t = oe(o.container);
172
+ if (t && t.nodeType === 1) {
173
+ const n = t.getBoundingClientRect();
174
+ if (process.env.NODE_ENV !== "test" && n.top === 0 && n.left === 0 && n.right === 0 && n.bottom === 0)
175
+ return new Error(["MUI: The `container` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
176
+ `));
177
+ } else if (!t || typeof t.getBoundingClientRect != "function" || t.contextElement != null && t.contextElement.nodeType !== 1)
178
+ return new Error(["MUI: The `container` prop provided to the component is invalid.", "It should be an HTML element instance."].join(`
179
+ `));
180
+ }
181
+ return null;
182
+ }),
183
+ /**
184
+ * Direction the child node will enter from.
185
+ * @default 'down'
186
+ */
187
+ direction: e.oneOf(["down", "left", "right", "up"]),
188
+ /**
189
+ * The transition timing function.
190
+ * You may specify a single easing or a object containing enter and exit values.
191
+ * @default {
192
+ * enter: theme.transitions.easing.easeOut,
193
+ * exit: theme.transitions.easing.sharp,
194
+ * }
195
+ */
196
+ easing: e.oneOfType([e.shape({
197
+ enter: e.string,
198
+ exit: e.string
199
+ }), e.string]),
200
+ /**
201
+ * If `true`, the component will transition in.
202
+ */
203
+ in: e.bool,
204
+ /**
205
+ * @ignore
206
+ */
207
+ onEnter: e.func,
208
+ /**
209
+ * @ignore
210
+ */
211
+ onEntered: e.func,
212
+ /**
213
+ * @ignore
214
+ */
215
+ onEntering: e.func,
216
+ /**
217
+ * @ignore
218
+ */
219
+ onExit: e.func,
220
+ /**
221
+ * @ignore
222
+ */
223
+ onExited: e.func,
224
+ /**
225
+ * @ignore
226
+ */
227
+ onExiting: e.func,
228
+ /**
229
+ * @ignore
230
+ */
231
+ style: e.object,
232
+ /**
233
+ * The duration for the transition, in milliseconds.
234
+ * You may specify a single timeout for all transitions, or individually with an object.
235
+ * @default {
236
+ * enter: theme.transitions.duration.enteringScreen,
237
+ * exit: theme.transitions.duration.leavingScreen,
238
+ * }
239
+ */
240
+ timeout: e.oneOfType([e.number, e.shape({
241
+ appear: e.number,
242
+ enter: e.number,
243
+ exit: e.number
244
+ })])
245
+ });
246
+ function We(o) {
247
+ return Pe("MuiDrawer", o);
248
+ }
249
+ Ee("MuiDrawer", ["root", "docked", "paper", "anchorLeft", "anchorRight", "anchorTop", "anchorBottom", "paperAnchorLeft", "paperAnchorRight", "paperAnchorTop", "paperAnchorBottom", "paperAnchorDockedLeft", "paperAnchorDockedRight", "paperAnchorDockedTop", "paperAnchorDockedBottom", "modal"]);
250
+ const ne = (o, t) => {
251
+ const {
252
+ ownerState: n
253
+ } = o;
254
+ return [t.root, (n.variant === "permanent" || n.variant === "persistent") && t.docked, t.modal];
255
+ }, Ue = (o) => {
256
+ const {
257
+ classes: t,
258
+ anchor: n,
259
+ variant: r
260
+ } = o, a = {
261
+ root: ["root", `anchor${$(n)}`],
262
+ docked: [(r === "permanent" || r === "persistent") && "docked"],
263
+ modal: ["modal"],
264
+ paper: ["paper", `paperAnchor${$(n)}`, r !== "temporary" && `paperAnchorDocked${$(n)}`]
265
+ };
266
+ return De(a, We, t);
267
+ }, Ye = Y(je, {
268
+ name: "MuiDrawer",
269
+ slot: "Root",
270
+ overridesResolver: ne
271
+ })(Z(({
272
+ theme: o
273
+ }) => ({
274
+ zIndex: (o.vars || o).zIndex.drawer
275
+ }))), Xe = Y("div", {
276
+ shouldForwardProp: Re,
277
+ name: "MuiDrawer",
278
+ slot: "Docked",
279
+ skipVariantsResolver: !1,
280
+ overridesResolver: ne
281
+ })({
282
+ flex: "0 0 auto"
283
+ }), qe = Y(Fe, {
284
+ name: "MuiDrawer",
285
+ slot: "Paper",
286
+ overridesResolver: (o, t) => {
287
+ const {
288
+ ownerState: n
289
+ } = o;
290
+ return [t.paper, t[`paperAnchor${$(n.anchor)}`], n.variant !== "temporary" && t[`paperAnchorDocked${$(n.anchor)}`]];
291
+ }
292
+ })(Z(({
293
+ theme: o
294
+ }) => ({
295
+ overflowY: "auto",
296
+ display: "flex",
297
+ flexDirection: "column",
298
+ height: "100%",
299
+ flex: "1 0 auto",
300
+ zIndex: (o.vars || o).zIndex.drawer,
301
+ // Add iOS momentum scrolling for iOS < 13.0
302
+ WebkitOverflowScrolling: "touch",
303
+ // temporary style
304
+ position: "fixed",
305
+ top: 0,
306
+ // We disable the focus ring for mouse, touch and keyboard users.
307
+ // At some point, it would be better to keep it for keyboard users.
308
+ // :focus-ring CSS pseudo-class will help.
309
+ outline: 0,
310
+ variants: [{
311
+ props: {
312
+ anchor: "left"
313
+ },
314
+ style: {
315
+ left: 0
316
+ }
317
+ }, {
318
+ props: {
319
+ anchor: "top"
320
+ },
321
+ style: {
322
+ top: 0,
323
+ left: 0,
324
+ right: 0,
325
+ height: "auto",
326
+ maxHeight: "100%"
327
+ }
328
+ }, {
329
+ props: {
330
+ anchor: "right"
331
+ },
332
+ style: {
333
+ right: 0
334
+ }
335
+ }, {
336
+ props: {
337
+ anchor: "bottom"
338
+ },
339
+ style: {
340
+ top: "auto",
341
+ left: 0,
342
+ bottom: 0,
343
+ right: 0,
344
+ height: "auto",
345
+ maxHeight: "100%"
346
+ }
347
+ }, {
348
+ props: ({
349
+ ownerState: t
350
+ }) => t.anchor === "left" && t.variant !== "temporary",
351
+ style: {
352
+ borderRight: `1px solid ${(o.vars || o).palette.divider}`
353
+ }
354
+ }, {
355
+ props: ({
356
+ ownerState: t
357
+ }) => t.anchor === "top" && t.variant !== "temporary",
358
+ style: {
359
+ borderBottom: `1px solid ${(o.vars || o).palette.divider}`
360
+ }
361
+ }, {
362
+ props: ({
363
+ ownerState: t
364
+ }) => t.anchor === "right" && t.variant !== "temporary",
365
+ style: {
366
+ borderLeft: `1px solid ${(o.vars || o).palette.divider}`
367
+ }
368
+ }, {
369
+ props: ({
370
+ ownerState: t
371
+ }) => t.anchor === "bottom" && t.variant !== "temporary",
372
+ style: {
373
+ borderTop: `1px solid ${(o.vars || o).palette.divider}`
374
+ }
375
+ }]
376
+ }))), ie = {
377
+ left: "right",
378
+ right: "left",
379
+ top: "down",
380
+ bottom: "up"
381
+ };
382
+ function Ge(o) {
383
+ return ["left", "right"].includes(o);
384
+ }
385
+ function Je({
386
+ direction: o
387
+ }, t) {
388
+ return o === "rtl" && Ge(t) ? ie[t] : t;
389
+ }
390
+ const ae = /* @__PURE__ */ T.forwardRef(function(t, n) {
391
+ const r = Ce({
392
+ props: t,
393
+ name: "MuiDrawer"
394
+ }), a = ee(), g = Se(), u = {
395
+ enter: a.transitions.duration.enteringScreen,
396
+ exit: a.transitions.duration.leavingScreen
397
+ }, {
398
+ anchor: p = "left",
399
+ BackdropProps: s,
400
+ children: c,
401
+ className: d,
402
+ elevation: E = 16,
403
+ hideBackdrop: y = !1,
404
+ ModalProps: {
405
+ BackdropProps: b,
406
+ ...C
407
+ } = {},
408
+ onClose: M,
409
+ open: k = !1,
410
+ PaperProps: w = {},
411
+ SlideProps: O,
412
+ // eslint-disable-next-line react/prop-types
413
+ TransitionComponent: D,
414
+ transitionDuration: m = u,
415
+ variant: x = "temporary",
416
+ slots: N = {},
417
+ slotProps: h = {},
418
+ ...L
419
+ } = r, v = T.useRef(!1);
420
+ T.useEffect(() => {
421
+ v.current = !0;
422
+ }, []);
423
+ const H = Je({
424
+ direction: g ? "rtl" : "ltr"
425
+ }, p), R = {
426
+ ...r,
427
+ anchor: p,
428
+ elevation: E,
429
+ open: k,
430
+ variant: x,
431
+ ...L
432
+ }, S = Ue(R), P = {
433
+ slots: {
434
+ transition: D,
435
+ ...N
436
+ },
437
+ slotProps: {
438
+ paper: w,
439
+ transition: O,
440
+ ...h,
441
+ backdrop: Me(h.backdrop || {
442
+ ...s,
443
+ ...b
444
+ }, {
445
+ transitionDuration: m
446
+ })
447
+ }
448
+ }, [V, W] = I("root", {
449
+ ref: n,
450
+ elementType: Ye,
451
+ className: U(S.root, S.modal, d),
452
+ shouldForwardComponentProp: !0,
453
+ ownerState: R,
454
+ externalForwardedProps: {
455
+ ...P,
456
+ ...L,
457
+ ...C
458
+ },
459
+ additionalProps: {
460
+ open: k,
461
+ onClose: M,
462
+ hideBackdrop: y,
463
+ slots: {
464
+ backdrop: P.slots.backdrop
465
+ },
466
+ slotProps: {
467
+ backdrop: P.slotProps.backdrop
468
+ }
469
+ }
470
+ }), [j, i] = I("paper", {
471
+ elementType: qe,
472
+ shouldForwardComponentProp: !0,
473
+ className: U(S.paper, w.className),
474
+ ownerState: R,
475
+ externalForwardedProps: P,
476
+ additionalProps: {
477
+ elevation: x === "temporary" ? E : 0,
478
+ square: !0,
479
+ ...x === "temporary" && {
480
+ role: "dialog",
481
+ "aria-modal": "true"
482
+ }
483
+ }
484
+ }), [f, B] = I("docked", {
485
+ elementType: Xe,
486
+ ref: n,
487
+ className: U(S.root, S.docked, d),
488
+ ownerState: R,
489
+ externalForwardedProps: P,
490
+ additionalProps: L
491
+ // pass `other` here because `DockedSlot` is also a root slot for some variants
492
+ }), [se, ce] = I("transition", {
493
+ elementType: re,
494
+ ownerState: R,
495
+ externalForwardedProps: P,
496
+ additionalProps: {
497
+ in: k,
498
+ direction: ie[H],
499
+ timeout: m,
500
+ appear: v.current
501
+ }
502
+ }), q = /* @__PURE__ */ l(j, {
503
+ ...i,
504
+ children: c
505
+ });
506
+ if (x === "permanent")
507
+ return /* @__PURE__ */ l(f, {
508
+ ...B,
509
+ children: q
510
+ });
511
+ const G = /* @__PURE__ */ l(se, {
512
+ ...ce,
513
+ children: q
514
+ });
515
+ return x === "persistent" ? /* @__PURE__ */ l(f, {
516
+ ...B,
517
+ children: G
518
+ }) : /* @__PURE__ */ l(V, {
519
+ ...W,
520
+ children: G
521
+ });
522
+ });
523
+ process.env.NODE_ENV !== "production" && (ae.propTypes = {
524
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
525
+ // │ These PropTypes are generated from the TypeScript type definitions. │
526
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
527
+ // └─────────────────────────────────────────────────────────────────────┘
528
+ /**
529
+ * Side from which the drawer will appear.
530
+ * @default 'left'
531
+ */
532
+ anchor: e.oneOf(["bottom", "left", "right", "top"]),
533
+ /**
534
+ * @ignore
535
+ */
536
+ BackdropProps: e.object,
537
+ /**
538
+ * The content of the component.
539
+ */
540
+ children: e.node,
541
+ /**
542
+ * Override or extend the styles applied to the component.
543
+ */
544
+ classes: e.object,
545
+ /**
546
+ * @ignore
547
+ */
548
+ className: e.string,
549
+ /**
550
+ * The elevation of the drawer.
551
+ * @default 16
552
+ */
553
+ elevation: ze,
554
+ /**
555
+ * If `true`, the backdrop is not rendered.
556
+ * @default false
557
+ */
558
+ hideBackdrop: e.bool,
559
+ /**
560
+ * Props applied to the [`Modal`](https://mui.com/material-ui/api/modal/) element.
561
+ * @default {}
562
+ */
563
+ ModalProps: e.object,
564
+ /**
565
+ * Callback fired when the component requests to be closed.
566
+ * The `reason` parameter can optionally be used to control the response to `onClose`.
567
+ *
568
+ * @param {object} event The event source of the callback.
569
+ * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
570
+ */
571
+ onClose: e.func,
572
+ /**
573
+ * If `true`, the component is shown.
574
+ * @default false
575
+ */
576
+ open: e.bool,
577
+ /**
578
+ * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
579
+ * @deprecated use the `slotProps.paper` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
580
+ * @default {}
581
+ */
582
+ PaperProps: e.object,
583
+ /**
584
+ * Props applied to the [`Slide`](https://mui.com/material-ui/api/slide/) element.
585
+ * @deprecated use the `slotProps.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
586
+ */
587
+ SlideProps: e.object,
588
+ /**
589
+ * The props used for each slot inside.
590
+ * @default {}
591
+ */
592
+ slotProps: e.shape({
593
+ backdrop: e.oneOfType([e.func, e.object]),
594
+ docked: e.oneOfType([e.func, e.object]),
595
+ paper: e.oneOfType([e.func, e.object]),
596
+ root: e.oneOfType([e.func, e.object]),
597
+ transition: e.oneOfType([e.func, e.object])
598
+ }),
599
+ /**
600
+ * The components used for each slot inside.
601
+ * @default {}
602
+ */
603
+ slots: e.shape({
604
+ backdrop: e.elementType,
605
+ docked: e.elementType,
606
+ paper: e.elementType,
607
+ root: e.elementType,
608
+ transition: e.elementType
609
+ }),
610
+ /**
611
+ * The system prop that allows defining system overrides as well as additional CSS styles.
612
+ */
613
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
614
+ /**
615
+ * The duration for the transition, in milliseconds.
616
+ * You may specify a single timeout for all transitions, or individually with an object.
617
+ * @default {
618
+ * enter: theme.transitions.duration.enteringScreen,
619
+ * exit: theme.transitions.duration.leavingScreen,
620
+ * }
621
+ */
622
+ transitionDuration: e.oneOfType([e.number, e.shape({
623
+ appear: e.number,
624
+ enter: e.number,
625
+ exit: e.number
626
+ })]),
627
+ /**
628
+ * The variant to use.
629
+ * @default 'temporary'
630
+ */
631
+ variant: e.oneOf(["permanent", "persistent", "temporary"])
632
+ });
633
+ const Ke = "_accordion_4f9hk_1", Qe = "_filterBackContainer_4f9hk_6", Ze = "_drawerList_4f9hk_12", et = "_drawerButtons_4f9hk_18", tt = "_back_4f9hk_28", _ = {
634
+ accordion: Ke,
635
+ filterBackContainer: Qe,
636
+ drawerList: Ze,
637
+ drawerButtons: et,
638
+ back: tt
639
+ }, Q = Te(), ot = be(({ category: o, setReportFilterOptions: t, translate: n, noneLabel: r, allLabel: a, searchLabel: g, selectionListProps: u }) => {
640
+ const p = o.options.filter((d) => d.selected), s = p.length, c = o.singleSelection ? s > 0 ? `(${p[0].translatable ? n(p[0].text) : p[0].text})` : "" : "(" + (s === 0 ? r : s === o.options.length ? a : s) + ")";
641
+ return /* @__PURE__ */ A(le, { children: [
642
+ /* @__PURE__ */ A(
643
+ ue,
644
+ {
645
+ className: _.accordion,
646
+ slotProps: { transition: { unmountOnExit: !0 } },
647
+ sx: {
648
+ boxShadow: "none",
649
+ "&.MuiPaper-elevation1": { boxShadow: "none" },
650
+ "&:before": { display: "none" },
651
+ borderRadius: "4px"
652
+ },
653
+ children: [
654
+ /* @__PURE__ */ A(
655
+ me,
656
+ {
657
+ expandIcon: /* @__PURE__ */ l(fe, {}),
658
+ sx: {
659
+ minHeight: "44px",
660
+ padding: "0 8px",
661
+ fontWeight: 500,
662
+ ".MuiAccordionSummary-content": { margin: "8px 0" }
663
+ },
664
+ children: [
665
+ n(o.categoryName),
666
+ " ",
667
+ c
668
+ ]
669
+ }
670
+ ),
671
+ /* @__PURE__ */ l(he, { children: /* @__PURE__ */ l(
672
+ de,
673
+ {
674
+ category: o,
675
+ setReportFilterOptions: t,
676
+ translate: n,
677
+ searchPlaceholder: g,
678
+ allLabel: a,
679
+ ...u
680
+ }
681
+ ) })
682
+ ]
683
+ }
684
+ ),
685
+ /* @__PURE__ */ l(ge, {})
686
+ ] });
687
+ }), vt = ({
688
+ isOpen: o,
689
+ onClose: t,
690
+ reportFilterOptions: n,
691
+ translate: r = (b) => b,
692
+ backLabel: a = "Back",
693
+ clearFiltersLabel: g = "Clear Filters",
694
+ cancelLabel: u = "Cancel",
695
+ applyLabel: p = "Apply",
696
+ noneLabel: s = "None",
697
+ allLabel: c = "All",
698
+ searchLabel: d = "Search",
699
+ backIcon: E,
700
+ selectionListProps: y
701
+ }) => {
702
+ ke(() => {
703
+ o && C(n);
704
+ }, [o, n]);
705
+ const [b, C] = xe({}), M = we(() => /* @__PURE__ */ l(ve, { sx: { width: 360 }, role: "presentation", children: b.filterCategories?.map((m) => /* @__PURE__ */ l(
706
+ ot,
707
+ {
708
+ category: m,
709
+ setReportFilterOptions: C,
710
+ translate: r,
711
+ noneLabel: s,
712
+ allLabel: c,
713
+ searchLabel: d,
714
+ selectionListProps: y
715
+ },
716
+ m.categoryName
717
+ )) }), [b.filterCategories, r, s, c, d, y]), k = F((m) => {
718
+ m && Q.info("Filter applied"), t(m ? b : void 0);
719
+ }, [t, b]), w = F(() => k(!0), [k]), O = F(() => k(!1), [k]), D = F(() => {
720
+ Q.info("Filters cleared"), C((m) => ({
721
+ ...m,
722
+ filterCategories: m.filterCategories?.map((x) => ({
723
+ ...x,
724
+ options: x.options.map((N) => ({ ...N, selected: !1 }))
725
+ }))
726
+ }));
727
+ }, []);
728
+ return /* @__PURE__ */ A(ae, { open: o, onClose: w, anchor: "right", children: [
729
+ /* @__PURE__ */ A("div", { className: _.filterBackContainer, children: [
730
+ /* @__PURE__ */ A("div", { onClick: w, children: [
731
+ E ?? /* @__PURE__ */ l(He, { style: { cursor: "pointer" } }),
732
+ /* @__PURE__ */ l("span", { className: _.back, children: a })
733
+ ] }),
734
+ /* @__PURE__ */ l(
735
+ ye,
736
+ {
737
+ style: { marginInlineStart: "auto" },
738
+ component: "button",
739
+ underline: "none",
740
+ variant: "button",
741
+ color: "var(--color-blue)",
742
+ onClick: D,
743
+ children: g
744
+ }
745
+ )
746
+ ] }),
747
+ /* @__PURE__ */ l("div", { className: _.drawerList, children: M }),
748
+ /* @__PURE__ */ A("div", { className: _.drawerButtons, children: [
749
+ /* @__PURE__ */ l(J, { onClick: O, content: u, width: "100%" }),
750
+ /* @__PURE__ */ l(J, { onClick: w, content: p, width: "100%" })
751
+ ] })
752
+ ] });
753
+ };
754
+ export {
755
+ vt as default
756
+ };