@dgshahr/ui-kit 1.9.7 → 1.9.9
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/INTEGRATION.md +1034 -0
- package/README.md +4 -0
- package/dist/Alert/index.d.ts +1 -1
- package/dist/Alert/index.d.ts.map +1 -1
- package/dist/Badge/index.d.ts +1 -1
- package/dist/Badge/index.d.ts.map +1 -1
- package/dist/Breadcrumb/index.d.ts +1 -1
- package/dist/Breadcrumb/index.d.ts.map +1 -1
- package/dist/Button/index.d.ts.map +1 -1
- package/dist/{DateAndTimePickerFooter-CBYQy9sQ.cjs → DateAndTimePickerFooter-D-DVvBp_.cjs} +1 -1
- package/dist/{DateAndTimePickerFooter-kdnv-rXj.js → DateAndTimePickerFooter-D5-DDqkr.js} +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.d.ts.map +1 -1
- package/dist/FieldBottomInfo-DRY-D74F.cjs +1 -0
- package/dist/FieldBottomInfo-IvQmalZA.js +79 -0
- package/dist/Form/Checkbox/index.d.ts +1 -1
- package/dist/Form/Checkbox/index.d.ts.map +1 -1
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts +1 -1
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts.map +1 -1
- package/dist/Form/Datepicker/index.cjs +1 -1
- package/dist/Form/Datepicker/index.mjs +1 -1
- package/dist/Form/FileUploader/Preview/utils.d.ts +1 -1
- package/dist/Form/FileUploader/Preview/utils.d.ts.map +1 -1
- package/dist/Form/FileUploader/index.cjs +1 -1
- package/dist/Form/FileUploader/index.mjs +1 -1
- package/dist/Form/FileUploader/types.d.ts.map +1 -1
- package/dist/Form/Input/index.cjs +1 -1
- package/dist/Form/Input/index.d.ts.map +1 -1
- package/dist/Form/Input/index.mjs +2 -2
- package/dist/Form/OtpInput/index.cjs +1 -1
- package/dist/Form/OtpInput/index.mjs +3 -3
- package/dist/Form/RadioButton/index.d.ts +1 -1
- package/dist/Form/RadioButton/index.d.ts.map +1 -1
- package/dist/Form/RangeInput/Thumb.d.ts.map +1 -1
- package/dist/Form/RangeInput/index.d.ts +1 -1
- package/dist/Form/RangeInput/index.d.ts.map +1 -1
- package/dist/Form/Select/OptionItem.d.ts +1 -1
- package/dist/Form/Select/OptionItem.d.ts.map +1 -1
- package/dist/Form/Select/Options.d.ts +1 -1
- package/dist/Form/Select/Options.d.ts.map +1 -1
- package/dist/Form/Select/index.cjs +1 -1
- package/dist/Form/Select/index.d.ts +1 -1
- package/dist/Form/Select/index.d.ts.map +1 -1
- package/dist/Form/Select/index.mjs +2 -2
- package/dist/Form/Textarea/index.cjs +1 -1
- package/dist/Form/Textarea/index.d.ts.map +1 -1
- package/dist/Form/Textarea/index.mjs +1 -1
- package/dist/Form/Timepicker/index.cjs +1 -1
- package/dist/Form/Timepicker/index.mjs +2 -2
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts +1 -0
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts.map +1 -1
- package/dist/Pagination/utils.d.ts.map +1 -1
- package/dist/{PickerWrapper-CtDZY-2d.cjs → PickerWrapper-DGyaWUvQ.cjs} +1 -1
- package/dist/{PickerWrapper-UTONFuhM.js → PickerWrapper-Dh1cWCNJ.js} +1 -1
- package/dist/Progress/Step/index.cjs +1 -0
- package/dist/Progress/Step/index.d.ts +18 -0
- package/dist/Progress/Step/index.d.ts.map +1 -0
- package/dist/Progress/Step/index.mjs +161 -0
- package/dist/Sidebar/Profile.d.ts +1 -1
- package/dist/Sidebar/Profile.d.ts.map +1 -1
- package/dist/Sidebar/index.cjs +1 -1
- package/dist/Sidebar/index.mjs +1 -1
- package/dist/Sidebar/utils.d.ts +1 -1
- package/dist/Sidebar/utils.d.ts.map +1 -1
- package/dist/{Slide-CV7KzC_T.js → Slide-D-2O9kS6.js} +5 -5
- package/dist/Slider/NavigationDot.d.ts +1 -1
- package/dist/Slider/NavigationDot.d.ts.map +1 -1
- package/dist/Slider/index.mjs +1 -1
- package/dist/{Step-DB73tIkY.js → Step-BQAozGAS.js} +5 -5
- package/dist/Stepper/Horizontal/index.mjs +1 -1
- package/dist/Table/Header.d.ts.map +1 -1
- package/dist/Table/context.d.ts +1 -1
- package/dist/Table/context.d.ts.map +1 -1
- package/dist/Table/index.cjs +1 -1
- package/dist/Table/index.d.ts +2 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.mjs +183 -149
- package/dist/Table/types.d.ts +8 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/utils.d.ts +1 -1
- package/dist/Table/utils.d.ts.map +1 -1
- package/dist/{TextFieldWrapper--IAJCgw8.js → TextFieldWrapper-CXoA32wk.js} +24 -22
- package/dist/TextFieldWrapper-OdBa53gf.cjs +1 -0
- package/dist/Tooltip/Content.d.ts.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/index-B00RqlIS.cjs +1 -0
- package/dist/{index-DymkrQ_k.js → index-mNB7iXgB.js} +6 -5
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +9 -2
- package/dist/FieldBottomInfo-Bb3s_zkd.js +0 -49
- package/dist/FieldBottomInfo-CwNgNyMP.cjs +0 -1
- package/dist/IconInfoCircleOutline-0ef3qbeI.cjs +0 -1
- package/dist/IconInfoCircleOutline-aO1F3qnG.js +0 -35
- package/dist/TextFieldWrapper-B9K5vPm3.cjs +0 -1
- package/dist/index-CUnCYVh2.cjs +0 -1
package/dist/Table/index.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { c
|
|
4
|
-
import j, { useState as
|
|
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/
|
|
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
|
|
10
|
-
import { I as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
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
|
|
21
|
+
function x(t) {
|
|
21
22
|
t.classList.add(_);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function Z(t) {
|
|
24
25
|
t.classList.remove(_);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const { children: i, ...n } = t, { columns:
|
|
28
|
-
return
|
|
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 =
|
|
31
|
-
return r || (r = !!s?.sticky), r &&
|
|
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
|
|
35
|
-
for (const
|
|
36
|
-
if (
|
|
37
|
-
document?.querySelectorAll("#sticky-cell-right").forEach(
|
|
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 (
|
|
40
|
-
document?.querySelectorAll("#sticky-cell-left").forEach(
|
|
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
|
-
|
|
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
|
-
|
|
49
|
+
l && l.disconnect();
|
|
49
50
|
};
|
|
50
|
-
}, [
|
|
51
|
+
}, [o, s]), /* @__PURE__ */ e(O.Provider, { value: { observer: l, ...n }, children: i });
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
-
const { title: i, extraElement: n, showTotal:
|
|
54
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
137
|
+
className: c(
|
|
104
138
|
"dgsuikit:w-full dgsuikit:flex dgsuikit:items-center",
|
|
105
|
-
|
|
139
|
+
C(t ?? "center")
|
|
106
140
|
),
|
|
107
|
-
children: /* @__PURE__ */ e(
|
|
141
|
+
children: /* @__PURE__ */ e(F, { ...i })
|
|
108
142
|
}
|
|
109
143
|
);
|
|
110
144
|
}
|
|
111
|
-
function
|
|
145
|
+
function Q(t, i) {
|
|
112
146
|
if (t)
|
|
113
|
-
return
|
|
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
|
|
125
|
-
const { children: i, className: n, type:
|
|
126
|
-
return
|
|
127
|
-
if (!(!r.current || !
|
|
128
|
-
return s &&
|
|
129
|
-
!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,
|
|
165
|
+
}, [r, u]), /* @__PURE__ */ e(
|
|
132
166
|
g,
|
|
133
167
|
{
|
|
134
168
|
ref: r,
|
|
135
|
-
className:
|
|
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':
|
|
137
|
-
"dgsuikit:top-0 dgsuikit:z-20":
|
|
138
|
-
"dgsuikit:sticky dgsuikit:top-0 dgsuikit:z-10":
|
|
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
|
-
},
|
|
145
|
-
const { columns: t, emptyContent: i } =
|
|
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__ */
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
-
},
|
|
447
|
-
const { columns: t, loading: i } =
|
|
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
|
|
464
|
-
return t ? Array.isArray(t) ? t.reduce((n,
|
|
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
|
|
500
|
+
function ie(t, i, n) {
|
|
467
501
|
if (typeof t.render == "function") return t.render(i, n);
|
|
468
|
-
const
|
|
502
|
+
const o = te(t.dataIndex, i);
|
|
469
503
|
if (t.ellipsis) {
|
|
470
|
-
const s = /* @__PURE__ */ e("div", { className: "dgsuikit:!truncate", children:
|
|
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:
|
|
509
|
+
content: o,
|
|
476
510
|
attachToBody: !0,
|
|
477
511
|
children: s
|
|
478
512
|
}
|
|
479
513
|
);
|
|
480
514
|
}
|
|
481
|
-
return
|
|
515
|
+
return o;
|
|
482
516
|
}
|
|
483
|
-
const
|
|
517
|
+
const re = (t) => {
|
|
484
518
|
const { havePagination: i } = t, {
|
|
485
519
|
columns: n,
|
|
486
|
-
data:
|
|
520
|
+
data: o,
|
|
487
521
|
rowKey: s,
|
|
488
|
-
rowSelection:
|
|
489
|
-
stickyTableHeader:
|
|
522
|
+
rowSelection: l,
|
|
523
|
+
stickyTableHeader: a,
|
|
490
524
|
loading: r,
|
|
491
525
|
emptyContent: g,
|
|
492
|
-
getRowClassName:
|
|
493
|
-
} =
|
|
494
|
-
if (r) return /* @__PURE__ */ e(
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
return /* @__PURE__ */ e("tbody", { children:
|
|
498
|
-
I(
|
|
499
|
-
|
|
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:
|
|
536
|
+
className: c(
|
|
503
537
|
N,
|
|
504
|
-
|
|
538
|
+
l?.className,
|
|
505
539
|
{
|
|
506
|
-
"dgsuikit:border-b-0 dgsuikit:rounded-br-2xl": !i &&
|
|
540
|
+
"dgsuikit:border-b-0 dgsuikit:rounded-br-2xl": !i && p === o.length - 1
|
|
507
541
|
},
|
|
508
|
-
|
|
509
|
-
|
|
542
|
+
l?.className,
|
|
543
|
+
f ? u(k) : ""
|
|
510
544
|
),
|
|
511
|
-
sticky:
|
|
512
|
-
addBorderToSticky:
|
|
513
|
-
children: K(
|
|
514
|
-
onChange: (
|
|
515
|
-
checked: !!
|
|
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((
|
|
520
|
-
|
|
553
|
+
n.map((m) => /* @__PURE__ */ e(
|
|
554
|
+
y,
|
|
521
555
|
{
|
|
522
556
|
type: "td",
|
|
523
|
-
className:
|
|
557
|
+
className: c(
|
|
524
558
|
N,
|
|
525
559
|
{
|
|
526
|
-
"dgsuikit:border-b-0 dgsuikit:first:rounded-br-2xl dgsuikit:last:rounded-bl-2xl": !i &&
|
|
560
|
+
"dgsuikit:border-b-0 dgsuikit:first:rounded-br-2xl dgsuikit:last:rounded-bl-2xl": !i && p === o.length - 1
|
|
527
561
|
},
|
|
528
|
-
|
|
529
|
-
|
|
562
|
+
m.className,
|
|
563
|
+
f ? u(k) : ""
|
|
530
564
|
),
|
|
531
|
-
sticky:
|
|
532
|
-
addBorderToSticky:
|
|
565
|
+
sticky: m.sticky,
|
|
566
|
+
addBorderToSticky: a ? p !== 0 : !0,
|
|
533
567
|
children: /* @__PURE__ */ e(
|
|
534
568
|
"div",
|
|
535
569
|
{
|
|
536
|
-
className:
|
|
570
|
+
className: c(
|
|
537
571
|
"dgsuikit:flex dgsuikit:items-center dgsuikit:ml-2",
|
|
538
|
-
|
|
572
|
+
C(m.align)
|
|
539
573
|
),
|
|
540
|
-
children:
|
|
574
|
+
children: ie(m, k, p)
|
|
541
575
|
}
|
|
542
576
|
)
|
|
543
577
|
},
|
|
544
|
-
`${
|
|
578
|
+
`${k[s]}-${L(m.key, m.dataIndex)}`
|
|
545
579
|
))
|
|
546
|
-
] },
|
|
547
|
-
},
|
|
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
|
|
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" ?
|
|
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__ */
|
|
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
|
-
|
|
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
|
|
598
|
-
const { haveHeader: i } = t, { columns: n, rowKey:
|
|
599
|
-
return /* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
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
|
-
|
|
635
|
+
y,
|
|
602
636
|
{
|
|
603
637
|
type: "th",
|
|
604
|
-
className:
|
|
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:
|
|
611
|
-
children: /* @__PURE__ */
|
|
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: !
|
|
615
|
-
B(
|
|
648
|
+
isIndeterminate: !ne(
|
|
649
|
+
B(l, o),
|
|
616
650
|
s.selectedRowKeys
|
|
617
651
|
),
|
|
618
|
-
onChange: (r) => s?.onSelectRow(r, r.target.checked ? B(
|
|
652
|
+
onChange: (r) => s?.onSelectRow(r, r.target.checked ? B(l, o) : [])
|
|
619
653
|
}),
|
|
620
654
|
/* @__PURE__ */ e(
|
|
621
|
-
|
|
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
|
-
|
|
665
|
+
y,
|
|
632
666
|
{
|
|
633
667
|
type: "th",
|
|
634
668
|
sticky: r.sticky,
|
|
635
|
-
className:
|
|
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:
|
|
643
|
-
children: /* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
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:
|
|
681
|
+
className: c(
|
|
648
682
|
"dgsuikit:flex dgsuikit:items-center dgsuikit:space-x-2 dgsuikit:w-full",
|
|
649
|
-
|
|
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__ */
|
|
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
|
-
|
|
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
|
|
714
|
+
function Ce(t) {
|
|
681
715
|
const {
|
|
682
716
|
header: i,
|
|
683
717
|
wrapperClassName: n,
|
|
684
|
-
className:
|
|
718
|
+
className: o,
|
|
685
719
|
data: s,
|
|
686
|
-
pagination:
|
|
687
|
-
layout:
|
|
720
|
+
pagination: l,
|
|
721
|
+
layout: a = "auto",
|
|
688
722
|
containerClassName: r
|
|
689
|
-
} = t, g = (i && Object.values(i).length > 0) ?? !1,
|
|
690
|
-
return /* @__PURE__ */
|
|
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:
|
|
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
|
-
|
|
733
|
+
J,
|
|
700
734
|
{
|
|
701
735
|
...i,
|
|
702
|
-
total:
|
|
736
|
+
total: l?.totalCount ?? s.length
|
|
703
737
|
}
|
|
704
738
|
),
|
|
705
739
|
/* @__PURE__ */ e(
|
|
706
|
-
|
|
740
|
+
f,
|
|
707
741
|
{
|
|
708
|
-
...
|
|
709
|
-
children: /* @__PURE__ */ e(
|
|
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:
|
|
713
|
-
style: { tableLayout:
|
|
746
|
+
className: o,
|
|
747
|
+
style: { tableLayout: a },
|
|
714
748
|
children: [
|
|
715
|
-
/* @__PURE__ */ e(
|
|
716
|
-
/* @__PURE__ */ e(
|
|
749
|
+
/* @__PURE__ */ e(ae, { haveHeader: g }),
|
|
750
|
+
/* @__PURE__ */ e(re, { havePagination: u })
|
|
717
751
|
]
|
|
718
752
|
}
|
|
719
753
|
) })
|
|
720
754
|
}
|
|
721
755
|
),
|
|
722
|
-
|
|
723
|
-
|
|
756
|
+
u && /* @__PURE__ */ e(
|
|
757
|
+
Y,
|
|
724
758
|
{
|
|
725
|
-
className:
|
|
726
|
-
...
|
|
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
|
-
|
|
768
|
+
Ce as default
|
|
735
769
|
};
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -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;
|