@dgshahr/ui-kit 0.0.94 → 0.0.95
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/README.md +53 -0
- package/dist/Form/Select/index.cjs +1 -1
- package/dist/Form/Select/index.mjs +1 -1
- package/dist/Form/Select/types.d.ts +1 -1
- package/dist/Form/Select/types.d.ts.map +1 -1
- package/dist/Table/TBody.d.ts.map +1 -1
- package/dist/Table/TBodyEmpty.d.ts +4 -0
- package/dist/Table/TBodyEmpty.d.ts.map +1 -0
- package/dist/Table/TBodyLoading.d.ts +4 -0
- package/dist/Table/TBodyLoading.d.ts.map +1 -0
- package/dist/Table/index.cjs +1 -1
- package/dist/Table/index.mjs +509 -191
- package/dist/Table/types.d.ts +4 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/package.json +28 -2
package/dist/Table/index.mjs
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c } from "../clsx-OuTLNxxd.js";
|
|
4
|
-
import { useState as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { c as u } from "../clsx-OuTLNxxd.js";
|
|
4
|
+
import { useState as I, useEffect as A, createContext as K, useContext as j, useRef as H } from "react";
|
|
5
|
+
import z from "../Badge/index.mjs";
|
|
6
|
+
import D from "../Form/Checkbox/index.mjs";
|
|
7
|
+
import B from "../Tooltip/index.mjs";
|
|
8
8
|
import { I as P } from "../IconArrowDown2-7ddwV5IE.js";
|
|
9
|
-
import { I as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import { I as q } from "../IconInfoCircleOutline-aO1F3qnG.js";
|
|
10
|
+
import b from "../Divider/index.mjs";
|
|
11
|
+
import M from "../Pagination/index.mjs";
|
|
12
12
|
import '../assets/styles.css';/* empty css */
|
|
13
|
-
const E =
|
|
13
|
+
const E = K({
|
|
14
14
|
observer: null,
|
|
15
15
|
columns: [],
|
|
16
16
|
data: [],
|
|
17
17
|
rowKey: ""
|
|
18
18
|
}), R = "after:!dgs-ui-kit-shadow-[rgba(0,0,0,0.06)]";
|
|
19
|
-
function
|
|
20
|
-
|
|
19
|
+
function v(t) {
|
|
20
|
+
t.classList.add(R);
|
|
21
21
|
}
|
|
22
|
-
function $(
|
|
23
|
-
|
|
22
|
+
function $(t) {
|
|
23
|
+
t.classList.remove(R);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const { children:
|
|
27
|
-
return
|
|
28
|
-
let
|
|
29
|
-
return
|
|
25
|
+
function F(t) {
|
|
26
|
+
const { children: i, ...n } = t, { columns: l, rowSelection: s } = n, [a, c] = I(null);
|
|
27
|
+
return A(() => {
|
|
28
|
+
let r = l.some((k) => !!k.sticky);
|
|
29
|
+
return r || (r = !!s?.sticky), r && c(
|
|
30
30
|
new IntersectionObserver(
|
|
31
|
-
(
|
|
32
|
-
let
|
|
33
|
-
for (const
|
|
34
|
-
if (
|
|
35
|
-
document.querySelectorAll("#sticky-cell-right").forEach(
|
|
31
|
+
(k) => {
|
|
32
|
+
let d = !1;
|
|
33
|
+
for (const g of k)
|
|
34
|
+
if (g.boundingClientRect.right > g.intersectionRect.right) {
|
|
35
|
+
document.querySelectorAll("#sticky-cell-right").forEach(v), d = !0;
|
|
36
36
|
break;
|
|
37
|
-
} else if (
|
|
38
|
-
document.querySelectorAll("#sticky-cell-left").forEach(
|
|
37
|
+
} else if (g.boundingClientRect.left < g.intersectionRect.left) {
|
|
38
|
+
document.querySelectorAll("#sticky-cell-left").forEach(v), d = !0;
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
d || document.querySelectorAll('[id^="sticky-cell-"]').forEach($);
|
|
42
42
|
},
|
|
43
43
|
{ threshold: 1, rootMargin: "0% 100% 0% 100%" }
|
|
44
44
|
)
|
|
45
45
|
), () => {
|
|
46
|
-
|
|
46
|
+
a && a.disconnect();
|
|
47
47
|
};
|
|
48
|
-
}, []), /* @__PURE__ */
|
|
48
|
+
}, []), /* @__PURE__ */ e(E.Provider, { value: { observer: a, ...n }, children: i });
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
const { title:
|
|
52
|
-
return /* @__PURE__ */
|
|
50
|
+
const m = () => j(E), U = (t) => {
|
|
51
|
+
const { title: i, extraElement: n, showTotal: l, total: s, className: a } = t;
|
|
52
|
+
return /* @__PURE__ */ o(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
55
|
+
className: u(
|
|
56
56
|
"dgs-ui-kit-p-4 dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-space-x-1 dgs-ui-kit-space-x-reverse dgs-ui-kit-border-b dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200",
|
|
57
|
-
|
|
57
|
+
a
|
|
58
58
|
),
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
60
|
+
/* @__PURE__ */ e("div", { className: "dgs-ui-kit-font-h4-bold dgs-ui-kit-text-gray-700 dgs-ui-kit-w-full", children: i }),
|
|
61
|
+
l && /* @__PURE__ */ o("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-shrink-0", children: [
|
|
62
|
+
/* @__PURE__ */ e("span", { className: "dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-700 dgs-ui-kit-ml-1", children: "تعداد نتایج:" }),
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
z,
|
|
65
65
|
{
|
|
66
|
-
value:
|
|
66
|
+
value: s ?? 0,
|
|
67
67
|
valueType: "number",
|
|
68
68
|
size: "large",
|
|
69
69
|
color: "primary",
|
|
@@ -76,8 +76,8 @@ const b = () => j(E), F = (e) => {
|
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
};
|
|
79
|
-
function
|
|
80
|
-
switch (
|
|
79
|
+
function y(t) {
|
|
80
|
+
switch (t) {
|
|
81
81
|
case "center":
|
|
82
82
|
return "dgs-ui-kit-justify-center";
|
|
83
83
|
case "start":
|
|
@@ -88,128 +88,446 @@ function p(e) {
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function O(t, i) {
|
|
92
|
+
return t || (Array.isArray(i) ? i[i.length - 1] : i);
|
|
93
93
|
}
|
|
94
|
-
function _(
|
|
95
|
-
return !!(
|
|
94
|
+
function _(t) {
|
|
95
|
+
return !!(t && t.selectedRowKeys.length > 1 || typeof t?.onSelectRow == "function");
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
return /* @__PURE__ */
|
|
97
|
+
function L(t, i) {
|
|
98
|
+
return /* @__PURE__ */ e(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
|
-
className:
|
|
101
|
+
className: u(
|
|
102
102
|
"dgs-ui-kit-w-full dgs-ui-kit-flex dgs-ui-kit-items-centerd",
|
|
103
|
-
|
|
103
|
+
y(t ?? "center")
|
|
104
104
|
),
|
|
105
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ e(D, { ...i })
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
109
|
+
function W(t, i) {
|
|
110
|
+
if (t)
|
|
111
|
+
return u(
|
|
112
112
|
"dgs-ui-kit-sticky dgs-ui-kit-z-10",
|
|
113
113
|
'after:dgs-ui-kit-content[""] after:dgs-ui-kit-absolute after:dgs-ui-kit-top-0 after:dgs-ui-kit-h-full after:dgs-ui-kit-w-[30px] after:dgs-ui-kit-transition-shadow',
|
|
114
114
|
// sticky shadow class
|
|
115
115
|
{
|
|
116
|
-
" dgs-ui-kit-right-[-1px] dgs-ui-kit-pr-[calc(1em+1px)] after:dgs-ui-kit-left-0 after:-dgs-ui-kit-translate-x-full after:dgs-ui-kit-shadow-[inset_-10px_0_8px_-8px] after:dgs-ui-kit-shadow-transparent":
|
|
117
|
-
" dgs-ui-kit-left-[-1px] dgs-ui-kit-pl-[calc(1em+1px)] after:dgs-ui-kit-right-0 after:dgs-ui-kit-translate-x-full after:dgs-ui-kit-shadow-[inset_10px_0_8px_-8px] after:dgs-ui-kit-shadow-transparent":
|
|
118
|
-
'before:dgs-ui-kit-content-[""] before:dgs-ui-kit-absolute before:dgs-ui-kit-top-0 before:dgs-ui-kit-right-0 before:dgs-ui-kit-w-full before:dgs-ui-kit-border-t before:md:dgs-ui-kit-border-t-0 before:dgs-ui-kit-border-solid before:dgs-ui-kit-border-gray-200':
|
|
116
|
+
" dgs-ui-kit-right-[-1px] dgs-ui-kit-pr-[calc(1em+1px)] after:dgs-ui-kit-left-0 after:-dgs-ui-kit-translate-x-full after:dgs-ui-kit-shadow-[inset_-10px_0_8px_-8px] after:dgs-ui-kit-shadow-transparent": t === "right",
|
|
117
|
+
" dgs-ui-kit-left-[-1px] dgs-ui-kit-pl-[calc(1em+1px)] after:dgs-ui-kit-right-0 after:dgs-ui-kit-translate-x-full after:dgs-ui-kit-shadow-[inset_10px_0_8px_-8px] after:dgs-ui-kit-shadow-transparent": t === "left",
|
|
118
|
+
'before:dgs-ui-kit-content-[""] before:dgs-ui-kit-absolute before:dgs-ui-kit-top-0 before:dgs-ui-kit-right-0 before:dgs-ui-kit-w-full before:dgs-ui-kit-border-t before:md:dgs-ui-kit-border-t-0 before:dgs-ui-kit-border-solid before:dgs-ui-kit-border-gray-200': i
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
const { children:
|
|
124
|
-
return
|
|
125
|
-
if (!(!
|
|
126
|
-
return
|
|
127
|
-
!
|
|
122
|
+
const h = (t) => {
|
|
123
|
+
const { children: i, className: n, type: l, sticky: s, addBorderToSticky: a, stuckToTop: c } = t, r = H(null), k = l, { observer: d } = m();
|
|
124
|
+
return A(() => {
|
|
125
|
+
if (!(!r.current || !d))
|
|
126
|
+
return s && d.observe(r.current), () => {
|
|
127
|
+
!r.current || !d || s && d.unobserve(r.current);
|
|
128
128
|
};
|
|
129
|
-
}, [
|
|
130
|
-
|
|
129
|
+
}, [r, d]), /* @__PURE__ */ e(
|
|
130
|
+
k,
|
|
131
131
|
{
|
|
132
|
-
ref:
|
|
133
|
-
className:
|
|
134
|
-
'dgs-ui-kit-border-b-0 before:dgs-ui-kit-content[""] before:dgs-ui-kit-absolute before:dgs-ui-kit-bottom-0 before:dgs-ui-kit-left-0 before:dgs-ui-kit-w-full before:dgs-ui-kit-border-b before:dgs-ui-kit-border-solid before:dgs-ui-kit-border-gray-200':
|
|
135
|
-
"dgs-ui-kit-top-0 dgs-ui-kit-z-20":
|
|
136
|
-
"dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-z-10":
|
|
132
|
+
ref: r,
|
|
133
|
+
className: u(n, W(s, a), {
|
|
134
|
+
'dgs-ui-kit-border-b-0 before:dgs-ui-kit-content[""] before:dgs-ui-kit-absolute before:dgs-ui-kit-bottom-0 before:dgs-ui-kit-left-0 before:dgs-ui-kit-w-full before:dgs-ui-kit-border-b before:dgs-ui-kit-border-solid before:dgs-ui-kit-border-gray-200': c,
|
|
135
|
+
"dgs-ui-kit-top-0 dgs-ui-kit-z-20": c && s,
|
|
136
|
+
"dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-z-10": c && !s
|
|
137
137
|
}),
|
|
138
|
-
id:
|
|
139
|
-
children:
|
|
138
|
+
id: s && `sticky-cell-${s}`,
|
|
139
|
+
children: i
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
|
+
}, Y = () => {
|
|
143
|
+
const { columns: t, emptyContent: i } = m();
|
|
144
|
+
return /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length, children: i }) }) });
|
|
145
|
+
}, Z = (t) => {
|
|
146
|
+
const { className: i, ...n } = t;
|
|
147
|
+
return /* @__PURE__ */ o(
|
|
148
|
+
"svg",
|
|
149
|
+
{
|
|
150
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
151
|
+
width: "200px",
|
|
152
|
+
height: "200px",
|
|
153
|
+
viewBox: "0 0 100 100",
|
|
154
|
+
preserveAspectRatio: "xMidYMid",
|
|
155
|
+
className: u(
|
|
156
|
+
"dgs-ui-kit-m-auto dgs-ui-kit-bg-none dgs-ui-kit-block dgs-ui-kit-text-primary-500",
|
|
157
|
+
i
|
|
158
|
+
),
|
|
159
|
+
...n,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ e("g", { transform: "translate(79,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(0)", children: /* @__PURE__ */ o(
|
|
162
|
+
"circle",
|
|
163
|
+
{
|
|
164
|
+
cx: "0",
|
|
165
|
+
cy: "0",
|
|
166
|
+
r: "6",
|
|
167
|
+
fill: "currentColor",
|
|
168
|
+
fillOpacity: "1",
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ e(
|
|
171
|
+
"animateTransform",
|
|
172
|
+
{
|
|
173
|
+
attributeName: "transform",
|
|
174
|
+
type: "scale",
|
|
175
|
+
begin: "-0.875s",
|
|
176
|
+
values: "1.5 1.5;1 1",
|
|
177
|
+
keyTimes: "0;1",
|
|
178
|
+
dur: "1s",
|
|
179
|
+
repeatCount: "indefinite"
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ e(
|
|
183
|
+
"animate",
|
|
184
|
+
{
|
|
185
|
+
attributeName: "fill-opacity",
|
|
186
|
+
keyTimes: "0;1",
|
|
187
|
+
dur: "1s",
|
|
188
|
+
repeatCount: "indefinite",
|
|
189
|
+
values: "1;0",
|
|
190
|
+
begin: "-0.875s"
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
) }) }),
|
|
196
|
+
/* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(45)", children: /* @__PURE__ */ o(
|
|
197
|
+
"circle",
|
|
198
|
+
{
|
|
199
|
+
cx: "0",
|
|
200
|
+
cy: "0",
|
|
201
|
+
r: "6",
|
|
202
|
+
fill: "currentColor",
|
|
203
|
+
fillOpacity: "0.875",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ e(
|
|
206
|
+
"animateTransform",
|
|
207
|
+
{
|
|
208
|
+
attributeName: "transform",
|
|
209
|
+
type: "scale",
|
|
210
|
+
begin: "-0.75s",
|
|
211
|
+
values: "1.5 1.5;1 1",
|
|
212
|
+
keyTimes: "0;1",
|
|
213
|
+
dur: "1s",
|
|
214
|
+
repeatCount: "indefinite"
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
/* @__PURE__ */ e(
|
|
218
|
+
"animate",
|
|
219
|
+
{
|
|
220
|
+
attributeName: "fill-opacity",
|
|
221
|
+
keyTimes: "0;1",
|
|
222
|
+
dur: "1s",
|
|
223
|
+
repeatCount: "indefinite",
|
|
224
|
+
values: "1;0",
|
|
225
|
+
begin: "-0.75s"
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
) }) }),
|
|
231
|
+
/* @__PURE__ */ e("g", { transform: "translate(50,79)", children: /* @__PURE__ */ e("g", { transform: "rotate(90)", children: /* @__PURE__ */ o(
|
|
232
|
+
"circle",
|
|
233
|
+
{
|
|
234
|
+
cx: "0",
|
|
235
|
+
cy: "0",
|
|
236
|
+
r: "6",
|
|
237
|
+
fill: "currentColor",
|
|
238
|
+
fillOpacity: "0.75",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ e(
|
|
241
|
+
"animateTransform",
|
|
242
|
+
{
|
|
243
|
+
attributeName: "transform",
|
|
244
|
+
type: "scale",
|
|
245
|
+
begin: "-0.625s",
|
|
246
|
+
values: "1.5 1.5;1 1",
|
|
247
|
+
keyTimes: "0;1",
|
|
248
|
+
dur: "1s",
|
|
249
|
+
repeatCount: "indefinite"
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ e(
|
|
253
|
+
"animate",
|
|
254
|
+
{
|
|
255
|
+
attributeName: "fill-opacity",
|
|
256
|
+
keyTimes: "0;1",
|
|
257
|
+
dur: "1s",
|
|
258
|
+
repeatCount: "indefinite",
|
|
259
|
+
values: "1;0",
|
|
260
|
+
begin: "-0.625s"
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
) }) }),
|
|
266
|
+
/* @__PURE__ */ e("g", { transform: "translate(29.493903345590123,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(135)", children: /* @__PURE__ */ o(
|
|
267
|
+
"circle",
|
|
268
|
+
{
|
|
269
|
+
cx: "0",
|
|
270
|
+
cy: "0",
|
|
271
|
+
r: "6",
|
|
272
|
+
fill: "currentColor",
|
|
273
|
+
fillOpacity: "0.625",
|
|
274
|
+
children: [
|
|
275
|
+
/* @__PURE__ */ e(
|
|
276
|
+
"animateTransform",
|
|
277
|
+
{
|
|
278
|
+
attributeName: "transform",
|
|
279
|
+
type: "scale",
|
|
280
|
+
begin: "-0.5s",
|
|
281
|
+
values: "1.5 1.5;1 1",
|
|
282
|
+
keyTimes: "0;1",
|
|
283
|
+
dur: "1s",
|
|
284
|
+
repeatCount: "indefinite"
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ e(
|
|
288
|
+
"animate",
|
|
289
|
+
{
|
|
290
|
+
attributeName: "fill-opacity",
|
|
291
|
+
keyTimes: "0;1",
|
|
292
|
+
dur: "1s",
|
|
293
|
+
repeatCount: "indefinite",
|
|
294
|
+
values: "1;0",
|
|
295
|
+
begin: "-0.5s"
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
) }) }),
|
|
301
|
+
/* @__PURE__ */ e("g", { transform: "translate(21,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(180)", children: /* @__PURE__ */ o(
|
|
302
|
+
"circle",
|
|
303
|
+
{
|
|
304
|
+
cx: "0",
|
|
305
|
+
cy: "0",
|
|
306
|
+
r: "6",
|
|
307
|
+
fill: "currentColor",
|
|
308
|
+
fillOpacity: "0.5",
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ e(
|
|
311
|
+
"animateTransform",
|
|
312
|
+
{
|
|
313
|
+
attributeName: "transform",
|
|
314
|
+
type: "scale",
|
|
315
|
+
begin: "-0.375s",
|
|
316
|
+
values: "1.5 1.5;1 1",
|
|
317
|
+
keyTimes: "0;1",
|
|
318
|
+
dur: "1s",
|
|
319
|
+
repeatCount: "indefinite"
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
/* @__PURE__ */ e(
|
|
323
|
+
"animate",
|
|
324
|
+
{
|
|
325
|
+
attributeName: "fill-opacity",
|
|
326
|
+
keyTimes: "0;1",
|
|
327
|
+
dur: "1s",
|
|
328
|
+
repeatCount: "indefinite",
|
|
329
|
+
values: "1;0",
|
|
330
|
+
begin: "-0.375s"
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
) }) }),
|
|
336
|
+
/* @__PURE__ */ e("g", { transform: "translate(29.493903345590116,29.493903345590123)", children: /* @__PURE__ */ e("g", { transform: "rotate(225)", children: /* @__PURE__ */ o(
|
|
337
|
+
"circle",
|
|
338
|
+
{
|
|
339
|
+
cx: "0",
|
|
340
|
+
cy: "0",
|
|
341
|
+
r: "6",
|
|
342
|
+
fill: "currentColor",
|
|
343
|
+
fillOpacity: "0.375",
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ e(
|
|
346
|
+
"animateTransform",
|
|
347
|
+
{
|
|
348
|
+
attributeName: "transform",
|
|
349
|
+
type: "scale",
|
|
350
|
+
begin: "-0.25s",
|
|
351
|
+
values: "1.5 1.5;1 1",
|
|
352
|
+
keyTimes: "0;1",
|
|
353
|
+
dur: "1s",
|
|
354
|
+
repeatCount: "indefinite"
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ e(
|
|
358
|
+
"animate",
|
|
359
|
+
{
|
|
360
|
+
attributeName: "fill-opacity",
|
|
361
|
+
keyTimes: "0;1",
|
|
362
|
+
dur: "1s",
|
|
363
|
+
repeatCount: "indefinite",
|
|
364
|
+
values: "1;0",
|
|
365
|
+
begin: "-0.25s"
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
) }) }),
|
|
371
|
+
/* @__PURE__ */ e("g", { transform: "translate(49.99999999999999,21)", children: /* @__PURE__ */ e("g", { transform: "rotate(270)", children: /* @__PURE__ */ o(
|
|
372
|
+
"circle",
|
|
373
|
+
{
|
|
374
|
+
cx: "0",
|
|
375
|
+
cy: "0",
|
|
376
|
+
r: "6",
|
|
377
|
+
fill: "currentColor",
|
|
378
|
+
fillOpacity: "0.25",
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ e(
|
|
381
|
+
"animateTransform",
|
|
382
|
+
{
|
|
383
|
+
attributeName: "transform",
|
|
384
|
+
type: "scale",
|
|
385
|
+
begin: "-0.125s",
|
|
386
|
+
values: "1.5 1.5;1 1",
|
|
387
|
+
keyTimes: "0;1",
|
|
388
|
+
dur: "1s",
|
|
389
|
+
repeatCount: "indefinite"
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ e(
|
|
393
|
+
"animate",
|
|
394
|
+
{
|
|
395
|
+
attributeName: "fill-opacity",
|
|
396
|
+
keyTimes: "0;1",
|
|
397
|
+
dur: "1s",
|
|
398
|
+
repeatCount: "indefinite",
|
|
399
|
+
values: "1;0",
|
|
400
|
+
begin: "-0.125s"
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
) }) }),
|
|
406
|
+
/* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,29.493903345590116)", children: /* @__PURE__ */ e("g", { transform: "rotate(315)", children: /* @__PURE__ */ o(
|
|
407
|
+
"circle",
|
|
408
|
+
{
|
|
409
|
+
cx: "0",
|
|
410
|
+
cy: "0",
|
|
411
|
+
r: "6",
|
|
412
|
+
fill: "currentColor",
|
|
413
|
+
fillOpacity: "0.125",
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ e(
|
|
416
|
+
"animateTransform",
|
|
417
|
+
{
|
|
418
|
+
attributeName: "transform",
|
|
419
|
+
type: "scale",
|
|
420
|
+
begin: "0s",
|
|
421
|
+
values: "1.5 1.5;1 1",
|
|
422
|
+
keyTimes: "0;1",
|
|
423
|
+
dur: "1s",
|
|
424
|
+
repeatCount: "indefinite"
|
|
425
|
+
}
|
|
426
|
+
),
|
|
427
|
+
/* @__PURE__ */ e(
|
|
428
|
+
"animate",
|
|
429
|
+
{
|
|
430
|
+
attributeName: "fill-opacity",
|
|
431
|
+
keyTimes: "0;1",
|
|
432
|
+
dur: "1s",
|
|
433
|
+
repeatCount: "indefinite",
|
|
434
|
+
values: "1;0",
|
|
435
|
+
begin: "0s"
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
) }) })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}, G = () => {
|
|
445
|
+
const { columns: t, loading: i } = m();
|
|
446
|
+
return /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
447
|
+
"td",
|
|
448
|
+
{
|
|
449
|
+
className: "dgs-ui-kit-p-10",
|
|
450
|
+
colSpan: t.length,
|
|
451
|
+
children: /* @__PURE__ */ e(
|
|
452
|
+
Z,
|
|
453
|
+
{
|
|
454
|
+
width: typeof i != "boolean" ? i.size : 100,
|
|
455
|
+
height: typeof i != "boolean" ? i.size : 100
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
) }) });
|
|
142
460
|
}, x = "dgs-ui-kit-p-4 dgs-ui-kit-pl-0 dgs-ui-kit-bg-white dgs-ui-kit-border-b dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200";
|
|
143
|
-
function
|
|
144
|
-
return
|
|
461
|
+
function J(t, i) {
|
|
462
|
+
return t ? Array.isArray(t) ? t.reduce((n, l) => n?.[l] ?? null, i) : i[t] : null;
|
|
145
463
|
}
|
|
146
|
-
function
|
|
147
|
-
if (typeof
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
return typeof
|
|
152
|
-
|
|
464
|
+
function Q(t, i, n) {
|
|
465
|
+
if (typeof t.render == "function") return t.render(i, n);
|
|
466
|
+
const l = J(t.dataIndex, i);
|
|
467
|
+
if (t.ellipsis) {
|
|
468
|
+
const s = /* @__PURE__ */ e("div", { className: "!dgs-ui-kit-truncate", children: l });
|
|
469
|
+
return typeof t.ellipsis != "boolean" && t.ellipsis.hideTooltip ? s : /* @__PURE__ */ e(
|
|
470
|
+
B,
|
|
153
471
|
{
|
|
154
472
|
wrapperClassName: "dgs-ui-kit-w-full",
|
|
155
|
-
content:
|
|
156
|
-
children:
|
|
473
|
+
content: l,
|
|
474
|
+
children: s
|
|
157
475
|
}
|
|
158
476
|
);
|
|
159
477
|
}
|
|
160
|
-
return
|
|
478
|
+
return l;
|
|
161
479
|
}
|
|
162
|
-
const
|
|
163
|
-
const { havePagination:
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
_(
|
|
166
|
-
|
|
480
|
+
const X = (t) => {
|
|
481
|
+
const { havePagination: i } = t, { columns: n, data: l, rowKey: s, rowSelection: a, stickyTableHeader: c, loading: r, emptyContent: k } = m();
|
|
482
|
+
return r ? /* @__PURE__ */ e(G, {}) : l.length < 1 && k ? /* @__PURE__ */ e(Y, {}) : /* @__PURE__ */ e("tbody", { children: l.map((d, g) => /* @__PURE__ */ o("tr", { children: [
|
|
483
|
+
_(a) && /* @__PURE__ */ e(
|
|
484
|
+
h,
|
|
167
485
|
{
|
|
168
486
|
type: "td",
|
|
169
|
-
className:
|
|
487
|
+
className: u(
|
|
170
488
|
x,
|
|
171
|
-
|
|
489
|
+
a?.className,
|
|
172
490
|
{
|
|
173
|
-
"dgs-ui-kit-border-b-0 dgs-ui-kit-rounded-br-2xl": !
|
|
491
|
+
"dgs-ui-kit-border-b-0 dgs-ui-kit-rounded-br-2xl": !i && g === l.length - 1
|
|
174
492
|
},
|
|
175
|
-
|
|
493
|
+
a?.className
|
|
176
494
|
),
|
|
177
|
-
sticky:
|
|
178
|
-
addBorderToSticky:
|
|
179
|
-
children:
|
|
180
|
-
onChange: (
|
|
181
|
-
checked: !!
|
|
495
|
+
sticky: a?.sticky,
|
|
496
|
+
addBorderToSticky: c ? g !== 0 : !0,
|
|
497
|
+
children: L(a?.align, {
|
|
498
|
+
onChange: (f) => a?.onSelectRow(f, d[s]),
|
|
499
|
+
checked: !!a?.selectedRowKeys.find((f) => f === d[s])
|
|
182
500
|
})
|
|
183
501
|
}
|
|
184
502
|
),
|
|
185
|
-
n.map((
|
|
186
|
-
|
|
503
|
+
n.map((f) => /* @__PURE__ */ e(
|
|
504
|
+
h,
|
|
187
505
|
{
|
|
188
506
|
type: "td",
|
|
189
|
-
className:
|
|
507
|
+
className: u(
|
|
190
508
|
x,
|
|
191
509
|
{
|
|
192
|
-
"dgs-ui-kit-border-b-0 first:dgs-ui-kit-rounded-br-2xl last:dgs-ui-kit-rounded-bl-2xl": !
|
|
510
|
+
"dgs-ui-kit-border-b-0 first:dgs-ui-kit-rounded-br-2xl last:dgs-ui-kit-rounded-bl-2xl": !i && g === l.length - 1
|
|
193
511
|
},
|
|
194
|
-
|
|
512
|
+
f.className
|
|
195
513
|
),
|
|
196
|
-
sticky:
|
|
197
|
-
addBorderToSticky:
|
|
198
|
-
children: /* @__PURE__ */
|
|
514
|
+
sticky: f.sticky,
|
|
515
|
+
addBorderToSticky: c ? g !== 0 : !0,
|
|
516
|
+
children: /* @__PURE__ */ e(
|
|
199
517
|
"div",
|
|
200
518
|
{
|
|
201
|
-
className:
|
|
519
|
+
className: u(
|
|
202
520
|
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-ml-2",
|
|
203
|
-
|
|
521
|
+
y(f.align)
|
|
204
522
|
),
|
|
205
|
-
children:
|
|
523
|
+
children: Q(f, d, g)
|
|
206
524
|
}
|
|
207
525
|
)
|
|
208
526
|
},
|
|
209
|
-
`${
|
|
527
|
+
`${d[s]}-${O(f.key, f.dataIndex)}`
|
|
210
528
|
))
|
|
211
|
-
] },
|
|
212
|
-
},
|
|
529
|
+
] }, d[s])) });
|
|
530
|
+
}, V = (t) => /* @__PURE__ */ e(
|
|
213
531
|
"svg",
|
|
214
532
|
{
|
|
215
533
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -217,8 +535,8 @@ const G = (e) => {
|
|
|
217
535
|
height: "1em",
|
|
218
536
|
fill: "none",
|
|
219
537
|
viewBox: "0 0 24 24",
|
|
220
|
-
...
|
|
221
|
-
children: /* @__PURE__ */
|
|
538
|
+
...t,
|
|
539
|
+
children: /* @__PURE__ */ e(
|
|
222
540
|
"path",
|
|
223
541
|
{
|
|
224
542
|
fill: "currentColor",
|
|
@@ -227,140 +545,140 @@ const G = (e) => {
|
|
|
227
545
|
)
|
|
228
546
|
}
|
|
229
547
|
);
|
|
230
|
-
function
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
for (let n = 0; n <
|
|
548
|
+
function ee(t, i) {
|
|
549
|
+
if (t.length !== i.length) return !1;
|
|
550
|
+
t.sort(), i.sort();
|
|
551
|
+
for (let n = 0; n < t.length; n++) if (t[n] !== i[n]) return !1;
|
|
234
552
|
return !0;
|
|
235
553
|
}
|
|
236
|
-
const
|
|
237
|
-
function
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
|
|
554
|
+
const p = 16, C = "dgs-ui-kit-p-4 dgs-ui-kit-pl-0 dgs-ui-kit-text-gray-500 dgs-ui-kit-bg-gray-50 dgs-ui-kit-border-b dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200", N = "!dgs-ui-kit-h-8 dgs-ui-kit-shrink-0";
|
|
555
|
+
function T(t, i) {
|
|
556
|
+
return /* @__PURE__ */ e("button", { onClick: () => i.onSort(t), children: /* @__PURE__ */ e(
|
|
557
|
+
t === "ascend" ? V : P,
|
|
240
558
|
{
|
|
241
|
-
width:
|
|
242
|
-
height:
|
|
243
|
-
className:
|
|
559
|
+
width: p,
|
|
560
|
+
height: p,
|
|
561
|
+
className: i.active === t ? "dgs-ui-kit-text-primary-500" : "dgs-ui-kit-text-gray-500"
|
|
244
562
|
}
|
|
245
563
|
) });
|
|
246
564
|
}
|
|
247
|
-
function
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
|
|
251
|
-
|
|
565
|
+
function w(t, i) {
|
|
566
|
+
return /* @__PURE__ */ o("div", { className: "dgs-ui-kit-font-p1-medium dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-space-x-1 dgs-ui-kit-space-x-reverse", children: [
|
|
567
|
+
/* @__PURE__ */ e("span", { children: t }),
|
|
568
|
+
i && (i.anchorIcon ?? /* @__PURE__ */ e(
|
|
569
|
+
q,
|
|
252
570
|
{
|
|
253
|
-
width:
|
|
254
|
-
height:
|
|
571
|
+
width: p,
|
|
572
|
+
height: p
|
|
255
573
|
}
|
|
256
574
|
))
|
|
257
575
|
] });
|
|
258
576
|
}
|
|
259
|
-
function S(
|
|
260
|
-
return
|
|
577
|
+
function S(t, i) {
|
|
578
|
+
return t.map((n) => n[i]);
|
|
261
579
|
}
|
|
262
|
-
const
|
|
263
|
-
const { haveHeader:
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
_(
|
|
266
|
-
|
|
580
|
+
const te = (t) => {
|
|
581
|
+
const { haveHeader: i } = t, { columns: n, rowKey: l, rowSelection: s, data: a, stickyTableHeader: c } = m();
|
|
582
|
+
return /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
|
|
583
|
+
_(s) && /* @__PURE__ */ e(
|
|
584
|
+
h,
|
|
267
585
|
{
|
|
268
586
|
type: "th",
|
|
269
|
-
className:
|
|
270
|
-
|
|
271
|
-
{ "dgs-ui-kit-rounded-tr-2xl": !
|
|
272
|
-
|
|
587
|
+
className: u(
|
|
588
|
+
C,
|
|
589
|
+
{ "dgs-ui-kit-rounded-tr-2xl": !i },
|
|
590
|
+
s?.className
|
|
273
591
|
),
|
|
274
|
-
sticky:
|
|
275
|
-
stuckToTop:
|
|
276
|
-
children: /* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
checked:
|
|
279
|
-
isIndeterminate: !
|
|
280
|
-
S(
|
|
281
|
-
|
|
592
|
+
sticky: s?.sticky,
|
|
593
|
+
stuckToTop: c,
|
|
594
|
+
children: /* @__PURE__ */ o("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-between", children: [
|
|
595
|
+
L(s?.align, {
|
|
596
|
+
checked: s.selectedRowKeys.length > 0,
|
|
597
|
+
isIndeterminate: !ee(
|
|
598
|
+
S(a, l),
|
|
599
|
+
s.selectedRowKeys
|
|
282
600
|
),
|
|
283
|
-
onChange: (
|
|
601
|
+
onChange: (r) => s?.onSelectRow(r, r.target.checked ? S(a, l) : [])
|
|
284
602
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
|
|
603
|
+
/* @__PURE__ */ e(
|
|
604
|
+
b,
|
|
287
605
|
{
|
|
288
606
|
type: "vertical",
|
|
289
|
-
className:
|
|
607
|
+
className: N
|
|
290
608
|
}
|
|
291
609
|
)
|
|
292
610
|
] })
|
|
293
611
|
}
|
|
294
612
|
),
|
|
295
|
-
n.map((
|
|
296
|
-
|
|
613
|
+
n.map((r, k) => /* @__PURE__ */ e(
|
|
614
|
+
h,
|
|
297
615
|
{
|
|
298
616
|
type: "th",
|
|
299
|
-
sticky:
|
|
300
|
-
className:
|
|
301
|
-
|
|
617
|
+
sticky: r.sticky,
|
|
618
|
+
className: u(
|
|
619
|
+
C,
|
|
302
620
|
{
|
|
303
|
-
"first:dgs-ui-kit-rounded-tr-2xl last:dgs-ui-kit-rounded-tl-2xl": !
|
|
621
|
+
"first:dgs-ui-kit-rounded-tr-2xl last:dgs-ui-kit-rounded-tl-2xl": !i
|
|
304
622
|
},
|
|
305
|
-
|
|
623
|
+
r.className
|
|
306
624
|
),
|
|
307
|
-
stuckToTop:
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
625
|
+
stuckToTop: c,
|
|
626
|
+
children: /* @__PURE__ */ o("div", { className: "dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center", children: [
|
|
627
|
+
/* @__PURE__ */ o(
|
|
310
628
|
"div",
|
|
311
629
|
{
|
|
312
|
-
className:
|
|
630
|
+
className: u(
|
|
313
631
|
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-space-x-2 dgs-ui-kit-space-x-reverse dgs-ui-kit-w-full dgs-ui-kit-ml-2",
|
|
314
|
-
|
|
632
|
+
y(r.align)
|
|
315
633
|
),
|
|
316
634
|
children: [
|
|
317
|
-
|
|
318
|
-
typeof
|
|
319
|
-
|
|
320
|
-
|
|
635
|
+
r.tooltip?.content ? /* @__PURE__ */ e(B, { ...r.tooltip, children: w(r.title, r.tooltip) }) : w(r.title),
|
|
636
|
+
typeof r.sort?.onSort == "function" && /* @__PURE__ */ o("div", { className: "dgs-ui-kit-flex dgs-ui-kit-flex-col", children: [
|
|
637
|
+
T("ascend", r.sort),
|
|
638
|
+
T("descend", r.sort)
|
|
321
639
|
] })
|
|
322
640
|
]
|
|
323
641
|
}
|
|
324
642
|
),
|
|
325
|
-
|
|
326
|
-
|
|
643
|
+
k !== n.length - 1 && /* @__PURE__ */ e(
|
|
644
|
+
b,
|
|
327
645
|
{
|
|
328
646
|
type: "vertical",
|
|
329
|
-
className:
|
|
647
|
+
className: N
|
|
330
648
|
}
|
|
331
649
|
)
|
|
332
650
|
] })
|
|
333
651
|
},
|
|
334
|
-
|
|
652
|
+
O(r.key, r.dataIndex)
|
|
335
653
|
))
|
|
336
654
|
] }) });
|
|
337
655
|
};
|
|
338
|
-
function
|
|
339
|
-
const { header:
|
|
340
|
-
return /* @__PURE__ */
|
|
656
|
+
function fe(t) {
|
|
657
|
+
const { header: i, wrapperClassName: n, className: l, data: s, pagination: a } = t, c = (i && Object.values(i).length > 0) ?? !1, r = !!(a?.totalCount && a?.pageSize);
|
|
658
|
+
return /* @__PURE__ */ o(
|
|
341
659
|
"div",
|
|
342
660
|
{
|
|
343
|
-
className:
|
|
661
|
+
className: u(
|
|
344
662
|
"dgs-ui-kit-relative dgs-ui-kit-bg-white dgs-ui-kit-border dgs-ui-kit-border-gray-200 dgs-ui-kit-border-solid dgs-ui-kit-rounded-2xl ",
|
|
345
663
|
n
|
|
346
664
|
),
|
|
347
665
|
children: [
|
|
348
|
-
|
|
349
|
-
|
|
666
|
+
c && /* @__PURE__ */ e(
|
|
667
|
+
U,
|
|
350
668
|
{
|
|
351
|
-
...
|
|
352
|
-
total:
|
|
669
|
+
...i,
|
|
670
|
+
total: a?.totalCount ?? s.length
|
|
353
671
|
}
|
|
354
672
|
),
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ e("table", { className: l, children: /* @__PURE__ */ o(F, { ...t, children: [
|
|
674
|
+
/* @__PURE__ */ e(te, { haveHeader: c }),
|
|
675
|
+
/* @__PURE__ */ e(X, { havePagination: r })
|
|
358
676
|
] }) }),
|
|
359
|
-
|
|
360
|
-
|
|
677
|
+
r && /* @__PURE__ */ e(
|
|
678
|
+
M,
|
|
361
679
|
{
|
|
362
|
-
className:
|
|
363
|
-
...
|
|
680
|
+
className: u("dgs-ui-kit-py-4 !dgs-ui-kit-px-0", a?.className),
|
|
681
|
+
...a
|
|
364
682
|
}
|
|
365
683
|
)
|
|
366
684
|
]
|
|
@@ -368,5 +686,5 @@ function ae(e) {
|
|
|
368
686
|
);
|
|
369
687
|
}
|
|
370
688
|
export {
|
|
371
|
-
|
|
689
|
+
fe as default
|
|
372
690
|
};
|