@dcs-tech/ui 0.6.0 → 0.8.0

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 (56) hide show
  1. package/README.md +43 -0
  2. package/dist/{ChartImageMenu-CuuFnW9q.js → ChartImageMenu-AsfvmdTH.js} +99 -81
  3. package/dist/{ChartView-nS4f4EU_.js → ChartView-CW3m4Z_1.js} +1 -1
  4. package/dist/{SummaryChart-CVg6i2mx.js → SummaryChart-CxRjK_HU.js} +2 -2
  5. package/dist/{SummaryImage-CoEFzMl6.js → SummaryImage-DeYs2Jgj.js} +2 -2
  6. package/dist/{SummarySeeAll-C_OUs3kn.js → SummarySeeAll-CrmROhBv.js} +5 -5
  7. package/dist/assets/fileTask.worker-BHT1olUk.js +1 -0
  8. package/dist/{columnValue-K98ElfJc.js → columnValue-DwUqueZ6.js} +1 -1
  9. package/dist/{exportContext-CJaIv8R-.js → exportContext-BKFnNQ0q.js} +1 -1
  10. package/dist/{exportEngine-CDLYHH0d.js → exportEngine-CZ22cX7a.js} +377 -382
  11. package/dist/file-worker.js +1 -0
  12. package/dist/{fileActions-KSaVGnaE.js → fileActions-COf5Q4Eg.js} +2 -2
  13. package/dist/{geometry-ChwYB45B.js → geometry-yZmKN662.js} +11 -2
  14. package/dist/index.js +6534 -6118
  15. package/dist/runFileTask--4YjQH7Y.js +210 -0
  16. package/dist/scrollArea-Dd2dNMV4.js +236 -0
  17. package/dist/style.css +1 -1
  18. package/dist/{summaryChartData-pNvzaEHp.js → summaryChartData-CARqGRUl.js} +1 -1
  19. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  20. package/dist/types/components/DataTable/export/exportEngine.d.ts +11 -4
  21. package/dist/types/components/DataTable/layout/useFillHeight.d.ts +1 -0
  22. package/dist/types/components/DataTable/rows/RowActions.d.ts +5 -2
  23. package/dist/types/components/DataTable/types.d.ts +1 -0
  24. package/dist/types/components/Dialog/DialogHost.d.ts +1 -0
  25. package/dist/types/components/Dialog/dialogOpen.d.ts +7 -0
  26. package/dist/types/components/Dialog/index.d.ts +1 -0
  27. package/dist/types/components/Fields/Field.d.ts +1 -1
  28. package/dist/types/components/Fields/hooks/useFieldBlur.d.ts +1 -1
  29. package/dist/types/components/FileEngine/FileEngineProvider.d.ts +20 -1
  30. package/dist/types/components/FileEngine/index.d.ts +1 -1
  31. package/dist/types/components/Popover/floatingPosition.d.ts +11 -1
  32. package/dist/types/components/Scroll/ScrollStrip.d.ts +4 -2
  33. package/dist/types/components/Sidebar/Sidebar.d.ts +12 -3
  34. package/dist/types/components/Sidebar/index.d.ts +1 -1
  35. package/dist/types/components/UIProvider/UIHostContext.d.ts +20 -0
  36. package/dist/types/components/UIProvider/UILabelsContext.d.ts +9 -0
  37. package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
  38. package/dist/types/components/UIProvider/index.d.ts +2 -0
  39. package/dist/types/core/logic/index.d.ts +1 -0
  40. package/dist/types/core/logic/popover.logic.d.ts +2 -0
  41. package/dist/types/core/logic/standardSchema.logic.d.ts +9 -0
  42. package/dist/types/core/types/fields.types.d.ts +2 -0
  43. package/dist/types/core/types/fileEngine.types.d.ts +51 -0
  44. package/dist/types/core/types/form.types.d.ts +4 -0
  45. package/dist/types/core/types/index.d.ts +1 -0
  46. package/dist/types/core/types/standardSchema.types.d.ts +30 -0
  47. package/dist/types/core/types/suggest.types.d.ts +1 -0
  48. package/dist/types/core/types/tooltip.types.d.ts +2 -0
  49. package/dist/types/file/fileEngine.d.ts +2 -1
  50. package/dist/types/file/tasks/runFileTask.d.ts +4 -1
  51. package/dist/types/file/workerPool.d.ts +1 -0
  52. package/dist/types/index.d.ts +11 -6
  53. package/package.json +7 -3
  54. package/dist/assets/fileTask.worker-FQSUtwcz.js +0 -1
  55. package/dist/runFileTask-BClLQjmv.js +0 -109
  56. package/dist/scrollArea-DAlVT5U7.js +0 -214
