@semcore/data-table 16.0.0-prerelease.2 → 16.0.0-prerelease.21
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/CHANGELOG.md +25 -1
- package/lib/cjs/components/Body/Body.js +439 -0
- package/lib/cjs/components/Body/Body.js.map +1 -0
- package/lib/cjs/components/Body/Body.types.js +2 -0
- package/lib/cjs/components/Body/Body.types.js.map +1 -0
- package/lib/cjs/components/Body/Cell.js +195 -0
- package/lib/cjs/components/Body/Cell.js.map +1 -0
- package/lib/cjs/components/Body/Cell.types.js +2 -0
- package/lib/cjs/components/Body/Cell.types.js.map +1 -0
- package/lib/cjs/components/Body/MergedCells.js +29 -0
- package/lib/cjs/components/Body/MergedCells.js.map +1 -0
- package/lib/cjs/components/Body/Row.js +252 -0
- package/lib/cjs/components/Body/Row.js.map +1 -0
- package/lib/cjs/components/Body/Row.types.js +4 -0
- package/lib/cjs/components/Body/Row.types.js.map +1 -0
- package/lib/cjs/components/Body/style.shadow.css +263 -0
- package/lib/cjs/components/DataTable/DataTable.js +1025 -0
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -0
- package/lib/cjs/{types.js → components/DataTable/DataTable.types.js} +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -0
- package/lib/cjs/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/cjs/components/Head/Column.js +311 -0
- package/lib/cjs/components/Head/Column.js.map +1 -0
- package/lib/cjs/components/Head/Column.types.js +2 -0
- package/lib/cjs/components/Head/Column.types.js.map +1 -0
- package/lib/cjs/components/Head/Group.js +116 -0
- package/lib/cjs/components/Head/Group.js.map +1 -0
- package/lib/cjs/components/Head/Group.type.js +2 -0
- package/lib/cjs/components/Head/Group.type.js.map +1 -0
- package/lib/cjs/components/Head/Head.js +207 -0
- package/lib/cjs/components/Head/Head.js.map +1 -0
- package/lib/cjs/components/Head/Head.types.js +2 -0
- package/lib/cjs/components/Head/Head.types.js.map +1 -0
- package/lib/cjs/components/Head/style.shadow.css +180 -0
- package/lib/cjs/index.js +25 -15
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/scroll-shadows.shadow.css +45 -5
- package/lib/cjs/translations/en.json +6 -1
- package/lib/es6/components/Body/Body.js +432 -0
- package/lib/es6/components/Body/Body.js.map +1 -0
- package/lib/es6/components/Body/Body.types.js +2 -0
- package/lib/es6/components/Body/Body.types.js.map +1 -0
- package/lib/es6/components/Body/Cell.js +188 -0
- package/lib/es6/components/Body/Cell.js.map +1 -0
- package/lib/es6/components/Body/Cell.types.js +2 -0
- package/lib/es6/components/Body/Cell.types.js.map +1 -0
- package/lib/es6/components/Body/MergedCells.js +20 -0
- package/lib/es6/components/Body/MergedCells.js.map +1 -0
- package/lib/es6/components/Body/Row.js +245 -0
- package/lib/es6/components/Body/Row.js.map +1 -0
- package/lib/es6/components/Body/Row.types.js +2 -0
- package/lib/es6/components/Body/Row.types.js.map +1 -0
- package/lib/es6/components/Body/style.shadow.css +263 -0
- package/lib/es6/components/DataTable/DataTable.js +1013 -0
- package/lib/es6/components/DataTable/DataTable.js.map +1 -0
- package/lib/es6/components/DataTable/DataTable.types.js +2 -0
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -0
- package/lib/es6/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/es6/components/Head/Column.js +304 -0
- package/lib/es6/components/Head/Column.js.map +1 -0
- package/lib/es6/components/Head/Column.types.js +2 -0
- package/lib/es6/components/Head/Column.types.js.map +1 -0
- package/lib/es6/components/Head/Group.js +109 -0
- package/lib/es6/components/Head/Group.js.map +1 -0
- package/lib/es6/components/Head/Group.type.js +2 -0
- package/lib/es6/components/Head/Group.type.js.map +1 -0
- package/lib/es6/components/Head/Head.js +201 -0
- package/lib/es6/components/Head/Head.js.map +1 -0
- package/lib/es6/components/Head/Head.types.js +2 -0
- package/lib/es6/components/Head/Head.types.js.map +1 -0
- package/lib/es6/components/Head/style.shadow.css +180 -0
- package/lib/es6/index.js +5 -2
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/scroll-shadows.shadow.css +45 -5
- package/lib/es6/translations/en.json +6 -1
- package/lib/esm/components/Body/Body.mjs +394 -0
- package/lib/esm/components/Body/Cell.mjs +186 -0
- package/lib/esm/components/Body/MergedCells.mjs +23 -0
- package/lib/esm/components/Body/Row.mjs +224 -0
- package/lib/esm/components/Body/style.shadow.css +263 -0
- package/lib/esm/components/DataTable/DataTable.mjs +944 -0
- package/lib/esm/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/esm/components/Head/Column.mjs +296 -0
- package/lib/esm/components/Head/Group.mjs +103 -0
- package/lib/esm/components/Head/Head.mjs +181 -0
- package/lib/esm/components/Head/style.shadow.css +180 -0
- package/lib/esm/index.mjs +9 -6
- package/lib/esm/style/scroll-shadows.shadow.css +47 -0
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +5 -4
- package/lib/esm/translations/en.json.mjs +10 -4
- package/lib/esm/translations/es.json.mjs +5 -4
- package/lib/esm/translations/fr.json.mjs +5 -4
- package/lib/esm/translations/it.json.mjs +5 -4
- package/lib/esm/translations/ja.json.mjs +5 -4
- package/lib/esm/translations/ko.json.mjs +5 -4
- package/lib/esm/translations/nl.json.mjs +5 -4
- package/lib/esm/translations/pl.json.mjs +5 -4
- package/lib/esm/translations/pt.json.mjs +5 -4
- package/lib/esm/translations/sv.json.mjs +5 -4
- package/lib/esm/translations/tr.json.mjs +5 -4
- package/lib/esm/translations/vi.json.mjs +5 -4
- package/lib/esm/translations/zh.json.mjs +5 -4
- package/lib/types/components/Body/Body.d.ts +8 -0
- package/lib/types/components/Body/Body.types.d.ts +57 -0
- package/lib/types/components/Body/Cell.d.ts +3 -0
- package/lib/types/components/Body/Cell.types.d.ts +20 -0
- package/lib/types/components/Body/MergedCells.d.ts +14 -0
- package/lib/types/components/Body/Row.d.ts +3 -0
- package/lib/types/components/Body/Row.types.d.ts +43 -0
- package/lib/types/components/DataTable/DataTable.d.ts +13 -0
- package/lib/types/components/DataTable/DataTable.types.d.ts +125 -0
- package/lib/types/components/Head/Column.d.ts +30 -0
- package/lib/types/components/Head/Column.types.d.ts +71 -0
- package/lib/types/components/Head/Group.d.ts +15 -0
- package/lib/types/components/Head/Group.type.d.ts +16 -0
- package/lib/types/components/Head/Head.d.ts +98 -0
- package/lib/types/components/Head/Head.types.d.ts +40 -0
- package/lib/types/index.d.ts +10 -2
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +5 -0
- package/package.json +11 -6
- package/vite.config.ts +0 -3
- package/lib/cjs/Body.js +0 -475
- package/lib/cjs/Body.js.map +0 -1
- package/lib/cjs/DataTable.js +0 -622
- package/lib/cjs/DataTable.js.map +0 -1
- package/lib/cjs/Head.js +0 -399
- package/lib/cjs/Head.js.map +0 -1
- package/lib/cjs/style/data-table.shadow.css +0 -394
- package/lib/cjs/types.js.map +0 -1
- package/lib/cjs/utils.js +0 -57
- package/lib/cjs/utils.js.map +0 -1
- package/lib/es6/Body.js +0 -468
- package/lib/es6/Body.js.map +0 -1
- package/lib/es6/DataTable.js +0 -614
- package/lib/es6/DataTable.js.map +0 -1
- package/lib/es6/Head.js +0 -391
- package/lib/es6/Head.js.map +0 -1
- package/lib/es6/style/data-table.shadow.css +0 -394
- package/lib/es6/types.js +0 -2
- package/lib/es6/types.js.map +0 -1
- package/lib/es6/utils.js +0 -48
- package/lib/es6/utils.js.map +0 -1
- package/lib/esm/Body.mjs +0 -320
- package/lib/esm/DataTable.mjs +0 -439
- package/lib/esm/Head.mjs +0 -258
- package/lib/esm/utils.mjs +0 -37
- package/lib/types/Body.d.ts +0 -61
- package/lib/types/DataTable.d.ts +0 -205
- package/lib/types/Head.d.ts +0 -45
- package/lib/types/types.d.ts +0 -73
- package/lib/types/utils.d.ts +0 -4
package/lib/esm/Body.mjs
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import oe from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import j from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import ue from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
|
-
import ie from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
5
|
-
import ae from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
-
import q from "@babel/runtime/helpers/esm/typeof";
|
|
7
|
-
import he from "@babel/runtime/helpers/esm/classCallCheck";
|
|
8
|
-
import ge from "@babel/runtime/helpers/esm/createClass";
|
|
9
|
-
import p from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
10
|
-
import me from "@babel/runtime/helpers/esm/inherits";
|
|
11
|
-
import pe from "@babel/runtime/helpers/esm/createSuper";
|
|
12
|
-
import R from "@babel/runtime/helpers/esm/defineProperty";
|
|
13
|
-
import { sstyled as V, assignProps as Re, Component as we } from "@semcore/core";
|
|
14
|
-
import s from "react";
|
|
15
|
-
import { Flex as Se, Box as M } from "@semcore/flex-box";
|
|
16
|
-
import K, { hideScrollBarsFromScreenReadersContext as ye } from "@semcore/scroll-area";
|
|
17
|
-
import { getFixedStyle as _e, getScrollOffsetValue as He } from "./utils.mjs";
|
|
18
|
-
import W, { callAllEventHandlers as ne } from "@semcore/core/lib/utils/assignProps";
|
|
19
|
-
import N from "@semcore/core/lib/utils/rafTrottle";
|
|
20
|
-
import { forkRef as Oe } from "@semcore/core/lib/utils/ref";
|
|
21
|
-
import be from "@semcore/core/lib/utils/canUseDOM";
|
|
22
|
-
import { SORT_ICON_WIDTH as Pe } from "./Head.mjs";
|
|
23
|
-
import { getFocusableIn as le } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
|
|
24
|
-
var ze = ["childrenPropsGetter"], Ee = ["childrenPropsGetter"], xe = (
|
|
25
|
-
/*__reshadow_css_start__*/
|
|
26
|
-
(V.insert(
|
|
27
|
-
/*__inner_css_start__*/
|
|
28
|
-
".___SShadowHorizontal_11aq4_gg_:after,.___SShadowHorizontal_11aq4_gg_:before,.___SShadowVertical_11aq4_gg_:after,.___SShadowVertical_11aq4_gg_:before{z-index:1}",
|
|
29
|
-
"11aq4_gg_"
|
|
30
|
-
), {
|
|
31
|
-
__SShadowHorizontal: "___SShadowHorizontal_11aq4_gg_",
|
|
32
|
-
__SShadowVertical: "___SShadowVertical_11aq4_gg_"
|
|
33
|
-
})
|
|
34
|
-
), Ae = process.env.NODE_ENV === "test", ke = function(F) {
|
|
35
|
-
var x = F.flat(20);
|
|
36
|
-
return Object.fromEntries(x.map(function(r) {
|
|
37
|
-
return [r.name, r.data];
|
|
38
|
-
}));
|
|
39
|
-
}, J = {
|
|
40
|
-
display: "contents"
|
|
41
|
-
}, rr = /* @__PURE__ */ function(Q) {
|
|
42
|
-
me(x, Q);
|
|
43
|
-
var F = pe(x);
|
|
44
|
-
function x() {
|
|
45
|
-
var r;
|
|
46
|
-
he(this, x);
|
|
47
|
-
for (var l = arguments.length, i = new Array(l), c = 0; c < l; c++)
|
|
48
|
-
i[c] = arguments[c];
|
|
49
|
-
return r = F.call.apply(F, [this].concat(i)), R(p(r), "state", {
|
|
50
|
-
rowHeight: void 0,
|
|
51
|
-
scrollAreaHeight: void 0,
|
|
52
|
-
scrollOffset: 0
|
|
53
|
-
}), R(p(r), "scrollContainerRef", /* @__PURE__ */ s.createRef()), R(p(r), "firstRowRef", /* @__PURE__ */ s.createRef()), R(p(r), "firstRowResizeObserver", null), R(p(r), "lockedCell", [null, !1]), R(p(r), "getRowHeight", function() {
|
|
54
|
-
var e = r.asProps.virtualScroll, o = q(e) === "object" && (e == null ? void 0 : e.rowHeight);
|
|
55
|
-
return o || r.state.rowHeight;
|
|
56
|
-
}), R(p(r), "handleKeyDown", function(e) {
|
|
57
|
-
if (e.currentTarget === r.lockedCell[0]) {
|
|
58
|
-
var o = Array.from(r.lockedCell[0].children).flatMap(function(g) {
|
|
59
|
-
return le(g);
|
|
60
|
-
});
|
|
61
|
-
if (r.lockedCell[1]) {
|
|
62
|
-
if (e.key === "Escape") {
|
|
63
|
-
var t;
|
|
64
|
-
(t = r.lockedCell[0]) === null || t === void 0 || t.focus(), r.lockedCell[1] = !1;
|
|
65
|
-
}
|
|
66
|
-
if (e.key.startsWith("Arrow") && (e.stopPropagation(), e.preventDefault()), e.key === "Tab") {
|
|
67
|
-
if (e.target === o[0] && e.shiftKey) {
|
|
68
|
-
var n;
|
|
69
|
-
(n = o[o.length - 1]) === null || n === void 0 || n.focus(), e.preventDefault();
|
|
70
|
-
} else if (e.target === o[o.length - 1] && !e.shiftKey) {
|
|
71
|
-
var a;
|
|
72
|
-
(a = o[0]) === null || a === void 0 || a.focus(), e.preventDefault();
|
|
73
|
-
}
|
|
74
|
-
e.stopPropagation();
|
|
75
|
-
}
|
|
76
|
-
} else if (e.key === "Enter") {
|
|
77
|
-
var f;
|
|
78
|
-
e.preventDefault(), e.stopPropagation(), r.lockedCell[1] = !0, (f = o[0]) === null || f === void 0 || f.focus();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}), R(p(r), "onFocusCell", function(e) {
|
|
82
|
-
if (e.target === e.currentTarget && e.target.matches(":focus-visible")) {
|
|
83
|
-
var o = Array.from(e.currentTarget.children).flatMap(function(t) {
|
|
84
|
-
return le(t);
|
|
85
|
-
});
|
|
86
|
-
o.length === 1 ? o[0].focus() : o.length > 1 && (r.lockedCell = [e.currentTarget, !1]);
|
|
87
|
-
}
|
|
88
|
-
}), R(p(r), "handleFirstRowResize", N(function(e) {
|
|
89
|
-
var o = e[0].contentRect, t = o.height;
|
|
90
|
-
r.setState(function(n) {
|
|
91
|
-
return n.rowHeight === t ? n : {
|
|
92
|
-
rowHeight: t
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
})), R(p(r), "handleScrollAreaResize", N(function(e) {
|
|
96
|
-
var o = r.asProps.virtualScroll;
|
|
97
|
-
if (o) {
|
|
98
|
-
var t = e[0].contentRect, n = t.height;
|
|
99
|
-
r.setState(function(a) {
|
|
100
|
-
return a.scrollAreaHeight === n ? a : {
|
|
101
|
-
scrollAreaHeight: n
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
})), R(p(r), "handleScrollAreaScroll", function(e) {
|
|
106
|
-
var o = e.target, t = o.scrollTop, n = r.asProps.virtualScroll;
|
|
107
|
-
n && r.setState(function(a) {
|
|
108
|
-
return a.scrollOffset === t ? a : {
|
|
109
|
-
scrollOffset: t
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
}), R(p(r), "setupRowSizeObserver", function() {
|
|
113
|
-
r.firstRowRef.current && r.asProps.virtualScroll && be() && (r.firstRowResizeObserver = new ResizeObserver(r.handleFirstRowResize), r.firstRowResizeObserver.observe(r.firstRowRef.current));
|
|
114
|
-
}), R(p(r), "handleBodyTransitionEnd", N(function() {
|
|
115
|
-
r.forceUpdate();
|
|
116
|
-
})), r;
|
|
117
|
-
}
|
|
118
|
-
return ge(x, [{
|
|
119
|
-
key: "renderCells",
|
|
120
|
-
value: function(l, i, c) {
|
|
121
|
-
var e = this, o = Se, t = this.asProps, n = t.styles, a = t.columns, f = t.use, g = t.uid;
|
|
122
|
-
return l.map(function(d, S) {
|
|
123
|
-
if (Array.isArray(d)) {
|
|
124
|
-
var y, A = "div";
|
|
125
|
-
return y = V(n), /* @__PURE__ */ s.createElement(A, y.cn("SGroupCell", {
|
|
126
|
-
key: "".concat(S),
|
|
127
|
-
"data-ui-name": "group-cell"
|
|
128
|
-
}), e.renderRows(d, !0));
|
|
129
|
-
} else {
|
|
130
|
-
var _, H, m, u, w, O, P, z, E = d.name.split("/"), k = E[0], I = E[E.length - 1], b = a.find(function(h) {
|
|
131
|
-
return h.name === k;
|
|
132
|
-
}), T = a.find(function(h) {
|
|
133
|
-
return h.name === I;
|
|
134
|
-
}), v = a.find(function(h) {
|
|
135
|
-
return h.name === d.name;
|
|
136
|
-
}), G = _e(d, a), B = ae(G, 2), X = B[0], Y = B[1], se = (H = v == null ? void 0 : v.parentColumns.map(function(h) {
|
|
137
|
-
return h.name;
|
|
138
|
-
})) !== null && H !== void 0 ? H : [], L = (Array.isArray(d.cssVar) ? d.cssVar : [d.cssVar]).map(function(h) {
|
|
139
|
-
return "var(".concat(h, ")");
|
|
140
|
-
}), de = v == null || (m = v.props) === null || m === void 0 || (u = m.ref.current) === null || u === void 0 ? void 0 : u.style.getPropertyValue("min-width"), U = v == null || (w = v.props) === null || w === void 0 || (O = w.ref.current) === null || O === void 0 ? void 0 : O.style.getPropertyValue("max-width"), C = {
|
|
141
|
-
name: d.name,
|
|
142
|
-
children: /* @__PURE__ */ s.createElement(s.Fragment, null, d.data),
|
|
143
|
-
justifyContent: v == null || (P = v.props) === null || P === void 0 ? void 0 : P.justifyContent,
|
|
144
|
-
alignItems: v == null || (z = v.props) === null || z === void 0 ? void 0 : z.alignItems,
|
|
145
|
-
borderLeft: b == null ? void 0 : b.borderLeft,
|
|
146
|
-
borderRight: T == null ? void 0 : T.borderRight,
|
|
147
|
-
style: {
|
|
148
|
-
width: L.length === 1 ? L[0] : "calc(".concat(L.join(" + "), ")"),
|
|
149
|
-
minWidth: de,
|
|
150
|
-
maxWidth: U && v !== null && v !== void 0 && v.sortable ? "calc(".concat(Pe, "px + ").concat(U, ")") : U
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
X !== void 0 && Y !== void 0 && (C.style[X] = Y);
|
|
154
|
-
var D = ie(d.cellPropsLayers || []), Z;
|
|
155
|
-
try {
|
|
156
|
-
for (D.s(); !(Z = D.n()).done; ) {
|
|
157
|
-
var $ = Z.value, ee = $.childrenPropsGetter, ve = ee === void 0 ? function(h) {
|
|
158
|
-
return h;
|
|
159
|
-
} : ee, fe = oe($, ze), re = W(fe, C);
|
|
160
|
-
C = W(ve(re, i, c), re);
|
|
161
|
-
}
|
|
162
|
-
} catch (h) {
|
|
163
|
-
D.e(h);
|
|
164
|
-
} finally {
|
|
165
|
-
D.f();
|
|
166
|
-
}
|
|
167
|
-
var ce = [d.name].concat(ue(se)).filter(Boolean).map(function(h) {
|
|
168
|
-
return "igc-table-".concat(g, "-").concat(h);
|
|
169
|
-
}), te = E.length;
|
|
170
|
-
return _ = V(n), /* @__PURE__ */ s.createElement(o, _.cn("SCell", j(j({
|
|
171
|
-
key: d.name,
|
|
172
|
-
role: "gridcell",
|
|
173
|
-
headers: ce.join(" "),
|
|
174
|
-
__excludeProps: ["data"]
|
|
175
|
-
}, C), {}, {
|
|
176
|
-
fixed: d.fixed,
|
|
177
|
-
theme: C.theme,
|
|
178
|
-
use: f,
|
|
179
|
-
borderLeft: C.borderLeft,
|
|
180
|
-
borderRight: C.borderRight,
|
|
181
|
-
tabIndex: -1,
|
|
182
|
-
onKeyDown: e.handleKeyDown,
|
|
183
|
-
onFocus: e.onFocusCell,
|
|
184
|
-
"aria-colindex": S + 1,
|
|
185
|
-
"aria-colspan": te === 1 ? void 0 : te,
|
|
186
|
-
innerOutline: !0
|
|
187
|
-
})));
|
|
188
|
-
}
|
|
189
|
-
}, []);
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
key: "renderRow",
|
|
193
|
-
value: function(l, i) {
|
|
194
|
-
var c, e = i.dataIndex, o = i.topOffset, t = i.nested, n = t === void 0 ? !1 : t, a = M, f = this.asProps, g = f.styles, d = f.rowPropsLayers, S = f.uniqueKey, y = f.virtualScroll, A = q(y) === "object" && (y == null ? void 0 : y.rowHeight), _ = l.flatRowData || ke(l), H = _[S] ? String(_[S]) : "row_".concat(e), m = e === 0 && !A, u = {
|
|
195
|
-
children: this.renderCells(l, _, e),
|
|
196
|
-
theme: void 0,
|
|
197
|
-
active: void 0,
|
|
198
|
-
positioned: o !== void 0,
|
|
199
|
-
top: o,
|
|
200
|
-
ref: m ? this.firstRowRef : void 0,
|
|
201
|
-
key: H,
|
|
202
|
-
"aria-rowindex": n ? void 0 : e + 2
|
|
203
|
-
}, w = ie(d), O;
|
|
204
|
-
try {
|
|
205
|
-
for (w.s(); !(O = w.n()).done; ) {
|
|
206
|
-
var P = O.value, z = P.childrenPropsGetter, E = z === void 0 ? function(b) {
|
|
207
|
-
return b;
|
|
208
|
-
} : z, k = oe(P, Ee), I = W(k, u);
|
|
209
|
-
u = W(E(I, _, e), I);
|
|
210
|
-
}
|
|
211
|
-
} catch (b) {
|
|
212
|
-
w.e(b);
|
|
213
|
-
} finally {
|
|
214
|
-
w.f();
|
|
215
|
-
}
|
|
216
|
-
return c = V(g), /* @__PURE__ */ s.createElement(a, c.cn("SRow", j({
|
|
217
|
-
"data-nested": n.toString(),
|
|
218
|
-
role: n ? void 0 : "row",
|
|
219
|
-
__excludeProps: ["data"]
|
|
220
|
-
}, u)));
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
key: "renderRows",
|
|
224
|
-
value: function(l) {
|
|
225
|
-
var i = this, c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
226
|
-
return l.map(function(e, o) {
|
|
227
|
-
return i.renderRow(e, {
|
|
228
|
-
dataIndex: o,
|
|
229
|
-
nested: c
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
}, {
|
|
234
|
-
key: "renderVirtualizedRows",
|
|
235
|
-
value: function(l) {
|
|
236
|
-
var i, c = this;
|
|
237
|
-
if (l.length === 0) return [];
|
|
238
|
-
var e = this.asProps.virtualScroll, o = this.state, t = o.scrollOffset, n = o.scrollAreaHeight, a = this.getRowHeight(), f = (i = q(e) === "object" ? e == null ? void 0 : e.tollerance : 2) !== null && i !== void 0 ? i : 2, g = Math.max(Math.floor(t / a) - f, 0), d = Math.min(Math.ceil((t + n) / a) + f, l.length), S = q(e) === "object" && (e == null ? void 0 : e.rowHeight), y = !S, A = {
|
|
239
|
-
cells: l[0],
|
|
240
|
-
dataIndex: 0,
|
|
241
|
-
topOffset: 0
|
|
242
|
-
}, _ = a !== void 0 ? l.slice(g, d) : [], H = _.map(function(m, u) {
|
|
243
|
-
return {
|
|
244
|
-
cells: m,
|
|
245
|
-
dataIndex: g + u,
|
|
246
|
-
topOffset: a * (g + u)
|
|
247
|
-
};
|
|
248
|
-
});
|
|
249
|
-
return y && g !== 0 && H.unshift(A), H.map(function(m) {
|
|
250
|
-
var u = m.cells, w = m.dataIndex, O = m.topOffset;
|
|
251
|
-
return c.renderRow(u, {
|
|
252
|
-
dataIndex: w,
|
|
253
|
-
topOffset: O,
|
|
254
|
-
nested: !1
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}, {
|
|
259
|
-
key: "componentWillUnmount",
|
|
260
|
-
value: function() {
|
|
261
|
-
var l;
|
|
262
|
-
(l = this.firstRowResizeObserver) === null || l === void 0 || l.disconnect();
|
|
263
|
-
}
|
|
264
|
-
}, {
|
|
265
|
-
key: "render",
|
|
266
|
-
value: function() {
|
|
267
|
-
var l = this.asProps, i, c = M, e = M, o = M, t = this.asProps, n = t.Children, a = t.styles, f = t.rows, g = t.columns, d = t.$scrollRef, S = t.virtualScroll, y = t.onResize, A = t.onScroll, _ = t.disabledScroll, H = t.renderRows, m = t.animationsDisabled, u = t.scrollContainerRef, w = g.reduce(function(v, G) {
|
|
268
|
-
var B = G.width;
|
|
269
|
-
return v + B;
|
|
270
|
-
}, 0) > 0 || Ae, O = He(g), P = ae(O, 2), z = P[0], E = P[1], k = this.getRowHeight(), I = k !== void 0 && S ? k * f.length : void 0;
|
|
271
|
-
S && w && !k && requestAnimationFrame(this.setupRowSizeObserver);
|
|
272
|
-
var b = (i = V(a), /* @__PURE__ */ s.createElement(c, i.cn("SBody", j({}, Re({
|
|
273
|
-
animationsDisabled: m,
|
|
274
|
-
onTransitionEnd: this.handleBodyTransitionEnd
|
|
275
|
-
}, l))), H ? H({
|
|
276
|
-
rows: f,
|
|
277
|
-
columns: g,
|
|
278
|
-
renderRow: this.renderRow.bind(this)
|
|
279
|
-
}) || null : /* @__PURE__ */ s.createElement(s.Fragment, null, I ? /* @__PURE__ */ s.createElement(o, i.cn("SHeightHold", {
|
|
280
|
-
hMin: I,
|
|
281
|
-
"aria-hidden": !0
|
|
282
|
-
})) : null, S ? this.renderVirtualizedRows(f) : this.renderRows(f))));
|
|
283
|
-
if (_)
|
|
284
|
-
return /* @__PURE__ */ s.createElement(e, null, b);
|
|
285
|
-
var T = [d, this.scrollContainerRef];
|
|
286
|
-
return u && T.push(u), /* @__PURE__ */ s.createElement(ye.Provider, {
|
|
287
|
-
value: !0
|
|
288
|
-
}, /* @__PURE__ */ s.createElement(e, i.cn("SBodyWrapper", {}), /* @__PURE__ */ s.createElement(K, i.cn("ScrollArea", {
|
|
289
|
-
shadow: !0,
|
|
290
|
-
leftOffset: z,
|
|
291
|
-
rightOffset: E,
|
|
292
|
-
onResize: ne(y, this.handleScrollAreaResize),
|
|
293
|
-
onScroll: ne(A, this.handleScrollAreaScroll),
|
|
294
|
-
styles: xe
|
|
295
|
-
}), /* @__PURE__ */ s.createElement(K.Container, {
|
|
296
|
-
ref: Oe.apply(void 0, T),
|
|
297
|
-
role: "rowgroup",
|
|
298
|
-
focusRingTopOffset: "3px",
|
|
299
|
-
tabIndex: -1
|
|
300
|
-
}, b), /* @__PURE__ */ s.createElement("div", i.cn("div", {
|
|
301
|
-
style: J
|
|
302
|
-
}), /* @__PURE__ */ s.createElement("div", i.cn("div", {
|
|
303
|
-
style: J
|
|
304
|
-
}), /* @__PURE__ */ s.createElement("div", i.cn("div", {
|
|
305
|
-
style: J
|
|
306
|
-
}), /* @__PURE__ */ s.createElement(K.Bar, {
|
|
307
|
-
orientation: "horizontal",
|
|
308
|
-
bottom: 0,
|
|
309
|
-
container: this.scrollContainerRef
|
|
310
|
-
}), /* @__PURE__ */ s.createElement(K.Bar, {
|
|
311
|
-
orientation: "vertical",
|
|
312
|
-
w: "12px",
|
|
313
|
-
zIndex: 2
|
|
314
|
-
}))))), n.origin));
|
|
315
|
-
}
|
|
316
|
-
}]), x;
|
|
317
|
-
}(we);
|
|
318
|
-
export {
|
|
319
|
-
rr as default
|
|
320
|
-
};
|