dhx-react-suite 1.0.0 → 1.0.2
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/dhx-react-suite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as f, jsx as t, Fragment as Z } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as T, useState as z, useMemo as F, useRef as B, useCallback as H, createContext as ee, useContext as te } from "react";
|
|
3
|
-
import { Tooltip as re, Legend as ne, CartesianGrid as oe, XAxis as _, YAxis as X, BarChart as ie, Bar as
|
|
3
|
+
import { Tooltip as re, Legend as ne, CartesianGrid as oe, XAxis as _, YAxis as X, BarChart as ie, Bar as le, LineChart as ae, Line as se, AreaChart as de, Area as ce, PieChart as pe, Pie as ue, Cell as he, RadarChart as xe, PolarGrid as ge, PolarAngleAxis as fe, Radar as ye, ScatterChart as be, Scatter as me, ResponsiveContainer as ve } from "recharts";
|
|
4
4
|
const e = {
|
|
5
5
|
primary: "#0288d1",
|
|
6
6
|
primaryDk: "#01579b",
|
|
@@ -73,21 +73,21 @@ const ke = {
|
|
|
73
73
|
};
|
|
74
74
|
function We({
|
|
75
75
|
children: r,
|
|
76
|
-
variant:
|
|
76
|
+
variant: l = "primary",
|
|
77
77
|
size: g = "md",
|
|
78
78
|
icon: o,
|
|
79
79
|
disabled: s,
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: a,
|
|
81
81
|
style: c,
|
|
82
82
|
className: n = ""
|
|
83
83
|
}) {
|
|
84
84
|
return T(W, []), /* @__PURE__ */ f(
|
|
85
85
|
"button",
|
|
86
86
|
{
|
|
87
|
-
className: `dhx dhx-btn dhx-btn-${
|
|
87
|
+
className: `dhx dhx-btn dhx-btn-${l} ${n}`,
|
|
88
88
|
style: { ...ke[g], ...c },
|
|
89
89
|
disabled: s,
|
|
90
|
-
onClick:
|
|
90
|
+
onClick: a,
|
|
91
91
|
children: [
|
|
92
92
|
o && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: o }),
|
|
93
93
|
r
|
|
@@ -95,7 +95,7 @@ function We({
|
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function Ee({ items: r = [], style:
|
|
98
|
+
function Ee({ items: r = [], style: l }) {
|
|
99
99
|
T(W, []);
|
|
100
100
|
const g = (o, s) => {
|
|
101
101
|
var c;
|
|
@@ -135,12 +135,12 @@ function Ee({ items: r = [], style: a }) {
|
|
|
135
135
|
},
|
|
136
136
|
s
|
|
137
137
|
);
|
|
138
|
-
const
|
|
138
|
+
const a = o.active;
|
|
139
139
|
return /* @__PURE__ */ f(
|
|
140
140
|
"button",
|
|
141
141
|
{
|
|
142
|
-
className: `dhx dhx-btn ${
|
|
143
|
-
style: { height: 32, gap: 4, ...o.twoState &&
|
|
142
|
+
className: `dhx dhx-btn ${a ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
|
|
143
|
+
style: { height: 32, gap: 4, ...o.twoState && a ? { background: e.primaryLt, color: e.primary, borderColor: `${e.primary}66` } : {} },
|
|
144
144
|
disabled: o.disabled,
|
|
145
145
|
onClick: () => {
|
|
146
146
|
var n;
|
|
@@ -154,12 +154,12 @@ function Ee({ items: r = [], style: a }) {
|
|
|
154
154
|
s
|
|
155
155
|
);
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...
|
|
157
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...l }, children: r.map(g) });
|
|
158
158
|
}
|
|
159
|
-
function Ae({ items: r = [], width:
|
|
159
|
+
function Ae({ items: r = [], width: l = 240, collapsed: g, onSelect: o, header: s, footer: a, style: c }) {
|
|
160
160
|
const [n, p] = z(g ?? !1), [m, d] = z(null), [h, i] = z({});
|
|
161
161
|
T(W, []);
|
|
162
|
-
const y = n ? 56 :
|
|
162
|
+
const y = n ? 56 : l, $ = (v) => {
|
|
163
163
|
d(v.id), o == null || o(v);
|
|
164
164
|
}, S = (v, N = 0) => {
|
|
165
165
|
var M;
|
|
@@ -191,11 +191,11 @@ function Ae({ items: r = [], width: a = 240, collapsed: g, onSelect: o, header:
|
|
|
191
191
|
s && !n && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: s }),
|
|
192
192
|
/* @__PURE__ */ t("button", { onClick: () => p((v) => !v), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: n ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: n ? "☰" : "✕" }) }),
|
|
193
193
|
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: r.map((v) => S(v)) }),
|
|
194
|
-
|
|
194
|
+
a && !n && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
|
|
195
195
|
] });
|
|
196
196
|
}
|
|
197
197
|
function we({ config: r }) {
|
|
198
|
-
const [
|
|
198
|
+
const [l, g] = z(!1), o = {
|
|
199
199
|
position: "relative",
|
|
200
200
|
background: e.surface,
|
|
201
201
|
border: `1px solid ${e.border}`,
|
|
@@ -203,34 +203,34 @@ function we({ config: r }) {
|
|
|
203
203
|
overflow: "hidden",
|
|
204
204
|
...r.width ? { width: r.width, minWidth: r.width } : { flex: 1 },
|
|
205
205
|
...r.height ? { height: r.height, minHeight: r.height } : { minHeight: 40 },
|
|
206
|
-
...
|
|
206
|
+
...l ? { flex: "0 0 auto" } : {}
|
|
207
207
|
};
|
|
208
208
|
return /* @__PURE__ */ f("div", { style: o, children: [
|
|
209
209
|
r.header && /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
|
|
210
210
|
/* @__PURE__ */ t("span", { children: r.header }),
|
|
211
|
-
r.collapsable && /* @__PURE__ */ t("button", { onClick: () => g((s) => !s), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children:
|
|
211
|
+
r.collapsable && /* @__PURE__ */ t("button", { onClick: () => g((s) => !s), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: l ? "▼" : "▲" })
|
|
212
212
|
] }),
|
|
213
|
-
!
|
|
213
|
+
!l && /* @__PURE__ */ f("div", { style: { padding: r.padding || 0, height: r.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
|
|
214
214
|
r.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: r.html } }) : r.content,
|
|
215
215
|
(r.rows || r.cols) && /* @__PURE__ */ t(Se, { rows: r.rows, cols: r.cols, style: { height: "100%" } })
|
|
216
216
|
] })
|
|
217
217
|
] });
|
|
218
218
|
}
|
|
219
|
-
function Se({ rows: r, cols:
|
|
219
|
+
function Se({ rows: r, cols: l, type: g = "line", style: o, children: s }) {
|
|
220
220
|
T(W, []);
|
|
221
|
-
const
|
|
222
|
-
return c ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: n ? "column" : "row", gap:
|
|
221
|
+
const a = g === "space" ? 12 : g === "wide" ? 8 : 1, c = r || l, n = !!r;
|
|
222
|
+
return c ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: n ? "column" : "row", gap: a, width: "100%", height: "100%", ...o }, children: c.map((p, m) => /* @__PURE__ */ t(we, { config: p }, p.id || m)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...o }, children: s });
|
|
223
223
|
}
|
|
224
|
-
function He({ views: r = [], mode:
|
|
224
|
+
function He({ views: r = [], mode: l = "top", tabAlign: g = "left", closable: o = [], disabled: s = [], defaultActive: a, onBeforeChange: c, onChange: n, style: p }) {
|
|
225
225
|
var x;
|
|
226
|
-
const [m, d] = z(
|
|
226
|
+
const [m, d] = z(a || ((x = r[0]) == null ? void 0 : x.id)), [h, i] = z(r.map((M) => M.id));
|
|
227
227
|
T(W, []);
|
|
228
228
|
const y = (M, D) => {
|
|
229
229
|
M.stopPropagation(), i((b) => b.filter((C) => C !== D)), m === D && d(h.find((b) => b !== D) ?? "");
|
|
230
230
|
}, $ = (M) => {
|
|
231
231
|
s.includes(M) || c && c(M) === !1 || (d(M), n == null || n(M));
|
|
232
|
-
}, S =
|
|
233
|
-
const D = m === M.id, b = s.includes(M.id), C =
|
|
232
|
+
}, S = l === "left" || l === "right", v = r.filter((M) => h.includes(M.id)), N = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: S ? "column" : "row", justifyContent: g === "center" ? "center" : g === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !S && l !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: l === "bottom" ? `2px solid ${e.border}` : "none", borderRight: l === "left" ? `2px solid ${e.border}` : "none", borderLeft: l === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: v.map((M) => {
|
|
233
|
+
const D = m === M.id, b = s.includes(M.id), C = l === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : S ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [l === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
|
|
234
234
|
return /* @__PURE__ */ f(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
@@ -248,23 +248,23 @@ function He({ views: r = [], mode: a = "top", tabAlign: g = "left", closable: o
|
|
|
248
248
|
k == null ? void 0 : k.content,
|
|
249
249
|
(k == null ? void 0 : k.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: k.html }, style: { padding: 16 } })
|
|
250
250
|
] });
|
|
251
|
-
return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", flexDirection:
|
|
251
|
+
return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", flexDirection: l === "top" ? "column" : l === "bottom" ? "column-reverse" : l === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...p }, children: [
|
|
252
252
|
N,
|
|
253
253
|
u
|
|
254
254
|
] });
|
|
255
255
|
}
|
|
256
|
-
function Be({ columns: r, data:
|
|
256
|
+
function Be({ columns: r, data: l = [], height: g = 400, rowHeight: o = 40, sortable: s = !0, resizable: a = !0, selection: c, multiselect: n, onSelect: p, style: m }) {
|
|
257
257
|
const [d, h] = z(null), [i, y] = z("asc"), [$, S] = z({}), [v, N] = z(/* @__PURE__ */ new Set()), [k, u] = z(r.map((w) => w.width || w.minWidth || 140));
|
|
258
258
|
T(W, []);
|
|
259
259
|
const x = F(() => {
|
|
260
|
-
let w =
|
|
260
|
+
let w = l.filter(
|
|
261
261
|
(L) => Object.entries($).every(([E, I]) => !I || String(L[E] ?? "").toLowerCase().includes(I.toLowerCase()))
|
|
262
262
|
);
|
|
263
263
|
return d && (w = [...w].sort((L, E) => {
|
|
264
264
|
const I = L[d], R = E[d];
|
|
265
265
|
return I == null ? 1 : R == null ? -1 : i === "asc" ? I < R ? -1 : I > R ? 1 : 0 : I > R ? -1 : I < R ? 1 : 0;
|
|
266
266
|
})), w;
|
|
267
|
-
}, [
|
|
267
|
+
}, [l, d, i, $]), M = (w) => {
|
|
268
268
|
!s || w.sortable === !1 || (y((L) => d === w.id && L === "asc" ? "desc" : "asc"), h(w.id));
|
|
269
269
|
}, D = (w, L) => {
|
|
270
270
|
if (!c) return;
|
|
@@ -293,7 +293,7 @@ function Be({ columns: r, data: a = [], height: g = 400, rowHeight: o = 40, sort
|
|
|
293
293
|
children: [
|
|
294
294
|
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(w.header) ? (E = w.header[0]) == null ? void 0 : E.text : w.header || w.id }),
|
|
295
295
|
s && w.sortable !== !1 && /* @__PURE__ */ t("span", { style: { opacity: d === w.id ? 1 : 0.25, fontSize: 10 }, children: d === w.id ? i === "asc" ? "▲" : "▼" : "⇅" }),
|
|
296
|
-
|
|
296
|
+
a && L < r.length - 1 && /* @__PURE__ */ t(
|
|
297
297
|
"div",
|
|
298
298
|
{
|
|
299
299
|
onMouseDown: (I) => b(I, L),
|
|
@@ -328,10 +328,10 @@ function Be({ columns: r, data: a = [], height: g = 400, rowHeight: o = 40, sort
|
|
|
328
328
|
] }) }) });
|
|
329
329
|
}
|
|
330
330
|
const A = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
|
|
331
|
-
function je({ type: r = "bar", data:
|
|
331
|
+
function je({ type: r = "bar", data: l = [], series: g = [], scales: o = {}, legend: s, height: a = 280, style: c }) {
|
|
332
332
|
var S, v, N, k, u;
|
|
333
333
|
T(W, []);
|
|
334
|
-
const n = ((S = o.bottom) == null ? void 0 : S.text) ||
|
|
334
|
+
const n = ((S = o.bottom) == null ? void 0 : S.text) || l[0] && Object.keys(l[0])[0] || "x", p = /* @__PURE__ */ t(re, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), m = s ? /* @__PURE__ */ t(ne, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: s.valign, align: s.halign }) : null, d = /* @__PURE__ */ t(oe, { strokeDasharray: "3 3", stroke: e.border }), h = /* @__PURE__ */ t(_, { dataKey: n, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), i = /* @__PURE__ */ t(X, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((v = o.left) == null ? void 0 : v.min) ?? "auto", ((N = o.left) == null ? void 0 : N.max) ?? "auto"] }), y = { data: l, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
|
|
335
335
|
let $;
|
|
336
336
|
if (r === "bar")
|
|
337
337
|
$ = /* @__PURE__ */ f(ie, { ...y, children: [
|
|
@@ -340,10 +340,10 @@ function je({ type: r = "bar", data: a = [], series: g = [], scales: o = {}, leg
|
|
|
340
340
|
i,
|
|
341
341
|
p,
|
|
342
342
|
m,
|
|
343
|
-
g.map((x, M) => /* @__PURE__ */ t(
|
|
343
|
+
g.map((x, M) => /* @__PURE__ */ t(le, { dataKey: x.value || x.id, name: x.label || x.id, fill: x.fill || A[M % A.length], radius: [3, 3, 0, 0] }, x.id))
|
|
344
344
|
] });
|
|
345
345
|
else if (r === "line")
|
|
346
|
-
$ = /* @__PURE__ */ f(
|
|
346
|
+
$ = /* @__PURE__ */ f(ae, { ...y, children: [
|
|
347
347
|
d,
|
|
348
348
|
h,
|
|
349
349
|
i,
|
|
@@ -361,12 +361,12 @@ function je({ type: r = "bar", data: a = [], series: g = [], scales: o = {}, leg
|
|
|
361
361
|
g.map((x, M) => /* @__PURE__ */ t(ce, { type: "monotone", dataKey: x.value || x.id, name: x.label || x.id, stroke: x.color || A[M % A.length], fill: (x.fill || A[M % A.length]) + "33", strokeWidth: 2 }, x.id))
|
|
362
362
|
] });
|
|
363
363
|
else if (r === "pie" || r === "donut") {
|
|
364
|
-
const x =
|
|
364
|
+
const x = l[0] || {}, M = Object.keys(x).find((b) => typeof x[b] == "number") || "value", D = Object.keys(x).find((b) => typeof x[b] == "string") || "x";
|
|
365
365
|
$ = /* @__PURE__ */ f(pe, { children: [
|
|
366
366
|
/* @__PURE__ */ t(
|
|
367
367
|
ue,
|
|
368
368
|
{
|
|
369
|
-
data:
|
|
369
|
+
data: l,
|
|
370
370
|
cx: "50%",
|
|
371
371
|
cy: "50%",
|
|
372
372
|
outerRadius: r === "donut" ? "70%" : "80%",
|
|
@@ -376,7 +376,7 @@ function je({ type: r = "bar", data: a = [], series: g = [], scales: o = {}, leg
|
|
|
376
376
|
label: ({ name: b, percent: C }) => `${b ?? ""} ${((C ?? 0) * 100).toFixed(0)}%`,
|
|
377
377
|
labelLine: !0,
|
|
378
378
|
paddingAngle: 2,
|
|
379
|
-
children:
|
|
379
|
+
children: l.map((b, C) => /* @__PURE__ */ t(he, { fill: A[C % A.length] }, C))
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
382
|
p,
|
|
@@ -393,20 +393,20 @@ function je({ type: r = "bar", data: a = [], series: g = [], scales: o = {}, leg
|
|
|
393
393
|
/* @__PURE__ */ t(_, { dataKey: ((k = g[0]) == null ? void 0 : k.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
|
|
394
394
|
/* @__PURE__ */ t(X, { dataKey: ((u = g[0]) == null ? void 0 : u.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
|
|
395
395
|
p,
|
|
396
|
-
g.map((x, M) => /* @__PURE__ */ t(me, { data: x.data ||
|
|
396
|
+
g.map((x, M) => /* @__PURE__ */ t(me, { data: x.data || l, name: x.label || x.id, fill: x.color || A[M] }, x.id))
|
|
397
397
|
] }));
|
|
398
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height:
|
|
398
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...c }, children: /* @__PURE__ */ t(ve, { width: "100%", height: "100%", children: $ }) });
|
|
399
399
|
}
|
|
400
400
|
const Me = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], $e = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
401
|
-
function Ye({ value: r, range:
|
|
402
|
-
const
|
|
401
|
+
function Ye({ value: r, range: l = !1, timepicker: g = !1, onChange: o, style: s }) {
|
|
402
|
+
const a = /* @__PURE__ */ new Date(), c = r ? new Date(Array.isArray(r) ? r[0] : r) : a, [n, p] = z(c), [m, d] = z(r ?? (l ? [null, null] : null)), [h, i] = z(null), [y, $] = z({ h: 0, m: 0 });
|
|
403
403
|
T(W, []);
|
|
404
404
|
const S = n.getFullYear(), v = n.getMonth(), N = new Date(S, v, 1).getDay(), k = new Date(S, v + 1, 0).getDate(), u = [];
|
|
405
405
|
for (let b = 0; b < N; b++) u.push(null);
|
|
406
406
|
for (let b = 1; b <= k; b++) u.push(new Date(S, v, b));
|
|
407
|
-
const x = (b) => b.toDateString() ===
|
|
407
|
+
const x = (b) => b.toDateString() === a.toDateString(), M = (b) => {
|
|
408
408
|
if (!m) return !1;
|
|
409
|
-
if (
|
|
409
|
+
if (l && Array.isArray(m)) {
|
|
410
410
|
const [C, w] = m;
|
|
411
411
|
if (!C) return !1;
|
|
412
412
|
const L = b.getTime();
|
|
@@ -414,7 +414,7 @@ function Ye({ value: r, range: a = !1, timepicker: g = !1, onChange: o, style: s
|
|
|
414
414
|
}
|
|
415
415
|
return b.toDateString() === m.toDateString();
|
|
416
416
|
}, D = (b) => {
|
|
417
|
-
if (
|
|
417
|
+
if (l) {
|
|
418
418
|
const [C, w] = Array.isArray(m) ? m : [null, null];
|
|
419
419
|
if (!C || w)
|
|
420
420
|
d([b, null]);
|
|
@@ -459,19 +459,19 @@ function Ye({ value: r, range: a = !1, timepicker: g = !1, onChange: o, style: s
|
|
|
459
459
|
] })
|
|
460
460
|
] });
|
|
461
461
|
}
|
|
462
|
-
function Oe({ value: r, onChange:
|
|
463
|
-
const [o, s] = z((r == null ? void 0 : r.h) ?? 12), [
|
|
462
|
+
function Oe({ value: r, onChange: l, style: g }) {
|
|
463
|
+
const [o, s] = z((r == null ? void 0 : r.h) ?? 12), [a, c] = z((r == null ? void 0 : r.m) ?? 0), [n, p] = z((r == null ? void 0 : r.ampm) ?? "AM");
|
|
464
464
|
T(W, []);
|
|
465
465
|
const m = Array.from({ length: 12 }, (h, i) => i + 1), d = Array.from({ length: 12 }, (h, i) => i * 5);
|
|
466
466
|
return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
|
|
467
467
|
/* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
|
|
468
|
-
[{ label: "Hours", values: m, val: o, setFn: s }, { label: "Minutes", values: d, val:
|
|
468
|
+
[{ label: "Hours", values: m, val: o, setFn: s }, { label: "Minutes", values: d, val: a, setFn: c }].map(({ label: h, values: i, val: y, setFn: $ }) => /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, children: [
|
|
469
469
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: h }),
|
|
470
470
|
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: i.map((S) => /* @__PURE__ */ t(
|
|
471
471
|
"div",
|
|
472
472
|
{
|
|
473
473
|
onClick: () => {
|
|
474
|
-
$(S),
|
|
474
|
+
$(S), l == null || l({ h: h === "Hours" ? S : o, m: h === "Minutes" ? S : a, ampm: n });
|
|
475
475
|
},
|
|
476
476
|
style: { height: 32, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", fontSize: 13, fontWeight: y === S ? 700 : 400, background: y === S ? e.primaryLt : "transparent", color: y === S ? e.primary : e.text },
|
|
477
477
|
onMouseEnter: (v) => y !== S && (v.currentTarget.style.background = e.bg),
|
|
@@ -487,7 +487,7 @@ function Oe({ value: r, onChange: a, style: g }) {
|
|
|
487
487
|
"div",
|
|
488
488
|
{
|
|
489
489
|
onClick: () => {
|
|
490
|
-
p(h),
|
|
490
|
+
p(h), l == null || l({ h: o, m: a, ampm: h });
|
|
491
491
|
},
|
|
492
492
|
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: n === h ? 700 : 400, background: n === h ? e.primary : e.surface, color: n === h ? "#fff" : e.text },
|
|
493
493
|
children: h
|
|
@@ -499,48 +499,48 @@ function Oe({ value: r, onChange: a, style: g }) {
|
|
|
499
499
|
/* @__PURE__ */ f("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
|
|
500
500
|
String(o).padStart(2, "0"),
|
|
501
501
|
":",
|
|
502
|
-
String(
|
|
502
|
+
String(a).padStart(2, "0"),
|
|
503
503
|
" ",
|
|
504
504
|
n
|
|
505
505
|
] })
|
|
506
506
|
] });
|
|
507
507
|
}
|
|
508
|
-
function Y(r,
|
|
508
|
+
function Y(r, l) {
|
|
509
509
|
T(() => {
|
|
510
510
|
const g = (o) => {
|
|
511
|
-
r.current && !r.current.contains(o.target) &&
|
|
511
|
+
r.current && !r.current.contains(o.target) && l(o);
|
|
512
512
|
};
|
|
513
513
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
514
|
-
}, [r,
|
|
514
|
+
}, [r, l]);
|
|
515
515
|
}
|
|
516
516
|
function ze(r) {
|
|
517
|
-
const
|
|
517
|
+
const l = B(!1), g = B({ x: 0, y: 0, ox: 0, oy: 0 });
|
|
518
518
|
return H(
|
|
519
|
-
(o, s = 0,
|
|
520
|
-
|
|
519
|
+
(o, s = 0, a = 0) => {
|
|
520
|
+
l.current = !0, g.current = { x: o.clientX, y: o.clientY, ox: s, oy: a };
|
|
521
521
|
const c = (p) => {
|
|
522
|
-
if (!
|
|
522
|
+
if (!l.current) return;
|
|
523
523
|
const { x: m, y: d, ox: h, oy: i } = g.current;
|
|
524
524
|
r(h + p.clientX - m, i + p.clientY - d);
|
|
525
525
|
}, n = () => {
|
|
526
|
-
|
|
526
|
+
l.current = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", n);
|
|
527
527
|
};
|
|
528
528
|
document.addEventListener("mousemove", c), document.addEventListener("mouseup", n), o.preventDefault();
|
|
529
529
|
},
|
|
530
530
|
[r]
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
|
-
function Ne({ data: r = [], value:
|
|
533
|
+
function Ne({ data: r = [], value: l, placeholder: g = "Select or type...", multiselection: o = !1, label: s, onChange: a, style: c }) {
|
|
534
534
|
var k;
|
|
535
|
-
const [n, p] = z(!1), [m, d] = z(""), [h, i] = z(o ?
|
|
535
|
+
const [n, p] = z(!1), [m, d] = z(""), [h, i] = z(o ? l ? [].concat(l) : [] : l || null), y = B(null);
|
|
536
536
|
T(W, []), Y(y, H(() => p(!1), []));
|
|
537
537
|
const $ = F(() => r.filter((u) => !m || u.value.toLowerCase().includes(m.toLowerCase())), [r, m]), S = (u) => o ? (h || []).includes(u) : h === u, v = (u) => {
|
|
538
538
|
const x = u.id || u.value;
|
|
539
539
|
if (o) {
|
|
540
540
|
const M = S(x) ? h.filter((D) => D !== x) : [...h || [], x];
|
|
541
|
-
i(M),
|
|
541
|
+
i(M), a == null || a(M);
|
|
542
542
|
} else
|
|
543
|
-
i(x), d(""), p(!1),
|
|
543
|
+
i(x), d(""), p(!1), a == null || a(x);
|
|
544
544
|
}, N = o ? h != null && h.length ? `${h.length} selected` : "" : ((k = r.find((u) => (u.id || u.value) === h)) == null ? void 0 : k.value) || "";
|
|
545
545
|
return /* @__PURE__ */ f("div", { ref: y, className: "dhx", style: { position: "relative", ...c }, children: [
|
|
546
546
|
s && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: s }),
|
|
@@ -593,8 +593,8 @@ function Ne({ data: r = [], value: a, placeholder: g = "Select or type...", mult
|
|
|
593
593
|
] })
|
|
594
594
|
] });
|
|
595
595
|
}
|
|
596
|
-
function Ce({ min: r = 0, max:
|
|
597
|
-
const [m, d] = z(o ?? (s ? [r,
|
|
596
|
+
function Ce({ min: r = 0, max: l = 100, step: g = 1, value: o, range: s = !1, label: a, tick: c, onChange: n, style: p }) {
|
|
597
|
+
const [m, d] = z(o ?? (s ? [r, l] : r));
|
|
598
598
|
T(W, []);
|
|
599
599
|
const h = (S, v) => {
|
|
600
600
|
if (s) {
|
|
@@ -602,9 +602,9 @@ function Ce({ min: r = 0, max: a = 100, step: g = 1, value: o, range: s = !1, la
|
|
|
602
602
|
N[S] = v, d(N), n == null || n(N);
|
|
603
603
|
} else
|
|
604
604
|
d(v), n == null || n(v);
|
|
605
|
-
}, i = (S) => (S - r) / (
|
|
605
|
+
}, i = (S) => (S - r) / (l - r) * 100, y = s ? m : [m], $ = s ? { left: `${i(y[0])}%`, width: `${i(y[1]) - i(y[0])}%` } : { left: 0, width: `${i(y[0])}%` };
|
|
606
606
|
return /* @__PURE__ */ f("div", { className: "dhx", style: { width: "100%", ...p }, children: [
|
|
607
|
-
|
|
607
|
+
a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
|
|
608
608
|
/* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ f("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
|
|
609
609
|
/* @__PURE__ */ t("div", { style: { position: "absolute", ...$, height: "100%", background: e.primary, borderRadius: 2 } }),
|
|
610
610
|
y.map((S, v) => /* @__PURE__ */ t(
|
|
@@ -612,7 +612,7 @@ function Ce({ min: r = 0, max: a = 100, step: g = 1, value: o, range: s = !1, la
|
|
|
612
612
|
{
|
|
613
613
|
type: "range",
|
|
614
614
|
min: r,
|
|
615
|
-
max:
|
|
615
|
+
max: l,
|
|
616
616
|
step: g,
|
|
617
617
|
value: S,
|
|
618
618
|
onChange: (N) => {
|
|
@@ -625,33 +625,33 @@ function Ce({ min: r = 0, max: a = 100, step: g = 1, value: o, range: s = !1, la
|
|
|
625
625
|
)),
|
|
626
626
|
y.map((S, v) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${i(S)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${e.primary}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: S }) }, v))
|
|
627
627
|
] }) }),
|
|
628
|
-
c && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [r, Math.round((
|
|
628
|
+
c && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [r, Math.round((l + r) / 2), l].map((S) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: S }, S)) })
|
|
629
629
|
] });
|
|
630
630
|
}
|
|
631
631
|
const Le = ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b", "#9e9e9e", "#000000", "#ffffff", "#0288d1", "#01579b", "#43a047", "#e53935", "#f57c00"];
|
|
632
632
|
function P(r) {
|
|
633
|
-
const
|
|
633
|
+
const l = parseInt(r.slice(1, 3), 16) / 255, g = parseInt(r.slice(3, 5), 16) / 255, o = parseInt(r.slice(5, 7), 16) / 255, s = Math.max(l, g, o), a = Math.min(l, g, o);
|
|
634
634
|
let c = 0, n = 0;
|
|
635
|
-
const p = (s +
|
|
636
|
-
if (s !==
|
|
637
|
-
const m = s -
|
|
638
|
-
n = p > 0.5 ? m / (2 - s -
|
|
635
|
+
const p = (s + a) / 2;
|
|
636
|
+
if (s !== a) {
|
|
637
|
+
const m = s - a;
|
|
638
|
+
n = p > 0.5 ? m / (2 - s - a) : m / (s + a), c = s === l ? ((g - o) / m + (g < o ? 6 : 0)) / 6 : s === g ? ((o - l) / m + 2) / 6 : ((l - g) / m + 4) / 6;
|
|
639
639
|
}
|
|
640
640
|
return [Math.round(c * 360), Math.round(n * 100), Math.round(p * 100)];
|
|
641
641
|
}
|
|
642
|
-
function q(r,
|
|
643
|
-
|
|
644
|
-
const o =
|
|
645
|
-
const c = (
|
|
642
|
+
function q(r, l, g) {
|
|
643
|
+
l /= 100, g /= 100;
|
|
644
|
+
const o = l * Math.min(g, 1 - g), s = (a) => {
|
|
645
|
+
const c = (a + r / 30) % 12, n = g - o * Math.max(Math.min(c - 3, 9 - c, 1), -1);
|
|
646
646
|
return Math.round(255 * n).toString(16).padStart(2, "0");
|
|
647
647
|
};
|
|
648
648
|
return "#" + s(0) + s(8) + s(4);
|
|
649
649
|
}
|
|
650
|
-
function Pe({ value: r = "#0288d1", onChange:
|
|
651
|
-
const [o, s] = z(() => P(r)),
|
|
650
|
+
function Pe({ value: r = "#0288d1", onChange: l, style: g }) {
|
|
651
|
+
const [o, s] = z(() => P(r)), a = q(...o);
|
|
652
652
|
T(W, []);
|
|
653
653
|
const c = (n) => {
|
|
654
|
-
s(n),
|
|
654
|
+
s(n), l == null || l(q(...n));
|
|
655
655
|
};
|
|
656
656
|
return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
|
|
657
657
|
/* @__PURE__ */ t("div", { style: { width: 200, height: 120, borderRadius: e.r, marginBottom: 12, background: `linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, hsl(${o[0]},100%,50%))`, cursor: "crosshair" } }),
|
|
@@ -666,16 +666,16 @@ function Pe({ value: r = "#0288d1", onChange: a, style: g }) {
|
|
|
666
666
|
}, style: { width: "100%", accentColor: e.primary } })
|
|
667
667
|
] }, n)),
|
|
668
668
|
/* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
669
|
-
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background:
|
|
669
|
+
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
|
|
670
670
|
/* @__PURE__ */ t(
|
|
671
671
|
"input",
|
|
672
672
|
{
|
|
673
673
|
className: "dhx dhx-input",
|
|
674
674
|
style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
|
|
675
|
-
value:
|
|
675
|
+
value: a,
|
|
676
676
|
onChange: (n) => {
|
|
677
677
|
try {
|
|
678
|
-
c(P(n.target.value)),
|
|
678
|
+
c(P(n.target.value)), l == null || l(n.target.value);
|
|
679
679
|
} catch {
|
|
680
680
|
}
|
|
681
681
|
}
|
|
@@ -686,9 +686,9 @@ function Pe({ value: r = "#0288d1", onChange: a, style: g }) {
|
|
|
686
686
|
"div",
|
|
687
687
|
{
|
|
688
688
|
onClick: () => {
|
|
689
|
-
s(P(n)),
|
|
689
|
+
s(P(n)), l == null || l(n);
|
|
690
690
|
},
|
|
691
|
-
style: { width: 14, height: 14, borderRadius: 2, background: n, cursor: "pointer", border:
|
|
691
|
+
style: { width: 14, height: 14, borderRadius: 2, background: n, cursor: "pointer", border: a === n ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
|
|
692
692
|
onMouseEnter: (p) => p.currentTarget.style.transform = "scale(1.3)",
|
|
693
693
|
onMouseLeave: (p) => p.currentTarget.style.transform = "scale(1)"
|
|
694
694
|
},
|
|
@@ -696,11 +696,11 @@ function Pe({ value: r = "#0288d1", onChange: a, style: g }) {
|
|
|
696
696
|
)) })
|
|
697
697
|
] });
|
|
698
698
|
}
|
|
699
|
-
function O({ items: r, onSelect:
|
|
699
|
+
function O({ items: r, onSelect: l, style: g }) {
|
|
700
700
|
const [o, s] = z(null);
|
|
701
|
-
return /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, minWidth: 180, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 200, padding: "4px 0", ...g }, children: r.map((
|
|
701
|
+
return /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, minWidth: 180, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 200, padding: "4px 0", ...g }, children: r.map((a, c) => {
|
|
702
702
|
var p, m;
|
|
703
|
-
if (
|
|
703
|
+
if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, c);
|
|
704
704
|
const n = o === c;
|
|
705
705
|
return /* @__PURE__ */ f("div", { style: { position: "relative" }, onMouseEnter: () => s(c), onMouseLeave: () => s(null), children: [
|
|
706
706
|
/* @__PURE__ */ f(
|
|
@@ -708,50 +708,50 @@ function O({ items: r, onSelect: a, style: g }) {
|
|
|
708
708
|
{
|
|
709
709
|
onClick: () => {
|
|
710
710
|
var d;
|
|
711
|
-
return !
|
|
711
|
+
return !a.disabled && !((d = a.items) != null && d.length) && l(a);
|
|
712
712
|
},
|
|
713
|
-
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor:
|
|
713
|
+
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: n && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
|
|
714
714
|
children: [
|
|
715
|
-
|
|
716
|
-
/* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
717
|
-
|
|
718
|
-
(p =
|
|
715
|
+
a.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: a.icon }),
|
|
716
|
+
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value || a.id }),
|
|
717
|
+
a.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: a.hotkey }),
|
|
718
|
+
(p = a.items) != null && p.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
),
|
|
722
|
-
n && ((m =
|
|
723
|
-
] },
|
|
722
|
+
n && ((m = a.items) != null && m.length) ? /* @__PURE__ */ t(O, { items: a.items, onSelect: l, style: { position: "absolute", left: "100%", top: -4 } }) : null
|
|
723
|
+
] }, a.id || c);
|
|
724
724
|
}) });
|
|
725
725
|
}
|
|
726
|
-
function Fe({ items: r = [], label:
|
|
727
|
-
const [s,
|
|
728
|
-
return T(W, []), Y(c, H(() =>
|
|
729
|
-
/* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () =>
|
|
730
|
-
|
|
726
|
+
function Fe({ items: r = [], label: l = "Menu", onSelect: g, style: o }) {
|
|
727
|
+
const [s, a] = z(!1), c = B(null);
|
|
728
|
+
return T(W, []), Y(c, H(() => a(!1), [])), /* @__PURE__ */ f("div", { ref: c, className: "dhx", style: { position: "relative", display: "inline-block", ...o }, children: [
|
|
729
|
+
/* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((n) => !n), children: [
|
|
730
|
+
l,
|
|
731
731
|
" ",
|
|
732
732
|
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: s ? "▲" : "▼" })
|
|
733
733
|
] }),
|
|
734
734
|
s && /* @__PURE__ */ t(O, { items: r, onSelect: (n) => {
|
|
735
|
-
g == null || g(n),
|
|
735
|
+
g == null || g(n), a(!1);
|
|
736
736
|
} })
|
|
737
737
|
] });
|
|
738
738
|
}
|
|
739
|
-
function Ke({ items: r = [], onSelect:
|
|
740
|
-
const [o, s] = z(null),
|
|
741
|
-
return T(W, []), Y(
|
|
739
|
+
function Ke({ items: r = [], onSelect: l, children: g }) {
|
|
740
|
+
const [o, s] = z(null), a = B(null);
|
|
741
|
+
return T(W, []), Y(a, H(() => s(null), [])), /* @__PURE__ */ f("div", { ref: a, onContextMenu: (n) => {
|
|
742
742
|
n.preventDefault(), s({ x: n.clientX, y: n.clientY });
|
|
743
743
|
}, style: { position: "relative", display: "contents" }, children: [
|
|
744
744
|
g,
|
|
745
745
|
o && /* @__PURE__ */ t("div", { style: { position: "fixed", left: o.x, top: o.y, zIndex: 9999 }, children: /* @__PURE__ */ t(O, { items: r, onSelect: (n) => {
|
|
746
|
-
|
|
746
|
+
l == null || l(n), s(null);
|
|
747
747
|
} }) })
|
|
748
748
|
] });
|
|
749
749
|
}
|
|
750
|
-
function _e({ trigger: r, children:
|
|
751
|
-
const [s,
|
|
752
|
-
return T(W, []), Y(p, H(() =>
|
|
750
|
+
function _e({ trigger: r, children: l, placement: g = "bottom-start", style: o }) {
|
|
751
|
+
const [s, a] = z(!1), [c, n] = z({ top: "100%", left: 0 }), p = B(null), m = B(null);
|
|
752
|
+
return T(W, []), Y(p, H(() => a(!1), [])), /* @__PURE__ */ f("div", { ref: p, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
|
|
753
753
|
/* @__PURE__ */ t("div", { ref: m, onClick: () => {
|
|
754
|
-
|
|
754
|
+
a((h) => {
|
|
755
755
|
if (!h && m.current) {
|
|
756
756
|
const i = m.current.getBoundingClientRect(), y = {
|
|
757
757
|
"bottom-start": { top: i.height + 4, left: 0 },
|
|
@@ -763,19 +763,19 @@ function _e({ trigger: r, children: a, placement: g = "bottom-start", style: o }
|
|
|
763
763
|
return !h;
|
|
764
764
|
});
|
|
765
765
|
}, children: r }),
|
|
766
|
-
s && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...c, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...o }, children:
|
|
766
|
+
s && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...c, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...o }, children: l })
|
|
767
767
|
] });
|
|
768
768
|
}
|
|
769
|
-
function Xe({ title: r, children:
|
|
769
|
+
function Xe({ title: r, children: l, width: g = 480, height: o, closable: s = !0, movable: a = !0, modal: c = !1, defaultOpen: n = !0, footer: p, onClose: m, style: d }) {
|
|
770
770
|
const [h, i] = z(n), [y, $] = z({ x: 0, y: 0 });
|
|
771
771
|
T(W, []);
|
|
772
|
-
const S = ze(H((N, k) =>
|
|
772
|
+
const S = ze(H((N, k) => a && $({ x: N, y: k }), [a])), v = () => {
|
|
773
773
|
i(!1), m == null || m();
|
|
774
774
|
};
|
|
775
775
|
return h ? /* @__PURE__ */ f(Z, { children: [
|
|
776
776
|
c && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: s ? v : void 0 }),
|
|
777
777
|
/* @__PURE__ */ f("div", { className: "dhx", style: { position: c ? "fixed" : "absolute", left: c ? "50%" : `calc(50% + ${y.x}px)`, top: c ? "50%" : `calc(50% + ${y.y}px)`, transform: `translate(calc(-50% + ${y.x}px), calc(-50% + ${y.y}px))`, width: g, ...o ? { height: o } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...d }, children: [
|
|
778
|
-
/* @__PURE__ */ f("div", { onMouseDown: (N) => S(N, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor:
|
|
778
|
+
/* @__PURE__ */ f("div", { onMouseDown: (N) => S(N, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
|
|
779
779
|
/* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: r }),
|
|
780
780
|
s && /* @__PURE__ */ t(
|
|
781
781
|
"button",
|
|
@@ -788,26 +788,26 @@ function Xe({ title: r, children: a, width: g = 480, height: o, closable: s = !0
|
|
|
788
788
|
}
|
|
789
789
|
)
|
|
790
790
|
] }),
|
|
791
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, padding: 20, overflowY: "auto" }, children:
|
|
791
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: l }),
|
|
792
792
|
p && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: p })
|
|
793
793
|
] })
|
|
794
794
|
] }) : null;
|
|
795
795
|
}
|
|
796
796
|
const J = ee(null), De = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, G = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
|
|
797
797
|
function Ve({ children: r }) {
|
|
798
|
-
const [
|
|
798
|
+
const [l, g] = z([]);
|
|
799
799
|
T(W, []);
|
|
800
800
|
const o = H((c) => g((n) => n.filter((p) => p.id !== c)), []), s = H((c) => {
|
|
801
801
|
const n = Date.now();
|
|
802
802
|
return g((p) => [...p, { id: n, ...c }]), c.duration !== 0 && setTimeout(() => o(n), c.duration || 4e3), n;
|
|
803
|
-
}, [o]),
|
|
803
|
+
}, [o]), a = {
|
|
804
804
|
message: s,
|
|
805
805
|
alert: (c, n) => s({ type: "info", title: c, ...n }),
|
|
806
806
|
confirm: (c, n, p) => s({ type: "warning", title: c, confirm: n, ...p })
|
|
807
807
|
};
|
|
808
|
-
return /* @__PURE__ */ f(J.Provider, { value:
|
|
808
|
+
return /* @__PURE__ */ f(J.Provider, { value: a, children: [
|
|
809
809
|
r,
|
|
810
|
-
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children:
|
|
810
|
+
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: l.map((c) => {
|
|
811
811
|
const n = c.type || "info";
|
|
812
812
|
return /* @__PURE__ */ f("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${G[n]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
|
|
813
813
|
/* @__PURE__ */ t("span", { style: { fontSize: 18, color: G[n], lineHeight: 1 }, children: De[n] }),
|
|
@@ -833,7 +833,7 @@ function qe() {
|
|
|
833
833
|
if (!r) throw new Error("useMessage must be used inside <MessageProvider>");
|
|
834
834
|
return r;
|
|
835
835
|
}
|
|
836
|
-
function Ge({ data: r = [], template:
|
|
836
|
+
function Ge({ data: r = [], template: l, keyNavigation: g = !0, multiselection: o = !1, editable: s = !1, height: a = 400, onSelect: c, onEdit: n, style: p }) {
|
|
837
837
|
const [m, d] = z(/* @__PURE__ */ new Set()), [h, i] = z(null), [y, $] = z(""), [S, v] = z(null);
|
|
838
838
|
T(W, []);
|
|
839
839
|
const N = (u, x) => {
|
|
@@ -849,7 +849,7 @@ function Ge({ data: r = [], template: a, keyNavigation: g = !0, multiselection:
|
|
|
849
849
|
"div",
|
|
850
850
|
{
|
|
851
851
|
className: "dhx dhx-scroll",
|
|
852
|
-
style: { height:
|
|
852
|
+
style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...p },
|
|
853
853
|
tabIndex: 0,
|
|
854
854
|
onKeyDown: (u) => {
|
|
855
855
|
g && (u.key === "ArrowDown" && v((x) => Math.min((x ?? -1) + 1, r.length - 1)), u.key === "ArrowUp" && v((x) => Math.max((x ?? 1) - 1, 0)));
|
|
@@ -877,7 +877,7 @@ function Ge({ data: r = [], template: a, keyNavigation: g = !0, multiselection:
|
|
|
877
877
|
},
|
|
878
878
|
onClick: (C) => C.stopPropagation()
|
|
879
879
|
}
|
|
880
|
-
) :
|
|
880
|
+
) : l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(u) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(u.value ?? "") })
|
|
881
881
|
},
|
|
882
882
|
String(M)
|
|
883
883
|
);
|
|
@@ -887,7 +887,7 @@ function Ge({ data: r = [], template: a, keyNavigation: g = !0, multiselection:
|
|
|
887
887
|
}
|
|
888
888
|
);
|
|
889
889
|
}
|
|
890
|
-
function Je({ data: r = [], template:
|
|
890
|
+
function Je({ data: r = [], template: l, itemsInRow: g = 3, gap: o = 12, multiselection: s = !1, onSelect: a, style: c }) {
|
|
891
891
|
const [n, p] = z(/* @__PURE__ */ new Set());
|
|
892
892
|
T(W, []);
|
|
893
893
|
const m = (d) => {
|
|
@@ -895,7 +895,7 @@ function Je({ data: r = [], template: a, itemsInRow: g = 3, gap: o = 12, multise
|
|
|
895
895
|
p((i) => {
|
|
896
896
|
const y = s ? new Set(i) : /* @__PURE__ */ new Set();
|
|
897
897
|
return y.has(h) ? y.delete(h) : y.add(h), y;
|
|
898
|
-
}),
|
|
898
|
+
}), a == null || a(d);
|
|
899
899
|
};
|
|
900
900
|
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${g}, 1fr)`, gap: o, padding: o, ...c }, children: r.map((d, h) => {
|
|
901
901
|
const i = d.id ?? h, y = n.has(i);
|
|
@@ -910,7 +910,7 @@ function Je({ data: r = [], template: a, itemsInRow: g = 3, gap: o = 12, multise
|
|
|
910
910
|
onMouseLeave: ($) => {
|
|
911
911
|
$.currentTarget.style.boxShadow = y ? `0 0 0 3px ${e.primary}33` : e.shadow, $.currentTarget.style.transform = y ? "translateY(-2px)" : "none";
|
|
912
912
|
},
|
|
913
|
-
children:
|
|
913
|
+
children: l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(d) } }) : /* @__PURE__ */ f("div", { style: { padding: 16 }, children: [
|
|
914
914
|
d.img && /* @__PURE__ */ t("img", { src: d.img, alt: d.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
|
|
915
915
|
/* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: d.title || d.value }),
|
|
916
916
|
d.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: d.subtitle })
|
|
@@ -920,7 +920,7 @@ function Je({ data: r = [], template: a, itemsInRow: g = 3, gap: o = 12, multise
|
|
|
920
920
|
);
|
|
921
921
|
}) });
|
|
922
922
|
}
|
|
923
|
-
function Ue({ data: r = [], checkbox:
|
|
923
|
+
function Ue({ data: r = [], checkbox: l = !1, editable: g = !1, onSelect: o, onCheck: s, style: a }) {
|
|
924
924
|
const [c, n] = z({}), [p, m] = z(null), [d, h] = z({}), [i, y] = z(null), [$, S] = z("");
|
|
925
925
|
T(W, []);
|
|
926
926
|
const v = (u) => n((x) => ({ ...x, [u]: !x[u] })), N = (u, x) => {
|
|
@@ -944,7 +944,7 @@ function Ue({ data: r = [], checkbox: a = !1, editable: g = !1, onSelect: o, onC
|
|
|
944
944
|
children: [
|
|
945
945
|
/* @__PURE__ */ t("span", { style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 }, children: M ? D ? "▾" : "▸" : "" }),
|
|
946
946
|
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: M ? D ? "📂" : "📁" : "📄" }),
|
|
947
|
-
|
|
947
|
+
l && /* @__PURE__ */ t("input", { type: "checkbox", checked: !!d[u.id], onChange: (w) => {
|
|
948
948
|
w.stopPropagation(), N(u.id, w.target.checked);
|
|
949
949
|
}, style: { cursor: "pointer", accentColor: e.primary }, onClick: (w) => w.stopPropagation() }),
|
|
950
950
|
i === u.id ? /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 24, fontSize: 12, flex: 1 }, value: $, onChange: (w) => S(w.target.value), onBlur: () => y(null), onKeyDown: (w) => w.key === "Enter" && y(null), onClick: (w) => w.stopPropagation() }) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: u.value }),
|
|
@@ -959,37 +959,37 @@ function Ue({ data: r = [], checkbox: a = !1, editable: g = !1, onSelect: o, onC
|
|
|
959
959
|
M && D && /* @__PURE__ */ t("div", { children: u.items.map((w) => k(w, x + 1)) })
|
|
960
960
|
] }, u.id);
|
|
961
961
|
};
|
|
962
|
-
return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...
|
|
962
|
+
return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...a }, children: r.map((u) => k(u)) });
|
|
963
963
|
}
|
|
964
|
-
function Qe({ total: r, pageSize:
|
|
965
|
-
const [
|
|
964
|
+
function Qe({ total: r, pageSize: l = 10, page: g, onChange: o, style: s }) {
|
|
965
|
+
const [a, c] = z(g || 1), n = Math.ceil(r / l);
|
|
966
966
|
T(W, []);
|
|
967
967
|
const p = (d) => {
|
|
968
968
|
const h = Math.min(Math.max(1, d), n);
|
|
969
969
|
c(h), o == null || o(h);
|
|
970
970
|
}, m = F(() => {
|
|
971
971
|
const d = [];
|
|
972
|
-
for (let i = Math.max(1,
|
|
972
|
+
for (let i = Math.max(1, a - 2); i <= Math.min(n, a + 2); i++) d.push(i);
|
|
973
973
|
return d[0] > 1 && (d[0] > 2 && d.unshift("..."), d.unshift(1)), d[d.length - 1] < n && (d[d.length - 1] < n - 1 && d.push("..."), d.push(n)), d;
|
|
974
|
-
}, [
|
|
974
|
+
}, [a, n]);
|
|
975
975
|
return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...s }, children: [
|
|
976
976
|
/* @__PURE__ */ f("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
|
|
977
|
-
(
|
|
977
|
+
(a - 1) * l + 1,
|
|
978
978
|
"–",
|
|
979
|
-
Math.min(
|
|
979
|
+
Math.min(a * l, r),
|
|
980
980
|
" of ",
|
|
981
981
|
r
|
|
982
982
|
] }),
|
|
983
|
-
[["«", 1], ["‹",
|
|
984
|
-
m.map((d, h) => /* @__PURE__ */ t("button", { onClick: () => typeof d == "number" && p(d), className: `dhx dhx-btn ${d ===
|
|
985
|
-
[["›",
|
|
983
|
+
[["«", 1], ["‹", a - 1]].map(([d, h]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => p(h), children: d }, d)),
|
|
984
|
+
m.map((d, h) => /* @__PURE__ */ t("button", { onClick: () => typeof d == "number" && p(d), className: `dhx dhx-btn ${d === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: d === "...", children: d }, h)),
|
|
985
|
+
[["›", a + 1], ["»", n]].map(([d, h]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === n, onClick: () => p(h), children: d }, d))
|
|
986
986
|
] });
|
|
987
987
|
}
|
|
988
|
-
function Ze({ config: r = {}, defaultValues:
|
|
989
|
-
const [s,
|
|
988
|
+
function Ze({ config: r = {}, defaultValues: l = {}, onSubmit: g, style: o }) {
|
|
989
|
+
const [s, a] = z(l), [c, n] = z({});
|
|
990
990
|
T(W, []);
|
|
991
991
|
const p = (i, y) => {
|
|
992
|
-
|
|
992
|
+
a(($) => ({ ...$, [i]: y })), n(($) => ({ ...$, [i]: null }));
|
|
993
993
|
}, m = () => {
|
|
994
994
|
const i = {};
|
|
995
995
|
return (r.rows || []).flat().forEach((y) => {
|
|
@@ -1055,17 +1055,17 @@ function Ze({ config: r = {}, defaultValues: a = {}, onSubmit: g, style: o }) {
|
|
|
1055
1055
|
(r.buttons || g) && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, justifyContent: r.buttonAlign || "flex-start", marginTop: 8 }, children: [
|
|
1056
1056
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => m() && (g == null ? void 0 : g(s)), children: r.submitText || "Submit" }),
|
|
1057
1057
|
r.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
|
|
1058
|
-
l
|
|
1058
|
+
a(l), n({});
|
|
1059
1059
|
}, children: r.resetText || "Reset" })
|
|
1060
1060
|
] })
|
|
1061
1061
|
] });
|
|
1062
1062
|
}
|
|
1063
|
-
function et({ items: r = [], onAction:
|
|
1063
|
+
function et({ items: r = [], onAction: l, style: g }) {
|
|
1064
1064
|
T(W, []);
|
|
1065
|
-
const o = (s,
|
|
1065
|
+
const o = (s, a) => {
|
|
1066
1066
|
var p, m;
|
|
1067
1067
|
if ("type" in s && (s.type === "separator" || s.type === "sep"))
|
|
1068
|
-
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } },
|
|
1068
|
+
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, a);
|
|
1069
1069
|
if ("type" in s && s.type === "input")
|
|
1070
1070
|
return /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
|
|
1071
1071
|
s.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: s.label }),
|
|
@@ -1073,20 +1073,20 @@ function et({ items: r = [], onAction: a, style: g }) {
|
|
|
1073
1073
|
var h;
|
|
1074
1074
|
return (h = s.onChange) == null ? void 0 : h.call(s, d.target.value);
|
|
1075
1075
|
} })
|
|
1076
|
-
] },
|
|
1076
|
+
] }, a);
|
|
1077
1077
|
if ("type" in s && s.type === "block") {
|
|
1078
1078
|
const d = s;
|
|
1079
1079
|
return /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: d.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
|
|
1080
1080
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (p = d.items) == null ? void 0 : p.map((h, i) => o(h, i)) }),
|
|
1081
1081
|
d.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: d.label })
|
|
1082
|
-
] },
|
|
1082
|
+
] }, a);
|
|
1083
1083
|
}
|
|
1084
1084
|
if ("type" in s && s.type === "selectButton") {
|
|
1085
1085
|
const d = s;
|
|
1086
1086
|
return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: d.value, onChange: (h) => {
|
|
1087
1087
|
var i;
|
|
1088
1088
|
return (i = d.onChange) == null ? void 0 : i.call(d, h.target.value);
|
|
1089
|
-
}, children: (m = d.items) == null ? void 0 : m.map((h) => /* @__PURE__ */ t("option", { value: h.value, children: h.value }, h.value)) },
|
|
1089
|
+
}, children: (m = d.items) == null ? void 0 : m.map((h) => /* @__PURE__ */ t("option", { value: h.value, children: h.value }, h.value)) }, a);
|
|
1090
1090
|
}
|
|
1091
1091
|
const c = s, n = c.active;
|
|
1092
1092
|
return /* @__PURE__ */ f(
|
|
@@ -1098,32 +1098,32 @@ function et({ items: r = [], onAction: a, style: g }) {
|
|
|
1098
1098
|
disabled: c.disabled,
|
|
1099
1099
|
onClick: () => {
|
|
1100
1100
|
var d;
|
|
1101
|
-
(d = c.onClick) == null || d.call(c, c), c.id && (
|
|
1101
|
+
(d = c.onClick) == null || d.call(c, c), c.id && (l == null || l(c.id, c));
|
|
1102
1102
|
},
|
|
1103
1103
|
children: [
|
|
1104
1104
|
c.icon && /* @__PURE__ */ t("span", { style: { fontSize: c.size === "large" ? 24 : 18 }, children: c.icon }),
|
|
1105
1105
|
c.text && /* @__PURE__ */ t("span", { style: { fontSize: 10, maxWidth: 60, textAlign: "center", lineHeight: 1.2, whiteSpace: "normal" }, children: c.text })
|
|
1106
1106
|
]
|
|
1107
1107
|
},
|
|
1108
|
-
|
|
1108
|
+
a
|
|
1109
1109
|
);
|
|
1110
1110
|
};
|
|
1111
1111
|
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "stretch", background: e.bg, borderBottom: `1px solid ${e.border}`, padding: "4px 0", overflowX: "auto", gap: 0, ...g }, children: r.map(o) });
|
|
1112
1112
|
}
|
|
1113
|
-
function tt({ logo: r, items:
|
|
1114
|
-
const [s,
|
|
1115
|
-
T(W, []), Y(c, H(() =>
|
|
1113
|
+
function tt({ logo: r, items: l = [], vertical: g = !1, style: o }) {
|
|
1114
|
+
const [s, a] = z(null), c = B(null);
|
|
1115
|
+
T(W, []), Y(c, H(() => a(null), []));
|
|
1116
1116
|
const n = (p, m) => {
|
|
1117
1117
|
var d;
|
|
1118
|
-
return p.type === "separator" ? /* @__PURE__ */ t("div", { style: { [g ? "height" : "width"]: 1, background:
|
|
1119
|
-
/* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, color:
|
|
1118
|
+
return p.type === "separator" ? /* @__PURE__ */ t("div", { style: { [g ? "height" : "width"]: 1, background: e.border, margin: g ? "4px 8px" : "0 6px", alignSelf: "stretch" } }, m) : p.type === "spacer" ? /* @__PURE__ */ t("div", { style: { flex: 1 } }, m) : p.type === "input" ? /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: p.width || 200, height: 28, margin: "0 4px" }, placeholder: p.placeholder }, m) : p.type === "menuItem" && ((d = p.items) != null && d.length) ? /* @__PURE__ */ f("div", { style: { position: "relative" }, children: [
|
|
1119
|
+
/* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, color: e.text }, onClick: () => a(s === m ? null : m), children: [
|
|
1120
1120
|
p.icon && /* @__PURE__ */ t("span", { children: p.icon }),
|
|
1121
1121
|
p.value,
|
|
1122
1122
|
" ",
|
|
1123
1123
|
/* @__PURE__ */ t("span", { style: { fontSize: 9 }, children: "▼" })
|
|
1124
1124
|
] }),
|
|
1125
|
-
s === m && /* @__PURE__ */ t(O, { items: p.items, onSelect: () =>
|
|
1126
|
-
] }, m) : /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, gap: 6, color:
|
|
1125
|
+
s === m && /* @__PURE__ */ t(O, { items: p.items, onSelect: () => a(null), style: { top: "100%" } })
|
|
1126
|
+
] }, m) : /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, gap: 6, color: e.text }, onClick: () => {
|
|
1127
1127
|
var h;
|
|
1128
1128
|
return (h = p.onClick) == null ? void 0 : h.call(p);
|
|
1129
1129
|
}, children: [
|
|
@@ -1131,9 +1131,9 @@ function tt({ logo: r, items: a = [], vertical: g = !1, style: o }) {
|
|
|
1131
1131
|
p.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: p.value })
|
|
1132
1132
|
] }, m);
|
|
1133
1133
|
};
|
|
1134
|
-
return /* @__PURE__ */ f("nav", { ref: c, className: "dhx", style: { display: "flex", flexDirection: g ? "column" : "row", alignItems: g ? "stretch" : "center", background: e.
|
|
1135
|
-
r && /* @__PURE__ */ t("div", { style: { color:
|
|
1136
|
-
|
|
1134
|
+
return /* @__PURE__ */ f("nav", { ref: c, className: "dhx", style: { display: "flex", flexDirection: g ? "column" : "row", alignItems: g ? "stretch" : "center", background: e.surface, borderBottom: g ? "none" : `1px solid ${e.border}`, borderRight: g ? `1px solid ${e.border}` : "none", padding: g ? "12px 0" : "0 12px", minHeight: g ? void 0 : 48, gap: 2, ...o }, children: [
|
|
1135
|
+
r && /* @__PURE__ */ t("div", { style: { color: e.text, fontWeight: 800, fontSize: 16, padding: g ? "8px 16px" : "0 12px 0 4px", borderRight: g ? "none" : `1px solid ${e.border}`, marginRight: g ? 0 : 8 }, children: r }),
|
|
1136
|
+
l.map(n)
|
|
1137
1137
|
] });
|
|
1138
1138
|
}
|
|
1139
1139
|
export {
|