schummar-table 0.38.3 → 0.39.2
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/dist/chunk-EEBUKP6F.js +64 -0
- package/dist/chunk-EEBUKP6F.js.map +1 -0
- package/dist/chunk-WFCJ3D3G.js +47 -0
- package/dist/chunk-WFCJ3D3G.js.map +1 -0
- package/dist/chunk-YWWFSINO.js +786 -0
- package/dist/chunk-YWWFSINO.js.map +1 -0
- package/dist/csvExporter.cjs +79 -0
- package/dist/csvExporter.cjs.map +1 -0
- package/dist/csvExporter.d.cts +18 -0
- package/dist/csvExporter.d.ts +18 -0
- package/dist/csvExporter.js +8 -0
- package/dist/csvExporter.js.map +1 -0
- package/dist/excelExporter.cjs +42 -0
- package/dist/excelExporter.cjs.map +1 -0
- package/dist/excelExporter.d.cts +9 -0
- package/dist/excelExporter.d.ts +9 -0
- package/dist/excelExporter.js +23 -0
- package/dist/excelExporter.js.map +1 -0
- package/dist/exporter-u6SatTo6.d.cts +22 -0
- package/dist/exporter-u6SatTo6.d.ts +22 -0
- package/dist/index.cjs +4942 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +219 -0
- package/dist/index.d.ts +219 -0
- package/dist/index.js +4053 -0
- package/dist/index.js.map +1 -0
- package/dist/mui4Theme.cjs +880 -0
- package/dist/mui4Theme.cjs.map +1 -0
- package/dist/mui4Theme.d.cts +13 -0
- package/dist/mui4Theme.d.ts +13 -0
- package/dist/mui4Theme.js +77 -0
- package/dist/mui4Theme.js.map +1 -0
- package/dist/mui5Theme.cjs +879 -0
- package/dist/mui5Theme.cjs.map +1 -0
- package/dist/mui5Theme.d.cts +13 -0
- package/dist/mui5Theme.d.ts +13 -0
- package/dist/mui5Theme.js +76 -0
- package/dist/mui5Theme.js.map +1 -0
- package/dist/types-CBQ-mEqF.d.cts +394 -0
- package/dist/{types/types.d.ts → types-DXWvQ10Y.d.ts} +50 -44
- package/package.json +59 -42
- package/dist/cjs/index.js +0 -3481
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/mui4Theme.js +0 -57
- package/dist/cjs/mui4Theme.js.map +0 -1
- package/dist/cjs/mui5Theme.js +0 -66
- package/dist/cjs/mui5Theme.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/tableTheme.js +0 -737
- package/dist/cjs/tableTheme.js.map +0 -1
- package/dist/es/index.js +0 -3482
- package/dist/es/index.js.map +0 -1
- package/dist/es/mui4Theme.js +0 -57
- package/dist/es/mui4Theme.js.map +0 -1
- package/dist/es/mui5Theme.js +0 -66
- package/dist/es/mui5Theme.js.map +0 -1
- package/dist/es/tableTheme.js +0 -738
- package/dist/es/tableTheme.js.map +0 -1
- package/dist/types/components/autoFocusTextField.d.ts +0 -5
- package/dist/types/components/cell.d.ts +0 -6
- package/dist/types/components/clearFiltersButton.d.ts +0 -1
- package/dist/types/components/columnFooter.d.ts +0 -1
- package/dist/types/components/columnHeader.d.ts +0 -6
- package/dist/types/components/columnSelection.d.ts +0 -2
- package/dist/types/components/dateFilter.d.ts +0 -7
- package/dist/types/components/dateInput.d.ts +0 -5
- package/dist/types/components/datePicker.d.ts +0 -82
- package/dist/types/components/details.d.ts +0 -6
- package/dist/types/components/expandControl.d.ts +0 -6
- package/dist/types/components/export.d.ts +0 -2
- package/dist/types/components/filterControl.d.ts +0 -6
- package/dist/types/components/formControlLabel.d.ts +0 -6
- package/dist/types/components/numberField.d.ts +0 -9
- package/dist/types/components/rangeFilter.d.ts +0 -7
- package/dist/types/components/resizeHandle.d.ts +0 -5
- package/dist/types/components/row.d.ts +0 -6
- package/dist/types/components/selectComponent.d.ts +0 -5
- package/dist/types/components/selectFilter.d.ts +0 -20
- package/dist/types/components/sortComponent.d.ts +0 -4
- package/dist/types/components/spinnner.d.ts +0 -3
- package/dist/types/components/table.d.ts +0 -3
- package/dist/types/components/text.d.ts +0 -5
- package/dist/types/components/textFilter.d.ts +0 -9
- package/dist/types/components/virtualList.d.ts +0 -14
- package/dist/types/components/virtualized.d.ts +0 -7
- package/dist/types/hooks/useFilter.d.ts +0 -8
- package/dist/types/hooks/useMemoMap.d.ts +0 -2
- package/dist/types/hooks/useTableMemo.d.ts +0 -6
- package/dist/types/hooks/useTheme.d.ts +0 -2
- package/dist/types/index.d.ts +0 -16
- package/dist/types/internalState/calcItems.d.ts +0 -3
- package/dist/types/internalState/calcProps.d.ts +0 -2
- package/dist/types/internalState/cleanupState.d.ts +0 -3
- package/dist/types/internalState/filterColumns.d.ts +0 -3
- package/dist/types/internalState/normalizeExpanded.d.ts +0 -3
- package/dist/types/internalState/syncSelections.d.ts +0 -3
- package/dist/types/internalState/tableStateStorage.d.ts +0 -13
- package/dist/types/internalState/useTableState.d.ts +0 -3
- package/dist/types/misc/calcClassNames.d.ts +0 -3
- package/dist/types/misc/csvExport.d.ts +0 -8
- package/dist/types/misc/debounce.d.ts +0 -4
- package/dist/types/misc/defaults.d.ts +0 -1
- package/dist/types/misc/helpers.d.ts +0 -18
- package/dist/types/misc/queue.d.ts +0 -7
- package/dist/types/misc/tableContext.d.ts +0 -8
- package/dist/types/misc/textMatch.d.ts +0 -2
- package/dist/types/misc/throttle.d.ts +0 -5
- package/dist/types/theme/defaultTheme/badge.d.ts +0 -2
- package/dist/types/theme/defaultTheme/button.d.ts +0 -2
- package/dist/types/theme/defaultTheme/checkbox.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultClasses.d.ts +0 -20
- package/dist/types/theme/defaultTheme/defaultColors.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultComponents.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultIcons.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultTexts.d.ts +0 -2
- package/dist/types/theme/defaultTheme/iconButton.d.ts +0 -2
- package/dist/types/theme/defaultTheme/index.d.ts +0 -2
- package/dist/types/theme/defaultTheme/popover.d.ts +0 -2
- package/dist/types/theme/defaultTheme/textField.d.ts +0 -2
- package/dist/types/theme/mui4Theme/index.d.ts +0 -7
- package/dist/types/theme/mui5Theme/index.d.ts +0 -7
- package/dist/types/theme/tableTheme.d.ts +0 -11
- package/dist/types/theme/useCssVariables.d.ts +0 -12
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CsvExporter
|
|
3
|
+
} from "./chunk-WFCJ3D3G.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadProps,
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "./chunk-EEBUKP6F.js";
|
|
8
|
+
|
|
9
|
+
// src/theme/defaultTheme/popover.tsx
|
|
10
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
11
|
+
import { createPortal } from "react-dom";
|
|
12
|
+
|
|
13
|
+
// src/theme/defaultTheme/defaultClasses.ts
|
|
14
|
+
import { css } from "@emotion/react";
|
|
15
|
+
var white = "#ffffff";
|
|
16
|
+
var lightGray = "#eeeeee";
|
|
17
|
+
var gray = "#bdbdbd";
|
|
18
|
+
var darkGray = "#777";
|
|
19
|
+
var cell = css({
|
|
20
|
+
padding: `calc(var(--spacing) * 0.1) calc(2 * var(--spacing))`,
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
borderBottom: `1px solid #dfe2e9`,
|
|
24
|
+
whiteSpace: "nowrap",
|
|
25
|
+
overflow: "hidden",
|
|
26
|
+
background: "white"
|
|
27
|
+
});
|
|
28
|
+
var defaultClasses = {
|
|
29
|
+
table: css({
|
|
30
|
+
position: "relative",
|
|
31
|
+
display: "grid"
|
|
32
|
+
}),
|
|
33
|
+
cell,
|
|
34
|
+
cellFill: css({
|
|
35
|
+
borderBottom: `1px solid ${lightGray}`
|
|
36
|
+
}),
|
|
37
|
+
headerCell: css(cell, {
|
|
38
|
+
padding: `var(--spacing) 0 var(--spacing) calc(2 * var(--spacing))`,
|
|
39
|
+
borderBottom: `1px solid #c9cfda`
|
|
40
|
+
}),
|
|
41
|
+
footerCell: css(cell, {
|
|
42
|
+
padding: `var(--spacing) calc(2 * var(--spacing))`,
|
|
43
|
+
borderTop: `1px solid #c9cfda`,
|
|
44
|
+
borderBottom: "none"
|
|
45
|
+
}),
|
|
46
|
+
firstCell: css({
|
|
47
|
+
justifyContent: "start"
|
|
48
|
+
}),
|
|
49
|
+
sticky: css({
|
|
50
|
+
position: "sticky",
|
|
51
|
+
top: 0,
|
|
52
|
+
zIndex: 2
|
|
53
|
+
}),
|
|
54
|
+
stickyBottom: css({
|
|
55
|
+
position: "sticky",
|
|
56
|
+
bottom: 0,
|
|
57
|
+
zIndex: 2
|
|
58
|
+
}),
|
|
59
|
+
headerFill: css({
|
|
60
|
+
borderBottom: `1px solid #c9cfda`,
|
|
61
|
+
background: white
|
|
62
|
+
}),
|
|
63
|
+
footerFill: css({
|
|
64
|
+
borderTop: `1px solid #c9cfda`,
|
|
65
|
+
background: white
|
|
66
|
+
}),
|
|
67
|
+
text: css({
|
|
68
|
+
minWidth: 0,
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
textOverflow: "ellipsis"
|
|
71
|
+
}),
|
|
72
|
+
card: css({
|
|
73
|
+
borderRadius: 4,
|
|
74
|
+
boxShadow: "0px 3px 14px 2px rgb(0 0 0 / 12%)",
|
|
75
|
+
background: "white"
|
|
76
|
+
}),
|
|
77
|
+
clearFiltersButton: css({
|
|
78
|
+
padding: `0 calc(2 * var(--spacing))`,
|
|
79
|
+
fontWeight: "bold",
|
|
80
|
+
position: "sticky",
|
|
81
|
+
left: 0,
|
|
82
|
+
maxWidth: "fit-content",
|
|
83
|
+
gridColumn: "2/-1",
|
|
84
|
+
button: {
|
|
85
|
+
color: "var(--primaryMain) !important",
|
|
86
|
+
border: "solid 1px",
|
|
87
|
+
borderColor: "var(--primaryMain) !important",
|
|
88
|
+
margin: "var(--spacing)"
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
details: css(cell, {
|
|
92
|
+
gridColumn: "1 / -1",
|
|
93
|
+
whiteSpace: "normal"
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/theme/defaultTheme/popover.tsx
|
|
98
|
+
import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
99
|
+
var MARGIN = 10;
|
|
100
|
+
var MAX_OFFSET = 20;
|
|
101
|
+
var Popover = ({
|
|
102
|
+
anchorEl,
|
|
103
|
+
open,
|
|
104
|
+
hidden,
|
|
105
|
+
onClose,
|
|
106
|
+
children,
|
|
107
|
+
className,
|
|
108
|
+
backdropClassName,
|
|
109
|
+
align
|
|
110
|
+
}) => {
|
|
111
|
+
const popper = useRef(null);
|
|
112
|
+
const [position, setPosition] = useState();
|
|
113
|
+
const [maxHeight, setMaxHeight] = useState(document.documentElement.clientHeight - 2 * MARGIN);
|
|
114
|
+
const [zIndex, setZIndex] = useState(1);
|
|
115
|
+
useLayoutEffect(() => {
|
|
116
|
+
if (!anchorEl || !open) {
|
|
117
|
+
setPosition(void 0);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
let last;
|
|
121
|
+
function check() {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
if (!anchorEl) return;
|
|
124
|
+
const {
|
|
125
|
+
left: anchorLeft,
|
|
126
|
+
bottom: anchorBottom,
|
|
127
|
+
width: anchorWidth
|
|
128
|
+
} = anchorEl.getBoundingClientRect();
|
|
129
|
+
const { width: popperWidth = 0 } = (_b = (_a = popper.current) == null ? void 0 : _a.getBoundingClientRect()) != null ? _b : {};
|
|
130
|
+
const viewportWidth = document.documentElement.clientWidth;
|
|
131
|
+
const viewportHeight = document.documentElement.clientHeight;
|
|
132
|
+
const next = {
|
|
133
|
+
left: align === "center" ? anchorLeft + anchorWidth / 2 - popperWidth / 2 : anchorLeft - Math.min(popperWidth ? popperWidth / 2 : Number.POSITIVE_INFINITY, MAX_OFFSET),
|
|
134
|
+
top: anchorBottom
|
|
135
|
+
};
|
|
136
|
+
if (next.left < MARGIN) {
|
|
137
|
+
next.left = MARGIN;
|
|
138
|
+
}
|
|
139
|
+
if (next.left + popperWidth > viewportWidth - MARGIN) {
|
|
140
|
+
next.left = viewportWidth - MARGIN - popperWidth;
|
|
141
|
+
}
|
|
142
|
+
if (next.top < MARGIN) {
|
|
143
|
+
next.top = MARGIN;
|
|
144
|
+
}
|
|
145
|
+
if (next.left !== (last == null ? void 0 : last.left) || next.top !== (last == null ? void 0 : last.top)) {
|
|
146
|
+
setPosition(next);
|
|
147
|
+
}
|
|
148
|
+
setMaxHeight(viewportHeight - MARGIN - next.top);
|
|
149
|
+
last = next;
|
|
150
|
+
}
|
|
151
|
+
check();
|
|
152
|
+
const handle = setInterval(check, 16);
|
|
153
|
+
return () => {
|
|
154
|
+
clearInterval(handle);
|
|
155
|
+
};
|
|
156
|
+
}, [anchorEl, open, align]);
|
|
157
|
+
function updateZIndex(div) {
|
|
158
|
+
var _a;
|
|
159
|
+
const ancestors = [];
|
|
160
|
+
for (let node = div == null ? void 0 : div.parentElement; node; node = node.parentElement) {
|
|
161
|
+
ancestors.push(node);
|
|
162
|
+
}
|
|
163
|
+
for (const node of ancestors.reverse()) {
|
|
164
|
+
const value = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(node).getPropertyValue("z-index");
|
|
165
|
+
if (value && !Number.isNaN(Number(value))) {
|
|
166
|
+
setZIndex(Number(value) + 1);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (!open) return null;
|
|
172
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
ref: updateZIndex,
|
|
177
|
+
css: {
|
|
178
|
+
display: "none"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
createPortal(
|
|
183
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
184
|
+
/* @__PURE__ */ jsx(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
className: backdropClassName,
|
|
188
|
+
css: [
|
|
189
|
+
{
|
|
190
|
+
position: "fixed",
|
|
191
|
+
left: 0,
|
|
192
|
+
right: 0,
|
|
193
|
+
top: 0,
|
|
194
|
+
bottom: 0,
|
|
195
|
+
zIndex
|
|
196
|
+
},
|
|
197
|
+
hidden && { display: "none" }
|
|
198
|
+
],
|
|
199
|
+
onClick: () => onClose()
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsx(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
ref: popper,
|
|
206
|
+
className,
|
|
207
|
+
css: [
|
|
208
|
+
defaultClasses.card,
|
|
209
|
+
__spreadProps(__spreadValues({
|
|
210
|
+
position: "fixed",
|
|
211
|
+
maxWidth: document.documentElement.clientWidth - 2 * MARGIN,
|
|
212
|
+
maxHeight
|
|
213
|
+
}, position), {
|
|
214
|
+
zIndex: zIndex + 1,
|
|
215
|
+
overflowY: "auto"
|
|
216
|
+
}),
|
|
217
|
+
hidden && { display: "none" },
|
|
218
|
+
!position && { visibility: "hidden" }
|
|
219
|
+
],
|
|
220
|
+
children
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] }),
|
|
224
|
+
document.body
|
|
225
|
+
)
|
|
226
|
+
] });
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// node_modules/schummar-state/dist/es/store.js
|
|
230
|
+
import { freeze, enableMapSet, enablePatches, produce, applyPatches } from "immer";
|
|
231
|
+
var react = function equal(a, b) {
|
|
232
|
+
if (a === b)
|
|
233
|
+
return true;
|
|
234
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
235
|
+
if (a.constructor !== b.constructor)
|
|
236
|
+
return false;
|
|
237
|
+
var length, i, keys;
|
|
238
|
+
if (Array.isArray(a)) {
|
|
239
|
+
length = a.length;
|
|
240
|
+
if (length != b.length)
|
|
241
|
+
return false;
|
|
242
|
+
for (i = length; i-- !== 0; )
|
|
243
|
+
if (!equal(a[i], b[i]))
|
|
244
|
+
return false;
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
if (a instanceof Map && b instanceof Map) {
|
|
248
|
+
if (a.size !== b.size)
|
|
249
|
+
return false;
|
|
250
|
+
for (i of a.entries())
|
|
251
|
+
if (!b.has(i[0]))
|
|
252
|
+
return false;
|
|
253
|
+
for (i of a.entries())
|
|
254
|
+
if (!equal(i[1], b.get(i[0])))
|
|
255
|
+
return false;
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
if (a instanceof Set && b instanceof Set) {
|
|
259
|
+
if (a.size !== b.size)
|
|
260
|
+
return false;
|
|
261
|
+
for (i of a.entries())
|
|
262
|
+
if (!b.has(i[0]))
|
|
263
|
+
return false;
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
267
|
+
length = a.length;
|
|
268
|
+
if (length != b.length)
|
|
269
|
+
return false;
|
|
270
|
+
for (i = length; i-- !== 0; )
|
|
271
|
+
if (a[i] !== b[i])
|
|
272
|
+
return false;
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
if (a.constructor === RegExp)
|
|
276
|
+
return a.source === b.source && a.flags === b.flags;
|
|
277
|
+
if (a.valueOf !== Object.prototype.valueOf)
|
|
278
|
+
return a.valueOf() === b.valueOf();
|
|
279
|
+
if (a.toString !== Object.prototype.toString)
|
|
280
|
+
return a.toString() === b.toString();
|
|
281
|
+
keys = Object.keys(a);
|
|
282
|
+
length = keys.length;
|
|
283
|
+
if (length !== Object.keys(b).length)
|
|
284
|
+
return false;
|
|
285
|
+
for (i = length; i-- !== 0; )
|
|
286
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
287
|
+
return false;
|
|
288
|
+
for (i = length; i-- !== 0; ) {
|
|
289
|
+
var key = keys[i];
|
|
290
|
+
if (key === "_owner" && a.$$typeof) {
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (!equal(a[key], b[key]))
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
return a !== a && b !== b;
|
|
299
|
+
};
|
|
300
|
+
function createSelector(stringSelector) {
|
|
301
|
+
const parts = stringSelector.split(".");
|
|
302
|
+
return (state) => parts.reduce((v2, p2) => v2 instanceof Object && p2 in v2 ? v2[p2] : void 0, state);
|
|
303
|
+
}
|
|
304
|
+
function setWithSelector(state, stringSelector, value) {
|
|
305
|
+
const parts = stringSelector.split(".");
|
|
306
|
+
const prefix = parts.slice(0, -1);
|
|
307
|
+
const last = parts[parts.length - 1];
|
|
308
|
+
for (const part of prefix) {
|
|
309
|
+
if (state instanceof Object && part in state) {
|
|
310
|
+
state = state[part];
|
|
311
|
+
} else {
|
|
312
|
+
throw Error(`Could not set ${stringSelector} because path ${stringSelector} doesn't exist`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (state instanceof Object) {
|
|
316
|
+
state[last] = value;
|
|
317
|
+
} else {
|
|
318
|
+
throw Error(`Could not set ${stringSelector} because path ${stringSelector} doesn't exist`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function throttle(fn, ms) {
|
|
322
|
+
let last = 0;
|
|
323
|
+
let lastArgs;
|
|
324
|
+
let timeout;
|
|
325
|
+
function run() {
|
|
326
|
+
const args = lastArgs;
|
|
327
|
+
last = Date.now();
|
|
328
|
+
lastArgs = void 0;
|
|
329
|
+
timeout = void 0;
|
|
330
|
+
fn(...args);
|
|
331
|
+
}
|
|
332
|
+
return function(...args) {
|
|
333
|
+
const now = Date.now();
|
|
334
|
+
lastArgs = args;
|
|
335
|
+
if (timeout)
|
|
336
|
+
;
|
|
337
|
+
else if (now < last + ms) {
|
|
338
|
+
timeout = setTimeout(run, last + ms - now);
|
|
339
|
+
} else {
|
|
340
|
+
run();
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
var RESTART_UPDATE = Symbol("RESTART_UPDATE");
|
|
345
|
+
var Store = class {
|
|
346
|
+
constructor(state, { log = (...data) => console.error(...data) } = {}) {
|
|
347
|
+
this.state = state;
|
|
348
|
+
this.subscriptions = /* @__PURE__ */ new Set();
|
|
349
|
+
this.batchCounter = 0;
|
|
350
|
+
this.reactions = /* @__PURE__ */ new Set();
|
|
351
|
+
this.patches = new Array();
|
|
352
|
+
freeze(state, true);
|
|
353
|
+
enableMapSet();
|
|
354
|
+
enablePatches();
|
|
355
|
+
this.options = {
|
|
356
|
+
log
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
getState() {
|
|
360
|
+
return this.state;
|
|
361
|
+
}
|
|
362
|
+
update(update) {
|
|
363
|
+
this.checkLock();
|
|
364
|
+
this.state = produce(this.state, (draft) => update(draft, this.state), (patches) => this.patches.push(...patches));
|
|
365
|
+
this.notify();
|
|
366
|
+
}
|
|
367
|
+
set(state) {
|
|
368
|
+
this.checkLock();
|
|
369
|
+
this.state = produce(this.state, () => state, (patches) => this.patches.push(...patches));
|
|
370
|
+
this.notify();
|
|
371
|
+
}
|
|
372
|
+
applyPatches(patches) {
|
|
373
|
+
this.checkLock();
|
|
374
|
+
this.state = applyPatches(this.state, patches);
|
|
375
|
+
this.patches.push(...patches);
|
|
376
|
+
this.notify();
|
|
377
|
+
}
|
|
378
|
+
batchUpdates(fn) {
|
|
379
|
+
try {
|
|
380
|
+
this.batchCounter++;
|
|
381
|
+
fn();
|
|
382
|
+
} finally {
|
|
383
|
+
this.batchCounter--;
|
|
384
|
+
if (this.batchCounter === 0) {
|
|
385
|
+
this.notify();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
subscribe(...args) {
|
|
390
|
+
let selector, listener, options;
|
|
391
|
+
if (args[1] instanceof Function) {
|
|
392
|
+
[selector, listener, options] = args;
|
|
393
|
+
if (typeof selector === "string") {
|
|
394
|
+
selector = createSelector(selector);
|
|
395
|
+
}
|
|
396
|
+
} else {
|
|
397
|
+
[selector, listener, options] = [(x) => x, ...args];
|
|
398
|
+
}
|
|
399
|
+
const { runNow = true, throttle: throttle$1 = 0, compare = react } = options != null ? options : {};
|
|
400
|
+
const throttledListener = throttle$1 ? throttle(listener, throttle$1) : listener;
|
|
401
|
+
let value = selector(this.state);
|
|
402
|
+
const internalListener = (state, _patches, init) => {
|
|
403
|
+
try {
|
|
404
|
+
const oldValue = value;
|
|
405
|
+
value = selector(state);
|
|
406
|
+
if (!init && compare(value, oldValue))
|
|
407
|
+
return;
|
|
408
|
+
(init ? listener : throttledListener)(value, oldValue, this.state);
|
|
409
|
+
} catch (e2) {
|
|
410
|
+
this.options.log("Failed to execute listener:", e2);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
this.subscriptions.add(internalListener);
|
|
414
|
+
if (runNow)
|
|
415
|
+
internalListener(this.state, [], true);
|
|
416
|
+
return () => {
|
|
417
|
+
this.subscriptions.delete(internalListener);
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
addReaction(...args) {
|
|
421
|
+
let selector, reaction, options;
|
|
422
|
+
if (args[1] instanceof Function) {
|
|
423
|
+
[selector, reaction, options] = args;
|
|
424
|
+
if (typeof selector === "string") {
|
|
425
|
+
selector = createSelector(selector);
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
[selector, reaction, options] = [(x) => x, ...args];
|
|
429
|
+
}
|
|
430
|
+
const { runNow = true, compare = react } = options != null ? options : {};
|
|
431
|
+
let value = selector(this.state);
|
|
432
|
+
const internalListener = (init) => {
|
|
433
|
+
let hasChanged = false;
|
|
434
|
+
try {
|
|
435
|
+
this.lock = "reaction";
|
|
436
|
+
const oldValue = value;
|
|
437
|
+
value = selector(this.state);
|
|
438
|
+
if (!init && compare(value, oldValue))
|
|
439
|
+
return;
|
|
440
|
+
this.state = produce(this.state, (draft) => reaction(value, draft, this.state, oldValue), (patches) => {
|
|
441
|
+
hasChanged = true;
|
|
442
|
+
this.patches.push(...patches);
|
|
443
|
+
});
|
|
444
|
+
} catch (e2) {
|
|
445
|
+
this.options.log("Failed to execute reaction:", e2);
|
|
446
|
+
} finally {
|
|
447
|
+
delete this.lock;
|
|
448
|
+
}
|
|
449
|
+
if (hasChanged && !init)
|
|
450
|
+
throw RESTART_UPDATE;
|
|
451
|
+
if (hasChanged && init)
|
|
452
|
+
this.notify();
|
|
453
|
+
};
|
|
454
|
+
this.reactions.add(internalListener);
|
|
455
|
+
if (runNow)
|
|
456
|
+
internalListener(true);
|
|
457
|
+
return () => {
|
|
458
|
+
this.reactions.delete(internalListener);
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
subscribePatches(listener) {
|
|
462
|
+
const internalListener = (_state, patches) => {
|
|
463
|
+
try {
|
|
464
|
+
listener(patches);
|
|
465
|
+
} catch (e2) {
|
|
466
|
+
this.options.log("Failed to execute patch listener:", e2);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
this.subscriptions.add(internalListener);
|
|
470
|
+
return () => {
|
|
471
|
+
this.subscriptions.delete(internalListener);
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
checkLock() {
|
|
475
|
+
if (this.lock === "reaction") {
|
|
476
|
+
throw Error("You cannot call update from within a reaction. Use the passed draft instead.");
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
notify() {
|
|
480
|
+
if (this.batchCounter > 0 || this.patches.length === 0)
|
|
481
|
+
return;
|
|
482
|
+
try {
|
|
483
|
+
for (const reaction of this.reactions) {
|
|
484
|
+
reaction();
|
|
485
|
+
}
|
|
486
|
+
} catch (e2) {
|
|
487
|
+
return this.notify();
|
|
488
|
+
}
|
|
489
|
+
const patches = this.patches;
|
|
490
|
+
this.patches = [];
|
|
491
|
+
this.batchUpdates(() => {
|
|
492
|
+
for (const subscription of this.subscriptions) {
|
|
493
|
+
subscription(this.state, patches);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
// node_modules/schummar-state/dist/es/react.js
|
|
500
|
+
import React, { useCallback, useDebugValue, useMemo, createContext, useContext, useEffect } from "react";
|
|
501
|
+
import "immer";
|
|
502
|
+
var __defProp = Object.defineProperty;
|
|
503
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
504
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
505
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
506
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
507
|
+
var __spreadValues2 = (a2, b) => {
|
|
508
|
+
for (var prop in b || (b = {}))
|
|
509
|
+
if (__hasOwnProp.call(b, prop))
|
|
510
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
511
|
+
if (__getOwnPropSymbols)
|
|
512
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
513
|
+
if (__propIsEnum.call(b, prop))
|
|
514
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
515
|
+
}
|
|
516
|
+
return a2;
|
|
517
|
+
};
|
|
518
|
+
var withSelector = { exports: {} };
|
|
519
|
+
var withSelector_production_min = {};
|
|
520
|
+
var shim = { exports: {} };
|
|
521
|
+
var useSyncExternalStoreShim_production_min = {};
|
|
522
|
+
var e = React;
|
|
523
|
+
function h$1(a2, b) {
|
|
524
|
+
return a2 === b && (a2 !== 0 || 1 / a2 === 1 / b) || a2 !== a2 && b !== b;
|
|
525
|
+
}
|
|
526
|
+
var k = typeof Object.is === "function" ? Object.is : h$1;
|
|
527
|
+
var l = e.useState;
|
|
528
|
+
var m = e.useEffect;
|
|
529
|
+
var n$1 = e.useLayoutEffect;
|
|
530
|
+
var p$1 = e.useDebugValue;
|
|
531
|
+
function q$1(a2, b) {
|
|
532
|
+
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
533
|
+
n$1(function() {
|
|
534
|
+
c.value = d;
|
|
535
|
+
c.getSnapshot = b;
|
|
536
|
+
r$1(c) && g({ inst: c });
|
|
537
|
+
}, [a2, d, b]);
|
|
538
|
+
m(function() {
|
|
539
|
+
r$1(c) && g({ inst: c });
|
|
540
|
+
return a2(function() {
|
|
541
|
+
r$1(c) && g({ inst: c });
|
|
542
|
+
});
|
|
543
|
+
}, [a2]);
|
|
544
|
+
p$1(d);
|
|
545
|
+
return d;
|
|
546
|
+
}
|
|
547
|
+
function r$1(a2) {
|
|
548
|
+
var b = a2.getSnapshot;
|
|
549
|
+
a2 = a2.value;
|
|
550
|
+
try {
|
|
551
|
+
var d = b();
|
|
552
|
+
return !k(a2, d);
|
|
553
|
+
} catch (f) {
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function t$1(a2, b) {
|
|
558
|
+
return b();
|
|
559
|
+
}
|
|
560
|
+
var u$1 = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? t$1 : q$1;
|
|
561
|
+
useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$1;
|
|
562
|
+
{
|
|
563
|
+
shim.exports = useSyncExternalStoreShim_production_min;
|
|
564
|
+
}
|
|
565
|
+
var h = React;
|
|
566
|
+
var n = shim.exports;
|
|
567
|
+
function p(a2, b) {
|
|
568
|
+
return a2 === b && (a2 !== 0 || 1 / a2 === 1 / b) || a2 !== a2 && b !== b;
|
|
569
|
+
}
|
|
570
|
+
var q = typeof Object.is === "function" ? Object.is : p;
|
|
571
|
+
var r = n.useSyncExternalStore;
|
|
572
|
+
var t = h.useRef;
|
|
573
|
+
var u = h.useEffect;
|
|
574
|
+
var v = h.useMemo;
|
|
575
|
+
var w = h.useDebugValue;
|
|
576
|
+
withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b, e2, l2, g) {
|
|
577
|
+
var c = t(null);
|
|
578
|
+
if (c.current === null) {
|
|
579
|
+
var f = { hasValue: false, value: null };
|
|
580
|
+
c.current = f;
|
|
581
|
+
} else
|
|
582
|
+
f = c.current;
|
|
583
|
+
c = v(function() {
|
|
584
|
+
function a3(a4) {
|
|
585
|
+
if (!c2) {
|
|
586
|
+
c2 = true;
|
|
587
|
+
d2 = a4;
|
|
588
|
+
a4 = l2(a4);
|
|
589
|
+
if (g !== void 0 && f.hasValue) {
|
|
590
|
+
var b2 = f.value;
|
|
591
|
+
if (g(b2, a4))
|
|
592
|
+
return k2 = b2;
|
|
593
|
+
}
|
|
594
|
+
return k2 = a4;
|
|
595
|
+
}
|
|
596
|
+
b2 = k2;
|
|
597
|
+
if (q(d2, a4))
|
|
598
|
+
return b2;
|
|
599
|
+
var e3 = l2(a4);
|
|
600
|
+
if (g !== void 0 && g(b2, e3))
|
|
601
|
+
return b2;
|
|
602
|
+
d2 = a4;
|
|
603
|
+
return k2 = e3;
|
|
604
|
+
}
|
|
605
|
+
var c2 = false, d2, k2, m2 = e2 === void 0 ? null : e2;
|
|
606
|
+
return [function() {
|
|
607
|
+
return a3(b());
|
|
608
|
+
}, m2 === null ? void 0 : function() {
|
|
609
|
+
return a3(m2());
|
|
610
|
+
}];
|
|
611
|
+
}, [b, e2, l2, g]);
|
|
612
|
+
var d = r(a2, c[0], c[1]);
|
|
613
|
+
u(function() {
|
|
614
|
+
f.hasValue = true;
|
|
615
|
+
f.value = d;
|
|
616
|
+
}, [d]);
|
|
617
|
+
w(d);
|
|
618
|
+
return d;
|
|
619
|
+
};
|
|
620
|
+
{
|
|
621
|
+
withSelector.exports = withSelector_production_min;
|
|
622
|
+
}
|
|
623
|
+
function useStoreState(store, ...args) {
|
|
624
|
+
var _a, _b, _c, _d;
|
|
625
|
+
let selector, options;
|
|
626
|
+
if (args[0] instanceof Function) {
|
|
627
|
+
selector = args[0];
|
|
628
|
+
options = (_a = args[1]) != null ? _a : {};
|
|
629
|
+
} else if (typeof args[0] === "string") {
|
|
630
|
+
selector = createSelector(args[0]);
|
|
631
|
+
options = (_b = args[1]) != null ? _b : {};
|
|
632
|
+
} else {
|
|
633
|
+
selector = (x) => x;
|
|
634
|
+
options = (_c = args[0]) != null ? _c : {};
|
|
635
|
+
}
|
|
636
|
+
const subscribe = useCallback((listener) => {
|
|
637
|
+
return store.subscribe((x) => x, listener, {
|
|
638
|
+
throttle: options.throttle,
|
|
639
|
+
runNow: false,
|
|
640
|
+
compare: (a2, b) => a2 === b
|
|
641
|
+
});
|
|
642
|
+
}, [store, options.throttle]);
|
|
643
|
+
const getSnapshot = useCallback(() => store.getState(), [store]);
|
|
644
|
+
const value = withSelector.exports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, selector, (_d = options.compare) != null ? _d : react);
|
|
645
|
+
useDebugValue(value);
|
|
646
|
+
return value;
|
|
647
|
+
}
|
|
648
|
+
function useStoreProp(store, selector) {
|
|
649
|
+
const value = useStoreState(store, selector);
|
|
650
|
+
const update = (value2) => store.update((state) => setWithSelector(state, selector, value2));
|
|
651
|
+
return [value, update];
|
|
652
|
+
}
|
|
653
|
+
var Store2 = class extends Store {
|
|
654
|
+
useState(...args) {
|
|
655
|
+
return useStoreState(this, ...args);
|
|
656
|
+
}
|
|
657
|
+
useProp(selector) {
|
|
658
|
+
return useStoreProp(this, selector);
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
var StoreScope = class {
|
|
662
|
+
constructor(defaultValue) {
|
|
663
|
+
this.defaultValue = defaultValue;
|
|
664
|
+
this.Provider = ({ children, store }) => {
|
|
665
|
+
const _store = useMemo(() => store != null ? store : new Store2(this.defaultValue), [store]);
|
|
666
|
+
return /* @__PURE__ */ React.createElement(this.context.Provider, {
|
|
667
|
+
value: _store
|
|
668
|
+
}, children);
|
|
669
|
+
};
|
|
670
|
+
this.withScope = (Component) => {
|
|
671
|
+
return (args) => /* @__PURE__ */ React.createElement(this.Provider, null, /* @__PURE__ */ React.createElement(Component, __spreadValues2({}, args)));
|
|
672
|
+
};
|
|
673
|
+
this.context = createContext(new Store2(defaultValue));
|
|
674
|
+
}
|
|
675
|
+
useStore() {
|
|
676
|
+
return useContext(this.context);
|
|
677
|
+
}
|
|
678
|
+
useState(...args) {
|
|
679
|
+
const store = this.useStore();
|
|
680
|
+
return useStoreState(store, ...args);
|
|
681
|
+
}
|
|
682
|
+
useProp(selector) {
|
|
683
|
+
const store = this.useStore();
|
|
684
|
+
return useStoreProp(store, selector);
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
// src/theme/tableTheme.tsx
|
|
689
|
+
var globalTableTheme = new Store2({});
|
|
690
|
+
function configureTableTheme(tableTheme) {
|
|
691
|
+
globalTableTheme.set(tableTheme);
|
|
692
|
+
}
|
|
693
|
+
function mergeThemes(...themes) {
|
|
694
|
+
return {
|
|
695
|
+
text: Object.assign({}, ...themes.map((theme) => theme.text)),
|
|
696
|
+
classes: Object.assign({}, ...themes.map((theme) => theme.classes)),
|
|
697
|
+
styles: Object.assign({}, ...themes.map((theme) => theme.styles)),
|
|
698
|
+
components: Object.assign({}, ...themes.map((theme) => theme.components)),
|
|
699
|
+
icons: Object.assign({}, ...themes.map((theme) => theme.icons)),
|
|
700
|
+
colors: {
|
|
701
|
+
primary: Object.assign({}, ...themes.map((theme) => {
|
|
702
|
+
var _a;
|
|
703
|
+
return (_a = theme.colors) == null ? void 0 : _a.primary;
|
|
704
|
+
})),
|
|
705
|
+
secondary: Object.assign({}, ...themes.map((theme) => {
|
|
706
|
+
var _a;
|
|
707
|
+
return (_a = theme.colors) == null ? void 0 : _a.secondary;
|
|
708
|
+
})),
|
|
709
|
+
blocked: Object.assign({}, ...themes.map((theme) => {
|
|
710
|
+
var _a;
|
|
711
|
+
return (_a = theme.colors) == null ? void 0 : _a.blocked;
|
|
712
|
+
}))
|
|
713
|
+
},
|
|
714
|
+
spacing: themes.map((theme) => theme.spacing).reverse().find((x) => x !== void 0)
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// src/misc/tableSettings.tsx
|
|
719
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
720
|
+
import { jsx as jsx2 } from "@emotion/react/jsx-runtime";
|
|
721
|
+
var TableSettingsContext = createContext2({
|
|
722
|
+
theme: {},
|
|
723
|
+
exporters: [
|
|
724
|
+
{ action: "copy", exporter: new CsvExporter() },
|
|
725
|
+
{ action: "download", exporter: new CsvExporter() }
|
|
726
|
+
]
|
|
727
|
+
});
|
|
728
|
+
function TableSettingsProvider({
|
|
729
|
+
theme,
|
|
730
|
+
exporters,
|
|
731
|
+
additionalExporters,
|
|
732
|
+
children
|
|
733
|
+
}) {
|
|
734
|
+
const inherited = useContext2(TableSettingsContext);
|
|
735
|
+
theme != null ? theme : theme = inherited.theme;
|
|
736
|
+
exporters != null ? exporters : exporters = inherited.exporters;
|
|
737
|
+
if (additionalExporters) {
|
|
738
|
+
exporters = [...exporters, ...additionalExporters];
|
|
739
|
+
}
|
|
740
|
+
return /* @__PURE__ */ jsx2(
|
|
741
|
+
TableSettingsContext.Provider,
|
|
742
|
+
{
|
|
743
|
+
value: {
|
|
744
|
+
theme,
|
|
745
|
+
exporters
|
|
746
|
+
},
|
|
747
|
+
children
|
|
748
|
+
}
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export {
|
|
753
|
+
Store2 as Store,
|
|
754
|
+
StoreScope,
|
|
755
|
+
lightGray,
|
|
756
|
+
gray,
|
|
757
|
+
darkGray,
|
|
758
|
+
defaultClasses,
|
|
759
|
+
Popover,
|
|
760
|
+
globalTableTheme,
|
|
761
|
+
configureTableTheme,
|
|
762
|
+
mergeThemes,
|
|
763
|
+
TableSettingsContext,
|
|
764
|
+
TableSettingsProvider
|
|
765
|
+
};
|
|
766
|
+
/*! Bundled license information:
|
|
767
|
+
|
|
768
|
+
schummar-state/dist/es/react.js:
|
|
769
|
+
(** @license React vundefined
|
|
770
|
+
* use-sync-external-store-shim.production.min.js
|
|
771
|
+
*
|
|
772
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
773
|
+
*
|
|
774
|
+
* This source code is licensed under the MIT license found in the
|
|
775
|
+
* LICENSE file in the root directory of this source tree.
|
|
776
|
+
*)
|
|
777
|
+
(** @license React vundefined
|
|
778
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
779
|
+
*
|
|
780
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
781
|
+
*
|
|
782
|
+
* This source code is licensed under the MIT license found in the
|
|
783
|
+
* LICENSE file in the root directory of this source tree.
|
|
784
|
+
*)
|
|
785
|
+
*/
|
|
786
|
+
//# sourceMappingURL=chunk-YWWFSINO.js.map
|