@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.
@@ -1,69 +1,69 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as g } from "react/jsx-runtime";
3
- import { c } from "../clsx-OuTLNxxd.js";
4
- import { useState as K, useEffect as T, createContext as L, useContext as j, useRef as H } from "react";
5
- import D from "../Badge/index.mjs";
6
- import O from "../Form/Checkbox/index.mjs";
7
- import A from "../Tooltip/index.mjs";
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 z } from "../IconInfoCircleOutline-aO1F3qnG.js";
10
- import m from "../Divider/index.mjs";
11
- import q from "../Pagination/index.mjs";
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 = L({
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 y(e) {
20
- e.classList.add(R);
19
+ function v(t) {
20
+ t.classList.add(R);
21
21
  }
22
- function $(e) {
23
- e.classList.remove(R);
22
+ function $(t) {
23
+ t.classList.remove(R);
24
24
  }
25
- function M(e) {
26
- const { children: t, ...n } = e, { columns: o, rowSelection: r } = n, [d, a] = K(null);
27
- return T(() => {
28
- let i = o.some((u) => !!u.sticky);
29
- return i || (i = !!r?.sticky), i && a(
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
- (u) => {
32
- let l = !1;
33
- for (const k of u)
34
- if (k.boundingClientRect.right > k.intersectionRect.right) {
35
- document.querySelectorAll("#sticky-cell-right").forEach(y), l = !0;
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 (k.boundingClientRect.left < k.intersectionRect.left) {
38
- document.querySelectorAll("#sticky-cell-left").forEach(y), l = !0;
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
- l || document.querySelectorAll('[id^="sticky-cell-"]').forEach($);
41
+ d || document.querySelectorAll('[id^="sticky-cell-"]').forEach($);
42
42
  },
43
43
  { threshold: 1, rootMargin: "0% 100% 0% 100%" }
44
44
  )
45
45
  ), () => {
46
- d && d.disconnect();
46
+ a && a.disconnect();
47
47
  };
48
- }, []), /* @__PURE__ */ s(E.Provider, { value: { observer: d, ...n }, children: t });
48
+ }, []), /* @__PURE__ */ e(E.Provider, { value: { observer: a, ...n }, children: i });
49
49
  }
50
- const b = () => j(E), F = (e) => {
51
- const { title: t, extraElement: n, showTotal: o, total: r, className: d } = e;
52
- return /* @__PURE__ */ g(
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: c(
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
- d
57
+ a
58
58
  ),
59
59
  children: [
60
- /* @__PURE__ */ s("div", { className: "dgs-ui-kit-font-h4-bold dgs-ui-kit-text-gray-700 dgs-ui-kit-w-full", children: t }),
61
- o && /* @__PURE__ */ g("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-shrink-0", children: [
62
- /* @__PURE__ */ s("span", { className: "dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-700 dgs-ui-kit-ml-1", children: "تعداد نتایج:" }),
63
- /* @__PURE__ */ s(
64
- D,
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: r ?? 0,
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 p(e) {
80
- switch (e) {
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 B(e, t) {
92
- return e || (Array.isArray(t) ? t[t.length - 1] : t);
91
+ function O(t, i) {
92
+ return t || (Array.isArray(i) ? i[i.length - 1] : i);
93
93
  }
94
- function _(e) {
95
- return !!(e && e.selectedRowKeys.length > 1 || typeof e?.onSelectRow == "function");
94
+ function _(t) {
95
+ return !!(t && t.selectedRowKeys.length > 1 || typeof t?.onSelectRow == "function");
96
96
  }
97
- function I(e, t) {
98
- return /* @__PURE__ */ s(
97
+ function L(t, i) {
98
+ return /* @__PURE__ */ e(
99
99
  "div",
100
100
  {
101
- className: c(
101
+ className: u(
102
102
  "dgs-ui-kit-w-full dgs-ui-kit-flex dgs-ui-kit-items-centerd",
103
- p(e ?? "center")
103
+ y(t ?? "center")
104
104
  ),
105
- children: /* @__PURE__ */ s(O, { ...t })
105
+ children: /* @__PURE__ */ e(D, { ...i })
106
106
  }
107
107
  );
108
108
  }
109
- function U(e, t) {
110
- if (e)
111
- return c(
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": e === "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": e === "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': t
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 f = (e) => {
123
- const { children: t, className: n, type: o, sticky: r, addBorderToSticky: d, stuckToTop: a } = e, i = H(null), u = o, { observer: l } = b();
124
- return T(() => {
125
- if (!(!i.current || !l))
126
- return r && l.observe(i.current), () => {
127
- !i.current || !l || r && l.unobserve(i.current);
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
- }, [i, l]), /* @__PURE__ */ s(
130
- u,
129
+ }, [r, d]), /* @__PURE__ */ e(
130
+ k,
131
131
  {
132
- ref: i,
133
- className: c(n, U(r, d), {
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': a,
135
- "dgs-ui-kit-top-0 dgs-ui-kit-z-20": a && r,
136
- "dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-z-10": a && !r
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: r && `sticky-cell-${r}`,
139
- children: t
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 W(e, t) {
144
- return e ? Array.isArray(e) ? e.reduce((n, o) => n?.[o] ?? null, t) : t[e] : null;
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 Z(e, t, n) {
147
- if (typeof e.render == "function") return e.render(t, n);
148
- const o = W(e.dataIndex, t);
149
- if (e.ellipsis) {
150
- const r = /* @__PURE__ */ s("div", { className: "!dgs-ui-kit-truncate", children: o });
151
- return typeof e.ellipsis != "boolean" && e.ellipsis.hideTooltip ? r : /* @__PURE__ */ s(
152
- A,
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: o,
156
- children: r
473
+ content: l,
474
+ children: s
157
475
  }
158
476
  );
159
477
  }
160
- return o;
478
+ return l;
161
479
  }
162
- const G = (e) => {
163
- const { havePagination: t } = e, { columns: n, data: o, rowKey: r, rowSelection: d, stickyTableHeader: a } = b();
164
- return /* @__PURE__ */ s("tbody", { children: o.map((i, u) => /* @__PURE__ */ g("tr", { children: [
165
- _(d) && /* @__PURE__ */ s(
166
- f,
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: c(
487
+ className: u(
170
488
  x,
171
- d?.className,
489
+ a?.className,
172
490
  {
173
- "dgs-ui-kit-border-b-0 dgs-ui-kit-rounded-br-2xl": !t && u === o.length - 1
491
+ "dgs-ui-kit-border-b-0 dgs-ui-kit-rounded-br-2xl": !i && g === l.length - 1
174
492
  },
175
- d?.className
493
+ a?.className
176
494
  ),
177
- sticky: d?.sticky,
178
- addBorderToSticky: a ? u !== 0 : !0,
179
- children: I(d?.align, {
180
- onChange: (l) => d?.onSelectRow(l, i[r]),
181
- checked: !!d?.selectedRowKeys.find((l) => l === i[r])
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((l) => /* @__PURE__ */ s(
186
- f,
503
+ n.map((f) => /* @__PURE__ */ e(
504
+ h,
187
505
  {
188
506
  type: "td",
189
- className: c(
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": !t && u === o.length - 1
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
- l.className
512
+ f.className
195
513
  ),
196
- sticky: l.sticky,
197
- addBorderToSticky: a ? u !== 0 : !0,
198
- children: /* @__PURE__ */ s(
514
+ sticky: f.sticky,
515
+ addBorderToSticky: c ? g !== 0 : !0,
516
+ children: /* @__PURE__ */ e(
199
517
  "div",
200
518
  {
201
- className: c(
519
+ className: u(
202
520
  "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-ml-2",
203
- p(l.align)
521
+ y(f.align)
204
522
  ),
205
- children: Z(l, i, u)
523
+ children: Q(f, d, g)
206
524
  }
207
525
  )
208
526
  },
209
- `${i[r]}-${B(l.key, l.dataIndex)}`
527
+ `${d[s]}-${O(f.key, f.dataIndex)}`
210
528
  ))
211
- ] }, i[r])) });
212
- }, J = (e) => /* @__PURE__ */ s(
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
- ...e,
221
- children: /* @__PURE__ */ s(
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 Q(e, t) {
231
- if (e.length !== t.length) return !1;
232
- e.sort(), t.sort();
233
- for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
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 h = 16, v = "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", w = "!dgs-ui-kit-h-8 dgs-ui-kit-shrink-0";
237
- function C(e, t) {
238
- return /* @__PURE__ */ s("button", { onClick: () => t.onSort(e), children: /* @__PURE__ */ s(
239
- e === "ascend" ? J : P,
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: h,
242
- height: h,
243
- className: t.active === e ? "dgs-ui-kit-text-primary-500" : "dgs-ui-kit-text-gray-500"
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 N(e, t) {
248
- return /* @__PURE__ */ g("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: [
249
- /* @__PURE__ */ s("span", { children: e }),
250
- t && (t.anchorIcon ?? /* @__PURE__ */ s(
251
- z,
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: h,
254
- height: h
571
+ width: p,
572
+ height: p
255
573
  }
256
574
  ))
257
575
  ] });
258
576
  }
259
- function S(e, t) {
260
- return e.map((n) => n[t]);
577
+ function S(t, i) {
578
+ return t.map((n) => n[i]);
261
579
  }
262
- const X = (e) => {
263
- const { haveHeader: t } = e, { columns: n, rowKey: o, rowSelection: r, data: d, stickyTableHeader: a } = b();
264
- return /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ g("tr", { children: [
265
- _(r) && /* @__PURE__ */ s(
266
- f,
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: c(
270
- v,
271
- { "dgs-ui-kit-rounded-tr-2xl": !t },
272
- r?.className
587
+ className: u(
588
+ C,
589
+ { "dgs-ui-kit-rounded-tr-2xl": !i },
590
+ s?.className
273
591
  ),
274
- sticky: r?.sticky,
275
- stuckToTop: a,
276
- children: /* @__PURE__ */ g("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-between", children: [
277
- I(r?.align, {
278
- checked: r.selectedRowKeys.length > 0,
279
- isIndeterminate: !Q(
280
- S(d, o),
281
- r.selectedRowKeys
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: (i) => r?.onSelectRow(i, i.target.checked ? S(d, o) : [])
601
+ onChange: (r) => s?.onSelectRow(r, r.target.checked ? S(a, l) : [])
284
602
  }),
285
- /* @__PURE__ */ s(
286
- m,
603
+ /* @__PURE__ */ e(
604
+ b,
287
605
  {
288
606
  type: "vertical",
289
- className: w
607
+ className: N
290
608
  }
291
609
  )
292
610
  ] })
293
611
  }
294
612
  ),
295
- n.map((i, u) => /* @__PURE__ */ s(
296
- f,
613
+ n.map((r, k) => /* @__PURE__ */ e(
614
+ h,
297
615
  {
298
616
  type: "th",
299
- sticky: i.sticky,
300
- className: c(
301
- v,
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": !t
621
+ "first:dgs-ui-kit-rounded-tr-2xl last:dgs-ui-kit-rounded-tl-2xl": !i
304
622
  },
305
- i.className
623
+ r.className
306
624
  ),
307
- stuckToTop: a,
308
- children: /* @__PURE__ */ g("div", { className: "dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center", children: [
309
- /* @__PURE__ */ g(
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: c(
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
- p(i.align)
632
+ y(r.align)
315
633
  ),
316
634
  children: [
317
- i.tooltip?.content ? /* @__PURE__ */ s(A, { ...i.tooltip, children: N(i.title, i.tooltip) }) : N(i.title),
318
- typeof i.sort?.onSort == "function" && /* @__PURE__ */ g("div", { className: "dgs-ui-kit-flex dgs-ui-kit-flex-col", children: [
319
- C("ascend", i.sort),
320
- C("descend", i.sort)
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
- u !== n.length - 1 && /* @__PURE__ */ s(
326
- m,
643
+ k !== n.length - 1 && /* @__PURE__ */ e(
644
+ b,
327
645
  {
328
646
  type: "vertical",
329
- className: w
647
+ className: N
330
648
  }
331
649
  )
332
650
  ] })
333
651
  },
334
- B(i.key, i.dataIndex)
652
+ O(r.key, r.dataIndex)
335
653
  ))
336
654
  ] }) });
337
655
  };
338
- function ae(e) {
339
- const { header: t, wrapperClassName: n, className: o, data: r, pagination: d } = e, a = (t && Object.values(t).length > 0) ?? !1, i = !!(d?.totalCount && d?.pageSize);
340
- return /* @__PURE__ */ g(
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: c(
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
- a && /* @__PURE__ */ s(
349
- F,
666
+ c && /* @__PURE__ */ e(
667
+ U,
350
668
  {
351
- ...t,
352
- total: d?.totalCount ?? r.length
669
+ ...i,
670
+ total: a?.totalCount ?? s.length
353
671
  }
354
672
  ),
355
- /* @__PURE__ */ s("table", { className: o, children: /* @__PURE__ */ g(M, { ...e, children: [
356
- /* @__PURE__ */ s(X, { haveHeader: a }),
357
- /* @__PURE__ */ s(G, { havePagination: i })
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
- i && /* @__PURE__ */ s(
360
- q,
677
+ r && /* @__PURE__ */ e(
678
+ M,
361
679
  {
362
- className: c("dgs-ui-kit-py-4 !dgs-ui-kit-px-0", d?.className),
363
- ...d
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
- ae as default
689
+ fe as default
372
690
  };