@dcs-tech/ui 0.4.0 → 0.6.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 (65) hide show
  1. package/dist/ChartImageMenu-CuuFnW9q.js +1481 -0
  2. package/dist/{ChartView-Cehrcr05.js → ChartView-nS4f4EU_.js} +514 -514
  3. package/dist/{SummaryChart-y27q_BBN.js → SummaryChart-CVg6i2mx.js} +2 -2
  4. package/dist/{SummaryImage-DDNEEu_K.js → SummaryImage-CoEFzMl6.js} +2 -2
  5. package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-C_OUs3kn.js} +5 -5
  6. package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
  7. package/dist/columnValue-K98ElfJc.js +610 -0
  8. package/dist/exportContext-CJaIv8R-.js +166 -0
  9. package/dist/{exportEngine-DL-jEXFU.js → exportEngine-CDLYHH0d.js} +137 -133
  10. package/dist/fileActions-KSaVGnaE.js +144 -0
  11. package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
  12. package/dist/index.js +8572 -8435
  13. package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
  14. package/dist/runFileTask-BClLQjmv.js +109 -0
  15. package/dist/scrollArea-DAlVT5U7.js +214 -0
  16. package/dist/style.css +1 -1
  17. package/dist/{summaryChartData-Djo73zb8.js → summaryChartData-pNvzaEHp.js} +1 -1
  18. package/dist/types/components/Charts/parts.d.ts +1 -1
  19. package/dist/types/components/Collapsible/index.d.ts +1 -1
  20. package/dist/types/components/DataTable/DataTable.d.ts +1 -1
  21. package/dist/types/components/DataTable/cards/cardFields.d.ts +2 -4
  22. package/dist/types/components/DataTable/columnValue.d.ts +19 -0
  23. package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
  24. package/dist/types/components/DataTable/export/exportEngine.d.ts +2 -0
  25. package/dist/types/components/DataTable/export/useTableExport.d.ts +2 -0
  26. package/dist/types/components/DataTable/host.d.ts +2 -0
  27. package/dist/types/components/DataTable/index.d.ts +1 -1
  28. package/dist/types/components/DataTable/labels.d.ts +2 -0
  29. package/dist/types/components/DataTable/types.d.ts +11 -0
  30. package/dist/types/components/DataTable/useTable.d.ts +4 -1
  31. package/dist/types/components/DataTable/vendor/index.d.ts +1 -1
  32. package/dist/types/components/EditableTable/EditableTableCell.d.ts +1 -1
  33. package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
  34. package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -0
  35. package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
  36. package/dist/types/components/FileEngine/index.d.ts +8 -0
  37. package/dist/types/components/FileEngine/labels.d.ts +29 -0
  38. package/dist/types/components/Toast/ToastHost.d.ts +1 -0
  39. package/dist/types/components/UIProvider/UIFormatContext.d.ts +7 -0
  40. package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
  41. package/dist/types/components/UIProvider/UIProvider.d.ts +6 -1
  42. package/dist/types/components/UIProvider/index.d.ts +4 -0
  43. package/dist/types/core/logic/collapsible.logic.d.ts +6 -1
  44. package/dist/types/core/logic/datePicker.logic.d.ts +5 -0
  45. package/dist/types/core/logic/exportSafety.logic.d.ts +1 -0
  46. package/dist/types/core/logic/fileQueue.logic.d.ts +28 -0
  47. package/dist/types/core/logic/format.logic.d.ts +4 -0
  48. package/dist/types/core/logic/index.d.ts +4 -0
  49. package/dist/types/core/logic/tableDate.logic.d.ts +7 -0
  50. package/dist/types/core/logic/tableSummary.logic.d.ts +2 -2
  51. package/dist/types/core/types/collapsible.types.d.ts +4 -16
  52. package/dist/types/core/types/fileEngine.types.d.ts +65 -0
  53. package/dist/types/core/types/format.types.d.ts +15 -0
  54. package/dist/types/core/types/index.d.ts +2 -0
  55. package/dist/types/core/types/table.types.d.ts +1 -0
  56. package/dist/types/{components/DataTable/vendor → file}/fileActions.d.ts +17 -7
  57. package/dist/types/file/fileEngine.d.ts +48 -0
  58. package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
  59. package/dist/types/file/tasks/runFileTask.d.ts +6 -0
  60. package/dist/types/file/workerPool.d.ts +17 -0
  61. package/dist/types/index.d.ts +9 -2
  62. package/package.json +1 -1
  63. package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
  64. package/dist/exportContext-CdpsOzE8.js +0 -235
  65. package/dist/scrollArea-CkPGDYH2.js +0 -210
