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