dgz-ui-shared 1.1.10 → 1.1.11

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.
@@ -0,0 +1,21 @@
1
+ "use strict";const e=require("./jsx-runtime-DUiatUiq.cjs"),k=require("./input-mask-dM3pU4zY-BGPzB-Vl.cjs"),a=require("./button-Bp2lHjov-D9UnCnYX.cjs"),_=require("./utils-B6fNqzRf-BNysSCt9.cjs"),b=require("./useTranslation-CZf20ucv.cjs"),u=require("./createLucideIcon-BnAj0RnC.cjs"),c=require("react"),z=require("./lodash-C5w_OPmE.cjs"),h=require("./popover-HTqpqYpJ-CIGEX_0q.cjs"),I=require("./MyInput-BnOpkwyE.cjs"),L=require("./MySelect-BSBolaFb.cjs"),$=require("./useFilter-CiORTEHP.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 D=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],F=u.createLucideIcon("chevron-down",D);/**
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 T=[["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"}]],O=u.createLucideIcon("list-filter-plus",T);/**
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 A=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],B=u.createLucideIcon("list-filter",A);/**
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 C=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=u.createLucideIcon("search",C),W=({name:l="search",defaultValue:n,onSearchChange:r,className:t,...i})=>{const{t:j}=b.useTranslation(),p=o=>{const x=new FormData(o.currentTarget);r(x.get(l)||void 0),o.preventDefault(),o.stopPropagation()};return e.jsxRuntimeExports.jsxs("form",{className:_.mo("relative w-full max-w-64 min-w-40",t),onSubmit:p,children:[e.jsxRuntimeExports.jsx(k.Xf,{...i,className:"h-8 rounded-lg",name:l,placeholder:j("Search..."),defaultValue:n?`${n}`:""}),e.jsxRuntimeExports.jsx(a.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,{})})]})},P=c.memo(function({filters:n,params:r,onFilter:t,onChange:i,onCancel:j,...p}){const{t:o}=b.useTranslation(),[x,q]=c.useState(!1),[v,d]=c.useState(!1),{form:y}=$.useFilter({params:r}),{watch:M,getValues:f,handleSubmit:N,control:E,reset:R}=y;c.useEffect(()=>{let s=!1;n.map(g=>{const m=z.lodashExports.get(r,`${g.name}`);(Array.isArray(m)?m.length>0:m)&&(s=!0),q(s)})},[n,r]),c.useEffect(()=>{i==null||i(f())},[M()]);const w=c.useCallback((s={})=>{t==null||t(s),d(!1)},[t]),S=c.useCallback(()=>{R(),t&&r&&t({...r,...Object.fromEntries(n.map(s=>[s.name,void 0]))}),d(!1)},[t,R,r,n]);return e.jsxRuntimeExports.jsxs(h.Oe,{open:v,onOpenChange:d,children:[e.jsxRuntimeExports.jsx(h._e,{children:e.jsxRuntimeExports.jsx(a.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...p,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[x?e.jsxRuntimeExports.jsx(O,{size:20}):e.jsxRuntimeExports.jsx(B,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:o("Filter")}),e.jsxRuntimeExports.jsx(F,{})]})})}),e.jsxRuntimeExports.jsx(h.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(k.vw,{...y,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:N(w),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:n.map(s=>s.options?e.jsxRuntimeExports.jsx(L.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(I.MyInput,{control:E,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(a.u,{variant:"destructive",type:"reset",size:"sm",onClick:S,children:o("Reset")}),e.jsxRuntimeExports.jsx(a.u,{type:"submit",size:"sm",children:o("Apply")})]})]})})})]})});exports.FilterWrapper=P;exports.Search=W;
@@ -1,21 +1,22 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { X as O, v as D } from "./input-mask-dM3pU4zY-Bm-Kuy6j.js";
3
- import { u as n } from "./button-Bp2lHjov-BTlHPcva.js";
3
+ import { u as c } from "./button-Bp2lHjov-BTlHPcva.js";
4
+ import { m as E } from "./utils-B6fNqzRf-B1_jG1K7.js";
4
5
  import { u as v } from "./useTranslation-dH-uwymc.js";
5
- import { c } from "./createLucideIcon-B950nf2d.js";
6
- import { memo as E, useState as y, useEffect as f, useCallback as k } from "react";
7
- import { l as F } from "./lodash-CYNxjS-I.js";
8
- import { O as q, _ as A, u as I } from "./popover-HTqpqYpJ-CIljcfgV.js";
9
- import { M as L } from "./MyInput-DtojM9_9.js";
10
- import { M as R } from "./MySelect-Dyou9nH2.js";
11
- import { u as C } from "./useFilter-DMpxv27U.js";
6
+ import { c as l } from "./createLucideIcon-B950nf2d.js";
7
+ import { memo as F, useState as f, useEffect as k, useCallback as b } from "react";
8
+ import { l as q } from "./lodash-CYNxjS-I.js";
9
+ import { O as A, _ as I, u as L } from "./popover-HTqpqYpJ-CIljcfgV.js";
10
+ import { M as R } from "./MyInput-DtojM9_9.js";
11
+ import { M as C } from "./MySelect-Dyou9nH2.js";
12
+ import { u as P } from "./useFilter-DMpxv27U.js";
12
13
  /**
13
14
  * @license lucide-react v0.511.0 - ISC
14
15
  *
15
16
  * This source code is licensed under the ISC license.
16
17
  * See the LICENSE file in the root directory of this source tree.
17
18
  */
