@dcs-tech/ui 0.4.0 → 0.7.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.
- package/README.md +27 -0
- package/dist/ChartImageMenu-C6MwKKjc.js +1494 -0
- package/dist/{ChartView-Cehrcr05.js → ChartView-nS4f4EU_.js} +514 -514
- package/dist/{SummaryChart-y27q_BBN.js → SummaryChart-CVg6i2mx.js} +2 -2
- package/dist/{SummaryImage-DDNEEu_K.js → SummaryImage-OHJHjCqe.js} +2 -2
- package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-BYrvXSJ6.js} +5 -5
- package/dist/assets/fileTask.worker-BHT1olUk.js +1 -0
- package/dist/columnValue-K98ElfJc.js +610 -0
- package/dist/exportContext-CJaIv8R-.js +166 -0
- package/dist/{exportEngine-DL-jEXFU.js → exportEngine-S8JHzYbS.js} +355 -356
- package/dist/file-worker.js +1 -0
- package/dist/fileActions-COf5Q4Eg.js +144 -0
- package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
- package/dist/index.js +8817 -8596
- package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
- package/dist/runFileTask--4YjQH7Y.js +210 -0
- package/dist/scrollArea-DAlVT5U7.js +214 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-Djo73zb8.js → summaryChartData-pNvzaEHp.js} +1 -1
- package/dist/types/components/Charts/parts.d.ts +1 -1
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/cards/cardFields.d.ts +2 -4
- package/dist/types/components/DataTable/columnValue.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
- package/dist/types/components/DataTable/export/exportEngine.d.ts +13 -4
- package/dist/types/components/DataTable/export/useTableExport.d.ts +2 -0
- package/dist/types/components/DataTable/host.d.ts +2 -0
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DataTable/labels.d.ts +2 -0
- package/dist/types/components/DataTable/types.d.ts +11 -0
- package/dist/types/components/DataTable/useTable.d.ts +4 -1
- package/dist/types/components/DataTable/vendor/index.d.ts +1 -1
- package/dist/types/components/Dialog/DialogHost.d.ts +1 -0
- package/dist/types/components/EditableTable/EditableTableCell.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +31 -0
- package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
- package/dist/types/components/FileEngine/index.d.ts +8 -0
- package/dist/types/components/FileEngine/labels.d.ts +29 -0
- package/dist/types/components/Toast/ToastHost.d.ts +1 -0
- package/dist/types/components/UIProvider/UIFormatContext.d.ts +7 -0
- package/dist/types/components/UIProvider/UIHostContext.d.ts +20 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +8 -1
- package/dist/types/components/UIProvider/index.d.ts +6 -0
- package/dist/types/core/logic/collapsible.logic.d.ts +6 -1
- package/dist/types/core/logic/datePicker.logic.d.ts +5 -0
- package/dist/types/core/logic/exportSafety.logic.d.ts +1 -0
- package/dist/types/core/logic/fileQueue.logic.d.ts +28 -0
- package/dist/types/core/logic/format.logic.d.ts +4 -0
- package/dist/types/core/logic/index.d.ts +4 -0
- package/dist/types/core/logic/tableDate.logic.d.ts +7 -0
- package/dist/types/core/logic/tableSummary.logic.d.ts +2 -2
- package/dist/types/core/types/collapsible.types.d.ts +4 -16
- package/dist/types/core/types/fileEngine.types.d.ts +116 -0
- package/dist/types/core/types/form.types.d.ts +4 -0
- package/dist/types/core/types/format.types.d.ts +15 -0
- package/dist/types/core/types/index.d.ts +2 -0
- package/dist/types/core/types/table.types.d.ts +1 -0
- package/dist/types/{components/DataTable/vendor → file}/fileActions.d.ts +17 -7
- package/dist/types/file/fileEngine.d.ts +49 -0
- package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
- package/dist/types/file/tasks/runFileTask.d.ts +9 -0
- package/dist/types/file/workerPool.d.ts +18 -0
- package/dist/types/index.d.ts +11 -2
- package/package.json +3 -2
- package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
- package/dist/exportContext-CdpsOzE8.js +0 -235
- 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
|
-
|
|
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,210 @@
|
|
|
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 f(e.workbook, t);
|
|
15
|
+
case "pdf": return g(e, 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, l = (e) => "FF" + e.replace("#", "").toUpperCase();
|
|
52
|
+
function u(e, t) {
|
|
53
|
+
if (t && ((t.bold !== void 0 || t.italic !== void 0 || t.size || t.color) && (e.font = {
|
|
54
|
+
...e.font ?? {},
|
|
55
|
+
...t.bold === void 0 ? {} : { bold: t.bold },
|
|
56
|
+
...t.italic === void 0 ? {} : { italic: t.italic },
|
|
57
|
+
...t.size ? { size: t.size } : {},
|
|
58
|
+
...t.color ? { color: { argb: l(t.color) } } : {}
|
|
59
|
+
}), t.fill && (e.fill = {
|
|
60
|
+
type: "pattern",
|
|
61
|
+
pattern: "solid",
|
|
62
|
+
fgColor: { argb: l(t.fill) }
|
|
63
|
+
}), t.align && (e.alignment = {
|
|
64
|
+
horizontal: t.align,
|
|
65
|
+
vertical: "middle"
|
|
66
|
+
}), t.numFmt && (typeof e.value == "number" || e.value instanceof Date) && (e.numFmt = t.numFmt), t.borderTop || t.borderBottom)) {
|
|
67
|
+
let n = (e) => ({
|
|
68
|
+
style: e.style,
|
|
69
|
+
...e.color ? { color: { argb: l(e.color) } } : {}
|
|
70
|
+
});
|
|
71
|
+
e.border = {
|
|
72
|
+
...t.borderTop ? { top: n(t.borderTop) } : {},
|
|
73
|
+
...t.borderBottom ? { bottom: n(t.borderBottom) } : {}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function d(e, t, n) {
|
|
78
|
+
let r = e.addRow(t.values);
|
|
79
|
+
t.style?.bold && (r.font = { bold: !0 }), t.merge && n > 1 && e.mergeCells(r.number, 1, r.number, n);
|
|
80
|
+
let i = t.merge ? 1 : Math.max(t.values.length, 0);
|
|
81
|
+
for (let e = 0; e < i; e++) {
|
|
82
|
+
let n = r.getCell(e + 1);
|
|
83
|
+
u(n, t.style), u(n, t.cells?.[e]);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async function f(e, t) {
|
|
87
|
+
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;
|
|
88
|
+
for (let o of e.sheets) {
|
|
89
|
+
let e = n.addWorksheet(o.name), c = o.columns.length;
|
|
90
|
+
e.columns = o.columns.map((e, t) => ({
|
|
91
|
+
key: String(t),
|
|
92
|
+
width: e.width
|
|
93
|
+
}));
|
|
94
|
+
for (let t of o.before ?? []) d(e, t, c);
|
|
95
|
+
let f = e.addRow(o.columns.map((e) => e.header));
|
|
96
|
+
f.font = { bold: o.headerStyle?.bold ?? !0 }, f.eachCell((e, t) => {
|
|
97
|
+
let n = o.columns[t - 1]?.align;
|
|
98
|
+
n && (e.alignment = {
|
|
99
|
+
horizontal: n,
|
|
100
|
+
vertical: "middle"
|
|
101
|
+
}), u(e, o.headerStyle);
|
|
102
|
+
});
|
|
103
|
+
let p = f.number;
|
|
104
|
+
o.freeze ? e.views = [{
|
|
105
|
+
state: "frozen",
|
|
106
|
+
ySplit: o.freeze.rows ?? 0,
|
|
107
|
+
xSplit: o.freeze.cols ?? 0
|
|
108
|
+
}] : o.freezeHeader !== !1 && (e.views = [{
|
|
109
|
+
state: "frozen",
|
|
110
|
+
ySplit: p
|
|
111
|
+
}]), o.rows.forEach((n, c) => {
|
|
112
|
+
let d = e.addRow(n), f = o.cellStyles?.[c], p = o.stripe && c % 2 == 1;
|
|
113
|
+
if (o.columns.forEach((e, t) => {
|
|
114
|
+
let n = d.getCell(t + 1);
|
|
115
|
+
e.numFmt && (typeof n.value == "number" || n.value instanceof Date) && (n.numFmt = e.numFmt), e.align && (n.alignment = {
|
|
116
|
+
horizontal: e.align,
|
|
117
|
+
vertical: "middle"
|
|
118
|
+
}), p && (n.fill = {
|
|
119
|
+
type: "pattern",
|
|
120
|
+
pattern: "solid",
|
|
121
|
+
fgColor: { argb: l(o.stripe) }
|
|
122
|
+
}), u(n, e.style), u(n, f?.[t]);
|
|
123
|
+
}), ++s % a === 0) {
|
|
124
|
+
if (t.signal?.aborted) throw r();
|
|
125
|
+
t.progress(s / i * .9);
|
|
126
|
+
}
|
|
127
|
+
}), o.autoFilter && o.rows.length > 0 && (e.autoFilter = {
|
|
128
|
+
from: {
|
|
129
|
+
row: p,
|
|
130
|
+
column: 1
|
|
131
|
+
},
|
|
132
|
+
to: {
|
|
133
|
+
row: p,
|
|
134
|
+
column: c
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
for (let t of o.after ?? []) d(e, t, c);
|
|
138
|
+
}
|
|
139
|
+
let f = await n.xlsx.writeBuffer();
|
|
140
|
+
return t.progress(1), c(f);
|
|
141
|
+
}
|
|
142
|
+
var p = { Roboto: {
|
|
143
|
+
normal: "Roboto-Regular.ttf",
|
|
144
|
+
bold: "Roboto-Medium.ttf",
|
|
145
|
+
italics: "Roboto-Italic.ttf",
|
|
146
|
+
bolditalics: "Roboto-MediumItalic.ttf"
|
|
147
|
+
} };
|
|
148
|
+
function m(e) {
|
|
149
|
+
let t = e.hLineWidth ?? 1, n = e.edgeLineWidth ?? t;
|
|
150
|
+
return {
|
|
151
|
+
hLineWidth: (e, r) => e === 0 || e === (r.table.headerRows ?? 0) || e === r.table.body.length ? n : t,
|
|
152
|
+
vLineWidth: () => e.vLineWidth ?? 1,
|
|
153
|
+
...e.hLineColor ? { hLineColor: () => e.hLineColor } : {},
|
|
154
|
+
...e.vLineColor ? { vLineColor: () => e.vLineColor } : {},
|
|
155
|
+
...e.paddingX === void 0 ? {} : {
|
|
156
|
+
paddingLeft: () => e.paddingX,
|
|
157
|
+
paddingRight: () => e.paddingX
|
|
158
|
+
},
|
|
159
|
+
...e.paddingY === void 0 ? {} : {
|
|
160
|
+
paddingTop: () => e.paddingY,
|
|
161
|
+
paddingBottom: () => e.paddingY
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function h(e) {
|
|
166
|
+
return (t, n) => ({
|
|
167
|
+
text: e.text.replace(/\{page\}/g, String(t)).replace(/\{pages\}/g, String(n)),
|
|
168
|
+
...e.font ? { font: e.font } : {},
|
|
169
|
+
alignment: e.alignment ?? "center",
|
|
170
|
+
fontSize: e.fontSize ?? 8,
|
|
171
|
+
...e.color ? { color: e.color } : {},
|
|
172
|
+
...e.margin ? { margin: e.margin } : {}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
async function g(e, t) {
|
|
176
|
+
let n = t.pdfFonts ? {
|
|
177
|
+
fonts: {
|
|
178
|
+
...t.pdfFonts.fonts,
|
|
179
|
+
...e.fonts?.fonts
|
|
180
|
+
},
|
|
181
|
+
vfs: t.pdfFonts.vfs || e.fonts?.vfs ? {
|
|
182
|
+
...t.pdfFonts.vfs,
|
|
183
|
+
...e.fonts?.vfs
|
|
184
|
+
} : void 0
|
|
185
|
+
} : e.fonts, i = e.footer ? {
|
|
186
|
+
...e.document,
|
|
187
|
+
footer: h(e.footer)
|
|
188
|
+
} : e.document, a = e.tableLayouts ? Object.fromEntries(Object.entries(e.tableLayouts).map(([e, t]) => [e, m(t)])) : void 0, { pdfMake: o, vfs: c } = await s();
|
|
189
|
+
if (t.progress(.1), t.signal?.aborted) throw r();
|
|
190
|
+
let l = {
|
|
191
|
+
...p,
|
|
192
|
+
...n?.fonts ?? {}
|
|
193
|
+
}, u = n?.vfs ? {
|
|
194
|
+
...c ?? {},
|
|
195
|
+
...n.vfs
|
|
196
|
+
} : c, d = await new Promise((e, t) => {
|
|
197
|
+
try {
|
|
198
|
+
let n = o.createPdf(i, a, l, u).getStream(), r = [];
|
|
199
|
+
n.on("data", (e) => r.push(e)), n.on("error", t), n.on("end", () => {
|
|
200
|
+
let t = new Uint8Array(r.reduce((e, t) => e + t.byteLength, 0)), n = 0;
|
|
201
|
+
for (let e of r) t.set(e, n), n += e.byteLength;
|
|
202
|
+
e(t.buffer);
|
|
203
|
+
}), n.end();
|
|
204
|
+
} catch (e) {
|
|
205
|
+
t(e);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return t.progress(1), d;
|
|
209
|
+
}
|
|
210
|
+
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 };
|