@@ -460,6 +460,8 @@ var e = {
460
460
  exportPreviewLoadFailed: "Could not load the rows to preview",
461
461
  exportLoadFailed: "Could not load the rows to export",
462
462
  exportGenerationFailed: "Export generation failed",
463
+ exportCancelled: (e) => `${e}: export cancelled`,
464
+ exportAwaitingClick: (e) => `${e} is ready — use the button in the notification to finish`,
463
465
  exportValidationFailed: "Validation failed",
464
466
  exportCapped: (e, t) => `Exported the first ${e} of ${t} matching rows — narrow the filters to export the rest.`,
465
467
  exportBusiness: "Business",
@@ -627,82 +629,4 @@ function n(e) {
627
629
  number: (e) => t.format(e)
628
630
  };
629
631
  }
630
- var r = {
631
- pageSize: 25,
632
- pageSizeOptions: [
633
- 25,
634
- 50,
635
- 100,
636
- 500,
637
- -1
638
- ]
639
- }, i = {
640
- multiSort: !1,
641
- defaultSort: []
642
- }, a = { advanced: !0 }, o = [
643
- "xlsx",
644
- "pdf",
645
- "csv",
646
- "html",
647
- "json"
648
- ], s = { mode: "multiple" };
649
- function c() {
650
- return {
651
- id: m(),
652
- logic: "AND",
653
- conditions: []
654
- };
655
- }
656
- function l(e) {
657
- return e.pagination === !1 ? !1 : e.pagination === !0 || e.pagination === void 0 ? r : {
658
- ...r,
659
- ...e.pagination
660
- };
661
- }
662
- function u(e) {
663
- return e.sorting === !1 ? !1 : e.sorting === !0 || e.sorting === void 0 ? i : {
664
- ...i,
665
- ...e.sorting
666
- };
667
- }
668
- function d(e) {
669
- return e.filtering === !1 ? !1 : e.filtering === !0 || e.filtering === void 0 ? a : {
670
- ...a,
671
- ...e.filtering
672
- };
673
- }
674
- function f(e) {
675
- if (!e.export) return !1;
676
- let t = { ...e.export };
677
- return t.quick && (t.quick.enabled === void 0 && (t.quick = {
678
- ...t.quick,
679
- enabled: !0
680
- }), t.quick.formats || (t.quick = {
681
- ...t.quick,
682
- formats: o
683
- }), t.quick.fileNameAs || (t.quick = {
684
- ...t.quick,
685
- fileNameAs: "title-date-generated"
686
- })), t;
687
- }
688
- function p(e) {
689
- let t = e.selection;
690
- return t ? t === !0 || t === "onDemand" ? {
691
- ...s,
692
- show: "onDemand"
693
- } : t === "always" ? {
694
- ...s,
695
- show: "always"
696
- } : {
697
- ...s,
698
- ...t,
699
- show: t.show ?? "onDemand"
700
- } : !1;
701
- }
702
- function m() {
703
- return Math.random().toString(36).substring(2, 10);
704
- }
705
- function h(e, t) {
706
- return t.split(".").reduce((e, t) => e?.[t], e);
707
- }
708
- export { d as a, u as c, t as d, f as i, e as l, m as n, l as o, h as r, p as s, c as t, n as u };
632
+ export { n, t as r, e as t };
@@ -0,0 +1,109 @@
1
+ "use client";
2
+ // \0rolldown/runtime.js
3
+ var e = Object.defineProperty, t = (t, n) => {
4
+ let r = {};
5
+ for (var i in t) e(r, i, {
6
+ get: t[i],
7
+ enumerable: !0
8
+ });
9
+ return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
10
+ }, n = /* @__PURE__ */ t({ runFileTask: () => i }), r = () => new DOMException("Aborted", "AbortError");
11
+ async function i(e, t) {
12
+ if (t.signal?.aborted) throw r();
13
+ switch (e.kind) {
14
+ case "xlsx": return l(e.workbook, t);
15
+ case "pdf": return d(e.document, e.fonts, t);
16
+ default: throw Error(`Unknown file task: ${e.kind}`);
17
+ }
18
+ }
19
+ var a = globalThis;
20
+ async function o() {
21
+ let e = await import("exceljs"), t = [
22
+ e.default?.default,
23
+ e.default,
24
+ e,
25
+ a.ExcelJS
26
+ ].find((e) => e && typeof e.Workbook == "function");
27
+ if (!t) throw Error("ExcelJS did not load");
28
+ return t;
29
+ }
30
+ async function s() {
31
+ let e = await import("pdfmake/build/pdfmake.js"), t = [
32
+ e.default?.default,
33
+ e.default,
34
+ e,
35
+ a.pdfMake
36
+ ].find((e) => e && typeof e.createPdf == "function");
37
+ if (!t) throw Error("pdfmake did not load");
38
+ let n = await import("pdfmake/build/vfs_fonts.js");
39
+ return {
40
+ pdfMake: t,
41
+ vfs: [
42
+ n?.default,
43
+ n,
44
+ n?.pdfMake?.vfs,
45
+ n?.default?.pdfMake?.vfs,
46
+ t.vfs,
47
+ a.pdfMake?.vfs
48
+ ].find((e) => e && e["Roboto-Regular.ttf"])
49
+ };
50
+ }
51
+ var c = (e) => ArrayBuffer.isView(e) ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : e;
52
+ async function l(e, t) {
53
+ let n = new (await (o())).Workbook(), i = Math.max(1, e.sheets.reduce((e, t) => e + t.rows.length, 0)), a = Math.max(1, Math.floor(i / 50)), s = 0;
54
+ for (let o of e.sheets) {
55
+ let e = n.addWorksheet(o.name);
56
+ e.columns = o.columns.map((e, t) => ({
57
+ key: String(t),
58
+ width: e.width
59
+ }));
60
+ let c = e.addRow(o.columns.map((e) => e.header));
61
+ o.freezeHeader !== !1 && (c.font = { bold: !0 }, e.views = [{
62
+ state: "frozen",
63
+ ySplit: 1
64
+ }]);
65
+ for (let n of o.rows) {
66
+ let c = e.addRow(n);
67
+ if (o.columns.forEach((e, t) => {
68
+ if (!e.numFmt && !e.align) return;
69
+ let n = c.getCell(t + 1);
70
+ e.numFmt && (n.numFmt = e.numFmt), e.align && (n.alignment = { horizontal: e.align });
71
+ }), ++s % a === 0) {
72
+ if (t.signal?.aborted) throw r();
73
+ t.progress(s / i * .9);
74
+ }
75
+ }
76
+ }
77
+ let l = await n.xlsx.writeBuffer();
78
+ return t.progress(1), c(l);
79
+ }
80
+ var u = { Roboto: {
81
+ normal: "Roboto-Regular.ttf",
82
+ bold: "Roboto-Medium.ttf",
83
+ italics: "Roboto-Italic.ttf",
84
+ bolditalics: "Roboto-MediumItalic.ttf"
85
+ } };
86
+ async function d(e, t, n) {
87
+ let { pdfMake: i, vfs: a } = await s();
88
+ if (n.progress(.1), n.signal?.aborted) throw r();
89
+ let o = {
90
+ ...u,
91
+ ...t?.fonts ?? {}
92
+ }, c = t?.vfs ? {
93
+ ...a ?? {},
94
+ ...t.vfs
95
+ } : a, l = await new Promise((t, n) => {
96
+ try {
97
+ let r = i.createPdf(e, void 0, o, c).getStream(), a = [];
98
+ r.on("data", (e) => a.push(e)), r.on("error", n), r.on("end", () => {
99
+ let e = new Uint8Array(a.reduce((e, t) => e + t.byteLength, 0)), n = 0;
100
+ for (let t of a) e.set(t, n), n += t.byteLength;
101
+ t(e.buffer);
102
+ }), r.end();
103
+ } catch (e) {
104
+ n(e);
105
+ }
106
+ });
107
+ return n.progress(1), l;
108
+ }
109
+ export { n, t as r, i as t };
@@ -0,0 +1,214 @@
1
+ "use client";
2
+ import { Nn as e, wn as t } from "./geometry-ChwYB45B.js";
3
+ import { n, t as r } from "./labels-CnqqTrne.js";
4
+ import { createContext as i, useCallback as a, useContext as o, useEffect as s, useId as ee, useRef as c, useState as l } from "react";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ import { createPortal as te } from "react-dom";
7
+ var f = {
8
+ root: "_root_1rswg_7",
9
+ nonModal: "_nonModal_1rswg_30",
10
+ panel: "_panel_1rswg_3",
11
+ center: "_center_1rswg_41",
12
+ right: "_right_1rswg_42",
13
+ left: "_left_1rswg_43",
14
+ top: "_top_1rswg_44",
15
+ bottom: "_bottom_1rswg_45",
16
+ sm: "_sm_1rswg_86",
17
+ md: "_md_1rswg_87",
18
+ lg: "_lg_1rswg_88",
19
+ xl: "_xl_1rswg_89",
20
+ full: "_full_1rswg_90",
21
+ header: "_header_1rswg_96",
22
+ headText: "_headText_1rswg_106",
23
+ title: "_title_1rswg_108",
24
+ subtitle: "_subtitle_1rswg_114",
25
+ body: "_body_1rswg_120",
26
+ flush: "_flush_1rswg_128",
27
+ footer: "_footer_1rswg_130",
28
+ close: "_close_1rswg_141",
29
+ dialogPop: "_dialogPop_1rswg_1",
30
+ slideFromRight: "_slideFromRight_1rswg_1",
31
+ slideFromLeft: "_slideFromLeft_1rswg_1",
32
+ slideFromTop: "_slideFromTop_1rswg_1",
33
+ slideFromBottom: "_slideFromBottom_1rswg_1",
34
+ backdropIn: "_backdropIn_1rswg_1",
35
+ closing: "_closing_1rswg_168"
36
+ }, p = 0, m = null, h = (e) => {
37
+ if (typeof document < "u") {
38
+ if (p === 0) {
39
+ let t = document.body;
40
+ m = {
41
+ overflow: t.style.overflow,
42
+ paddingRight: t.style.paddingRight
43
+ };
44
+ let n = window.innerWidth - document.documentElement.clientWidth;
45
+ if (e && n > 0) {
46
+ let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
47
+ t.style.paddingRight = `${e + n}px`;
48
+ }
49
+ t.style.overflow = "hidden";
50
+ }
51
+ p += 1;
52
+ }
53
+ }, g = () => {
54
+ typeof document < "u" && (p = Math.max(0, p - 1), p === 0 && m && (document.body.style.overflow = m.overflow, document.body.style.paddingRight = m.paddingRight, m = null));
55
+ }, _ = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, ne = /* @__PURE__ */ d("svg", {
56
+ width: "16",
57
+ height: "16",
58
+ viewBox: "0 0 24 24",
59
+ fill: "none",
60
+ stroke: "currentColor",
61
+ strokeWidth: "2",
62
+ strokeLinecap: "round",
63
+ "aria-hidden": "true",
64
+ children: [/* @__PURE__ */ u("line", {
65
+ x1: "18",
66
+ y1: "6",
67
+ x2: "6",
68
+ y2: "18"
69
+ }), /* @__PURE__ */ u("line", {
70
+ x1: "6",
71
+ y1: "6",
72
+ x2: "18",
73
+ y2: "18"
74
+ })]
75
+ }), v = ({ open: n, onClose: r, onBeforeClose: i, onEscKeyDown: o, onOverlayClick: p, onAnimationEnd: m, children: v, title: y, subtitle: b, footer: x, modal: S = !0, placement: C = "center", size: w = "md", closeOnBackdrop: re = !0, closeOnEscape: T = !0, showCloseButton: E = !0, closeIcon: D, closeIconId: O, blockScroll: k = !0, reserveScrollBarGap: A = !0, initialFocusRef: j, container: ie, animationDuration: ae = 200, padded: oe = !0, classNames: M = {}, styleSlots: N = {}, className: P = "", style: F, role: I = "dialog", id: L, "aria-label": R, "aria-labelledby": z, "aria-describedby": B }) => {
76
+ let V = e(), H = c(null), [U, W] = l(null), G = ee(), [K, q] = l(n), [se, J] = l(!1), Y = c(null), X = _() ? 0 : ae;
77
+ s(() => {
78
+ n ? (Y.current &&= (clearTimeout(Y.current), null), J(!1), q(!0)) : K && (J(!0), Y.current = setTimeout(() => {
79
+ H.current?.close(), q(!1), J(!1), m?.();
80
+ }, X));
81
+ }, [n]), s(() => () => {
82
+ Y.current && clearTimeout(Y.current);
83
+ }, []);
84
+ let Z = a(() => {
85
+ i && i() === !1 || r?.();
86
+ }, [i, r]);
87
+ s(() => {
88
+ let e = H.current;
89
+ if (e && K && (e.open || (S ? e.showModal() : e.show(), j?.current && j.current.focus({ focusVisible: !0 })), k && S)) return h(A), () => g();
90
+ }, [
91
+ K,
92
+ S,
93
+ k,
94
+ A,
95
+ j
96
+ ]), s(() => {
97
+ let e = H.current;
98
+ if (!e || !K) return;
99
+ let t = (e) => {
100
+ e.preventDefault(), o?.(e), T && Z();
101
+ };
102
+ return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
103
+ }, [
104
+ K,
105
+ T,
106
+ Z,
107
+ o
108
+ ]);
109
+ let Q = c(!1), ce = (e) => {
110
+ Q.current = e.target === H.current;
111
+ }, le = (e) => {
112
+ let t = Q.current && e.target === H.current;
113
+ Q.current = !1, t && (p?.(e), re && Z());
114
+ };
115
+ if (!K) return null;
116
+ let ue = y !== void 0 || b !== void 0 || E, de = z ?? (y !== void 0 && !R ? G : void 0), fe = /* @__PURE__ */ u("dialog", {
117
+ ref: (e) => {
118
+ H.current = e, W(e);
119
+ },
120
+ id: L,
121
+ className: [
122
+ f.root,
123
+ f[C],
124
+ f[w],
125
+ S ? "" : f.nonModal,
126
+ se ? f.closing : "",
127
+ M.root,
128
+ P
129
+ ].filter(Boolean).join(" "),
130
+ style: {
131
+ "--dialog-anim": `${X}ms`,
132
+ ...N.root,
133
+ ...F
134
+ },
135
+ role: I,
136
+ "aria-label": R,
137
+ "aria-labelledby": de,
138
+ "aria-describedby": B,
139
+ "aria-modal": S || void 0,
140
+ onPointerDown: ce,
141
+ onPointerUp: le,
142
+ children: /* @__PURE__ */ u(t.Provider, {
143
+ value: U,
144
+ children: /* @__PURE__ */ d("div", {
145
+ className: [f.panel, M.panel].filter(Boolean).join(" "),
146
+ style: N.panel,
147
+ children: [
148
+ ue && /* @__PURE__ */ d("div", {
149
+ className: [f.header, M.header].filter(Boolean).join(" "),
150
+ style: N.header,
151
+ children: [/* @__PURE__ */ d("span", {
152
+ className: f.headText,
153
+ children: [y !== void 0 && /* @__PURE__ */ u("span", {
154
+ className: f.title,
155
+ id: G,
156
+ children: y
157
+ }), b !== void 0 && /* @__PURE__ */ u("span", {
158
+ className: f.subtitle,
159
+ children: b
160
+ })]
161
+ }), E && /* @__PURE__ */ u("button", {
162
+ type: "button",
163
+ id: O,
164
+ className: [f.close, M.closeButton].filter(Boolean).join(" "),
165
+ style: N.closeButton,
166
+ onClick: Z,
167
+ "aria-label": V.dialog.close,
168
+ children: D ?? ne
169
+ })]
170
+ }),
171
+ v !== void 0 && /* @__PURE__ */ u("div", {
172
+ className: [
173
+ f.body,
174
+ oe ? "" : f.flush,
175
+ M.body
176
+ ].filter(Boolean).join(" "),
177
+ style: N.body,
178
+ children: v
179
+ }),
180
+ x !== void 0 && /* @__PURE__ */ u("div", {
181
+ className: [f.footer, M.footer].filter(Boolean).join(" "),
182
+ style: N.footer,
183
+ children: x
184
+ })
185
+ ]
186
+ })
187
+ })
188
+ }), $ = ie ?? (typeof document > "u" ? null : document.body);
189
+ return $ ? te(fe, $) : null;
190
+ };
191
+ v.displayName = "Dialog";
192
+ var y = i({
193
+ authorize: () => !0,
194
+ exportOptions: {},
195
+ serverMode: !1,
196
+ labels: r,
197
+ format: n(),
198
+ text: {
199
+ yes: r.yes,
200
+ no: r.no
201
+ }
202
+ });
203
+ function b() {
204
+ return o(y);
205
+ }
206
+ function x() {
207
+ return o(y).labels;
208
+ }
209
+ function S(e, t, n) {
210
+ return !e || e(t, n) !== !1;
211
+ }
212
+ // src/components/DataTable/layout/scrollArea.ts
213
+ var C = "dt-scroll-area scroll-fade-y scroll-gutter", w = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
214
+ export { x as a, S as i, C as n, b as o, y as r, v as s, w as t };