@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.
- package/README.md +43 -0
- package/dist/{ChartImageMenu-CuuFnW9q.js → ChartImageMenu-AsfvmdTH.js} +99 -81
- package/dist/{ChartView-nS4f4EU_.js → ChartView-CW3m4Z_1.js} +1 -1
- package/dist/{SummaryChart-CVg6i2mx.js → SummaryChart-CxRjK_HU.js} +2 -2
- package/dist/{SummaryImage-CoEFzMl6.js → SummaryImage-DeYs2Jgj.js} +2 -2
- package/dist/{SummarySeeAll-C_OUs3kn.js → SummarySeeAll-CrmROhBv.js} +5 -5
- package/dist/assets/fileTask.worker-BHT1olUk.js +1 -0
- package/dist/{columnValue-K98ElfJc.js → columnValue-DwUqueZ6.js} +1 -1
- package/dist/{exportContext-CJaIv8R-.js → exportContext-BKFnNQ0q.js} +1 -1
- package/dist/{exportEngine-CDLYHH0d.js → exportEngine-CZ22cX7a.js} +377 -382
- package/dist/file-worker.js +1 -0
- package/dist/{fileActions-KSaVGnaE.js → fileActions-COf5Q4Eg.js} +2 -2
- package/dist/{geometry-ChwYB45B.js → geometry-yZmKN662.js} +11 -2
- package/dist/index.js +6534 -6118
- package/dist/runFileTask--4YjQH7Y.js +210 -0
- package/dist/scrollArea-Dd2dNMV4.js +236 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-pNvzaEHp.js → summaryChartData-CARqGRUl.js} +1 -1
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/DataTable/export/exportEngine.d.ts +11 -4
- package/dist/types/components/DataTable/layout/useFillHeight.d.ts +1 -0
- package/dist/types/components/DataTable/rows/RowActions.d.ts +5 -2
- package/dist/types/components/DataTable/types.d.ts +1 -0
- package/dist/types/components/Dialog/DialogHost.d.ts +1 -0
- package/dist/types/components/Dialog/dialogOpen.d.ts +7 -0
- package/dist/types/components/Dialog/index.d.ts +1 -0
- package/dist/types/components/Fields/Field.d.ts +1 -1
- package/dist/types/components/Fields/hooks/useFieldBlur.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +20 -1
- package/dist/types/components/FileEngine/index.d.ts +1 -1
- package/dist/types/components/Popover/floatingPosition.d.ts +11 -1
- package/dist/types/components/Scroll/ScrollStrip.d.ts +4 -2
- package/dist/types/components/Sidebar/Sidebar.d.ts +12 -3
- package/dist/types/components/Sidebar/index.d.ts +1 -1
- package/dist/types/components/UIProvider/UIHostContext.d.ts +20 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +9 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
- package/dist/types/components/UIProvider/index.d.ts +2 -0
- package/dist/types/core/logic/index.d.ts +1 -0
- package/dist/types/core/logic/popover.logic.d.ts +2 -0
- package/dist/types/core/logic/standardSchema.logic.d.ts +9 -0
- package/dist/types/core/types/fields.types.d.ts +2 -0
- package/dist/types/core/types/fileEngine.types.d.ts +51 -0
- package/dist/types/core/types/form.types.d.ts +4 -0
- package/dist/types/core/types/index.d.ts +1 -0
- package/dist/types/core/types/standardSchema.types.d.ts +30 -0
- package/dist/types/core/types/suggest.types.d.ts +1 -0
- package/dist/types/core/types/tooltip.types.d.ts +2 -0
- package/dist/types/file/fileEngine.d.ts +2 -1
- package/dist/types/file/tasks/runFileTask.d.ts +4 -1
- package/dist/types/file/workerPool.d.ts +1 -0
- package/dist/types/index.d.ts +11 -6
- package/package.json +7 -3
- package/dist/assets/fileTask.worker-FQSUtwcz.js +0 -1
- package/dist/runFileTask-BClLQjmv.js +0 -109
- package/dist/scrollArea-DAlVT5U7.js +0 -214
|
@@ -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,236 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Nn as e, wn as t } from "./geometry-yZmKN662.js";
|
|
3
|
+
import { n, t as r } from "./labels-CnqqTrne.js";
|
|
4
|
+
import { createContext as i, useCallback as ee, useContext as a, useEffect as o, useId as te, useMemo 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 ne } from "react-dom";
|
|
7
|
+
// src/components/Dialog/dialogOpen.tsx
|
|
8
|
+
var f = i(null), p = i(0), m = ({ children: e }) => {
|
|
9
|
+
let [t, n] = l(0), r = s(() => () => {
|
|
10
|
+
n((e) => e + 1);
|
|
11
|
+
let e = !1;
|
|
12
|
+
return () => {
|
|
13
|
+
e || (e = !0, n((e) => e - 1));
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
return /* @__PURE__ */ u(f.Provider, {
|
|
17
|
+
value: r,
|
|
18
|
+
children: /* @__PURE__ */ u(p.Provider, {
|
|
19
|
+
value: t,
|
|
20
|
+
children: e
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
function h(e) {
|
|
25
|
+
let t = a(f);
|
|
26
|
+
o(() => e && t ? t() : void 0, [e, t]);
|
|
27
|
+
}
|
|
28
|
+
var g = () => a(p), _ = () => a(p) > 0, v = {
|
|
29
|
+
root: "_root_1rswg_7",
|
|
30
|
+
nonModal: "_nonModal_1rswg_30",
|
|
31
|
+
panel: "_panel_1rswg_3",
|
|
32
|
+
center: "_center_1rswg_41",
|
|
33
|
+
right: "_right_1rswg_42",
|
|
34
|
+
left: "_left_1rswg_43",
|
|
35
|
+
top: "_top_1rswg_44",
|
|
36
|
+
bottom: "_bottom_1rswg_45",
|
|
37
|
+
sm: "_sm_1rswg_86",
|
|
38
|
+
md: "_md_1rswg_87",
|
|
39
|
+
lg: "_lg_1rswg_88",
|
|
40
|
+
xl: "_xl_1rswg_89",
|
|
41
|
+
full: "_full_1rswg_90",
|
|
42
|
+
header: "_header_1rswg_96",
|
|
43
|
+
headText: "_headText_1rswg_106",
|
|
44
|
+
title: "_title_1rswg_108",
|
|
45
|
+
subtitle: "_subtitle_1rswg_114",
|
|
46
|
+
body: "_body_1rswg_120",
|
|
47
|
+
flush: "_flush_1rswg_128",
|
|
48
|
+
footer: "_footer_1rswg_130",
|
|
49
|
+
close: "_close_1rswg_141",
|
|
50
|
+
dialogPop: "_dialogPop_1rswg_1",
|
|
51
|
+
slideFromRight: "_slideFromRight_1rswg_1",
|
|
52
|
+
slideFromLeft: "_slideFromLeft_1rswg_1",
|
|
53
|
+
slideFromTop: "_slideFromTop_1rswg_1",
|
|
54
|
+
slideFromBottom: "_slideFromBottom_1rswg_1",
|
|
55
|
+
backdropIn: "_backdropIn_1rswg_1",
|
|
56
|
+
closing: "_closing_1rswg_168"
|
|
57
|
+
}, y = 0, b = null, x = (e) => {
|
|
58
|
+
if (typeof document < "u") {
|
|
59
|
+
if (y === 0) {
|
|
60
|
+
let t = document.body;
|
|
61
|
+
b = {
|
|
62
|
+
overflow: t.style.overflow,
|
|
63
|
+
paddingRight: t.style.paddingRight
|
|
64
|
+
};
|
|
65
|
+
let n = window.innerWidth - document.documentElement.clientWidth;
|
|
66
|
+
if (e && n > 0) {
|
|
67
|
+
let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
|
|
68
|
+
t.style.paddingRight = `${e + n}px`;
|
|
69
|
+
}
|
|
70
|
+
t.style.overflow = "hidden";
|
|
71
|
+
}
|
|
72
|
+
y += 1;
|
|
73
|
+
}
|
|
74
|
+
}, re = () => {
|
|
75
|
+
typeof document < "u" && (y = Math.max(0, y - 1), y === 0 && b && (document.body.style.overflow = b.overflow, document.body.style.paddingRight = b.paddingRight, b = null));
|
|
76
|
+
}, ie = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, S = /* @__PURE__ */ d("svg", {
|
|
77
|
+
width: "16",
|
|
78
|
+
height: "16",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
fill: "none",
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
strokeWidth: "2",
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
children: [/* @__PURE__ */ u("line", {
|
|
86
|
+
x1: "18",
|
|
87
|
+
y1: "6",
|
|
88
|
+
x2: "6",
|
|
89
|
+
y2: "18"
|
|
90
|
+
}), /* @__PURE__ */ u("line", {
|
|
91
|
+
x1: "6",
|
|
92
|
+
y1: "6",
|
|
93
|
+
x2: "18",
|
|
94
|
+
y2: "18"
|
|
95
|
+
})]
|
|
96
|
+
}), ae = 0, C = ({ open: n, onClose: r, onBeforeClose: i, onEscKeyDown: a, onOverlayClick: s, onAnimationEnd: f, children: p, title: m, subtitle: g, footer: _, modal: y = !0, placement: b = "center", size: C = "md", closeOnBackdrop: w = !0, closeOnEscape: T = !0, showCloseButton: E = !0, closeIcon: D, closeIconId: O, blockScroll: k = !0, reserveScrollBarGap: A = !0, initialFocusRef: j, container: oe, animationDuration: se = 200, padded: ce = !0, classNames: M = {}, styleSlots: N = {}, className: P = "", style: F, role: I = "dialog", id: L, "aria-label": R, "aria-labelledby": z, "aria-describedby": B }) => {
|
|
97
|
+
let V = e(), H = c(null), [U, W] = l(null), G = te(), [K, q] = l(n), [le, J] = l(!1), Y = c(null), X = ie() ? 0 : se;
|
|
98
|
+
h(K), o(() => {
|
|
99
|
+
n ? (Y.current &&= (clearTimeout(Y.current), null), J(!1), q(!0)) : K && (J(!0), Y.current = setTimeout(() => {
|
|
100
|
+
H.current?.close(), q(!1), J(!1), f?.();
|
|
101
|
+
}, X));
|
|
102
|
+
}, [n]), o(() => () => {
|
|
103
|
+
Y.current && clearTimeout(Y.current);
|
|
104
|
+
}, []);
|
|
105
|
+
let Z = ee(() => {
|
|
106
|
+
i && i() === !1 || r?.();
|
|
107
|
+
}, [i, r]);
|
|
108
|
+
o(() => {
|
|
109
|
+
let e = H.current;
|
|
110
|
+
if (e && K && (e.open || (y && (e.dataset.modalOrder = String(++ae)), y ? e.showModal() : e.show(), j?.current && j.current.focus({ focusVisible: !0 })), k && y)) return x(A), () => re();
|
|
111
|
+
}, [
|
|
112
|
+
K,
|
|
113
|
+
y,
|
|
114
|
+
k,
|
|
115
|
+
A,
|
|
116
|
+
j
|
|
117
|
+
]), o(() => {
|
|
118
|
+
let e = H.current;
|
|
119
|
+
if (!e || !K) return;
|
|
120
|
+
let t = (e) => {
|
|
121
|
+
e.preventDefault(), a?.(e), T && Z();
|
|
122
|
+
};
|
|
123
|
+
return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
|
|
124
|
+
}, [
|
|
125
|
+
K,
|
|
126
|
+
T,
|
|
127
|
+
Z,
|
|
128
|
+
a
|
|
129
|
+
]);
|
|
130
|
+
let Q = c(!1), ue = (e) => {
|
|
131
|
+
Q.current = e.target === H.current;
|
|
132
|
+
}, de = (e) => {
|
|
133
|
+
let t = Q.current && e.target === H.current;
|
|
134
|
+
Q.current = !1, t && (s?.(e), w && Z());
|
|
135
|
+
};
|
|
136
|
+
if (!K) return null;
|
|
137
|
+
let fe = m !== void 0 || g !== void 0 || E, pe = z ?? (m !== void 0 && !R ? G : void 0), me = /* @__PURE__ */ u("dialog", {
|
|
138
|
+
ref: (e) => {
|
|
139
|
+
H.current = e, W(e);
|
|
140
|
+
},
|
|
141
|
+
id: L,
|
|
142
|
+
"data-modal": y ? "" : void 0,
|
|
143
|
+
className: [
|
|
144
|
+
v.root,
|
|
145
|
+
v[b],
|
|
146
|
+
v[C],
|
|
147
|
+
y ? "" : v.nonModal,
|
|
148
|
+
le ? v.closing : "",
|
|
149
|
+
M.root,
|
|
150
|
+
P
|
|
151
|
+
].filter(Boolean).join(" "),
|
|
152
|
+
style: {
|
|
153
|
+
"--dialog-anim": `${X}ms`,
|
|
154
|
+
...N.root,
|
|
155
|
+
...F
|
|
156
|
+
},
|
|
157
|
+
role: I,
|
|
158
|
+
"aria-label": R,
|
|
159
|
+
"aria-labelledby": pe,
|
|
160
|
+
"aria-describedby": B,
|
|
161
|
+
"aria-modal": y || void 0,
|
|
162
|
+
onPointerDown: ue,
|
|
163
|
+
onPointerUp: de,
|
|
164
|
+
children: /* @__PURE__ */ u(t.Provider, {
|
|
165
|
+
value: U,
|
|
166
|
+
children: /* @__PURE__ */ d("div", {
|
|
167
|
+
className: [v.panel, M.panel].filter(Boolean).join(" "),
|
|
168
|
+
style: N.panel,
|
|
169
|
+
children: [
|
|
170
|
+
fe && /* @__PURE__ */ d("div", {
|
|
171
|
+
className: [v.header, M.header].filter(Boolean).join(" "),
|
|
172
|
+
style: N.header,
|
|
173
|
+
children: [/* @__PURE__ */ d("span", {
|
|
174
|
+
className: v.headText,
|
|
175
|
+
children: [m !== void 0 && /* @__PURE__ */ u("span", {
|
|
176
|
+
className: v.title,
|
|
177
|
+
id: G,
|
|
178
|
+
children: m
|
|
179
|
+
}), g !== void 0 && /* @__PURE__ */ u("span", {
|
|
180
|
+
className: v.subtitle,
|
|
181
|
+
children: g
|
|
182
|
+
})]
|
|
183
|
+
}), E && /* @__PURE__ */ u("button", {
|
|
184
|
+
type: "button",
|
|
185
|
+
id: O,
|
|
186
|
+
className: [v.close, M.closeButton].filter(Boolean).join(" "),
|
|
187
|
+
style: N.closeButton,
|
|
188
|
+
onClick: Z,
|
|
189
|
+
"aria-label": V.dialog.close,
|
|
190
|
+
children: D ?? S
|
|
191
|
+
})]
|
|
192
|
+
}),
|
|
193
|
+
p !== void 0 && /* @__PURE__ */ u("div", {
|
|
194
|
+
className: [
|
|
195
|
+
v.body,
|
|
196
|
+
ce ? "scroll-fade-y scroll-gutter" : `${v.flush} scroll-fade-y`,
|
|
197
|
+
M.body
|
|
198
|
+
].filter(Boolean).join(" "),
|
|
199
|
+
style: N.body,
|
|
200
|
+
children: p
|
|
201
|
+
}),
|
|
202
|
+
_ !== void 0 && /* @__PURE__ */ u("div", {
|
|
203
|
+
className: [v.footer, M.footer].filter(Boolean).join(" "),
|
|
204
|
+
style: N.footer,
|
|
205
|
+
children: _
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
}), $ = oe ?? (typeof document > "u" ? null : document.body);
|
|
211
|
+
return $ ? ne(me, $) : null;
|
|
212
|
+
};
|
|
213
|
+
C.displayName = "Dialog";
|
|
214
|
+
var w = i({
|
|
215
|
+
authorize: () => !0,
|
|
216
|
+
exportOptions: {},
|
|
217
|
+
serverMode: !1,
|
|
218
|
+
labels: r,
|
|
219
|
+
format: n(),
|
|
220
|
+
text: {
|
|
221
|
+
yes: r.yes,
|
|
222
|
+
no: r.no
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
function T() {
|
|
226
|
+
return a(w);
|
|
227
|
+
}
|
|
228
|
+
function E() {
|
|
229
|
+
return a(w).labels;
|
|
230
|
+
}
|
|
231
|
+
function D(e, t, n) {
|
|
232
|
+
return !e || e(t, n) !== !1;
|
|
233
|
+
}
|
|
234
|
+
// src/components/DataTable/layout/scrollArea.ts
|
|
235
|
+
var O = "dt-scroll-area scroll-fade-y scroll-gutter", k = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
|
|
236
|
+
export { E as a, m as c, D as i, _ as l, O as n, T as o, w as r, C as s, k as t, g as u };
|