dgz-ui-shared 1.1.25 → 1.1.27

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 (67) hide show
  1. package/dist/Actions-DYmkv_J9.js +29 -0
  2. package/dist/Actions-Dh8TPahn.cjs +1 -0
  3. package/dist/ExportData-DV3HcBlK.cjs +1 -0
  4. package/dist/ExportData-DvwQ6UCI.js +31 -0
  5. package/dist/{FilterWrapper-Dk18nVPy.js → FilterWrapper-BU6BOSt1.js} +63 -56
  6. package/dist/FilterWrapper-OjCn16Bf.cjs +21 -0
  7. package/dist/{MyInput-B-QCpehg.js → MyInput-ChZBApQv.js} +224 -228
  8. package/dist/{MyInput-9MnlVZ4h.cjs → MyInput-OECIw9XS.cjs} +1 -1
  9. package/dist/MySelect-BTvVzbd9.js +55 -0
  10. package/dist/MySelect-ClBq6zbD.cjs +1 -0
  11. package/dist/components/actions/index.cjs.js +1 -1
  12. package/dist/components/actions/index.es.js +1 -1
  13. package/dist/components/confirm/index.cjs.js +1 -1
  14. package/dist/components/confirm/index.es.js +1 -1
  15. package/dist/components/datatable/index.cjs.js +5 -5
  16. package/dist/components/datatable/index.es.js +249 -219
  17. package/dist/components/export/index.cjs.js +1 -1
  18. package/dist/components/export/index.es.js +1 -1
  19. package/dist/components/filters/index.cjs.js +1 -1
  20. package/dist/components/filters/index.es.js +23 -22
  21. package/dist/components/form/index.cjs.js +2 -2
  22. package/dist/components/form/index.es.js +293 -337
  23. package/dist/dgz-ui-shared.css +1 -1
  24. package/dist/hooks/index.cjs.js +1 -1
  25. package/dist/hooks/index.es.js +1 -1
  26. package/dist/types/components/actions/Actions.d.ts +5 -2
  27. package/dist/types/components/actions/Actions.d.ts.map +1 -1
  28. package/dist/types/components/datatable/DataTable.d.ts +24 -4
  29. package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
  30. package/dist/types/components/datatable/MyTable.d.ts +3 -2
  31. package/dist/types/components/datatable/MyTable.d.ts.map +1 -1
  32. package/dist/types/components/export/ExportData.d.ts +5 -2
  33. package/dist/types/components/export/ExportData.d.ts.map +1 -1
  34. package/dist/types/components/filters/FilterWrapper.d.ts +8 -1
  35. package/dist/types/components/filters/FilterWrapper.d.ts.map +1 -1
  36. package/dist/types/components/filters/SearchWithCtrl.d.ts +1 -1
  37. package/dist/types/components/filters/SearchWithCtrl.d.ts.map +1 -1
  38. package/dist/types/components/form/MyCheckbox.d.ts +6 -6
  39. package/dist/types/components/form/MyCheckbox.d.ts.map +1 -1
  40. package/dist/types/components/form/MyDatePicker.d.ts +11 -11
  41. package/dist/types/components/form/MyDatePicker.d.ts.map +1 -1
  42. package/dist/types/components/form/MyDateRangePicker.d.ts +9 -9
  43. package/dist/types/components/form/MyDateRangePicker.d.ts.map +1 -1
  44. package/dist/types/components/form/MyHtmlEditor.d.ts +8 -8
  45. package/dist/types/components/form/MyInput.d.ts +9 -9
  46. package/dist/types/components/form/MyInput.d.ts.map +1 -1
  47. package/dist/types/components/form/MyMaskInput.d.ts +9 -9
  48. package/dist/types/components/form/MyMaskInput.d.ts.map +1 -1
  49. package/dist/types/components/form/MyRadio.d.ts +7 -7
  50. package/dist/types/components/form/MyRadio.d.ts.map +1 -1
  51. package/dist/types/components/form/MySelect.d.ts +10 -10
  52. package/dist/types/components/form/MySelect.d.ts.map +1 -1
  53. package/dist/types/components/form/MySwitch.d.ts +6 -6
  54. package/dist/types/components/form/MySwitch.d.ts.map +1 -1
  55. package/dist/types/components/form/MyTextarea.d.ts +9 -9
  56. package/dist/types/components/form/MyTextarea.d.ts.map +1 -1
  57. package/dist/types/components/form/MyTimePicker.d.ts +8 -8
  58. package/dist/{unstyled-BMbrfzye.js → unstyled-3gQZkMky.js} +1 -1
  59. package/dist/{unstyled-BFCMBSGZ.cjs → unstyled-CD5LId4m.cjs} +1 -1
  60. package/package.json +2 -2
  61. package/dist/Actions-CKVu3P3q.js +0 -28
  62. package/dist/Actions-uGf1oq7E.cjs +0 -1
  63. package/dist/ExportData-1xS2UAoq.js +0 -29
  64. package/dist/ExportData-ApStkEWC.cjs +0 -1
  65. package/dist/FilterWrapper-DvNjUQih.cjs +0 -21
  66. package/dist/MySelect-C5uWRVJh.js +0 -62
  67. package/dist/MySelect-DNK997Bi.cjs +0 -1
