laif-ds 0.2.60 → 0.2.62
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/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/agent-docs/components/AppDialog.md +271 -0
- package/dist/agent-docs/components/DataTable.md +73 -2
- package/dist/agent-docs/components-list.md +9 -0
- package/dist/components/ui/app-dialog.js +123 -0
- package/dist/components/ui/app-select.js +36 -34
- package/dist/components/ui/async-select.js +12 -11
- package/dist/components/ui/dialog.js +50 -46
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +87 -87
- package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +82 -77
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +16 -16
- package/dist/components/ui/tables/data-table/components/data-table-sorting.js +14 -14
- package/dist/components/ui/tables/data-table/data-table.js +293 -288
- package/dist/components/ui/tables/data-table/data-table.service.js +43 -43
- package/dist/components/ui/tables/data-table/data-table.utils.js +95 -88
- package/dist/index.d.ts +68 -19
- package/dist/index.js +291 -288
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as f, jsx as
|
|
2
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { useState as k } from "react";
|
|
4
4
|
import { Button as b } from "../../../button.js";
|
|
5
5
|
import { Icon as C } from "../../../icon.js";
|
|
6
|
-
import { Popover as
|
|
6
|
+
import { Popover as H, PopoverTrigger as _, PopoverContent as $ } from "../../../popover.js";
|
|
7
7
|
import { getIconFromColumnType as z } from "../data-table.service.js";
|
|
8
|
-
function
|
|
9
|
-
table:
|
|
10
|
-
visibleColumns:
|
|
11
|
-
hiddenColumns:
|
|
8
|
+
function W({
|
|
9
|
+
table: u,
|
|
10
|
+
visibleColumns: Y,
|
|
11
|
+
hiddenColumns: B,
|
|
12
12
|
i18n: x
|
|
13
13
|
}) {
|
|
14
|
-
const [c,
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const [c, m] = k({ section: null, position: -1, itemId: null }), [O, T] = k(!1), d = (e) => e.id, V = (e) => {
|
|
15
|
+
const t = e.columnDef.meta?.headerLabel;
|
|
16
|
+
if (t) return String(t);
|
|
17
|
+
const i = e.columnDef.header;
|
|
18
|
+
return typeof i == "string" ? i : d(e);
|
|
19
|
+
}, D = (e) => d(e) === "data-table-integrated-checkbox-column" || e.columnDef.enableHiding === !1, P = () => {
|
|
20
|
+
const e = u?.getState?.().columnOrder || [];
|
|
21
|
+
return e && e.length > 0 ? [...e] : (u?.getAllLeafColumns?.() || []).map((i) => i.id);
|
|
22
|
+
}, j = (e, t) => {
|
|
18
23
|
e.dataTransfer.setData("text/column-id", t), e.dataTransfer.effectAllowed = "move", T(!0);
|
|
19
|
-
},
|
|
20
|
-
T(!1),
|
|
21
|
-
},
|
|
24
|
+
}, A = () => {
|
|
25
|
+
T(!1), m({ section: null, position: -1, itemId: null });
|
|
26
|
+
}, E = (e) => {
|
|
22
27
|
const t = e.currentTarget, i = Array.from(t.querySelectorAll("[data-column-item]")), o = e.clientY;
|
|
23
|
-
for (let
|
|
24
|
-
const a = i[
|
|
28
|
+
for (let n = 0; n < i.length; n++) {
|
|
29
|
+
const a = i[n].getBoundingClientRect(), l = a.top + a.height / 2;
|
|
25
30
|
if (o < l)
|
|
26
|
-
return
|
|
31
|
+
return n;
|
|
27
32
|
}
|
|
28
33
|
return i.length;
|
|
29
34
|
}, w = (e, t, i) => {
|
|
30
|
-
const o =
|
|
35
|
+
const o = u?.getColumn?.(e);
|
|
31
36
|
if (!o || D(o))
|
|
32
37
|
return;
|
|
33
|
-
const
|
|
38
|
+
const n = o.getIsVisible(), s = t === "visible" ? g : N;
|
|
34
39
|
if (t === "visible" && i === 0)
|
|
35
40
|
return;
|
|
36
|
-
(t === "visible" && !
|
|
37
|
-
const a =
|
|
41
|
+
(t === "visible" && !n || t === "hidden" && n) && o.toggleVisibility(t === "visible");
|
|
42
|
+
const a = P(), l = s.map(d), p = a.indexOf(e);
|
|
38
43
|
if (p === -1) return;
|
|
39
44
|
const h = [...a];
|
|
40
45
|
h.splice(p, 1);
|
|
@@ -46,19 +51,19 @@ function U({
|
|
|
46
51
|
const I = l[l.length - 1];
|
|
47
52
|
I && (v = h.indexOf(I) + 1);
|
|
48
53
|
}
|
|
49
|
-
h.splice(v, 0, e),
|
|
54
|
+
h.splice(v, 0, e), u.setColumnOrder(h);
|
|
50
55
|
}, S = (e, t, i, o) => {
|
|
51
56
|
e.preventDefault(), e.stopPropagation(), e.dataTransfer.dropEffect = "move";
|
|
52
|
-
const
|
|
53
|
-
|
|
57
|
+
const n = e.currentTarget.getBoundingClientRect(), s = e.clientY, a = n.top + n.height / 2, l = s < a ? o : o + 1;
|
|
58
|
+
m({
|
|
54
59
|
section: t,
|
|
55
60
|
position: l,
|
|
56
61
|
itemId: i
|
|
57
62
|
});
|
|
58
|
-
},
|
|
63
|
+
}, L = (e) => (t) => {
|
|
59
64
|
t.preventDefault(), t.dataTransfer.dropEffect = "move";
|
|
60
|
-
const i =
|
|
61
|
-
|
|
65
|
+
const i = E(t);
|
|
66
|
+
m({
|
|
62
67
|
section: e,
|
|
63
68
|
position: e === "visible" && i === 0 ? 1 : i,
|
|
64
69
|
itemId: null
|
|
@@ -67,20 +72,20 @@ function U({
|
|
|
67
72
|
t.preventDefault(), t.stopPropagation();
|
|
68
73
|
const i = t.dataTransfer.getData("text/column-id");
|
|
69
74
|
if (!i) return;
|
|
70
|
-
const o = c.position !== -1 ? c.position :
|
|
71
|
-
w(i, e, e === "visible" && o === 0 ? 1 : o),
|
|
72
|
-
},
|
|
75
|
+
const o = c.position !== -1 ? c.position : E(t);
|
|
76
|
+
w(i, e, e === "visible" && o === 0 ? 1 : o), m({ section: null, position: -1, itemId: null });
|
|
77
|
+
}, F = P(), G = (u?.getAllLeafColumns?.() || []).map(
|
|
73
78
|
(e) => e.id
|
|
74
|
-
),
|
|
75
|
-
|
|
79
|
+
), R = new Map(
|
|
80
|
+
G.map((e, t) => [e, t])
|
|
76
81
|
), y = (e) => {
|
|
77
|
-
const t =
|
|
82
|
+
const t = F.indexOf(e);
|
|
78
83
|
if (t !== -1) return t;
|
|
79
|
-
const i =
|
|
84
|
+
const i = R.get(e);
|
|
80
85
|
return i !== void 0 ? i : Number.MAX_SAFE_INTEGER;
|
|
81
|
-
}, g = [...
|
|
82
|
-
return /* @__PURE__ */ f(
|
|
83
|
-
/* @__PURE__ */
|
|
86
|
+
}, g = [...Y].filter((e) => !D(e)).sort((e, t) => y(d(e)) - y(d(t))), N = [...B].filter((e) => !D(e)).sort((e, t) => y(d(e)) - y(d(t)));
|
|
87
|
+
return /* @__PURE__ */ f(H, { children: [
|
|
88
|
+
/* @__PURE__ */ r(_, { asChild: !0, children: /* @__PURE__ */ r(
|
|
84
89
|
b,
|
|
85
90
|
{
|
|
86
91
|
className: "h-6 w-6",
|
|
@@ -89,28 +94,28 @@ function U({
|
|
|
89
94
|
variant: "ghost"
|
|
90
95
|
}
|
|
91
96
|
) }),
|
|
92
|
-
/* @__PURE__ */ f(
|
|
97
|
+
/* @__PURE__ */ f($, { className: "flex flex-col gap-2 px-3 py-2", align: "end", children: [
|
|
93
98
|
g.length > 0 && /* @__PURE__ */ f(
|
|
94
99
|
"div",
|
|
95
100
|
{
|
|
96
101
|
className: "flex max-h-[250px] flex-col",
|
|
97
|
-
onDragOver:
|
|
102
|
+
onDragOver: L("visible"),
|
|
98
103
|
onDrop: M("visible"),
|
|
99
104
|
children: [
|
|
100
105
|
/* @__PURE__ */ f("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ r("div", { className: "text-d-foreground text-sm", children: x.columnVisibility.visibleColumns }),
|
|
107
|
+
/* @__PURE__ */ r(
|
|
103
108
|
b,
|
|
104
109
|
{
|
|
105
110
|
variant: "ghost",
|
|
106
111
|
size: "sm",
|
|
107
112
|
className: "text-xs",
|
|
108
113
|
onClick: () => {
|
|
109
|
-
|
|
114
|
+
u.setColumnVisibility(() => {
|
|
110
115
|
const e = [...g, ...N], t = d(g[0] ?? e[0]);
|
|
111
116
|
return e.reduce(
|
|
112
|
-
(o,
|
|
113
|
-
const s = d(
|
|
117
|
+
(o, n) => {
|
|
118
|
+
const s = d(n);
|
|
114
119
|
return s && (o[s] = s === t), o;
|
|
115
120
|
},
|
|
116
121
|
{}
|
|
@@ -121,23 +126,23 @@ function U({
|
|
|
121
126
|
}
|
|
122
127
|
)
|
|
123
128
|
] }),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
const i = d(e), o = t === 0,
|
|
129
|
+
/* @__PURE__ */ r("div", { className: "border-d-border flex min-h-0 flex-1 flex-col overflow-y-auto border-b", children: g.map((e, t) => {
|
|
130
|
+
const i = d(e), o = t === 0, n = D(e), s = c.section === "visible" && c.position === t && t > 0, a = c.section === "visible" && c.position === t + 1;
|
|
126
131
|
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
127
|
-
s && /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
132
|
+
s && /* @__PURE__ */ r("div", { className: "bg-d-primary absolute -top-1 right-0 left-0 z-10 h-0.5 rounded-full" }),
|
|
133
|
+
/* @__PURE__ */ r(
|
|
129
134
|
"div",
|
|
130
135
|
{
|
|
131
136
|
"data-column-item": !0,
|
|
132
|
-
draggable: !o && !
|
|
137
|
+
draggable: !o && !n,
|
|
133
138
|
onDragStart: (l) => {
|
|
134
|
-
if (o ||
|
|
139
|
+
if (o || n) {
|
|
135
140
|
l.preventDefault();
|
|
136
141
|
return;
|
|
137
142
|
}
|
|
138
|
-
|
|
143
|
+
j(l, i);
|
|
139
144
|
},
|
|
140
|
-
onDragEnd:
|
|
145
|
+
onDragEnd: A,
|
|
141
146
|
onDragOver: (l) => {
|
|
142
147
|
if (t === 0) {
|
|
143
148
|
l.dataTransfer.dropEffect = "none";
|
|
@@ -152,25 +157,25 @@ function U({
|
|
|
152
157
|
p,
|
|
153
158
|
"visible",
|
|
154
159
|
Math.max(1, t)
|
|
155
|
-
),
|
|
160
|
+
), m({
|
|
156
161
|
section: null,
|
|
157
162
|
position: -1,
|
|
158
163
|
itemId: null
|
|
159
164
|
});
|
|
160
165
|
},
|
|
161
|
-
className: `rounded transition-all duration-150 ${o ||
|
|
162
|
-
children: /* @__PURE__ */
|
|
166
|
+
className: `rounded transition-all duration-150 ${o || n ? "cursor-not-allowed opacity-60" : O && c.itemId === i ? "scale-95 opacity-50" : "hover:bg-d-foreground/5"}`,
|
|
167
|
+
children: /* @__PURE__ */ r(
|
|
163
168
|
b,
|
|
164
169
|
{
|
|
165
170
|
variant: "ghost",
|
|
166
171
|
className: "w-full cursor-grab justify-start",
|
|
167
172
|
iconLeft: "GripVertical",
|
|
168
173
|
onClick: () => {
|
|
169
|
-
|
|
174
|
+
n || e.toggleVisibility();
|
|
170
175
|
},
|
|
171
|
-
disabled: i === d(g[0]) ||
|
|
176
|
+
disabled: i === d(g[0]) || n,
|
|
172
177
|
children: /* @__PURE__ */ f("div", { className: "flex w-full flex-row items-center justify-between gap-1", children: [
|
|
173
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ r(
|
|
174
179
|
C,
|
|
175
180
|
{
|
|
176
181
|
name: z(
|
|
@@ -179,15 +184,15 @@ function U({
|
|
|
179
184
|
className: "h-4 w-4"
|
|
180
185
|
}
|
|
181
186
|
),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1", children: V(e) }),
|
|
188
|
+
/* @__PURE__ */ r(C, { name: "Eye" })
|
|
184
189
|
] })
|
|
185
190
|
},
|
|
186
191
|
i
|
|
187
192
|
)
|
|
188
193
|
}
|
|
189
194
|
),
|
|
190
|
-
a && /* @__PURE__ */
|
|
195
|
+
a && /* @__PURE__ */ r("div", { className: "bg-d-primary absolute right-0 -bottom-1 left-0 z-10 h-0.5 rounded-full" })
|
|
191
196
|
] }, i);
|
|
192
197
|
}) })
|
|
193
198
|
]
|
|
@@ -197,45 +202,45 @@ function U({
|
|
|
197
202
|
"div",
|
|
198
203
|
{
|
|
199
204
|
className: "flex max-h-[250px] flex-col",
|
|
200
|
-
onDragOver:
|
|
205
|
+
onDragOver: L("hidden"),
|
|
201
206
|
onDrop: M("hidden"),
|
|
202
207
|
children: [
|
|
203
208
|
/* @__PURE__ */ f("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ r("div", { className: "text-d-foreground text-sm", children: x.columnVisibility.hiddenColumns }),
|
|
210
|
+
/* @__PURE__ */ r(
|
|
206
211
|
b,
|
|
207
212
|
{
|
|
208
213
|
variant: "ghost",
|
|
209
214
|
size: "sm",
|
|
210
215
|
className: "text-xs",
|
|
211
|
-
onClick: () =>
|
|
216
|
+
onClick: () => u.setColumnVisibility({}),
|
|
212
217
|
children: x.columnVisibility.showAll
|
|
213
218
|
}
|
|
214
219
|
)
|
|
215
220
|
] }),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
const i = d(e), o = c.section === "hidden" && c.position === t,
|
|
221
|
+
/* @__PURE__ */ r("div", { className: "border-d-border flex min-h-0 flex-1 flex-col overflow-y-auto border-b", children: N.map((e, t) => {
|
|
222
|
+
const i = d(e), o = c.section === "hidden" && c.position === t, n = c.section === "hidden" && c.position === t + 1;
|
|
218
223
|
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
219
|
-
o && /* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */
|
|
224
|
+
o && /* @__PURE__ */ r("div", { className: "bg-d-primary absolute -top-1 right-0 left-0 z-10 h-0.5 rounded-full" }),
|
|
225
|
+
/* @__PURE__ */ r(
|
|
221
226
|
"div",
|
|
222
227
|
{
|
|
223
228
|
"data-column-item": !0,
|
|
224
229
|
draggable: !0,
|
|
225
|
-
onDragStart: (s) =>
|
|
226
|
-
onDragEnd:
|
|
230
|
+
onDragStart: (s) => j(s, i),
|
|
231
|
+
onDragEnd: A,
|
|
227
232
|
onDragOver: (s) => S(s, "hidden", i, t),
|
|
228
233
|
onDrop: (s) => {
|
|
229
234
|
s.preventDefault(), s.stopPropagation();
|
|
230
235
|
const a = s.dataTransfer.getData("text/column-id");
|
|
231
|
-
a && a !== i && w(a, "hidden", t),
|
|
236
|
+
a && a !== i && w(a, "hidden", t), m({
|
|
232
237
|
section: null,
|
|
233
238
|
position: -1,
|
|
234
239
|
itemId: null
|
|
235
240
|
});
|
|
236
241
|
},
|
|
237
242
|
className: `rounded transition-all duration-150 ${O && c.itemId === i ? "scale-95 opacity-50" : "hover:bg-d-foreground/5"}`,
|
|
238
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ r(
|
|
239
244
|
b,
|
|
240
245
|
{
|
|
241
246
|
variant: "ghost",
|
|
@@ -243,7 +248,7 @@ function U({
|
|
|
243
248
|
iconLeft: "GripVertical",
|
|
244
249
|
onClick: () => e.toggleVisibility(),
|
|
245
250
|
children: /* @__PURE__ */ f("div", { className: "flex w-full flex-row items-center justify-between gap-1", children: [
|
|
246
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ r(
|
|
247
252
|
C,
|
|
248
253
|
{
|
|
249
254
|
name: z(
|
|
@@ -252,15 +257,15 @@ function U({
|
|
|
252
257
|
className: "h-4 w-4"
|
|
253
258
|
}
|
|
254
259
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1", children: V(e) }),
|
|
261
|
+
/* @__PURE__ */ r(C, { name: "EyeOff" })
|
|
257
262
|
] })
|
|
258
263
|
},
|
|
259
264
|
i
|
|
260
265
|
)
|
|
261
266
|
}
|
|
262
267
|
),
|
|
263
|
-
|
|
268
|
+
n && /* @__PURE__ */ r("div", { className: "bg-d-primary absolute right-0 -bottom-1 left-0 z-10 h-0.5 rounded-full" })
|
|
264
269
|
] }, i);
|
|
265
270
|
}) })
|
|
266
271
|
]
|
|
@@ -270,5 +275,5 @@ function U({
|
|
|
270
275
|
] });
|
|
271
276
|
}
|
|
272
277
|
export {
|
|
273
|
-
|
|
278
|
+
W as DataTableColumnVisibility
|
|
274
279
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as p, Fragment as A, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { useState as q, useEffect as $ } from "react";
|
|
4
|
-
import { Badge as
|
|
4
|
+
import { Badge as f } from "../../../badge.js";
|
|
5
5
|
import { Button as N } from "../../../button.js";
|
|
6
|
-
import { Icon as
|
|
6
|
+
import { Icon as y } from "../../../icon.js";
|
|
7
7
|
import { Input as E } from "../../../input.js";
|
|
8
|
-
import { Popover as S, PopoverTrigger as
|
|
8
|
+
import { Popover as S, PopoverTrigger as D, PopoverContent as _ } from "../../../popover.js";
|
|
9
9
|
import { getIconFromColumnType as M } from "../data-table.service.js";
|
|
10
10
|
import { DataTableAdvancedFilterComponent as R } from "./data-table-advanced-filter.js";
|
|
11
11
|
import { DataTableStringFilter as z, DataTableNumberFilter as H, DataTableBooleanFilter as J, DataTableDateFilter as K, DataTableDateTimeFilter as Q, DataTableListSingleSelectFilter as U, DataTableListMultiSelectFilter as V } from "./data-table-simple-filters.js";
|
|
@@ -99,18 +99,18 @@ function se({
|
|
|
99
99
|
b
|
|
100
100
|
]), /* @__PURE__ */ p(A, { children: [
|
|
101
101
|
m && /* @__PURE__ */ p(S, { children: [
|
|
102
|
-
/* @__PURE__ */ o(
|
|
103
|
-
|
|
102
|
+
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ p(
|
|
103
|
+
f,
|
|
104
104
|
{
|
|
105
105
|
className: "hover:border-d-border cursor-pointer hover:border",
|
|
106
106
|
variant: "default",
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */ o(
|
|
108
|
+
/* @__PURE__ */ o(y, { name: "ListFilter" }),
|
|
109
109
|
s.filters.advancedFilter
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
) }),
|
|
113
|
-
/* @__PURE__ */ o(
|
|
113
|
+
/* @__PURE__ */ o(_, { className: "w-[800px]", align: "start", children: /* @__PURE__ */ o(
|
|
114
114
|
R,
|
|
115
115
|
{
|
|
116
116
|
columns: h,
|
|
@@ -134,18 +134,18 @@ function se({
|
|
|
134
134
|
});
|
|
135
135
|
},
|
|
136
136
|
children: [
|
|
137
|
-
/* @__PURE__ */ o(
|
|
138
|
-
|
|
137
|
+
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ p(
|
|
138
|
+
f,
|
|
139
139
|
{
|
|
140
140
|
variant: (e.value === void 0 || e.value === "") && !(e.operator === "eq_null" || e.operator === "n_eq_null" || e.operator === "checked" || e.operator === "unchecked") ? "ghost" : "default",
|
|
141
141
|
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${c && "border-d-foreground border"}`,
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */ o(
|
|
143
|
+
/* @__PURE__ */ o(y, { name: "Filter" }),
|
|
144
144
|
e.columnLabel || s.filters.value
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
147
|
) }),
|
|
148
|
-
/* @__PURE__ */ p(
|
|
148
|
+
/* @__PURE__ */ p(_, { align: "start", children: [
|
|
149
149
|
e.columnType === "string" && /* @__PURE__ */ o(
|
|
150
150
|
z,
|
|
151
151
|
{
|
|
@@ -229,18 +229,18 @@ function se({
|
|
|
229
229
|
});
|
|
230
230
|
},
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */ o(
|
|
233
|
-
|
|
232
|
+
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ p(
|
|
233
|
+
f,
|
|
234
234
|
{
|
|
235
235
|
variant: "ghost",
|
|
236
236
|
className: `hover:border-d-border flex cursor-pointer items-center gap-1 hover:border ${j && "border-d-foreground border"}`,
|
|
237
237
|
children: [
|
|
238
|
-
/* @__PURE__ */ o(
|
|
238
|
+
/* @__PURE__ */ o(y, { name: "FunnelPlus" }),
|
|
239
239
|
s.filters.addFilter
|
|
240
240
|
]
|
|
241
241
|
}
|
|
242
242
|
) }),
|
|
243
|
-
/* @__PURE__ */ p(
|
|
243
|
+
/* @__PURE__ */ p(_, { className: "p-2", align: "start", children: [
|
|
244
244
|
/* @__PURE__ */ o(
|
|
245
245
|
E,
|
|
246
246
|
{
|
|
@@ -260,7 +260,7 @@ function se({
|
|
|
260
260
|
e.column.columnDef.meta?.type
|
|
261
261
|
),
|
|
262
262
|
onClick: () => G(e),
|
|
263
|
-
children: e.column.columnDef.
|
|
263
|
+
children: e.column.columnDef.meta?.headerLabel || (typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : "") || e.column.id
|
|
264
264
|
}
|
|
265
265
|
) }, e.id)) }),
|
|
266
266
|
/* @__PURE__ */ o("div", { className: "border-d-border mb-1 w-full border-b" }),
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import { AppSelect as h } from "../../../app-select.js";
|
|
4
4
|
import { Badge as S } from "../../../badge.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as g } from "../../../button.js";
|
|
6
6
|
import { Icon as z } from "../../../icon.js";
|
|
7
|
-
import { Popover as C, PopoverTrigger as
|
|
8
|
-
function
|
|
7
|
+
import { Popover as C, PopoverTrigger as D, PopoverContent as L } from "../../../popover.js";
|
|
8
|
+
function B({
|
|
9
9
|
table: c,
|
|
10
|
-
sortedColumns:
|
|
10
|
+
sortedColumns: f = [],
|
|
11
11
|
sortableColumns: d,
|
|
12
12
|
i18n: o,
|
|
13
13
|
maxSortedColumns: m = 3
|
|
@@ -33,10 +33,10 @@ function T({
|
|
|
33
33
|
c.setSorting(t);
|
|
34
34
|
};
|
|
35
35
|
return /* @__PURE__ */ a(C, { children: [
|
|
36
|
-
/* @__PURE__ */ l(
|
|
36
|
+
/* @__PURE__ */ l(D, { asChild: !0, children: /* @__PURE__ */ a(
|
|
37
37
|
S,
|
|
38
38
|
{
|
|
39
|
-
variant:
|
|
39
|
+
variant: f.length > 0 ? "default" : "ghost",
|
|
40
40
|
className: "hover:border-d-border cursor-pointer hover:border",
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ l(z, { name: "ArrowUpDown" }),
|
|
@@ -44,14 +44,14 @@ function T({
|
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
) }),
|
|
47
|
-
/* @__PURE__ */ a(
|
|
47
|
+
/* @__PURE__ */ a(L, { className: "flex w-[400px] flex-col gap-2", align: "start", children: [
|
|
48
48
|
/* @__PURE__ */ l("div", { className: "text-d-foreground text-md font-semibold", children: o.sorting.sorting }),
|
|
49
|
-
|
|
49
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
|
|
50
50
|
/* @__PURE__ */ a("div", { className: "flex w-full flex-row gap-1 pr-9 text-sm", children: [
|
|
51
51
|
/* @__PURE__ */ l("div", { className: "flex flex-1", children: o.sorting.column }),
|
|
52
52
|
/* @__PURE__ */ l("div", { className: "flex flex-1", children: o.sorting.order })
|
|
53
53
|
] }),
|
|
54
|
-
|
|
54
|
+
f.map((n, t) => /* @__PURE__ */ a("div", { className: "flex w-full flex-row items-end gap-1", children: [
|
|
55
55
|
/* @__PURE__ */ l(
|
|
56
56
|
h,
|
|
57
57
|
{
|
|
@@ -62,7 +62,7 @@ function T({
|
|
|
62
62
|
return s === n?.column.id || !p.has(s);
|
|
63
63
|
}).map((e) => ({
|
|
64
64
|
value: e.column.id,
|
|
65
|
-
label: e.column.columnDef.
|
|
65
|
+
label: e.column.columnDef.meta?.headerLabel || (typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : "") || e.column.id
|
|
66
66
|
})),
|
|
67
67
|
value: n?.column.id,
|
|
68
68
|
onValueChange: (e) => {
|
|
@@ -86,7 +86,7 @@ function T({
|
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
88
|
/* @__PURE__ */ l(
|
|
89
|
-
|
|
89
|
+
g,
|
|
90
90
|
{
|
|
91
91
|
variant: "ghost-destructive",
|
|
92
92
|
size: "sm",
|
|
@@ -98,7 +98,7 @@ function T({
|
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ a("div", { className: "flex w-full gap-2", children: [
|
|
100
100
|
/* @__PURE__ */ l(
|
|
101
|
-
|
|
101
|
+
g,
|
|
102
102
|
{
|
|
103
103
|
className: "flex flex-1",
|
|
104
104
|
variant: "ghost-destructive",
|
|
@@ -109,7 +109,7 @@ function T({
|
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
111
|
/* @__PURE__ */ l(
|
|
112
|
-
|
|
112
|
+
g,
|
|
113
113
|
{
|
|
114
114
|
className: "flex flex-1",
|
|
115
115
|
variant: "ghost",
|
|
@@ -124,5 +124,5 @@ function T({
|
|
|
124
124
|
] });
|
|
125
125
|
}
|
|
126
126
|
export {
|
|
127
|
-
|
|
127
|
+
B as DataTableSortingComponent
|
|
128
128
|
};
|