package/README.md CHANGED
@@ -69,6 +69,49 @@ The table's runtime dependencies (`@tanstack/react-table`, `@tanstack/react-virt
69
69
  `@tanstack/match-sorter-utils`, `exceljs`, `pdfmake` — loaded on the first PDF export —
70
70
  and `react-icons`) install with the package.
71
71
 
72
+ ## Files and the background worker
73
+
74
+ Exports (DataTable, chart images, your own reports) run through one file engine that
75
+ `UIProvider` sets up. Excel and PDF files build in a **background worker**, so a large
76
+ export does not freeze the page.
77
+
78
+ The worker ships as its own file and imports `exceljs` and `pdfmake` by package name, so
79
+ **your bundler must treat it as a worker entry**:
80
+
81
+ - **Vite** and **webpack 5**: nothing to do. They follow the package's
82
+ `new Worker(new URL(…, import.meta.url))` and bundle the worker themselves.
83
+ - **Anything else**: build a worker from `@dcs-tech/ui/file-worker` with your bundler and hand it
84
+ to the engine:
85
+
86
+ ```ts
87
+ // file.worker.ts — bundled by your setup as a module worker
88
+ import '@dcs-tech/ui/file-worker';
89
+ ```
90
+
91
+ ```tsx
92
+ <UIProvider fileEngine={{ createWorker: () => new Worker('/assets/file.worker.js', { type: 'module' }) }}>
93
+ ```
94
+
95
+ If a worker cannot start, the engine builds the same file on the main thread instead.
96
+ `fileEngine={{ workers: 'off' }}` always uses the main thread. Large PDF fonts (a script font)
97
+ belong on the engine, so they reach each worker once: `fileEngine={{ pdfFonts: { fonts, vfs } }}`.
98
+
99
+ ## Form validation
100
+
101
+ `Form` validates with any [Standard Schema](https://standardschema.dev) library — Zod 3.24+,
102
+ Valibot 1+, ArkType 2+, Yup 1.7+ — with no adapter:
103
+
104
+ ```tsx
105
+ import { z } from 'zod'
106
+
107
+ <Form fields={fields} defaultData={data} validation={{ schema: z.object({ name: z.string().min(1, 'Required') }), validateOnBlur: true }} />
108
+ ```
109
+
110
+ Errors are keyed by each issue's path (`address.city`). Leaving a field checks only that field; a
111
+ failed submit shows every error and focuses the first. For other schemas (e.g. Yup before 1.7),
112
+ pass `validate: (schema, data) => ({ valid, errors })` as before. The form's words (Submit, Reset,
113
+ its error toasts) come from `UIProvider labels.form`.
114
+
72
115
  ## Theming
73
116
 
74
117
  Every colour, size and spacing value is a CSS custom property. Override them on
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { A as e, C as t, Cn as n, Dn as r, E as i, En as a, F as o, J as s, L as c, N as l, Nn as u, O as d, P as f, Q as p, R as m, S as h, T as g, Tn as _, Y as v, _ as y, b, c as x, d as S, et as C, ft as w, g as T, h as ee, i as te, j as ne, kn as re, l as ie, r as ae, rt as oe, st as E, ut as se, w as ce, y as le } from "./geometry-ChwYB45B.js";
3
- import { a as ue, c as de, i as fe, l as pe, t as me } from "./fileActions-KSaVGnaE.js";
4
- import { t as he } from "./runFileTask-BClLQjmv.js";
2
+ import { A as e, C as t, Cn as n, Dn as r, E as i, En as a, F as o, J as s, L as c, N as l, Nn as u, O as d, P as f, Q as p, R as m, S as h, T as g, Tn as _, Y as v, _ as y, b, c as x, d as S, et as C, ft as w, g as T, h as ee, i as te, j as ne, kn as re, l as ie, r as ae, rt as oe, st as E, ut as se, w as ce, y as le } from "./geometry-yZmKN662.js";
3
+ import { a as ue, l as de, n as fe, o as pe, u as me } from "./fileActions-COf5Q4Eg.js";
4
+ import { t as he } from "./runFileTask--4YjQH7Y.js";
5
5
  import ge, { cloneElement as _e, createContext as ve, forwardRef as ye, useCallback as D, useContext as be, useEffect as O, useId as xe, useLayoutEffect as Se, useMemo as Ce, useRef as k, useState as A, useSyncExternalStore as we } from "react";
