triafly-ui-kit 1.0.49 → 1.0.51
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.
@@ -11,7 +11,7 @@ const L = {
|
|
11
11
|
desc: /* @__PURE__ */ n(ae, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
|
12
12
|
default: /* @__PURE__ */ n(z, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
|
13
13
|
}, le = ({
|
14
|
-
columns:
|
14
|
+
columns: p,
|
15
15
|
dataSource: l,
|
16
16
|
rowKey: f,
|
17
17
|
tableClassName: $,
|
@@ -23,7 +23,7 @@ const L = {
|
|
23
23
|
borderBottom: y = !1,
|
24
24
|
stickyHeader: H = !1,
|
25
25
|
stickyLeft: b = !1,
|
26
|
-
bordered:
|
26
|
+
bordered: m = !1,
|
27
27
|
rowClassName: x,
|
28
28
|
defaultSort: J,
|
29
29
|
onClickTr: d,
|
@@ -39,7 +39,7 @@ const L = {
|
|
39
39
|
}, W) => {
|
40
40
|
const T = K.useRef(null), o = !!c && !!u, [A, X] = j(l || []), [s, E] = j(
|
41
41
|
J || null
|
42
|
-
),
|
42
|
+
), w = te(() => {
|
43
43
|
if (!o)
|
44
44
|
return D ? l : A;
|
45
45
|
}, [o, l, A, D]), I = k(
|
@@ -54,7 +54,7 @@ const L = {
|
|
54
54
|
})), E({ key: e, order: t });
|
55
55
|
},
|
56
56
|
[o]
|
57
|
-
),
|
57
|
+
), N = k(
|
58
58
|
(e) => typeof f == "function" ? f(e) : String(e[f]),
|
59
59
|
[f]
|
60
60
|
), Y = k(
|
@@ -68,26 +68,26 @@ const L = {
|
|
68
68
|
const e = T.current;
|
69
69
|
if (!e) return;
|
70
70
|
const t = (_) => {
|
71
|
-
const
|
72
|
-
if (!h ||
|
71
|
+
const v = _.target, h = v.closest("tr");
|
72
|
+
if (!h || v.closest("[data-no-bubble]")) return;
|
73
73
|
const r = h.dataset.id;
|
74
74
|
if (!(!r || !d))
|
75
75
|
if (o && c) {
|
76
76
|
const a = c[r];
|
77
77
|
a && d(a);
|
78
78
|
} else {
|
79
|
-
const a = l == null ? void 0 : l.find((Z) =>
|
79
|
+
const a = l == null ? void 0 : l.find((Z) => N(Z) === r);
|
80
80
|
a && d(a);
|
81
81
|
}
|
82
82
|
};
|
83
83
|
return e.addEventListener("click", t), () => e.removeEventListener("click", t);
|
84
|
-
}, [l, d,
|
84
|
+
}, [l, d, N, o, c]), /* @__PURE__ */ n("div", { className: i("table-component", G), children: /* @__PURE__ */ n(
|
85
85
|
"div",
|
86
86
|
{
|
87
87
|
className: i(
|
88
88
|
"table-component__wrapper",
|
89
89
|
{
|
90
|
-
bordered:
|
90
|
+
bordered: m,
|
91
91
|
borderBottom: y
|
92
92
|
},
|
93
93
|
$
|
@@ -97,7 +97,7 @@ const L = {
|
|
97
97
|
"table",
|
98
98
|
{
|
99
99
|
className: i("table-component__wrapper__table", {
|
100
|
-
bordered:
|
100
|
+
bordered: m,
|
101
101
|
borderBottom: y
|
102
102
|
}),
|
103
103
|
ref: W,
|
@@ -120,13 +120,13 @@ const L = {
|
|
120
120
|
U
|
121
121
|
),
|
122
122
|
onClick: P,
|
123
|
-
children:
|
123
|
+
children: p.map((e, t) => /* @__PURE__ */ n(
|
124
124
|
"th",
|
125
125
|
{
|
126
126
|
className: i(
|
127
127
|
"table-component__wrapper__table__thead__th",
|
128
128
|
{
|
129
|
-
bordered:
|
129
|
+
bordered: m,
|
130
130
|
stickyLeft: b && t === 0
|
131
131
|
},
|
132
132
|
q
|
@@ -159,39 +159,40 @@ const L = {
|
|
159
159
|
C,
|
160
160
|
{
|
161
161
|
record: t,
|
162
|
-
columns:
|
162
|
+
columns: p,
|
163
163
|
rowKey: f,
|
164
164
|
rowClassName: x,
|
165
165
|
index: u.indexOf(e),
|
166
166
|
stickyLeft: b,
|
167
|
-
bordered:
|
167
|
+
bordered: m,
|
168
168
|
id: e
|
169
169
|
},
|
170
170
|
e
|
171
171
|
) : null;
|
172
|
-
}) :
|
172
|
+
}) : w == null ? void 0 : w.map((e, t) => /* @__PURE__ */ n(
|
173
173
|
C,
|
174
174
|
{
|
175
175
|
record: e,
|
176
|
-
columns:
|
176
|
+
columns: p,
|
177
177
|
rowKey: f,
|
178
178
|
rowClassName: x,
|
179
179
|
index: t,
|
180
180
|
stickyLeft: b,
|
181
|
-
bordered:
|
181
|
+
bordered: m
|
182
182
|
},
|
183
|
-
|
183
|
+
N(e)
|
184
184
|
)),
|
185
185
|
R ? /* @__PURE__ */ n("div", { className: "loading_table_init", children: /* @__PURE__ */ n(re, { className: "centered" }) }) : null,
|
186
|
-
!R && Q && B && /* @__PURE__ */ n("tr", { ref: B, children: /* @__PURE__ */ n("td", { colSpan:
|
186
|
+
!R && Q && B && /* @__PURE__ */ n("tr", { ref: B, children: /* @__PURE__ */ n("td", { colSpan: p.length, children: S || /* @__PURE__ */ n(se, { colSpan: p.length }) }) })
|
187
187
|
]
|
188
188
|
}
|
189
189
|
)
|
190
190
|
]
|
191
191
|
}
|
192
192
|
)
|
193
|
-
}
|
194
|
-
|
193
|
+
},
|
194
|
+
"wrapper"
|
195
|
+
) }, "table-component");
|
195
196
|
}, ue = ee(le);
|
196
197
|
export {
|
197
198
|
ue as Table
|