@dgshahr/ui-kit 1.9.5 → 1.9.8

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.
Files changed (41) hide show
  1. package/dist/{DateAndTimePickerFooter-NWsDe_w1.js → DateAndTimePickerFooter-DvYgk9Qh.js} +1 -1
  2. package/dist/{DateAndTimePickerFooter-DVZyqJ2K.cjs → DateAndTimePickerFooter-O7VW4RUW.cjs} +1 -1
  3. package/dist/FieldBottomInfo-DRY-D74F.cjs +1 -0
  4. package/dist/FieldBottomInfo-IvQmalZA.js +79 -0
  5. package/dist/Form/Datepicker/Footer.d.ts.map +1 -1
  6. package/dist/Form/Datepicker/index.cjs +1 -1
  7. package/dist/Form/Datepicker/index.mjs +3 -2
  8. package/dist/Form/FileUploader/index.cjs +1 -1
  9. package/dist/Form/FileUploader/index.mjs +1 -1
  10. package/dist/Form/Input/index.cjs +1 -1
  11. package/dist/Form/Input/index.mjs +2 -2
  12. package/dist/Form/OtpInput/index.cjs +1 -1
  13. package/dist/Form/OtpInput/index.mjs +3 -3
  14. package/dist/Form/Select/index.cjs +1 -1
  15. package/dist/Form/Select/index.mjs +2 -2
  16. package/dist/Form/Textarea/index.cjs +1 -1
  17. package/dist/Form/Textarea/index.mjs +1 -1
  18. package/dist/Form/Timepicker/index.cjs +1 -1
  19. package/dist/Form/Timepicker/index.mjs +2 -2
  20. package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -1
  21. package/dist/{PickerWrapper-C382nk_V.js → PickerWrapper-Bwdfzr3U.js} +1 -1
  22. package/dist/{PickerWrapper-mCAghdQ5.cjs → PickerWrapper-DkRUahWD.cjs} +1 -1
  23. package/dist/Sidebar/index.cjs +1 -1
  24. package/dist/Sidebar/index.mjs +1 -1
  25. package/dist/Table/Header.d.ts.map +1 -1
  26. package/dist/Table/index.cjs +1 -1
  27. package/dist/Table/index.mjs +183 -149
  28. package/dist/Table/types.d.ts +8 -0
  29. package/dist/Table/types.d.ts.map +1 -1
  30. package/dist/{TextFieldWrapper-DJnrmooN.js → TextFieldWrapper-3DRVoeki.js} +17 -17
  31. package/dist/{TextFieldWrapper-GdanVaoy.cjs → TextFieldWrapper-DKMhxMuC.cjs} +1 -1
  32. package/dist/assets/styles.css +1 -1
  33. package/dist/{index-nXqUoTI3.js → index-Ccf1HAfZ.js} +1 -1
  34. package/dist/{index-CZRRnYAI.cjs → index-IPoPOLW2.cjs} +1 -1
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.mjs +1 -1
  37. package/package.json +3 -3
  38. package/dist/FieldBottomInfo-Bb3s_zkd.js +0 -49
  39. package/dist/FieldBottomInfo-CwNgNyMP.cjs +0 -1
  40. package/dist/IconInfoCircleOutline-0ef3qbeI.cjs +0 -1
  41. package/dist/IconInfoCircleOutline-aO1F3qnG.js +0 -35
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
3
- import { c as u } from "../clsx-OuTLNxxd.js";
4
- import j, { useState as H, useEffect as R, createContext as z, useContext as D, useRef as P } from "react";
2
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
3
+ import { c } from "../clsx-OuTLNxxd.js";
4
+ import j, { useState as R, useEffect as P, createContext as z, useContext as H, useRef as D } from "react";
5
5
  import { i as q } from "../isBrowser-Bkqg1t1y.js";
6
6
  import M from "../Badge/index.mjs";
7
- import $ from "../Form/Checkbox/index.mjs";
7
+ import $ from "../Form/Select/index.mjs";
8
+ import F from "../Form/Checkbox/index.mjs";
8
9
  import E from "../Tooltip/index.mjs";
9
- import { I as F } from "../IconArrowDown2-7ddwV5IE.js";
10
- import { I as U } from "../IconInfoCircleOutline-aO1F3qnG.js";
11
- import x from "../Divider/index.mjs";
12
- import W from "../Pagination/index.mjs";
10
+ import { I as U } from "../IconArrowDown2-7ddwV5IE.js";
11
+ import { I as W } from "../FieldBottomInfo-IvQmalZA.js";
12
+ import v from "../Divider/index.mjs";
13
+ import Y from "../Pagination/index.mjs";
13
14
  import '../assets/styles.css';/* empty css */