@@ -0,0 +1,29 @@
1
+ import { j as s } from "./jsx-runtime-DS1N_tNq.js";
2
+ import { T as t, A as o, i as m, u as c } from "./dropdown-menu-TWRSm6RK-D_FJpI4C.js";
3
+ import { u as d } from "./button-CdZDBhmr-BT_j3ig5.js";
4
+ import { W as x, f as j } from "./index-BrQ82Wyu.js";
5
+ const A = ({
6
+ actions: i,
7
+ triggerProps: n,
8
+ contentProps: a,
9
+ title: e
10
+ }) => /* @__PURE__ */ s.jsxs(t, { children: [
11
+ /* @__PURE__ */ s.jsx(o, { asChild: !0, ...n, children: /* @__PURE__ */ s.jsxs(
12
+ d,
13
+ {
14
+ variant: "secondary",
15
+ size: "sm",
16
+ className: "ml-auto rounded-lg px-3",
17
+ children: [
18
+ /* @__PURE__ */ s.jsx(x, {}),
19
+ " ",
20
+ /* @__PURE__ */ s.jsx("span", { className: "hidden lg:!inline", children: e || "Actions" }),
21
+ /* @__PURE__ */ s.jsx(j, {})
22
+ ]
23
+ }
24
+ ) }),
25
+ /* @__PURE__ */ s.jsx(m, { align: "end", ...a, children: i.map((r, l) => /* @__PURE__ */ s.jsx(c, { onClick: () => r.onClick(), children: r.label }, l)) })
26
+ ] });
27
+ export {
28
+ A
29
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-h4oGeKUK.cjs"),n=require("./dropdown-menu-TWRSm6RK-DQ03CnVw.cjs"),c=require("./button-CdZDBhmr-3yMPCRDo.cjs"),t=require("./index-CGv7FLNy.cjs"),l=({actions:i,triggerProps:r,contentProps:x,title:o})=>s.jsxRuntimeExports.jsxs(n.Tt,{children:[s.jsxRuntimeExports.jsx(n.At,{asChild:!0,...r,children:s.jsxRuntimeExports.jsxs(c.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[s.jsxRuntimeExports.jsx(t.Wg,{})," ",s.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:o||"Actions"}),s.jsxRuntimeExports.jsx(t.f1,{})]})}),s.jsxRuntimeExports.jsx(n.it,{align:"end",...x,children:i.map((e,u)=>s.jsxRuntimeExports.jsx(n.ut,{onClick:()=>e.onClick(),children:e.label},u))})]});exports.Actions=l;
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-h4oGeKUK.cjs"),e=require("./dropdown-menu-TWRSm6RK-DQ03CnVw.cjs"),l=require("./button-CdZDBhmr-3yMPCRDo.cjs"),n=require("./index-CGv7FLNy.cjs"),a=require("./Spin-DBoJvG-Y.cjs"),c=({options:r,loading:i=!1,triggerProps:x,contentProps:u,title:o})=>s.jsxRuntimeExports.jsxs(e.Tt,{children:[s.jsxRuntimeExports.jsx(e.At,{asChild:!0,...x,children:s.jsxRuntimeExports.jsxs(l.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[i?s.jsxRuntimeExports.jsx(a.Spin,{}):s.jsxRuntimeExports.jsx(n.ZC,{})," ",s.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:o||"Export"}),s.jsxRuntimeExports.jsx(n.f1,{})]})}),s.jsxRuntimeExports.jsx(e.it,{align:"end",...u,children:r.map((t,j)=>s.jsxRuntimeExports.jsx(e.ut,{onClick:()=>t.onClick(),children:t.label},j))})]});exports.ExportData=c;
@@ -0,0 +1,31 @@
1
+ import { j as s } from "./jsx-runtime-DS1N_tNq.js";
2
+ import { T as o, A as m, i as x, u as d } from "./dropdown-menu-TWRSm6RK-D_FJpI4C.js";
3
+ import { u as c } from "./button-CdZDBhmr-BT_j3ig5.js";
4
+ import { Z as p, f as j } from "./index-BrQ82Wyu.js";
5
+ import { S as u } from "./Spin-D1geCtns.js";
6
+ const k = ({
7
+ options: a,
8
+ loading: i = !1,
9
+ triggerProps: e,
10
+ contentProps: n,
11
+ title: t
12
+ }) => /* @__PURE__ */ s.jsxs(o, { children: [
13
+ /* @__PURE__ */ s.jsx(m, { asChild: !0, ...e, children: /* @__PURE__ */ s.jsxs(
14
+ c,
15
+ {
16
+ variant: "secondary",
17
+ size: "sm",
18
+ className: "ml-auto rounded-lg px-3",
19
+ children: [
20
+ i ? /* @__PURE__ */ s.jsx(u, {}) : /* @__PURE__ */ s.jsx(p, {}),
21
+ " ",
22
+ /* @__PURE__ */ s.jsx("span", { className: "hidden lg:!inline", children: t || "Export" }),
23
+ /* @__PURE__ */ s.jsx(j, {})
24
+ ]
25
+ }
26
+ ) }),
27
+ /* @__PURE__ */ s.jsx(x, { align: "end", ...n, children: a.map((r, l) => /* @__PURE__ */ s.jsx(d, { onClick: () => r.onClick(), children: r.label }, l)) })
28
+ ] });
29
+ export {
30
+ k as E
31
+ };
@@ -1,120 +1,127 @@
1
1
  import { j as e } from "./jsx-runtime-DS1N_tNq.js";
2
- import { y as D, b as E } from "./input-mask-DBLFIvhN-BBxoZxnd.js";
3
- import { u as l } from "./button-CdZDBhmr-BT_j3ig5.js";
4
- import { m as F } from "./utils-B6fNqzRf-B1_jG1K7.js";
5
- import { u as M } from "./useTranslation-dH-uwymc.js";
6
- import { c as i } from "./createLucideIcon-B950nf2d.js";
7
- import { memo as q, useState as b, useEffect as k, useCallback as v } from "react";
8
- import { l as A } from "./lodash-CYNxjS-I.js";
9
- import { _ as I, w as L, u as O } from "./popover-OZcfKDD9-C2PVWPLS.js";
10
- import { M as R } from "./MyInput-B-QCpehg.js";
11
- import { M as C } from "./MySelect-C5uWRVJh.js";
12
- import { u as P } from "./useFilter-DJunNBm2.js";
2
+ import { y as A, b as I } from "./input-mask-DBLFIvhN-BBxoZxnd.js";
3
+ import { u as c } from "./button-CdZDBhmr-BT_j3ig5.js";
4
+ import { m as L } from "./utils-B6fNqzRf-B1_jG1K7.js";
5
+ import { u as O } from "./useTranslation-dH-uwymc.js";
6
+ import { c as l } from "./createLucideIcon-B950nf2d.js";
7
+ import { memo as R, useState as b, useEffect as k, useCallback as v } from "react";
8
+ import { l as C } from "./lodash-CYNxjS-I.js";
9
+ import { _ as P, w as T, u as V } from "./popover-OZcfKDD9-C2PVWPLS.js";
10
+ import { M as W } from "./MyInput-ChZBApQv.js";
11
+ import { M as B } from "./MySelect-BTvVzbd9.js";
12
+ import { u as G } from "./useFilter-DJunNBm2.js";
13
13
  /**
14
14
  * @license lucide-react v0.511.0 - ISC
15
15
  *
16
16
  * This source code is licensed under the ISC license.
17
17
  * See the LICENSE file in the root directory of this source tree.
18
18
  */
19
- const T = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], V = i("chevron-down", T);
19
+ const H = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], J = l("chevron-down", H);
20
20
  /**
21
21
  * @license lucide-react v0.511.0 - ISC
22
22
  *
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
25
  */