18
- const T = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], V = c("chevron-down", T);
19
+ const T = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], V = l("chevron-down", T);
19
20
  /**
20
21
  * @license lucide-react v0.511.0 - ISC
21
22
  *
@@ -28,7 +29,7 @@ const W = [
28
29
  ["path", { d: "M15 6h6", key: "1jlkvy" }],
29
30
  ["path", { d: "M18 9V3", key: "xwwp7m" }],
30
31
  ["path", { d: "M7 12h8", key: "7a1bxv" }]
31
- ], X = c("list-filter-plus", W);
32
+ ], X = l("list-filter-plus", W);
32
33
  /**
33
34
  * @license lucide-react v0.511.0 - ISC
34
35
  *
@@ -39,87 +40,90 @@ const B = [
39
40
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
40
41
  ["path", { d: "M7 12h10", key: "b7w52i" }],
41
42
  ["path", { d: "M10 18h4", key: "1ulq68" }]
42
- ], H = c("list-filter", B);
43
+ ], H = l("list-filter", B);
43
44
  /**
44
45
  * @license lucide-react v0.511.0 - ISC
45
46
  *
46
47
  * This source code is licensed under the ISC license.
47
48
  * See the LICENSE file in the root directory of this source tree.
48
49
  */
49
- const P = [
50
+ const G = [
50
51
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
51
52
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
52
- ], G = c("search", P), re = ({
53
- name: l = "search",
54
- defaultValue: a,
55
- onSearchChange: o
53
+ ], J = l("search", G), ce = ({
54
+ name: i = "search",
55
+ defaultValue: t,
56
+ onSearchChange: o,
57
+ className: a,
58
+ ...n
56
59
  }) => {
57
- const { t } = v(), r = (i) => {
58
- const m = new FormData(i.currentTarget);
59
- o(m.get(l) || void 0), i.preventDefault();
60
+ const { t: u } = v(), m = (r) => {
61
+ const d = new FormData(r.currentTarget);
62
+ o(d.get(i) || void 0), r.preventDefault(), r.stopPropagation();
60
63
  };
61
64
  return /* @__PURE__ */ e.jsxs(
62
65
  "form",
63
66
  {
64
- className: "relative w-full max-w-64 min-w-40",
65
- onSubmit: r,
67
+ className: E("relative w-full max-w-64 min-w-40", a),
68
+ onSubmit: m,
66
69
  children: [
67
70
  /* @__PURE__ */ e.jsx(
68
71
  O,
69
72
  {
73
+ ...n,
70
74
  className: "h-8 rounded-lg",
71
- name: l,
72
- placeholder: t("Search..."),
73
- defaultValue: a ? `${a}` : ""
75
+ name: i,
76
+ placeholder: u("Search..."),
77
+ defaultValue: t ? `${t}` : ""
74
78
  }
75
79
  ),
76
80
  /* @__PURE__ */ e.jsx(
77
- n,
81
+ c,
78
82
  {
79
83
  type: "submit",
80
84
  variant: "ghost",
81
85
  className: "text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",
82
86
  size: "sm",
83
- children: /* @__PURE__ */ e.jsx(G, {})
87
+ children: /* @__PURE__ */ e.jsx(J, {})
84
88
  }
85
89
  )
86
90
  ]
87
91
  }
88
92
  );
89
- }, ne = E(function({
90
- filters: a,
93
+ }, le = F(function({
94
+ filters: t,
91
95
  params: o,
92
- onFilter: t,
93
- onChange: r,
94
- onCancel: i,
96
+ onFilter: a,
97
+ onChange: n,
98
+ onCancel: u,
95
99
  ...m
96
100
  }) {
97
- const { t: d } = v(), [b, M] = y(!1), [N, h] = y(!1), { form: u } = C({ params: o }), { watch: w, getValues: g, handleSubmit: S, control: x, reset: j } = u;
98
- f(() => {
101
+ const { t: r } = v(), [d, M] = f(!1), [N, p] = f(!1), { form: x } = P({ params: o }), { watch: w, getValues: g, handleSubmit: S, control: j, reset: y } = x;
102
+ k(() => {
99
103
  let s = !1;
100
- a.map(($) => {
101
- const p = F.get(o, `${$.name}`);
102
- (Array.isArray(p) ? p.length > 0 : p) && (s = !0), M(s);
104
+ t.map(($) => {
105
+ const h = q.get(o, `${$.name}`);
106
+ (Array.isArray(h) ? h.length > 0 : h) && (s = !0), M(s);
103
107
  });
104
- }, [a, o]), f(() => {
105
- r == null || r(g());
108
+ }, [t, o]), k(() => {
109
+ n == null || n(g());
106
110
  }, [w()]);
107
- const _ = k(
111
+ const _ = b(
108
112
  (s = {}) => {
109
- t == null || t(s), h(!1);
113
+ a == null || a(s), p(!1);
110
114
  },
111
- [t]
112
- ), z = k(() => {
113
- j(), t && o && t({
115
+ [a]
116
+ ), z = b(() => {
117
+ y(), a && o && a({
114
118
  ...o,
115
119
  ...Object.fromEntries(
116
- a.map((s) => [s.name, void 0])
120
+ t.map((s) => [s.name, void 0])
117
121
  )
118
- }), h(!1);
119
- }, [t, j, o, a]);
120
- return /* @__PURE__ */ e.jsxs(q, { open: N, onOpenChange: h, children: [
121
- /* @__PURE__ */ e.jsx(A, { children: /* @__PURE__ */ e.jsx(
122
- n,
122
+ }), p(!1);
123
+ }, [a, y, o, t]);
124
+ return /* @__PURE__ */ e.jsxs(A, { open: N, onOpenChange: p, children: [
125
+ /* @__PURE__ */ e.jsx(I, { children: /* @__PURE__ */ e.jsx(
126
+ c,
123
127
  {
124
128
  asChild: !0,
125
129
  size: "sm",
@@ -127,19 +131,19 @@ const P = [
127
131
  className: "ml-auto px-3",
128
132
  ...m,
129
133
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
130
- b ? /* @__PURE__ */ e.jsx(X, { size: 20 }) : /* @__PURE__ */ e.jsx(H, { size: 20 }),
134
+ d ? /* @__PURE__ */ e.jsx(X, { size: 20 }) : /* @__PURE__ */ e.jsx(H, { size: 20 }),
131
135
  " ",
132
- /* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children: d("Filter") }),
136
+ /* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children: r("Filter") }),
133
137
  /* @__PURE__ */ e.jsx(V, {})
134
138
  ] })
135
139
  }
136
140
  ) }),
137
- /* @__PURE__ */ e.jsx(I, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(D, { ...u, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S(_), className: "space-y-2", children: [
138
- /* @__PURE__ */ e.jsx("div", { className: "h-full shrink p-1", children: a.map(
141
+ /* @__PURE__ */ e.jsx(L, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(D, { ...x, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: S(_), className: "space-y-2", children: [
142
+ /* @__PURE__ */ e.jsx("div", { className: "h-full shrink p-1", children: t.map(
139
143
  (s) => s.options ? /* @__PURE__ */ e.jsx(
140
- R,
144
+ C,
141
145
  {
142
- control: x,
146
+ control: j,
143
147
  name: s.name,
144
148
  placeholder: s.placeholder,
145
149
  isMulti: s.isMulti,
@@ -148,9 +152,9 @@ const P = [
148
152
  },
149
153
  s.name
150
154
  ) : /* @__PURE__ */ e.jsx(
151
- L,
155
+ R,
152
156
  {
153
- control: x,
157
+ control: j,
154
158
  placeholder: s.placeholder,
155
159
  name: s.name,
156
160
  label: s.label
@@ -160,21 +164,21 @@ const P = [
160
164
  ) }),
161
165
  /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 justify-end gap-2", children: [
162
166
  /* @__PURE__ */ e.jsx(
163
- n,
167
+ c,
164
168
  {
165
169
  variant: "destructive",
166
170
  type: "reset",
167
171
  size: "sm",
168
172
  onClick: z,
169
- children: d("Reset")
173
+ children: r("Reset")
170
174
  }
171
175
  ),
172
- /* @__PURE__ */ e.jsx(n, { type: "submit", size: "sm", children: d("Apply") })
176
+ /* @__PURE__ */ e.jsx(c, { type: "submit", size: "sm", children: r("Apply") })
173
177
  ] })
174
178
  ] }) }) })
175
179
  ] });
176
180
  });
177
181
  export {
178
- ne as F,
179
- re as S
182
+ le as F,
183
+ ce as S
180
184
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),U=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),N=require("../../dropdown-menu-BceuJw0L-CubE3SM3.cjs"),T=require("../../MyLimitSelect-Cx1EjMnR.cjs"),H=require("../../index-CGv7FLNy.cjs"),n=require("react"),y=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),c=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),A=require("../../useSortable-ByFhUHQb.cjs"),B=require("../../input-mask-dM3pU4zY-BGPzB-Vl.cjs"),S=require("../../SortOrder-81BrXp3i.cjs"),X=require("../../Empty--unTFnpg.cjs"),L=require("../../createLucideIcon-BnAj0RnC.cjs"),V=require("../../FilterWrapper-EFpCkvT8.cjs"),K=require("../../Loader-BMHIikqX.cjs"),C=require("../../Actions-BYWRve24.cjs"),P=require("../../ExportData-BfvmBxMk.cjs"),ee=require("../../useTranslation-CZf20ucv.cjs"),W=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("table",{ref:i,className:c.mo("w-full caption-bottom text-sm",s),...t}));W.displayName="Table";const Z=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("thead",{ref:i,className:c.mo("[&_tr]:border-b",s),...t}));Z.displayName="TableHeader";const J=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tbody",{ref:i,className:c.mo("[&_tr:last-child]:border-0",s),...t}));J.displayName="TableBody";const se=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tfoot",{ref:i,className:c.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...t}));se.displayName="TableFooter";const M=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tr",{ref:i,className:c.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t}));M.displayName="TableRow";const q=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("th",{ref:i,className:c.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...t}));q.displayName="TableHead";const w=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("td",{ref:i,className:c.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));w.displayName="TableCell";const te=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("caption",{ref:i,className:c.mo("text-muted-foreground mt-4 text-sm",s),...t}));te.displayName="TableCaption";/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),U=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),N=require("../../dropdown-menu-BceuJw0L-CubE3SM3.cjs"),T=require("../../MyLimitSelect-Cx1EjMnR.cjs"),H=require("../../index-CGv7FLNy.cjs"),n=require("react"),y=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),c=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),A=require("../../useSortable-ByFhUHQb.cjs"),B=require("../../input-mask-dM3pU4zY-BGPzB-Vl.cjs"),S=require("../../SortOrder-81BrXp3i.cjs"),X=require("../../Empty--unTFnpg.cjs"),L=require("../../createLucideIcon-BnAj0RnC.cjs"),V=require("../../FilterWrapper-BfxX5EuD.cjs"),K=require("../../Loader-BMHIikqX.cjs"),C=require("../../Actions-BYWRve24.cjs"),P=require("../../ExportData-BfvmBxMk.cjs"),ee=require("../../useTranslation-CZf20ucv.cjs"),W=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("table",{ref:i,className:c.mo("w-full caption-bottom text-sm",s),...t}));W.displayName="Table";const Z=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("thead",{ref:i,className:c.mo("[&_tr]:border-b",s),...t}));Z.displayName="TableHeader";const J=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tbody",{ref:i,className:c.mo("[&_tr:last-child]:border-0",s),...t}));J.displayName="TableBody";const se=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tfoot",{ref:i,className:c.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...t}));se.displayName="TableFooter";const M=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tr",{ref:i,className:c.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t}));M.displayName="TableRow";const q=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("th",{ref:i,className:c.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...t}));q.displayName="TableHead";const w=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("td",{ref:i,className:c.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));w.displayName="TableCell";const te=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("caption",{ref:i,className:c.mo("text-muted-foreground mt-4 text-sm",s),...t}));te.displayName="TableCaption";/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -12,7 +12,7 @@ import { Z as $ } from "../../input-mask-dM3pU4zY-Bm-Kuy6j.js";
12
12
  import { S as q } from "../../SortOrder-CwuehjY1.js";
13
13
  import { E as re } from "../../Empty--aMfJ9Jw.js";
14
14
  import { c as _ } from "../../createLucideIcon-B950nf2d.js";
15
- import { S as ae, F as ce } from "../../FilterWrapper-CqGjL11i.js";
15
+ import { S as ae, F as ce } from "../../FilterWrapper-Blfvpt-j.js";
16
16
  import { L as oe } from "../../Loader-Bbz39yY0.js";
17
17
  import { A as xe } from "../../Actions-Ch2gh0m4.js";
18
18
  import { E as me } from "../../ExportData-j0k5_xKx.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../FilterWrapper-EFpCkvT8.cjs"),t=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),p=require("../../input-mask-dM3pU4zY-BGPzB-Vl.cjs"),c=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),l=require("../../index-CGv7FLNy.cjs"),x=require("../../lodash-C5w_OPmE.cjs"),d=require("../../Keyboard-kyPAAQWP.cjs"),h=require("../../useTranslation-CZf20ucv.cjs"),j=({placeholder:r,onSearchChange:s})=>{const{t:i}=h.useTranslation(),[o,a]=u.useState("");return t.jsxRuntimeExports.jsxs("div",{className:"relative my-2 w-full",children:[t.jsxRuntimeExports.jsx(p.Xf,{placeholder:r||i("Type text and press CTRL + Enter"),onInput:e=>a(x.lodashExports.get(e,"target.value","")),onKeyUp:e=>{e.key===d.Keyboard.ENTER&&(e.ctrlKey&&s(o||void 0),e.stopPropagation(),e.preventDefault())}}),t.jsxRuntimeExports.jsx(c.u,{type:"button",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",onClick:()=>s(o),children:t.jsxRuntimeExports.jsx(l.pv,{})})]})};exports.FilterWrapper=n.FilterWrapper;exports.Search=n.Search;exports.SearchWithCtrl=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../FilterWrapper-BfxX5EuD.cjs"),t=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),p=require("../../input-mask-dM3pU4zY-BGPzB-Vl.cjs"),c=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),l=require("../../index-CGv7FLNy.cjs"),x=require("../../lodash-C5w_OPmE.cjs"),d=require("../../Keyboard-kyPAAQWP.cjs"),h=require("../../useTranslation-CZf20ucv.cjs"),j=({placeholder:r,onSearchChange:s})=>{const{t:i}=h.useTranslation(),[o,a]=u.useState("");return t.jsxRuntimeExports.jsxs("div",{className:"relative my-2 w-full",children:[t.jsxRuntimeExports.jsx(p.Xf,{placeholder:r||i("Type text and press CTRL + Enter"),onInput:e=>a(x.lodashExports.get(e,"target.value","")),onKeyUp:e=>{e.key===d.Keyboard.ENTER&&(e.ctrlKey&&s(o||void 0),e.stopPropagation(),e.preventDefault())}}),t.jsxRuntimeExports.jsx(c.u,{type:"button",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",onClick:()=>s(o),children:t.jsxRuntimeExports.jsx(l.pv,{})})]})};exports.FilterWrapper=n.FilterWrapper;exports.Search=n.Search;exports.SearchWithCtrl=j;
@@ -1,4 +1,4 @@
1
- import { F as T, S as N } from "../../FilterWrapper-CqGjL11i.js";
1
+ import { F as T, S as N } from "../../FilterWrapper-Blfvpt-j.js";
2
2
  import { j as t } from "../../jsx-runtime-C5mzlN2N.js";
3
3
  import { useState as i } from "react";
4
4
  import { X as m } from "../../input-mask-dM3pU4zY-Bm-Kuy6j.js";
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],w=y.k("x",b),R=s.ve,v=s.xe,k=s.Ce,i=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Re,{ref:t,className:d.mo("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...a}));i.displayName=s.Re.displayName;const m=c.forwardRef(({className:e,children:a,hasCloseButton:t,...r},l)=>o.ae.jsxs(k,{children:[o.ae.jsx(i,{}),o.ae.jsxs(s._e,{ref:l,className:d.mo("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...r,children:[a,t&&o.ae.jsxs(s.Pe,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[o.ae.jsx(w,{className:"size-4"}),o.ae.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s._e.displayName;const x=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col space-y-1.5 text-center sm:text-left",e),...a});x.displayName="DialogHeader";const u=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});u.displayName="DialogFooter";const f=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.he,{ref:t,className:d.mo("text-lg leading-none font-semibold tracking-tight",e),...a}));f.displayName=s.he.displayName;const p=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Ee,{ref:t,className:d.mo("text-muted-foreground text-sm",e),...a}));p.displayName=s.Ee.displayName;const E=({header:e,footer:a,trigger:t,children:r,size:l="lg",className:j,...g})=>n.jsxRuntimeExports.jsxs(R,{...g,children:[t&&n.jsxRuntimeExports.jsx(v,{asChild:!0,children:t}),n.jsxRuntimeExports.jsxs(m,{className:d.mo("data-[state=open]:animate-contentShowTop top-4 bottom-auto max-h-[calc(100vh-2rem)] max-w-lg translate-y-0 overflow-y-auto",l==="xl"&&"max-w-xl",l==="2xl"&&"max-w-2xl",l==="3xl"&&"max-w-3xl",l==="4xl"&&"max-w-5xl",l==="5xl"&&"max-w-5xl",l==="6xl"&&"max-w-6xl",l==="7xl"&&"max-w-7xl",l==="full"&&"max-w-[95%]",j),children:[n.jsxRuntimeExports.jsxs(x,{children:[n.jsxRuntimeExports.jsx(f,{children:e}),n.jsxRuntimeExports.jsx(p,{className:"hidden"})]}),r,a&&n.jsxRuntimeExports.jsx(u,{children:a})]})]});exports.MyModal=E;
6
+ */const b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],w=y.k("x",b),R=s.ve,v=s.xe,k=s.Ce,i=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Re,{ref:t,className:d.mo("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...a}));i.displayName=s.Re.displayName;const m=c.forwardRef(({className:e,children:a,hasCloseButton:t,...r},l)=>o.ae.jsxs(k,{children:[o.ae.jsx(i,{}),o.ae.jsxs(s._e,{ref:l,className:d.mo("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...r,children:[a,t&&o.ae.jsxs(s.Pe,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[o.ae.jsx(w,{className:"size-4"}),o.ae.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s._e.displayName;const x=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col space-y-1.5 text-center sm:text-left",e),...a});x.displayName="DialogHeader";const u=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});u.displayName="DialogFooter";const f=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.he,{ref:t,className:d.mo("text-lg leading-none font-semibold tracking-tight",e),...a}));f.displayName=s.he.displayName;const p=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Ee,{ref:t,className:d.mo("text-muted-foreground text-sm",e),...a}));p.displayName=s.Ee.displayName;const E=({header:e,footer:a,trigger:t,children:r,size:l="lg",className:j,...g})=>n.jsxRuntimeExports.jsxs(R,{...g,children:[t&&n.jsxRuntimeExports.jsx(v,{asChild:!0,children:t}),n.jsxRuntimeExports.jsxs(m,{className:d.mo("data-[state=open]:animate-contentShowTop top-4 bottom-auto max-h-[calc(100vh-2rem)] max-w-lg translate-y-0 overflow-y-auto",l==="xl"&&"max-w-xl",l==="2xl"&&"max-w-2xl",l==="3xl"&&"max-w-3xl",l==="4xl"&&"max-w-5xl",l==="5xl"&&"max-w-5xl",l==="6xl"&&"max-w-6xl",l==="7xl"&&"max-w-7xl",l==="full"&&"max-w-[95%]",j),children:[n.jsxRuntimeExports.jsxs(x,{children:[n.jsxRuntimeExports.jsx(f,{className:"mb-0",children:e}),n.jsxRuntimeExports.jsx(p,{className:"hidden"})]}),r,a&&n.jsxRuntimeExports.jsx(u,{children:a})]})]});exports.MyModal=E;
@@ -123,7 +123,7 @@ const H = ({
123
123
  ),
124
124
  children: [
125
125
  /* @__PURE__ */ l.jsxs(u, { children: [
126
- /* @__PURE__ */ l.jsx(h, { children: e }),
126
+ /* @__PURE__ */ l.jsx(h, { className: "mb-0", children: e }),
127
127
  /* @__PURE__ */ l.jsx(g, { className: "hidden" })
128
128
  ] }),
129
129
  m,
@@ -1,4 +1,5 @@
1
- export interface SearchProps {
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface SearchProps extends Omit<HTMLAttributes<HTMLInputElement>, 'defaultValue' | 'name'> {
2
3
  name?: string;
3
4
  defaultValue?: FormDataEntryValue | null;
4
5
  onSearchChange: (search?: FormDataEntryValue) => void;
@@ -10,5 +11,5 @@ export interface SearchProps {
10
11
  * @param props.defaultValue - Default search value.
11
12
  * @param props.onSearchChange - Callback fired with submitted value.
12
13
  */
13
- export declare const Search: ({ name, defaultValue, onSearchChange, }: SearchProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const Search: ({ name, defaultValue, onSearchChange, className, ...props }: SearchProps) => import("react/jsx-runtime").JSX.Element;
14
15
  //# sourceMappingURL=Search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../../src/components/filters/Search.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,yCAIpB,WAAW,4CAgCb,CAAC"}
1
+ {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../../src/components/filters/Search.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,6DAMpB,WAAW,4CAkCb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dgz-ui-shared",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,21 +0,0 @@
1
- "use strict";const e=require("./jsx-runtime-DUiatUiq.cjs"),R=require("./input-mask-dM3pU4zY-BGPzB-Vl.cjs"),a=require("./button-Bp2lHjov-D9UnCnYX.cjs"),k=require("./useTranslation-CZf20ucv.cjs"),i=require("./createLucideIcon-BnAj0RnC.cjs"),o=require("react"),_=require("./lodash-C5w_OPmE.cjs"),h=require("./popover-HTqpqYpJ-CIGEX_0q.cjs"),I=require("./MyInput-BnOpkwyE.cjs"),z=require("./MySelect-BSBolaFb.cjs"),L=require("./useFilter-CiORTEHP.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 $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D=i.createLucideIcon("chevron-down",$);/**
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 F=[["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"}]],T=i.createLucideIcon("list-filter-plus",F);/**
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 O=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],A=i.createLucideIcon("list-filter",O);/**
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 C=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=i.createLucideIcon("search",C),W=({name:u="search",defaultValue:n,onSearchChange:r})=>{const{t}=k.useTranslation(),c=l=>{const x=new FormData(l.currentTarget);r(x.get(u)||void 0),l.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative w-full max-w-64 min-w-40",onSubmit:c,children:[e.jsxRuntimeExports.jsx(R.Xf,{className:"h-8 rounded-lg",name:u,placeholder:t("Search..."),defaultValue:n?`${n}`:""}),e.jsxRuntimeExports.jsx(a.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,{})})]})},B=o.memo(function({filters:n,params:r,onFilter:t,onChange:c,onCancel:l,...x}){const{t:p}=k.useTranslation(),[b,v]=o.useState(!1),[q,d]=o.useState(!1),{form:j}=L.useFilter({params:r}),{watch:M,getValues:N,handleSubmit:f,control:y,reset:E}=j;o.useEffect(()=>{let s=!1;n.map(g=>{const m=_.lodashExports.get(r,`${g.name}`);(Array.isArray(m)?m.length>0:m)&&(s=!0),v(s)})},[n,r]),o.useEffect(()=>{c==null||c(N())},[M()]);const w=o.useCallback((s={})=>{t==null||t(s),d(!1)},[t]),S=o.useCallback(()=>{E(),t&&r&&t({...r,...Object.fromEntries(n.map(s=>[s.name,void 0]))}),d(!1)},[t,E,r,n]);return e.jsxRuntimeExports.jsxs(h.Oe,{open:q,onOpenChange:d,children:[e.jsxRuntimeExports.jsx(h._e,{children:e.jsxRuntimeExports.jsx(a.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...x,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[b?e.jsxRuntimeExports.jsx(T,{size:20}):e.jsxRuntimeExports.jsx(A,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:p("Filter")}),e.jsxRuntimeExports.jsx(D,{})]})})}),e.jsxRuntimeExports.jsx(h.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(R.vw,{...j,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:f(w),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:n.map(s=>s.options?e.jsxRuntimeExports.jsx(z.MySelect,{control:y,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(I.MyInput,{control:y,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(a.u,{variant:"destructive",type:"reset",size:"sm",onClick:S,children:p("Reset")}),e.jsxRuntimeExports.jsx(a.u,{type:"submit",size:"sm",children:p("Apply")})]})]})})})]})});exports.FilterWrapper=B;exports.Search=W;