6
6
  import { Fragment as Te, jsx as j, jsxs as M } from "react/jsx-runtime";
7
7
  import { createPortal as Ee } from "react-dom";
@@ -98,15 +98,19 @@ function Be(...e) {
98
98
  }, []);
99
99
  }
100
100
  var I = {
101
- tooltip: "_tooltip_osxra_14",
102
- open: "_open_osxra_42",
103
- placement_top: "_placement_top_osxra_81",
104
- placement_bottom: "_placement_bottom_osxra_82",
105
- placement_left: "_placement_left_osxra_83",
106
- placement_right: "_placement_right_osxra_84",
107
- measured: "_measured_osxra_90",
108
- helpIcon: "_helpIcon_osxra_98",
109
- disabledAnchor: "_disabledAnchor_osxra_131"
101
+ tooltip: "_tooltip_2q3ib_14",
102
+ open: "_open_2q3ib_42",
103
+ tone_info: "_tone_info_2q3ib_53",
104
+ tone_success: "_tone_success_2q3ib_54",
105
+ tone_warning: "_tone_warning_2q3ib_55",
106
+ tone_danger: "_tone_danger_2q3ib_56",
107
+ placement_top: "_placement_top_2q3ib_88",
108
+ placement_bottom: "_placement_bottom_2q3ib_89",
109
+ placement_left: "_placement_left_2q3ib_90",
110
+ placement_right: "_placement_right_2q3ib_91",
111
+ measured: "_measured_2q3ib_97",
112
+ helpIcon: "_helpIcon_2q3ib_105",
113
+ disabledAnchor: "_disabledAnchor_2q3ib_138"
110
114
  }, Ve = 500, He = 100, L = 8, Ue = 16, We = 300, Ge = 0, Ke = () => Date.now() - Ge < We, R = () => typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --probe"), qe = () => typeof HTMLElement < "u" && Object.prototype.hasOwnProperty.call(HTMLElement.prototype, "popover");