26
- const W = [
26
+ const K = [
27
27
  ["path", { d: "M10 18h4", key: "1ulq68" }],
28
28
  ["path", { d: "M11 6H3", key: "1u26ik" }],
29
29
  ["path", { d: "M15 6h6", key: "1jlkvy" }],
30
30
  ["path", { d: "M18 9V3", key: "xwwp7m" }],
31
31
  ["path", { d: "M7 12h8", key: "7a1bxv" }]
32
- ], B = i("list-filter-plus", W);
32
+ ], Q = l("list-filter-plus", K);
33
33
  /**
34
34
  * @license lucide-react v0.511.0 - ISC
35
35
  *
36
36
  * This source code is licensed under the ISC license.
37
37
  * See the LICENSE file in the root directory of this source tree.
38
38
  */
39
- const G = [
39
+ const U = [
40
40
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
41
41
  ["path", { d: "M7 12h10", key: "b7w52i" }],
42
42
  ["path", { d: "M10 18h4", key: "1ulq68" }]
43
- ], H = i("list-filter", G);
43
+ ], X = l("list-filter", U);
44
44
  /**
45
45
  * @license lucide-react v0.511.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
49
  */
50
- const J = [
50
+ const Y = [
51
51
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
52
52
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
53
- ], K = i("search", J), ce = ({
54
- name: m = "search",
53
+ ], Z = l("search", Y), pe = ({
54
+ name: i = "search",
55
55
  defaultValue: t,
56
56
  onSearchChange: o,
57
57
  placeholder: a,
58
58
  className: r,
59
59
  ...x
60
60
  }) => {
61
- const { t: d } = M(), n = (c) => {
62
- const p = new FormData(c.currentTarget);
63
- o(p.get(m) || void 0), c.preventDefault(), c.stopPropagation();
61
+ const { t: m } = O(), d = (n) => {
62
+ const p = new FormData(n.currentTarget);
63
+ o(p.get(i) || void 0), n.preventDefault(), n.stopPropagation();
64
64
  };
65
65
  return /* @__PURE__ */ e.jsxs(
66
66
  "form",
67
67
  {
68
- className: F("relative w-full max-w-64 min-w-40", r),
69
- onSubmit: n,
68
+ className: L("relative w-full max-w-64 min-w-40", r),
69
+ onSubmit: d,
70
70
  children: [
71
71
  /* @__PURE__ */ e.jsx(
72
- D,
72
+ A,
73
73
  {
74
74
  ...x,
75
75
  className: "h-8 rounded-lg",
76
- name: m,
77
- placeholder: a || d("Search..."),
76
+ name: i,
77
+ placeholder: a || m("Search..."),
78
78
  defaultValue: t ? `${t}` : ""
79
79
  }
80
80
  ),
81
81
  /* @__PURE__ */ e.jsx(
82
- l,
82
+ c,
83
83
  {
84
84
  type: "submit",
85
85
  variant: "ghost",
86
86
  className: "text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",
87
87
  size: "sm",
88
- children: /* @__PURE__ */ e.jsx(K, {})
88
+ children: /* @__PURE__ */ e.jsx(Z, {})
89
89
  }
90
90
  )
91
91
  ]
92
92
  }
93
93
  );
94
- }, le = q(function({
94
+ }, he = R(function({
95
95
  filters: t,
96
96
  params: o,
97
97
  onFilter: a,
98
98
  onChange: r,
99
99
  onCancel: x,
100
- ...d
100
+ triggerProps: m,
101
+ contentProps: d,
102
+ title: n,
103
+ resetText: p,
104
+ applyText: N,
105
+ ...M
101
106
  }) {
102
- const { t: n } = M(), [c, p] = b(!1), [N, h] = b(!1), { form: j } = P({ params: o }), { watch: w, getValues: g, handleSubmit: S, control: y, reset: f } = j;
107
+ const [w, g] = b(!1), [S, h] = b(!1), { form: j } = G({ params: o }), { watch: _, getValues: z, handleSubmit: $, control: y, reset: f } = j;
103
108
  k(() => {
104
109
  let s = !1;
105
- t.map(($) => {
106
- const u = A.get(o, `${$.name}`);
107
- (Array.isArray(u) ? u.length > 0 : u) && (s = !0), p(s);
110
+ t.map((q) => {
111
+ const u = C.get(o, `${q.name}`);
112
+ (Array.isArray(u) ? u.length > 0 : u) && (s = !0), g(s);
108
113
  });
109
- }, [t, o]), k(() => {
110
- r == null || r(g());
111
- }, [w()]);
112
- const _ = v(
114
+ }, [t, o]);
115
+ const D = _();
116
+ k(() => {
117
+ r == null || r(z());
118
+ }, [D]);
119
+ const E = v(
113
120
  (s = {}) => {
114
121
  a == null || a(s), h(!1);
115
122
  },
116
123
  [a]
117
- ), z = v(() => {
124
+ ), F = v(() => {
118
125
  f(), a && o && a({
119
126
  ...o,
120
127
  ...Object.fromEntries(
@@ -122,27 +129,27 @@ const J = [
122
129
  )
123
130
  }), h(!1);
124
131
  }, [a, f, o, t]);
125
- return /* @__PURE__ */ e.jsxs(I, { open: N, onOpenChange: h, children: [
126
- /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsx(
127
- l,
132
+ return /* @__PURE__ */ e.jsxs(P, { open: S, onOpenChange: h, children: [
133
+ /* @__PURE__ */ e.jsx(T, { ...m, children: /* @__PURE__ */ e.jsx(
134
+ c,
128
135
  {
129
136
  asChild: !0,
130
137
  size: "sm",
131
138
  variant: "secondary",
132
139
  className: "ml-auto px-3",
133
- ...d,
140
+ ...M,
134
141
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
135
- c ? /* @__PURE__ */ e.jsx(B, { size: 20 }) : /* @__PURE__ */ e.jsx(H, { size: 20 }),
142
+ w ? /* @__PURE__ */ e.jsx(Q, { className: "size-5" }) : /* @__PURE__ */ e.jsx(X, { className: "size-5" }),
136
143
  " ",
137
- /* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children: n("Filter") }),
138
- /* @__PURE__ */ e.jsx(V, {})
144
+ /* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children: n || "Filter" }),
145
+ /* @__PURE__ */ e.jsx(J, {})
139
146
  ] })
140
147
  }
141
148
  ) }),
142
- /* @__PURE__ */ e.jsx(O, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(E, { ...j, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S(_), className: "space-y-2", children: [
149
+ /* @__PURE__ */ e.jsx(V, { side: "bottom", align: "end", ...d, children: /* @__PURE__ */ e.jsx(I, { ...j, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: $(E), className: "space-y-2", children: [
143
150
  /* @__PURE__ */ e.jsx("div", { className: "h-full shrink p-1", children: t.map(
144
151
  (s) => s.options ? /* @__PURE__ */ e.jsx(
145
- C,
152
+ B,
146
153
  {
147
154
  control: y,
148
155
  name: s.name,
@@ -153,7 +160,7 @@ const J = [
153
160
  },
154
161
  s.name
155
162
  ) : /* @__PURE__ */ e.jsx(
156
- R,
163
+ W,
157
164
  {
158
165
  control: y,
159
166
  placeholder: s.placeholder,
@@ -165,21 +172,21 @@ const J = [
165
172
  ) }),
166
173
  /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 justify-end gap-2", children: [
167
174
  /* @__PURE__ */ e.jsx(
168
- l,
175
+ c,
169
176
  {
170
177
  variant: "destructive",
171
178
  type: "reset",
172
179
  size: "sm",
173
- onClick: z,
174
- children: n("Reset")
180
+ onClick: F,
181
+ children: p || "Reset"
175
182
  }
176
183
  ),
177
- /* @__PURE__ */ e.jsx(l, { type: "submit", size: "sm", children: n("Apply") })
184
+ /* @__PURE__ */ e.jsx(c, { type: "submit", size: "sm", children: N || "Apply" })
178
185
  ] })
179
186
  ] }) }) })
180
187
  ] });
181
188
  });
182
189
  export {
183
- le as F,
184
- ce as S
190
+ he as F,
191
+ pe as S
185
192
  };
@@ -0,0 +1,21 @@
1
+ "use strict";const e=require("./jsx-runtime-h4oGeKUK.cjs"),b=require("./input-mask-DBLFIvhN-C_0RAR2l.cjs"),i=require("./button-CdZDBhmr-3yMPCRDo.cjs"),z=require("./utils-B6fNqzRf-BNysSCt9.cjs"),F=require("./useTranslation-CZf20ucv.cjs"),u=require("./createLucideIcon-BnAj0RnC.cjs"),o=require("react"),$=require("./lodash-C5w_OPmE.cjs"),j=require("./popover-OZcfKDD9-KUWOsIOs.cjs"),B=require("./MyInput-OECIw9XS.cjs"),C=require("./MySelect-ClBq6zbD.cjs"),O=require("./useFilter-Cwz8oftI.cjs");/**
2
+ * @license lucide-react v0.511.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const A=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T=u.createLucideIcon("chevron-down",A);/**
7
+ * @license lucide-react v0.511.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const W=[["path",{d:"M10 18h4",key:"1ulq68"}],["path",{d:"M11 6H3",key:"1u26ik"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"M18 9V3",key:"xwwp7m"}],["path",{d:"M7 12h8",key:"7a1bxv"}]],P=u.createLucideIcon("list-filter-plus",W);/**
12
+ * @license lucide-react v0.511.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const V=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Z=u.createLucideIcon("list-filter",V);/**
17
+ * @license lucide-react v0.511.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const G=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=u.createLucideIcon("search",G),K=({name:l="search",defaultValue:n,onSearchChange:r,placeholder:t,className:c,...y})=>{const{t:x}=F.useTranslation(),p=a=>{const d=new FormData(a.currentTarget);r(d.get(l)||void 0),a.preventDefault(),a.stopPropagation()};return e.jsxRuntimeExports.jsxs("form",{className:z.mo("relative w-full max-w-64 min-w-40",c),onSubmit:p,children:[e.jsxRuntimeExports.jsx(b.yp,{...y,className:"h-8 rounded-lg",name:l,placeholder:t||x("Search..."),defaultValue:n?`${n}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",size:"sm",children:e.jsxRuntimeExports.jsx(H,{})})]})},J=o.memo(function({filters:n,params:r,onFilter:t,onChange:c,onCancel:y,triggerProps:x,contentProps:p,title:a,resetText:d,applyText:v,...N}){const[q,f]=o.useState(!1),[M,m]=o.useState(!1),{form:E}=O.useFilter({params:r}),{watch:w,getValues:S,handleSubmit:g,control:R,reset:k}=E;o.useEffect(()=>{let s=!1;n.map(L=>{const h=$.lodashExports.get(r,`${L.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),f(s)})},[n,r]);const I=w();o.useEffect(()=>{c==null||c(S())},[I]);const _=o.useCallback((s={})=>{t==null||t(s),m(!1)},[t]),D=o.useCallback(()=>{k(),t&&r&&t({...r,...Object.fromEntries(n.map(s=>[s.name,void 0]))}),m(!1)},[t,k,r,n]);return e.jsxRuntimeExports.jsxs(j._e,{open:M,onOpenChange:m,children:[e.jsxRuntimeExports.jsx(j.we,{...x,children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...N,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[q?e.jsxRuntimeExports.jsx(P,{className:"size-5"}):e.jsxRuntimeExports.jsx(Z,{className:"size-5"})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:a||"Filter"}),e.jsxRuntimeExports.jsx(T,{})]})})}),e.jsxRuntimeExports.jsx(j.ue,{side:"bottom",align:"end",...p,children:e.jsxRuntimeExports.jsx(b.Gx,{...E,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:g(_),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:n.map(s=>s.options?e.jsxRuntimeExports.jsx(C.MySelect,{control:R,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(B.MyInput,{control:R,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:D,children:d||"Reset"}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:v||"Apply"})]})]})})})]})});exports.FilterWrapper=J;exports.Search=K;