@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.
- package/dist/ChartImageMenu-CuuFnW9q.js +1481 -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-CoEFzMl6.js} +2 -2
- package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-C_OUs3kn.js} +5 -5
- package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
- package/dist/columnValue-K98ElfJc.js +610 -0
- package/dist/exportContext-CJaIv8R-.js +166 -0
- package/dist/{exportEngine-DL-jEXFU.js → exportEngine-CDLYHH0d.js} +137 -133
- package/dist/fileActions-KSaVGnaE.js +144 -0
- package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
- package/dist/index.js +8572 -8435
- package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
- package/dist/runFileTask-BClLQjmv.js +109 -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 +2 -0
- 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/EditableTable/EditableTableCell.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -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/UILabelsContext.d.ts +116 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +6 -1
- package/dist/types/components/UIProvider/index.d.ts +4 -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 +65 -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 +48 -0
- package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
- package/dist/types/file/tasks/runFileTask.d.ts +6 -0
- package/dist/types/file/workerPool.d.ts +17 -0
- package/dist/types/index.d.ts +9 -2
- package/package.json +1 -1
- package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
- package/dist/exportContext-CdpsOzE8.js +0 -235
- package/dist/scrollArea-CkPGDYH2.js +0 -210
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { d as e, l as t, r as n } from "./defaults-DL745PK1.js";
|
|
3
|
-
// src/components/DataTable/vendor/fileActions.ts
|
|
4
|
-
var r = {
|
|
5
|
-
pdf: ".pdf",
|
|
6
|
-
xlsx: ".xlsx",
|
|
7
|
-
csv: ".csv",
|
|
8
|
-
html: ".html",
|
|
9
|
-
json: ".json",
|
|
10
|
-
xml: ".xml",
|
|
11
|
-
png: ".png"
|
|
12
|
-
}, i = {
|
|
13
|
-
pdf: "application/pdf",
|
|
14
|
-
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
15
|
-
csv: "text/csv;charset=utf-8;",
|
|
16
|
-
html: "text/html;charset=utf-8;",
|
|
17
|
-
json: "application/json",
|
|
18
|
-
xml: "application/xml;charset=utf-8;",
|
|
19
|
-
png: "image/png"
|
|
20
|
-
}, a = null;
|
|
21
|
-
function o() {
|
|
22
|
-
return a ||= (async () => {
|
|
23
|
-
let e = await import("pdfmake/build/pdfmake"), t = e.default ?? e, n = await import("pdfmake/build/vfs_fonts");
|
|
24
|
-
return {
|
|
25
|
-
pdfMake: t,
|
|
26
|
-
vfs: [
|
|
27
|
-
n?.default,
|
|
28
|
-
n,
|
|
29
|
-
n?.pdfMake?.vfs,
|
|
30
|
-
n?.default?.pdfMake?.vfs,
|
|
31
|
-
t.vfs
|
|
32
|
-
].find((e) => e && e["Roboto-Regular.ttf"]) ?? {}
|
|
33
|
-
};
|
|
34
|
-
})(), a;
|
|
35
|
-
}
|
|
36
|
-
var s = { Roboto: {
|
|
37
|
-
normal: "Roboto-Regular.ttf",
|
|
38
|
-
bold: "Roboto-Medium.ttf",
|
|
39
|
-
italics: "Roboto-Italic.ttf",
|
|
40
|
-
bolditalics: "Roboto-MediumItalic.ttf"
|
|
41
|
-
} };
|
|
42
|
-
async function c(e, t) {
|
|
43
|
-
let { pdfMake: n, vfs: r } = await o(), i = {
|
|
44
|
-
...s,
|
|
45
|
-
...t?.fonts || {}
|
|
46
|
-
}, a = {
|
|
47
|
-
...r,
|
|
48
|
-
...t?.vfs || {}
|
|
49
|
-
};
|
|
50
|
-
return new Promise((t, r) => {
|
|
51
|
-
try {
|
|
52
|
-
n.createPdf(e, void 0, i, a).getBlob((e) => t(e));
|
|
53
|
-
} catch (e) {
|
|
54
|
-
r(e);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
async function l(e, t, n) {
|
|
59
|
-
if (t instanceof Blob) return t;
|
|
60
|
-
switch (e) {
|
|
61
|
-
case "pdf": return c(t, n);
|
|
62
|
-
case "json": return new Blob([JSON.stringify(t, null, 2)], { type: i.json });
|
|
63
|
-
case "csv":
|
|
64
|
-
case "html":
|
|
65
|
-
case "xml": return new Blob([typeof t == "string" ? t : String(t)], { type: i[e] });
|
|
66
|
-
case "xlsx": return new Blob([t], { type: i.xlsx });
|
|
67
|
-
default: return new Blob([typeof t == "string" ? t : JSON.stringify(t)]);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function u(e) {
|
|
71
|
-
return String(e ?? "").replace(/[\\/:*?"<>|\u0000-\u001F]/g, " ").replace(/\./g, " ").replace(/\s+/g, " ").replace(/[\s.]+$/, "").trim().slice(0, 120) || "file";
|
|
72
|
-
}
|
|
73
|
-
function d(e) {
|
|
74
|
-
let t = String(e ?? ""), n = t.lastIndexOf("."), r = n > 0 && /^\.[A-Za-z0-9]{1,5}$/.test(t.slice(n)) ? t.slice(n) : "";
|
|
75
|
-
return u(r ? t.slice(0, n) : t) + r;
|
|
76
|
-
}
|
|
77
|
-
function f(e, t) {
|
|
78
|
-
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
79
|
-
r.href = n, r.download = d(t), document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
80
|
-
}
|
|
81
|
-
async function p(e, t) {
|
|
82
|
-
let n = new File([e], d(t), { type: e.type });
|
|
83
|
-
if (navigator.share && navigator.canShare?.({ files: [n] })) try {
|
|
84
|
-
return await navigator.share({
|
|
85
|
-
title: t,
|
|
86
|
-
files: [n]
|
|
87
|
-
}), !0;
|
|
88
|
-
} catch (e) {
|
|
89
|
-
if (e?.name === "AbortError") return !1;
|
|
90
|
-
}
|
|
91
|
-
if (e.type.includes("text") || e.type.includes("json") || e.type.includes("csv")) try {
|
|
92
|
-
let t = await e.text();
|
|
93
|
-
return await navigator.clipboard.writeText(t), !0;
|
|
94
|
-
} catch {}
|
|
95
|
-
return f(e, t), !0;
|
|
96
|
-
}
|
|
97
|
-
function m(e, t, n) {
|
|
98
|
-
if (t === "html" || t === "pdf" || t === "json" || t === "xml") {
|
|
99
|
-
let t = URL.createObjectURL(e), r = window.open(t, "_blank");
|
|
100
|
-
if (r) {
|
|
101
|
-
if (n) {
|
|
102
|
-
let e = () => {
|
|
103
|
-
try {
|
|
104
|
-
r.document.title = n;
|
|
105
|
-
} catch {}
|
|
106
|
-
};
|
|
107
|
-
r.addEventListener("load", e), setTimeout(e, 100);
|
|
108
|
-
}
|
|
109
|
-
setTimeout(() => URL.revokeObjectURL(t), 6e4);
|
|
110
|
-
}
|
|
111
|
-
return { type: "new_tab" };
|
|
112
|
-
}
|
|
113
|
-
return { type: "modal" };
|
|
114
|
-
}
|
|
115
|
-
async function h(e, t, n) {
|
|
116
|
-
if (t === "pdf") g(e);
|
|
117
|
-
else if (t === "html") {
|
|
118
|
-
let t = URL.createObjectURL(e), n = window.open(t, "_blank");
|
|
119
|
-
n && (n.addEventListener("load", () => n.print()), setTimeout(() => URL.revokeObjectURL(t), 6e4));
|
|
120
|
-
} else f(e, n);
|
|
121
|
-
}
|
|
122
|
-
function g(e) {
|
|
123
|
-
let t = URL.createObjectURL(e), n = document.createElement("iframe");
|
|
124
|
-
n.style.display = "none", n.src = t, document.body.appendChild(n), n.addEventListener("load", () => {
|
|
125
|
-
try {
|
|
126
|
-
n.contentWindow?.print();
|
|
127
|
-
} catch {
|
|
128
|
-
window.open(t, "_blank");
|
|
129
|
-
}
|
|
130
|
-
setTimeout(() => {
|
|
131
|
-
n.remove(), URL.revokeObjectURL(t);
|
|
132
|
-
}, 6e4);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
async function _(e, t, n, r, i, a) {
|
|
136
|
-
let o = await l(n, e, a);
|
|
137
|
-
switch (r) {
|
|
138
|
-
case "download":
|
|
139
|
-
f(o, t);
|
|
140
|
-
break;
|
|
141
|
-
case "share":
|
|
142
|
-
await p(o, t);
|
|
143
|
-
break;
|
|
144
|
-
case "preview":
|
|
145
|
-
m(o, n, i || t);
|
|
146
|
-
break;
|
|
147
|
-
case "print":
|
|
148
|
-
await h(o, n, t);
|
|
149
|
-
break;
|
|
150
|
-
case "open": {
|
|
151
|
-
let e = URL.createObjectURL(o);
|
|
152
|
-
window.open(e, "_blank"), setTimeout(() => URL.revokeObjectURL(e), 6e4);
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function v(e) {
|
|
158
|
-
return r[e] || "";
|
|
159
|
-
}
|
|
160
|
-
function y(e) {
|
|
161
|
-
return {
|
|
162
|
-
csv: "CSV",
|
|
163
|
-
xlsx: "Excel",
|
|
164
|
-
json: "JSON",
|
|
165
|
-
pdf: "PDF",
|
|
166
|
-
html: "HTML",
|
|
167
|
-
xml: "XML",
|
|
168
|
-
png: "Image"
|
|
169
|
-
}[e] || e.toUpperCase();
|
|
170
|
-
}
|
|
171
|
-
// src/components/DataTable/export/exportRows.ts
|
|
172
|
-
function b(e, n = t) {
|
|
173
|
-
return e == null ? "" : typeof e == "number" ? e : typeof e == "boolean" ? e ? n.yes : n.no : e instanceof Date ? e.toLocaleDateString() : Array.isArray(e) ? e.length === 0 ? "" : typeof e[0] == "object" ? n.exportItems(String(e.length)) : e.join(", ") : typeof e == "object" ? "" : String(e);
|
|
174
|
-
}
|
|
175
|
-
function x(e, r, i, a = t) {
|
|
176
|
-
let o = new Map(r.map((e) => [e.key, e])), s = i.map((e) => o.get(e)).filter((e) => e !== void 0 && e.exportable !== !1 && e.authorized !== !1), c = s.map((e) => e.exportHeader || e.header), l = s.some((e) => e.cellStyle);
|
|
177
|
-
return {
|
|
178
|
-
headers: c,
|
|
179
|
-
rows: e.map((e) => s.reduce((t, r) => {
|
|
180
|
-
let i = n(e, r.key);
|
|
181
|
-
return t[r.exportHeader || r.header] = r.exportValue ? r.exportValue(i, e) : b(i, a), t;
|
|
182
|
-
}, {})),
|
|
183
|
-
exportColumns: s,
|
|
184
|
-
cellStyles: l ? e.map((e) => s.reduce((t, r) => {
|
|
185
|
-
if (r.cellStyle) {
|
|
186
|
-
let i = n(e, r.key), a = r.cellStyle(i, e);
|
|
187
|
-
a && (t[r.exportHeader || r.header] = a);
|
|
188
|
-
}
|
|
189
|
-
return t;
|
|
190
|
-
}, {})) : void 0
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
function S(e) {
|
|
194
|
-
let t = e?.businessMeta?.() || {}, n = {};
|
|
195
|
-
return t.businessName && (n.businessName = t.businessName), t.businessAddress && (n.businessAddress = t.businessAddress), t.businessPhone && (n.businessPhone = t.businessPhone), t.taxNumber && (n.taxNumber = t.taxNumber, n.taxNumberLabel = t.taxNumberLabel), n;
|
|
196
|
-
}
|
|
197
|
-
// src/components/DataTable/export/exportContext.ts
|
|
198
|
-
var C = (t) => e(t?.labels), w = (e) => e.taxNumberLabel || C(e).exportTaxNo;
|
|
199
|
-
function T(e, t) {
|
|
200
|
-
return e.map((e) => ({
|
|
201
|
-
column: e.columnLabel,
|
|
202
|
-
operator: e.operatorLabel,
|
|
203
|
-
value: t?.get(e.id) ?? e.displayValue
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
function E(e, t = {}) {
|
|
207
|
-
let n = C(e), r = [];
|
|
208
|
-
if (e.filters && e.filters.length > 0 && r.push({
|
|
209
|
-
label: n.exportFiltersLabel,
|
|
210
|
-
value: e.filters.map((e) => `${e.column} ${e.operator} ${e.value}`).join(", ")
|
|
211
|
-
}), e.searchTerm && r.push({
|
|
212
|
-
label: n.exportSearchLabel,
|
|
213
|
-
value: `"${e.searchTerm}"`
|
|
214
|
-
}), e.totalRows > 0 || e.resultRows > 0) {
|
|
215
|
-
let i = [n.exportRowsTotal(String(e.totalRows))];
|
|
216
|
-
e.filteredRows !== e.totalRows && i.push(n.exportRowsFiltered(String(e.filteredRows))), (t.rows ?? "export") === "export" && i.push(n.exportRowsExported(String(e.resultRows)));
|
|
217
|
-
let a = e.selectedRows > 0 ? ` (${n.exportRowsSelected(String(e.selectedRows))})` : "";
|
|
218
|
-
r.push({
|
|
219
|
-
label: n.exportRowsLabel,
|
|
220
|
-
value: `${i.join(" > ")}${a}`,
|
|
221
|
-
rows: !0
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
return r;
|
|
225
|
-
}
|
|
226
|
-
function D(e, t) {
|
|
227
|
-
return E(e, t).map((e) => e.rows ? e.value : `${e.label}: ${e.value}`).join(" | ");
|
|
228
|
-
}
|
|
229
|
-
function O(e) {
|
|
230
|
-
let t = C(e), n = [];
|
|
231
|
-
e.businessName && n.push([t.exportBusiness, e.businessName]), e.businessAddress && n.push([t.exportAddress, e.businessAddress]), e.businessPhone && n.push([t.exportPhone, e.businessPhone]), e.taxNumber && n.push([w(e), e.taxNumber]);
|
|
232
|
-
for (let t of E(e)) n.push([t.label, t.value]);
|
|
233
|
-
return n;
|
|
234
|
-
}
|
|
235
|
-
export { w as a, x as c, v as d, y as f, p as h, C as i, f as l, l as m, D as n, b as o, m as p, O as r, S as s, T as t, _ as u };
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jn as e } from "./geometry-CG2nOEnw.js";
|
|
3
|
-
import { l as t, u as n } from "./defaults-DL745PK1.js";
|
|
4
|
-
import { createContext as r, useCallback as i, useContext as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
5
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
-
import { createPortal as ee } 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, te = (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
|
-
}, ne = () => {
|
|
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
|
-
}, re = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, h = /* @__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
|
-
}), g = ({ open: t, onClose: n, onBeforeClose: r, onEscKeyDown: a, onOverlayClick: p, onAnimationEnd: m, children: g, title: _, subtitle: v, footer: y, modal: b = !0, placement: x = "center", size: S = "md", closeOnBackdrop: C = !0, closeOnEscape: w = !0, showCloseButton: T = !0, closeIcon: E, closeIconId: D, blockScroll: O = !0, reserveScrollBarGap: k = !0, initialFocusRef: A, container: ie, animationDuration: ae = 200, padded: oe = !0, classNames: j = {}, styleSlots: M = {}, className: N = "", style: P, role: F = "dialog", id: I, "aria-label": L, "aria-labelledby": R, "aria-describedby": z }) => {
|
|
76
|
-
let B = c(null), [V, H] = l(null), U = s(), [W, G] = l(t), [K, q] = l(!1), J = c(null), Y = re() ? 0 : ae;
|
|
77
|
-
o(() => {
|
|
78
|
-
t ? (J.current &&= (clearTimeout(J.current), null), q(!1), G(!0)) : W && (q(!0), J.current = setTimeout(() => {
|
|
79
|
-
B.current?.close(), G(!1), q(!1), m?.();
|
|
80
|
-
}, Y));
|
|
81
|
-
}, [t]), o(() => () => {
|
|
82
|
-
J.current && clearTimeout(J.current);
|
|
83
|
-
}, []);
|
|
84
|
-
let X = i(() => {
|
|
85
|
-
r && r() === !1 || n?.();
|
|
86
|
-
}, [r, n]);
|
|
87
|
-
o(() => {
|
|
88
|
-
let e = B.current;
|
|
89
|
-
if (e && W && (e.open || (b ? e.showModal() : e.show(), A?.current && A.current.focus({ focusVisible: !0 })), O && b)) return te(k), () => ne();
|
|
90
|
-
}, [
|
|
91
|
-
W,
|
|
92
|
-
b,
|
|
93
|
-
O,
|
|
94
|
-
k,
|
|
95
|
-
A
|
|
96
|
-
]), o(() => {
|
|
97
|
-
let e = B.current;
|
|
98
|
-
if (!e || !W) return;
|
|
99
|
-
let t = (e) => {
|
|
100
|
-
e.preventDefault(), a?.(e), w && X();
|
|
101
|
-
};
|
|
102
|
-
return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
|
|
103
|
-
}, [
|
|
104
|
-
W,
|
|
105
|
-
w,
|
|
106
|
-
X,
|
|
107
|
-
a
|
|
108
|
-
]);
|
|
109
|
-
let Z = c(!1), se = (e) => {
|
|
110
|
-
Z.current = e.target === B.current;
|
|
111
|
-
}, ce = (e) => {
|
|
112
|
-
let t = Z.current && e.target === B.current;
|
|
113
|
-
Z.current = !1, t && (p?.(e), C && X());
|
|
114
|
-
};
|
|
115
|
-
if (!W) return null;
|
|
116
|
-
let le = _ !== void 0 || v !== void 0 || T, ue = R ?? (_ !== void 0 && !L ? U : void 0), Q = /* @__PURE__ */ u("dialog", {
|
|
117
|
-
ref: (e) => {
|
|
118
|
-
B.current = e, H(e);
|
|
119
|
-
},
|
|
120
|
-
id: I,
|
|
121
|
-
className: [
|
|
122
|
-
f.root,
|
|
123
|
-
f[x],
|
|
124
|
-
f[S],
|
|
125
|
-
b ? "" : f.nonModal,
|
|
126
|
-
K ? f.closing : "",
|
|
127
|
-
j.root,
|
|
128
|
-
N
|
|
129
|
-
].filter(Boolean).join(" "),
|
|
130
|
-
style: {
|
|
131
|
-
"--dialog-anim": `${Y}ms`,
|
|
132
|
-
...M.root,
|
|
133
|
-
...P
|
|
134
|
-
},
|
|
135
|
-
role: F,
|
|
136
|
-
"aria-label": L,
|
|
137
|
-
"aria-labelledby": ue,
|
|
138
|
-
"aria-describedby": z,
|
|
139
|
-
"aria-modal": b || void 0,
|
|
140
|
-
onPointerDown: se,
|
|
141
|
-
onPointerUp: ce,
|
|
142
|
-
children: /* @__PURE__ */ u(e.Provider, {
|
|
143
|
-
value: V,
|
|
144
|
-
children: /* @__PURE__ */ d("div", {
|
|
145
|
-
className: [f.panel, j.panel].filter(Boolean).join(" "),
|
|
146
|
-
style: M.panel,
|
|
147
|
-
children: [
|
|
148
|
-
le && /* @__PURE__ */ d("div", {
|
|
149
|
-
className: [f.header, j.header].filter(Boolean).join(" "),
|
|
150
|
-
style: M.header,
|
|
151
|
-
children: [/* @__PURE__ */ d("span", {
|
|
152
|
-
className: f.headText,
|
|
153
|
-
children: [_ !== void 0 && /* @__PURE__ */ u("span", {
|
|
154
|
-
className: f.title,
|
|
155
|
-
id: U,
|
|
156
|
-
children: _
|
|
157
|
-
}), v !== void 0 && /* @__PURE__ */ u("span", {
|
|
158
|
-
className: f.subtitle,
|
|
159
|
-
children: v
|
|
160
|
-
})]
|
|
161
|
-
}), T && /* @__PURE__ */ u("button", {
|
|
162
|
-
type: "button",
|
|
163
|
-
id: D,
|
|
164
|
-
className: [f.close, j.closeButton].filter(Boolean).join(" "),
|
|
165
|
-
style: M.closeButton,
|
|
166
|
-
onClick: X,
|
|
167
|
-
"aria-label": "Close",
|
|
168
|
-
children: E ?? h
|
|
169
|
-
})]
|
|
170
|
-
}),
|
|
171
|
-
g !== void 0 && /* @__PURE__ */ u("div", {
|
|
172
|
-
className: [
|
|
173
|
-
f.body,
|
|
174
|
-
oe ? "" : f.flush,
|
|
175
|
-
j.body
|
|
176
|
-
].filter(Boolean).join(" "),
|
|
177
|
-
style: M.body,
|
|
178
|
-
children: g
|
|
179
|
-
}),
|
|
180
|
-
y !== void 0 && /* @__PURE__ */ u("div", {
|
|
181
|
-
className: [f.footer, j.footer].filter(Boolean).join(" "),
|
|
182
|
-
style: M.footer,
|
|
183
|
-
children: y
|
|
184
|
-
})
|
|
185
|
-
]
|
|
186
|
-
})
|
|
187
|
-
})
|
|
188
|
-
}), $ = ie ?? (typeof document > "u" ? null : document.body);
|
|
189
|
-
return $ ? ee(Q, $) : null;
|
|
190
|
-
};
|
|
191
|
-
g.displayName = "Dialog";
|
|
192
|
-
var _ = r({
|
|
193
|
-
authorize: () => !0,
|
|
194
|
-
exportOptions: {},
|
|
195
|
-
serverMode: !1,
|
|
196
|
-
labels: t,
|
|
197
|
-
format: n()
|
|
198
|
-
});
|
|
199
|
-
function v() {
|
|
200
|
-
return a(_);
|
|
201
|
-
}
|
|
202
|
-
function y() {
|
|
203
|
-
return a(_).labels;
|
|
204
|
-
}
|
|
205
|
-
function b(e, t, n) {
|
|
206
|
-
return !e || e(t, n) !== !1;
|
|
207
|
-
}
|
|
208
|
-
// src/components/DataTable/layout/scrollArea.ts
|
|
209
|
-
var x = "dt-scroll-area scroll-fade-y scroll-gutter", S = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
|
|
210
|
-
export { y as a, b as i, x as n, v as o, _ as r, g as s, S as t };
|