dgz-ui-shared 1.0.59 → 1.0.60
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/dist/{FilterWrapper-D3p-_GxF.js → FilterWrapper-C-ddF8lj.js} +43 -43
- package/dist/FilterWrapper-Cq3YXU-5.cjs +21 -0
- package/dist/components/datatable/index.cjs.js +5 -5
- package/dist/components/datatable/index.es.js +99 -102
- package/dist/components/filters/index.cjs.js +1 -1
- package/dist/components/filters/index.es.js +2 -2
- package/dist/components/theme/index.cjs.js +1 -1
- package/dist/components/theme/index.es.js +4 -4
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
- package/dist/types/components/filters/FilterWrapper.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/FilterWrapper-Ba6dGNaQ.cjs +0 -21
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l, { memo as z, useState as y, useEffect as f, useCallback as v } from "react";
|
|
2
2
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
3
|
-
import { y as V, P as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
3
|
+
import { y as V, P as H } from "./radio-group-CqPTye2U-DGs9dBuR.js";
|
|
4
|
+
import { u as n } from "./button-Bp2lHjov-BTlHPcva.js";
|
|
5
|
+
import { u as g } from "./useTranslation-dH-uwymc.js";
|
|
6
6
|
import { c as i } from "./createLucideIcon-B950nf2d.js";
|
|
7
|
-
import { l as
|
|
8
|
-
import { O as
|
|
9
|
-
import { M as
|
|
10
|
-
import { M as
|
|
7
|
+
import { l as Z } from "./lodash-CYNxjS-I.js";
|
|
8
|
+
import { O as $, _ as O, u as B } from "./popover-HTqpqYpJ-B9u7VIkT.js";
|
|
9
|
+
import { M as D } from "./MyInput-CHKuq1qI.js";
|
|
10
|
+
import { M as F } from "./MySelect-N-QzYp6z.js";
|
|
11
11
|
import { u as q } from "./useFilter-DMpxv27U.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.511.0 - ISC
|
|
@@ -49,32 +49,32 @@ const T = [
|
|
|
49
49
|
const G = [
|
|
50
50
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
51
51
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
52
|
-
], J = i("search", G),
|
|
52
|
+
], J = i("search", G), le = ({ color: r = "currentColor", size: t = 24, className: o, ...a }) => l.createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", width: t, height: t, fill: r, ...a, className: "remixicon " + (o || "") }, l.createElement("path", { d: "M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z" })), ce = ({ color: r = "currentColor", size: t = 24, className: o, ...a }) => l.createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", width: t, height: t, fill: r, ...a, className: "remixicon " + (o || "") }, l.createElement("path", { d: "M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z" })), ne = ({ color: r = "currentColor", size: t = 24, className: o, ...a }) => l.createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", width: t, height: t, fill: r, ...a, className: "remixicon " + (o || "") }, l.createElement("path", { d: "M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z" })), ie = ({
|
|
53
53
|
name: r = "search",
|
|
54
54
|
defaultValue: t,
|
|
55
|
-
onSearchChange:
|
|
55
|
+
onSearchChange: o
|
|
56
56
|
}) => {
|
|
57
|
-
const { t:
|
|
57
|
+
const { t: a } = g(), c = (m) => {
|
|
58
58
|
const h = new FormData(m.currentTarget);
|
|
59
|
-
|
|
59
|
+
o(h.get(r)), m.preventDefault();
|
|
60
60
|
};
|
|
61
61
|
return /* @__PURE__ */ e.jsxs(
|
|
62
62
|
"form",
|
|
63
63
|
{
|
|
64
64
|
className: "relative w-full max-w-64 min-w-40",
|
|
65
|
-
onSubmit:
|
|
65
|
+
onSubmit: c,
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ e.jsx(
|
|
68
68
|
V,
|
|
69
69
|
{
|
|
70
70
|
className: "h-8 rounded-lg",
|
|
71
71
|
name: r,
|
|
72
|
-
placeholder:
|
|
72
|
+
placeholder: a("Search..."),
|
|
73
73
|
defaultValue: t ? `${t}` : ""
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
76
|
/* @__PURE__ */ e.jsx(
|
|
77
|
-
|
|
77
|
+
n,
|
|
78
78
|
{
|
|
79
79
|
type: "submit",
|
|
80
80
|
variant: "ghost",
|
|
@@ -88,38 +88,38 @@ const G = [
|
|
|
88
88
|
);
|
|
89
89
|
}, me = z(function({
|
|
90
90
|
filters: t,
|
|
91
|
-
params:
|
|
92
|
-
onFilter:
|
|
93
|
-
onChange:
|
|
91
|
+
params: o,
|
|
92
|
+
onFilter: a,
|
|
93
|
+
onChange: c,
|
|
94
94
|
onCancel: m,
|
|
95
95
|
...h
|
|
96
96
|
}) {
|
|
97
|
-
const { t: d } =
|
|
98
|
-
|
|
97
|
+
const { t: d } = g(), [M, N] = y(!1), [C, p] = y(!1), { form: x } = q({ params: o }), { watch: k, getValues: b, handleSubmit: L, control: j, reset: w } = x;
|
|
98
|
+
f(() => {
|
|
99
99
|
let s = !1;
|
|
100
100
|
t.map((S) => {
|
|
101
|
-
const u =
|
|
102
|
-
(Array.isArray(u) ? u.length > 0 : u) && (s = !0),
|
|
101
|
+
const u = Z.get(o, `${S.name}`);
|
|
102
|
+
(Array.isArray(u) ? u.length > 0 : u) && (s = !0), N(s);
|
|
103
103
|
});
|
|
104
|
-
}, [t,
|
|
105
|
-
|
|
104
|
+
}, [t, o]), f(() => {
|
|
105
|
+
c == null || c(b());
|
|
106
106
|
}, [k()]);
|
|
107
|
-
const _ =
|
|
107
|
+
const _ = v(
|
|
108
108
|
(s = {}) => {
|
|
109
|
-
|
|
109
|
+
a == null || a(s), p(!1);
|
|
110
110
|
},
|
|
111
|
-
[
|
|
112
|
-
), E =
|
|
113
|
-
|
|
114
|
-
...
|
|
111
|
+
[a]
|
|
112
|
+
), E = v(() => {
|
|
113
|
+
w(), a && o && a({
|
|
114
|
+
...o,
|
|
115
115
|
...Object.fromEntries(
|
|
116
116
|
t.map((s) => [s.name, void 0])
|
|
117
117
|
)
|
|
118
118
|
}), p(!1);
|
|
119
|
-
}, [
|
|
120
|
-
return /* @__PURE__ */ e.jsxs(
|
|
121
|
-
/* @__PURE__ */ e.jsx(
|
|
122
|
-
|
|
119
|
+
}, [a, w, o, t]);
|
|
120
|
+
return /* @__PURE__ */ e.jsxs($, { open: C, onOpenChange: p, children: [
|
|
121
|
+
/* @__PURE__ */ e.jsx(O, { children: /* @__PURE__ */ e.jsx(
|
|
122
|
+
n,
|
|
123
123
|
{
|
|
124
124
|
asChild: !0,
|
|
125
125
|
size: "sm",
|
|
@@ -127,17 +127,17 @@ const G = [
|
|
|
127
127
|
className: "ml-auto px-3",
|
|
128
128
|
...h,
|
|
129
129
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
130
|
-
|
|
130
|
+
M ? /* @__PURE__ */ e.jsx(R, { size: 20 }) : /* @__PURE__ */ e.jsx(W, { size: 20 }),
|
|
131
131
|
" ",
|
|
132
132
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:inline", children: d("Filter") }),
|
|
133
133
|
/* @__PURE__ */ e.jsx(I, {})
|
|
134
134
|
] })
|
|
135
135
|
}
|
|
136
136
|
) }),
|
|
137
|
-
/* @__PURE__ */ e.jsx(
|
|
137
|
+
/* @__PURE__ */ e.jsx(B, { side: "bottom", align: "end", className: "", children: /* @__PURE__ */ e.jsx(H, { ...x, children: /* @__PURE__ */ e.jsxs("form", { onSubmit: L(_), className: "space-y-2", children: [
|
|
138
138
|
/* @__PURE__ */ e.jsx("div", { className: "h-full shrink p-1", children: t.map(
|
|
139
139
|
(s) => s.options ? /* @__PURE__ */ e.jsx(
|
|
140
|
-
|
|
140
|
+
F,
|
|
141
141
|
{
|
|
142
142
|
control: j,
|
|
143
143
|
name: s.name,
|
|
@@ -148,7 +148,7 @@ const G = [
|
|
|
148
148
|
},
|
|
149
149
|
s.name
|
|
150
150
|
) : /* @__PURE__ */ e.jsx(
|
|
151
|
-
|
|
151
|
+
D,
|
|
152
152
|
{
|
|
153
153
|
control: j,
|
|
154
154
|
placeholder: s.placeholder,
|
|
@@ -160,7 +160,7 @@ const G = [
|
|
|
160
160
|
) }),
|
|
161
161
|
/* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 justify-end gap-2", children: [
|
|
162
162
|
/* @__PURE__ */ e.jsx(
|
|
163
|
-
|
|
163
|
+
n,
|
|
164
164
|
{
|
|
165
165
|
variant: "destructive",
|
|
166
166
|
type: "reset",
|
|
@@ -169,7 +169,7 @@ const G = [
|
|
|
169
169
|
children: d("Reset")
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsx(n, { type: "submit", size: "sm", children: d("Apply") })
|
|
173
173
|
] })
|
|
174
174
|
] }) }) })
|
|
175
175
|
] });
|
|
@@ -177,7 +177,7 @@ const G = [
|
|
|
177
177
|
export {
|
|
178
178
|
me as F,
|
|
179
179
|
ie as S,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
le as f,
|
|
181
|
+
ne as p,
|
|
182
|
+
ce as y
|
|
183
183
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";const o=require("react"),e=require("./jsx-runtime-DUiatUiq.cjs"),w=require("./radio-group-CqPTye2U-CXc2TUFE.cjs"),i=require("./button-Bp2lHjov-D9UnCnYX.cjs"),v=require("./useTranslation-CZf20ucv.cjs"),l=require("./createLucideIcon-BnAj0RnC.cjs"),L=require("./lodash-C5w_OPmE.cjs"),h=require("./popover-HTqpqYpJ-DkiWPDCk.cjs"),S=require("./MyInput-yriz78UG.cjs"),z=require("./MySelect-rr-aoQ49.cjs"),H=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"}]],I=l.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 V=[["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"}]],$=l.createLucideIcon("list-filter-plus",V);/**
|
|
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 T=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Z=l.createLucideIcon("list-filter",T);/**
|
|
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 B=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F=l.createLucideIcon("search",B),D=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),O=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"})),A=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),P=({name:c="search",defaultValue:t,onSearchChange:r})=>{const{t:n}=v.useTranslation(),a=u=>{const m=new FormData(u.currentTarget);r(m.get(c)),u.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative w-full max-w-64 min-w-40",onSubmit:a,children:[e.jsxRuntimeExports.jsx(w.yl,{className:"h-8 rounded-lg",name:c,placeholder:n("Search..."),defaultValue:t?`${t}`:""}),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(F,{})})]})},W=o.memo(function({filters:t,params:r,onFilter:n,onChange:a,onCancel:u,...m}){const{t:x}=v.useTranslation(),[R,g]=o.useState(!1),[C,p]=o.useState(!1),{form:j}=H.useFilter({params:r}),{watch:M,getValues:N,handleSubmit:b,control:E,reset:y}=j;o.useEffect(()=>{let s=!1;t.map(q=>{const d=L.lodashExports.get(r,`${q.name}`);(Array.isArray(d)?d.length>0:d)&&(s=!0),g(s)})},[t,r]),o.useEffect(()=>{a==null||a(N())},[M()]);const k=o.useCallback((s={})=>{n==null||n(s),p(!1)},[n]),f=o.useCallback(()=>{y(),n&&r&&n({...r,...Object.fromEntries(t.map(s=>[s.name,void 0]))}),p(!1)},[n,y,r,t]);return e.jsxRuntimeExports.jsxs(h.Oe,{open:C,onOpenChange:p,children:[e.jsxRuntimeExports.jsx(h._e,{children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[R?e.jsxRuntimeExports.jsx($,{size:20}):e.jsxRuntimeExports.jsx(Z,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:x("Filter")}),e.jsxRuntimeExports.jsx(I,{})]})})}),e.jsxRuntimeExports.jsx(h.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(w.Ph,{...j,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:b(k),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:t.map(s=>s.options?e.jsxRuntimeExports.jsx(z.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(S.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(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:f,children:x("Reset")}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:x("Apply")})]})]})})})]})});exports.FilterWrapper=W;exports.Search=P;exports.f1=D;exports.pv=A;exports.yn=O;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),V=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),u=require("../../dropdown-menu-BPBcxHRB-towSSPIs.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),V=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),u=require("../../dropdown-menu-BPBcxHRB-towSSPIs.cjs"),q=require("../../MyLimitSelect-BFWr_fUn.cjs"),v=require("../../FilterWrapper-Cq3YXU-5.cjs"),c=require("react"),y=require("../../lodash-C5w_OPmE.cjs"),j=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),a=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),C=require("../../useSortable-DZ6f7Wg7.cjs"),A=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),D=require("../../SortOrder-81BrXp3i.cjs"),W=require("../../Empty--unTFnpg.cjs"),I=require("../../createLucideIcon-BnAj0RnC.cjs"),O=require("../../useTranslation-CZf20ucv.cjs"),$=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("table",{ref:i,className:a.mo("w-full caption-bottom text-sm",s),...t}));$.displayName="Table";const B=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("thead",{ref:i,className:a.mo("[&_tr]:border-b",s),...t}));B.displayName="TableHeader";const H=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("tbody",{ref:i,className:a.mo("[&_tr:last-child]:border-0",s),...t}));H.displayName="TableBody";const G=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("tfoot",{ref:i,className:a.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...t}));G.displayName="TableFooter";const T=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("tr",{ref:i,className:a.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t}));T.displayName="TableRow";const M=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("th",{ref:i,className:a.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...t}));M.displayName="TableHead";const N=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("td",{ref:i,className:a.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));N.displayName="TableCell";const J=c.forwardRef(({className:s,...t},i)=>j.ae.jsx("caption",{ref:i,className:a.mo("text-muted-foreground mt-4 text-sm",s),...t}));J.displayName="TableCaption";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
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 Q=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],S=
|
|
6
|
+
*/const Q=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],S=I.createLucideIcon("arrow-down-wide-narrow",Q);/**
|
|
7
7
|
* @license lucide-react v0.511.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const X=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Y=
|
|
11
|
+
*/const X=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Y=I.createLucideIcon("arrow-up-down",X);/**
|
|
12
12
|
* @license lucide-react v0.511.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Z=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]],P=
|
|
16
|
+
*/const Z=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]],P=I.createLucideIcon("arrow-up-wide-narrow",Z);/**
|
|
17
17
|
* @license lucide-react v0.511.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const K=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ee=
|
|
21
|
+
*/const K=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ee=I.createLucideIcon("refresh-cw",K),U=({rows:s=[],columns:t,onRowClick:i,rowKey:p,params:d={page:1,limit:q.DEFAULT_LIMIT},hasNumbers:h=!1,hasCheckbox:f=!1,selectedItems:L,onSelectedItemsChange:w,onSortOrderChange:n,isStickyHeader:R})=>{const{sortObject:o,handleSort:_}=C.useSortable({sortField:d==null?void 0:d.sortField,sortOrder:d==null?void 0:d.sortField,onSortOrderChange:n}),{selectedRows:m,isRowSelected:E,isAllRowsSelected:g,handleSelectAllRows:b,handleSelectRow:F}=C.useDataTable({rows:s,defaultSelectedRows:L});return c.useEffect(()=>{w&&w(m)},[m]),e.jsxRuntimeExports.jsxs($,{className:"relative",children:[e.jsxRuntimeExports.jsx(B,{className:a.mo("bg-bg",R&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(T,{children:[f&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(A.Tl,{className:"mt-1",checked:g(p),onCheckedChange:r=>b(p,!!r),"aria-label":"Select all"})}),h&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-2",children:"#"}),t.filter(r=>!r.hidden).map(r=>e.jsxRuntimeExports.jsx(M,{style:r.styles,className:a.mo("p-2",r.sortable&&"cursor-pointer"),onClick:()=>_(r.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.name," ",r.sortable&&((o==null?void 0:o.sortField)===r.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(o==null?void 0:o.sortOrder)===D.SortOrder.DESC&&e.jsxRuntimeExports.jsx(S,{size:15}),(o==null?void 0:o.sortOrder)===D.SortOrder.ASC&&e.jsxRuntimeExports.jsx(P,{size:15})]}):e.jsxRuntimeExports.jsx(Y,{size:15}))]})},r.key))]})}),e.jsxRuntimeExports.jsx(H,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((r,k)=>e.jsxRuntimeExports.jsxs(T,{onClick:()=>{i&&i(r)},"data-state":E(r[p])&&"selected",children:[f&&e.jsxRuntimeExports.jsx(N,{className:"w-12 p-3",onClick:l=>l.stopPropagation(),children:e.jsxRuntimeExports.jsx(A.Tl,{className:"mt-1",checked:E(r[p]),onCheckedChange:l=>F(r[p],!!l),"aria-label":"Select row"})}),h&&e.jsxRuntimeExports.jsx(N,{className:"w-12 p-2",children:(d.page-1)*(d.limit||q.DEFAULT_LIMIT)+k+1}),t.filter(l=>!l.hidden).map(l=>e.jsxRuntimeExports.jsx(N,{className:"text-body-xs-medium max-w-xs overflow-hidden p-2 text-ellipsis",style:l.styles,children:l.render?l.render(y.lodashExports.get(r,l.dataIndex),r):y.lodashExports.get(r,l.dataIndex,"")},`${k}-${l.key}`))]},`${r[p]}`)):e.jsxRuntimeExports.jsx(T,{children:e.jsxRuntimeExports.jsx(N,{colSpan:h?f?t.length+2:t.length+1:t.length,children:e.jsxRuntimeExports.jsx(W.Empty,{})})})})]})},se=({dataSource:s,columns:t,onRowClick:i,rowKey:p,hasNumbers:d,hasSearch:h,hasCheckbox:f,hasPagination:L,isStickyHeader:w,onParamChange:n,tableKey:R,filters:o=[],handleFilterChange:_,params:m,hasColumnsVisibilityDropdown:E})=>{const{t:g}=O.useTranslation(),[b,F]=c.useState([]),{formattedColumns:r,handleColumnsChange:k,resetColumns:l}=C.useColumns({key:R,columns:t});return e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(h||E&&R||!y.lodashExports.isEmpty(o))&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"w-full shrink",children:h&&e.jsxRuntimeExports.jsx(v.Search,{defaultValue:y.lodashExports.get(m,"search",""),onSearchChange:x=>({...m,search:x,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[E&&R&&e.jsxRuntimeExports.jsxs(u.Nt,{children:[e.jsxRuntimeExports.jsx(u.jt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(V.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[e.jsxRuntimeExports.jsx(v.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:g("Customize columns")}),e.jsxRuntimeExports.jsx(v.f1,{})]})}),e.jsxRuntimeExports.jsxs(u.ut,{align:"end",children:[e.jsxRuntimeExports.jsxs(u.it,{className:"capitalize",onClick:l,children:[e.jsxRuntimeExports.jsx(ee,{})," ",g("Reset columns")]}),e.jsxRuntimeExports.jsx(u.ft,{}),r.map(x=>e.jsxRuntimeExports.jsx(u.dt,{className:"capitalize",checked:!x.hidden,onCheckedChange:z=>k(x,!z),children:x.name},x.key))]})]}),!y.lodashExports.isEmpty(o)&&e.jsxRuntimeExports.jsx(v.FilterWrapper,{filters:o,onFilter:_})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:e.jsxRuntimeExports.jsx(U,{params:m,rows:s==null?void 0:s.docs,rowKey:p,selectedItems:b,isStickyHeader:w,columns:r,hasCheckbox:f,hasNumbers:d,onRowClick:i,onSelectedItemsChange:F,onSortOrderChange:({sortField:x,sortOrder:z})=>{n==null||n({...m,sortField:x,sortOrder:z})}})}),L&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm",children:e.jsxRuntimeExports.jsx(q.MyLimitSelect,{onLimitChange:x=>n==null?void 0:n({...m,limit:x,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[b.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(q.MyPagination,{onPageChange:x=>n==null?void 0:n({...m,page:x}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=se;exports.MyTable=U;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { j as e } from "../../jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { u as q } from "../../button-Bp2lHjov-BTlHPcva.js";
|
|
3
3
|
import { N as H, j as U, u as V, i as W, f as B, d as G } from "../../dropdown-menu-BPBcxHRB-EjT0ADL9.js";
|
|
4
|
-
import { D as
|
|
5
|
-
import { S as Q, y as X, f as Y, F as Z } from "../../FilterWrapper-
|
|
6
|
-
import { forwardRef as
|
|
4
|
+
import { D as C, a as J, M as O } from "../../MyLimitSelect-Bzc40bxS.js";
|
|
5
|
+
import { S as Q, y as X, f as Y, F as Z } from "../../FilterWrapper-C-ddF8lj.js";
|
|
6
|
+
import { forwardRef as h, useEffect as S, useState as K } from "react";
|
|
7
7
|
import { l as k } from "../../lodash-CYNxjS-I.js";
|
|
8
8
|
import { a as p } from "../../index-DqTIeHVj-CeLMF2B2.js";
|
|
9
9
|
import { m as n } from "../../utils-B6fNqzRf-B1_jG1K7.js";
|
|
10
|
-
import { u as
|
|
10
|
+
import { u as P, a as ee, b as se } from "../../useSortable-B7BkQQIY.js";
|
|
11
11
|
import { T as A } from "../../radio-group-CqPTye2U-DGs9dBuR.js";
|
|
12
|
-
import { S as
|
|
12
|
+
import { S as I } from "../../SortOrder-CwuehjY1.js";
|
|
13
13
|
import { E as te } from "../../Empty--aMfJ9Jw.js";
|
|
14
|
-
import { c as
|
|
14
|
+
import { c as R } from "../../createLucideIcon-B950nf2d.js";
|
|
15
15
|
import { u as le } from "../../useTranslation-dH-uwymc.js";
|
|
16
|
-
const
|
|
17
|
-
({ className: s, ...t },
|
|
16
|
+
const L = h(
|
|
17
|
+
({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
18
18
|
"table",
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
20
|
+
ref: i,
|
|
21
21
|
className: n("w-full caption-bottom text-sm", s),
|
|
22
22
|
...t
|
|
23
23
|
}
|
|
24
24
|
)
|
|
25
25
|
);
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const $ =
|
|
26
|
+
L.displayName = "Table";
|
|
27
|
+
const D = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx("thead", { ref: i, className: n("[&_tr]:border-b", s), ...t }));
|
|
28
|
+
D.displayName = "TableHeader";
|
|
29
|
+
const $ = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
30
30
|
"tbody",
|
|
31
31
|
{
|
|
32
|
-
ref:
|
|
32
|
+
ref: i,
|
|
33
33
|
className: n("[&_tr:last-child]:border-0", s),
|
|
34
34
|
...t
|
|
35
35
|
}
|
|
36
36
|
));
|
|
37
37
|
$.displayName = "TableBody";
|
|
38
|
-
const
|
|
38
|
+
const ie = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
39
39
|
"tfoot",
|
|
40
40
|
{
|
|
41
|
-
ref:
|
|
41
|
+
ref: i,
|
|
42
42
|
className: n(
|
|
43
43
|
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
44
44
|
s
|
|
@@ -46,11 +46,11 @@ const ae = x(({ className: s, ...t }, a) => /* @__PURE__ */ p.jsx(
|
|
|
46
46
|
...t
|
|
47
47
|
}
|
|
48
48
|
));
|
|
49
|
-
|
|
50
|
-
const
|
|
49
|
+
ie.displayName = "TableFooter";
|
|
50
|
+
const T = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
51
51
|
"tr",
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
53
|
+
ref: i,
|
|
54
54
|
className: n(
|
|
55
55
|
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
56
56
|
s
|
|
@@ -58,11 +58,11 @@ const M = x(({ className: s, ...t }, a) => /* @__PURE__ */ p.jsx(
|
|
|
58
58
|
...t
|
|
59
59
|
}
|
|
60
60
|
));
|
|
61
|
-
|
|
62
|
-
const
|
|
61
|
+
T.displayName = "TableRow";
|
|
62
|
+
const u = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
63
63
|
"th",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
65
|
+
ref: i,
|
|
66
66
|
className: n(
|
|
67
67
|
"text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",
|
|
68
68
|
s
|
|
@@ -70,50 +70,50 @@ const T = x(({ className: s, ...t }, a) => /* @__PURE__ */ p.jsx(
|
|
|
70
70
|
...t
|
|
71
71
|
}
|
|
72
72
|
));
|
|
73
|
-
|
|
74
|
-
const g =
|
|
73
|
+
u.displayName = "TableHead";
|
|
74
|
+
const g = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
75
75
|
"td",
|
|
76
76
|
{
|
|
77
|
-
ref:
|
|
77
|
+
ref: i,
|
|
78
78
|
className: n("p-4 align-middle [&:has([role=checkbox])]:pr-0", s),
|
|
79
79
|
...t
|
|
80
80
|
}
|
|
81
81
|
));
|
|
82
82
|
g.displayName = "TableCell";
|
|
83
|
-
const
|
|
83
|
+
const de = h(({ className: s, ...t }, i) => /* @__PURE__ */ p.jsx(
|
|
84
84
|
"caption",
|
|
85
85
|
{
|
|
86
|
-
ref:
|
|
86
|
+
ref: i,
|
|
87
87
|
className: n("text-muted-foreground mt-4 text-sm", s),
|
|
88
88
|
...t
|
|
89
89
|
}
|
|
90
90
|
));
|
|
91
|
-
|
|
91
|
+
de.displayName = "TableCaption";
|
|
92
92
|
/**
|
|
93
93
|
* @license lucide-react v0.511.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
97
|
*/
|
|
98
|
-
const
|
|
98
|
+
const ae = [
|
|
99
99
|
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
|
|
100
100
|
["path", { d: "M7 20V4", key: "1yoxec" }],
|
|
101
101
|
["path", { d: "M11 4h10", key: "1w87gc" }],
|
|
102
102
|
["path", { d: "M11 8h7", key: "djye34" }],
|
|
103
103
|
["path", { d: "M11 12h4", key: "q8tih4" }]
|
|
104
|
-
], re =
|
|
104
|
+
], re = R("arrow-down-wide-narrow", ae);
|
|
105
105
|
/**
|
|
106
106
|
* @license lucide-react v0.511.0 - ISC
|
|
107
107
|
*
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/
|
|
111
|
-
const
|
|
111
|
+
const ce = [
|
|
112
112
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
113
113
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
114
114
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
115
115
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
116
|
-
],
|
|
116
|
+
], oe = R("arrow-up-down", ce);
|
|
117
117
|
/**
|
|
118
118
|
* @license lucide-react v0.511.0 - ISC
|
|
119
119
|
*
|
|
@@ -126,76 +126,76 @@ const ne = [
|
|
|
126
126
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
127
127
|
["path", { d: "M11 16h7", key: "uosisv" }],
|
|
128
128
|
["path", { d: "M11 20h4", key: "1krc32" }]
|
|
129
|
-
],
|
|
129
|
+
], me = R("arrow-up-wide-narrow", ne);
|
|
130
130
|
/**
|
|
131
131
|
* @license lucide-react v0.511.0 - ISC
|
|
132
132
|
*
|
|
133
133
|
* This source code is licensed under the ISC license.
|
|
134
134
|
* See the LICENSE file in the root directory of this source tree.
|
|
135
135
|
*/
|
|
136
|
-
const
|
|
136
|
+
const xe = [
|
|
137
137
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
138
138
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
139
139
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
140
140
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
141
|
-
],
|
|
141
|
+
], he = R("refresh-cw", xe), pe = ({
|
|
142
142
|
rows: s = [],
|
|
143
143
|
columns: t,
|
|
144
|
-
onRowClick:
|
|
145
|
-
rowKey:
|
|
144
|
+
onRowClick: i,
|
|
145
|
+
rowKey: x,
|
|
146
146
|
params: o = {
|
|
147
147
|
page: 1,
|
|
148
|
-
limit:
|
|
148
|
+
limit: C
|
|
149
149
|
},
|
|
150
150
|
hasNumbers: f = !1,
|
|
151
151
|
hasCheckbox: j = !1,
|
|
152
|
-
selectedItems:
|
|
152
|
+
selectedItems: _,
|
|
153
153
|
onSelectedItemsChange: w,
|
|
154
154
|
onSortOrderChange: c,
|
|
155
155
|
isStickyHeader: N
|
|
156
156
|
}) => {
|
|
157
|
-
const { sortObject:
|
|
157
|
+
const { sortObject: a, handleSort: F } = P({
|
|
158
158
|
sortField: o == null ? void 0 : o.sortField,
|
|
159
159
|
sortOrder: o == null ? void 0 : o.sortField,
|
|
160
160
|
onSortOrderChange: c
|
|
161
161
|
}), {
|
|
162
|
-
selectedRows:
|
|
162
|
+
selectedRows: m,
|
|
163
163
|
isRowSelected: y,
|
|
164
164
|
isAllRowsSelected: b,
|
|
165
|
-
handleSelectAllRows:
|
|
166
|
-
handleSelectRow:
|
|
167
|
-
} = ee({ rows: s, defaultSelectedRows:
|
|
165
|
+
handleSelectAllRows: v,
|
|
166
|
+
handleSelectRow: E
|
|
167
|
+
} = ee({ rows: s, defaultSelectedRows: _ });
|
|
168
168
|
return S(() => {
|
|
169
|
-
w && w(
|
|
170
|
-
}, [
|
|
169
|
+
w && w(m);
|
|
170
|
+
}, [m]), /* @__PURE__ */ e.jsxs(L, { className: "relative", children: [
|
|
171
171
|
/* @__PURE__ */ e.jsx(
|
|
172
|
-
|
|
172
|
+
D,
|
|
173
173
|
{
|
|
174
174
|
className: n("bg-bg", N && "sticky top-0 z-10"),
|
|
175
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
176
|
-
j && /* @__PURE__ */ e.jsx(
|
|
175
|
+
children: /* @__PURE__ */ e.jsxs(T, { children: [
|
|
176
|
+
j && /* @__PURE__ */ e.jsx(u, { className: "w-12 p-3", children: /* @__PURE__ */ e.jsx(
|
|
177
177
|
A,
|
|
178
178
|
{
|
|
179
179
|
className: "mt-1",
|
|
180
|
-
checked: b(
|
|
181
|
-
onCheckedChange: (l) =>
|
|
180
|
+
checked: b(x),
|
|
181
|
+
onCheckedChange: (l) => v(x, !!l),
|
|
182
182
|
"aria-label": "Select all"
|
|
183
183
|
}
|
|
184
184
|
) }),
|
|
185
|
-
f && /* @__PURE__ */ e.jsx(
|
|
185
|
+
f && /* @__PURE__ */ e.jsx(u, { className: "w-12 p-2", children: "#" }),
|
|
186
186
|
t.filter((l) => !l.hidden).map((l) => /* @__PURE__ */ e.jsx(
|
|
187
|
-
|
|
187
|
+
u,
|
|
188
188
|
{
|
|
189
189
|
style: l.styles,
|
|
190
190
|
className: n("p-2", l.sortable && "cursor-pointer"),
|
|
191
|
-
onClick: () =>
|
|
191
|
+
onClick: () => F(l.dataIndex),
|
|
192
192
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
193
193
|
l.name,
|
|
194
194
|
" ",
|
|
195
|
-
l.sortable && ((
|
|
196
|
-
(
|
|
197
|
-
(
|
|
198
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
195
|
+
l.sortable && ((a == null ? void 0 : a.sortField) === l.key ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
196
|
+
(a == null ? void 0 : a.sortOrder) === I.DESC && /* @__PURE__ */ e.jsx(re, { size: 15 }),
|
|
197
|
+
(a == null ? void 0 : a.sortOrder) === I.ASC && /* @__PURE__ */ e.jsx(me, { size: 15 })
|
|
198
|
+
] }) : /* @__PURE__ */ e.jsx(oe, { size: 15 }))
|
|
199
199
|
] })
|
|
200
200
|
},
|
|
201
201
|
l.key
|
|
@@ -203,44 +203,44 @@ const me = [
|
|
|
203
203
|
] })
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
|
-
/* @__PURE__ */ e.jsx($, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: s.length ? s.map((l,
|
|
207
|
-
|
|
206
|
+
/* @__PURE__ */ e.jsx($, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: s.length ? s.map((l, M) => /* @__PURE__ */ e.jsxs(
|
|
207
|
+
T,
|
|
208
208
|
{
|
|
209
209
|
onClick: () => {
|
|
210
|
-
|
|
210
|
+
i && i(l);
|
|
211
211
|
},
|
|
212
|
-
"data-state": y(l[
|
|
212
|
+
"data-state": y(l[x]) && "selected",
|
|
213
213
|
children: [
|
|
214
214
|
j && /* @__PURE__ */ e.jsx(
|
|
215
215
|
g,
|
|
216
216
|
{
|
|
217
217
|
className: "w-12 p-3",
|
|
218
|
-
onClick: (
|
|
218
|
+
onClick: (d) => d.stopPropagation(),
|
|
219
219
|
children: /* @__PURE__ */ e.jsx(
|
|
220
220
|
A,
|
|
221
221
|
{
|
|
222
222
|
className: "mt-1",
|
|
223
|
-
checked: y(l[
|
|
224
|
-
onCheckedChange: (
|
|
223
|
+
checked: y(l[x]),
|
|
224
|
+
onCheckedChange: (d) => E(l[x], !!d),
|
|
225
225
|
"aria-label": "Select row"
|
|
226
226
|
}
|
|
227
227
|
)
|
|
228
228
|
}
|
|
229
229
|
),
|
|
230
|
-
f && /* @__PURE__ */ e.jsx(g, { className: "w-12 p-2", children: (o.page - 1) * (o.limit ||
|
|
231
|
-
t.filter((
|
|
230
|
+
f && /* @__PURE__ */ e.jsx(g, { className: "w-12 p-2", children: (o.page - 1) * (o.limit || C) + M + 1 }),
|
|
231
|
+
t.filter((d) => !d.hidden).map((d) => /* @__PURE__ */ e.jsx(
|
|
232
232
|
g,
|
|
233
233
|
{
|
|
234
234
|
className: "text-body-xs-medium max-w-xs overflow-hidden p-2 text-ellipsis",
|
|
235
|
-
style:
|
|
236
|
-
children:
|
|
235
|
+
style: d.styles,
|
|
236
|
+
children: d.render ? d.render(k.get(l, d.dataIndex), l) : k.get(l, d.dataIndex, "")
|
|
237
237
|
},
|
|
238
|
-
`${
|
|
238
|
+
`${M}-${d.key}`
|
|
239
239
|
))
|
|
240
240
|
]
|
|
241
241
|
},
|
|
242
|
-
`${l[
|
|
243
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
242
|
+
`${l[x]}`
|
|
243
|
+
)) : /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(
|
|
244
244
|
g,
|
|
245
245
|
{
|
|
246
246
|
colSpan: f ? j ? t.length + 2 : t.length + 1 : t.length,
|
|
@@ -248,35 +248,35 @@ const me = [
|
|
|
248
248
|
}
|
|
249
249
|
) }) })
|
|
250
250
|
] });
|
|
251
|
-
},
|
|
251
|
+
}, Ee = ({
|
|
252
252
|
dataSource: s,
|
|
253
253
|
columns: t,
|
|
254
|
-
onRowClick:
|
|
255
|
-
rowKey:
|
|
254
|
+
onRowClick: i,
|
|
255
|
+
rowKey: x,
|
|
256
256
|
hasNumbers: o,
|
|
257
257
|
hasSearch: f,
|
|
258
258
|
hasCheckbox: j,
|
|
259
|
-
hasPagination:
|
|
259
|
+
hasPagination: _,
|
|
260
260
|
isStickyHeader: w,
|
|
261
261
|
onParamChange: c,
|
|
262
262
|
tableKey: N,
|
|
263
|
-
filters:
|
|
264
|
-
handleFilterChange:
|
|
265
|
-
params:
|
|
263
|
+
filters: a = [],
|
|
264
|
+
handleFilterChange: F,
|
|
265
|
+
params: m,
|
|
266
266
|
hasColumnsVisibilityDropdown: y
|
|
267
267
|
}) => {
|
|
268
|
-
const { t: b } = le(), [
|
|
268
|
+
const { t: b } = le(), [v, E] = K([]), { formattedColumns: l, handleColumnsChange: M, resetColumns: d } = se({ key: N, columns: t });
|
|
269
269
|
return /* @__PURE__ */ e.jsxs(
|
|
270
270
|
"div",
|
|
271
271
|
{
|
|
272
272
|
className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
|
|
273
273
|
children: [
|
|
274
|
-
(f || y && N || !k.isEmpty(
|
|
274
|
+
(f || y && N || !k.isEmpty(a)) && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 p-4", children: [
|
|
275
275
|
/* @__PURE__ */ e.jsx("div", { className: "w-full shrink", children: f && /* @__PURE__ */ e.jsx(
|
|
276
276
|
Q,
|
|
277
277
|
{
|
|
278
|
-
defaultValue: k.get(
|
|
279
|
-
onSearchChange: (r) => ({ ...
|
|
278
|
+
defaultValue: k.get(m, "search", ""),
|
|
279
|
+
onSearchChange: (r) => ({ ...m, search: r, page: 1 })
|
|
280
280
|
}
|
|
281
281
|
) }),
|
|
282
282
|
/* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-3", children: [
|
|
@@ -300,9 +300,9 @@ const me = [
|
|
|
300
300
|
W,
|
|
301
301
|
{
|
|
302
302
|
className: "capitalize",
|
|
303
|
-
onClick:
|
|
303
|
+
onClick: d,
|
|
304
304
|
children: [
|
|
305
|
-
/* @__PURE__ */ e.jsx(
|
|
305
|
+
/* @__PURE__ */ e.jsx(he, {}),
|
|
306
306
|
" ",
|
|
307
307
|
b("Reset columns")
|
|
308
308
|
]
|
|
@@ -314,45 +314,44 @@ const me = [
|
|
|
314
314
|
{
|
|
315
315
|
className: "capitalize",
|
|
316
316
|
checked: !r.hidden,
|
|
317
|
-
onCheckedChange: (
|
|
317
|
+
onCheckedChange: (z) => M(r, !z),
|
|
318
318
|
children: r.name
|
|
319
319
|
},
|
|
320
320
|
r.key
|
|
321
321
|
))
|
|
322
322
|
] })
|
|
323
323
|
] }),
|
|
324
|
-
!k.isEmpty(
|
|
324
|
+
!k.isEmpty(a) && /* @__PURE__ */ e.jsx(Z, { filters: a, onFilter: F })
|
|
325
325
|
] })
|
|
326
326
|
] }),
|
|
327
327
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-auto border-y", children: /* @__PURE__ */ e.jsx(
|
|
328
328
|
pe,
|
|
329
329
|
{
|
|
330
|
-
params:
|
|
330
|
+
params: m,
|
|
331
331
|
rows: s == null ? void 0 : s.docs,
|
|
332
|
-
rowKey:
|
|
332
|
+
rowKey: x,
|
|
333
|
+
selectedItems: v,
|
|
333
334
|
isStickyHeader: w,
|
|
334
335
|
columns: l,
|
|
335
336
|
hasCheckbox: j,
|
|
336
337
|
hasNumbers: o,
|
|
337
|
-
onRowClick:
|
|
338
|
-
onSelectedItemsChange:
|
|
339
|
-
onSortOrderChange: ({ sortField: r, sortOrder:
|
|
340
|
-
c == null || c({ ...
|
|
338
|
+
onRowClick: i,
|
|
339
|
+
onSelectedItemsChange: E,
|
|
340
|
+
onSortOrderChange: ({ sortField: r, sortOrder: z }) => {
|
|
341
|
+
c == null || c({ ...m, sortField: r, sortOrder: z });
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
344
|
) }),
|
|
344
|
-
|
|
345
|
+
_ && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row", children: [
|
|
345
346
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm", children: /* @__PURE__ */ e.jsx(
|
|
346
347
|
J,
|
|
347
348
|
{
|
|
348
|
-
onLimitChange: (r) => {
|
|
349
|
-
console.log(r), c == null || c({ ...h, limit: r, page: 1 });
|
|
350
|
-
},
|
|
349
|
+
onLimitChange: (r) => c == null ? void 0 : c({ ...m, limit: r, page: 1 }),
|
|
351
350
|
defaultValue: s == null ? void 0 : s.limit
|
|
352
351
|
}
|
|
353
352
|
) }),
|
|
354
353
|
/* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-sm", children: [
|
|
355
|
-
|
|
354
|
+
v.length,
|
|
356
355
|
" of ",
|
|
357
356
|
(s == null ? void 0 : s.total) || 0,
|
|
358
357
|
" row(s) selected."
|
|
@@ -360,9 +359,7 @@ const me = [
|
|
|
360
359
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
361
360
|
O,
|
|
362
361
|
{
|
|
363
|
-
onPageChange: (r) => {
|
|
364
|
-
c && c({ ...h, page: r });
|
|
365
|
-
},
|
|
362
|
+
onPageChange: (r) => c == null ? void 0 : c({ ...m, page: r }),
|
|
366
363
|
currentPage: s == null ? void 0 : s.page,
|
|
367
364
|
totalPages: s == null ? void 0 : s.totalPages
|
|
368
365
|
}
|
|
@@ -373,6 +370,6 @@ const me = [
|
|
|
373
370
|
);
|
|
374
371
|
};
|
|
375
372
|
export {
|
|
376
|
-
|
|
373
|
+
Ee as DataTable,
|
|
377
374
|
pe as MyTable
|
|
378
375
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../FilterWrapper-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../FilterWrapper-Cq3YXU-5.cjs"),r=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),l=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),p=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),c=require("../../lodash-C5w_OPmE.cjs"),x=require("../../Keyboard-kyPAAQWP.cjs"),d=require("../../useTranslation-CZf20ucv.cjs"),h=({placeholder:s,onSearchChange:o})=>{const{t:a}=d.useTranslation(),[n,i]=u.useState("");return r.jsxRuntimeExports.jsxs("div",{className:"relative my-2 w-full",children:[r.jsxRuntimeExports.jsx(l.yl,{placeholder:s||a("Type text and press CTRL + Enter"),onInput:e=>i(c.lodashExports.get(e,"target.value","")),onKeyUp:e=>{e.key===x.Keyboard.ENTER&&(e.ctrlKey&&o(n),e.stopPropagation(),e.preventDefault())}}),r.jsxRuntimeExports.jsx(p.u,{type:"button",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",onClick:()=>o(n),children:r.jsxRuntimeExports.jsx(t.pv,{})})]})};exports.FilterWrapper=t.FilterWrapper;exports.Search=t.Search;exports.SearchWithCtrl=h;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as i } from "../../FilterWrapper-
|
|
2
|
-
import { F as v, S as N } from "../../FilterWrapper-
|
|
1
|
+
import { p as i } from "../../FilterWrapper-C-ddF8lj.js";
|
|
2
|
+
import { F as v, S as N } from "../../FilterWrapper-C-ddF8lj.js";
|
|
3
3
|
import { j as t } from "../../jsx-runtime-C5mzlN2N.js";
|
|
4
4
|
import { useState as m } from "react";
|
|
5
5
|
import { y as n } from "../../radio-group-CqPTye2U-DGs9dBuR.js";
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const d=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],h=o.createLucideIcon("sun",d);function x({className:i}){const{
|
|
11
|
+
*/const d=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],h=o.createLucideIcon("sun",d);function x({className:i}){const{t:s}=u.useTranslation(),{setTheme:n}=a.useTheme();return e.jsxRuntimeExports.jsxs(t.Nt,{children:[e.jsxRuntimeExports.jsx(t.jt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(c.u,{variant:"tertiary",size:"icon",className:i,children:[e.jsxRuntimeExports.jsx(h,{className:"h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),e.jsxRuntimeExports.jsx(m,{className:"absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),e.jsxRuntimeExports.jsxs(t.ut,{align:"end",children:[e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.LIGHT),children:s("Light")}),e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.DARK),children:s("Dark")}),e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.SYSTEM),children:s("System")})]})]})}exports.ThemeToggle=x;
|
|
@@ -32,7 +32,7 @@ const u = [
|
|
|
32
32
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
33
33
|
], j = o("sun", u);
|
|
34
34
|
function v({ className: n }) {
|
|
35
|
-
const {
|
|
35
|
+
const { t } = d(), { setTheme: s } = h();
|
|
36
36
|
return /* @__PURE__ */ e.jsxs(i, { children: [
|
|
37
37
|
/* @__PURE__ */ e.jsx(c, { asChild: !0, children: /* @__PURE__ */ e.jsxs(l, { variant: "tertiary", size: "icon", className: n, children: [
|
|
38
38
|
/* @__PURE__ */ e.jsx(j, { className: "h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
|
|
@@ -40,9 +40,9 @@ function v({ className: n }) {
|
|
|
40
40
|
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Toggle theme" })
|
|
41
41
|
] }) }),
|
|
42
42
|
/* @__PURE__ */ e.jsxs(m, { align: "end", children: [
|
|
43
|
-
/* @__PURE__ */ e.jsx(a, { onClick: () =>
|
|
44
|
-
/* @__PURE__ */ e.jsx(a, { onClick: () =>
|
|
45
|
-
/* @__PURE__ */ e.jsx(a, { onClick: () =>
|
|
43
|
+
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.LIGHT), children: t("Light") }),
|
|
44
|
+
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.DARK), children: t("Dark") }),
|
|
45
|
+
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.SYSTEM), children: t("System") })
|
|
46
46
|
] })
|
|
47
47
|
] });
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/datatable/DataTable.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,mBAAmB,CAAC,KAAK;IACxC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc,CAAC,KAAK,CACnC,SAAQ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B,CAAC,EAAE,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,SAAS,GAAI,KAAK,EAAG,6MAgB/B,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/datatable/DataTable.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,mBAAmB,CAAC,KAAK;IACxC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc,CAAC,KAAK,CACnC,SAAQ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B,CAAC,EAAE,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,SAAS,GAAI,KAAK,EAAG,6MAgB/B,cAAc,CAAC,KAAK,CAAC,4CAgHvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/filters/FilterWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAoC,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"FilterWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/filters/FilterWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAoC,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,aAAa,0DAqHxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("react"),e=require("./jsx-runtime-DUiatUiq.cjs"),w=require("./radio-group-CqPTye2U-CXc2TUFE.cjs"),a=require("./button-Bp2lHjov-D9UnCnYX.cjs"),v=require("./useTranslation-CZf20ucv.cjs"),l=require("./createLucideIcon-BnAj0RnC.cjs"),L=require("./lodash-C5w_OPmE.cjs"),d=require("./popover-HTqpqYpJ-DkiWPDCk.cjs"),S=require("./MyInput-yriz78UG.cjs"),z=require("./MySelect-rr-aoQ49.cjs"),H=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"}]],F=l.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 I=[["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"}]],V=l.createLucideIcon("list-filter-plus",I);/**
|
|
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 $=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]],T=l.createLucideIcon("list-filter",$);/**
|
|
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 Z=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],B=l.createLucideIcon("search",Z),D=({color:c="currentColor",size:t=24,className:n,...r})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...r,className:"remixicon "+(n||"")},o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),O=({color:c="currentColor",size:t=24,className:n,...r})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...r,className:"remixicon "+(n||"")},o.createElement("path",{d:"M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"})),A=({color:c="currentColor",size:t=24,className:n,...r})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...r,className:"remixicon "+(n||"")},o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),P=({name:c="search",defaultValue:t,onSearchChange:n})=>{const{t:r}=v.useTranslation(),i=u=>{const m=new FormData(u.currentTarget);n(m.get(c)),u.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative w-full max-w-64 min-w-40",onSubmit:i,children:[e.jsxRuntimeExports.jsx(w.yl,{className:"h-8 rounded-lg",name:c,placeholder:r("Search..."),defaultValue:t?`${t}`:""}),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(B,{})})]})},W=o.memo(function({filters:t,params:n,onFilter:r,onChange:i,onCancel:u,...m}){const{t:x}=v.useTranslation(),[g,C]=o.useState(!1),[R,p]=o.useState(!1),{form:j}=H.useFilter({params:n}),{watch:M,getValues:N,handleSubmit:f,control:E,reset:y}=j;o.useEffect(()=>{let s=!1;t.map(q=>{const h=L.lodashExports.get(n,`${q.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),C(s)})},[t,n]),o.useEffect(()=>{i&&i(N())},[M()]);const b=o.useCallback((s={})=>{r&&r(s),p(!1)},[r]),k=o.useCallback(()=>{y(),r&&n&&r({...n,...Object.fromEntries(t.map(s=>[s.name,void 0]))}),p(!1)},[r,y,n,t]);return e.jsxRuntimeExports.jsxs(d.Oe,{open:R,onOpenChange:p,children:[e.jsxRuntimeExports.jsx(d._e,{children:e.jsxRuntimeExports.jsx(a.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[g?e.jsxRuntimeExports.jsx(V,{size:20}):e.jsxRuntimeExports.jsx(T,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:x("Filter")}),e.jsxRuntimeExports.jsx(F,{})]})})}),e.jsxRuntimeExports.jsx(d.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(w.Ph,{...j,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:f(b),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:t.map(s=>s.options?e.jsxRuntimeExports.jsx(z.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(S.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:k,children:x("Reset")}),e.jsxRuntimeExports.jsx(a.u,{type:"submit",size:"sm",children:x("Apply")})]})]})})})]})});exports.FilterWrapper=W;exports.Search=P;exports.f1=D;exports.pv=A;exports.yn=O;
|