14
15
  const O = z({
15
16
  observer: null,
@@ -17,50 +18,83 @@ const O = z({
17
18
  data: [],
18
19
  rowKey: ""
19
20
  }), _ = "dgsuikit:after:!shadow-[rgba(0,0,0,0.06)]";
20
- function C(t) {
21
+ function x(t) {
21
22
  t.classList.add(_);
22
23
  }
23
- function Y(t) {
24
+ function Z(t) {
24
25
  t.classList.remove(_);
25
26
  }
26
- function Z(t) {
27
- const { children: i, ...n } = t, { columns: l, rowSelection: s } = n, [a, c] = H(null);
28
- return R(() => {
27
+ function G(t) {
28
+ const { children: i, ...n } = t, { columns: o, rowSelection: s } = n, [l, a] = R(null);
29
+ return P(() => {
29
30
  if (!q()) return;
30
- let r = l.some((g) => !!g.sticky);
31
- return r || (r = !!s?.sticky), r && c(
31
+ let r = o.some((g) => !!g.sticky);
32
+ return r || (r = !!s?.sticky), r && a(
32
33
  new IntersectionObserver(
33
34
  (g) => {
34
- let d = !1;
35
- for (const k of g)
36
- if (k.boundingClientRect.right > k.intersectionRect.right) {
37
- document?.querySelectorAll("#sticky-cell-right").forEach(C), d = !0;
35
+ let u = !1;
36
+ for (const f of g)
37
+ if (f.boundingClientRect.right > f.intersectionRect.right) {
38
+ document?.querySelectorAll("#sticky-cell-right").forEach(x), u = !0;
38
39
  break;
39
- } else if (k.boundingClientRect.left < k.intersectionRect.left) {
40
- document?.querySelectorAll("#sticky-cell-left").forEach(C), d = !0;
40
+ } else if (f.boundingClientRect.left < f.intersectionRect.left) {
41
+ document?.querySelectorAll("#sticky-cell-left").forEach(x), u = !0;
41
42
  break;
42
43
  }
43
- d || document?.querySelectorAll('[id^="sticky-cell-"]').forEach(Y);
44
+ u || document?.querySelectorAll('[id^="sticky-cell-"]').forEach(Z);
44
45
  },
45
46
  { threshold: 1, rootMargin: "0% 100% 0% 100%" }
46
47
  )
47
48
  ), () => {
48
- a && a.disconnect();
49
+ l && l.disconnect();
49
50
  };
50
- }, [l, s]), /* @__PURE__ */ e(O.Provider, { value: { observer: a, ...n }, children: i });
51
+ }, [o, s]), /* @__PURE__ */ e(O.Provider, { value: { observer: l, ...n }, children: i });
51
52
  }
52
- const y = () => D(O), G = (t) => {
53
- const { title: i, extraElement: n, showTotal: l, total: s, className: a } = t;
54
- return /* @__PURE__ */ o(
53
+ const h = () => H(O), J = (t) => {
54
+ const { title: i, extraElement: n, showTotal: o, total: s, className: l, pageCountSelector: a } = t, r = a?.defaultValue ?? a?.options?.[0]?.value ?? 0, [g, u] = R(r);
55
+ function f(k) {
56
+ u(k), a?.onPageCountChange?.(k);
57
+ }
58
+ return /* @__PURE__ */ d(
55
59
  "div",
56
60
  {
57
- className: u(
61
+ className: c(
58
62
  "dgsuikit:p-4 dgsuikit:flex dgsuikit:items-center dgsuikit:space-x-1 dgsuikit:border-b dgsuikit:border-solid dgsuikit:border-gray-200",
59
- a
63
+ l
60
64
  ),
61
65
  children: [
62
66
  /* @__PURE__ */ e("div", { className: "dgsuikit:font-h4-bold dgsuikit:text-gray-700 dgsuikit:w-full", children: i }),
63
- l && /* @__PURE__ */ o("div", { className: "dgsuikit:flex dgsuikit:items-center dgsuikit:shrink-0", children: [
67
+ a && /* @__PURE__ */ d("div", { className: "dgsuikit:flex dgsuikit:ml-2 dgsuikit:items-center dgsuikit:gap-2 dgsuikit:shrink-0 dgsuikit:mr-2", children: [
68
+ /* @__PURE__ */ e("span", { className: "dgsuikit:font-p2-regular dgsuikit:text-gray-700 dgsuikit:whitespace-nowrap", children: "تعداد نمایش:" }),
69
+ /* @__PURE__ */ e(
70
+ $,
71
+ {
72
+ ...a.selectProps,
73
+ wrapperClassName: c(
74
+ "dgsuikit:w-20",
75
+ a.selectProps?.wrapperClassName
76
+ ),
77
+ popoverClassName: c(
78
+ "dgsuikit:!min-w-0",
79
+ a.selectProps?.popoverClassName
80
+ ),
81
+ inputProps: {
82
+ size: 1,
83
+ containerClassName: c(
84
+ "dgsuikit:!p-2 dgsuikit:!gap-x-1",
85
+ a.selectProps?.inputProps?.containerClassName
86
+ ),
87
+ ...a.selectProps?.inputProps
88
+ },
89
+ mode: "single",
90
+ options: a.options,
91
+ value: g,
92
+ searchable: !1,
93
+ onChange: f
94
+ }
95
+ )
96
+ ] }),
97
+ o && /* @__PURE__ */ d("div", { className: "dgsuikit:flex dgsuikit:items-center dgsuikit:shrink-0", children: [
64
98
  /* @__PURE__ */ e("span", { className: "dgsuikit:font-p2-regular dgsuikit:text-gray-700 dgsuikit:ml-1", children: "تعداد نتایج:" }),
65
99
  /* @__PURE__ */ e(
66
100
  M,
@@ -78,7 +112,7 @@ const y = () => D(O), G = (t) => {
78
112
  }
79
113
  );
80
114
  };
81
- function v(t) {
115
+ function C(t) {
82
116
  switch (t) {
83
117
  case "center":
84
118
  return "dgsuikit:justify-center";
@@ -100,17 +134,17 @@ function K(t, i) {
100
134
  return /* @__PURE__ */ e(
101
135
  "div",
102
136
  {
103
- className: u(
137
+ className: c(
104
138
  "dgsuikit:w-full dgsuikit:flex dgsuikit:items-center",
105
- v(t ?? "center")
139
+ C(t ?? "center")
106
140
  ),
107
- children: /* @__PURE__ */ e($, { ...i })
141
+ children: /* @__PURE__ */ e(F, { ...i })
108
142
  }
109
143
  );
110
144
  }
111
- function J(t, i) {
145
+ function Q(t, i) {
112
146
  if (t)
113
- return u(
147
+ return c(
114
148
  "dgsuikit:sticky dgsuikit:z-10",
115
149
  'dgsuikit:after:content[""] dgsuikit:after:absolute dgsuikit:after:top-0 dgsuikit:after:h-full dgsuikit:after:w-[30px] dgsuikit:after:transition-shadow',
116
150
  // sticky shadow class
@@ -121,32 +155,32 @@ function J(t, i) {
121
155
  }
122
156
  );
123
157
  }
124
- const p = (t) => {
125
- const { children: i, className: n, type: l, sticky: s, addBorderToSticky: a, stuckToTop: c } = t, r = P(null), g = l, { observer: d } = y();
126
- return R(() => {
127
- if (!(!r.current || !d))
128
- return s && d.observe(r.current), () => {
129
- !r.current || !d || s && d.unobserve(r.current);
158
+ const y = (t) => {
159
+ const { children: i, className: n, type: o, sticky: s, addBorderToSticky: l, stuckToTop: a } = t, r = D(null), g = o, { observer: u } = h();
160
+ return P(() => {
161
+ if (!(!r.current || !u))
162
+ return s && u.observe(r.current), () => {
163
+ !r.current || !u || s && u.unobserve(r.current);
130
164
  };
131
- }, [r, d]), /* @__PURE__ */ e(
165
+ }, [r, u]), /* @__PURE__ */ e(
132
166
  g,
133
167
  {
134
168
  ref: r,
135
- className: u(n, J(s, a), {
136
- 'dgsuikit:border-b-0 dgsuikit:before:content[""] dgsuikit:before:absolute dgsuikit:before:bottom-0 dgsuikit:before:left-0 dgsuikit:before:w-full dgsuikit:before:border-b dgsuikit:before:border-solid dgsuikit:before:border-gray-200': c,
137
- "dgsuikit:top-0 dgsuikit:z-20": c && s,
138
- "dgsuikit:sticky dgsuikit:top-0 dgsuikit:z-10": c && !s
169
+ className: c(n, Q(s, l), {
170
+ 'dgsuikit:border-b-0 dgsuikit:before:content[""] dgsuikit:before:absolute dgsuikit:before:bottom-0 dgsuikit:before:left-0 dgsuikit:before:w-full dgsuikit:before:border-b dgsuikit:before:border-solid dgsuikit:before:border-gray-200': a,
171
+ "dgsuikit:top-0 dgsuikit:z-20": a && s,
172
+ "dgsuikit:sticky dgsuikit:top-0 dgsuikit:z-10": a && !s
139
173
  }),
140
174
  id: s && `sticky-cell-${s}`,
141
175
  children: i
142
176
  }
143
177
  );
144
- }, Q = () => {
145
- const { columns: t, emptyContent: i } = y();
178
+ }, V = () => {
179
+ const { columns: t, emptyContent: i } = h();
146
180
  return /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length, children: i }) }) });
147
181
  }, X = (t) => {
148
182
  const { className: i, ...n } = t;
149
- return /* @__PURE__ */ o(
183
+ return /* @__PURE__ */ d(
150
184
  "svg",
151
185
  {
152
186
  xmlns: "http://www.w3.org/2000/svg",
@@ -154,13 +188,13 @@ const p = (t) => {
154
188
  height: "200px",
155
189
  viewBox: "0 0 100 100",
156
190
  preserveAspectRatio: "xMidYMid",
157
- className: u(
191
+ className: c(
158
192
  "dgsuikit:m-auto dgsuikit:bg-none dgsuikit:block dgsuikit:text-primary-500",
159
193
  i
160
194
  ),
161
195
  ...n,
162
196
  children: [
163
- /* @__PURE__ */ e("g", { transform: "translate(79,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(0)", children: /* @__PURE__ */ o(
197
+ /* @__PURE__ */ e("g", { transform: "translate(79,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(0)", children: /* @__PURE__ */ d(
164
198
  "circle",
165
199
  {
166
200
  cx: "0",
@@ -195,7 +229,7 @@ const p = (t) => {
195
229
  ]
196
230
  }
197
231
  ) }) }),
198
- /* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(45)", children: /* @__PURE__ */ o(
232
+ /* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(45)", children: /* @__PURE__ */ d(
199
233
  "circle",
200
234
  {
201
235
  cx: "0",
@@ -230,7 +264,7 @@ const p = (t) => {
230
264
  ]
231
265
  }
232
266
  ) }) }),
233
- /* @__PURE__ */ e("g", { transform: "translate(50,79)", children: /* @__PURE__ */ e("g", { transform: "rotate(90)", children: /* @__PURE__ */ o(
267
+ /* @__PURE__ */ e("g", { transform: "translate(50,79)", children: /* @__PURE__ */ e("g", { transform: "rotate(90)", children: /* @__PURE__ */ d(
234
268
  "circle",
235
269
  {
236
270
  cx: "0",
@@ -265,7 +299,7 @@ const p = (t) => {
265
299
  ]
266
300
  }
267
301
  ) }) }),
268
- /* @__PURE__ */ e("g", { transform: "translate(29.493903345590123,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(135)", children: /* @__PURE__ */ o(
302
+ /* @__PURE__ */ e("g", { transform: "translate(29.493903345590123,70.50609665440987)", children: /* @__PURE__ */ e("g", { transform: "rotate(135)", children: /* @__PURE__ */ d(
269
303
  "circle",
270
304
  {
271
305
  cx: "0",
@@ -300,7 +334,7 @@ const p = (t) => {
300
334
  ]
301
335
  }
302
336
  ) }) }),
303
- /* @__PURE__ */ e("g", { transform: "translate(21,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(180)", children: /* @__PURE__ */ o(
337
+ /* @__PURE__ */ e("g", { transform: "translate(21,50)", children: /* @__PURE__ */ e("g", { transform: "rotate(180)", children: /* @__PURE__ */ d(
304
338
  "circle",
305
339
  {
306
340
  cx: "0",
@@ -335,7 +369,7 @@ const p = (t) => {
335
369
  ]
336
370
  }
337
371
  ) }) }),
338
- /* @__PURE__ */ e("g", { transform: "translate(29.493903345590116,29.493903345590123)", children: /* @__PURE__ */ e("g", { transform: "rotate(225)", children: /* @__PURE__ */ o(
372
+ /* @__PURE__ */ e("g", { transform: "translate(29.493903345590116,29.493903345590123)", children: /* @__PURE__ */ e("g", { transform: "rotate(225)", children: /* @__PURE__ */ d(
339
373
  "circle",
340
374
  {
341
375
  cx: "0",
@@ -370,7 +404,7 @@ const p = (t) => {
370
404
  ]
371
405
  }
372
406
  ) }) }),
373
- /* @__PURE__ */ e("g", { transform: "translate(49.99999999999999,21)", children: /* @__PURE__ */ e("g", { transform: "rotate(270)", children: /* @__PURE__ */ o(
407
+ /* @__PURE__ */ e("g", { transform: "translate(49.99999999999999,21)", children: /* @__PURE__ */ e("g", { transform: "rotate(270)", children: /* @__PURE__ */ d(
374
408
  "circle",
375
409
  {
376
410
  cx: "0",
@@ -405,7 +439,7 @@ const p = (t) => {
405
439
  ]
406
440
  }
407
441
  ) }) }),
408
- /* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,29.493903345590116)", children: /* @__PURE__ */ e("g", { transform: "rotate(315)", children: /* @__PURE__ */ o(
442
+ /* @__PURE__ */ e("g", { transform: "translate(70.50609665440987,29.493903345590116)", children: /* @__PURE__ */ e("g", { transform: "rotate(315)", children: /* @__PURE__ */ d(
409
443
  "circle",
410
444
  {
411
445
  cx: "0",
@@ -443,8 +477,8 @@ const p = (t) => {
443
477
  ]
444
478
  }
445
479
  );
446
- }, V = () => {
447
- const { columns: t, loading: i } = y();
480
+ }, ee = () => {
481
+ const { columns: t, loading: i } = h();
448
482
  return /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
449
483
  "td",
450
484
  {
@@ -460,91 +494,91 @@ const p = (t) => {
460
494
  }
461
495
  ) }) });
462
496
  }, N = "dgsuikit:p-4 dgsuikit:pl-0 dgsuikit:bg-white dgsuikit:border-b dgsuikit:border-solid dgsuikit:border-gray-200";
463
- function ee(t, i) {
464
- return t ? Array.isArray(t) ? t.reduce((n, l) => n?.[l] ?? null, i) : i[t] : null;
497
+ function te(t, i) {
498
+ return t ? Array.isArray(t) ? t.reduce((n, o) => n?.[o] ?? null, i) : i[t] : null;
465
499
  }
466
- function te(t, i, n) {
500
+ function ie(t, i, n) {
467
501
  if (typeof t.render == "function") return t.render(i, n);
468
- const l = ee(t.dataIndex, i);
502
+ const o = te(t.dataIndex, i);
469
503
  if (t.ellipsis) {
470
- const s = /* @__PURE__ */ e("div", { className: "dgsuikit:!truncate", children: l });
504
+ const s = /* @__PURE__ */ e("div", { className: "dgsuikit:!truncate", children: o });
471
505
  return typeof t.ellipsis != "boolean" && t.ellipsis.hideTooltip ? s : /* @__PURE__ */ e(
472
506
  E,
473
507
  {
474
508
  wrapperClassName: "dgsuikit:w-full",
475
- content: l,
509
+ content: o,
476
510
  attachToBody: !0,
477
511
  children: s
478
512
  }
479
513
  );
480
514
  }
481
- return l;
515
+ return o;
482
516
  }
483
- const ie = (t) => {
517
+ const re = (t) => {
484
518
  const { havePagination: i } = t, {
485
519
  columns: n,
486
- data: l,
520
+ data: o,
487
521
  rowKey: s,
488
- rowSelection: a,
489
- stickyTableHeader: c,
522
+ rowSelection: l,
523
+ stickyTableHeader: a,
490
524
  loading: r,
491
525
  emptyContent: g,
492
- getRowClassName: d
493
- } = y();
494
- if (r) return /* @__PURE__ */ e(V, {});
495
- if (l.length < 1 && g) return /* @__PURE__ */ e(Q, {});
496
- const k = typeof d == "function";
497
- return /* @__PURE__ */ e("tbody", { children: l.map((m, h) => /* @__PURE__ */ o("tr", { children: [
498
- I(a) && /* @__PURE__ */ e(
499
- p,
526
+ getRowClassName: u
527
+ } = h();
528
+ if (r) return /* @__PURE__ */ e(ee, {});
529
+ if (o.length < 1 && g) return /* @__PURE__ */ e(V, {});
530
+ const f = typeof u == "function";
531
+ return /* @__PURE__ */ e("tbody", { children: o.map((k, p) => /* @__PURE__ */ d("tr", { children: [
532
+ I(l) && /* @__PURE__ */ e(
533
+ y,
500
534
  {
501
535
  type: "td",
502
- className: u(
536
+ className: c(
503
537
  N,
504
- a?.className,
538
+ l?.className,
505
539
  {
506
- "dgsuikit:border-b-0 dgsuikit:rounded-br-2xl": !i && h === l.length - 1
540
+ "dgsuikit:border-b-0 dgsuikit:rounded-br-2xl": !i && p === o.length - 1
507
541
  },
508
- a?.className,
509
- k ? d(m) : ""
542
+ l?.className,
543
+ f ? u(k) : ""
510
544
  ),
511
- sticky: a?.sticky,
512
- addBorderToSticky: c ? h !== 0 : !0,
513
- children: K(a?.align, {
514
- onChange: (f) => a?.onSelectRow(f, m[s]),
515
- checked: !!a?.selectedRowKeys.find((f) => f === m[s])
545
+ sticky: l?.sticky,
546
+ addBorderToSticky: a ? p !== 0 : !0,
547
+ children: K(l?.align, {
548
+ onChange: (m) => l?.onSelectRow(m, k[s]),
549
+ checked: !!l?.selectedRowKeys.find((m) => m === k[s])
516
550
  })
517
551
  }
518
552
  ),
519
- n.map((f) => /* @__PURE__ */ e(
520
- p,
553
+ n.map((m) => /* @__PURE__ */ e(
554
+ y,
521
555
  {
522
556
  type: "td",
523
- className: u(
557
+ className: c(
524
558
  N,
525
559
  {
526
- "dgsuikit:border-b-0 dgsuikit:first:rounded-br-2xl dgsuikit:last:rounded-bl-2xl": !i && h === l.length - 1
560
+ "dgsuikit:border-b-0 dgsuikit:first:rounded-br-2xl dgsuikit:last:rounded-bl-2xl": !i && p === o.length - 1
527
561
  },
528
- f.className,
529
- k ? d(m) : ""
562
+ m.className,
563
+ f ? u(k) : ""
530
564
  ),
531
- sticky: f.sticky,
532
- addBorderToSticky: c ? h !== 0 : !0,
565
+ sticky: m.sticky,
566
+ addBorderToSticky: a ? p !== 0 : !0,
533
567
  children: /* @__PURE__ */ e(
534
568
  "div",
535
569
  {
536
- className: u(
570
+ className: c(
537
571
  "dgsuikit:flex dgsuikit:items-center dgsuikit:ml-2",
538
- v(f.align)
572
+ C(m.align)
539
573
  ),
540
- children: te(f, m, h)
574
+ children: ie(m, k, p)
541
575
  }
542
576
  )
543
577
  },
544
- `${m[s]}-${L(f.key, f.dataIndex)}`
578
+ `${k[s]}-${L(m.key, m.dataIndex)}`
545
579
  ))
546
- ] }, m[s])) });
547
- }, re = (t) => /* @__PURE__ */ e(
580
+ ] }, k[s])) });
581
+ }, se = (t) => /* @__PURE__ */ e(
548
582
  "svg",
549
583
  {
550
584
  xmlns: "http://www.w3.org/2000/svg",
@@ -562,7 +596,7 @@ const ie = (t) => {
562
596
  )
563
597
  }
564
598
  );
565
- function se(t, i) {
599
+ function ne(t, i) {
566
600
  if (t.length !== i.length) return !1;
567
601
  t.sort(), i.sort();
568
602
  for (let n = 0; n < t.length; n++) if (t[n] !== i[n]) return !1;
@@ -571,7 +605,7 @@ function se(t, i) {
571
605
  const b = 16, w = "dgsuikit:p-4 dgsuikit:pl-0 dgsuikit:text-gray-500 dgsuikit:bg-gray-50 dgsuikit:border-b dgsuikit:border-solid dgsuikit:border-gray-200", T = "dgsuikit:!h-8 dgsuikit:shrink-0 dgsuikit:mr-2";
572
606
  function S(t, i) {
573
607
  return /* @__PURE__ */ e("button", { onClick: () => i.onSort(t), children: /* @__PURE__ */ e(
574
- t === "ascend" ? re : F,
608
+ t === "ascend" ? se : U,
575
609
  {
576
610
  width: b,
577
611
  height: b,
@@ -580,10 +614,10 @@ function S(t, i) {
580
614
  ) });
581
615
  }
582
616
  function A(t, i) {
583
- return /* @__PURE__ */ o("div", { className: "dgsuikit:font-p1-medium dgsuikit:flex dgsuikit:items-center dgsuikit:space-x-1", children: [
617
+ return /* @__PURE__ */ d("div", { className: "dgsuikit:font-p1-medium dgsuikit:flex dgsuikit:items-center dgsuikit:space-x-1", children: [
584
618
  /* @__PURE__ */ e("span", { children: t }),
585
619
  i && (i.anchorIcon ?? /* @__PURE__ */ e(
586
- U,
620
+ W,
587
621
  {
588
622
  width: b,
589
623
  height: b
@@ -594,31 +628,31 @@ function A(t, i) {
594
628
  function B(t, i) {
595
629
  return t.map((n) => n[i]);
596
630
  }
597
- const ne = (t) => {
598
- const { haveHeader: i } = t, { columns: n, rowKey: l, rowSelection: s, data: a, stickyTableHeader: c } = y();
599
- return /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
631
+ const ae = (t) => {
632
+ const { haveHeader: i } = t, { columns: n, rowKey: o, rowSelection: s, data: l, stickyTableHeader: a } = h();
633
+ return /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { children: [
600
634
  I(s) && /* @__PURE__ */ e(
601
- p,
635
+ y,
602
636
  {
603
637
  type: "th",
604
- className: u(
638
+ className: c(
605
639
  w,
606
640
  { "dgsuikit:rounded-tr-2xl": !i },
607
641
  s?.className
608
642
  ),
609
643
  sticky: s?.sticky,
610
- stuckToTop: c,
611
- children: /* @__PURE__ */ o("div", { className: "dgsuikit:flex dgsuikit:items-center dgsuikit:justify-between", children: [
644
+ stuckToTop: a,
645
+ children: /* @__PURE__ */ d("div", { className: "dgsuikit:flex dgsuikit:items-center dgsuikit:justify-between", children: [
612
646
  K(s?.align, {
613
647
  checked: s.selectedRowKeys.length > 0,
614
- isIndeterminate: !se(
615
- B(a, l),
648
+ isIndeterminate: !ne(
649
+ B(l, o),
616
650
  s.selectedRowKeys
617
651
  ),
618
- onChange: (r) => s?.onSelectRow(r, r.target.checked ? B(a, l) : [])
652
+ onChange: (r) => s?.onSelectRow(r, r.target.checked ? B(l, o) : [])
619
653
  }),
620
654
  /* @__PURE__ */ e(
621
- x,
655
+ v,
622
656
  {
623
657
  type: "vertical",
624
658
  className: T
@@ -628,25 +662,25 @@ const ne = (t) => {
628
662
  }
629
663
  ),
630
664
  n.map((r, g) => /* @__PURE__ */ e(
631
- p,
665
+ y,
632
666
  {
633
667
  type: "th",
634
668
  sticky: r.sticky,
635
- className: u(
669
+ className: c(
636
670
  w,
637
671
  {
638
672
  "dgsuikit:first:rounded-tr-2xl dgsuikit:last:rounded-tl-2xl": !i
639
673
  },
640
674
  r.className
641
675
  ),
642
- stuckToTop: c,
643
- children: /* @__PURE__ */ o("div", { className: "dgsuikit:flex dgsuikit:justify-between dgsuikit:items-center", children: [
644
- /* @__PURE__ */ o(
676
+ stuckToTop: a,
677
+ children: /* @__PURE__ */ d("div", { className: "dgsuikit:flex dgsuikit:justify-between dgsuikit:items-center", children: [
678
+ /* @__PURE__ */ d(
645
679
  "div",
646
680
  {
647
- className: u(
681
+ className: c(
648
682
  "dgsuikit:flex dgsuikit:items-center dgsuikit:space-x-2 dgsuikit:w-full",
649
- v(r.align)
683
+ C(r.align)
650
684
  ),
651
685
  children: [
652
686
  r.tooltip?.content ? /* @__PURE__ */ e(
@@ -657,7 +691,7 @@ const ne = (t) => {
657
691
  children: A(r.title, r.tooltip)
658
692
  }
659
693
  ) : A(r.title),
660
- typeof r.sort?.onSort == "function" && /* @__PURE__ */ o("div", { className: "dgsuikit:flex dgsuikit:flex-col", children: [
694
+ typeof r.sort?.onSort == "function" && /* @__PURE__ */ d("div", { className: "dgsuikit:flex dgsuikit:flex-col", children: [
661
695
  S("ascend", r.sort),
662
696
  S("descend", r.sort)
663
697
  ] })
@@ -665,7 +699,7 @@ const ne = (t) => {
665
699
  }
666
700
  ),
667
701
  g !== n.length - 1 && /* @__PURE__ */ e(
668
- x,
702
+ v,
669
703
  {
670
704
  type: "vertical",
671
705
  className: T
@@ -677,53 +711,53 @@ const ne = (t) => {
677
711
  ))
678
712
  ] }) });
679
713
  };
680
- function pe(t) {
714
+ function Ce(t) {
681
715
  const {
682
716
  header: i,
683
717
  wrapperClassName: n,
684
- className: l,
718
+ className: o,
685
719
  data: s,
686
- pagination: a,
687
- layout: c = "auto",
720
+ pagination: l,
721
+ layout: a = "auto",
688
722
  containerClassName: r
689
- } = t, g = (i && Object.values(i).length > 0) ?? !1, d = !!(a?.totalCount && a?.pageSize), k = c !== "fixed" ? "div" : j.Fragment;
690
- return /* @__PURE__ */ o(
723
+ } = t, g = (i && Object.values(i).length > 0) ?? !1, u = !!(l?.totalCount && l?.pageSize), f = a !== "fixed" ? "div" : j.Fragment;
724
+ return /* @__PURE__ */ d(
691
725
  "div",
692
726
  {
693
- className: u(
727
+ className: c(
694
728
  "dgsuikit:relative dgsuikit:bg-white dgsuikit:border dgsuikit:border-gray-200 dgsuikit:border-solid dgsuikit:rounded-2xl",
695
729
  n
696
730
  ),
697
731
  children: [
698
732
  g && /* @__PURE__ */ e(
699
- G,
733
+ J,
700
734
  {
701
735
  ...i,
702
- total: a?.totalCount ?? s.length
736
+ total: l?.totalCount ?? s.length
703
737
  }
704
738
  ),
705
739
  /* @__PURE__ */ e(
706
- k,
740
+ f,
707
741
  {
708
- ...c !== "fixed" ? { className: u("dgsuikit:overflow-x-auto dgsuikit:h-full", r) } : {},
709
- children: /* @__PURE__ */ e(Z, { ...t, children: /* @__PURE__ */ o(
742
+ ...a !== "fixed" ? { className: c("dgsuikit:overflow-x-auto dgsuikit:h-full", r) } : {},
743
+ children: /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ d(
710
744
  "table",
711
745
  {
712
- className: l,
713
- style: { tableLayout: c },
746
+ className: o,
747
+ style: { tableLayout: a },
714
748
  children: [
715
- /* @__PURE__ */ e(ne, { haveHeader: g }),
716
- /* @__PURE__ */ e(ie, { havePagination: d })
749
+ /* @__PURE__ */ e(ae, { haveHeader: g }),
750
+ /* @__PURE__ */ e(re, { havePagination: u })
717
751
  ]
718
752
  }
719
753
  ) })
720
754
  }
721
755
  ),
722
- d && /* @__PURE__ */ e(
723
- W,
756
+ u && /* @__PURE__ */ e(
757
+ Y,
724
758
  {
725
- className: u("dgsuikit:py-4 dgsuikit:!px-0", a?.className),
726
- ...a
759
+ className: c("dgsuikit:py-4 dgsuikit:!px-0", l?.className),
760
+ ...l
727
761
  }
728
762
  )
729
763
  ]
@@ -731,5 +765,5 @@ function pe(t) {
731
765
  );
732
766
  }
733
767
  export {
734
- pe as default
768
+ Ce as default
735
769
  };
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DeepNamePath } from '../../utils/types/deepNamePath';
3
+ import { SelectProps } from '../Form/Select/types';
3
4
  import { PaginationProps } from '../Pagination';
4
5
  import { TooltipProps } from '../Tooltip';
5
6
  type NonTypeSafeDataIndex = string | string[];
@@ -33,11 +34,18 @@ interface ColumnsTypeWithDataIndex<T> {
33
34
  dataIndex: DataIndexPath<T>;
34
35
  }
35
36
  export type ColumnsType<T extends UnknownRecord = UnknownRecord> = ColumnsTypeBase<T> & (ColumnsTypeWithKey<T> | ColumnsTypeWithDataIndex<T>);
37
+ export interface PageCountSelectorProps {
38
+ options: SelectProps<number>['options'];
39
+ defaultValue?: number;
40
+ onPageCountChange?: (value: number) => void;
41
+ selectProps?: Omit<SelectProps<number>, 'options' | 'value' | 'onChange' | 'mode' | 'customInput' | 'dropdownType' | 'drawerProps' | 'optionsTitle' | 'separateSelectedOptions'>;
42
+ }
36
43
  export interface TableHeaderProps {
37
44
  title?: string;
38
45
  showTotal?: boolean;
39
46
  extraElement?: ReactNode;
40
47
  className?: string;
48
+ pageCountSelector?: PageCountSelectorProps;
41
49
  }
42
50
  export interface RowSelectionProps<T> extends Pick<ColumnsType, 'align' | 'sticky' | 'className'> {
43
51
  onSelectRow: (e: React.ChangeEvent<HTMLInputElement>, key: string | string[], record?: T) => void;