111
115
  function Je(e) {
112
116
  let t = r(e), n = `tooltip-${xe().replace(/:/g, "")}`, [i, o] = A(!1), [s, c] = A(t?.placement || "top"), [l, u] = A(!1), d = k(null), f = k(null), p = k(void 0), m = k(void 0), h = k(null), g = k("pointer"), _ = t?.placement || "top", v = t?.anchorTo || "auto", y = t?.delay ?? Ve, b = t?.closeDelay ?? He, x = D(() => {
@@ -187,6 +191,7 @@ function Je(e) {
187
191
  className: [
188
192
  I.tooltip,
189
193
  I[`placement_${s}`],
194
+ t.tone && t.tone !== "default" ? I[`tone_${t.tone}`] : "",
190
195
  i ? I.open : "",
191
196
  l ? I.measured : "",
192
197
  t.className || ""
@@ -298,51 +303,51 @@ function tt() {
298
303
  return be(et);
299
304
  }
300
305
  var z = {
301
- root: "_root_vgjyx_6",
302
- size_xxs: "_size_xxs_vgjyx_45",
303
- size_xs: "_size_xs_vgjyx_52",
304
- size_small: "_size_small_vgjyx_59",
305
- size_medium: "_size_medium_vgjyx_66",
306
- size_large: "_size_large_vgjyx_73",
307
- size_xl: "_size_xl_vgjyx_80",
308
- iconOnly: "_iconOnly_vgjyx_89",
309
- shape_rectangle: "_shape_rectangle_vgjyx_98",
310
- shape_rounded: "_shape_rounded_vgjyx_102",
311
- shape_pill: "_shape_pill_vgjyx_106",
312
- shape_circle: "_shape_circle_vgjyx_110",
313
- shape_square: "_shape_square_vgjyx_122",
314
- color_primary: "_color_primary_vgjyx_140",
315
- color_secondary: "_color_secondary_vgjyx_150",
316
- color_success: "_color_success_vgjyx_160",
317
- color_error: "_color_error_vgjyx_170",
318
- color_warning: "_color_warning_vgjyx_180",
319
- color_info: "_color_info_vgjyx_190",
320
- color_neutral: "_color_neutral_vgjyx_200",
321
- variant_filled: "_variant_filled_vgjyx_211",
322
- disabled: "_disabled_vgjyx_217",
323
- disableElevation: "_disableElevation_vgjyx_225",
324
- variant_outlined: "_variant_outlined_vgjyx_235",
325
- variant_text: "_variant_text_vgjyx_254",
326
- variant_elevated: "_variant_elevated_vgjyx_270",
327
- variant_tonal: "_variant_tonal_vgjyx_288",
328
- loading: "_loading_vgjyx_312",
329
- fullWidth: "_fullWidth_vgjyx_316",
330
- disableTextTransform: "_disableTextTransform_vgjyx_320",
331
- showFocusRing: "_showFocusRing_vgjyx_331",
332
- content: "_content_vgjyx_338",
333
- loading_overlay: "_loading_overlay_vgjyx_346",
334
- loading_center: "_loading_center_vgjyx_347",
335
- icon: "_icon_vgjyx_89",
336
- loadingWrapper: "_loadingWrapper_vgjyx_365",
337
- loading_start: "_loading_start_vgjyx_377",
338
- loading_end: "_loading_end_vgjyx_378",
339
- spinner: "_spinner_vgjyx_383",
340
- spin: "_spin_vgjyx_383",
341
- srOnly: "_srOnly_vgjyx_394",
342
- group: "_group_vgjyx_414",
343
- orientation_horizontal: "_orientation_horizontal_vgjyx_419",
344
- orientation_vertical: "_orientation_vertical_vgjyx_423",
345
- groupFullWidth: "_groupFullWidth_vgjyx_427"
306
+ root: "_root_1mlby_6",
307
+ size_xxs: "_size_xxs_1mlby_45",
308
+ size_xs: "_size_xs_1mlby_52",
309
+ size_small: "_size_small_1mlby_59",
310
+ size_medium: "_size_medium_1mlby_66",
311
+ size_large: "_size_large_1mlby_73",
312
+ size_xl: "_size_xl_1mlby_80",
313
+ iconOnly: "_iconOnly_1mlby_89",
314
+ shape_rectangle: "_shape_rectangle_1mlby_98",
315
+ shape_rounded: "_shape_rounded_1mlby_102",
316
+ shape_pill: "_shape_pill_1mlby_106",
317
+ shape_circle: "_shape_circle_1mlby_110",
318
+ shape_square: "_shape_square_1mlby_122",
319
+ color_primary: "_color_primary_1mlby_140",
320
+ color_secondary: "_color_secondary_1mlby_150",
321
+ color_success: "_color_success_1mlby_160",
322
+ color_error: "_color_error_1mlby_170",
323
+ color_warning: "_color_warning_1mlby_180",
324
+ color_info: "_color_info_1mlby_190",
325
+ color_neutral: "_color_neutral_1mlby_200",
326
+ variant_filled: "_variant_filled_1mlby_211",
327
+ disabled: "_disabled_1mlby_217",
328
+ disableElevation: "_disableElevation_1mlby_225",
329
+ variant_outlined: "_variant_outlined_1mlby_235",
330
+ variant_text: "_variant_text_1mlby_254",
331
+ variant_elevated: "_variant_elevated_1mlby_270",
332
+ variant_tonal: "_variant_tonal_1mlby_288",
333
+ loading: "_loading_1mlby_312",
334
+ fullWidth: "_fullWidth_1mlby_316",
335
+ disableTextTransform: "_disableTextTransform_1mlby_320",
336
+ showFocusRing: "_showFocusRing_1mlby_331",
337
+ content: "_content_1mlby_338",
338
+ loading_overlay: "_loading_overlay_1mlby_346",
339
+ loading_center: "_loading_center_1mlby_347",
340
+ icon: "_icon_1mlby_89",
341
+ loadingWrapper: "_loadingWrapper_1mlby_365",
342
+ loading_start: "_loading_start_1mlby_377",
343
+ loading_end: "_loading_end_1mlby_378",
344
+ spinner: "_spinner_1mlby_383",
345
+ spin: "_spin_1mlby_383",
346
+ srOnly: "_srOnly_1mlby_394",
347
+ group: "_group_1mlby_414",
348
+ orientation_horizontal: "_orientation_horizontal_1mlby_419",
349
+ orientation_vertical: "_orientation_vertical_1mlby_423",
350
+ groupFullWidth: "_groupFullWidth_1mlby_427"
346
351
  }, nt = () => {
347
352
  let e = u();
348
353
  return /* @__PURE__ */ j("span", {
@@ -505,25 +510,28 @@ var B = class extends Error {
505
510
  }
506
511
  };
507
512
  function it(e) {
508
- let t = [], n = /* @__PURE__ */ new Set(), r = !1, i = 0, a = (r) => {
513
+ let t = [], n = /* @__PURE__ */ new Set(), r = !1, i = 0, a = () => {
514
+ let t = e.create();
515
+ return e.init !== void 0 && t.postMessage(e.init), {
516
+ worker: t,
517
+ started: !1
518
+ };
519
+ }, o = (r) => {
509
520
  n.delete(r), t.length < e.size ? t.push(r) : r.worker.terminate();
510
- }, o = (e) => {
521
+ }, s = (e) => {
511
522
  n.delete(e), e.worker.terminate();
512
523
  };
513
524
  return {
514
525
  get broken() {
515
526
  return r;
516
527
  },
517
- run(s, { signal: c, progress: l }) {
528
+ run(e, { signal: c, progress: l }) {
518
529
  return new Promise((u, d) => {
519
530
  if (r) return d(new B("unavailable", "Workers are unavailable"));
520
531
  if (c.aborted) return d(new DOMException("Aborted", "AbortError"));
521
532
  let f;
522
533
  try {
523
- f = t.pop() ?? {
524
- worker: e.create(),
525
- started: !1
526
- };
534
+ f = t.pop() ?? a();
527
535
  } catch (e) {
528
536
  return r = !0, d(new B("unavailable", `Worker could not be created: ${String(e)}`));
529
537
  }
@@ -534,24 +542,24 @@ function it(e) {
534
542
  let t = e.data;
535
543
  if (t && t.id === p) {
536
544
  if (f.started = !0, t.type === "progress") return l(t.fraction);
537
- m(), a(f), t.type === "done" ? u(t.buffer) : d(Error(t.message));
545
+ m(), o(f), t.type === "done" ? u(t.buffer) : d(Error(t.message));
538
546
  }
539
547
  }, g = (e) => {
540
- e.preventDefault?.(), m(), o(f), f.started ? d(Error(e.message || "The file worker stopped unexpectedly")) : (r = !0, d(new B("unavailable", e.message || "The file worker failed to start")));
548
+ e.preventDefault?.(), m(), s(f), f.started ? d(Error(e.message || "The file worker stopped unexpectedly")) : (r = !0, d(new B("unavailable", e.message || "The file worker failed to start")));
541
549
  }, _ = () => {
542
- m(), o(f), d(/* @__PURE__ */ Error("The file worker sent a message that could not be read"));
550
+ m(), s(f), d(/* @__PURE__ */ Error("The file worker sent a message that could not be read"));
543
551
  }, v = () => {
544
- m(), o(f), d(c.reason ?? new DOMException("Aborted", "AbortError"));
552
+ m(), s(f), d(c.reason ?? new DOMException("Aborted", "AbortError"));
545
553
  };
546
554
  f.worker.addEventListener("message", h), f.worker.addEventListener("error", g), f.worker.addEventListener("messageerror", _), c.addEventListener("abort", v);
547
555
  try {
548
556
  f.worker.postMessage({
549
557
  type: "run",
550
558
  id: p,
551
- task: s
559
+ task: e
552
560
  });
553
561
  } catch (e) {
554
- m(), a(f), d(new B("uncloneable", e instanceof Error ? e.message : String(e)));
562
+ m(), o(f), d(new B("uncloneable", e instanceof Error ? e.message : String(e)));
555
563
  }
556
564
  });
557
565
  },
@@ -566,7 +574,7 @@ var V = class extends Error {
566
574
  constructor(e, t) {
567
575
  super(t), this.name = "FileEngineError", this.code = e;
568
576
  }
569
- }, at = (e, t, n) => fe(e, pe(t.filename) + ue(t.format), t.format, n, t.title ?? t.filename), ot = () => typeof navigator > "u" ? void 0 : navigator.userActivation?.isActive, H = (e) => e instanceof Error ? e.message : String(e), st = () => new Worker(new URL("./assets/fileTask.worker-FQSUtwcz.js", import.meta.url), { type: "module" }), ct = () => typeof Worker < "u", lt = 0;
577
+ }, at = (e, t, n) => ue(e, me(t.filename) + pe(t.format), t.format, n, t.title ?? t.filename), ot = () => typeof navigator > "u" ? void 0 : navigator.userActivation?.isActive, H = (e) => e instanceof Error ? e.message : String(e), st = () => new Worker(new URL("./assets/fileTask.worker-BHT1olUk.js", import.meta.url), { type: "module" }), ct = () => typeof Worker < "u", lt = 0;
570
578
  function ut(e = {}) {
571
579
  let t = Me(e), n = e.deliver ?? at, r = `file-${++lt}-`, i = [], a = 0, o = !1, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), d = null, f = t.workers === "auto" && (!!e.createWorker || ct()), p = () => {
572
580
  if (!f) return null;
@@ -574,20 +582,30 @@ function ut(e = {}) {
574
582
  let n = typeof navigator < "u" && navigator.hardwareConcurrency ? navigator.hardwareConcurrency : t.concurrency;
575
583
  d = it({
576
584
  size: Math.max(1, Math.min(t.concurrency, n)),
577
- create: e.createWorker ?? st
585
+ create: e.createWorker ?? st,
586
+ ...e.pdfFonts ? { init: {
587
+ type: "init",
588
+ pdfFonts: e.pdfFonts
589
+ } } : {}
578
590
  });
579
591
  }
580
592
  return d;
581
- }, m = async (e, t, n) => {
582
- let r = p(), i;
583
- if (r && !r.broken) try {
584
- i = await r.run(e, n);
585
- } catch (t) {
586
- if (!(t instanceof B)) throw t;
587
- i = await he(e, n);
593
+ }, m = async (t, n, r) => {
594
+ let i = p(), a;
595
+ if (i && !i.broken) try {
596
+ a = await i.run(t, r);
597
+ } catch (n) {
598
+ if (!(n instanceof B)) throw n;
599
+ a = await he(t, {
600
+ ...r,
601
+ pdfFonts: e.pdfFonts
602
+ });
588
603
  }
589
- else i = await he(e, n);
590
- return new Blob([i], { type: me[t] });
604
+ else a = await he(t, {
605
+ ...r,
606
+ pdfFonts: e.pdfFonts
607
+ });
608
+ return new Blob([a], { type: fe[n] });
591
609
  }, h = (e) => i.find((t) => t.id === e), g = () => u.forEach((e) => e()), _ = (e, t) => {
592
610
  i = i.map((n) => n.id === e ? {
593
611
  ...n,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { A as e, C as t, Cn as n, D as r, E as i, En as a, F as o, G as s, J as c, K as l, L as u, M as d, N as f, O as p, R as m, S as h, T as g, Tn as _, W as v, X as y, Y as b, Z as x, _ as S, b as C, c as w, ct as T, d as E, f as D, ft as O, g as k, h as A, i as j, j as M, k as N, l as P, m as F, o as I, ot as L, p as R, q as z, r as B, s as V, t as H, u as ee, v as U, vt as te, w as ne, y as re, z as ie } from "./geometry-ChwYB45B.js";
2
+ import { A as e, C as t, Cn as n, D as r, E as i, En as a, F as o, G as s, J as c, K as l, L as u, M as d, N as f, O as p, R as m, S as h, T as g, Tn as _, W as v, X as y, Y as b, Z as x, _ as S, b as C, c as w, ct as T, d as E, f as D, ft as O, g as k, h as A, i as j, j as M, k as N, l as P, m as F, o as I, ot as L, p as R, q as z, r as B, s as V, t as H, u as ee, v as U, vt as te, w as ne, y as re, z as ie } from "./geometry-yZmKN662.js";
3
3
  import { useCallback as W, useEffect as ae, useLayoutEffect as G, useMemo as oe, useRef as K, useState as q } from "react";
4
4
  import { Fragment as se, jsx as J, jsxs as Y } from "react/jsx-runtime";
5
5
  import { createPortal as ce } from "react-dom";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { t as e } from "./ChartView-nS4f4EU_.js";
3
- import { n as t } from "./summaryChartData-pNvzaEHp.js";
2
+ import { t as e } from "./ChartView-CW3m4Z_1.js";
3
+ import { n as t } from "./summaryChartData-CARqGRUl.js";
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  // src/components/DataTable/summary/SummaryChart.tsx
6
6
  var r = {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { t as e } from "./ChartImageMenu-CuuFnW9q.js";
3
- import { n as t } from "./summaryChartData-pNvzaEHp.js";
2
+ import { t as e } from "./ChartImageMenu-AsfvmdTH.js";
3
+ import { n as t } from "./summaryChartData-CARqGRUl.js";
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  // src/components/DataTable/summary/SummaryImage.tsx
6
6
  function r({ item: r, report: i, context: a, branding: o, format: s, locale: c, labels: l }) {
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { t as e } from "./ChartImageMenu-CuuFnW9q.js";
3
- import { t } from "./ChartView-nS4f4EU_.js";
4
- import { J as n, Tt as r, U as i, ot as a } from "./geometry-ChwYB45B.js";
5
- import { n as o, o as s, s as c } from "./scrollArea-DAlVT5U7.js";
6
- import { r as l, t as u } from "./summaryChartData-pNvzaEHp.js";
2
+ import { t as e } from "./ChartImageMenu-AsfvmdTH.js";
3
+ import { t } from "./ChartView-CW3m4Z_1.js";
4
+ import { J as n, Tt as r, U as i, ot as a } from "./geometry-yZmKN662.js";
5
+ import { n as o, o as s, s as c } from "./scrollArea-Dd2dNMV4.js";
6
+ import { r as l, t as u } from "./summaryChartData-CARqGRUl.js";
7
7
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
8
  // src/components/DataTable/summary/SummarySeeAll.tsx
9
9
  function m({ item: m, all: h, onClose: g, onSelect: _, image: v, labels: y }) {
@@ -0,0 +1 @@
1
+ const e=()=>new DOMException(`Aborted`,`AbortError`);async function t(t,n){if(n.signal?.aborted)throw e();switch(t.kind){case`xlsx`:return l(t.workbook,n);case`pdf`:return p(t,n);default:throw Error(`Unknown file task: ${t.kind}`)}}const n=globalThis;async function r(){let e=await import(`exceljs`),t=[e.default?.default,e.default,e,n.ExcelJS].find(e=>e&&typeof e.Workbook==`function`);if(!t)throw Error(`ExcelJS did not load`);return t}async function i(){let e=await import(`pdfmake/build/pdfmake.js`),t=[e.default?.default,e.default,e,n.pdfMake].find(e=>e&&typeof e.createPdf==`function`);if(!t)throw Error(`pdfmake did not load`);let r=await import(`pdfmake/build/vfs_fonts.js`);return{pdfMake:t,vfs:[r?.default,r,r?.pdfMake?.vfs,r?.default?.pdfMake?.vfs,t.vfs,n.pdfMake?.vfs].find(e=>e&&e[`Roboto-Regular.ttf`])}}const a=e=>ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e,o=e=>`FF`+e.replace(`#`,``).toUpperCase();function s(e,t){if(t&&((t.bold!==void 0||t.italic!==void 0||t.size||t.color)&&(e.font={...e.font??{},...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.size?{size:t.size}:{},...t.color?{color:{argb:o(t.color)}}:{}}),t.fill&&(e.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:o(t.fill)}}),t.align&&(e.alignment={horizontal:t.align,vertical:`middle`}),t.numFmt&&(typeof e.value==`number`||e.value instanceof Date)&&(e.numFmt=t.numFmt),t.borderTop||t.borderBottom)){let n=e=>({style:e.style,...e.color?{color:{argb:o(e.color)}}:{}});e.border={...t.borderTop?{top:n(t.borderTop)}:{},...t.borderBottom?{bottom:n(t.borderBottom)}:{}}}}function c(e,t,n){let r=e.addRow(t.values);t.style?.bold&&(r.font={bold:!0}),t.merge&&n>1&&e.mergeCells(r.number,1,r.number,n);let i=t.merge?1:Math.max(t.values.length,0);for(let e=0;e<i;e++){let n=r.getCell(e+1);s(n,t.style),s(n,t.cells?.[e])}}async function l(t,n){let i=new(await(r())).Workbook,l=Math.max(1,t.sheets.reduce((e,t)=>e+t.rows.length,0)),u=Math.max(1,Math.floor(l/50)),d=0;for(let r of t.sheets){let t=i.addWorksheet(r.name),a=r.columns.length;t.columns=r.columns.map((e,t)=>({key:String(t),width:e.width}));for(let e of r.before??[])c(t,e,a);let f=t.addRow(r.columns.map(e=>e.header));f.font={bold:r.headerStyle?.bold??!0},f.eachCell((e,t)=>{let n=r.columns[t-1]?.align;n&&(e.alignment={horizontal:n,vertical:`middle`}),s(e,r.headerStyle)});let p=f.number;r.freeze?t.views=[{state:`frozen`,ySplit:r.freeze.rows??0,xSplit:r.freeze.cols??0}]:r.freezeHeader!==!1&&(t.views=[{state:`frozen`,ySplit:p}]),r.rows.forEach((i,a)=>{let c=t.addRow(i),f=r.cellStyles?.[a],p=r.stripe&&a%2==1;if(r.columns.forEach((e,t)=>{let n=c.getCell(t+1);e.numFmt&&(typeof n.value==`number`||n.value instanceof Date)&&(n.numFmt=e.numFmt),e.align&&(n.alignment={horizontal:e.align,vertical:`middle`}),p&&(n.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:o(r.stripe)}}),s(n,e.style),s(n,f?.[t])}),++d%u===0){if(n.signal?.aborted)throw e();n.progress(d/l*.9)}}),r.autoFilter&&r.rows.length>0&&(t.autoFilter={from:{row:p,column:1},to:{row:p,column:a}});for(let e of r.after??[])c(t,e,a)}let f=await i.xlsx.writeBuffer();return n.progress(1),a(f)}const u={Roboto:{normal:`Roboto-Regular.ttf`,bold:`Roboto-Medium.ttf`,italics:`Roboto-Italic.ttf`,bolditalics:`Roboto-MediumItalic.ttf`}};function d(e){let t=e.hLineWidth??1,n=e.edgeLineWidth??t;return{hLineWidth:(e,r)=>e===0||e===(r.table.headerRows??0)||e===r.table.body.length?n:t,vLineWidth:()=>e.vLineWidth??1,...e.hLineColor?{hLineColor:()=>e.hLineColor}:{},...e.vLineColor?{vLineColor:()=>e.vLineColor}:{},...e.paddingX===void 0?{}:{paddingLeft:()=>e.paddingX,paddingRight:()=>e.paddingX},...e.paddingY===void 0?{}:{paddingTop:()=>e.paddingY,paddingBottom:()=>e.paddingY}}}function f(e){return(t,n)=>({text:e.text.replace(/\{page\}/g,String(t)).replace(/\{pages\}/g,String(n)),...e.font?{font:e.font}:{},alignment:e.alignment??`center`,fontSize:e.fontSize??8,...e.color?{color:e.color}:{},...e.margin?{margin:e.margin}:{}})}async function p(t,n){let r=n.pdfFonts?{fonts:{...n.pdfFonts.fonts,...t.fonts?.fonts},vfs:n.pdfFonts.vfs||t.fonts?.vfs?{...n.pdfFonts.vfs,...t.fonts?.vfs}:void 0}:t.fonts,a=t.footer?{...t.document,footer:f(t.footer)}:t.document,o=t.tableLayouts?Object.fromEntries(Object.entries(t.tableLayouts).map(([e,t])=>[e,d(t)])):void 0,{pdfMake:s,vfs:c}=await i();if(n.progress(.1),n.signal?.aborted)throw e();let l={...u,...r?.fonts??{}},p=r?.vfs?{...c??{},...r.vfs}:c,m=await new Promise((e,t)=>{try{let n=s.createPdf(a,o,l,p).getStream(),r=[];n.on(`data`,e=>r.push(e)),n.on(`error`,t),n.on(`end`,()=>{let t=new Uint8Array(r.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let e of r)t.set(e,n),n+=e.byteLength;e(t.buffer)}),n.end()}catch(e){t(e)}});return n.progress(1),m}let m;const h=self;h.onmessage=async e=>{if(e.data.type===`init`){m=e.data.pdfFonts;return}let{id:n,task:r}=e.data;try{let e=await t(r,{progress:e=>h.postMessage({type:`progress`,id:n,fraction:e}),pdfFonts:m});h.postMessage({type:`done`,id:n,buffer:e},[e])}catch(e){h.postMessage({type:`error`,id:n,message:e instanceof Error?e.message:String(e)})}};
@@ -515,7 +515,7 @@ function ge(e) {
515
515
  })), t;
516
516
  }
517
517
  function _e(e) {
518
- let t = e.selection;
518
+ let t = e.selection === void 0 ? "onDemand" : e.selection;
519
519
  return t ? t === !0 || t === "onDemand" ? {
520
520
  ...G,
521
521
  show: "onDemand"
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as e, d as t, r as n, s as r } from "./columnValue-K98ElfJc.js";
2
+ import { a as e, d as t, r as n, s as r } from "./columnValue-DwUqueZ6.js";
3
3
  import { r as i, t as a } from "./labels-CnqqTrne.js";
4
4
  // src/core/logic/exportSafety.logic.ts
5
5
  var o = /^[=+\-@\t\r]/, s = (e) => o.test(e) ? `'${e}` : e, c = (e) => e === "xlsx" || e === "json" || e === "xml" ? "typed" : "text";