dhx-react-suite 1.0.8 → 1.1.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/dhx-react-suite.js +1261 -1068
- package/dist/dhx-react-suite.js.map +1 -1
- package/dist/dhx-react-suite.umd.cjs +2 -2
- package/dist/dhx-react-suite.umd.cjs.map +1 -1
- package/dist/index.d.ts +21 -10
- package/package.json +1 -1
package/dist/dhx-react-suite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as g, jsx as t, Fragment as
|
|
2
|
-
import { useEffect as H,
|
|
3
|
-
import { Tooltip as
|
|
1
|
+
import { jsxs as g, jsx as t, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as H, useRef as q, useCallback as G, useState as C, useMemo as oe, createContext as je, useContext as Pe } from "react";
|
|
3
|
+
import { Tooltip as Oe, Legend as Ye, CartesianGrid as Ke, XAxis as Se, YAxis as we, BarChart as Fe, Bar as Ve, LineChart as _e, Line as Xe, AreaChart as qe, Area as Ge, PieChart as Je, Pie as Ue, Cell as Qe, RadarChart as Ze, PolarGrid as et, PolarAngleAxis as tt, Radar as nt, ScatterChart as rt, Scatter as ot, ResponsiveContainer as it } from "recharts";
|
|
4
4
|
const e = {
|
|
5
5
|
primary: "#0288d1",
|
|
6
6
|
primaryDk: "#01579b",
|
|
@@ -20,11 +20,11 @@ const e = {
|
|
|
20
20
|
r: "4px",
|
|
21
21
|
rMd: "8px",
|
|
22
22
|
font: "'Segoe UI', system-ui, -apple-system, sans-serif"
|
|
23
|
-
},
|
|
23
|
+
}, ze = "dhx-react-styles";
|
|
24
24
|
function O() {
|
|
25
|
-
if (typeof document > "u" || document.getElementById(
|
|
26
|
-
const
|
|
27
|
-
|
|
25
|
+
if (typeof document > "u" || document.getElementById(ze)) return;
|
|
26
|
+
const n = document.createElement("style");
|
|
27
|
+
n.id = ze, n.textContent = `
|
|
28
28
|
*,*::before,*::after{box-sizing:border-box}
|
|
29
29
|
.dhx{font-family:${e.font};font-size:14px;color:${e.text}}
|
|
30
30
|
.dhx *{box-sizing:border-box}
|
|
@@ -64,417 +64,595 @@ function O() {
|
|
|
64
64
|
.dhx-tag-success{background:#e8f5e9;color:#1b5e20}
|
|
65
65
|
.dhx-tag-danger{background:#ffebee;color:#b71c1c}
|
|
66
66
|
.dhx-tag-warning{background:#fff3e0;color:#e65100}
|
|
67
|
-
`, document.head.appendChild(
|
|
67
|
+
`, document.head.appendChild(n);
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const lt = {
|
|
70
70
|
sm: { height: 24, padding: "0 8px", fontSize: 12 },
|
|
71
71
|
md: {},
|
|
72
72
|
lg: { height: 38, padding: "0 18px", fontSize: 14 }
|
|
73
73
|
};
|
|
74
|
-
function
|
|
75
|
-
children:
|
|
76
|
-
variant:
|
|
77
|
-
size:
|
|
78
|
-
icon:
|
|
79
|
-
disabled:
|
|
74
|
+
function St({
|
|
75
|
+
children: n,
|
|
76
|
+
variant: i = "primary",
|
|
77
|
+
size: p = "md",
|
|
78
|
+
icon: u,
|
|
79
|
+
disabled: x,
|
|
80
80
|
onClick: s,
|
|
81
|
-
style:
|
|
82
|
-
className:
|
|
81
|
+
style: f,
|
|
82
|
+
className: a = ""
|
|
83
83
|
}) {
|
|
84
84
|
return H(O, []), /* @__PURE__ */ g(
|
|
85
85
|
"button",
|
|
86
86
|
{
|
|
87
|
-
className: `dhx dhx-btn dhx-btn-${
|
|
88
|
-
style: { ...
|
|
89
|
-
disabled:
|
|
87
|
+
className: `dhx dhx-btn dhx-btn-${i} ${a}`,
|
|
88
|
+
style: { ...lt[p], ...f },
|
|
89
|
+
disabled: x,
|
|
90
90
|
onClick: s,
|
|
91
91
|
children: [
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
u && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: u }),
|
|
93
|
+
n
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
H(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
function ie(n, i) {
|
|
99
|
+
H(() => {
|
|
100
|
+
const p = (u) => {
|
|
101
|
+
n.current && !n.current.contains(u.target) && i(u);
|
|
102
|
+
};
|
|
103
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
104
|
+
}, [n, i]);
|
|
105
|
+
}
|
|
106
|
+
function st(n) {
|
|
107
|
+
const i = q(!1), p = q({ x: 0, y: 0, ox: 0, oy: 0 });
|
|
108
|
+
return G(
|
|
109
|
+
(u, x = 0, s = 0) => {
|
|
110
|
+
i.current = !0, p.current = { x: u.clientX, y: u.clientY, ox: x, oy: s };
|
|
111
|
+
const f = (m) => {
|
|
112
|
+
if (!i.current) return;
|
|
113
|
+
const { x: z, y: r, ox: l, oy: d } = p.current;
|
|
114
|
+
n(l + m.clientX - z, d + m.clientY - r);
|
|
115
|
+
}, a = () => {
|
|
116
|
+
i.current = !1, document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", a);
|
|
117
|
+
};
|
|
118
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", a), u.preventDefault();
|
|
119
|
+
},
|
|
120
|
+
[n]
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function ae({ items: n, onSelect: i, style: p }) {
|
|
124
|
+
const [u, x] = C(null);
|
|
125
|
+
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", ...p }, children: n.map((s, f) => {
|
|
126
|
+
var m, z;
|
|
127
|
+
if (s.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, f);
|
|
128
|
+
const a = u === f;
|
|
129
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => x(f), onMouseLeave: () => x(null), children: [
|
|
130
|
+
/* @__PURE__ */ g(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
onClick: () => {
|
|
134
|
+
var r;
|
|
135
|
+
return !s.disabled && !((r = s.items) != null && r.length) && i(s);
|
|
136
|
+
},
|
|
137
|
+
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: s.disabled ? "not-allowed" : "pointer", fontSize: 13, color: s.disabled ? e.textMut : e.text, background: a && !s.disabled ? e.bg : "transparent", opacity: s.disabled ? 0.5 : 1 },
|
|
138
|
+
children: [
|
|
139
|
+
s.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: s.icon }),
|
|
140
|
+
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: s.value || s.id }),
|
|
141
|
+
s.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: s.hotkey }),
|
|
142
|
+
(m = s.items) != null && m.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
a && ((z = s.items) != null && z.length) ? /* @__PURE__ */ t(ae, { items: s.items, onSelect: i, style: { position: "absolute", left: "100%", top: -4 } }) : null
|
|
147
|
+
] }, s.id || f);
|
|
148
|
+
}) });
|
|
149
|
+
}
|
|
150
|
+
function wt({ items: n = [], label: i = "Menu", onSelect: p, style: u }) {
|
|
151
|
+
const [x, s] = C(!1), f = q(null);
|
|
152
|
+
return H(O, []), ie(f, G(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: f, className: "dhx", style: { position: "relative", display: "inline-block", ...u }, children: [
|
|
153
|
+
/* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => s((a) => !a), children: [
|
|
154
|
+
i,
|
|
155
|
+
" ",
|
|
156
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: x ? "▲" : "▼" })
|
|
157
|
+
] }),
|
|
158
|
+
x && /* @__PURE__ */ t(ae, { items: n, onSelect: (a) => {
|
|
159
|
+
p == null || p(a), s(!1);
|
|
160
|
+
} })
|
|
161
|
+
] });
|
|
162
|
+
}
|
|
163
|
+
function zt({ items: n = [], onSelect: i, children: p }) {
|
|
164
|
+
const [u, x] = C(null), s = q(null);
|
|
165
|
+
return H(O, []), ie(s, G(() => x(null), [])), /* @__PURE__ */ g("div", { ref: s, onContextMenu: (a) => {
|
|
166
|
+
a.preventDefault(), x({ x: a.clientX, y: a.clientY });
|
|
167
|
+
}, style: { position: "relative", display: "contents" }, children: [
|
|
168
|
+
p,
|
|
169
|
+
u && /* @__PURE__ */ t("div", { style: { position: "fixed", left: u.x, top: u.y, zIndex: 9999 }, children: /* @__PURE__ */ t(ae, { items: n, onSelect: (a) => {
|
|
170
|
+
i == null || i(a), x(null);
|
|
171
|
+
} }) })
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
function Me({ count: n }) {
|
|
175
|
+
return /* @__PURE__ */ t("span", { style: {
|
|
176
|
+
position: "absolute",
|
|
177
|
+
top: 2,
|
|
178
|
+
right: 2,
|
|
179
|
+
minWidth: 16,
|
|
180
|
+
height: 16,
|
|
181
|
+
background: e.danger,
|
|
182
|
+
color: "#fff",
|
|
183
|
+
borderRadius: 8,
|
|
184
|
+
fontSize: 10,
|
|
185
|
+
fontWeight: 700,
|
|
186
|
+
display: "flex",
|
|
187
|
+
alignItems: "center",
|
|
188
|
+
justifyContent: "center",
|
|
189
|
+
padding: "0 3px",
|
|
190
|
+
lineHeight: 1,
|
|
191
|
+
pointerEvents: "none"
|
|
192
|
+
}, children: n });
|
|
193
|
+
}
|
|
194
|
+
function Mt({ items: n = [], onAction: i, style: p }) {
|
|
195
|
+
const [u, x] = C(null), [s, f] = C(() => {
|
|
196
|
+
const r = {};
|
|
197
|
+
return n.forEach((l) => {
|
|
198
|
+
l.id && (l.twoState || l.group) && l.active && (r[l.id] = !0);
|
|
199
|
+
}), r;
|
|
200
|
+
}), a = q(null);
|
|
201
|
+
H(O, []), ie(a, G(() => x(null), []));
|
|
202
|
+
const m = (r, l) => {
|
|
203
|
+
var d, y;
|
|
204
|
+
if (!r.disabled) {
|
|
205
|
+
if (r.twoState && r.id && f((o) => ({ ...o, [r.id]: !o[r.id] })), r.group && r.id && f((o) => {
|
|
206
|
+
const b = { ...o };
|
|
207
|
+
return n.forEach((v) => {
|
|
208
|
+
v.group === r.group && v.id && (b[v.id] = !1);
|
|
209
|
+
}), b[r.id] = !0, b;
|
|
210
|
+
}), (d = r.items) != null && d.length) {
|
|
211
|
+
x((o) => o === l ? null : l);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
(y = r.onClick) == null || y.call(r, r.id || ""), i == null || i(r.id || "");
|
|
215
|
+
}
|
|
216
|
+
}, z = (r, l) => {
|
|
217
|
+
var b, v;
|
|
218
|
+
if (r.hidden) return null;
|
|
219
|
+
if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, l);
|
|
220
|
+
if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, l);
|
|
221
|
+
if (r.type === "input") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
222
|
+
r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
|
|
223
|
+
/* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
224
|
+
r.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: r.icon }),
|
|
109
225
|
/* @__PURE__ */ t(
|
|
110
226
|
"input",
|
|
111
227
|
{
|
|
112
228
|
className: "dhx dhx-input",
|
|
113
|
-
style: { width:
|
|
114
|
-
placeholder:
|
|
115
|
-
defaultValue:
|
|
116
|
-
onChange: (
|
|
117
|
-
var
|
|
118
|
-
return (
|
|
229
|
+
style: { width: r.width || 140, height: 28, paddingLeft: r.icon ? 30 : void 0 },
|
|
230
|
+
placeholder: r.placeholder,
|
|
231
|
+
defaultValue: r.value,
|
|
232
|
+
onChange: (M) => {
|
|
233
|
+
var D;
|
|
234
|
+
return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
|
|
119
235
|
}
|
|
120
236
|
}
|
|
121
237
|
)
|
|
122
|
-
] }
|
|
123
|
-
|
|
124
|
-
|
|
238
|
+
] })
|
|
239
|
+
] }, l);
|
|
240
|
+
if (r.type === "select") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
241
|
+
r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
|
|
242
|
+
/* @__PURE__ */ t(
|
|
125
243
|
"select",
|
|
126
244
|
{
|
|
127
245
|
className: "dhx dhx-input",
|
|
128
|
-
style: { width:
|
|
129
|
-
defaultValue:
|
|
130
|
-
onChange: (
|
|
131
|
-
var
|
|
132
|
-
return (
|
|
246
|
+
style: { width: r.width || 100, height: 28, cursor: "pointer" },
|
|
247
|
+
defaultValue: r.value,
|
|
248
|
+
onChange: (M) => {
|
|
249
|
+
var D;
|
|
250
|
+
return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
|
|
133
251
|
},
|
|
134
|
-
children: (
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return /* @__PURE__ */ g(
|
|
252
|
+
children: (b = r.options) == null ? void 0 : b.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.label }, M.value))
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] }, l);
|
|
256
|
+
if (r.type === "imageButton") return /* @__PURE__ */ g(
|
|
140
257
|
"button",
|
|
141
258
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
259
|
+
title: r.tooltip,
|
|
260
|
+
disabled: r.disabled,
|
|
261
|
+
style: {
|
|
262
|
+
position: "relative",
|
|
263
|
+
width: 32,
|
|
264
|
+
height: 32,
|
|
265
|
+
padding: 2,
|
|
266
|
+
border: "none",
|
|
267
|
+
borderRadius: "50%",
|
|
268
|
+
overflow: "hidden",
|
|
269
|
+
cursor: r.disabled ? "not-allowed" : "pointer",
|
|
270
|
+
background: "transparent",
|
|
271
|
+
flexShrink: 0
|
|
148
272
|
},
|
|
273
|
+
onClick: () => m(r, l),
|
|
149
274
|
children: [
|
|
150
|
-
|
|
151
|
-
|
|
275
|
+
r.src && /* @__PURE__ */ t("img", { src: r.src, alt: r.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
|
|
276
|
+
r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
|
|
152
277
|
]
|
|
153
278
|
},
|
|
154
|
-
|
|
279
|
+
l
|
|
155
280
|
);
|
|
281
|
+
const d = !!(r.id && s[r.id]), y = r.value ?? r.text, o = !!((v = r.items) != null && v.length);
|
|
282
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
283
|
+
/* @__PURE__ */ g(
|
|
284
|
+
"button",
|
|
285
|
+
{
|
|
286
|
+
className: "dhx dhx-btn dhx-btn-ghost",
|
|
287
|
+
title: r.tooltip,
|
|
288
|
+
disabled: r.disabled,
|
|
289
|
+
style: {
|
|
290
|
+
height: 32,
|
|
291
|
+
gap: 4,
|
|
292
|
+
position: "relative",
|
|
293
|
+
background: d ? e.primaryLt : "transparent",
|
|
294
|
+
color: d ? e.primary : r.disabled ? e.textMut : e.text,
|
|
295
|
+
opacity: r.disabled ? 0.55 : 1,
|
|
296
|
+
cursor: r.disabled ? "not-allowed" : "pointer"
|
|
297
|
+
},
|
|
298
|
+
onClick: () => m(r, l),
|
|
299
|
+
children: [
|
|
300
|
+
r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
|
|
301
|
+
y && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: y }),
|
|
302
|
+
o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
|
|
303
|
+
r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
o && u === l && /* @__PURE__ */ t(
|
|
308
|
+
ae,
|
|
309
|
+
{
|
|
310
|
+
items: r.items,
|
|
311
|
+
onSelect: () => x(null),
|
|
312
|
+
style: { top: "100%", left: 0 }
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] }, l);
|
|
156
316
|
};
|
|
157
|
-
return /* @__PURE__ */ t(
|
|
317
|
+
return /* @__PURE__ */ t(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
ref: a,
|
|
321
|
+
className: "dhx",
|
|
322
|
+
style: {
|
|
323
|
+
display: "flex",
|
|
324
|
+
alignItems: "center",
|
|
325
|
+
gap: 2,
|
|
326
|
+
padding: "4px 8px",
|
|
327
|
+
background: e.surface,
|
|
328
|
+
borderBottom: `1px solid ${e.border}`,
|
|
329
|
+
minHeight: 44,
|
|
330
|
+
flexWrap: "wrap",
|
|
331
|
+
...p
|
|
332
|
+
},
|
|
333
|
+
children: n.map(z)
|
|
334
|
+
}
|
|
335
|
+
);
|
|
158
336
|
}
|
|
159
|
-
function
|
|
160
|
-
const [
|
|
337
|
+
function $t({ items: n = [], width: i = 240, collapsed: p, onSelect: u, header: x, footer: s, style: f }) {
|
|
338
|
+
const [a, m] = C(p ?? !1), [z, r] = C(null), [l, d] = C({});
|
|
161
339
|
H(O, []);
|
|
162
|
-
const y =
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
var
|
|
166
|
-
if (
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
340
|
+
const y = a ? 56 : i, o = (v) => {
|
|
341
|
+
r(v.id), u == null || u(v);
|
|
342
|
+
}, b = (v, M = 0) => {
|
|
343
|
+
var k;
|
|
344
|
+
if (v.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, v.id);
|
|
345
|
+
if (v.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: v.html || "" } }, v.id);
|
|
346
|
+
const D = (((k = v.items) == null ? void 0 : k.length) ?? 0) > 0, T = l[v.id], h = z === v.id;
|
|
169
347
|
return /* @__PURE__ */ g("div", { children: [
|
|
170
348
|
/* @__PURE__ */ g(
|
|
171
349
|
"div",
|
|
172
350
|
{
|
|
173
351
|
onClick: () => {
|
|
174
|
-
|
|
352
|
+
D && d((E) => ({ ...E, [v.id]: !E[v.id] })), o(v);
|
|
175
353
|
},
|
|
176
|
-
style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${
|
|
177
|
-
onMouseEnter: (E) => !
|
|
178
|
-
onMouseLeave: (E) => !
|
|
354
|
+
style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${a ? "0px" : `${12 + M * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: a ? "center" : "flex-start", transition: "all .15s", background: h ? e.primaryLt : "transparent", color: h ? e.primary : e.text, userSelect: "none" },
|
|
355
|
+
onMouseEnter: (E) => !h && (E.currentTarget.style.background = e.bg),
|
|
356
|
+
onMouseLeave: (E) => !h && (E.currentTarget.style.background = "transparent"),
|
|
179
357
|
children: [
|
|
180
|
-
|
|
181
|
-
!
|
|
182
|
-
!
|
|
183
|
-
!
|
|
358
|
+
v.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: v.icon }),
|
|
359
|
+
!a && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: h ? 600 : 400 }, children: v.value }),
|
|
360
|
+
!a && v.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: v.count }),
|
|
361
|
+
!a && D && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: T ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
|
|
184
362
|
]
|
|
185
363
|
}
|
|
186
364
|
),
|
|
187
|
-
|
|
188
|
-
] },
|
|
365
|
+
D && T && !a && v.items.map((E) => b(E, M + 1))
|
|
366
|
+
] }, v.id);
|
|
189
367
|
};
|
|
190
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { width: y, minWidth: y, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
193
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children:
|
|
194
|
-
s && !
|
|
368
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { width: y, minWidth: y, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...f }, children: [
|
|
369
|
+
x && !a && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: x }),
|
|
370
|
+
/* @__PURE__ */ t("button", { onClick: () => m((v) => !v), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: a ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: a ? "☰" : "✕" }) }),
|
|
371
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((v) => b(v)) }),
|
|
372
|
+
s && !a && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: s })
|
|
195
373
|
] });
|
|
196
374
|
}
|
|
197
|
-
function
|
|
198
|
-
const [
|
|
375
|
+
function at({ config: n }) {
|
|
376
|
+
const [i, p] = C(!1), u = {
|
|
199
377
|
position: "relative",
|
|
200
378
|
background: e.surface,
|
|
201
379
|
border: `1px solid ${e.border}`,
|
|
202
380
|
borderRadius: e.r,
|
|
203
381
|
overflow: "hidden",
|
|
204
|
-
...
|
|
205
|
-
...
|
|
206
|
-
...
|
|
382
|
+
...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
|
|
383
|
+
...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
|
|
384
|
+
...i ? { flex: "0 0 auto" } : {}
|
|
207
385
|
};
|
|
208
|
-
return /* @__PURE__ */ g("div", { style:
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */ t("span", { children:
|
|
211
|
-
|
|
386
|
+
return /* @__PURE__ */ g("div", { style: u, children: [
|
|
387
|
+
n.header && /* @__PURE__ */ g("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: [
|
|
388
|
+
/* @__PURE__ */ t("span", { children: n.header }),
|
|
389
|
+
n.collapsable && /* @__PURE__ */ t("button", { onClick: () => p((x) => !x), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: i ? "▼" : "▲" })
|
|
212
390
|
] }),
|
|
213
|
-
!
|
|
214
|
-
|
|
215
|
-
(
|
|
391
|
+
!i && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
|
|
392
|
+
n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
|
|
393
|
+
(n.rows || n.cols) && /* @__PURE__ */ t(dt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
|
|
216
394
|
] })
|
|
217
395
|
] });
|
|
218
396
|
}
|
|
219
|
-
function
|
|
397
|
+
function dt({ rows: n, cols: i, type: p = "line", style: u, children: x }) {
|
|
220
398
|
H(O, []);
|
|
221
|
-
const s =
|
|
222
|
-
return
|
|
399
|
+
const s = p === "space" ? 12 : p === "wide" ? 8 : 1, f = n || i, a = !!n;
|
|
400
|
+
return f ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: a ? "column" : "row", gap: s, width: "100%", height: "100%", ...u }, children: f.map((m, z) => /* @__PURE__ */ t(at, { config: m }, m.id || z)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...u }, children: x });
|
|
223
401
|
}
|
|
224
|
-
function
|
|
225
|
-
var
|
|
226
|
-
const [
|
|
402
|
+
function Dt({ views: n = [], mode: i = "top", tabAlign: p = "left", closable: u = [], disabled: x = [], defaultActive: s, onBeforeChange: f, onChange: a, style: m }) {
|
|
403
|
+
var h;
|
|
404
|
+
const [z, r] = C(s || ((h = n[0]) == null ? void 0 : h.id)), [l, d] = C(n.map((k) => k.id));
|
|
227
405
|
H(O, []);
|
|
228
|
-
const y = (
|
|
229
|
-
|
|
230
|
-
}, o = (
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
const E =
|
|
406
|
+
const y = (k, E) => {
|
|
407
|
+
k.stopPropagation(), d((c) => c.filter((I) => I !== E)), z === E && r(l.find((c) => c !== E) ?? "");
|
|
408
|
+
}, o = (k) => {
|
|
409
|
+
x.includes(k) || f && f(k) === !1 || (r(k), a == null || a(k));
|
|
410
|
+
}, b = i === "left" || i === "right", v = n.filter((k) => l.includes(k.id)), M = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: b ? "column" : "row", justifyContent: p === "center" ? "center" : p === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !b && i !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: i === "bottom" ? `2px solid ${e.border}` : "none", borderRight: i === "left" ? `2px solid ${e.border}` : "none", borderLeft: i === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: v.map((k) => {
|
|
411
|
+
const E = z === k.id, c = x.includes(k.id), I = i === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : b ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [i === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
|
|
234
412
|
return /* @__PURE__ */ g(
|
|
235
413
|
"div",
|
|
236
414
|
{
|
|
237
|
-
onClick: () => o(
|
|
238
|
-
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor:
|
|
415
|
+
onClick: () => o(k.id),
|
|
416
|
+
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: c ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: b ? 120 : "auto", ...E ? I : { color: c ? e.textMut : e.textSec } },
|
|
239
417
|
children: [
|
|
240
|
-
|
|
241
|
-
/* @__PURE__ */ t("span", { children:
|
|
242
|
-
|
|
418
|
+
k.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: k.icon }),
|
|
419
|
+
/* @__PURE__ */ t("span", { children: k.tab }),
|
|
420
|
+
u.includes(k.id) && /* @__PURE__ */ t("span", { onClick: (S) => y(S, k.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
|
|
243
421
|
]
|
|
244
422
|
},
|
|
245
|
-
|
|
423
|
+
k.id
|
|
246
424
|
);
|
|
247
|
-
}) }),
|
|
248
|
-
|
|
249
|
-
(
|
|
425
|
+
}) }), D = v.find((k) => k.id === z), T = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
|
|
426
|
+
D == null ? void 0 : D.content,
|
|
427
|
+
(D == null ? void 0 : D.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: D.html }, style: { padding: 16 } })
|
|
250
428
|
] });
|
|
251
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection:
|
|
252
|
-
|
|
253
|
-
|
|
429
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: i === "top" ? "column" : i === "bottom" ? "column-reverse" : i === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...m }, children: [
|
|
430
|
+
M,
|
|
431
|
+
T
|
|
254
432
|
] });
|
|
255
433
|
}
|
|
256
434
|
const Z = `1px solid ${e.border}`;
|
|
257
|
-
function
|
|
435
|
+
function ct({ active: n, dir: i }) {
|
|
258
436
|
return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
|
|
259
|
-
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill:
|
|
260
|
-
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill:
|
|
437
|
+
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && i === "asc" ? e.primary : e.borderDk }) }),
|
|
438
|
+
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && i === "desc" ? e.primary : e.borderDk }) })
|
|
261
439
|
] });
|
|
262
440
|
}
|
|
263
|
-
function
|
|
264
|
-
columns:
|
|
265
|
-
data:
|
|
266
|
-
height:
|
|
267
|
-
rowHeight:
|
|
268
|
-
sortable:
|
|
441
|
+
function It({
|
|
442
|
+
columns: n,
|
|
443
|
+
data: i = [],
|
|
444
|
+
height: p = 400,
|
|
445
|
+
rowHeight: u = 40,
|
|
446
|
+
sortable: x = !0,
|
|
269
447
|
resizable: s = !0,
|
|
270
|
-
editable:
|
|
271
|
-
stripe:
|
|
272
|
-
autoWidth:
|
|
273
|
-
keyNavigation:
|
|
274
|
-
selection:
|
|
275
|
-
multiselect:
|
|
276
|
-
onSelect:
|
|
448
|
+
editable: f = !1,
|
|
449
|
+
stripe: a = !1,
|
|
450
|
+
autoWidth: m = !1,
|
|
451
|
+
keyNavigation: z = !1,
|
|
452
|
+
selection: r,
|
|
453
|
+
multiselect: l,
|
|
454
|
+
onSelect: d,
|
|
277
455
|
onChange: y,
|
|
278
456
|
style: o
|
|
279
457
|
}) {
|
|
280
|
-
const [
|
|
458
|
+
const [b, v] = C(null), [M, D] = C("asc"), [T, h] = C({}), [k, E] = C(/* @__PURE__ */ new Set()), [c, I] = C(-1), [S, A] = C(() => n.map((w) => w.width ?? w.minWidth ?? 150)), [F, U] = C(null), [Q, de] = C(""), [le, ce] = C({}), L = q(null), [j, Y] = C(0);
|
|
281
459
|
H(O, []), H(() => {
|
|
282
|
-
if (!
|
|
283
|
-
const
|
|
284
|
-
var
|
|
285
|
-
return Y(((
|
|
460
|
+
if (!m || !L.current) return;
|
|
461
|
+
const w = new ResizeObserver(() => {
|
|
462
|
+
var $;
|
|
463
|
+
return Y((($ = L.current) == null ? void 0 : $.offsetWidth) ?? 0);
|
|
286
464
|
});
|
|
287
|
-
return
|
|
288
|
-
}, [
|
|
465
|
+
return w.observe(L.current), () => w.disconnect();
|
|
466
|
+
}, [m]);
|
|
289
467
|
const V = oe(() => {
|
|
290
|
-
if (!
|
|
291
|
-
const
|
|
292
|
-
if (j <=
|
|
293
|
-
const
|
|
294
|
-
return
|
|
295
|
-
}, [
|
|
296
|
-
let
|
|
297
|
-
const
|
|
298
|
-
return
|
|
468
|
+
if (!m || j === 0) return S;
|
|
469
|
+
const w = S.reduce((R, N) => R + N, 0);
|
|
470
|
+
if (j <= w) return S;
|
|
471
|
+
const $ = (j - w) / n.length;
|
|
472
|
+
return S.map((R) => R + $);
|
|
473
|
+
}, [m, j, S, n.length]), K = oe(() => {
|
|
474
|
+
let w = i.map(($, R) => {
|
|
475
|
+
const N = String($.id ?? R);
|
|
476
|
+
return le[N] ? { ...$, ...le[N] } : $;
|
|
299
477
|
}).filter(
|
|
300
|
-
(
|
|
478
|
+
($) => Object.entries(T).every(([R, N]) => !N || String($[R] ?? "").toLowerCase().includes(N.toLowerCase()))
|
|
301
479
|
);
|
|
302
|
-
return
|
|
303
|
-
const
|
|
304
|
-
if (
|
|
480
|
+
return b && (w = [...w].sort(($, R) => {
|
|
481
|
+
const N = $[b], P = R[b];
|
|
482
|
+
if (N == null) return 1;
|
|
305
483
|
if (P == null) return -1;
|
|
306
|
-
const B =
|
|
307
|
-
return
|
|
308
|
-
})),
|
|
309
|
-
}, [
|
|
310
|
-
const
|
|
311
|
-
return
|
|
484
|
+
const B = N < P ? -1 : N > P ? 1 : 0;
|
|
485
|
+
return M === "asc" ? B : -B;
|
|
486
|
+
})), w;
|
|
487
|
+
}, [i, b, M, T, le]), J = oe(() => {
|
|
488
|
+
const w = {};
|
|
489
|
+
return n.forEach(($) => {
|
|
312
490
|
var R;
|
|
313
|
-
if ((R =
|
|
314
|
-
const
|
|
315
|
-
|
|
491
|
+
if ((R = $.footer) != null && R.some((N) => N.summary)) {
|
|
492
|
+
const N = K.map((B) => Number(B[$.id])).filter((B) => !isNaN(B)), P = N.reduce((B, te) => B + te, 0);
|
|
493
|
+
w[$.id] = { sum: P, avg: N.length ? P / N.length : 0, count: K.length, min: N.length ? Math.min(...N) : 0, max: N.length ? Math.max(...N) : 0 };
|
|
316
494
|
}
|
|
317
|
-
}),
|
|
318
|
-
}, [K,
|
|
319
|
-
const
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
}),
|
|
323
|
-
}, [
|
|
324
|
-
var
|
|
325
|
-
return (
|
|
326
|
-
}), fe = V.reduce((
|
|
327
|
-
!
|
|
328
|
-
}, W = (
|
|
329
|
-
if (!
|
|
330
|
-
const R =
|
|
331
|
-
$
|
|
332
|
-
const P =
|
|
495
|
+
}), w;
|
|
496
|
+
}, [K, n]), X = oe(() => {
|
|
497
|
+
const w = {};
|
|
498
|
+
return n.filter(($) => $.filterType === "select").forEach(($) => {
|
|
499
|
+
w[$.id] = [...new Set(i.map((R) => String(R[$.id] ?? "")))].sort();
|
|
500
|
+
}), w;
|
|
501
|
+
}, [i, n]), pe = n.some((w) => w.filterable), ue = n.some((w) => {
|
|
502
|
+
var $;
|
|
503
|
+
return ($ = w.footer) == null ? void 0 : $.length;
|
|
504
|
+
}), fe = V.reduce((w, $) => w + $, 0), se = (w, $) => w.id ?? $, he = (w) => {
|
|
505
|
+
!x || w.sortable === !1 || (D(($) => b === w.id && $ === "asc" ? "desc" : "asc"), v(w.id));
|
|
506
|
+
}, W = (w, $) => {
|
|
507
|
+
if (!r) return;
|
|
508
|
+
const R = se(w, $);
|
|
509
|
+
I($), E((N) => {
|
|
510
|
+
const P = l ? new Set(N) : /* @__PURE__ */ new Set();
|
|
333
511
|
return P.has(R) ? P.delete(R) : P.add(R), P;
|
|
334
|
-
}),
|
|
512
|
+
}), d == null || d(w);
|
|
335
513
|
}, ee = () => {
|
|
336
514
|
if (!F) return;
|
|
337
|
-
const { key:
|
|
338
|
-
|
|
339
|
-
const R = K.find((
|
|
340
|
-
R && (y == null || y(R,
|
|
341
|
-
},
|
|
342
|
-
if (F &&
|
|
515
|
+
const { key: w, colId: $ } = F;
|
|
516
|
+
ce((N) => ({ ...N, [String(w)]: { ...N[String(w)] || {}, [$]: Q } }));
|
|
517
|
+
const R = K.find((N, P) => se(N, P) === w);
|
|
518
|
+
R && (y == null || y(R, $, Q)), U(null);
|
|
519
|
+
}, Ae = (w) => {
|
|
520
|
+
if (F && w.key === "Escape") {
|
|
343
521
|
U(null);
|
|
344
522
|
return;
|
|
345
523
|
}
|
|
346
|
-
if (!(!
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
} else if (
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
524
|
+
if (!(!z || !r)) {
|
|
525
|
+
if (w.key === "ArrowDown") {
|
|
526
|
+
w.preventDefault();
|
|
527
|
+
const $ = Math.min(c + 1, K.length - 1);
|
|
528
|
+
$ >= 0 && W(K[$], $);
|
|
529
|
+
} else if (w.key === "ArrowUp") {
|
|
530
|
+
w.preventDefault();
|
|
531
|
+
const $ = Math.max(c - 1, 0);
|
|
532
|
+
$ >= 0 && W(K[$], $);
|
|
355
533
|
}
|
|
356
534
|
}
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
const R =
|
|
360
|
-
const
|
|
361
|
-
return
|
|
535
|
+
}, Be = (w, $) => {
|
|
536
|
+
w.preventDefault(), w.stopPropagation();
|
|
537
|
+
const R = w.clientX, N = S[$], P = (te) => A((ge) => {
|
|
538
|
+
const ne = [...ge];
|
|
539
|
+
return ne[$] = Math.max(n[$].minWidth || 50, N + te.clientX - R), ne;
|
|
362
540
|
}), B = () => {
|
|
363
541
|
document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", B);
|
|
364
542
|
};
|
|
365
543
|
document.addEventListener("mousemove", P), document.addEventListener("mouseup", B);
|
|
366
|
-
}, xe = (
|
|
367
|
-
width:
|
|
368
|
-
minWidth:
|
|
544
|
+
}, xe = (w, $, R, N) => ({
|
|
545
|
+
width: w,
|
|
546
|
+
minWidth: w,
|
|
369
547
|
flexShrink: 0,
|
|
370
548
|
boxSizing: "border-box",
|
|
371
549
|
padding: "0 12px",
|
|
372
|
-
height:
|
|
550
|
+
height: N,
|
|
373
551
|
display: "flex",
|
|
374
552
|
alignItems: "center",
|
|
375
553
|
overflow: "hidden",
|
|
376
554
|
textOverflow: "ellipsis",
|
|
377
555
|
whiteSpace: "nowrap",
|
|
378
556
|
fontSize: 13,
|
|
379
|
-
textAlign:
|
|
380
|
-
justifyContent:
|
|
557
|
+
textAlign: $.align,
|
|
558
|
+
justifyContent: $.align === "center" ? "center" : $.align === "right" ? "flex-end" : "flex-start",
|
|
381
559
|
borderLeft: R ? "none" : Z
|
|
382
560
|
});
|
|
383
561
|
return /* @__PURE__ */ t(
|
|
384
562
|
"div",
|
|
385
563
|
{
|
|
386
|
-
ref:
|
|
564
|
+
ref: L,
|
|
387
565
|
className: "dhx",
|
|
388
|
-
tabIndex:
|
|
389
|
-
onKeyDown:
|
|
390
|
-
style: { width: "100%", height:
|
|
566
|
+
tabIndex: z ? 0 : void 0,
|
|
567
|
+
onKeyDown: Ae,
|
|
568
|
+
style: { width: "100%", height: p, display: "flex", flexDirection: "column", border: Z, borderRadius: e.r, overflow: "hidden", outline: "none", ...o },
|
|
391
569
|
children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ g("div", { style: { minWidth: fe, display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
392
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: Z, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children:
|
|
570
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: Z, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((w, $) => {
|
|
393
571
|
var R;
|
|
394
572
|
return /* @__PURE__ */ g(
|
|
395
573
|
"div",
|
|
396
574
|
{
|
|
397
|
-
onClick: () =>
|
|
575
|
+
onClick: () => he(w),
|
|
398
576
|
style: {
|
|
399
|
-
...xe(V[
|
|
577
|
+
...xe(V[$], w, $ === 0, 40),
|
|
400
578
|
position: "relative",
|
|
401
579
|
fontWeight: 500,
|
|
402
580
|
color: e.text,
|
|
403
|
-
cursor:
|
|
581
|
+
cursor: x && w.sortable !== !1 ? "pointer" : "default",
|
|
404
582
|
userSelect: "none"
|
|
405
583
|
},
|
|
406
584
|
children: [
|
|
407
|
-
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(
|
|
408
|
-
|
|
409
|
-
s &&
|
|
585
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(w.header) ? (R = w.header[0]) == null ? void 0 : R.text : w.header || w.id }),
|
|
586
|
+
x && w.sortable !== !1 && /* @__PURE__ */ t(ct, { active: b === w.id, dir: M }),
|
|
587
|
+
s && w.resizable !== !1 && $ < n.length - 1 && /* @__PURE__ */ t(
|
|
410
588
|
"div",
|
|
411
589
|
{
|
|
412
|
-
onMouseDown: (
|
|
413
|
-
onClick: (
|
|
590
|
+
onMouseDown: (N) => Be(N, $),
|
|
591
|
+
onClick: (N) => N.stopPropagation(),
|
|
414
592
|
style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
|
|
415
|
-
onMouseEnter: (
|
|
416
|
-
onMouseLeave: (
|
|
593
|
+
onMouseEnter: (N) => N.currentTarget.style.background = e.primary + "55",
|
|
594
|
+
onMouseLeave: (N) => N.currentTarget.style.background = "transparent"
|
|
417
595
|
}
|
|
418
596
|
)
|
|
419
597
|
]
|
|
420
598
|
},
|
|
421
|
-
|
|
599
|
+
w.id
|
|
422
600
|
);
|
|
423
601
|
}) }),
|
|
424
|
-
|
|
602
|
+
pe && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: Z, background: e.surface, flexShrink: 0 }, children: n.map((w, $) => /* @__PURE__ */ t("div", { style: { width: V[$], minWidth: V[$], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: $ === 0 ? "none" : Z }, children: w.filterable && w.filterType === "select" ? /* @__PURE__ */ g(
|
|
425
603
|
"select",
|
|
426
604
|
{
|
|
427
605
|
className: "dhx dhx-input",
|
|
428
606
|
style: { height: 26, fontSize: 12, padding: "0 4px" },
|
|
429
|
-
value:
|
|
430
|
-
onChange: (R) =>
|
|
607
|
+
value: T[w.id] || "",
|
|
608
|
+
onChange: (R) => h((N) => ({ ...N, [w.id]: R.target.value })),
|
|
431
609
|
children: [
|
|
432
610
|
/* @__PURE__ */ t("option", { value: "", children: "All" }),
|
|
433
|
-
(X[
|
|
611
|
+
(X[w.id] || []).map((R) => /* @__PURE__ */ t("option", { value: R, children: R }, R))
|
|
434
612
|
]
|
|
435
613
|
}
|
|
436
|
-
) :
|
|
614
|
+
) : w.filterable ? /* @__PURE__ */ t(
|
|
437
615
|
"input",
|
|
438
616
|
{
|
|
439
617
|
className: "dhx dhx-input",
|
|
440
618
|
style: { height: 26, fontSize: 12 },
|
|
441
619
|
placeholder: "Filter...",
|
|
442
|
-
value:
|
|
443
|
-
onChange: (R) =>
|
|
620
|
+
value: T[w.id] || "",
|
|
621
|
+
onChange: (R) => h((N) => ({ ...N, [w.id]: R.target.value }))
|
|
444
622
|
}
|
|
445
|
-
) : null },
|
|
623
|
+
) : null }, w.id)) }),
|
|
446
624
|
/* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
447
|
-
K.map((
|
|
448
|
-
const R =
|
|
625
|
+
K.map((w, $) => {
|
|
626
|
+
const R = se(w, $), N = k.has(R), P = N ? e.primaryLt : a && $ % 2 !== 0 ? e.bg : e.surface;
|
|
449
627
|
return /* @__PURE__ */ t(
|
|
450
628
|
"div",
|
|
451
629
|
{
|
|
452
|
-
style: { display: "flex", height:
|
|
453
|
-
onMouseEnter: (B) => !
|
|
454
|
-
onMouseLeave: (B) => !
|
|
455
|
-
children:
|
|
456
|
-
const ge = (F == null ? void 0 : F.key) === R && (F == null ? void 0 : F.colId) === B.id,
|
|
630
|
+
style: { display: "flex", height: u, borderBottom: Z, flexShrink: 0, background: P, transition: "background .1s", cursor: r ? "pointer" : "default" },
|
|
631
|
+
onMouseEnter: (B) => !N && (B.currentTarget.style.background = e.primaryLt + "80"),
|
|
632
|
+
onMouseLeave: (B) => !N && (B.currentTarget.style.background = P),
|
|
633
|
+
children: n.map((B, te) => {
|
|
634
|
+
const ge = (F == null ? void 0 : F.key) === R && (F == null ? void 0 : F.colId) === B.id, ne = w[B.id], He = B.template ? B.template(ne, w) : String(ne ?? "");
|
|
457
635
|
return /* @__PURE__ */ t(
|
|
458
636
|
"div",
|
|
459
637
|
{
|
|
460
638
|
onClick: () => {
|
|
461
|
-
W(
|
|
639
|
+
W(w, $), f && B.editable !== !1 && (U({ key: R, colId: B.id }), de(String(ne ?? "")));
|
|
462
640
|
},
|
|
463
|
-
style: xe(V[te], B, te === 0,
|
|
641
|
+
style: xe(V[te], B, te === 0, u),
|
|
464
642
|
children: ge ? /* @__PURE__ */ t(
|
|
465
643
|
"input",
|
|
466
644
|
{
|
|
467
645
|
autoFocus: !0,
|
|
468
646
|
value: Q,
|
|
469
|
-
onChange: (
|
|
647
|
+
onChange: (re) => de(re.target.value),
|
|
470
648
|
onBlur: ee,
|
|
471
|
-
onKeyDown: (
|
|
472
|
-
|
|
649
|
+
onKeyDown: (re) => {
|
|
650
|
+
re.key === "Enter" && ee(), re.key === "Escape" && U(null);
|
|
473
651
|
},
|
|
474
|
-
onClick: (
|
|
652
|
+
onClick: (re) => re.stopPropagation(),
|
|
475
653
|
style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
|
|
476
654
|
}
|
|
477
|
-
) :
|
|
655
|
+
) : He
|
|
478
656
|
},
|
|
479
657
|
B.id
|
|
480
658
|
);
|
|
@@ -485,292 +663,267 @@ function Mt({
|
|
|
485
663
|
}),
|
|
486
664
|
K.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
|
|
487
665
|
] }),
|
|
488
|
-
|
|
666
|
+
ue && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: Z, background: e.bg, flexShrink: 0 }, children: n.map((w, $) => {
|
|
489
667
|
var B;
|
|
490
|
-
const R = (B =
|
|
668
|
+
const R = (B = w.footer) == null ? void 0 : B[0], N = J[w.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
|
|
491
669
|
let P = "";
|
|
492
|
-
return R && (typeof R.text == "function" ? P = R.text(
|
|
670
|
+
return R && (typeof R.text == "function" ? P = R.text(N) : R.text ? P = R.text : R.summary && (P = String(Math.round(N[R.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(V[$], w, $ === 0, 40), fontWeight: 600, color: e.text }, children: P }, w.id);
|
|
493
671
|
}) })
|
|
494
672
|
] }) })
|
|
495
673
|
}
|
|
496
674
|
);
|
|
497
675
|
}
|
|
498
676
|
const _ = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
|
|
499
|
-
function
|
|
500
|
-
var
|
|
677
|
+
function Ct({ type: n = "bar", data: i = [], series: p = [], scales: u = {}, legend: x, height: s = 280, style: f }) {
|
|
678
|
+
var b, v, M, D, T;
|
|
501
679
|
H(O, []);
|
|
502
|
-
const
|
|
680
|
+
const a = ((b = u.bottom) == null ? void 0 : b.text) || i[0] && Object.keys(i[0])[0] || "x", m = /* @__PURE__ */ t(Oe, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), z = x ? /* @__PURE__ */ t(Ye, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: x.valign, align: x.halign }) : null, r = /* @__PURE__ */ t(Ke, { strokeDasharray: "3 3", stroke: e.border }), l = /* @__PURE__ */ t(Se, { dataKey: a, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), d = /* @__PURE__ */ t(we, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((v = u.left) == null ? void 0 : v.min) ?? "auto", ((M = u.left) == null ? void 0 : M.max) ?? "auto"] }), y = { data: i, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
|
|
503
681
|
let o;
|
|
504
|
-
if (
|
|
505
|
-
o = /* @__PURE__ */ g(
|
|
506
|
-
|
|
682
|
+
if (n === "bar")
|
|
683
|
+
o = /* @__PURE__ */ g(Fe, { ...y, children: [
|
|
684
|
+
r,
|
|
685
|
+
l,
|
|
686
|
+
d,
|
|
687
|
+
m,
|
|
507
688
|
z,
|
|
508
|
-
h,
|
|
509
|
-
x,
|
|
510
|
-
b,
|
|
511
|
-
d.map((c, m) => /* @__PURE__ */ t(Fe, { dataKey: c.value || c.id, name: c.label || c.id, fill: c.fill || _[m % _.length], radius: [3, 3, 0, 0] }, c.id))
|
|
689
|
+
p.map((h, k) => /* @__PURE__ */ t(Ve, { dataKey: h.value || h.id, name: h.label || h.id, fill: h.fill || _[k % _.length], radius: [3, 3, 0, 0] }, h.id))
|
|
512
690
|
] });
|
|
513
|
-
else if (
|
|
514
|
-
o = /* @__PURE__ */ g(
|
|
515
|
-
|
|
691
|
+
else if (n === "line")
|
|
692
|
+
o = /* @__PURE__ */ g(_e, { ...y, children: [
|
|
693
|
+
r,
|
|
694
|
+
l,
|
|
695
|
+
d,
|
|
696
|
+
m,
|
|
516
697
|
z,
|
|
517
|
-
h,
|
|
518
|
-
x,
|
|
519
|
-
b,
|
|
520
|
-
d.map((c, m) => /* @__PURE__ */ t(_e, { type: "monotone", dataKey: c.value || c.id, name: c.label || c.id, stroke: c.color || _[m % _.length], strokeWidth: 2, dot: { r: 3, fill: c.color || _[m % _.length] } }, c.id))
|
|
698
|
+
p.map((h, k) => /* @__PURE__ */ t(Xe, { type: "monotone", dataKey: h.value || h.id, name: h.label || h.id, stroke: h.color || _[k % _.length], strokeWidth: 2, dot: { r: 3, fill: h.color || _[k % _.length] } }, h.id))
|
|
521
699
|
] });
|
|
522
|
-
else if (
|
|
523
|
-
o = /* @__PURE__ */ g(
|
|
524
|
-
|
|
700
|
+
else if (n === "area")
|
|
701
|
+
o = /* @__PURE__ */ g(qe, { ...y, children: [
|
|
702
|
+
r,
|
|
703
|
+
l,
|
|
704
|
+
d,
|
|
705
|
+
m,
|
|
525
706
|
z,
|
|
526
|
-
h,
|
|
527
|
-
x,
|
|
528
|
-
b,
|
|
529
|
-
d.map((c, m) => /* @__PURE__ */ t(qe, { type: "monotone", dataKey: c.value || c.id, name: c.label || c.id, stroke: c.color || _[m % _.length], fill: (c.fill || _[m % _.length]) + "33", strokeWidth: 2 }, c.id))
|
|
707
|
+
p.map((h, k) => /* @__PURE__ */ t(Ge, { type: "monotone", dataKey: h.value || h.id, name: h.label || h.id, stroke: h.color || _[k % _.length], fill: (h.fill || _[k % _.length]) + "33", strokeWidth: 2 }, h.id))
|
|
530
708
|
] });
|
|
531
|
-
else if (
|
|
532
|
-
const
|
|
533
|
-
o = /* @__PURE__ */ g(
|
|
709
|
+
else if (n === "pie" || n === "donut") {
|
|
710
|
+
const h = i[0] || {}, k = Object.keys(h).find((c) => typeof h[c] == "number") || "value", E = Object.keys(h).find((c) => typeof h[c] == "string") || "x";
|
|
711
|
+
o = /* @__PURE__ */ g(Je, { children: [
|
|
534
712
|
/* @__PURE__ */ t(
|
|
535
|
-
|
|
713
|
+
Ue,
|
|
536
714
|
{
|
|
537
|
-
data:
|
|
715
|
+
data: i,
|
|
538
716
|
cx: "50%",
|
|
539
717
|
cy: "50%",
|
|
540
|
-
outerRadius:
|
|
541
|
-
innerRadius:
|
|
542
|
-
dataKey:
|
|
718
|
+
outerRadius: n === "donut" ? "70%" : "80%",
|
|
719
|
+
innerRadius: n === "donut" ? "40%" : 0,
|
|
720
|
+
dataKey: k,
|
|
543
721
|
nameKey: E,
|
|
544
|
-
label: ({ name:
|
|
722
|
+
label: ({ name: c, percent: I }) => `${c ?? ""} ${((I ?? 0) * 100).toFixed(0)}%`,
|
|
545
723
|
labelLine: !0,
|
|
546
724
|
paddingAngle: 2,
|
|
547
|
-
children:
|
|
725
|
+
children: i.map((c, I) => /* @__PURE__ */ t(Qe, { fill: _[I % _.length] }, I))
|
|
548
726
|
}
|
|
549
727
|
),
|
|
550
|
-
|
|
551
|
-
|
|
728
|
+
m,
|
|
729
|
+
z
|
|
552
730
|
] });
|
|
553
|
-
} else
|
|
554
|
-
/* @__PURE__ */ t(
|
|
555
|
-
/* @__PURE__ */ t(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
] }) :
|
|
560
|
-
|
|
561
|
-
/* @__PURE__ */ t(
|
|
562
|
-
/* @__PURE__ */ t(
|
|
563
|
-
|
|
564
|
-
|
|
731
|
+
} else n === "radar" ? o = /* @__PURE__ */ g(Ze, { ...y, cx: "50%", cy: "50%", children: [
|
|
732
|
+
/* @__PURE__ */ t(et, {}),
|
|
733
|
+
/* @__PURE__ */ t(tt, { dataKey: a, tick: { fontSize: 11 } }),
|
|
734
|
+
p.map((h, k) => /* @__PURE__ */ t(nt, { dataKey: h.value || h.id, name: h.label || h.id, stroke: h.color || _[k], fill: (h.fill || _[k]) + "44" }, h.id)),
|
|
735
|
+
m,
|
|
736
|
+
z
|
|
737
|
+
] }) : n === "scatter" && (o = /* @__PURE__ */ g(rt, { ...y, children: [
|
|
738
|
+
r,
|
|
739
|
+
/* @__PURE__ */ t(Se, { dataKey: ((D = p[0]) == null ? void 0 : D.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
|
|
740
|
+
/* @__PURE__ */ t(we, { dataKey: ((T = p[0]) == null ? void 0 : T.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
|
|
741
|
+
m,
|
|
742
|
+
p.map((h, k) => /* @__PURE__ */ t(ot, { data: h.data || i, name: h.label || h.id, fill: h.color || _[k] }, h.id))
|
|
565
743
|
] }));
|
|
566
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: s, padding: 12, background: e.surface, borderRadius: e.rMd, ...
|
|
744
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: s, padding: 12, background: e.surface, borderRadius: e.rMd, ...f }, children: /* @__PURE__ */ t(it, { width: "100%", height: "100%", children: o }) });
|
|
567
745
|
}
|
|
568
|
-
const
|
|
569
|
-
function
|
|
570
|
-
const s = /* @__PURE__ */ new Date(),
|
|
746
|
+
const pt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ut = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
747
|
+
function Lt({ value: n, range: i = !1, timepicker: p = !1, onChange: u, style: x }) {
|
|
748
|
+
const s = /* @__PURE__ */ new Date(), f = n ? new Date(Array.isArray(n) ? n[0] : n) : s, [a, m] = C(f), [z, r] = C(n ?? (i ? [null, null] : null)), [l, d] = C(null), [y, o] = C({ h: 0, m: 0 });
|
|
571
749
|
H(O, []);
|
|
572
|
-
const
|
|
573
|
-
for (let
|
|
574
|
-
for (let
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
577
|
-
if (
|
|
578
|
-
const [
|
|
579
|
-
if (
|
|
580
|
-
const A =
|
|
581
|
-
return
|
|
750
|
+
const b = a.getFullYear(), v = a.getMonth(), M = new Date(b, v, 1).getDay(), D = new Date(b, v + 1, 0).getDate(), T = [];
|
|
751
|
+
for (let c = 0; c < M; c++) T.push(null);
|
|
752
|
+
for (let c = 1; c <= D; c++) T.push(new Date(b, v, c));
|
|
753
|
+
const h = (c) => c.toDateString() === s.toDateString(), k = (c) => {
|
|
754
|
+
if (!z) return !1;
|
|
755
|
+
if (i && Array.isArray(z)) {
|
|
756
|
+
const [I, S] = z;
|
|
757
|
+
if (!I) return !1;
|
|
758
|
+
const A = c.getTime();
|
|
759
|
+
return S ? A >= I.getTime() && A <= S.getTime() : c.toDateString() === I.toDateString();
|
|
582
760
|
}
|
|
583
|
-
return
|
|
584
|
-
}, E = (
|
|
585
|
-
if (
|
|
586
|
-
const [
|
|
587
|
-
if (
|
|
588
|
-
|
|
761
|
+
return c.toDateString() === z.toDateString();
|
|
762
|
+
}, E = (c) => {
|
|
763
|
+
if (i) {
|
|
764
|
+
const [I, S] = Array.isArray(z) ? z : [null, null];
|
|
765
|
+
if (!I || S)
|
|
766
|
+
r([c, null]);
|
|
589
767
|
else {
|
|
590
|
-
const A =
|
|
591
|
-
|
|
768
|
+
const A = c < I ? [c, I] : [I, c];
|
|
769
|
+
r(A), u == null || u(A);
|
|
592
770
|
}
|
|
593
771
|
} else
|
|
594
|
-
|
|
772
|
+
r(c), u == null || u(c);
|
|
595
773
|
};
|
|
596
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...
|
|
774
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...x }, children: [
|
|
597
775
|
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
|
|
598
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
776
|
+
/* @__PURE__ */ t("button", { onClick: () => m((c) => new Date(c.getFullYear(), c.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
|
|
599
777
|
/* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
|
|
600
|
-
|
|
778
|
+
pt[v],
|
|
601
779
|
" ",
|
|
602
|
-
|
|
780
|
+
b
|
|
603
781
|
] }),
|
|
604
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
782
|
+
/* @__PURE__ */ t("button", { onClick: () => m((c) => new Date(c.getFullYear(), c.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
|
|
605
783
|
] }),
|
|
606
784
|
/* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
const
|
|
785
|
+
ut.map((c) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: c }, c)),
|
|
786
|
+
T.map((c, I) => {
|
|
787
|
+
const S = c ? k(c) : !1, A = c && l && c.toDateString() === l.toDateString();
|
|
610
788
|
return /* @__PURE__ */ t(
|
|
611
789
|
"div",
|
|
612
790
|
{
|
|
613
|
-
onClick: () =>
|
|
614
|
-
onMouseEnter: () =>
|
|
615
|
-
onMouseLeave: () =>
|
|
616
|
-
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor:
|
|
617
|
-
children:
|
|
791
|
+
onClick: () => c && E(c),
|
|
792
|
+
onMouseEnter: () => c && d(c),
|
|
793
|
+
onMouseLeave: () => d(null),
|
|
794
|
+
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: c ? "pointer" : "default", fontSize: 12, fontWeight: c && h(c) ? 700 : 400, background: S ? e.primary : A ? e.bg : "transparent", color: S ? "#fff" : c && h(c) ? e.primary : c ? e.text : "transparent", border: c && h(c) && !S ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
|
|
795
|
+
children: c == null ? void 0 : c.getDate()
|
|
618
796
|
},
|
|
619
|
-
|
|
797
|
+
I
|
|
620
798
|
);
|
|
621
799
|
})
|
|
622
800
|
] }),
|
|
623
|
-
|
|
624
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: y.h, onChange: (
|
|
801
|
+
p && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
802
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: y.h, onChange: (c) => o((I) => ({ ...I, h: +c.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
|
|
625
803
|
/* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
|
|
626
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: y.m, onChange: (
|
|
804
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: y.m, onChange: (c) => o((I) => ({ ...I, m: +c.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
|
|
627
805
|
] })
|
|
628
806
|
] });
|
|
629
807
|
}
|
|
630
|
-
function
|
|
631
|
-
const [
|
|
808
|
+
function ht({ value: n, onChange: i, timeFormat: p = 12, controls: u = !1, minuteStep: x = 5, style: s }) {
|
|
809
|
+
const [f, a] = C((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), [m, z] = C((n == null ? void 0 : n.m) ?? 0), [r, l] = C((n == null ? void 0 : n.ampm) ?? "AM"), [d, y] = C(null);
|
|
632
810
|
H(O, []);
|
|
633
|
-
const o =
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
},
|
|
637
|
-
y(null),
|
|
638
|
-
},
|
|
811
|
+
const o = p === 24 ? Array.from({ length: 24 }, (h, k) => k) : Array.from({ length: 12 }, (h, k) => k + 1), b = Array.from({ length: Math.ceil(60 / x) }, (h, k) => k * x), v = (h, k, E) => {
|
|
812
|
+
const c = p === 24 ? { h, m: k } : { h, m: k, ampm: E };
|
|
813
|
+
u ? y(c) : i == null || i(c);
|
|
814
|
+
}, M = () => {
|
|
815
|
+
y(null), a((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), z((n == null ? void 0 : n.m) ?? 0), l((n == null ? void 0 : n.ampm) ?? "AM");
|
|
816
|
+
}, D = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, T = (h) => ({
|
|
639
817
|
height: 32,
|
|
640
818
|
display: "flex",
|
|
641
819
|
alignItems: "center",
|
|
642
820
|
justifyContent: "center",
|
|
643
821
|
cursor: "pointer",
|
|
644
822
|
fontSize: 13,
|
|
645
|
-
fontWeight:
|
|
646
|
-
background:
|
|
647
|
-
color:
|
|
823
|
+
fontWeight: h ? 700 : 400,
|
|
824
|
+
background: h ? e.primaryLt : "transparent",
|
|
825
|
+
color: h ? e.primary : e.text
|
|
648
826
|
});
|
|
649
827
|
return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...s }, children: [
|
|
650
828
|
/* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
|
|
651
|
-
/* @__PURE__ */ g("div", { style:
|
|
829
|
+
/* @__PURE__ */ g("div", { style: D, children: [
|
|
652
830
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
|
|
653
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((
|
|
831
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((h) => /* @__PURE__ */ t(
|
|
654
832
|
"div",
|
|
655
833
|
{
|
|
656
834
|
onClick: () => {
|
|
657
|
-
|
|
835
|
+
a(h), v(h, m, r);
|
|
658
836
|
},
|
|
659
|
-
style:
|
|
660
|
-
onMouseEnter: (
|
|
661
|
-
onMouseLeave: (
|
|
662
|
-
children: String(
|
|
837
|
+
style: T(f === h),
|
|
838
|
+
onMouseEnter: (k) => f !== h && (k.currentTarget.style.background = e.bg),
|
|
839
|
+
onMouseLeave: (k) => f !== h && (k.currentTarget.style.background = "transparent"),
|
|
840
|
+
children: String(h).padStart(2, "0")
|
|
663
841
|
},
|
|
664
|
-
|
|
842
|
+
h
|
|
665
843
|
)) })
|
|
666
844
|
] }),
|
|
667
|
-
/* @__PURE__ */ g("div", { style:
|
|
845
|
+
/* @__PURE__ */ g("div", { style: D, children: [
|
|
668
846
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
|
|
669
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children:
|
|
847
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: b.map((h) => /* @__PURE__ */ t(
|
|
670
848
|
"div",
|
|
671
849
|
{
|
|
672
850
|
onClick: () => {
|
|
673
|
-
|
|
851
|
+
z(h), v(f, h, r);
|
|
674
852
|
},
|
|
675
|
-
style:
|
|
676
|
-
onMouseEnter: (
|
|
677
|
-
onMouseLeave: (
|
|
678
|
-
children: String(
|
|
853
|
+
style: T(m === h),
|
|
854
|
+
onMouseEnter: (k) => m !== h && (k.currentTarget.style.background = e.bg),
|
|
855
|
+
onMouseLeave: (k) => m !== h && (k.currentTarget.style.background = "transparent"),
|
|
856
|
+
children: String(h).padStart(2, "0")
|
|
679
857
|
},
|
|
680
|
-
|
|
858
|
+
h
|
|
681
859
|
)) })
|
|
682
860
|
] }),
|
|
683
|
-
|
|
861
|
+
p === 12 && /* @__PURE__ */ g("div", { style: D, children: [
|
|
684
862
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
|
|
685
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((
|
|
863
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((h) => /* @__PURE__ */ t(
|
|
686
864
|
"div",
|
|
687
865
|
{
|
|
688
866
|
onClick: () => {
|
|
689
|
-
|
|
867
|
+
l(h), v(f, m, h);
|
|
690
868
|
},
|
|
691
|
-
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight:
|
|
692
|
-
children:
|
|
869
|
+
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === h ? 700 : 400, background: r === h ? e.primary : e.surface, color: r === h ? "#fff" : e.text },
|
|
870
|
+
children: h
|
|
693
871
|
},
|
|
694
|
-
|
|
872
|
+
h
|
|
695
873
|
)) })
|
|
696
874
|
] })
|
|
697
875
|
] }),
|
|
698
876
|
/* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
|
|
699
|
-
String(
|
|
877
|
+
String(f).padStart(2, "0"),
|
|
700
878
|
":",
|
|
701
|
-
String(
|
|
702
|
-
|
|
879
|
+
String(m).padStart(2, "0"),
|
|
880
|
+
p === 12 ? ` ${r}` : ""
|
|
703
881
|
] }),
|
|
704
|
-
|
|
705
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick:
|
|
706
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () =>
|
|
882
|
+
u && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
|
|
883
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: M, children: "Cancel" }),
|
|
884
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => d && (i == null ? void 0 : i(d)), children: "Apply" })
|
|
707
885
|
] })
|
|
708
886
|
] });
|
|
709
887
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
const d = (i) => {
|
|
713
|
-
r.current && !r.current.contains(i.target) && l(i);
|
|
714
|
-
};
|
|
715
|
-
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
716
|
-
}, [r, l]);
|
|
717
|
-
}
|
|
718
|
-
function ut(r) {
|
|
719
|
-
const l = q(!1), d = q({ x: 0, y: 0, ox: 0, oy: 0 });
|
|
720
|
-
return J(
|
|
721
|
-
(i, f = 0, s = 0) => {
|
|
722
|
-
l.current = !0, d.current = { x: i.clientX, y: i.clientY, ox: f, oy: s };
|
|
723
|
-
const u = (x) => {
|
|
724
|
-
if (!l.current) return;
|
|
725
|
-
const { x: b, y: p, ox: z, oy: h } = d.current;
|
|
726
|
-
r(z + x.clientX - b, h + x.clientY - p);
|
|
727
|
-
}, n = () => {
|
|
728
|
-
l.current = !1, document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", n);
|
|
729
|
-
};
|
|
730
|
-
document.addEventListener("mousemove", u), document.addEventListener("mouseup", n), i.preventDefault();
|
|
731
|
-
},
|
|
732
|
-
[r]
|
|
733
|
-
);
|
|
734
|
-
}
|
|
735
|
-
const ht = ({ open: r }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: r ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
736
|
-
function ze({ data: r = [], value: l, placeholder: d = "Select or type...", multiselection: i = !1, label: f, onChange: s, style: u }) {
|
|
888
|
+
const ft = ({ open: n }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: n ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
889
|
+
function $e({ data: n = [], value: i, placeholder: p = "Select or type...", multiselection: u = !1, label: x, onChange: s, style: f }) {
|
|
737
890
|
var E;
|
|
738
|
-
const [
|
|
739
|
-
|
|
891
|
+
const [a, m] = C(!1), [z, r] = C(""), [l, d] = C(
|
|
892
|
+
u ? i ? [].concat(i) : [] : i || null
|
|
740
893
|
), y = q(null), o = q(null);
|
|
741
|
-
H(O, []),
|
|
742
|
-
|
|
894
|
+
H(O, []), ie(y, G(() => {
|
|
895
|
+
m(!1), r("");
|
|
743
896
|
}, []));
|
|
744
|
-
const
|
|
745
|
-
() =>
|
|
746
|
-
[
|
|
747
|
-
),
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
|
|
897
|
+
const b = oe(
|
|
898
|
+
() => n.filter((c) => !z || c.value.toLowerCase().includes(z.toLowerCase())),
|
|
899
|
+
[n, z]
|
|
900
|
+
), v = (c) => u ? (l || []).includes(c) : l === c, M = (c) => {
|
|
901
|
+
const I = c.id || c.value;
|
|
902
|
+
if (u) {
|
|
903
|
+
const S = v(I) ? l.filter((A) => A !== I) : [...l || [], I];
|
|
904
|
+
d(S), s == null || s(S);
|
|
752
905
|
} else
|
|
753
|
-
|
|
754
|
-
},
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
},
|
|
758
|
-
|
|
759
|
-
var
|
|
760
|
-
return (
|
|
906
|
+
d(I), r(""), m(!1), s == null || s(I);
|
|
907
|
+
}, D = (c) => {
|
|
908
|
+
const I = l.filter((S) => S !== c);
|
|
909
|
+
d(I), s == null || s(I);
|
|
910
|
+
}, T = () => {
|
|
911
|
+
m(!0), setTimeout(() => {
|
|
912
|
+
var c;
|
|
913
|
+
return (c = o.current) == null ? void 0 : c.focus();
|
|
761
914
|
}, 0);
|
|
762
|
-
},
|
|
763
|
-
return /* @__PURE__ */ g("div", { ref: y, className: "dhx", style: { position: "relative", ...
|
|
764
|
-
|
|
915
|
+
}, h = ((E = n.find((c) => (c.id || c.value) === l)) == null ? void 0 : E.value) || "", k = u ? l || [] : [];
|
|
916
|
+
return /* @__PURE__ */ g("div", { ref: y, className: "dhx", style: { position: "relative", ...f }, children: [
|
|
917
|
+
x && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: x }),
|
|
765
918
|
/* @__PURE__ */ g(
|
|
766
919
|
"div",
|
|
767
920
|
{
|
|
768
|
-
onClick:
|
|
921
|
+
onClick: T,
|
|
769
922
|
style: {
|
|
770
923
|
display: "flex",
|
|
771
924
|
alignItems: "center",
|
|
772
|
-
flexWrap:
|
|
773
|
-
border: `1px solid ${
|
|
925
|
+
flexWrap: u ? "wrap" : "nowrap",
|
|
926
|
+
border: `1px solid ${a ? e.primary : e.border}`,
|
|
774
927
|
borderRadius: e.r,
|
|
775
928
|
minHeight: 34,
|
|
776
929
|
padding: "4px 8px",
|
|
@@ -778,12 +931,12 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
|
|
|
778
931
|
background: e.surface,
|
|
779
932
|
gap: 4,
|
|
780
933
|
transition: "border-color .15s",
|
|
781
|
-
boxShadow:
|
|
934
|
+
boxShadow: a ? `0 0 0 3px ${e.primary}22` : "none"
|
|
782
935
|
},
|
|
783
936
|
children: [
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
var
|
|
937
|
+
u && /* @__PURE__ */ g(Ne, { children: [
|
|
938
|
+
k.map((c) => {
|
|
939
|
+
var I;
|
|
787
940
|
return /* @__PURE__ */ g("span", { style: {
|
|
788
941
|
display: "inline-flex",
|
|
789
942
|
alignItems: "center",
|
|
@@ -796,55 +949,55 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
|
|
|
796
949
|
lineHeight: 1.5,
|
|
797
950
|
whiteSpace: "nowrap"
|
|
798
951
|
}, children: [
|
|
799
|
-
((
|
|
952
|
+
((I = n.find((S) => (S.id || S.value) === c)) == null ? void 0 : I.value) || c,
|
|
800
953
|
/* @__PURE__ */ t(
|
|
801
954
|
"span",
|
|
802
955
|
{
|
|
803
|
-
onClick: (
|
|
804
|
-
|
|
956
|
+
onClick: (S) => {
|
|
957
|
+
S.stopPropagation(), D(c);
|
|
805
958
|
},
|
|
806
959
|
style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
|
|
807
960
|
children: "×"
|
|
808
961
|
}
|
|
809
962
|
)
|
|
810
|
-
] },
|
|
963
|
+
] }, c);
|
|
811
964
|
}),
|
|
812
965
|
/* @__PURE__ */ t(
|
|
813
966
|
"input",
|
|
814
967
|
{
|
|
815
968
|
ref: o,
|
|
816
|
-
value:
|
|
817
|
-
onChange: (
|
|
818
|
-
|
|
969
|
+
value: z,
|
|
970
|
+
onChange: (c) => {
|
|
971
|
+
r(c.target.value), m(!0);
|
|
819
972
|
},
|
|
820
|
-
onFocus: () =>
|
|
821
|
-
onClick: (
|
|
822
|
-
placeholder:
|
|
973
|
+
onFocus: () => m(!0),
|
|
974
|
+
onClick: (c) => c.stopPropagation(),
|
|
975
|
+
placeholder: k.length ? "" : p,
|
|
823
976
|
style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
824
977
|
}
|
|
825
978
|
)
|
|
826
979
|
] }),
|
|
827
|
-
!
|
|
980
|
+
!u && /* @__PURE__ */ t(
|
|
828
981
|
"input",
|
|
829
982
|
{
|
|
830
983
|
ref: o,
|
|
831
|
-
value:
|
|
832
|
-
onChange: (
|
|
833
|
-
|
|
984
|
+
value: a ? z : h,
|
|
985
|
+
onChange: (c) => {
|
|
986
|
+
r(c.target.value), m(!0);
|
|
834
987
|
},
|
|
835
988
|
onFocus: () => {
|
|
836
|
-
|
|
989
|
+
m(!0), r("");
|
|
837
990
|
},
|
|
838
|
-
onClick: (
|
|
839
|
-
placeholder:
|
|
991
|
+
onClick: (c) => c.stopPropagation(),
|
|
992
|
+
placeholder: p,
|
|
840
993
|
style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
841
994
|
}
|
|
842
995
|
),
|
|
843
|
-
/* @__PURE__ */ t(
|
|
996
|
+
/* @__PURE__ */ t(ft, { open: a })
|
|
844
997
|
]
|
|
845
998
|
}
|
|
846
999
|
),
|
|
847
|
-
|
|
1000
|
+
a && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
|
|
848
1001
|
position: "absolute",
|
|
849
1002
|
top: "calc(100% + 4px)",
|
|
850
1003
|
left: 0,
|
|
@@ -855,12 +1008,12 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
|
|
|
855
1008
|
boxShadow: e.shadowLg,
|
|
856
1009
|
zIndex: 100
|
|
857
1010
|
}, children: /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
|
|
858
|
-
|
|
859
|
-
const
|
|
1011
|
+
b.map((c) => {
|
|
1012
|
+
const I = c.id || c.value, S = v(I);
|
|
860
1013
|
return /* @__PURE__ */ g(
|
|
861
1014
|
"div",
|
|
862
1015
|
{
|
|
863
|
-
onClick: () =>
|
|
1016
|
+
onClick: () => M(c),
|
|
864
1017
|
style: {
|
|
865
1018
|
padding: "8px 12px",
|
|
866
1019
|
cursor: "pointer",
|
|
@@ -868,113 +1021,113 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
|
|
|
868
1021
|
alignItems: "center",
|
|
869
1022
|
gap: 8,
|
|
870
1023
|
fontSize: 13,
|
|
871
|
-
background:
|
|
872
|
-
color:
|
|
1024
|
+
background: S ? e.primaryLt : "transparent",
|
|
1025
|
+
color: S ? e.primary : e.text
|
|
873
1026
|
},
|
|
874
|
-
onMouseEnter: (A) => !
|
|
875
|
-
onMouseLeave: (A) => !
|
|
1027
|
+
onMouseEnter: (A) => !S && (A.currentTarget.style.background = e.bg),
|
|
1028
|
+
onMouseLeave: (A) => !S && (A.currentTarget.style.background = "transparent"),
|
|
876
1029
|
children: [
|
|
877
|
-
|
|
1030
|
+
u && /* @__PURE__ */ t("span", { style: {
|
|
878
1031
|
width: 14,
|
|
879
1032
|
height: 14,
|
|
880
1033
|
flexShrink: 0,
|
|
881
|
-
border: `2px solid ${
|
|
1034
|
+
border: `2px solid ${S ? e.primary : e.borderDk}`,
|
|
882
1035
|
borderRadius: 3,
|
|
883
1036
|
display: "flex",
|
|
884
1037
|
alignItems: "center",
|
|
885
1038
|
justifyContent: "center",
|
|
886
|
-
background:
|
|
887
|
-
}, children:
|
|
888
|
-
/* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
889
|
-
!
|
|
890
|
-
|
|
1039
|
+
background: S ? e.primary : "transparent"
|
|
1040
|
+
}, children: S && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
|
|
1041
|
+
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: c.value }),
|
|
1042
|
+
!u && S && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
|
|
1043
|
+
c.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
891
1044
|
"(",
|
|
892
|
-
|
|
1045
|
+
c.count,
|
|
893
1046
|
")"
|
|
894
1047
|
] })
|
|
895
1048
|
]
|
|
896
1049
|
},
|
|
897
|
-
|
|
1050
|
+
I
|
|
898
1051
|
);
|
|
899
1052
|
}),
|
|
900
|
-
|
|
1053
|
+
b.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
|
|
901
1054
|
] }) })
|
|
902
1055
|
] });
|
|
903
1056
|
}
|
|
904
|
-
function
|
|
905
|
-
const [
|
|
1057
|
+
function De({ min: n = 0, max: i = 100, step: p = 1, value: u, range: x = !1, label: s, tick: f, disabled: a = !1, onChange: m, style: z }) {
|
|
1058
|
+
const [r, l] = C(u ?? (x ? [n, i] : n));
|
|
906
1059
|
H(O, []);
|
|
907
|
-
const
|
|
908
|
-
if (!
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
911
|
-
|
|
1060
|
+
const d = (M, D) => {
|
|
1061
|
+
if (!a)
|
|
1062
|
+
if (x) {
|
|
1063
|
+
const T = [...r];
|
|
1064
|
+
T[M] = D, l(T), m == null || m(T);
|
|
912
1065
|
} else
|
|
913
|
-
|
|
914
|
-
}, y = (
|
|
915
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity:
|
|
1066
|
+
l(D), m == null || m(D);
|
|
1067
|
+
}, y = (M) => (M - n) / (i - n) * 100, o = x ? r : [r], b = x ? { left: `${y(o[0])}%`, width: `${y(o[1]) - y(o[0])}%` } : { left: 0, width: `${y(o[0])}%` }, v = a ? e.border : e.primary;
|
|
1068
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: a ? 0.5 : 1, ...z }, children: [
|
|
916
1069
|
s && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: s }),
|
|
917
1070
|
/* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ g("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
|
|
918
|
-
/* @__PURE__ */ t("div", { style: { position: "absolute", ...
|
|
919
|
-
o.map((
|
|
1071
|
+
/* @__PURE__ */ t("div", { style: { position: "absolute", ...b, height: "100%", background: v, borderRadius: 2 } }),
|
|
1072
|
+
o.map((M, D) => /* @__PURE__ */ t(
|
|
920
1073
|
"input",
|
|
921
1074
|
{
|
|
922
1075
|
type: "range",
|
|
923
|
-
min:
|
|
924
|
-
max:
|
|
925
|
-
step:
|
|
926
|
-
value:
|
|
927
|
-
disabled:
|
|
928
|
-
onChange: (
|
|
929
|
-
const
|
|
930
|
-
|
|
1076
|
+
min: n,
|
|
1077
|
+
max: i,
|
|
1078
|
+
step: p,
|
|
1079
|
+
value: M,
|
|
1080
|
+
disabled: a,
|
|
1081
|
+
onChange: (T) => {
|
|
1082
|
+
const h = +T.target.value;
|
|
1083
|
+
x && D === 0 && h >= r[1] || x && D === 1 && h <= r[0] || d(D, h);
|
|
931
1084
|
},
|
|
932
|
-
style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor:
|
|
1085
|
+
style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: a ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
|
|
933
1086
|
},
|
|
934
|
-
|
|
1087
|
+
D
|
|
935
1088
|
)),
|
|
936
|
-
o.map((
|
|
1089
|
+
o.map((M, D) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${y(M)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${v}`, 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: a ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: M }) }, D))
|
|
937
1090
|
] }) }),
|
|
938
|
-
|
|
1091
|
+
f && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((i + n) / 2), i].map((M) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: M }, M)) })
|
|
939
1092
|
] });
|
|
940
1093
|
}
|
|
941
|
-
const
|
|
942
|
-
function ye(
|
|
943
|
-
const
|
|
944
|
-
let
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
const
|
|
948
|
-
|
|
1094
|
+
const xt = ["#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"];
|
|
1095
|
+
function ye(n) {
|
|
1096
|
+
const i = parseInt(n.slice(1, 3), 16) / 255, p = parseInt(n.slice(3, 5), 16) / 255, u = parseInt(n.slice(5, 7), 16) / 255, x = Math.max(i, p, u), s = Math.min(i, p, u);
|
|
1097
|
+
let f = 0, a = 0;
|
|
1098
|
+
const m = (x + s) / 2;
|
|
1099
|
+
if (x !== s) {
|
|
1100
|
+
const z = x - s;
|
|
1101
|
+
a = m > 0.5 ? z / (2 - x - s) : z / (x + s), f = x === i ? ((p - u) / z + (p < u ? 6 : 0)) / 6 : x === p ? ((u - i) / z + 2) / 6 : ((i - p) / z + 4) / 6;
|
|
949
1102
|
}
|
|
950
|
-
return [Math.round(
|
|
1103
|
+
return [Math.round(f * 360), Math.round(a * 100), Math.round(m * 100)];
|
|
951
1104
|
}
|
|
952
|
-
function
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
const
|
|
956
|
-
return Math.round(255 *
|
|
1105
|
+
function Ie(n, i, p) {
|
|
1106
|
+
i /= 100, p /= 100;
|
|
1107
|
+
const u = i * Math.min(p, 1 - p), x = (s) => {
|
|
1108
|
+
const f = (s + n / 30) % 12, a = p - u * Math.max(Math.min(f - 3, 9 - f, 1), -1);
|
|
1109
|
+
return Math.round(255 * a).toString(16).padStart(2, "0");
|
|
957
1110
|
};
|
|
958
|
-
return "#" +
|
|
1111
|
+
return "#" + x(0) + x(8) + x(4);
|
|
959
1112
|
}
|
|
960
|
-
function
|
|
961
|
-
const [
|
|
1113
|
+
function Tt({ value: n = "#0288d1", onChange: i, style: p }) {
|
|
1114
|
+
const [u, x] = C(() => ye(n)), s = Ie(...u);
|
|
962
1115
|
H(O, []);
|
|
963
|
-
const
|
|
964
|
-
|
|
1116
|
+
const f = (a) => {
|
|
1117
|
+
x(a), i == null || i(Ie(...a));
|
|
965
1118
|
};
|
|
966
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...
|
|
967
|
-
/* @__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(${
|
|
968
|
-
[["Hue", 0, 360,
|
|
1119
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...p }, children: [
|
|
1120
|
+
/* @__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(${u[0]},100%,50%))`, cursor: "crosshair" } }),
|
|
1121
|
+
[["Hue", 0, 360, u[0]], ["Saturation", 0, 100, u[1]], ["Lightness", 0, 100, u[2]]].map(([a, m, z, r], l) => /* @__PURE__ */ g("div", { style: { marginBottom: l < 2 ? 8 : 12 }, children: [
|
|
969
1122
|
/* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
|
|
970
|
-
|
|
971
|
-
|
|
1123
|
+
a,
|
|
1124
|
+
l > 0 ? ` (${r}%)` : ""
|
|
972
1125
|
] }),
|
|
973
|
-
/* @__PURE__ */ t("input", { type: "range", min:
|
|
974
|
-
const y = [...
|
|
975
|
-
y[
|
|
1126
|
+
/* @__PURE__ */ t("input", { type: "range", min: m, max: z, value: r, onChange: (d) => {
|
|
1127
|
+
const y = [...u];
|
|
1128
|
+
y[l] = +d.target.value, f(y);
|
|
976
1129
|
}, style: { width: "100%", accentColor: e.primary } })
|
|
977
|
-
] },
|
|
1130
|
+
] }, a)),
|
|
978
1131
|
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
979
1132
|
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: s, border: `1px solid ${e.border}`, flexShrink: 0 } }),
|
|
980
1133
|
/* @__PURE__ */ t(
|
|
@@ -983,236 +1136,185 @@ function Ct({ value: r = "#0288d1", onChange: l, style: d }) {
|
|
|
983
1136
|
className: "dhx dhx-input",
|
|
984
1137
|
style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
|
|
985
1138
|
value: s,
|
|
986
|
-
onChange: (
|
|
1139
|
+
onChange: (a) => {
|
|
987
1140
|
try {
|
|
988
|
-
|
|
1141
|
+
f(ye(a.target.value)), i == null || i(a.target.value);
|
|
989
1142
|
} catch {
|
|
990
1143
|
}
|
|
991
1144
|
}
|
|
992
1145
|
}
|
|
993
1146
|
)
|
|
994
1147
|
] }),
|
|
995
|
-
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children:
|
|
1148
|
+
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: xt.map((a) => /* @__PURE__ */ t(
|
|
996
1149
|
"div",
|
|
997
1150
|
{
|
|
998
1151
|
onClick: () => {
|
|
999
|
-
|
|
1152
|
+
x(ye(a)), i == null || i(a);
|
|
1000
1153
|
},
|
|
1001
|
-
style: { width: 14, height: 14, borderRadius: 2, background:
|
|
1002
|
-
onMouseEnter: (
|
|
1003
|
-
onMouseLeave: (
|
|
1154
|
+
style: { width: 14, height: 14, borderRadius: 2, background: a, cursor: "pointer", border: s === a ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
|
|
1155
|
+
onMouseEnter: (m) => m.currentTarget.style.transform = "scale(1.3)",
|
|
1156
|
+
onMouseLeave: (m) => m.currentTarget.style.transform = "scale(1)"
|
|
1004
1157
|
},
|
|
1005
|
-
|
|
1158
|
+
a
|
|
1006
1159
|
)) })
|
|
1007
1160
|
] });
|
|
1008
1161
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const [
|
|
1011
|
-
return /* @__PURE__ */
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
onClick: () => {
|
|
1020
|
-
var p;
|
|
1021
|
-
return !s.disabled && !((p = s.items) != null && p.length) && l(s);
|
|
1022
|
-
},
|
|
1023
|
-
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: s.disabled ? "not-allowed" : "pointer", fontSize: 13, color: s.disabled ? e.textMut : e.text, background: n && !s.disabled ? e.bg : "transparent", opacity: s.disabled ? 0.5 : 1 },
|
|
1024
|
-
children: [
|
|
1025
|
-
s.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: s.icon }),
|
|
1026
|
-
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: s.value || s.id }),
|
|
1027
|
-
s.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: s.hotkey }),
|
|
1028
|
-
(x = s.items) != null && x.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
|
|
1029
|
-
]
|
|
1030
|
-
}
|
|
1031
|
-
),
|
|
1032
|
-
n && ((b = s.items) != null && b.length) ? /* @__PURE__ */ t(he, { items: s.items, onSelect: l, style: { position: "absolute", left: "100%", top: -4 } }) : null
|
|
1033
|
-
] }, s.id || u);
|
|
1034
|
-
}) });
|
|
1035
|
-
}
|
|
1036
|
-
function Nt({ items: r = [], label: l = "Menu", onSelect: d, style: i }) {
|
|
1037
|
-
const [f, s] = D(!1), u = q(null);
|
|
1038
|
-
return H(O, []), se(u, J(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: u, className: "dhx", style: { position: "relative", display: "inline-block", ...i }, children: [
|
|
1039
|
-
/* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => s((n) => !n), children: [
|
|
1040
|
-
l,
|
|
1041
|
-
" ",
|
|
1042
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
|
|
1043
|
-
] }),
|
|
1044
|
-
f && /* @__PURE__ */ t(he, { items: r, onSelect: (n) => {
|
|
1045
|
-
d == null || d(n), s(!1);
|
|
1046
|
-
} })
|
|
1047
|
-
] });
|
|
1048
|
-
}
|
|
1049
|
-
function Tt({ items: r = [], onSelect: l, children: d }) {
|
|
1050
|
-
const [i, f] = D(null), s = q(null);
|
|
1051
|
-
return H(O, []), se(s, J(() => f(null), [])), /* @__PURE__ */ g("div", { ref: s, onContextMenu: (n) => {
|
|
1052
|
-
n.preventDefault(), f({ x: n.clientX, y: n.clientY });
|
|
1053
|
-
}, style: { position: "relative", display: "contents" }, children: [
|
|
1054
|
-
d,
|
|
1055
|
-
i && /* @__PURE__ */ t("div", { style: { position: "fixed", left: i.x, top: i.y, zIndex: 9999 }, children: /* @__PURE__ */ t(he, { items: r, onSelect: (n) => {
|
|
1056
|
-
l == null || l(n), f(null);
|
|
1057
|
-
} }) })
|
|
1058
|
-
] });
|
|
1059
|
-
}
|
|
1060
|
-
function Lt({ trigger: r, children: l, placement: d = "bottom-start", style: i }) {
|
|
1061
|
-
const [f, s] = D(!1), [u, n] = D({ top: "100%", left: 0 }), x = q(null), b = q(null);
|
|
1062
|
-
return H(O, []), se(x, J(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
|
|
1063
|
-
/* @__PURE__ */ t("div", { ref: b, onClick: () => {
|
|
1064
|
-
s((z) => {
|
|
1065
|
-
if (!z && b.current) {
|
|
1066
|
-
const h = b.current.getBoundingClientRect(), y = {
|
|
1067
|
-
"bottom-start": { top: h.height + 4, left: 0 },
|
|
1068
|
-
"bottom-end": { top: h.height + 4, right: 0, left: "auto" },
|
|
1069
|
-
"top-start": { bottom: h.height + 4, top: "auto", left: 0 }
|
|
1162
|
+
function Nt({ trigger: n, children: i, placement: p = "bottom-start", style: u }) {
|
|
1163
|
+
const [x, s] = C(!1), [f, a] = C({ top: "100%", left: 0 }), m = q(null), z = q(null);
|
|
1164
|
+
return H(O, []), ie(m, G(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: m, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
|
|
1165
|
+
/* @__PURE__ */ t("div", { ref: z, onClick: () => {
|
|
1166
|
+
s((l) => {
|
|
1167
|
+
if (!l && z.current) {
|
|
1168
|
+
const d = z.current.getBoundingClientRect(), y = {
|
|
1169
|
+
"bottom-start": { top: d.height + 4, left: 0 },
|
|
1170
|
+
"bottom-end": { top: d.height + 4, right: 0, left: "auto" },
|
|
1171
|
+
"top-start": { bottom: d.height + 4, top: "auto", left: 0 }
|
|
1070
1172
|
};
|
|
1071
|
-
|
|
1173
|
+
a(y[p] || y["bottom-start"]);
|
|
1072
1174
|
}
|
|
1073
|
-
return !
|
|
1175
|
+
return !l;
|
|
1074
1176
|
});
|
|
1075
|
-
}, children:
|
|
1076
|
-
|
|
1177
|
+
}, children: n }),
|
|
1178
|
+
x && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...f, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...u }, children: i })
|
|
1077
1179
|
] });
|
|
1078
1180
|
}
|
|
1079
|
-
function
|
|
1080
|
-
const [
|
|
1181
|
+
function Rt({ title: n, children: i, width: p = 480, height: u, closable: x = !0, movable: s = !0, modal: f = !1, defaultOpen: a = !0, footer: m, onClose: z, style: r }) {
|
|
1182
|
+
const [l, d] = C(a), [y, o] = C({ x: 0, y: 0 });
|
|
1081
1183
|
H(O, []);
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1184
|
+
const b = st(G((M, D) => s && o({ x: M, y: D }), [s])), v = () => {
|
|
1185
|
+
d(!1), z == null || z();
|
|
1084
1186
|
};
|
|
1085
|
-
return
|
|
1086
|
-
|
|
1087
|
-
/* @__PURE__ */ g("div", { className: "dhx", style: { position:
|
|
1088
|
-
/* @__PURE__ */ g("div", { onMouseDown: (
|
|
1089
|
-
/* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children:
|
|
1090
|
-
|
|
1187
|
+
return l ? /* @__PURE__ */ g(Ne, { children: [
|
|
1188
|
+
f && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: x ? v : void 0 }),
|
|
1189
|
+
/* @__PURE__ */ g("div", { className: "dhx", style: { position: f ? "fixed" : "absolute", left: f ? "50%" : `calc(50% + ${y.x}px)`, top: f ? "50%" : `calc(50% + ${y.y}px)`, transform: `translate(calc(-50% + ${y.x}px), calc(-50% + ${y.y}px))`, width: p, ...u ? { height: u } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
|
|
1190
|
+
/* @__PURE__ */ g("div", { onMouseDown: (M) => b(M, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: s ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
|
|
1191
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
|
|
1192
|
+
x && /* @__PURE__ */ t(
|
|
1091
1193
|
"button",
|
|
1092
1194
|
{
|
|
1093
|
-
onClick:
|
|
1195
|
+
onClick: v,
|
|
1094
1196
|
style: { background: "none", border: "none", cursor: "pointer", width: 28, height: 28, borderRadius: e.r, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 18, color: e.textSec },
|
|
1095
|
-
onMouseEnter: (
|
|
1096
|
-
onMouseLeave: (
|
|
1197
|
+
onMouseEnter: (M) => M.currentTarget.style.background = e.border,
|
|
1198
|
+
onMouseLeave: (M) => M.currentTarget.style.background = "none",
|
|
1097
1199
|
children: "×"
|
|
1098
1200
|
}
|
|
1099
1201
|
)
|
|
1100
1202
|
] }),
|
|
1101
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children:
|
|
1102
|
-
|
|
1203
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: i }),
|
|
1204
|
+
m && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: m })
|
|
1103
1205
|
] })
|
|
1104
1206
|
] }) : null;
|
|
1105
1207
|
}
|
|
1106
|
-
const
|
|
1107
|
-
function
|
|
1108
|
-
const [
|
|
1208
|
+
const Re = je(null), gt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Ce = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
|
|
1209
|
+
function Et({ children: n }) {
|
|
1210
|
+
const [i, p] = C([]);
|
|
1109
1211
|
H(O, []);
|
|
1110
|
-
const
|
|
1111
|
-
const
|
|
1112
|
-
return
|
|
1113
|
-
}, [
|
|
1114
|
-
message:
|
|
1115
|
-
alert: (
|
|
1116
|
-
confirm: (
|
|
1212
|
+
const u = G((f) => p((a) => a.filter((m) => m.id !== f)), []), x = G((f) => {
|
|
1213
|
+
const a = Date.now();
|
|
1214
|
+
return p((m) => [...m, { id: a, ...f }]), f.duration !== 0 && setTimeout(() => u(a), f.duration || 4e3), a;
|
|
1215
|
+
}, [u]), s = {
|
|
1216
|
+
message: x,
|
|
1217
|
+
alert: (f, a) => x({ type: "info", title: f, ...a }),
|
|
1218
|
+
confirm: (f, a, m) => x({ type: "warning", title: f, confirm: a, ...m })
|
|
1117
1219
|
};
|
|
1118
|
-
return /* @__PURE__ */ g(
|
|
1119
|
-
|
|
1120
|
-
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children:
|
|
1121
|
-
const
|
|
1122
|
-
return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${
|
|
1123
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 18, color:
|
|
1220
|
+
return /* @__PURE__ */ g(Re.Provider, { value: s, children: [
|
|
1221
|
+
n,
|
|
1222
|
+
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: i.map((f) => {
|
|
1223
|
+
const a = f.type || "info";
|
|
1224
|
+
return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Ce[a]}`, 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: [
|
|
1225
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 18, color: Ce[a], lineHeight: 1 }, children: gt[a] }),
|
|
1124
1226
|
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1227
|
+
f.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: f.text ? 3 : 0 }, children: f.title }),
|
|
1228
|
+
f.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: f.text }),
|
|
1229
|
+
f.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
|
|
1128
1230
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
1129
|
-
|
|
1231
|
+
f.confirm(!0), u(f.id);
|
|
1130
1232
|
}, children: "Confirm" }),
|
|
1131
1233
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
1132
|
-
|
|
1234
|
+
f.confirm(!1), u(f.id);
|
|
1133
1235
|
}, children: "Cancel" })
|
|
1134
1236
|
] })
|
|
1135
1237
|
] }),
|
|
1136
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
1137
|
-
] },
|
|
1238
|
+
/* @__PURE__ */ t("button", { onClick: () => u(f.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
|
|
1239
|
+
] }, f.id);
|
|
1138
1240
|
}) })
|
|
1139
1241
|
] });
|
|
1140
1242
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const
|
|
1143
|
-
if (!
|
|
1144
|
-
return
|
|
1243
|
+
function Wt() {
|
|
1244
|
+
const n = Pe(Re);
|
|
1245
|
+
if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
|
|
1246
|
+
return n;
|
|
1145
1247
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const [
|
|
1248
|
+
function At({ data: n = [], template: i, keyNavigation: p = !0, multiselection: u = !1, editable: x = !1, height: s = 400, onSelect: f, onEdit: a, style: m }) {
|
|
1249
|
+
const [z, r] = C(/* @__PURE__ */ new Set()), [l, d] = C(null), [y, o] = C(""), [b, v] = C(null);
|
|
1148
1250
|
H(O, []);
|
|
1149
|
-
const
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
const
|
|
1153
|
-
return
|
|
1154
|
-
}),
|
|
1155
|
-
},
|
|
1156
|
-
|
|
1251
|
+
const M = (T, h) => {
|
|
1252
|
+
const k = T.id ?? h;
|
|
1253
|
+
r((E) => {
|
|
1254
|
+
const c = u ? new Set(E) : /* @__PURE__ */ new Set();
|
|
1255
|
+
return c.has(k) ? c.delete(k) : c.add(k), c;
|
|
1256
|
+
}), v(h), f == null || f(T);
|
|
1257
|
+
}, D = (T, h) => {
|
|
1258
|
+
a == null || a({ ...T, value: y }, h), d(null);
|
|
1157
1259
|
};
|
|
1158
1260
|
return /* @__PURE__ */ g(
|
|
1159
1261
|
"div",
|
|
1160
1262
|
{
|
|
1161
1263
|
className: "dhx dhx-scroll",
|
|
1162
|
-
style: { height: s, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...
|
|
1264
|
+
style: { height: s, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...m },
|
|
1163
1265
|
tabIndex: 0,
|
|
1164
|
-
onKeyDown: (
|
|
1165
|
-
|
|
1266
|
+
onKeyDown: (T) => {
|
|
1267
|
+
p && (T.key === "ArrowDown" && v((h) => Math.min((h ?? -1) + 1, n.length - 1)), T.key === "ArrowUp" && v((h) => Math.max((h ?? 1) - 1, 0)));
|
|
1166
1268
|
},
|
|
1167
1269
|
children: [
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1270
|
+
n.map((T, h) => {
|
|
1271
|
+
const k = T.id ?? h, E = z.has(k), c = b === h;
|
|
1170
1272
|
return /* @__PURE__ */ t(
|
|
1171
1273
|
"div",
|
|
1172
1274
|
{
|
|
1173
|
-
onClick: () =>
|
|
1174
|
-
onDoubleClick: () =>
|
|
1175
|
-
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: E ? e.primaryLt :
|
|
1176
|
-
children:
|
|
1275
|
+
onClick: () => M(T, h),
|
|
1276
|
+
onDoubleClick: () => x && (d(h), o(String(T.value || ""))),
|
|
1277
|
+
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: E ? e.primaryLt : c ? e.bg : e.surface, color: E ? e.primary : e.text, outline: c ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
|
|
1278
|
+
children: l === h ? /* @__PURE__ */ t(
|
|
1177
1279
|
"input",
|
|
1178
1280
|
{
|
|
1179
1281
|
autoFocus: !0,
|
|
1180
1282
|
className: "dhx dhx-input",
|
|
1181
1283
|
style: { height: 28, flex: 1 },
|
|
1182
1284
|
value: y,
|
|
1183
|
-
onChange: (
|
|
1184
|
-
onBlur: () =>
|
|
1185
|
-
onKeyDown: (
|
|
1186
|
-
|
|
1285
|
+
onChange: (I) => o(I.target.value),
|
|
1286
|
+
onBlur: () => D(T, h),
|
|
1287
|
+
onKeyDown: (I) => {
|
|
1288
|
+
I.key === "Enter" && D(T, h), I.key === "Escape" && d(null);
|
|
1187
1289
|
},
|
|
1188
|
-
onClick: (
|
|
1290
|
+
onClick: (I) => I.stopPropagation()
|
|
1189
1291
|
}
|
|
1190
|
-
) :
|
|
1292
|
+
) : i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(T) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(T.value ?? "") })
|
|
1191
1293
|
},
|
|
1192
|
-
String(
|
|
1294
|
+
String(k)
|
|
1193
1295
|
);
|
|
1194
1296
|
}),
|
|
1195
|
-
|
|
1297
|
+
n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
|
|
1196
1298
|
]
|
|
1197
1299
|
}
|
|
1198
1300
|
);
|
|
1199
1301
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const [
|
|
1302
|
+
function Bt({ data: n = [], template: i, itemsInRow: p = 3, gap: u = 12, multiselection: x = !1, onSelect: s, style: f }) {
|
|
1303
|
+
const [a, m] = C(/* @__PURE__ */ new Set());
|
|
1202
1304
|
H(O, []);
|
|
1203
|
-
const
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
const y =
|
|
1207
|
-
return y.has(
|
|
1208
|
-
}), s == null || s(
|
|
1305
|
+
const z = (r) => {
|
|
1306
|
+
const l = r.id ?? String(r.title);
|
|
1307
|
+
m((d) => {
|
|
1308
|
+
const y = x ? new Set(d) : /* @__PURE__ */ new Set();
|
|
1309
|
+
return y.has(l) ? y.delete(l) : y.add(l), y;
|
|
1310
|
+
}), s == null || s(r);
|
|
1209
1311
|
};
|
|
1210
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${
|
|
1211
|
-
const
|
|
1312
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${p}, 1fr)`, gap: u, padding: u, ...f }, children: n.map((r, l) => {
|
|
1313
|
+
const d = r.id ?? l, y = a.has(d);
|
|
1212
1314
|
return /* @__PURE__ */ t(
|
|
1213
1315
|
"div",
|
|
1214
1316
|
{
|
|
1215
|
-
onClick: () =>
|
|
1317
|
+
onClick: () => z(r),
|
|
1216
1318
|
style: { background: e.surface, border: `2px solid ${y ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: y ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: y ? "translateY(-2px)" : "none" },
|
|
1217
1319
|
onMouseEnter: (o) => {
|
|
1218
1320
|
o.currentTarget.style.boxShadow = e.shadowLg, o.currentTarget.style.transform = "translateY(-2px)";
|
|
@@ -1220,151 +1322,151 @@ function At({ data: r = [], template: l, itemsInRow: d = 3, gap: i = 12, multise
|
|
|
1220
1322
|
onMouseLeave: (o) => {
|
|
1221
1323
|
o.currentTarget.style.boxShadow = y ? `0 0 0 3px ${e.primary}33` : e.shadow, o.currentTarget.style.transform = y ? "translateY(-2px)" : "none";
|
|
1222
1324
|
},
|
|
1223
|
-
children:
|
|
1224
|
-
|
|
1225
|
-
/* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children:
|
|
1226
|
-
|
|
1325
|
+
children: i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
|
|
1326
|
+
r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
|
|
1327
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
|
|
1328
|
+
r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
|
|
1227
1329
|
] })
|
|
1228
1330
|
},
|
|
1229
|
-
String(
|
|
1331
|
+
String(d)
|
|
1230
1332
|
);
|
|
1231
1333
|
}) });
|
|
1232
1334
|
}
|
|
1233
|
-
function be(
|
|
1234
|
-
return
|
|
1335
|
+
function be(n) {
|
|
1336
|
+
return n.map((i) => ({ ...i, items: i.items ? be(i.items) : void 0 }));
|
|
1235
1337
|
}
|
|
1236
|
-
function me(
|
|
1237
|
-
return
|
|
1238
|
-
|
|
1239
|
-
}),
|
|
1338
|
+
function me(n, i = {}) {
|
|
1339
|
+
return n.forEach((p) => {
|
|
1340
|
+
p.opened && (i[p.id] = !0), p.items && me(p.items, i);
|
|
1341
|
+
}), i;
|
|
1240
1342
|
}
|
|
1241
|
-
function
|
|
1242
|
-
let
|
|
1243
|
-
return [
|
|
1244
|
-
if (
|
|
1245
|
-
const [s,
|
|
1246
|
-
return
|
|
1343
|
+
function Ee(n, i) {
|
|
1344
|
+
let p = null;
|
|
1345
|
+
return [n.filter((x) => x.id === i ? (p = x, !1) : !0).map((x) => {
|
|
1346
|
+
if (x.items) {
|
|
1347
|
+
const [s, f] = Ee(x.items, i);
|
|
1348
|
+
return f && (p = f), { ...x, items: s };
|
|
1247
1349
|
}
|
|
1248
|
-
return
|
|
1249
|
-
}),
|
|
1350
|
+
return x;
|
|
1351
|
+
}), p];
|
|
1250
1352
|
}
|
|
1251
|
-
function ve(
|
|
1252
|
-
if (
|
|
1253
|
-
return
|
|
1254
|
-
if (
|
|
1353
|
+
function ve(n, i, p, u) {
|
|
1354
|
+
if (u === "inside")
|
|
1355
|
+
return n.map((s) => s.id === i ? { ...s, items: [...s.items || [], p] } : s.items ? { ...s, items: ve(s.items, i, p, u) } : s);
|
|
1356
|
+
if (n.some((s) => s.id === i)) {
|
|
1255
1357
|
const s = [];
|
|
1256
|
-
for (const
|
|
1257
|
-
|
|
1358
|
+
for (const f of n)
|
|
1359
|
+
f.id === i ? u === "before" ? (s.push(p), s.push(f)) : (s.push(f), s.push(p)) : s.push(f);
|
|
1258
1360
|
return s;
|
|
1259
1361
|
}
|
|
1260
|
-
return
|
|
1362
|
+
return n.map((s) => s.items ? { ...s, items: ve(s.items, i, p, u) } : s);
|
|
1261
1363
|
}
|
|
1262
|
-
function
|
|
1263
|
-
function
|
|
1264
|
-
var s,
|
|
1265
|
-
if (
|
|
1266
|
-
const
|
|
1267
|
-
var
|
|
1268
|
-
return
|
|
1364
|
+
function yt(n, i, p) {
|
|
1365
|
+
function u(x) {
|
|
1366
|
+
var s, f;
|
|
1367
|
+
if (x.id === i) {
|
|
1368
|
+
const a = (m) => {
|
|
1369
|
+
var z;
|
|
1370
|
+
return m.id === p || (((z = m.items) == null ? void 0 : z.some(a)) ?? !1);
|
|
1269
1371
|
};
|
|
1270
|
-
return ((s =
|
|
1372
|
+
return ((s = x.items) == null ? void 0 : s.some(a)) ?? !1;
|
|
1271
1373
|
}
|
|
1272
|
-
return ((
|
|
1374
|
+
return ((f = x.items) == null ? void 0 : f.some(u)) ?? !1;
|
|
1273
1375
|
}
|
|
1274
|
-
return
|
|
1376
|
+
return n.some(u);
|
|
1275
1377
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1278
|
-
(
|
|
1378
|
+
function We(n, i, p) {
|
|
1379
|
+
return n.map(
|
|
1380
|
+
(u) => u.id === i ? { ...u, value: p } : { ...u, items: u.items ? We(u.items, i, p) : void 0 }
|
|
1279
1381
|
);
|
|
1280
1382
|
}
|
|
1281
|
-
function
|
|
1383
|
+
function bt(n, i) {
|
|
1282
1384
|
var s;
|
|
1283
|
-
let
|
|
1284
|
-
const
|
|
1285
|
-
var
|
|
1286
|
-
|
|
1385
|
+
let p = 0, u = 0;
|
|
1386
|
+
const x = (f) => {
|
|
1387
|
+
var a;
|
|
1388
|
+
p++, i[f.id] && u++, (a = f.items) == null || a.forEach(x);
|
|
1287
1389
|
};
|
|
1288
|
-
return (s =
|
|
1390
|
+
return (s = n.items) == null || s.forEach(x), { total: p, checkedCount: u };
|
|
1289
1391
|
}
|
|
1290
|
-
function
|
|
1291
|
-
data:
|
|
1292
|
-
checkbox:
|
|
1293
|
-
editable:
|
|
1294
|
-
dragMode:
|
|
1295
|
-
tooltip:
|
|
1392
|
+
function Ht({
|
|
1393
|
+
data: n = [],
|
|
1394
|
+
checkbox: i = !1,
|
|
1395
|
+
editable: p = !1,
|
|
1396
|
+
dragMode: u,
|
|
1397
|
+
tooltip: x,
|
|
1296
1398
|
onSelect: s,
|
|
1297
|
-
onCheck:
|
|
1298
|
-
onChange:
|
|
1299
|
-
style:
|
|
1399
|
+
onCheck: f,
|
|
1400
|
+
onChange: a,
|
|
1401
|
+
style: m
|
|
1300
1402
|
}) {
|
|
1301
|
-
const [
|
|
1403
|
+
const [z, r] = C(() => be(n)), [l, d] = C(() => me(n)), [y, o] = C(null), [b, v] = C({}), [M, D] = C(null), [T, h] = C(""), [k, E] = C(null), [c, I] = C(null);
|
|
1302
1404
|
H(O, []), H(() => {
|
|
1303
|
-
|
|
1304
|
-
}, [
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1405
|
+
r(be(n)), d((L) => ({ ...me(n), ...L }));
|
|
1406
|
+
}, [n]);
|
|
1407
|
+
const S = (L) => d((j) => ({ ...j, [L]: !j[L] })), A = (L, j) => {
|
|
1408
|
+
v((Y) => ({ ...Y, [L]: j })), f == null || f(L, j);
|
|
1307
1409
|
}, F = () => {
|
|
1308
|
-
if (!
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
const V =
|
|
1312
|
-
return
|
|
1410
|
+
if (!M) return;
|
|
1411
|
+
const L = M, j = T;
|
|
1412
|
+
D(null), r((Y) => {
|
|
1413
|
+
const V = We(Y, L, j);
|
|
1414
|
+
return a == null || a(V), V;
|
|
1313
1415
|
});
|
|
1314
|
-
}, U = (
|
|
1315
|
-
|
|
1316
|
-
}, Q = (
|
|
1317
|
-
if (!
|
|
1318
|
-
|
|
1319
|
-
const Y =
|
|
1320
|
-
|
|
1321
|
-
},
|
|
1322
|
-
if (
|
|
1323
|
-
|
|
1416
|
+
}, U = (L, j) => {
|
|
1417
|
+
L.dataTransfer.effectAllowed = "move", E(j);
|
|
1418
|
+
}, Q = (L, j) => {
|
|
1419
|
+
if (!k || k === j || yt(z, k, j)) return;
|
|
1420
|
+
L.preventDefault();
|
|
1421
|
+
const Y = L.currentTarget.getBoundingClientRect(), V = L.clientY - Y.top, K = Y.height, J = V < K * 0.25 ? "before" : V > K * 0.75 ? "after" : "inside";
|
|
1422
|
+
I((X) => (X == null ? void 0 : X.id) === j && (X == null ? void 0 : X.pos) === J ? X : { id: j, pos: J });
|
|
1423
|
+
}, de = (L, j) => {
|
|
1424
|
+
if (L.preventDefault(), !k || !c || k === j) {
|
|
1425
|
+
I(null), E(null);
|
|
1324
1426
|
return;
|
|
1325
1427
|
}
|
|
1326
|
-
|
|
1327
|
-
const [V, K] =
|
|
1428
|
+
r((Y) => {
|
|
1429
|
+
const [V, K] = Ee(Y, k);
|
|
1328
1430
|
if (!K) return Y;
|
|
1329
|
-
const
|
|
1330
|
-
return
|
|
1331
|
-
}),
|
|
1332
|
-
},
|
|
1333
|
-
E(null),
|
|
1334
|
-
},
|
|
1335
|
-
var
|
|
1336
|
-
const Y = (((
|
|
1337
|
-
let
|
|
1338
|
-
if (
|
|
1339
|
-
const { total: W, checkedCount: ee } =
|
|
1340
|
-
ee > 0 && ee < W ?
|
|
1431
|
+
const J = ve(V, j, K, c.pos);
|
|
1432
|
+
return a == null || a(J), J;
|
|
1433
|
+
}), c.pos === "inside" && d((Y) => ({ ...Y, [j]: !0 })), I(null), E(null);
|
|
1434
|
+
}, le = () => {
|
|
1435
|
+
E(null), I(null);
|
|
1436
|
+
}, ce = (L, j = 0) => {
|
|
1437
|
+
var he;
|
|
1438
|
+
const Y = (((he = L.items) == null ? void 0 : he.length) ?? 0) > 0, V = l[L.id], K = y === L.id, J = k === L.id, X = (c == null ? void 0 : c.id) === L.id;
|
|
1439
|
+
let pe = !!b[L.id], ue = !1;
|
|
1440
|
+
if (i && Y) {
|
|
1441
|
+
const { total: W, checkedCount: ee } = bt(L, b);
|
|
1442
|
+
ee > 0 && ee < W ? ue = !0 : W > 0 && ee === W && (pe = !0);
|
|
1341
1443
|
}
|
|
1342
|
-
const fe = X &&
|
|
1343
|
-
return /* @__PURE__ */ g("div", { style: { opacity:
|
|
1444
|
+
const fe = X && c.pos !== "inside" ? { boxShadow: c.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, se = X && c.pos === "inside" || K ? e.primaryLt : "transparent";
|
|
1445
|
+
return /* @__PURE__ */ g("div", { style: { opacity: J ? 0.4 : 1 }, children: [
|
|
1344
1446
|
/* @__PURE__ */ g(
|
|
1345
1447
|
"div",
|
|
1346
1448
|
{
|
|
1347
|
-
draggable: !!
|
|
1348
|
-
onDragStart:
|
|
1349
|
-
onDragOver:
|
|
1350
|
-
onDrop:
|
|
1351
|
-
onDragEnd:
|
|
1352
|
-
title:
|
|
1449
|
+
draggable: !!u,
|
|
1450
|
+
onDragStart: u ? (W) => U(W, L.id) : void 0,
|
|
1451
|
+
onDragOver: u ? (W) => Q(W, L.id) : void 0,
|
|
1452
|
+
onDrop: u ? (W) => de(W, L.id) : void 0,
|
|
1453
|
+
onDragEnd: u ? le : void 0,
|
|
1454
|
+
title: x == null ? void 0 : x(L),
|
|
1353
1455
|
onClick: () => {
|
|
1354
|
-
o(
|
|
1456
|
+
o(L.id), s == null || s(L), Y && S(L.id);
|
|
1355
1457
|
},
|
|
1356
1458
|
onDoubleClick: () => {
|
|
1357
|
-
|
|
1459
|
+
p && (D(L.id), h(L.value || ""));
|
|
1358
1460
|
},
|
|
1359
1461
|
style: {
|
|
1360
1462
|
display: "flex",
|
|
1361
1463
|
alignItems: "center",
|
|
1362
1464
|
gap: 4,
|
|
1363
1465
|
padding: `5px 8px 5px ${12 + j * 18}px`,
|
|
1364
|
-
cursor:
|
|
1466
|
+
cursor: u ? "grab" : "pointer",
|
|
1365
1467
|
borderRadius: e.r,
|
|
1366
1468
|
margin: "1px 4px",
|
|
1367
|
-
background:
|
|
1469
|
+
background: se,
|
|
1368
1470
|
color: K ? e.primary : e.text,
|
|
1369
1471
|
userSelect: "none",
|
|
1370
1472
|
fontSize: 13,
|
|
@@ -1378,308 +1480,308 @@ function Bt({
|
|
|
1378
1480
|
{
|
|
1379
1481
|
style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
|
|
1380
1482
|
onClick: (W) => {
|
|
1381
|
-
W.stopPropagation(), Y &&
|
|
1483
|
+
W.stopPropagation(), Y && S(L.id);
|
|
1382
1484
|
},
|
|
1383
1485
|
children: Y ? V ? "▾" : "▸" : ""
|
|
1384
1486
|
}
|
|
1385
1487
|
),
|
|
1386
1488
|
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: Y ? V ? "📂" : "📁" : "📄" }),
|
|
1387
|
-
|
|
1489
|
+
i && /* @__PURE__ */ t(
|
|
1388
1490
|
"input",
|
|
1389
1491
|
{
|
|
1390
1492
|
ref: (W) => {
|
|
1391
|
-
W && (W.indeterminate =
|
|
1493
|
+
W && (W.indeterminate = ue);
|
|
1392
1494
|
},
|
|
1393
1495
|
type: "checkbox",
|
|
1394
|
-
checked:
|
|
1496
|
+
checked: pe,
|
|
1395
1497
|
onChange: (W) => {
|
|
1396
|
-
W.stopPropagation(), A(
|
|
1498
|
+
W.stopPropagation(), A(L.id, W.target.checked);
|
|
1397
1499
|
},
|
|
1398
1500
|
style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
|
|
1399
1501
|
onClick: (W) => W.stopPropagation()
|
|
1400
1502
|
}
|
|
1401
1503
|
),
|
|
1402
|
-
|
|
1504
|
+
M === L.id ? /* @__PURE__ */ t(
|
|
1403
1505
|
"input",
|
|
1404
1506
|
{
|
|
1405
1507
|
autoFocus: !0,
|
|
1406
1508
|
className: "dhx dhx-input",
|
|
1407
1509
|
style: { height: 24, fontSize: 12, flex: 1 },
|
|
1408
|
-
value:
|
|
1409
|
-
onChange: (W) =>
|
|
1510
|
+
value: T,
|
|
1511
|
+
onChange: (W) => h(W.target.value),
|
|
1410
1512
|
onBlur: F,
|
|
1411
1513
|
onKeyDown: (W) => {
|
|
1412
|
-
W.key === "Enter" && F(), W.key === "Escape" &&
|
|
1514
|
+
W.key === "Enter" && F(), W.key === "Escape" && D(null);
|
|
1413
1515
|
},
|
|
1414
1516
|
onClick: (W) => W.stopPropagation()
|
|
1415
1517
|
}
|
|
1416
|
-
) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
1417
|
-
|
|
1518
|
+
) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: L.value }),
|
|
1519
|
+
L.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
1418
1520
|
"(",
|
|
1419
|
-
|
|
1521
|
+
L.count,
|
|
1420
1522
|
")"
|
|
1421
1523
|
] })
|
|
1422
1524
|
]
|
|
1423
1525
|
}
|
|
1424
1526
|
),
|
|
1425
|
-
Y && V && /* @__PURE__ */ t("div", { children:
|
|
1426
|
-
] },
|
|
1527
|
+
Y && V && /* @__PURE__ */ t("div", { children: L.items.map((W) => ce(W, j + 1)) })
|
|
1528
|
+
] }, L.id);
|
|
1427
1529
|
};
|
|
1428
1530
|
return /* @__PURE__ */ t(
|
|
1429
1531
|
"div",
|
|
1430
1532
|
{
|
|
1431
1533
|
className: "dhx dhx-scroll",
|
|
1432
|
-
style: { overflowY: "auto", ...
|
|
1433
|
-
onDragOver:
|
|
1434
|
-
onDrop:
|
|
1435
|
-
|
|
1534
|
+
style: { overflowY: "auto", ...m },
|
|
1535
|
+
onDragOver: u ? (L) => L.preventDefault() : void 0,
|
|
1536
|
+
onDrop: u ? (L) => {
|
|
1537
|
+
L.preventDefault(), I(null), E(null);
|
|
1436
1538
|
} : void 0,
|
|
1437
|
-
children:
|
|
1539
|
+
children: z.map((L) => ce(L))
|
|
1438
1540
|
}
|
|
1439
1541
|
);
|
|
1440
1542
|
}
|
|
1441
|
-
function
|
|
1442
|
-
const [s,
|
|
1543
|
+
function jt({ total: n, pageSize: i = 10, page: p, onChange: u, style: x }) {
|
|
1544
|
+
const [s, f] = C(p || 1), a = Math.ceil(n / i);
|
|
1443
1545
|
H(O, []);
|
|
1444
|
-
const
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
},
|
|
1448
|
-
const
|
|
1449
|
-
for (let
|
|
1450
|
-
return
|
|
1451
|
-
}, [s,
|
|
1452
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...
|
|
1546
|
+
const m = (r) => {
|
|
1547
|
+
const l = Math.min(Math.max(1, r), a);
|
|
1548
|
+
f(l), u == null || u(l);
|
|
1549
|
+
}, z = oe(() => {
|
|
1550
|
+
const r = [];
|
|
1551
|
+
for (let d = Math.max(1, s - 2); d <= Math.min(a, s + 2); d++) r.push(d);
|
|
1552
|
+
return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < a && (r[r.length - 1] < a - 1 && r.push("..."), r.push(a)), r;
|
|
1553
|
+
}, [s, a]);
|
|
1554
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...x }, children: [
|
|
1453
1555
|
/* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
|
|
1454
|
-
(s - 1) *
|
|
1556
|
+
(s - 1) * i + 1,
|
|
1455
1557
|
"–",
|
|
1456
|
-
Math.min(s *
|
|
1558
|
+
Math.min(s * i, n),
|
|
1457
1559
|
" of ",
|
|
1458
|
-
|
|
1560
|
+
n
|
|
1459
1561
|
] }),
|
|
1460
|
-
[["«", 1], ["‹", s - 1]].map(([
|
|
1461
|
-
|
|
1462
|
-
[["›", s + 1], ["»",
|
|
1562
|
+
[["«", 1], ["‹", s - 1]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === 1, onClick: () => m(l), children: r }, r)),
|
|
1563
|
+
z.map((r, l) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && m(r), className: `dhx dhx-btn ${r === s ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, l)),
|
|
1564
|
+
[["›", s + 1], ["»", a]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === a, onClick: () => m(l), children: r }, r))
|
|
1463
1565
|
] });
|
|
1464
1566
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const [
|
|
1567
|
+
function Pt({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: u }) {
|
|
1568
|
+
const [x, s] = C(i), [f, a] = C({}), [m, z] = C(null);
|
|
1467
1569
|
H(O, []);
|
|
1468
|
-
const
|
|
1469
|
-
s((
|
|
1470
|
-
},
|
|
1570
|
+
const r = (o, b) => {
|
|
1571
|
+
s((v) => ({ ...v, [o]: b })), a((v) => ({ ...v, [o]: null }));
|
|
1572
|
+
}, l = () => {
|
|
1471
1573
|
const o = {};
|
|
1472
|
-
return (
|
|
1473
|
-
|
|
1474
|
-
}),
|
|
1475
|
-
},
|
|
1476
|
-
const
|
|
1574
|
+
return (n.rows || []).flat().forEach((b) => {
|
|
1575
|
+
b && typeof b == "object" && "name" in b && b.required && !x[b.name] && (o[b.name] = `${b.label || b.name} is required`);
|
|
1576
|
+
}), a(o), Object.keys(o).length === 0;
|
|
1577
|
+
}, d = (o) => {
|
|
1578
|
+
const b = x[o.name] ?? o.value ?? "", v = f[o.name], M = o.labelWidth ?? n.labelWidth, D = M !== void 0 || o.labelPosition === "left";
|
|
1477
1579
|
if (o.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
|
|
1478
1580
|
/* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
|
|
1479
|
-
(o.rows || []).map((
|
|
1581
|
+
(o.rows || []).map((S) => d(S))
|
|
1480
1582
|
] }, o.name);
|
|
1481
1583
|
if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
|
|
1482
|
-
const
|
|
1584
|
+
const T = M ? { minWidth: M, width: M, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, h = o.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...T }, children: [
|
|
1483
1585
|
o.label,
|
|
1484
1586
|
o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
|
|
1485
|
-
] }, "lbl") : null,
|
|
1587
|
+
] }, "lbl") : null, k = v ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: v }) : null, E = o.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
|
|
1486
1588
|
"ⓘ ",
|
|
1487
1589
|
o.helpMessage
|
|
1488
|
-
] }) : null,
|
|
1489
|
-
|
|
1590
|
+
] }) : null, c = { key: o.name, className: "dhx-form-group" }, I = (S) => D ? /* @__PURE__ */ g("div", { ...c, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1591
|
+
h,
|
|
1490
1592
|
/* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1491
|
-
|
|
1492
|
-
|
|
1593
|
+
S,
|
|
1594
|
+
k,
|
|
1493
1595
|
E
|
|
1494
1596
|
] })
|
|
1495
|
-
] }) : /* @__PURE__ */ g("div", { ...
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1597
|
+
] }) : /* @__PURE__ */ g("div", { ...c, children: [
|
|
1598
|
+
h,
|
|
1599
|
+
S,
|
|
1600
|
+
k,
|
|
1499
1601
|
E
|
|
1500
1602
|
] });
|
|
1501
|
-
if (!o.type || o.type === "input") return
|
|
1603
|
+
if (!o.type || o.type === "input") return I(
|
|
1502
1604
|
/* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
|
|
1503
1605
|
o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
|
|
1504
1606
|
/* @__PURE__ */ t(
|
|
1505
1607
|
"input",
|
|
1506
1608
|
{
|
|
1507
1609
|
className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
|
|
1508
|
-
style: { borderColor:
|
|
1610
|
+
style: { borderColor: v ? e.danger : void 0 },
|
|
1509
1611
|
type: o.inputType || "text",
|
|
1510
1612
|
placeholder: o.placeholder,
|
|
1511
|
-
value:
|
|
1512
|
-
onChange: (
|
|
1613
|
+
value: b,
|
|
1614
|
+
onChange: (S) => r(o.name, S.target.value),
|
|
1513
1615
|
disabled: o.disabled
|
|
1514
1616
|
}
|
|
1515
1617
|
)
|
|
1516
1618
|
] })
|
|
1517
1619
|
);
|
|
1518
|
-
if (o.type === "textarea") return
|
|
1620
|
+
if (o.type === "textarea") return I(
|
|
1519
1621
|
/* @__PURE__ */ t(
|
|
1520
1622
|
"textarea",
|
|
1521
1623
|
{
|
|
1522
1624
|
className: "dhx dhx-input",
|
|
1523
1625
|
style: { height: 80, resize: "vertical", padding: "8px 10px" },
|
|
1524
1626
|
placeholder: o.placeholder,
|
|
1525
|
-
value:
|
|
1526
|
-
onChange: (
|
|
1627
|
+
value: b,
|
|
1628
|
+
onChange: (S) => r(o.name, S.target.value)
|
|
1527
1629
|
}
|
|
1528
1630
|
)
|
|
1529
1631
|
);
|
|
1530
|
-
if (o.type === "select") return
|
|
1531
|
-
/* @__PURE__ */ g("select", { className: "dhx dhx-input", value:
|
|
1632
|
+
if (o.type === "select") return I(
|
|
1633
|
+
/* @__PURE__ */ g("select", { className: "dhx dhx-input", value: b, onChange: (S) => r(o.name, S.target.value), style: { cursor: "pointer" }, children: [
|
|
1532
1634
|
/* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
|
|
1533
|
-
(o.options || []).map((
|
|
1635
|
+
(o.options || []).map((S) => /* @__PURE__ */ t("option", { value: S.value, children: S.label || S.value }, S.value))
|
|
1534
1636
|
] })
|
|
1535
1637
|
);
|
|
1536
|
-
if (o.type === "datepicker") return
|
|
1537
|
-
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value:
|
|
1638
|
+
if (o.type === "datepicker") return I(
|
|
1639
|
+
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: b, onChange: (S) => r(o.name, S.target.value) })
|
|
1538
1640
|
);
|
|
1539
1641
|
if (o.type === "timepicker") {
|
|
1540
|
-
const
|
|
1642
|
+
const S = x[o.name] ?? { h: 12, m: 0, ampm: "AM" }, A = !!x[o.name], F = A ? `${String(S.h).padStart(2, "0")}:${String(S.m).padStart(2, "0")}${S.ampm ? " " + S.ampm : ""}` : o.placeholder || "Click to select", U = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
1541
1643
|
/* @__PURE__ */ g(
|
|
1542
1644
|
"div",
|
|
1543
1645
|
{
|
|
1544
1646
|
className: "dhx dhx-input",
|
|
1545
1647
|
style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
1546
|
-
onClick: () =>
|
|
1648
|
+
onClick: () => z(m === o.name ? null : o.name),
|
|
1547
1649
|
children: [
|
|
1548
1650
|
/* @__PURE__ */ t("span", { style: { color: A ? e.text : e.textMut }, children: F }),
|
|
1549
1651
|
/* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
|
|
1550
1652
|
]
|
|
1551
1653
|
}
|
|
1552
1654
|
),
|
|
1553
|
-
|
|
1554
|
-
|
|
1655
|
+
m === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(ht, { value: S, controls: !0, onChange: (Q) => {
|
|
1656
|
+
r(o.name, Q), z(null);
|
|
1555
1657
|
} }) })
|
|
1556
1658
|
] });
|
|
1557
|
-
return
|
|
1659
|
+
return I(U);
|
|
1558
1660
|
}
|
|
1559
|
-
if (o.type === "colorpicker") return
|
|
1661
|
+
if (o.type === "colorpicker") return I(
|
|
1560
1662
|
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1561
1663
|
/* @__PURE__ */ t(
|
|
1562
1664
|
"input",
|
|
1563
1665
|
{
|
|
1564
1666
|
type: "color",
|
|
1565
|
-
value:
|
|
1566
|
-
onChange: (
|
|
1667
|
+
value: b || "#000000",
|
|
1668
|
+
onChange: (S) => r(o.name, S.target.value),
|
|
1567
1669
|
style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
|
|
1568
1670
|
}
|
|
1569
1671
|
),
|
|
1570
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children:
|
|
1672
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: b || "#000000" })
|
|
1571
1673
|
] })
|
|
1572
1674
|
);
|
|
1573
|
-
if (o.type === "text") return
|
|
1675
|
+
if (o.type === "text") return I(
|
|
1574
1676
|
/* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
|
|
1575
1677
|
);
|
|
1576
|
-
if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...
|
|
1577
|
-
|
|
1578
|
-
|
|
1678
|
+
if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...c, children: [
|
|
1679
|
+
D ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1680
|
+
M && /* @__PURE__ */ t("div", { style: { width: M, flexShrink: 0 } }),
|
|
1579
1681
|
/* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1580
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
1682
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (S) => r(o.name, S.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
1581
1683
|
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
|
|
1582
1684
|
] })
|
|
1583
1685
|
] }) : /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1584
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
1686
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (S) => r(o.name, S.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
1585
1687
|
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
|
|
1586
1688
|
] }),
|
|
1587
1689
|
E
|
|
1588
1690
|
] });
|
|
1589
1691
|
if (o.type === "radio") {
|
|
1590
|
-
const
|
|
1692
|
+
const S = (o.options || []).map((A) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
|
|
1591
1693
|
/* @__PURE__ */ t(
|
|
1592
1694
|
"input",
|
|
1593
1695
|
{
|
|
1594
1696
|
type: "radio",
|
|
1595
1697
|
name: o.name,
|
|
1596
1698
|
value: A.value,
|
|
1597
|
-
checked:
|
|
1598
|
-
onChange: () =>
|
|
1699
|
+
checked: b === A.value,
|
|
1700
|
+
onChange: () => r(o.name, A.value),
|
|
1599
1701
|
style: { accentColor: e.primary, cursor: "pointer" }
|
|
1600
1702
|
}
|
|
1601
1703
|
),
|
|
1602
1704
|
A.label || A.value
|
|
1603
1705
|
] }, A.value));
|
|
1604
|
-
return
|
|
1605
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children:
|
|
1706
|
+
return I(
|
|
1707
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: S })
|
|
1606
1708
|
);
|
|
1607
1709
|
}
|
|
1608
|
-
if (o.type === "slider") return
|
|
1609
|
-
|
|
1710
|
+
if (o.type === "slider") return D ? /* @__PURE__ */ g("div", { ...c, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1711
|
+
h,
|
|
1610
1712
|
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
1611
1713
|
/* @__PURE__ */ t(
|
|
1612
|
-
|
|
1714
|
+
De,
|
|
1613
1715
|
{
|
|
1614
1716
|
min: o.min,
|
|
1615
1717
|
max: o.max,
|
|
1616
1718
|
step: o.step,
|
|
1617
|
-
value:
|
|
1719
|
+
value: b || o.min,
|
|
1618
1720
|
range: o.range,
|
|
1619
|
-
onChange: (
|
|
1721
|
+
onChange: (S) => r(o.name, S)
|
|
1620
1722
|
}
|
|
1621
1723
|
),
|
|
1622
1724
|
E
|
|
1623
1725
|
] })
|
|
1624
|
-
] }) : /* @__PURE__ */ g("div", { ...
|
|
1726
|
+
] }) : /* @__PURE__ */ g("div", { ...c, children: [
|
|
1625
1727
|
/* @__PURE__ */ t(
|
|
1626
|
-
|
|
1728
|
+
De,
|
|
1627
1729
|
{
|
|
1628
1730
|
label: o.label,
|
|
1629
1731
|
min: o.min,
|
|
1630
1732
|
max: o.max,
|
|
1631
1733
|
step: o.step,
|
|
1632
|
-
value:
|
|
1734
|
+
value: b || o.min,
|
|
1633
1735
|
range: o.range,
|
|
1634
|
-
onChange: (
|
|
1736
|
+
onChange: (S) => r(o.name, S)
|
|
1635
1737
|
}
|
|
1636
1738
|
),
|
|
1637
1739
|
E
|
|
1638
1740
|
] });
|
|
1639
|
-
if (o.type === "combo") return
|
|
1640
|
-
|
|
1741
|
+
if (o.type === "combo") return D ? /* @__PURE__ */ g("div", { ...c, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1742
|
+
h,
|
|
1641
1743
|
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
1642
1744
|
/* @__PURE__ */ t(
|
|
1643
|
-
|
|
1745
|
+
$e,
|
|
1644
1746
|
{
|
|
1645
1747
|
data: o.data || [],
|
|
1646
1748
|
multiselection: o.multiselection,
|
|
1647
1749
|
placeholder: o.placeholder || "Select...",
|
|
1648
|
-
value:
|
|
1649
|
-
onChange: (
|
|
1750
|
+
value: b || (o.multiselection ? [] : null),
|
|
1751
|
+
onChange: (S) => r(o.name, S)
|
|
1650
1752
|
}
|
|
1651
1753
|
),
|
|
1652
|
-
|
|
1754
|
+
k,
|
|
1653
1755
|
E
|
|
1654
1756
|
] })
|
|
1655
|
-
] }) : /* @__PURE__ */ g("div", { ...
|
|
1757
|
+
] }) : /* @__PURE__ */ g("div", { ...c, children: [
|
|
1656
1758
|
/* @__PURE__ */ t(
|
|
1657
|
-
|
|
1759
|
+
$e,
|
|
1658
1760
|
{
|
|
1659
1761
|
label: o.label,
|
|
1660
1762
|
data: o.data || [],
|
|
1661
1763
|
multiselection: o.multiselection,
|
|
1662
1764
|
placeholder: o.placeholder || "Select...",
|
|
1663
|
-
value:
|
|
1664
|
-
onChange: (
|
|
1765
|
+
value: b || (o.multiselection ? [] : null),
|
|
1766
|
+
onChange: (S) => r(o.name, S)
|
|
1665
1767
|
}
|
|
1666
1768
|
),
|
|
1667
|
-
|
|
1769
|
+
k,
|
|
1668
1770
|
E
|
|
1669
1771
|
] });
|
|
1670
1772
|
if (o.type === "toggle") {
|
|
1671
|
-
const
|
|
1672
|
-
return /* @__PURE__ */ g("div", { ...
|
|
1673
|
-
|
|
1674
|
-
/* @__PURE__ */ t("div", { style: { width:
|
|
1773
|
+
const S = !!b, A = S ? o.icon : o.offIcon || o.icon, F = S ? o.text || o.label : o.offText || o.text || o.label;
|
|
1774
|
+
return /* @__PURE__ */ g("div", { ...c, children: [
|
|
1775
|
+
D && M && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1776
|
+
/* @__PURE__ */ t("div", { style: { width: M, flexShrink: 0 } }),
|
|
1675
1777
|
/* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1676
|
-
/* @__PURE__ */ t(
|
|
1778
|
+
/* @__PURE__ */ t(Le, { on: S, onClick: () => r(o.name, !b) }),
|
|
1677
1779
|
A && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: A }),
|
|
1678
1780
|
F && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: F })
|
|
1679
1781
|
] })
|
|
1680
1782
|
] }),
|
|
1681
|
-
!
|
|
1682
|
-
/* @__PURE__ */ t(
|
|
1783
|
+
!D && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
|
|
1784
|
+
/* @__PURE__ */ t(Le, { on: S, onClick: () => r(o.name, !b) }),
|
|
1683
1785
|
A && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: A }),
|
|
1684
1786
|
F && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: F })
|
|
1685
1787
|
] }),
|
|
@@ -1688,97 +1790,188 @@ function jt({ config: r = {}, defaultValues: l = {}, onSubmit: d, style: i }) {
|
|
|
1688
1790
|
}
|
|
1689
1791
|
return null;
|
|
1690
1792
|
}, y = (o) => o.map(
|
|
1691
|
-
(
|
|
1793
|
+
(b, v) => Array.isArray(b) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: b.map(d) }, v) : d(b)
|
|
1692
1794
|
);
|
|
1693
|
-
return /* @__PURE__ */ g("div", { className: "dhx", style: { padding:
|
|
1694
|
-
y(
|
|
1695
|
-
(
|
|
1696
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () =>
|
|
1697
|
-
|
|
1698
|
-
s(
|
|
1699
|
-
}, children:
|
|
1795
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...u }, children: [
|
|
1796
|
+
y(n.rows || []),
|
|
1797
|
+
(n.buttons || p) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
|
|
1798
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => l() && (p == null ? void 0 : p(x)), children: n.submitText || "Submit" }),
|
|
1799
|
+
n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
|
|
1800
|
+
s(i), a({});
|
|
1801
|
+
}, children: n.resetText || "Reset" })
|
|
1700
1802
|
] })
|
|
1701
1803
|
] });
|
|
1702
1804
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick:
|
|
1705
|
-
/* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background:
|
|
1706
|
-
/* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left:
|
|
1805
|
+
function Le({ on: n, onClick: i }) {
|
|
1806
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: i, children: [
|
|
1807
|
+
/* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
|
|
1808
|
+
/* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left: n ? 21 : 3, width: 16, height: 16, borderRadius: "50%", background: "#fff", transition: "left 0.2s", boxShadow: "0 1px 3px rgba(0,0,0,.3)" } })
|
|
1707
1809
|
] });
|
|
1708
1810
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const
|
|
1711
|
-
for (const
|
|
1712
|
-
|
|
1713
|
-
return
|
|
1811
|
+
function ke(n) {
|
|
1812
|
+
const i = [];
|
|
1813
|
+
for (const p of n)
|
|
1814
|
+
p.type === "block" ? i.push(...ke(p.items || [])) : i.push(p);
|
|
1815
|
+
return i;
|
|
1714
1816
|
}
|
|
1715
|
-
function
|
|
1817
|
+
function Ot({ items: n = [], onAction: i, style: p }) {
|
|
1716
1818
|
H(O, []);
|
|
1717
|
-
const [
|
|
1718
|
-
const
|
|
1719
|
-
for (const
|
|
1720
|
-
|
|
1721
|
-
return
|
|
1722
|
-
}), s = (n) => {
|
|
1723
|
-
var
|
|
1724
|
-
if (
|
|
1725
|
-
if (
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
var z, h;
|
|
1736
|
-
if ("type" in n && (n.type === "separator" || n.type === "sep"))
|
|
1737
|
-
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, x);
|
|
1738
|
-
if ("type" in n && n.type === "input") {
|
|
1739
|
-
const y = n;
|
|
1740
|
-
return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
|
|
1741
|
-
y.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: y.label }),
|
|
1742
|
-
/* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: y.width || 110, height: 26, fontSize: 12 }, placeholder: y.placeholder, defaultValue: y.value, onChange: (o) => {
|
|
1743
|
-
var k;
|
|
1744
|
-
return (k = y.onChange) == null ? void 0 : k.call(y, o.target.value);
|
|
1745
|
-
} })
|
|
1746
|
-
] }, x);
|
|
1747
|
-
}
|
|
1748
|
-
if ("type" in n && n.type === "block") {
|
|
1749
|
-
const y = n;
|
|
1750
|
-
return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: y.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
|
|
1751
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (z = y.items) == null ? void 0 : z.map((o, k) => u(o, k)) }),
|
|
1752
|
-
y.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: y.label })
|
|
1753
|
-
] }, x);
|
|
1754
|
-
}
|
|
1755
|
-
if ("type" in n && n.type === "selectButton") {
|
|
1756
|
-
const y = n;
|
|
1757
|
-
return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: y.value, onChange: (o) => {
|
|
1758
|
-
var k;
|
|
1759
|
-
return (k = y.onChange) == null ? void 0 : k.call(y, o.target.value);
|
|
1760
|
-
}, children: (h = y.items) == null ? void 0 : h.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.value }, o.value)) }, x);
|
|
1819
|
+
const [u, x] = C(() => {
|
|
1820
|
+
const l = {};
|
|
1821
|
+
for (const d of ke(n))
|
|
1822
|
+
d.id && (l[d.id] = !!d.active);
|
|
1823
|
+
return l;
|
|
1824
|
+
}), s = ke(n), f = (l) => {
|
|
1825
|
+
var d;
|
|
1826
|
+
if (!l.disabled) {
|
|
1827
|
+
if (l.id)
|
|
1828
|
+
if (l.group) {
|
|
1829
|
+
const y = s.filter((o) => o.group === l.group && o.id);
|
|
1830
|
+
x((o) => {
|
|
1831
|
+
const b = { ...o };
|
|
1832
|
+
for (const v of y) b[v.id] = !1;
|
|
1833
|
+
return b[l.id] = !0, b;
|
|
1834
|
+
});
|
|
1835
|
+
} else l.twoState && x((y) => ({ ...y, [l.id]: !y[l.id] }));
|
|
1836
|
+
(d = l.onClick) == null || d.call(l, l), l.id && (i == null || i(l.id, l));
|
|
1761
1837
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1838
|
+
}, a = (l, d) => {
|
|
1839
|
+
var v;
|
|
1840
|
+
if (l.hidden) return null;
|
|
1841
|
+
const y = l.value ?? l.text, o = l.size === "auto", b = l.id !== void 0 ? u[l.id] ?? !!l.active : !!l.active;
|
|
1842
|
+
return l.type === "separator" || l.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, d) : l.type === "input" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
|
|
1843
|
+
l.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: l.label }),
|
|
1844
|
+
/* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
1845
|
+
l.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: l.icon }),
|
|
1846
|
+
/* @__PURE__ */ t(
|
|
1847
|
+
"input",
|
|
1848
|
+
{
|
|
1849
|
+
className: "dhx dhx-input",
|
|
1850
|
+
style: { width: l.width || 110, height: 26, fontSize: 12, paddingLeft: l.icon ? 24 : void 0 },
|
|
1851
|
+
placeholder: l.placeholder,
|
|
1852
|
+
defaultValue: l.value,
|
|
1853
|
+
onChange: (M) => {
|
|
1854
|
+
var D;
|
|
1855
|
+
return (D = l.onChange) == null ? void 0 : D.call(l, M.target.value);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
)
|
|
1859
|
+
] })
|
|
1860
|
+
] }, d) : l.type === "selectButton" ? /* @__PURE__ */ t(
|
|
1861
|
+
"select",
|
|
1862
|
+
{
|
|
1863
|
+
className: "dhx dhx-input",
|
|
1864
|
+
style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: l.width },
|
|
1865
|
+
defaultValue: l.value,
|
|
1866
|
+
onChange: (M) => {
|
|
1867
|
+
var D;
|
|
1868
|
+
return (D = l.onChange) == null ? void 0 : D.call(l, M.target.value);
|
|
1869
|
+
},
|
|
1870
|
+
children: (v = l.items) == null ? void 0 : v.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.value }, M.value))
|
|
1871
|
+
},
|
|
1872
|
+
d
|
|
1873
|
+
) : /* @__PURE__ */ g(
|
|
1764
1874
|
"button",
|
|
1765
1875
|
{
|
|
1766
|
-
title:
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1876
|
+
title: l.tooltip,
|
|
1877
|
+
disabled: l.disabled,
|
|
1878
|
+
className: "dhx dhx-btn dhx-btn-ghost",
|
|
1879
|
+
style: {
|
|
1880
|
+
flexDirection: o ? "column" : "row",
|
|
1881
|
+
alignSelf: o ? "stretch" : "center",
|
|
1882
|
+
justifyContent: "center",
|
|
1883
|
+
minHeight: o ? 48 : 26,
|
|
1884
|
+
padding: o ? "6px 10px" : "0 8px",
|
|
1885
|
+
gap: o ? 4 : 5,
|
|
1886
|
+
position: "relative",
|
|
1887
|
+
background: b ? e.primaryLt : "transparent",
|
|
1888
|
+
color: b ? e.primary : l.disabled ? e.textMut : e.text,
|
|
1889
|
+
opacity: l.disabled ? 0.55 : 1,
|
|
1890
|
+
cursor: l.disabled ? "not-allowed" : "pointer"
|
|
1891
|
+
},
|
|
1892
|
+
onClick: () => f(l),
|
|
1771
1893
|
children: [
|
|
1772
|
-
|
|
1773
|
-
|
|
1894
|
+
l.icon && /* @__PURE__ */ t("span", { style: { fontSize: o ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: l.icon }),
|
|
1895
|
+
y && /* @__PURE__ */ t("span", { style: {
|
|
1896
|
+
fontSize: 10,
|
|
1897
|
+
maxWidth: o ? 64 : void 0,
|
|
1898
|
+
textAlign: o ? "center" : "left",
|
|
1899
|
+
lineHeight: 1.2,
|
|
1900
|
+
whiteSpace: o ? "normal" : "nowrap"
|
|
1901
|
+
}, children: y }),
|
|
1902
|
+
l.count !== void 0 && /* @__PURE__ */ t("span", { style: {
|
|
1903
|
+
position: "absolute",
|
|
1904
|
+
top: 2,
|
|
1905
|
+
right: 2,
|
|
1906
|
+
minWidth: 14,
|
|
1907
|
+
height: 14,
|
|
1908
|
+
background: e.danger,
|
|
1909
|
+
color: "#fff",
|
|
1910
|
+
borderRadius: 7,
|
|
1911
|
+
fontSize: 9,
|
|
1912
|
+
fontWeight: 700,
|
|
1913
|
+
display: "flex",
|
|
1914
|
+
alignItems: "center",
|
|
1915
|
+
justifyContent: "center",
|
|
1916
|
+
padding: "0 2px",
|
|
1917
|
+
pointerEvents: "none"
|
|
1918
|
+
}, children: l.count })
|
|
1774
1919
|
]
|
|
1775
1920
|
},
|
|
1776
|
-
|
|
1921
|
+
d
|
|
1777
1922
|
);
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1923
|
+
}, m = (l, d) => {
|
|
1924
|
+
var y;
|
|
1925
|
+
return /* @__PURE__ */ t("div", { style: {
|
|
1926
|
+
display: "flex",
|
|
1927
|
+
flexDirection: l.direction === "col" ? "column" : "row",
|
|
1928
|
+
alignItems: l.direction === "col" ? "flex-start" : "center",
|
|
1929
|
+
gap: 2
|
|
1930
|
+
}, children: (y = l.items) == null ? void 0 : y.map(
|
|
1931
|
+
(o, b) => o.type === "block" ? m(o, `${d}-${b}`) : a(o, `${d}-${b}`)
|
|
1932
|
+
) }, d);
|
|
1933
|
+
}, z = (l, d) => {
|
|
1934
|
+
var o;
|
|
1935
|
+
const y = l.title || l.label;
|
|
1936
|
+
return /* @__PURE__ */ g("div", { style: {
|
|
1937
|
+
display: "flex",
|
|
1938
|
+
flexDirection: "column",
|
|
1939
|
+
alignItems: "stretch",
|
|
1940
|
+
borderRight: `1px solid ${e.border}`,
|
|
1941
|
+
padding: "4px 6px 0",
|
|
1942
|
+
minWidth: 40
|
|
1943
|
+
}, children: [
|
|
1944
|
+
/* @__PURE__ */ t("div", { style: {
|
|
1945
|
+
display: "flex",
|
|
1946
|
+
flexDirection: l.direction === "col" ? "column" : "row",
|
|
1947
|
+
alignItems: l.direction === "col" ? "stretch" : "center",
|
|
1948
|
+
gap: 2,
|
|
1949
|
+
flex: 1
|
|
1950
|
+
}, children: (o = l.items) == null ? void 0 : o.map(
|
|
1951
|
+
(b, v) => b.type === "block" ? m(b, v) : a(b, v)
|
|
1952
|
+
) }),
|
|
1953
|
+
y && /* @__PURE__ */ t("div", { style: {
|
|
1954
|
+
fontSize: 10,
|
|
1955
|
+
color: e.textMut,
|
|
1956
|
+
textAlign: "center",
|
|
1957
|
+
padding: "3px 0 4px",
|
|
1958
|
+
marginTop: 2,
|
|
1959
|
+
borderTop: `1px solid ${e.border}`
|
|
1960
|
+
}, children: y })
|
|
1961
|
+
] }, d);
|
|
1962
|
+
}, r = (l, d) => l.type === "block" ? z(l, d) : a(l, d);
|
|
1963
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: {
|
|
1964
|
+
display: "flex",
|
|
1965
|
+
alignItems: "stretch",
|
|
1966
|
+
background: e.surface,
|
|
1967
|
+
borderBottom: `1px solid ${e.border}`,
|
|
1968
|
+
overflowX: "auto",
|
|
1969
|
+
gap: 0,
|
|
1970
|
+
minHeight: 72,
|
|
1971
|
+
...p
|
|
1972
|
+
}, children: n.map(r) });
|
|
1780
1973
|
}
|
|
1781
|
-
function Te({ count:
|
|
1974
|
+
function Te({ count: n }) {
|
|
1782
1975
|
return /* @__PURE__ */ t("span", { style: {
|
|
1783
1976
|
position: "absolute",
|
|
1784
1977
|
top: 3,
|
|
@@ -1796,55 +1989,55 @@ function Te({ count: r }) {
|
|
|
1796
1989
|
padding: "0 3px",
|
|
1797
1990
|
lineHeight: 1,
|
|
1798
1991
|
pointerEvents: "none"
|
|
1799
|
-
}, children:
|
|
1992
|
+
}, children: n });
|
|
1800
1993
|
}
|
|
1801
|
-
function
|
|
1802
|
-
const [s,
|
|
1803
|
-
const
|
|
1804
|
-
return
|
|
1805
|
-
y.id && y.twoState && y.active && (
|
|
1806
|
-
}),
|
|
1807
|
-
}),
|
|
1808
|
-
H(O, []),
|
|
1809
|
-
const
|
|
1810
|
-
var o,
|
|
1811
|
-
if (!
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1994
|
+
function Yt({ logo: n, items: i = [], vertical: p = !1, onAction: u, style: x }) {
|
|
1995
|
+
const [s, f] = C(null), [a, m] = C(() => {
|
|
1996
|
+
const d = {};
|
|
1997
|
+
return i.forEach((y) => {
|
|
1998
|
+
y.id && y.twoState && y.active && (d[y.id] = !0);
|
|
1999
|
+
}), d;
|
|
2000
|
+
}), z = q(null);
|
|
2001
|
+
H(O, []), ie(z, G(() => f(null), []));
|
|
2002
|
+
const r = (d, y) => {
|
|
2003
|
+
var o, b;
|
|
2004
|
+
if (!d.disabled) {
|
|
2005
|
+
if (d.twoState && d.id && m((v) => ({ ...v, [d.id]: !v[d.id] })), (o = d.items) != null && o.length) {
|
|
2006
|
+
f((v) => v === y ? null : y);
|
|
1814
2007
|
return;
|
|
1815
2008
|
}
|
|
1816
|
-
(
|
|
2009
|
+
(b = d.onClick) == null || b.call(d, d.id || ""), u == null || u(d.id || "");
|
|
1817
2010
|
}
|
|
1818
|
-
},
|
|
1819
|
-
var
|
|
1820
|
-
if (
|
|
1821
|
-
if (
|
|
1822
|
-
[
|
|
2011
|
+
}, l = (d, y) => {
|
|
2012
|
+
var M;
|
|
2013
|
+
if (d.hidden) return null;
|
|
2014
|
+
if (d.type === "separator") return /* @__PURE__ */ t("div", { style: {
|
|
2015
|
+
[p ? "height" : "width"]: 1,
|
|
1823
2016
|
background: e.border,
|
|
1824
|
-
margin:
|
|
2017
|
+
margin: p ? "4px 8px" : "0 6px",
|
|
1825
2018
|
alignSelf: "stretch"
|
|
1826
2019
|
} }, y);
|
|
1827
|
-
if (
|
|
1828
|
-
if (
|
|
1829
|
-
|
|
2020
|
+
if (d.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, y);
|
|
2021
|
+
if (d.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
|
|
2022
|
+
d.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: d.icon }),
|
|
1830
2023
|
/* @__PURE__ */ t(
|
|
1831
2024
|
"input",
|
|
1832
2025
|
{
|
|
1833
2026
|
className: "dhx dhx-input",
|
|
1834
|
-
style: { width:
|
|
1835
|
-
placeholder:
|
|
1836
|
-
onChange: (
|
|
1837
|
-
var
|
|
1838
|
-
return (
|
|
2027
|
+
style: { width: d.width || 200, height: 28, paddingLeft: d.icon ? 30 : void 0 },
|
|
2028
|
+
placeholder: d.placeholder,
|
|
2029
|
+
onChange: (D) => {
|
|
2030
|
+
var T;
|
|
2031
|
+
return (T = d.onChange) == null ? void 0 : T.call(d, D.target.value);
|
|
1839
2032
|
}
|
|
1840
2033
|
}
|
|
1841
2034
|
)
|
|
1842
2035
|
] }, y);
|
|
1843
|
-
if (
|
|
2036
|
+
if (d.type === "imageButton") return /* @__PURE__ */ g(
|
|
1844
2037
|
"button",
|
|
1845
2038
|
{
|
|
1846
|
-
title:
|
|
1847
|
-
disabled:
|
|
2039
|
+
title: d.tooltip,
|
|
2040
|
+
disabled: d.disabled,
|
|
1848
2041
|
style: {
|
|
1849
2042
|
position: "relative",
|
|
1850
2043
|
width: 36,
|
|
@@ -1853,27 +2046,27 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
|
|
|
1853
2046
|
border: "none",
|
|
1854
2047
|
borderRadius: "50%",
|
|
1855
2048
|
overflow: "hidden",
|
|
1856
|
-
cursor:
|
|
2049
|
+
cursor: d.disabled ? "not-allowed" : "pointer",
|
|
1857
2050
|
background: "transparent",
|
|
1858
2051
|
flexShrink: 0
|
|
1859
2052
|
},
|
|
1860
|
-
onClick: () =>
|
|
2053
|
+
onClick: () => r(d, y),
|
|
1861
2054
|
children: [
|
|
1862
|
-
|
|
1863
|
-
|
|
2055
|
+
d.src && /* @__PURE__ */ t("img", { src: d.src, alt: d.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
|
|
2056
|
+
d.count !== void 0 && /* @__PURE__ */ t(Te, { count: d.count })
|
|
1864
2057
|
]
|
|
1865
2058
|
},
|
|
1866
2059
|
y
|
|
1867
2060
|
);
|
|
1868
|
-
const o = !!(
|
|
2061
|
+
const o = !!(d.twoState && d.id && a[d.id]), b = !!((M = d.items) != null && M.length), v = {
|
|
1869
2062
|
position: "relative",
|
|
1870
|
-
height:
|
|
2063
|
+
height: p ? 40 : 36,
|
|
1871
2064
|
gap: 6,
|
|
1872
2065
|
background: o ? e.primaryLt : "transparent",
|
|
1873
|
-
color: o ? e.primary :
|
|
1874
|
-
opacity:
|
|
1875
|
-
cursor:
|
|
1876
|
-
...
|
|
2066
|
+
color: o ? e.primary : d.disabled ? e.textMut : e.text,
|
|
2067
|
+
opacity: d.disabled ? 0.55 : 1,
|
|
2068
|
+
cursor: d.disabled ? "not-allowed" : "pointer",
|
|
2069
|
+
...p ? {
|
|
1877
2070
|
width: "100%",
|
|
1878
2071
|
justifyContent: "flex-start",
|
|
1879
2072
|
padding: "0 16px",
|
|
@@ -1885,24 +2078,24 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
|
|
|
1885
2078
|
"button",
|
|
1886
2079
|
{
|
|
1887
2080
|
className: "dhx dhx-btn dhx-btn-ghost",
|
|
1888
|
-
title:
|
|
1889
|
-
disabled:
|
|
1890
|
-
style:
|
|
1891
|
-
onClick: () =>
|
|
2081
|
+
title: d.tooltip,
|
|
2082
|
+
disabled: d.disabled,
|
|
2083
|
+
style: v,
|
|
2084
|
+
onClick: () => r(d, y),
|
|
1892
2085
|
children: [
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
2086
|
+
d.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: d.icon }),
|
|
2087
|
+
d.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: d.value }),
|
|
2088
|
+
b && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
|
|
2089
|
+
d.count !== void 0 && /* @__PURE__ */ t(Te, { count: d.count })
|
|
1897
2090
|
]
|
|
1898
2091
|
}
|
|
1899
2092
|
),
|
|
1900
|
-
|
|
1901
|
-
|
|
2093
|
+
b && s === y && /* @__PURE__ */ t(
|
|
2094
|
+
ae,
|
|
1902
2095
|
{
|
|
1903
|
-
items:
|
|
1904
|
-
onSelect: () =>
|
|
1905
|
-
style:
|
|
2096
|
+
items: d.items,
|
|
2097
|
+
onSelect: () => f(null),
|
|
2098
|
+
style: p ? { left: "100%", top: 0 } : { top: "100%" }
|
|
1906
2099
|
}
|
|
1907
2100
|
)
|
|
1908
2101
|
] }, y);
|
|
@@ -1910,67 +2103,67 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
|
|
|
1910
2103
|
return /* @__PURE__ */ g(
|
|
1911
2104
|
"nav",
|
|
1912
2105
|
{
|
|
1913
|
-
ref:
|
|
2106
|
+
ref: z,
|
|
1914
2107
|
className: "dhx",
|
|
1915
2108
|
style: {
|
|
1916
2109
|
display: "flex",
|
|
1917
|
-
flexDirection:
|
|
1918
|
-
alignItems:
|
|
2110
|
+
flexDirection: p ? "column" : "row",
|
|
2111
|
+
alignItems: p ? "stretch" : "center",
|
|
1919
2112
|
background: e.surface,
|
|
1920
|
-
borderBottom:
|
|
1921
|
-
borderRight:
|
|
1922
|
-
padding:
|
|
1923
|
-
minHeight:
|
|
2113
|
+
borderBottom: p ? "none" : `1px solid ${e.border}`,
|
|
2114
|
+
borderRight: p ? `1px solid ${e.border}` : "none",
|
|
2115
|
+
padding: p ? "8px 0" : "0 12px",
|
|
2116
|
+
minHeight: p ? void 0 : 48,
|
|
1924
2117
|
gap: 2,
|
|
1925
|
-
...
|
|
2118
|
+
...x
|
|
1926
2119
|
},
|
|
1927
2120
|
children: [
|
|
1928
|
-
|
|
2121
|
+
n && /* @__PURE__ */ t("div", { style: {
|
|
1929
2122
|
color: e.text,
|
|
1930
2123
|
fontWeight: 800,
|
|
1931
2124
|
fontSize: 16,
|
|
1932
|
-
padding:
|
|
1933
|
-
borderBottom:
|
|
1934
|
-
borderRight:
|
|
1935
|
-
marginRight:
|
|
1936
|
-
marginBottom:
|
|
2125
|
+
padding: p ? "8px 16px 12px" : "0 12px 0 4px",
|
|
2126
|
+
borderBottom: p ? `1px solid ${e.border}` : "none",
|
|
2127
|
+
borderRight: p ? "none" : `1px solid ${e.border}`,
|
|
2128
|
+
marginRight: p ? 0 : 8,
|
|
2129
|
+
marginBottom: p ? 4 : 0,
|
|
1937
2130
|
flexShrink: 0
|
|
1938
|
-
}, children:
|
|
1939
|
-
|
|
2131
|
+
}, children: n }),
|
|
2132
|
+
i.map(l)
|
|
1940
2133
|
]
|
|
1941
2134
|
}
|
|
1942
2135
|
);
|
|
1943
2136
|
}
|
|
1944
2137
|
export {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
2138
|
+
St as Button,
|
|
2139
|
+
Lt as Calendar,
|
|
2140
|
+
Ct as Chart,
|
|
2141
|
+
Tt as Colorpicker,
|
|
2142
|
+
$e as Combobox,
|
|
2143
|
+
zt as ContextMenu,
|
|
2144
|
+
Bt as DataView,
|
|
2145
|
+
Pt as Form,
|
|
2146
|
+
It as Grid,
|
|
2147
|
+
dt as Layout,
|
|
2148
|
+
At as List,
|
|
2149
|
+
wt as Menu,
|
|
2150
|
+
ae as MenuDropdown,
|
|
2151
|
+
Re as MessageContext,
|
|
2152
|
+
Et as MessageProvider,
|
|
2153
|
+
Yt as Navbar,
|
|
2154
|
+
jt as Pagination,
|
|
2155
|
+
Nt as Popup,
|
|
2156
|
+
Ot as Ribbon,
|
|
2157
|
+
$t as Sidebar,
|
|
2158
|
+
De as Slider,
|
|
2159
|
+
Dt as Tabbar,
|
|
2160
|
+
ht as Timepicker,
|
|
2161
|
+
Mt as Toolbar,
|
|
2162
|
+
Ht as Tree,
|
|
2163
|
+
Rt as Window,
|
|
1971
2164
|
e as tokens,
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
2165
|
+
ie as useClickOutside,
|
|
2166
|
+
st as useDrag,
|
|
2167
|
+
Wt as useMessage
|
|
1975
2168
|
};
|
|
1976
2169
|
//# sourceMappingURL=dhx-react-suite.js.map
|