dhx-react-suite 1.1.7 → 1.1.8
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 +1273 -1061
- 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 +24 -5
- package/package.json +1 -1
package/dist/dhx-react-suite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { Tooltip as et, Legend as tt, CartesianGrid as nt, XAxis as
|
|
1
|
+
import { jsxs as g, jsx as t, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as _, useRef as oe, useCallback as ae, useState as N, useMemo as ue, createContext as Qe, useContext as Ze } from "react";
|
|
3
|
+
import { Tooltip as et, Legend as tt, CartesianGrid as nt, XAxis as Ee, YAxis as Re, BarChart as rt, Bar as ot, LineChart as it, Line as lt, AreaChart as st, Area as at, PieChart as dt, Pie as ct, Cell as ut, RadarChart as pt, PolarGrid as ht, PolarAngleAxis as ft, PolarRadiusAxis as xt, Radar as gt, ScatterChart as yt, Scatter as bt, ResponsiveContainer as mt, Treemap as vt } 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
|
-
},
|
|
24
|
-
function
|
|
25
|
-
if (typeof document > "u" || document.getElementById(
|
|
23
|
+
}, We = "dhx-react-styles";
|
|
24
|
+
function q() {
|
|
25
|
+
if (typeof document > "u" || document.getElementById(We)) return;
|
|
26
26
|
const n = document.createElement("style");
|
|
27
|
-
n.id =
|
|
27
|
+
n.id = We, 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}
|
|
@@ -71,17 +71,17 @@ const kt = {
|
|
|
71
71
|
md: {},
|
|
72
72
|
lg: { height: 38, padding: "0 18px", fontSize: 14 }
|
|
73
73
|
};
|
|
74
|
-
function
|
|
74
|
+
function _t({
|
|
75
75
|
children: n,
|
|
76
76
|
variant: o = "primary",
|
|
77
77
|
size: d = "md",
|
|
78
|
-
icon:
|
|
78
|
+
icon: l,
|
|
79
79
|
disabled: f,
|
|
80
80
|
onClick: a,
|
|
81
81
|
style: h,
|
|
82
82
|
className: u = ""
|
|
83
83
|
}) {
|
|
84
|
-
return
|
|
84
|
+
return _(q, []), /* @__PURE__ */ g(
|
|
85
85
|
"button",
|
|
86
86
|
{
|
|
87
87
|
className: `dhx dhx-btn dhx-btn-${o} ${u}`,
|
|
@@ -89,45 +89,45 @@ function Ot({
|
|
|
89
89
|
disabled: f,
|
|
90
90
|
onClick: a,
|
|
91
91
|
children: [
|
|
92
|
-
|
|
92
|
+
l && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: l }),
|
|
93
93
|
n
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
const d = (
|
|
101
|
-
n.current && !n.current.contains(
|
|
98
|
+
function ge(n, o) {
|
|
99
|
+
_(() => {
|
|
100
|
+
const d = (l) => {
|
|
101
|
+
n.current && !n.current.contains(l.target) && o(l);
|
|
102
102
|
};
|
|
103
103
|
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
104
104
|
}, [n, o]);
|
|
105
105
|
}
|
|
106
106
|
function St(n) {
|
|
107
|
-
const o =
|
|
108
|
-
return
|
|
109
|
-
(
|
|
110
|
-
o.current = !0, d.current = { x:
|
|
111
|
-
const h = (
|
|
107
|
+
const o = oe(!1), d = oe({ x: 0, y: 0, ox: 0, oy: 0 });
|
|
108
|
+
return ae(
|
|
109
|
+
(l, f = 0, a = 0) => {
|
|
110
|
+
o.current = !0, d.current = { x: l.clientX, y: l.clientY, ox: f, oy: a };
|
|
111
|
+
const h = (x) => {
|
|
112
112
|
if (!o.current) return;
|
|
113
|
-
const { x:
|
|
114
|
-
n(i +
|
|
113
|
+
const { x: w, y: r, ox: i, oy: c } = d.current;
|
|
114
|
+
n(i + x.clientX - w, c + x.clientY - r);
|
|
115
115
|
}, u = () => {
|
|
116
116
|
o.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u);
|
|
117
117
|
};
|
|
118
|
-
document.addEventListener("mousemove", h), document.addEventListener("mouseup", u),
|
|
118
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", u), l.preventDefault();
|
|
119
119
|
},
|
|
120
120
|
[n]
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
const [
|
|
123
|
+
function be({ items: n, onSelect: o, style: d }) {
|
|
124
|
+
const [l, f] = N(null);
|
|
125
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", ...d }, children: n.map((a, h) => {
|
|
126
|
-
var
|
|
126
|
+
var x, w;
|
|
127
127
|
if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, h);
|
|
128
|
-
const u =
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
128
|
+
const u = l === h;
|
|
129
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
|
|
130
|
+
/* @__PURE__ */ g(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
133
|
onClick: () => {
|
|
@@ -139,39 +139,39 @@ function ge({ items: n, onSelect: o, style: d }) {
|
|
|
139
139
|
a.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: a.icon }),
|
|
140
140
|
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value || a.id }),
|
|
141
141
|
a.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: a.hotkey }),
|
|
142
|
-
(
|
|
142
|
+
(x = a.items) != null && x.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
|
|
143
143
|
]
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
|
-
u && ((
|
|
146
|
+
u && ((w = a.items) != null && w.length) ? /* @__PURE__ */ t(be, { items: a.items, onSelect: o, style: { position: "absolute", left: "100%", top: -4 } }) : null
|
|
147
147
|
] }, a.id || h);
|
|
148
148
|
}) });
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const [f, a] =
|
|
152
|
-
return
|
|
153
|
-
/* @__PURE__ */
|
|
150
|
+
function Vt({ items: n = [], label: o = "Menu", onSelect: d, style: l }) {
|
|
151
|
+
const [f, a] = N(!1), h = oe(null);
|
|
152
|
+
return _(q, []), ge(h, ae(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...l }, children: [
|
|
153
|
+
/* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((u) => !u), children: [
|
|
154
154
|
o,
|
|
155
155
|
" ",
|
|
156
156
|
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
|
|
157
157
|
] }),
|
|
158
|
-
f && /* @__PURE__ */ t(
|
|
158
|
+
f && /* @__PURE__ */ t(be, { items: n, onSelect: (u) => {
|
|
159
159
|
d == null || d(u), a(!1);
|
|
160
160
|
} })
|
|
161
161
|
] });
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
const [
|
|
165
|
-
return
|
|
163
|
+
function Xt({ items: n = [], onSelect: o, children: d }) {
|
|
164
|
+
const [l, f] = N(null), a = oe(null);
|
|
165
|
+
return _(q, []), ge(a, ae(() => f(null), [])), /* @__PURE__ */ g("div", { ref: a, onContextMenu: (u) => {
|
|
166
166
|
u.preventDefault(), f({ x: u.clientX, y: u.clientY });
|
|
167
167
|
}, style: { position: "relative", display: "contents" }, children: [
|
|
168
168
|
d,
|
|
169
|
-
|
|
169
|
+
l && /* @__PURE__ */ t("div", { style: { position: "fixed", left: l.x, top: l.y, zIndex: 9999 }, children: /* @__PURE__ */ t(be, { items: n, onSelect: (u) => {
|
|
170
170
|
o == null || o(u), f(null);
|
|
171
171
|
} }) })
|
|
172
172
|
] });
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Ae({ count: n }) {
|
|
175
175
|
return /* @__PURE__ */ t("span", { style: {
|
|
176
176
|
position: "absolute",
|
|
177
177
|
top: 2,
|
|
@@ -191,36 +191,36 @@ function We({ count: n }) {
|
|
|
191
191
|
pointerEvents: "none"
|
|
192
192
|
}, children: n });
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const [
|
|
194
|
+
function qt({ items: n = [], onAction: o, style: d }) {
|
|
195
|
+
const [l, f] = N(null), [a, h] = N(() => {
|
|
196
196
|
const r = {};
|
|
197
197
|
return n.forEach((i) => {
|
|
198
198
|
i.id && (i.twoState || i.group) && i.active && (r[i.id] = !0);
|
|
199
199
|
}), r;
|
|
200
|
-
}), u =
|
|
201
|
-
|
|
202
|
-
const
|
|
200
|
+
}), u = oe(null);
|
|
201
|
+
_(q, []), ge(u, ae(() => f(null), []));
|
|
202
|
+
const x = (r, i) => {
|
|
203
203
|
var c, m;
|
|
204
204
|
if (!r.disabled) {
|
|
205
|
-
if (r.twoState && r.id && h((
|
|
206
|
-
const
|
|
207
|
-
return n.forEach((
|
|
208
|
-
|
|
209
|
-
}),
|
|
205
|
+
if (r.twoState && r.id && h((S) => ({ ...S, [r.id]: !S[r.id] })), r.group && r.id && h((S) => {
|
|
206
|
+
const s = { ...S };
|
|
207
|
+
return n.forEach((b) => {
|
|
208
|
+
b.group === r.group && b.id && (s[b.id] = !1);
|
|
209
|
+
}), s[r.id] = !0, s;
|
|
210
210
|
}), (c = r.items) != null && c.length) {
|
|
211
|
-
f((
|
|
211
|
+
f((S) => S === i ? null : i);
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
(m = r.onClick) == null || m.call(r, r.id || ""), o == null || o(r.id || "");
|
|
215
215
|
}
|
|
216
|
-
},
|
|
217
|
-
var
|
|
216
|
+
}, w = (r, i) => {
|
|
217
|
+
var s, b;
|
|
218
218
|
if (r.hidden) return null;
|
|
219
219
|
if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, i);
|
|
220
220
|
if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, i);
|
|
221
|
-
if (r.type === "input") return /* @__PURE__ */
|
|
221
|
+
if (r.type === "input") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
222
222
|
r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
224
224
|
r.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: r.icon }),
|
|
225
225
|
/* @__PURE__ */ t(
|
|
226
226
|
"input",
|
|
@@ -229,15 +229,15 @@ function _t({ items: n = [], onAction: o, style: d }) {
|
|
|
229
229
|
style: { width: r.width || 140, height: 28, paddingLeft: r.icon ? 30 : void 0 },
|
|
230
230
|
placeholder: r.placeholder,
|
|
231
231
|
defaultValue: r.value,
|
|
232
|
-
onChange: (
|
|
233
|
-
var
|
|
234
|
-
return (
|
|
232
|
+
onChange: (M) => {
|
|
233
|
+
var D;
|
|
234
|
+
return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
)
|
|
238
238
|
] })
|
|
239
239
|
] }, i);
|
|
240
|
-
if (r.type === "select") return /* @__PURE__ */
|
|
240
|
+
if (r.type === "select") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
241
241
|
r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
|
|
242
242
|
/* @__PURE__ */ t(
|
|
243
243
|
"select",
|
|
@@ -245,15 +245,15 @@ function _t({ items: n = [], onAction: o, style: d }) {
|
|
|
245
245
|
className: "dhx dhx-input",
|
|
246
246
|
style: { width: r.width || 100, height: 28, cursor: "pointer" },
|
|
247
247
|
defaultValue: r.value,
|
|
248
|
-
onChange: (
|
|
249
|
-
var
|
|
250
|
-
return (
|
|
248
|
+
onChange: (M) => {
|
|
249
|
+
var D;
|
|
250
|
+
return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
|
|
251
251
|
},
|
|
252
|
-
children: (
|
|
252
|
+
children: (s = r.options) == null ? void 0 : s.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.label }, M.value))
|
|
253
253
|
}
|
|
254
254
|
)
|
|
255
255
|
] }, i);
|
|
256
|
-
if (r.type === "imageButton") return /* @__PURE__ */
|
|
256
|
+
if (r.type === "imageButton") return /* @__PURE__ */ g(
|
|
257
257
|
"button",
|
|
258
258
|
{
|
|
259
259
|
title: r.tooltip,
|
|
@@ -270,17 +270,17 @@ function _t({ items: n = [], onAction: o, style: d }) {
|
|
|
270
270
|
background: "transparent",
|
|
271
271
|
flexShrink: 0
|
|
272
272
|
},
|
|
273
|
-
onClick: () =>
|
|
273
|
+
onClick: () => x(r, i),
|
|
274
274
|
children: [
|
|
275
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(
|
|
276
|
+
r.count !== void 0 && /* @__PURE__ */ t(Ae, { count: r.count })
|
|
277
277
|
]
|
|
278
278
|
},
|
|
279
279
|
i
|
|
280
280
|
);
|
|
281
|
-
const c = !!(r.id && a[r.id]), m = r.value ?? r.text,
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
281
|
+
const c = !!(r.id && a[r.id]), m = r.value ?? r.text, S = !!((b = r.items) != null && b.length);
|
|
282
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
283
|
+
/* @__PURE__ */ g(
|
|
284
284
|
"button",
|
|
285
285
|
{
|
|
286
286
|
className: "dhx dhx-btn dhx-btn-ghost",
|
|
@@ -295,17 +295,17 @@ function _t({ items: n = [], onAction: o, style: d }) {
|
|
|
295
295
|
opacity: r.disabled ? 0.55 : 1,
|
|
296
296
|
cursor: r.disabled ? "not-allowed" : "pointer"
|
|
297
297
|
},
|
|
298
|
-
onClick: () =>
|
|
298
|
+
onClick: () => x(r, i),
|
|
299
299
|
children: [
|
|
300
300
|
r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
|
|
301
301
|
m && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: m }),
|
|
302
|
-
|
|
303
|
-
r.count !== void 0 && /* @__PURE__ */ t(
|
|
302
|
+
S && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
|
|
303
|
+
r.count !== void 0 && /* @__PURE__ */ t(Ae, { count: r.count })
|
|
304
304
|
]
|
|
305
305
|
}
|
|
306
306
|
),
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
S && l === i && /* @__PURE__ */ t(
|
|
308
|
+
be,
|
|
309
309
|
{
|
|
310
310
|
items: r.items,
|
|
311
311
|
onSelect: () => f(null),
|
|
@@ -330,50 +330,262 @@ function _t({ items: n = [], onAction: o, style: d }) {
|
|
|
330
330
|
flexWrap: "wrap",
|
|
331
331
|
...d
|
|
332
332
|
},
|
|
333
|
-
children: n.map(
|
|
333
|
+
children: n.map(w)
|
|
334
334
|
}
|
|
335
335
|
);
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
337
|
+
function wt(n) {
|
|
338
|
+
return n === "primary" ? e.primary : n === "success" ? "#43a047" : n === "secondary" ? "#9e9e9e" : "#e53935";
|
|
339
|
+
}
|
|
340
|
+
function zt(n, o) {
|
|
341
|
+
const d = [], l = (f) => {
|
|
342
|
+
var a;
|
|
343
|
+
f.id && f.group === o && d.push(f.id), (a = f.items) == null || a.forEach(l);
|
|
344
|
+
};
|
|
345
|
+
return n.forEach(l), d;
|
|
346
|
+
}
|
|
347
|
+
function Mt(n) {
|
|
348
|
+
const o = {}, d = (l) => {
|
|
349
|
+
var f;
|
|
350
|
+
l.id && l.twoState && l.active && (o[l.id] = !0), (f = l.items) == null || f.forEach(d);
|
|
351
|
+
};
|
|
352
|
+
return n.forEach(d), o;
|
|
353
|
+
}
|
|
354
|
+
function Gt({
|
|
355
|
+
items: n = [],
|
|
356
|
+
width: o = 240,
|
|
357
|
+
minWidth: d = 64,
|
|
358
|
+
header: l,
|
|
359
|
+
footer: f,
|
|
360
|
+
collapsed: a,
|
|
361
|
+
defaultCollapsed: h,
|
|
362
|
+
selected: u,
|
|
363
|
+
defaultSelected: x,
|
|
364
|
+
onSelect: w,
|
|
365
|
+
onCollapse: r,
|
|
366
|
+
onExpand: i,
|
|
367
|
+
onBeforeCollapse: c,
|
|
368
|
+
onBeforeExpand: m,
|
|
369
|
+
onToggleItem: S,
|
|
370
|
+
style: s
|
|
371
|
+
}) {
|
|
372
|
+
const b = a !== void 0, M = u !== void 0, [D, R] = N(h ?? !1), [z, C] = N(x ?? null), [F, p] = N({}), [I, W] = N(() => Mt(n));
|
|
373
|
+
_(q, []);
|
|
374
|
+
const v = b ? a : D, X = M ? u ?? null : z, J = v ? d : o, se = () => {
|
|
375
|
+
if (v) {
|
|
376
|
+
if ((m == null ? void 0 : m()) === !1) return;
|
|
377
|
+
b || R(!1), i == null || i();
|
|
378
|
+
} else {
|
|
379
|
+
if ((c == null ? void 0 : c()) === !1) return;
|
|
380
|
+
b || R(!0), r == null || r();
|
|
381
|
+
}
|
|
382
|
+
}, U = (k) => {
|
|
383
|
+
M || C(k.id ?? null), w == null || w(k), k.id && k.onClick && k.onClick(k.id);
|
|
384
|
+
}, ie = (k) => {
|
|
385
|
+
if (!k.id) return;
|
|
386
|
+
const P = !I[k.id];
|
|
387
|
+
let O = { ...I, [k.id]: P };
|
|
388
|
+
k.group && P && zt(n, k.group).forEach((G) => {
|
|
389
|
+
G !== k.id && (O[G] = !1);
|
|
390
|
+
}), W(O), S == null || S(k.id, P);
|
|
391
|
+
}, E = (k, P) => {
|
|
392
|
+
if (k.count === void 0) return null;
|
|
393
|
+
const O = wt(k.countColor), G = k.count > 99 ? "99+" : String(k.count);
|
|
394
|
+
return P ? /* @__PURE__ */ t("span", { style: {
|
|
395
|
+
position: "absolute",
|
|
396
|
+
top: 1,
|
|
397
|
+
right: 1,
|
|
398
|
+
background: O,
|
|
399
|
+
color: "#fff",
|
|
400
|
+
borderRadius: 8,
|
|
401
|
+
fontSize: 9,
|
|
402
|
+
fontWeight: 700,
|
|
403
|
+
padding: "0 3px",
|
|
404
|
+
minWidth: 14,
|
|
405
|
+
textAlign: "center",
|
|
406
|
+
lineHeight: "14px",
|
|
407
|
+
pointerEvents: "none"
|
|
408
|
+
}, children: G }) : /* @__PURE__ */ t("span", { style: {
|
|
409
|
+
background: O,
|
|
410
|
+
color: "#fff",
|
|
411
|
+
borderRadius: 10,
|
|
412
|
+
padding: "1px 6px",
|
|
413
|
+
fontSize: 11,
|
|
414
|
+
fontWeight: 700,
|
|
415
|
+
flexShrink: 0
|
|
416
|
+
}, children: G });
|
|
417
|
+
}, $ = (k, P, O) => {
|
|
418
|
+
var ce;
|
|
419
|
+
if (k.hidden) return null;
|
|
420
|
+
const G = k.id ?? `${k.type ?? "navItem"}-${P}-${O}`, K = k.type ?? "navItem";
|
|
421
|
+
if (K === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px", flexShrink: 0 } }, G);
|
|
422
|
+
if (K === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, G);
|
|
423
|
+
if (K === "title")
|
|
424
|
+
return v ? null : /* @__PURE__ */ t("div", { style: {
|
|
425
|
+
padding: "10px 14px 4px",
|
|
426
|
+
fontSize: 10,
|
|
427
|
+
fontWeight: 700,
|
|
428
|
+
textTransform: "uppercase",
|
|
429
|
+
letterSpacing: 1,
|
|
430
|
+
color: e.textMut,
|
|
431
|
+
flexShrink: 0
|
|
432
|
+
}, children: k.value }, G);
|
|
433
|
+
if (K === "customHTML") return /* @__PURE__ */ t(
|
|
434
|
+
"div",
|
|
435
|
+
{
|
|
436
|
+
dangerouslySetInnerHTML: { __html: k.html ?? "" },
|
|
437
|
+
style: { padding: "8px 12px", flexShrink: 0 }
|
|
438
|
+
},
|
|
439
|
+
G
|
|
440
|
+
);
|
|
441
|
+
const V = (((ce = k.items) == null ? void 0 : ce.length) ?? 0) > 0, Q = !!F[k.id ?? ""], Z = k.twoState ? !!I[k.id ?? ""] : !1, ne = !k.twoState && X === k.id || Z, H = !!k.disabled, de = v ? 0 : 12 + P * 16, me = () => {
|
|
442
|
+
H || (k.twoState ? (ie(k), U(k)) : (V && p((le) => ({ ...le, [k.id ?? ""]: !le[k.id ?? ""] })), U(k)));
|
|
443
|
+
};
|
|
444
|
+
return /* @__PURE__ */ g("div", { style: { flexShrink: 0 }, children: [
|
|
445
|
+
/* @__PURE__ */ g(
|
|
349
446
|
"div",
|
|
350
447
|
{
|
|
351
|
-
|
|
352
|
-
|
|
448
|
+
title: k.tooltip,
|
|
449
|
+
onClick: me,
|
|
450
|
+
style: {
|
|
451
|
+
display: "flex",
|
|
452
|
+
alignItems: "center",
|
|
453
|
+
gap: v ? 0 : 8,
|
|
454
|
+
justifyContent: v ? "center" : "flex-start",
|
|
455
|
+
paddingTop: 8,
|
|
456
|
+
paddingBottom: 8,
|
|
457
|
+
paddingLeft: v ? 0 : de,
|
|
458
|
+
paddingRight: v ? 0 : 10,
|
|
459
|
+
borderRadius: e.r,
|
|
460
|
+
margin: "1px 6px",
|
|
461
|
+
cursor: H ? "not-allowed" : "pointer",
|
|
462
|
+
userSelect: "none",
|
|
463
|
+
transition: "background .15s",
|
|
464
|
+
background: ne ? e.primaryLt : "transparent",
|
|
465
|
+
color: H ? e.textMut : ne ? e.primary : e.text,
|
|
466
|
+
opacity: H ? 0.55 : 1
|
|
467
|
+
},
|
|
468
|
+
onMouseEnter: (le) => {
|
|
469
|
+
!ne && !H && (le.currentTarget.style.background = e.bg);
|
|
470
|
+
},
|
|
471
|
+
onMouseLeave: (le) => {
|
|
472
|
+
!ne && !H && (le.currentTarget.style.background = "transparent");
|
|
353
473
|
},
|
|
354
|
-
style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${u ? "0px" : `${12 + w * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: u ? "center" : "flex-start", transition: "all .15s", background: k ? e.primaryLt : "transparent", color: k ? e.primary : e.text, userSelect: "none" },
|
|
355
|
-
onMouseEnter: (W) => !k && (W.currentTarget.style.background = e.bg),
|
|
356
|
-
onMouseLeave: (W) => !k && (W.currentTarget.style.background = "transparent"),
|
|
357
474
|
children: [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
475
|
+
/* @__PURE__ */ g("span", { style: {
|
|
476
|
+
position: "relative",
|
|
477
|
+
minWidth: 22,
|
|
478
|
+
textAlign: "center",
|
|
479
|
+
fontSize: 18,
|
|
480
|
+
flexShrink: 0,
|
|
481
|
+
lineHeight: 1
|
|
482
|
+
}, children: [
|
|
483
|
+
k.icon ?? (k.value && !k.icon, null),
|
|
484
|
+
v && E(k, !0)
|
|
485
|
+
] }),
|
|
486
|
+
!v && /* @__PURE__ */ t("span", { style: {
|
|
487
|
+
flex: 1,
|
|
488
|
+
fontSize: 13,
|
|
489
|
+
fontWeight: ne ? 600 : 400,
|
|
490
|
+
overflow: "hidden",
|
|
491
|
+
textOverflow: "ellipsis",
|
|
492
|
+
whiteSpace: "nowrap"
|
|
493
|
+
}, children: k.value }),
|
|
494
|
+
!v && E(k, !1),
|
|
495
|
+
!v && k.twoState && /* @__PURE__ */ t("span", { style: {
|
|
496
|
+
width: 14,
|
|
497
|
+
height: 14,
|
|
498
|
+
borderRadius: 2,
|
|
499
|
+
border: `2px solid ${ne ? e.primary : e.borderDk}`,
|
|
500
|
+
background: ne ? e.primary : "transparent",
|
|
501
|
+
flexShrink: 0,
|
|
502
|
+
display: "flex",
|
|
503
|
+
alignItems: "center",
|
|
504
|
+
justifyContent: "center"
|
|
505
|
+
}, children: ne && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 8, fontWeight: 700, lineHeight: 1 }, children: "✓" }) }),
|
|
506
|
+
!v && V && !k.twoState && /* @__PURE__ */ t("span", { style: {
|
|
507
|
+
fontSize: 11,
|
|
508
|
+
color: e.textMut,
|
|
509
|
+
flexShrink: 0,
|
|
510
|
+
transition: "transform .2s",
|
|
511
|
+
transform: Q ? "rotate(90deg)" : "rotate(0deg)",
|
|
512
|
+
display: "inline-block"
|
|
513
|
+
}, children: "▶" })
|
|
362
514
|
]
|
|
363
515
|
}
|
|
364
516
|
),
|
|
365
|
-
|
|
366
|
-
] },
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
517
|
+
V && Q && !v && /* @__PURE__ */ t("div", { children: k.items.map((le, ye) => $(le, P + 1, ye)) })
|
|
518
|
+
] }, G);
|
|
519
|
+
}, j = /* @__PURE__ */ g(
|
|
520
|
+
"div",
|
|
521
|
+
{
|
|
522
|
+
onClick: se,
|
|
523
|
+
style: {
|
|
524
|
+
display: "flex",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
justifyContent: v ? "center" : "flex-start",
|
|
527
|
+
gap: 8,
|
|
528
|
+
padding: v ? "8px 0" : "8px 14px",
|
|
529
|
+
margin: "4px 6px",
|
|
530
|
+
borderRadius: e.r,
|
|
531
|
+
cursor: "pointer",
|
|
532
|
+
color: e.textMut,
|
|
533
|
+
fontSize: 13,
|
|
534
|
+
userSelect: "none",
|
|
535
|
+
transition: "background .15s",
|
|
536
|
+
flexShrink: 0
|
|
537
|
+
},
|
|
538
|
+
onMouseEnter: (k) => k.currentTarget.style.background = e.bg,
|
|
539
|
+
onMouseLeave: (k) => k.currentTarget.style.background = "transparent",
|
|
540
|
+
children: [
|
|
541
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 16, fontWeight: 700, lineHeight: 1 }, children: v ? "›" : "‹" }),
|
|
542
|
+
!v && /* @__PURE__ */ t("span", { children: "Collapse" })
|
|
543
|
+
]
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
return /* @__PURE__ */ g(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
className: "dhx",
|
|
550
|
+
style: {
|
|
551
|
+
width: J,
|
|
552
|
+
minWidth: J,
|
|
553
|
+
background: e.surface,
|
|
554
|
+
borderRight: `1px solid ${e.border}`,
|
|
555
|
+
display: "flex",
|
|
556
|
+
flexDirection: "column",
|
|
557
|
+
transition: "width .2s ease, min-width .2s ease",
|
|
558
|
+
overflow: "hidden",
|
|
559
|
+
...s
|
|
560
|
+
},
|
|
561
|
+
children: [
|
|
562
|
+
l && /* @__PURE__ */ t("div", { style: {
|
|
563
|
+
padding: v ? "12px 0" : "12px 14px",
|
|
564
|
+
borderBottom: `1px solid ${e.border}`,
|
|
565
|
+
fontWeight: 700,
|
|
566
|
+
fontSize: 15,
|
|
567
|
+
display: "flex",
|
|
568
|
+
alignItems: "center",
|
|
569
|
+
justifyContent: v ? "center" : "flex-start",
|
|
570
|
+
overflow: "hidden",
|
|
571
|
+
flexShrink: 0
|
|
572
|
+
}, children: l }),
|
|
573
|
+
/* @__PURE__ */ t(
|
|
574
|
+
"div",
|
|
575
|
+
{
|
|
576
|
+
className: "dhx-scroll",
|
|
577
|
+
style: { flex: 1, overflowY: "auto", overflowX: "hidden", display: "flex", flexDirection: "column" },
|
|
578
|
+
children: n.map((k, P) => $(k, 0, P))
|
|
579
|
+
}
|
|
580
|
+
),
|
|
581
|
+
j,
|
|
582
|
+
f && !v && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}`, flexShrink: 0 }, children: f })
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
);
|
|
374
586
|
}
|
|
375
|
-
function
|
|
376
|
-
const [o, d] =
|
|
587
|
+
function $t({ config: n }) {
|
|
588
|
+
const [o, d] = N(!1), l = {
|
|
377
589
|
position: "relative",
|
|
378
590
|
background: e.surface,
|
|
379
591
|
border: `1px solid ${e.border}`,
|
|
@@ -383,81 +595,81 @@ function wt({ config: n }) {
|
|
|
383
595
|
...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
|
|
384
596
|
...o ? { flex: "0 0 auto" } : {}
|
|
385
597
|
};
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
n.header && /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ g("div", { style: l, children: [
|
|
599
|
+
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
600
|
/* @__PURE__ */ t("span", { children: n.header }),
|
|
389
601
|
n.collapsable && /* @__PURE__ */ t("button", { onClick: () => d((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: o ? "▼" : "▲" })
|
|
390
602
|
] }),
|
|
391
|
-
!o && /* @__PURE__ */
|
|
603
|
+
!o && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
|
|
392
604
|
n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
|
|
393
|
-
(n.rows || n.cols) && /* @__PURE__ */ t(
|
|
605
|
+
(n.rows || n.cols) && /* @__PURE__ */ t(Dt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
|
|
394
606
|
] })
|
|
395
607
|
] });
|
|
396
608
|
}
|
|
397
|
-
function
|
|
398
|
-
|
|
609
|
+
function Dt({ rows: n, cols: o, type: d = "line", style: l, children: f }) {
|
|
610
|
+
_(q, []);
|
|
399
611
|
const a = d === "space" ? 12 : d === "wide" ? 8 : 1, h = n || o, u = !!n;
|
|
400
|
-
return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: u ? "column" : "row", gap: a, width: "100%", height: "100%", ...
|
|
612
|
+
return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: u ? "column" : "row", gap: a, width: "100%", height: "100%", ...l }, children: h.map((x, w) => /* @__PURE__ */ t($t, { config: x }, x.id || w)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...l }, children: f });
|
|
401
613
|
}
|
|
402
|
-
function
|
|
403
|
-
var
|
|
404
|
-
const [
|
|
405
|
-
|
|
406
|
-
const m = (
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
f.includes(
|
|
410
|
-
},
|
|
411
|
-
const
|
|
412
|
-
return /* @__PURE__ */
|
|
614
|
+
function Jt({ views: n = [], mode: o = "top", tabAlign: d = "left", closable: l = [], disabled: f = [], defaultActive: a, onBeforeChange: h, onChange: u, style: x }) {
|
|
615
|
+
var z;
|
|
616
|
+
const [w, r] = N(a || ((z = n[0]) == null ? void 0 : z.id)), [i, c] = N(n.map((C) => C.id));
|
|
617
|
+
_(q, []);
|
|
618
|
+
const m = (C, F) => {
|
|
619
|
+
C.stopPropagation(), c((p) => p.filter((I) => I !== F)), w === F && r(i.find((p) => p !== F) ?? "");
|
|
620
|
+
}, S = (C) => {
|
|
621
|
+
f.includes(C) || h && h(C) === !1 || (r(C), u == null || u(C));
|
|
622
|
+
}, s = o === "left" || o === "right", b = n.filter((C) => i.includes(C.id)), M = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: s ? "column" : "row", justifyContent: d === "center" ? "center" : d === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !s && o !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: o === "bottom" ? `2px solid ${e.border}` : "none", borderRight: o === "left" ? `2px solid ${e.border}` : "none", borderLeft: o === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: b.map((C) => {
|
|
623
|
+
const F = w === C.id, p = f.includes(C.id), I = o === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : s ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [o === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
|
|
624
|
+
return /* @__PURE__ */ g(
|
|
413
625
|
"div",
|
|
414
626
|
{
|
|
415
|
-
onClick: () =>
|
|
416
|
-
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: p ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth:
|
|
627
|
+
onClick: () => S(C.id),
|
|
628
|
+
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: p ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: s ? 120 : "auto", ...F ? I : { color: p ? e.textMut : e.textSec } },
|
|
417
629
|
children: [
|
|
418
|
-
|
|
419
|
-
/* @__PURE__ */ t("span", { children:
|
|
420
|
-
|
|
630
|
+
C.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: C.icon }),
|
|
631
|
+
/* @__PURE__ */ t("span", { children: C.tab }),
|
|
632
|
+
l.includes(C.id) && /* @__PURE__ */ t("span", { onClick: (W) => m(W, C.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
|
|
421
633
|
]
|
|
422
634
|
},
|
|
423
|
-
|
|
635
|
+
C.id
|
|
424
636
|
);
|
|
425
|
-
}) }),
|
|
426
|
-
|
|
427
|
-
(
|
|
637
|
+
}) }), D = b.find((C) => C.id === w), R = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
|
|
638
|
+
D == null ? void 0 : D.content,
|
|
639
|
+
(D == null ? void 0 : D.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: D.html }, style: { padding: 16 } })
|
|
428
640
|
] });
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
|
|
431
|
-
|
|
641
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: o === "top" ? "column" : o === "bottom" ? "column-reverse" : o === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...x }, children: [
|
|
642
|
+
M,
|
|
643
|
+
R
|
|
432
644
|
] });
|
|
433
645
|
}
|
|
434
|
-
const
|
|
435
|
-
function
|
|
436
|
-
return /* @__PURE__ */
|
|
646
|
+
const he = `1px solid ${e.border}`;
|
|
647
|
+
function Ct({ active: n, dir: o }) {
|
|
648
|
+
return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
|
|
437
649
|
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && o === "asc" ? e.primary : e.borderDk }) }),
|
|
438
650
|
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && o === "desc" ? e.primary : e.borderDk }) })
|
|
439
651
|
] });
|
|
440
652
|
}
|
|
441
|
-
function
|
|
442
|
-
const [a, h] =
|
|
443
|
-
|
|
653
|
+
function Lt({ options: n, value: o, onChange: d, onCommit: l, onCancel: f }) {
|
|
654
|
+
const [a, h] = N(o), [u, x] = N(!0), w = oe(null);
|
|
655
|
+
_(() => {
|
|
444
656
|
const i = (c) => {
|
|
445
|
-
|
|
657
|
+
w.current && !w.current.contains(c.target) && l();
|
|
446
658
|
};
|
|
447
659
|
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
448
|
-
}, [
|
|
660
|
+
}, [l]);
|
|
449
661
|
const r = n.filter((i) => !a || i.toLowerCase().includes(a.toLowerCase()));
|
|
450
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ g("div", { ref: w, style: { width: "100%", position: "relative" }, children: [
|
|
451
663
|
/* @__PURE__ */ t(
|
|
452
664
|
"input",
|
|
453
665
|
{
|
|
454
666
|
autoFocus: !0,
|
|
455
667
|
value: a,
|
|
456
668
|
onChange: (i) => {
|
|
457
|
-
h(i.target.value), d(i.target.value),
|
|
669
|
+
h(i.target.value), d(i.target.value), x(!0);
|
|
458
670
|
},
|
|
459
671
|
onKeyDown: (i) => {
|
|
460
|
-
i.key === "Enter" &&
|
|
672
|
+
i.key === "Enter" && l(), i.key === "Escape" && f();
|
|
461
673
|
},
|
|
462
674
|
onClick: (i) => i.stopPropagation(),
|
|
463
675
|
style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
|
|
@@ -467,7 +679,7 @@ function $t({ options: n, value: o, onChange: d, onCommit: s, onCancel: f }) {
|
|
|
467
679
|
"div",
|
|
468
680
|
{
|
|
469
681
|
onMouseDown: (c) => {
|
|
470
|
-
c.preventDefault(), d(i), h(i),
|
|
682
|
+
c.preventDefault(), d(i), h(i), x(!1), l();
|
|
471
683
|
},
|
|
472
684
|
style: { padding: "6px 10px", cursor: "pointer", fontSize: 13, color: e.text },
|
|
473
685
|
onMouseEnter: (c) => c.currentTarget.style.background = e.bg,
|
|
@@ -478,7 +690,7 @@ function $t({ options: n, value: o, onChange: d, onCommit: s, onCancel: f }) {
|
|
|
478
690
|
)) })
|
|
479
691
|
] });
|
|
480
692
|
}
|
|
481
|
-
function
|
|
693
|
+
function It(n, o) {
|
|
482
694
|
if (n == null) return "";
|
|
483
695
|
if (o === "number") return typeof n == "number" ? n.toLocaleString() : String(n);
|
|
484
696
|
if (o === "date") {
|
|
@@ -487,14 +699,14 @@ function Dt(n, o) {
|
|
|
487
699
|
}
|
|
488
700
|
return String(n);
|
|
489
701
|
}
|
|
490
|
-
function
|
|
702
|
+
function Tt(n, o, d) {
|
|
491
703
|
return n == null ? 1 : o == null ? -1 : d === "date" ? new Date(String(n)).getTime() - new Date(String(o)).getTime() : d === "number" ? Number(n) - Number(o) : String(n) < String(o) ? -1 : String(n) > String(o) ? 1 : 0;
|
|
492
704
|
}
|
|
493
|
-
function
|
|
705
|
+
function Se(n) {
|
|
494
706
|
var o;
|
|
495
707
|
return Array.isArray(n.header) && ((o = n.header[1]) == null ? void 0 : o.content) != null ? n.header[1].content : n.filterable ? n.filterType === "select" ? "selectFilter" : "inputFilter" : null;
|
|
496
708
|
}
|
|
497
|
-
function
|
|
709
|
+
function Nt(n, o, d, l, f) {
|
|
498
710
|
const a = {
|
|
499
711
|
width: "100%",
|
|
500
712
|
border: "none",
|
|
@@ -510,23 +722,23 @@ function Lt(n, o, d, s, f) {
|
|
|
510
722
|
{
|
|
511
723
|
autoFocus: !0,
|
|
512
724
|
value: o,
|
|
513
|
-
onChange: (
|
|
514
|
-
onBlur:
|
|
515
|
-
onKeyDown: (
|
|
516
|
-
|
|
725
|
+
onChange: (x) => d(x.target.value),
|
|
726
|
+
onBlur: l,
|
|
727
|
+
onKeyDown: (x) => {
|
|
728
|
+
x.key === "Enter" && l(), x.key === "Escape" && f();
|
|
517
729
|
},
|
|
518
|
-
onClick: (
|
|
730
|
+
onClick: (x) => x.stopPropagation(),
|
|
519
731
|
style: { ...a, cursor: "pointer" },
|
|
520
|
-
children: (n.options ?? []).map((
|
|
732
|
+
children: (n.options ?? []).map((x) => /* @__PURE__ */ t("option", { value: x, children: x }, x))
|
|
521
733
|
}
|
|
522
734
|
);
|
|
523
735
|
if (h === "combobox") return /* @__PURE__ */ t(
|
|
524
|
-
|
|
736
|
+
Lt,
|
|
525
737
|
{
|
|
526
738
|
options: n.options ?? [],
|
|
527
739
|
value: o,
|
|
528
740
|
onChange: d,
|
|
529
|
-
onCommit:
|
|
741
|
+
onCommit: l,
|
|
530
742
|
onCancel: f
|
|
531
743
|
}
|
|
532
744
|
);
|
|
@@ -537,345 +749,345 @@ function Lt(n, o, d, s, f) {
|
|
|
537
749
|
autoFocus: !0,
|
|
538
750
|
type: u,
|
|
539
751
|
value: o,
|
|
540
|
-
onChange: (
|
|
541
|
-
onBlur:
|
|
542
|
-
onKeyDown: (
|
|
543
|
-
|
|
752
|
+
onChange: (x) => d(x.target.value),
|
|
753
|
+
onBlur: l,
|
|
754
|
+
onKeyDown: (x) => {
|
|
755
|
+
x.key === "Enter" && l(), x.key === "Escape" && f();
|
|
544
756
|
},
|
|
545
|
-
onClick: (
|
|
757
|
+
onClick: (x) => x.stopPropagation(),
|
|
546
758
|
style: a
|
|
547
759
|
}
|
|
548
760
|
);
|
|
549
761
|
}
|
|
550
|
-
function
|
|
762
|
+
function Ut({
|
|
551
763
|
columns: n,
|
|
552
764
|
data: o = [],
|
|
553
765
|
height: d = 400,
|
|
554
|
-
rowHeight:
|
|
766
|
+
rowHeight: l = 40,
|
|
555
767
|
headerRowHeight: f = 40,
|
|
556
768
|
footerRowHeight: a = 40,
|
|
557
769
|
sortable: h = !0,
|
|
558
770
|
resizable: u = !0,
|
|
559
|
-
editable:
|
|
560
|
-
stripe:
|
|
771
|
+
editable: x = !1,
|
|
772
|
+
stripe: w = !1,
|
|
561
773
|
autoWidth: r = !1,
|
|
562
774
|
keyNavigation: i = !1,
|
|
563
775
|
selection: c,
|
|
564
776
|
multiselect: m,
|
|
565
|
-
leftSplit:
|
|
566
|
-
onSelect:
|
|
567
|
-
onChange:
|
|
568
|
-
style:
|
|
777
|
+
leftSplit: S = 0,
|
|
778
|
+
onSelect: s,
|
|
779
|
+
onChange: b,
|
|
780
|
+
style: M
|
|
569
781
|
}) {
|
|
570
|
-
var
|
|
571
|
-
const [
|
|
572
|
-
() => Object.fromEntries(n.map((
|
|
573
|
-
), [
|
|
574
|
-
|
|
575
|
-
if (!r || !
|
|
576
|
-
const
|
|
577
|
-
var
|
|
578
|
-
return
|
|
782
|
+
var Ce;
|
|
783
|
+
const [D, R] = N(null), [z, C] = N("asc"), [F, p] = N({}), [I, W] = N(/* @__PURE__ */ new Set()), [v, X] = N(-1), [J, se] = N(
|
|
784
|
+
() => Object.fromEntries(n.map((y) => [y.id, y.width ?? y.minWidth ?? 150]))
|
|
785
|
+
), [U, ie] = N(null), [E, $] = N(""), [j, k] = N({}), P = oe(null), [O, G] = N(0);
|
|
786
|
+
_(q, []), _(() => {
|
|
787
|
+
if (!r || !P.current) return;
|
|
788
|
+
const y = new ResizeObserver(() => {
|
|
789
|
+
var L;
|
|
790
|
+
return G(((L = P.current) == null ? void 0 : L.offsetWidth) ?? 0);
|
|
579
791
|
});
|
|
580
|
-
return
|
|
792
|
+
return y.observe(P.current), () => y.disconnect();
|
|
581
793
|
}, [r]);
|
|
582
|
-
const
|
|
794
|
+
const K = ue(
|
|
583
795
|
() => n.map(
|
|
584
|
-
(
|
|
796
|
+
(y) => y.summary && (!y.footer || y.footer.length === 0) ? { ...y, footer: [{ summary: y.summary }] } : y
|
|
585
797
|
),
|
|
586
798
|
[n]
|
|
587
|
-
),
|
|
588
|
-
() =>
|
|
589
|
-
[
|
|
590
|
-
),
|
|
591
|
-
if (!r ||
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
594
|
-
const
|
|
595
|
-
return Object.fromEntries(
|
|
596
|
-
}, [r,
|
|
597
|
-
let
|
|
598
|
-
const A = String(
|
|
599
|
-
return
|
|
799
|
+
), V = ue(
|
|
800
|
+
() => K.filter((y) => !y.hidden),
|
|
801
|
+
[K]
|
|
802
|
+
), Q = ue(() => {
|
|
803
|
+
if (!r || O === 0) return J;
|
|
804
|
+
const y = V.reduce((T, A) => T + (J[A.id] ?? 150), 0);
|
|
805
|
+
if (O <= y) return J;
|
|
806
|
+
const L = (O - y) / V.length;
|
|
807
|
+
return Object.fromEntries(V.map((T) => [T.id, (J[T.id] ?? 150) + L]));
|
|
808
|
+
}, [r, O, J, V]), Z = ue(() => {
|
|
809
|
+
let y = o.map((L, T) => {
|
|
810
|
+
const A = String(L.id ?? T);
|
|
811
|
+
return j[A] ? { ...L, ...j[A] } : L;
|
|
600
812
|
}).filter(
|
|
601
|
-
(
|
|
602
|
-
([
|
|
813
|
+
(L) => Object.entries(F).every(
|
|
814
|
+
([T, A]) => !A || String(L[T] ?? "").toLowerCase().includes(A.toLowerCase())
|
|
603
815
|
)
|
|
604
816
|
);
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
const
|
|
609
|
-
return
|
|
817
|
+
if (D) {
|
|
818
|
+
const L = K.find((T) => T.id === D);
|
|
819
|
+
y = [...y].sort((T, A) => {
|
|
820
|
+
const Y = Tt(T[D], A[D], L == null ? void 0 : L.type);
|
|
821
|
+
return z === "asc" ? Y : -Y;
|
|
610
822
|
});
|
|
611
823
|
}
|
|
612
|
-
return
|
|
613
|
-
}, [o,
|
|
614
|
-
const
|
|
615
|
-
return
|
|
616
|
-
var
|
|
617
|
-
if ((
|
|
618
|
-
const A = Z.map((B) => Number(B[
|
|
619
|
-
|
|
824
|
+
return y;
|
|
825
|
+
}, [o, D, z, F, j, K]), fe = ue(() => {
|
|
826
|
+
const y = {};
|
|
827
|
+
return K.forEach((L) => {
|
|
828
|
+
var T;
|
|
829
|
+
if ((T = L.footer) != null && T.some((A) => A.summary)) {
|
|
830
|
+
const A = Z.map((B) => Number(B[L.id])).filter((B) => !isNaN(B)), Y = A.reduce((B, ee) => B + ee, 0);
|
|
831
|
+
y[L.id] = { sum: Y, avg: A.length ? Y / A.length : 0, count: Z.length, min: A.length ? Math.min(...A) : 0, max: A.length ? Math.max(...A) : 0 };
|
|
620
832
|
}
|
|
621
|
-
}),
|
|
622
|
-
}, [Z,
|
|
623
|
-
const
|
|
624
|
-
return
|
|
625
|
-
const
|
|
626
|
-
return
|
|
627
|
-
}).forEach((
|
|
628
|
-
|
|
629
|
-
}),
|
|
630
|
-
}, [o,
|
|
631
|
-
var
|
|
632
|
-
return (
|
|
633
|
-
}),
|
|
634
|
-
if (!
|
|
635
|
-
let
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
-
A <
|
|
639
|
-
}),
|
|
640
|
-
}, [
|
|
641
|
-
!h ||
|
|
642
|
-
},
|
|
833
|
+
}), y;
|
|
834
|
+
}, [Z, K]), ne = ue(() => {
|
|
835
|
+
const y = {};
|
|
836
|
+
return V.filter((L) => {
|
|
837
|
+
const T = Se(L);
|
|
838
|
+
return T === "selectFilter" || T === "comboFilter";
|
|
839
|
+
}).forEach((L) => {
|
|
840
|
+
y[L.id] = [...new Set(o.map((T) => String(T[L.id] ?? "")))].sort();
|
|
841
|
+
}), y;
|
|
842
|
+
}, [o, V]), H = V.some((y) => Se(y) !== null), de = K.some((y) => {
|
|
843
|
+
var L;
|
|
844
|
+
return (L = y.footer) == null ? void 0 : L.length;
|
|
845
|
+
}), me = V.reduce((y, L) => y + (Q[L.id] ?? 150), 0), ce = ue(() => {
|
|
846
|
+
if (!S) return {};
|
|
847
|
+
let y = 0;
|
|
848
|
+
const L = {};
|
|
849
|
+
return V.forEach((T, A) => {
|
|
850
|
+
A < S && (L[T.id] = y, y += Q[T.id] ?? 150);
|
|
851
|
+
}), L;
|
|
852
|
+
}, [S, V, Q]), le = S > 0 ? (Ce = V[S - 1]) == null ? void 0 : Ce.id : null, ye = (y, L) => y.id ?? L, Xe = (y) => {
|
|
853
|
+
!h || y.sortable === !1 || (C((L) => D === y.id && L === "asc" ? "desc" : "asc"), R(y.id));
|
|
854
|
+
}, ve = (y, L) => {
|
|
643
855
|
if (!c) return;
|
|
644
|
-
const
|
|
645
|
-
X(
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
}),
|
|
856
|
+
const T = ye(y, L);
|
|
857
|
+
X(L), W((A) => {
|
|
858
|
+
const Y = m ? new Set(A) : /* @__PURE__ */ new Set();
|
|
859
|
+
return Y.has(T) ? Y.delete(T) : Y.add(T), Y;
|
|
860
|
+
}), s == null || s(y);
|
|
649
861
|
}, qe = () => {
|
|
650
|
-
if (!
|
|
651
|
-
const { key:
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
}, Ge = (
|
|
656
|
-
if (
|
|
862
|
+
if (!U) return;
|
|
863
|
+
const { key: y, colId: L } = U;
|
|
864
|
+
k((A) => ({ ...A, [String(y)]: { ...A[String(y)] || {}, [L]: E } }));
|
|
865
|
+
const T = Z.find((A, Y) => ye(A, Y) === y);
|
|
866
|
+
T && (b == null || b(T, L, E)), ie(null);
|
|
867
|
+
}, Ge = (y) => {
|
|
868
|
+
if (U && y.key === "Escape") {
|
|
657
869
|
ie(null);
|
|
658
870
|
return;
|
|
659
871
|
}
|
|
660
872
|
if (!(!i || !c)) {
|
|
661
|
-
if (
|
|
662
|
-
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
} else if (
|
|
666
|
-
|
|
667
|
-
const
|
|
668
|
-
|
|
873
|
+
if (y.key === "ArrowDown") {
|
|
874
|
+
y.preventDefault();
|
|
875
|
+
const L = Math.min(v + 1, Z.length - 1);
|
|
876
|
+
L >= 0 && ve(Z[L], L);
|
|
877
|
+
} else if (y.key === "ArrowUp") {
|
|
878
|
+
y.preventDefault();
|
|
879
|
+
const L = Math.max(v - 1, 0);
|
|
880
|
+
L >= 0 && ve(Z[L], L);
|
|
669
881
|
}
|
|
670
882
|
}
|
|
671
|
-
}, Je = (
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
...
|
|
675
|
-
[
|
|
676
|
-
})),
|
|
677
|
-
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup",
|
|
883
|
+
}, Je = (y, L) => {
|
|
884
|
+
y.preventDefault(), y.stopPropagation();
|
|
885
|
+
const T = y.clientX, A = J[L] ?? 150, Y = n.find((te) => te.id === L), B = (te) => se((pe) => ({
|
|
886
|
+
...pe,
|
|
887
|
+
[L]: Math.max((Y == null ? void 0 : Y.minWidth) || 50, A + te.clientX - T)
|
|
888
|
+
})), ee = () => {
|
|
889
|
+
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", ee);
|
|
678
890
|
};
|
|
679
|
-
document.addEventListener("mousemove", B), document.addEventListener("mouseup",
|
|
680
|
-
},
|
|
681
|
-
const
|
|
891
|
+
document.addEventListener("mousemove", B), document.addEventListener("mouseup", ee);
|
|
892
|
+
}, ke = (y, L, T, A, Y, B = "hidden") => {
|
|
893
|
+
const ee = y in ce;
|
|
682
894
|
return {
|
|
683
|
-
width:
|
|
684
|
-
minWidth:
|
|
895
|
+
width: L,
|
|
896
|
+
minWidth: L,
|
|
685
897
|
flexShrink: 0,
|
|
686
898
|
boxSizing: "border-box",
|
|
687
899
|
padding: "0 12px",
|
|
688
|
-
height:
|
|
900
|
+
height: Y,
|
|
689
901
|
display: "flex",
|
|
690
902
|
alignItems: "center",
|
|
691
903
|
overflow: B,
|
|
692
904
|
textOverflow: "ellipsis",
|
|
693
905
|
whiteSpace: "nowrap",
|
|
694
906
|
fontSize: 13,
|
|
695
|
-
textAlign:
|
|
696
|
-
justifyContent:
|
|
697
|
-
borderLeft: A ? "none" :
|
|
698
|
-
position:
|
|
699
|
-
...
|
|
700
|
-
left:
|
|
907
|
+
textAlign: T,
|
|
908
|
+
justifyContent: T === "center" ? "center" : T === "right" ? "flex-end" : "flex-start",
|
|
909
|
+
borderLeft: A ? "none" : he,
|
|
910
|
+
position: ee ? "sticky" : "relative",
|
|
911
|
+
...ee ? {
|
|
912
|
+
left: ce[y],
|
|
701
913
|
zIndex: 1,
|
|
702
|
-
boxShadow:
|
|
914
|
+
boxShadow: y === le ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
|
|
703
915
|
} : {}
|
|
704
916
|
};
|
|
705
917
|
};
|
|
706
918
|
return /* @__PURE__ */ t(
|
|
707
919
|
"div",
|
|
708
920
|
{
|
|
709
|
-
ref:
|
|
921
|
+
ref: P,
|
|
710
922
|
className: "dhx",
|
|
711
923
|
tabIndex: i ? 0 : void 0,
|
|
712
924
|
onKeyDown: Ge,
|
|
713
|
-
style: { width: "100%", height: d, display: "flex", flexDirection: "column", border:
|
|
714
|
-
children: /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { overflow: "auto", flex: 1 }, children: /* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom:
|
|
716
|
-
const
|
|
717
|
-
return /* @__PURE__ */
|
|
925
|
+
style: { width: "100%", height: d, display: "flex", flexDirection: "column", border: he, borderRadius: e.r, overflow: "hidden", outline: "none", ...M },
|
|
926
|
+
children: /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { overflow: "auto", flex: 1 }, children: /* @__PURE__ */ g("div", { style: { minWidth: me, display: "flex", flexDirection: "column", minHeight: "100%" }, children: [
|
|
927
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: he, flexShrink: 0, position: "sticky", top: 0, zIndex: 3 }, children: V.map((y, L) => {
|
|
928
|
+
const T = Array.isArray(y.header) ? y.header[0] : null, A = (T == null ? void 0 : T.text) ?? (typeof y.header == "string" ? y.header : y.id), Y = (T == null ? void 0 : T.align) ?? y.align, B = Q[y.id] ?? 150, ee = y.id in ce;
|
|
929
|
+
return /* @__PURE__ */ g(
|
|
718
930
|
"div",
|
|
719
931
|
{
|
|
720
|
-
onClick: () => Xe(
|
|
932
|
+
onClick: () => Xe(y),
|
|
721
933
|
style: {
|
|
722
|
-
...
|
|
934
|
+
...ke(y.id, B, Y, L === 0, f),
|
|
723
935
|
fontWeight: 500,
|
|
724
936
|
color: e.text,
|
|
725
937
|
background: e.bg,
|
|
726
|
-
cursor: h &&
|
|
938
|
+
cursor: h && y.sortable !== !1 ? "pointer" : "default",
|
|
727
939
|
userSelect: "none",
|
|
728
|
-
...
|
|
940
|
+
...ee ? { zIndex: 4 } : {}
|
|
729
941
|
},
|
|
730
942
|
children: [
|
|
731
|
-
|
|
732
|
-
h &&
|
|
733
|
-
u &&
|
|
943
|
+
T != null && T.htmlEnable ? /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden" }, dangerouslySetInnerHTML: { __html: A } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: A }),
|
|
944
|
+
h && y.sortable !== !1 && /* @__PURE__ */ t(Ct, { active: D === y.id, dir: z }),
|
|
945
|
+
u && y.resizable !== !1 && L < V.length - 1 && /* @__PURE__ */ t(
|
|
734
946
|
"div",
|
|
735
947
|
{
|
|
736
|
-
onMouseDown: (
|
|
737
|
-
onClick: (
|
|
948
|
+
onMouseDown: (te) => Je(te, y.id),
|
|
949
|
+
onClick: (te) => te.stopPropagation(),
|
|
738
950
|
style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
|
|
739
|
-
onMouseEnter: (
|
|
740
|
-
onMouseLeave: (
|
|
951
|
+
onMouseEnter: (te) => te.currentTarget.style.background = e.primary + "55",
|
|
952
|
+
onMouseLeave: (te) => te.currentTarget.style.background = "transparent"
|
|
741
953
|
}
|
|
742
954
|
)
|
|
743
955
|
]
|
|
744
956
|
},
|
|
745
|
-
|
|
957
|
+
y.id
|
|
746
958
|
);
|
|
747
959
|
}) }),
|
|
748
|
-
|
|
960
|
+
H && /* @__PURE__ */ t("div", { style: {
|
|
749
961
|
display: "flex",
|
|
750
|
-
borderBottom:
|
|
962
|
+
borderBottom: he,
|
|
751
963
|
background: e.surface,
|
|
752
964
|
flexShrink: 0,
|
|
753
|
-
...
|
|
754
|
-
}, children:
|
|
755
|
-
const
|
|
965
|
+
...S ? { position: "sticky", top: f, zIndex: 3 } : {}
|
|
966
|
+
}, children: V.map((y, L) => {
|
|
967
|
+
const T = Se(y), A = Q[y.id] ?? 150, Y = y.id in ce;
|
|
756
968
|
return /* @__PURE__ */ t("div", { style: {
|
|
757
969
|
width: A,
|
|
758
970
|
minWidth: A,
|
|
759
971
|
flexShrink: 0,
|
|
760
972
|
padding: "4px 6px",
|
|
761
973
|
boxSizing: "border-box",
|
|
762
|
-
borderLeft:
|
|
974
|
+
borderLeft: L === 0 ? "none" : he,
|
|
763
975
|
background: e.surface,
|
|
764
|
-
...
|
|
976
|
+
...Y ? {
|
|
765
977
|
position: "sticky",
|
|
766
|
-
left:
|
|
978
|
+
left: ce[y.id],
|
|
767
979
|
zIndex: 4,
|
|
768
|
-
boxShadow:
|
|
980
|
+
boxShadow: y.id === le ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
|
|
769
981
|
} : {}
|
|
770
|
-
}, children:
|
|
982
|
+
}, children: T === "selectFilter" || T === "comboFilter" ? /* @__PURE__ */ g(
|
|
771
983
|
"select",
|
|
772
984
|
{
|
|
773
985
|
className: "dhx dhx-input",
|
|
774
986
|
style: { height: 26, fontSize: 12, padding: "0 4px" },
|
|
775
|
-
value:
|
|
776
|
-
onChange: (B) => p((
|
|
987
|
+
value: F[y.id] || "",
|
|
988
|
+
onChange: (B) => p((ee) => ({ ...ee, [y.id]: B.target.value })),
|
|
777
989
|
children: [
|
|
778
990
|
/* @__PURE__ */ t("option", { value: "", children: "All" }),
|
|
779
|
-
(
|
|
991
|
+
(ne[y.id] || []).map((B) => /* @__PURE__ */ t("option", { value: B, children: B }, B))
|
|
780
992
|
]
|
|
781
993
|
}
|
|
782
|
-
) :
|
|
994
|
+
) : T === "inputFilter" ? /* @__PURE__ */ t(
|
|
783
995
|
"input",
|
|
784
996
|
{
|
|
785
997
|
className: "dhx dhx-input",
|
|
786
998
|
style: { height: 26, fontSize: 12 },
|
|
787
999
|
placeholder: "Filter...",
|
|
788
|
-
value:
|
|
789
|
-
onChange: (B) => p((
|
|
1000
|
+
value: F[y.id] || "",
|
|
1001
|
+
onChange: (B) => p((ee) => ({ ...ee, [y.id]: B.target.value }))
|
|
790
1002
|
}
|
|
791
|
-
) : null },
|
|
1003
|
+
) : null }, y.id);
|
|
792
1004
|
}) }),
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
Z.map((
|
|
795
|
-
const
|
|
1005
|
+
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
1006
|
+
Z.map((y, L) => {
|
|
1007
|
+
const T = ye(y, L), A = I.has(T), Y = A ? e.primaryLt : w && L % 2 !== 0 ? e.bg : e.surface;
|
|
796
1008
|
return /* @__PURE__ */ t(
|
|
797
1009
|
"div",
|
|
798
1010
|
{
|
|
799
|
-
style: { display: "flex", height:
|
|
1011
|
+
style: { display: "flex", height: l, borderBottom: he, flexShrink: 0, background: Y, transition: "background .1s", cursor: c ? "pointer" : "default" },
|
|
800
1012
|
onMouseEnter: (B) => !A && (B.currentTarget.style.background = e.primaryLt + "80"),
|
|
801
|
-
onMouseLeave: (B) => !A && (B.currentTarget.style.background =
|
|
802
|
-
children:
|
|
803
|
-
const
|
|
804
|
-
let
|
|
805
|
-
return
|
|
1013
|
+
onMouseLeave: (B) => !A && (B.currentTarget.style.background = Y),
|
|
1014
|
+
children: V.map((B, ee) => {
|
|
1015
|
+
const te = (U == null ? void 0 : U.key) === T && (U == null ? void 0 : U.colId) === B.id, pe = y[B.id], Ue = Q[B.id] ?? 150, Le = (x || B.editable) && B.editable !== !1;
|
|
1016
|
+
let xe;
|
|
1017
|
+
return te ? xe = Nt(B, E, $, qe, () => ie(null)) : B.template ? xe = B.template(pe, y) : B.htmlEnable ? xe = /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: String(pe ?? "") } }) : B.type === "boolean" ? xe = /* @__PURE__ */ t(
|
|
806
1018
|
"input",
|
|
807
1019
|
{
|
|
808
1020
|
type: "checkbox",
|
|
809
1021
|
readOnly: !0,
|
|
810
|
-
checked: !!
|
|
811
|
-
style: { width: 16, height: 16, accentColor: e.primary, cursor:
|
|
1022
|
+
checked: !!pe,
|
|
1023
|
+
style: { width: 16, height: 16, accentColor: e.primary, cursor: Le ? "pointer" : "default" }
|
|
812
1024
|
}
|
|
813
|
-
) :
|
|
1025
|
+
) : xe = It(pe, B.type), /* @__PURE__ */ t(
|
|
814
1026
|
"div",
|
|
815
1027
|
{
|
|
816
1028
|
onClick: () => {
|
|
817
|
-
if (
|
|
1029
|
+
if (ve(y, L), !!Le)
|
|
818
1030
|
if (B.type === "boolean") {
|
|
819
|
-
const
|
|
820
|
-
|
|
1031
|
+
const Ie = !pe, Te = String(T);
|
|
1032
|
+
k((Ne) => ({ ...Ne, [Te]: { ...Ne[Te] || {}, [B.id]: Ie } })), b == null || b(y, B.id, Ie);
|
|
821
1033
|
} else
|
|
822
|
-
ie({ key:
|
|
1034
|
+
ie({ key: T, colId: B.id }), $(String(pe ?? ""));
|
|
823
1035
|
},
|
|
824
|
-
style: { ...
|
|
825
|
-
children:
|
|
1036
|
+
style: { ...ke(B.id, Ue, B.align, ee === 0, l, te ? "visible" : "hidden"), background: Y },
|
|
1037
|
+
children: xe
|
|
826
1038
|
},
|
|
827
1039
|
B.id
|
|
828
1040
|
);
|
|
829
1041
|
})
|
|
830
1042
|
},
|
|
831
|
-
String(
|
|
1043
|
+
String(T)
|
|
832
1044
|
);
|
|
833
1045
|
}),
|
|
834
1046
|
Z.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
|
|
835
1047
|
] }),
|
|
836
|
-
de && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop:
|
|
837
|
-
var
|
|
838
|
-
const
|
|
839
|
-
let
|
|
840
|
-
|
|
841
|
-
const B =
|
|
1048
|
+
de && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: he, background: e.bg, flexShrink: 0, position: "sticky", bottom: 0, zIndex: 2 }, children: V.map((y, L) => {
|
|
1049
|
+
var te;
|
|
1050
|
+
const T = (te = y.footer) == null ? void 0 : te[0], A = fe[y.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
|
|
1051
|
+
let Y = "";
|
|
1052
|
+
T && (typeof T.text == "function" ? Y = T.text(A) : T.text ? Y = T.text : T.summary && (Y = String(Math.round(A[T.summary] * 100) / 100)));
|
|
1053
|
+
const B = Q[y.id] ?? 150, ee = y.id in ce;
|
|
842
1054
|
return /* @__PURE__ */ t("div", { style: {
|
|
843
|
-
...
|
|
1055
|
+
...ke(y.id, B, y.align, L === 0, a),
|
|
844
1056
|
fontWeight: 600,
|
|
845
1057
|
color: e.text,
|
|
846
1058
|
background: e.bg,
|
|
847
|
-
...
|
|
848
|
-
}, children:
|
|
1059
|
+
...ee ? { zIndex: 3 } : {}
|
|
1060
|
+
}, children: Y }, y.id);
|
|
849
1061
|
}) })
|
|
850
1062
|
] }) })
|
|
851
1063
|
}
|
|
852
1064
|
);
|
|
853
1065
|
}
|
|
854
|
-
const
|
|
855
|
-
function
|
|
856
|
-
const
|
|
857
|
-
return
|
|
1066
|
+
const re = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
|
|
1067
|
+
function Et(n, o, d) {
|
|
1068
|
+
const l = n.filter((a) => !a.parent), f = n.filter((a) => !!a.parent);
|
|
1069
|
+
return l.map((a) => ({
|
|
858
1070
|
name: a[d],
|
|
859
1071
|
children: f.filter((h) => h.parent === a.id).map((h) => ({ name: h[d], value: Number(h[o] ?? 0) }))
|
|
860
1072
|
}));
|
|
861
1073
|
}
|
|
862
|
-
function
|
|
1074
|
+
function Qt({
|
|
863
1075
|
type: n = "bar",
|
|
864
1076
|
data: o = [],
|
|
865
1077
|
series: d = [],
|
|
866
|
-
scales:
|
|
1078
|
+
scales: l = {},
|
|
867
1079
|
legend: f,
|
|
868
1080
|
height: a = 280,
|
|
869
1081
|
style: h
|
|
870
1082
|
}) {
|
|
871
|
-
var
|
|
872
|
-
|
|
873
|
-
const u = ((
|
|
1083
|
+
var b, M, D, R, z, C, F, p, I, W, v, X, J, se, U, ie;
|
|
1084
|
+
_(q, []);
|
|
1085
|
+
const u = ((b = l.bottom) == null ? void 0 : b.text) || o[0] && Object.keys(o[0])[0] || "x", x = /* @__PURE__ */ t(
|
|
874
1086
|
et,
|
|
875
1087
|
{
|
|
876
1088
|
contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` }
|
|
877
1089
|
}
|
|
878
|
-
),
|
|
1090
|
+
), w = f ? /* @__PURE__ */ t(
|
|
879
1091
|
tt,
|
|
880
1092
|
{
|
|
881
1093
|
iconSize: 10,
|
|
@@ -884,98 +1096,98 @@ function Gt({
|
|
|
884
1096
|
align: f.halign ?? "center"
|
|
885
1097
|
}
|
|
886
1098
|
) : null, r = /* @__PURE__ */ t(nt, { strokeDasharray: "3 3", stroke: e.border }), i = /* @__PURE__ */ t(
|
|
887
|
-
|
|
1099
|
+
Ee,
|
|
888
1100
|
{
|
|
889
1101
|
dataKey: u,
|
|
890
1102
|
tick: { fontSize: 11, fill: e.textSec },
|
|
891
1103
|
axisLine: { stroke: e.border },
|
|
892
1104
|
tickLine: !1,
|
|
893
|
-
label: (
|
|
1105
|
+
label: (M = l.bottom) != null && M.title ? { value: l.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
|
|
894
1106
|
}
|
|
895
1107
|
), c = /* @__PURE__ */ t(
|
|
896
|
-
|
|
1108
|
+
Re,
|
|
897
1109
|
{
|
|
898
1110
|
tick: { fontSize: 11, fill: e.textSec },
|
|
899
1111
|
axisLine: !1,
|
|
900
1112
|
tickLine: !1,
|
|
901
|
-
domain: [((
|
|
902
|
-
tickCount: (
|
|
903
|
-
label: (
|
|
1113
|
+
domain: [((D = l.left) == null ? void 0 : D.min) ?? "auto", ((R = l.left) == null ? void 0 : R.max) ?? "auto"],
|
|
1114
|
+
tickCount: (z = l.left) == null ? void 0 : z.maxTicks,
|
|
1115
|
+
label: (C = l.left) != null && C.title ? { value: l.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
|
|
904
1116
|
}
|
|
905
1117
|
), m = {
|
|
906
1118
|
top: 10,
|
|
907
1119
|
right: 20,
|
|
908
1120
|
left: 0,
|
|
909
|
-
bottom: (
|
|
910
|
-
},
|
|
911
|
-
let
|
|
1121
|
+
bottom: (F = l.bottom) != null && F.title ? 20 : 0
|
|
1122
|
+
}, S = { data: o, margin: m };
|
|
1123
|
+
let s;
|
|
912
1124
|
if (n === "bar")
|
|
913
|
-
|
|
1125
|
+
s = /* @__PURE__ */ g(rt, { ...S, children: [
|
|
914
1126
|
r,
|
|
915
1127
|
i,
|
|
916
1128
|
c,
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
d.map((E,
|
|
1129
|
+
x,
|
|
1130
|
+
w,
|
|
1131
|
+
d.map((E, $) => /* @__PURE__ */ t(
|
|
920
1132
|
ot,
|
|
921
1133
|
{
|
|
922
1134
|
dataKey: E.value || E.id || "",
|
|
923
1135
|
name: E.label || E.id,
|
|
924
|
-
fill: E.fill || E.color ||
|
|
1136
|
+
fill: E.fill || E.color || re[$ % re.length],
|
|
925
1137
|
radius: [3, 3, 0, 0]
|
|
926
1138
|
},
|
|
927
|
-
E.id ??
|
|
1139
|
+
E.id ?? $
|
|
928
1140
|
))
|
|
929
1141
|
] });
|
|
930
1142
|
else if (n === "line")
|
|
931
|
-
|
|
1143
|
+
s = /* @__PURE__ */ g(it, { ...S, children: [
|
|
932
1144
|
r,
|
|
933
1145
|
i,
|
|
934
1146
|
c,
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
d.map((E,
|
|
938
|
-
const
|
|
1147
|
+
x,
|
|
1148
|
+
w,
|
|
1149
|
+
d.map((E, $) => {
|
|
1150
|
+
const j = E.color || re[$ % re.length];
|
|
939
1151
|
return /* @__PURE__ */ t(
|
|
940
1152
|
lt,
|
|
941
1153
|
{
|
|
942
1154
|
type: "monotone",
|
|
943
1155
|
dataKey: E.value || E.id || "",
|
|
944
1156
|
name: E.label || E.id,
|
|
945
|
-
stroke:
|
|
1157
|
+
stroke: j,
|
|
946
1158
|
strokeWidth: E.strokeWidth ?? 2,
|
|
947
|
-
dot: { r: 3, fill:
|
|
1159
|
+
dot: { r: 3, fill: j }
|
|
948
1160
|
},
|
|
949
|
-
E.id ??
|
|
1161
|
+
E.id ?? $
|
|
950
1162
|
);
|
|
951
1163
|
})
|
|
952
1164
|
] });
|
|
953
1165
|
else if (n === "area")
|
|
954
|
-
|
|
1166
|
+
s = /* @__PURE__ */ g(st, { ...S, children: [
|
|
955
1167
|
r,
|
|
956
1168
|
i,
|
|
957
1169
|
c,
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
d.map((E,
|
|
961
|
-
const
|
|
1170
|
+
x,
|
|
1171
|
+
w,
|
|
1172
|
+
d.map((E, $) => {
|
|
1173
|
+
const j = E.color || re[$ % re.length];
|
|
962
1174
|
return /* @__PURE__ */ t(
|
|
963
1175
|
at,
|
|
964
1176
|
{
|
|
965
1177
|
type: "monotone",
|
|
966
1178
|
dataKey: E.value || E.id || "",
|
|
967
1179
|
name: E.label || E.id,
|
|
968
|
-
stroke:
|
|
969
|
-
fill: (E.fill ||
|
|
1180
|
+
stroke: j,
|
|
1181
|
+
fill: (E.fill || j) + "33",
|
|
970
1182
|
strokeWidth: E.strokeWidth ?? 2
|
|
971
1183
|
},
|
|
972
|
-
E.id ??
|
|
1184
|
+
E.id ?? $
|
|
973
1185
|
);
|
|
974
1186
|
})
|
|
975
1187
|
] });
|
|
976
1188
|
else if (n === "pie" || n === "donut") {
|
|
977
|
-
const E = d[0] || {},
|
|
978
|
-
|
|
1189
|
+
const E = d[0] || {}, $ = E.value || "value", j = E.text || "name", k = E.color && o[0] && E.color in o[0] ? E.color : null;
|
|
1190
|
+
s = /* @__PURE__ */ g(dt, { children: [
|
|
979
1191
|
/* @__PURE__ */ t(
|
|
980
1192
|
ct,
|
|
981
1193
|
{
|
|
@@ -984,131 +1196,131 @@ function Gt({
|
|
|
984
1196
|
cy: "50%",
|
|
985
1197
|
outerRadius: n === "donut" ? "70%" : "80%",
|
|
986
1198
|
innerRadius: n === "donut" ? "40%" : 0,
|
|
987
|
-
dataKey:
|
|
988
|
-
nameKey:
|
|
1199
|
+
dataKey: $,
|
|
1200
|
+
nameKey: j,
|
|
989
1201
|
stroke: E.stroke || "none",
|
|
990
1202
|
strokeWidth: E.strokeWidth ?? 0,
|
|
991
|
-
label: ({ name:
|
|
1203
|
+
label: ({ name: P, percent: O }) => `${P ?? ""} ${((O ?? 0) * 100).toFixed(0)}%`,
|
|
992
1204
|
labelLine: !0,
|
|
993
1205
|
paddingAngle: 2,
|
|
994
|
-
children: o.map((
|
|
1206
|
+
children: o.map((P, O) => /* @__PURE__ */ t(
|
|
995
1207
|
ut,
|
|
996
1208
|
{
|
|
997
|
-
fill:
|
|
1209
|
+
fill: k ? P[k] : re[O % re.length]
|
|
998
1210
|
},
|
|
999
|
-
|
|
1211
|
+
O
|
|
1000
1212
|
))
|
|
1001
1213
|
}
|
|
1002
1214
|
),
|
|
1003
|
-
|
|
1004
|
-
|
|
1215
|
+
x,
|
|
1216
|
+
w
|
|
1005
1217
|
] });
|
|
1006
1218
|
} else if (n === "radar") {
|
|
1007
|
-
const E = ((p =
|
|
1008
|
-
|
|
1219
|
+
const E = ((p = l.radial) == null ? void 0 : p.value) || u;
|
|
1220
|
+
s = /* @__PURE__ */ g(pt, { ...S, cx: "50%", cy: "50%", children: [
|
|
1009
1221
|
/* @__PURE__ */ t(ht, {}),
|
|
1010
1222
|
/* @__PURE__ */ t(ft, { dataKey: E, tick: { fontSize: 11 } }),
|
|
1011
1223
|
/* @__PURE__ */ t(xt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
|
|
1012
|
-
d.map((
|
|
1013
|
-
const
|
|
1224
|
+
d.map(($, j) => {
|
|
1225
|
+
const k = $.color || $.pointColor || re[j % re.length];
|
|
1014
1226
|
return /* @__PURE__ */ t(
|
|
1015
1227
|
gt,
|
|
1016
1228
|
{
|
|
1017
|
-
dataKey:
|
|
1018
|
-
name:
|
|
1019
|
-
stroke:
|
|
1020
|
-
fill:
|
|
1229
|
+
dataKey: $.value || $.id || "",
|
|
1230
|
+
name: $.label || $.id,
|
|
1231
|
+
stroke: k,
|
|
1232
|
+
fill: k + "44"
|
|
1021
1233
|
},
|
|
1022
|
-
|
|
1234
|
+
$.id ?? j
|
|
1023
1235
|
);
|
|
1024
1236
|
}),
|
|
1025
|
-
|
|
1026
|
-
|
|
1237
|
+
x,
|
|
1238
|
+
w
|
|
1027
1239
|
] });
|
|
1028
1240
|
} else if (n === "scatter")
|
|
1029
|
-
|
|
1241
|
+
s = /* @__PURE__ */ g(yt, { margin: m, children: [
|
|
1030
1242
|
r,
|
|
1031
1243
|
/* @__PURE__ */ t(
|
|
1032
|
-
|
|
1244
|
+
Ee,
|
|
1033
1245
|
{
|
|
1034
1246
|
type: "number",
|
|
1035
1247
|
dataKey: "x",
|
|
1036
|
-
name: ((
|
|
1248
|
+
name: ((I = l.bottom) == null ? void 0 : I.title) || "x",
|
|
1037
1249
|
tick: { fontSize: 11, fill: e.textSec },
|
|
1038
1250
|
tickLine: !1,
|
|
1039
|
-
domain: [((
|
|
1040
|
-
label: (X =
|
|
1251
|
+
domain: [((W = l.bottom) == null ? void 0 : W.min) ?? "auto", ((v = l.bottom) == null ? void 0 : v.max) ?? "auto"],
|
|
1252
|
+
label: (X = l.bottom) != null && X.title ? { value: l.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
|
|
1041
1253
|
}
|
|
1042
1254
|
),
|
|
1043
1255
|
/* @__PURE__ */ t(
|
|
1044
|
-
|
|
1256
|
+
Re,
|
|
1045
1257
|
{
|
|
1046
1258
|
type: "number",
|
|
1047
1259
|
dataKey: "y",
|
|
1048
|
-
name: ((
|
|
1260
|
+
name: ((J = l.left) == null ? void 0 : J.title) || "y",
|
|
1049
1261
|
tick: { fontSize: 11, fill: e.textSec },
|
|
1050
1262
|
tickLine: !1,
|
|
1051
1263
|
axisLine: !1,
|
|
1052
|
-
domain: [((se =
|
|
1053
|
-
label: (ie =
|
|
1264
|
+
domain: [((se = l.left) == null ? void 0 : se.min) ?? "auto", ((U = l.left) == null ? void 0 : U.max) ?? "auto"],
|
|
1265
|
+
label: (ie = l.left) != null && ie.title ? { value: l.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
|
|
1054
1266
|
}
|
|
1055
1267
|
),
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
d.map((E,
|
|
1059
|
-
const
|
|
1060
|
-
x:
|
|
1061
|
-
y:
|
|
1268
|
+
x,
|
|
1269
|
+
w,
|
|
1270
|
+
d.map((E, $) => {
|
|
1271
|
+
const j = E.value || "x", k = E.valueY || "y", P = (E.data || o).map((O) => ({
|
|
1272
|
+
x: O[j],
|
|
1273
|
+
y: O[k]
|
|
1062
1274
|
}));
|
|
1063
1275
|
return /* @__PURE__ */ t(
|
|
1064
1276
|
bt,
|
|
1065
1277
|
{
|
|
1066
|
-
data:
|
|
1278
|
+
data: P,
|
|
1067
1279
|
name: E.label || E.id,
|
|
1068
|
-
fill: E.color ||
|
|
1280
|
+
fill: E.color || re[$ % re.length]
|
|
1069
1281
|
},
|
|
1070
|
-
E.id ??
|
|
1282
|
+
E.id ?? $
|
|
1071
1283
|
);
|
|
1072
1284
|
})
|
|
1073
1285
|
] });
|
|
1074
1286
|
else if (n === "treeMap") {
|
|
1075
|
-
const E = d[0] || {},
|
|
1076
|
-
|
|
1287
|
+
const E = d[0] || {}, $ = E.value || "value", j = E.text || "name", k = Et(o, $, j), P = E.stroke || e.surface, O = E.strokeWidth ?? 2;
|
|
1288
|
+
s = /* @__PURE__ */ t(
|
|
1077
1289
|
vt,
|
|
1078
1290
|
{
|
|
1079
|
-
data:
|
|
1291
|
+
data: k,
|
|
1080
1292
|
dataKey: "value",
|
|
1081
1293
|
aspectRatio: 4 / 3,
|
|
1082
|
-
stroke:
|
|
1083
|
-
content: (
|
|
1084
|
-
const { x:
|
|
1085
|
-
if (
|
|
1086
|
-
const de =
|
|
1087
|
-
return /* @__PURE__ */
|
|
1294
|
+
stroke: P,
|
|
1295
|
+
content: (G) => {
|
|
1296
|
+
const { x: K, y: V, width: Q, height: Z, depth: fe, index: ne, name: H } = G;
|
|
1297
|
+
if (fe === 0) return null;
|
|
1298
|
+
const de = re[ne % re.length];
|
|
1299
|
+
return /* @__PURE__ */ g("g", { children: [
|
|
1088
1300
|
/* @__PURE__ */ t(
|
|
1089
1301
|
"rect",
|
|
1090
1302
|
{
|
|
1091
|
-
x:
|
|
1092
|
-
y:
|
|
1093
|
-
width:
|
|
1303
|
+
x: K,
|
|
1304
|
+
y: V,
|
|
1305
|
+
width: Q,
|
|
1094
1306
|
height: Z,
|
|
1095
1307
|
fill: de,
|
|
1096
|
-
stroke:
|
|
1097
|
-
strokeWidth:
|
|
1308
|
+
stroke: P,
|
|
1309
|
+
strokeWidth: O,
|
|
1098
1310
|
style: { borderRadius: 3 }
|
|
1099
1311
|
}
|
|
1100
1312
|
),
|
|
1101
|
-
|
|
1313
|
+
Q > 40 && Z > 20 && /* @__PURE__ */ t(
|
|
1102
1314
|
"text",
|
|
1103
1315
|
{
|
|
1104
|
-
x:
|
|
1105
|
-
y:
|
|
1316
|
+
x: K + Q / 2,
|
|
1317
|
+
y: V + Z / 2,
|
|
1106
1318
|
textAnchor: "middle",
|
|
1107
1319
|
dominantBaseline: "middle",
|
|
1108
1320
|
fill: "#fff",
|
|
1109
1321
|
fontSize: 11,
|
|
1110
1322
|
pointerEvents: "none",
|
|
1111
|
-
children:
|
|
1323
|
+
children: H
|
|
1112
1324
|
}
|
|
1113
1325
|
)
|
|
1114
1326
|
] });
|
|
@@ -1121,193 +1333,193 @@ function Gt({
|
|
|
1121
1333
|
{
|
|
1122
1334
|
className: "dhx",
|
|
1123
1335
|
style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...h },
|
|
1124
|
-
children: /* @__PURE__ */ t(mt, { width: "100%", height: "100%", children:
|
|
1336
|
+
children: /* @__PURE__ */ t(mt, { width: "100%", height: "100%", children: s })
|
|
1125
1337
|
}
|
|
1126
1338
|
);
|
|
1127
1339
|
}
|
|
1128
|
-
const
|
|
1129
|
-
function
|
|
1130
|
-
const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [u,
|
|
1131
|
-
|
|
1132
|
-
const
|
|
1133
|
-
for (let p = 0; p <
|
|
1134
|
-
for (let p = 1; p <=
|
|
1135
|
-
const
|
|
1136
|
-
if (!
|
|
1137
|
-
if (o && Array.isArray(
|
|
1138
|
-
const [
|
|
1139
|
-
if (!
|
|
1140
|
-
const
|
|
1141
|
-
return
|
|
1340
|
+
const Rt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], Wt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
1341
|
+
function Zt({ value: n, range: o = !1, timepicker: d = !1, onChange: l, style: f }) {
|
|
1342
|
+
const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [u, x] = N(h), [w, r] = N(n ?? (o ? [null, null] : null)), [i, c] = N(null), [m, S] = N({ h: 0, m: 0 });
|
|
1343
|
+
_(q, []);
|
|
1344
|
+
const s = u.getFullYear(), b = u.getMonth(), M = new Date(s, b, 1).getDay(), D = new Date(s, b + 1, 0).getDate(), R = [];
|
|
1345
|
+
for (let p = 0; p < M; p++) R.push(null);
|
|
1346
|
+
for (let p = 1; p <= D; p++) R.push(new Date(s, b, p));
|
|
1347
|
+
const z = (p) => p.toDateString() === a.toDateString(), C = (p) => {
|
|
1348
|
+
if (!w) return !1;
|
|
1349
|
+
if (o && Array.isArray(w)) {
|
|
1350
|
+
const [I, W] = w;
|
|
1351
|
+
if (!I) return !1;
|
|
1352
|
+
const v = p.getTime();
|
|
1353
|
+
return W ? v >= I.getTime() && v <= W.getTime() : p.toDateString() === I.toDateString();
|
|
1142
1354
|
}
|
|
1143
|
-
return p.toDateString() ===
|
|
1144
|
-
},
|
|
1355
|
+
return p.toDateString() === w.toDateString();
|
|
1356
|
+
}, F = (p) => {
|
|
1145
1357
|
if (o) {
|
|
1146
|
-
const [
|
|
1147
|
-
if (!
|
|
1358
|
+
const [I, W] = Array.isArray(w) ? w : [null, null];
|
|
1359
|
+
if (!I || W)
|
|
1148
1360
|
r([p, null]);
|
|
1149
1361
|
else {
|
|
1150
|
-
const
|
|
1151
|
-
r(
|
|
1362
|
+
const v = p < I ? [p, I] : [I, p];
|
|
1363
|
+
r(v), l == null || l(v);
|
|
1152
1364
|
}
|
|
1153
1365
|
} else
|
|
1154
|
-
r(p),
|
|
1366
|
+
r(p), l == null || l(p);
|
|
1155
1367
|
};
|
|
1156
|
-
return /* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
|
|
1368
|
+
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, ...f }, children: [
|
|
1369
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
|
|
1370
|
+
/* @__PURE__ */ t("button", { onClick: () => x((p) => new Date(p.getFullYear(), p.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
|
|
1371
|
+
/* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
|
|
1372
|
+
Rt[b],
|
|
1161
1373
|
" ",
|
|
1162
|
-
|
|
1374
|
+
s
|
|
1163
1375
|
] }),
|
|
1164
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
1376
|
+
/* @__PURE__ */ t("button", { onClick: () => x((p) => new Date(p.getFullYear(), p.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
|
|
1165
1377
|
] }),
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1378
|
+
/* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
|
|
1379
|
+
Wt.map((p) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: p }, p)),
|
|
1380
|
+
R.map((p, I) => {
|
|
1381
|
+
const W = p ? C(p) : !1, v = p && i && p.toDateString() === i.toDateString();
|
|
1170
1382
|
return /* @__PURE__ */ t(
|
|
1171
1383
|
"div",
|
|
1172
1384
|
{
|
|
1173
|
-
onClick: () => p &&
|
|
1385
|
+
onClick: () => p && F(p),
|
|
1174
1386
|
onMouseEnter: () => p && c(p),
|
|
1175
1387
|
onMouseLeave: () => c(null),
|
|
1176
|
-
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: p ? "pointer" : "default", fontSize: 12, fontWeight: p &&
|
|
1388
|
+
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: p ? "pointer" : "default", fontSize: 12, fontWeight: p && z(p) ? 700 : 400, background: W ? e.primary : v ? e.bg : "transparent", color: W ? "#fff" : p && z(p) ? e.primary : p ? e.text : "transparent", border: p && z(p) && !W ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
|
|
1177
1389
|
children: p == null ? void 0 : p.getDate()
|
|
1178
1390
|
},
|
|
1179
|
-
|
|
1391
|
+
I
|
|
1180
1392
|
);
|
|
1181
1393
|
})
|
|
1182
1394
|
] }),
|
|
1183
|
-
d && /* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (p) =>
|
|
1395
|
+
d && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
1396
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (p) => S((I) => ({ ...I, h: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
|
|
1185
1397
|
/* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
|
|
1186
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (p) =>
|
|
1398
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (p) => S((I) => ({ ...I, m: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
|
|
1187
1399
|
] })
|
|
1188
1400
|
] });
|
|
1189
1401
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const [h, u] =
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
const p = d === 24 ? { h:
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1197
|
-
m(null), u((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)),
|
|
1198
|
-
},
|
|
1402
|
+
function At({ value: n, onChange: o, timeFormat: d = 12, controls: l = !1, minuteStep: f = 5, style: a }) {
|
|
1403
|
+
const [h, u] = N((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), [x, w] = N((n == null ? void 0 : n.m) ?? 0), [r, i] = N((n == null ? void 0 : n.ampm) ?? "AM"), [c, m] = N(null);
|
|
1404
|
+
_(q, []);
|
|
1405
|
+
const S = d === 24 ? Array.from({ length: 24 }, (z, C) => C) : Array.from({ length: 12 }, (z, C) => C + 1), s = Array.from({ length: Math.ceil(60 / f) }, (z, C) => C * f), b = (z, C, F) => {
|
|
1406
|
+
const p = d === 24 ? { h: z, m: C } : { h: z, m: C, ampm: F };
|
|
1407
|
+
l ? m(p) : o == null || o(p);
|
|
1408
|
+
}, M = () => {
|
|
1409
|
+
m(null), u((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), w((n == null ? void 0 : n.m) ?? 0), i((n == null ? void 0 : n.ampm) ?? "AM");
|
|
1410
|
+
}, D = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, R = (z) => ({
|
|
1199
1411
|
height: 32,
|
|
1200
1412
|
display: "flex",
|
|
1201
1413
|
alignItems: "center",
|
|
1202
1414
|
justifyContent: "center",
|
|
1203
1415
|
cursor: "pointer",
|
|
1204
1416
|
fontSize: 13,
|
|
1205
|
-
fontWeight:
|
|
1206
|
-
background:
|
|
1207
|
-
color:
|
|
1417
|
+
fontWeight: z ? 700 : 400,
|
|
1418
|
+
background: z ? e.primaryLt : "transparent",
|
|
1419
|
+
color: z ? e.primary : e.text
|
|
1208
1420
|
});
|
|
1209
|
-
return /* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1421
|
+
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, ...a }, children: [
|
|
1422
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
|
|
1423
|
+
/* @__PURE__ */ g("div", { style: D, children: [
|
|
1212
1424
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
|
|
1213
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children:
|
|
1425
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: S.map((z) => /* @__PURE__ */ t(
|
|
1214
1426
|
"div",
|
|
1215
1427
|
{
|
|
1216
1428
|
onClick: () => {
|
|
1217
|
-
u(
|
|
1429
|
+
u(z), b(z, x, r);
|
|
1218
1430
|
},
|
|
1219
|
-
style:
|
|
1220
|
-
onMouseEnter: (
|
|
1221
|
-
onMouseLeave: (
|
|
1222
|
-
children: String(
|
|
1431
|
+
style: R(h === z),
|
|
1432
|
+
onMouseEnter: (C) => h !== z && (C.currentTarget.style.background = e.bg),
|
|
1433
|
+
onMouseLeave: (C) => h !== z && (C.currentTarget.style.background = "transparent"),
|
|
1434
|
+
children: String(z).padStart(2, "0")
|
|
1223
1435
|
},
|
|
1224
|
-
|
|
1436
|
+
z
|
|
1225
1437
|
)) })
|
|
1226
1438
|
] }),
|
|
1227
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ g("div", { style: D, children: [
|
|
1228
1440
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
|
|
1229
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children:
|
|
1441
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: s.map((z) => /* @__PURE__ */ t(
|
|
1230
1442
|
"div",
|
|
1231
1443
|
{
|
|
1232
1444
|
onClick: () => {
|
|
1233
|
-
|
|
1445
|
+
w(z), b(h, z, r);
|
|
1234
1446
|
},
|
|
1235
|
-
style:
|
|
1236
|
-
onMouseEnter: (
|
|
1237
|
-
onMouseLeave: (
|
|
1238
|
-
children: String(
|
|
1447
|
+
style: R(x === z),
|
|
1448
|
+
onMouseEnter: (C) => x !== z && (C.currentTarget.style.background = e.bg),
|
|
1449
|
+
onMouseLeave: (C) => x !== z && (C.currentTarget.style.background = "transparent"),
|
|
1450
|
+
children: String(z).padStart(2, "0")
|
|
1239
1451
|
},
|
|
1240
|
-
|
|
1452
|
+
z
|
|
1241
1453
|
)) })
|
|
1242
1454
|
] }),
|
|
1243
|
-
d === 12 && /* @__PURE__ */
|
|
1455
|
+
d === 12 && /* @__PURE__ */ g("div", { style: D, children: [
|
|
1244
1456
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
|
|
1245
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((
|
|
1457
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((z) => /* @__PURE__ */ t(
|
|
1246
1458
|
"div",
|
|
1247
1459
|
{
|
|
1248
1460
|
onClick: () => {
|
|
1249
|
-
i(
|
|
1461
|
+
i(z), b(h, x, z);
|
|
1250
1462
|
},
|
|
1251
|
-
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r ===
|
|
1252
|
-
children:
|
|
1463
|
+
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === z ? 700 : 400, background: r === z ? e.primary : e.surface, color: r === z ? "#fff" : e.text },
|
|
1464
|
+
children: z
|
|
1253
1465
|
},
|
|
1254
|
-
|
|
1466
|
+
z
|
|
1255
1467
|
)) })
|
|
1256
1468
|
] })
|
|
1257
1469
|
] }),
|
|
1258
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
|
|
1259
1471
|
String(h).padStart(2, "0"),
|
|
1260
1472
|
":",
|
|
1261
|
-
String(
|
|
1473
|
+
String(x).padStart(2, "0"),
|
|
1262
1474
|
d === 12 ? ` ${r}` : ""
|
|
1263
1475
|
] }),
|
|
1264
|
-
|
|
1265
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick:
|
|
1476
|
+
l && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
|
|
1477
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: M, children: "Cancel" }),
|
|
1266
1478
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => {
|
|
1267
|
-
const
|
|
1268
|
-
o == null || o(
|
|
1479
|
+
const z = c ?? (d === 24 ? { h, m: x } : { h, m: x, ampm: r });
|
|
1480
|
+
o == null || o(z);
|
|
1269
1481
|
}, children: "Apply" })
|
|
1270
1482
|
] })
|
|
1271
1483
|
] });
|
|
1272
1484
|
}
|
|
1273
|
-
const
|
|
1274
|
-
function
|
|
1275
|
-
var
|
|
1276
|
-
const [u,
|
|
1277
|
-
|
|
1278
|
-
), m =
|
|
1279
|
-
|
|
1280
|
-
|
|
1485
|
+
const Bt = ({ 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" }) });
|
|
1486
|
+
function Be({ data: n = [], value: o, placeholder: d = "Select or type...", multiselection: l = !1, label: f, onChange: a, style: h }) {
|
|
1487
|
+
var F;
|
|
1488
|
+
const [u, x] = N(!1), [w, r] = N(""), [i, c] = N(
|
|
1489
|
+
l ? o ? [].concat(o) : [] : o || null
|
|
1490
|
+
), m = oe(null), S = oe(null);
|
|
1491
|
+
_(q, []), ge(m, ae(() => {
|
|
1492
|
+
x(!1), r("");
|
|
1281
1493
|
}, []));
|
|
1282
|
-
const
|
|
1283
|
-
() => n.filter((p) => !
|
|
1284
|
-
[n,
|
|
1285
|
-
),
|
|
1286
|
-
const
|
|
1287
|
-
if (
|
|
1288
|
-
const
|
|
1289
|
-
c(
|
|
1494
|
+
const s = ue(
|
|
1495
|
+
() => n.filter((p) => !w || p.value.toLowerCase().includes(w.toLowerCase())),
|
|
1496
|
+
[n, w]
|
|
1497
|
+
), b = (p) => l ? (i || []).includes(p) : i === p, M = (p) => {
|
|
1498
|
+
const I = p.id || p.value;
|
|
1499
|
+
if (l) {
|
|
1500
|
+
const W = b(I) ? i.filter((v) => v !== I) : [...i || [], I];
|
|
1501
|
+
c(W), a == null || a(W);
|
|
1290
1502
|
} else
|
|
1291
|
-
c(
|
|
1292
|
-
},
|
|
1293
|
-
const
|
|
1294
|
-
c(
|
|
1295
|
-
},
|
|
1296
|
-
|
|
1503
|
+
c(I), r(""), x(!1), a == null || a(I);
|
|
1504
|
+
}, D = (p) => {
|
|
1505
|
+
const I = i.filter((W) => W !== p);
|
|
1506
|
+
c(I), a == null || a(I);
|
|
1507
|
+
}, R = () => {
|
|
1508
|
+
x(!0), setTimeout(() => {
|
|
1297
1509
|
var p;
|
|
1298
|
-
return (p =
|
|
1510
|
+
return (p = S.current) == null ? void 0 : p.focus();
|
|
1299
1511
|
}, 0);
|
|
1300
|
-
},
|
|
1301
|
-
return /* @__PURE__ */
|
|
1512
|
+
}, z = ((F = n.find((p) => (p.id || p.value) === i)) == null ? void 0 : F.value) || "", C = l ? i || [] : [];
|
|
1513
|
+
return /* @__PURE__ */ g("div", { ref: m, className: "dhx", style: { position: "relative", ...h }, children: [
|
|
1302
1514
|
f && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: f }),
|
|
1303
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ g(
|
|
1304
1516
|
"div",
|
|
1305
1517
|
{
|
|
1306
|
-
onClick:
|
|
1518
|
+
onClick: R,
|
|
1307
1519
|
style: {
|
|
1308
1520
|
display: "flex",
|
|
1309
1521
|
alignItems: "center",
|
|
1310
|
-
flexWrap:
|
|
1522
|
+
flexWrap: l ? "wrap" : "nowrap",
|
|
1311
1523
|
border: `1px solid ${u ? e.primary : e.border}`,
|
|
1312
1524
|
borderRadius: e.r,
|
|
1313
1525
|
minHeight: 34,
|
|
@@ -1319,10 +1531,10 @@ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", mult
|
|
|
1319
1531
|
boxShadow: u ? `0 0 0 3px ${e.primary}22` : "none"
|
|
1320
1532
|
},
|
|
1321
1533
|
children: [
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
var
|
|
1325
|
-
return /* @__PURE__ */
|
|
1534
|
+
l && /* @__PURE__ */ g(Ye, { children: [
|
|
1535
|
+
C.map((p) => {
|
|
1536
|
+
var I;
|
|
1537
|
+
return /* @__PURE__ */ g("span", { style: {
|
|
1326
1538
|
display: "inline-flex",
|
|
1327
1539
|
alignItems: "center",
|
|
1328
1540
|
gap: 4,
|
|
@@ -1334,12 +1546,12 @@ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", mult
|
|
|
1334
1546
|
lineHeight: 1.5,
|
|
1335
1547
|
whiteSpace: "nowrap"
|
|
1336
1548
|
}, children: [
|
|
1337
|
-
((
|
|
1549
|
+
((I = n.find((W) => (W.id || W.value) === p)) == null ? void 0 : I.value) || p,
|
|
1338
1550
|
/* @__PURE__ */ t(
|
|
1339
1551
|
"span",
|
|
1340
1552
|
{
|
|
1341
|
-
onClick: (
|
|
1342
|
-
|
|
1553
|
+
onClick: (W) => {
|
|
1554
|
+
W.stopPropagation(), D(p);
|
|
1343
1555
|
},
|
|
1344
1556
|
style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
|
|
1345
1557
|
children: "×"
|
|
@@ -1350,35 +1562,35 @@ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", mult
|
|
|
1350
1562
|
/* @__PURE__ */ t(
|
|
1351
1563
|
"input",
|
|
1352
1564
|
{
|
|
1353
|
-
ref:
|
|
1354
|
-
value:
|
|
1565
|
+
ref: S,
|
|
1566
|
+
value: w,
|
|
1355
1567
|
onChange: (p) => {
|
|
1356
|
-
r(p.target.value),
|
|
1568
|
+
r(p.target.value), x(!0);
|
|
1357
1569
|
},
|
|
1358
|
-
onFocus: () =>
|
|
1570
|
+
onFocus: () => x(!0),
|
|
1359
1571
|
onClick: (p) => p.stopPropagation(),
|
|
1360
|
-
placeholder:
|
|
1572
|
+
placeholder: C.length ? "" : d,
|
|
1361
1573
|
style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
1362
1574
|
}
|
|
1363
1575
|
)
|
|
1364
1576
|
] }),
|
|
1365
|
-
!
|
|
1577
|
+
!l && /* @__PURE__ */ t(
|
|
1366
1578
|
"input",
|
|
1367
1579
|
{
|
|
1368
|
-
ref:
|
|
1369
|
-
value: u ?
|
|
1580
|
+
ref: S,
|
|
1581
|
+
value: u ? w : z,
|
|
1370
1582
|
onChange: (p) => {
|
|
1371
|
-
r(p.target.value),
|
|
1583
|
+
r(p.target.value), x(!0);
|
|
1372
1584
|
},
|
|
1373
1585
|
onFocus: () => {
|
|
1374
|
-
|
|
1586
|
+
x(!0), r("");
|
|
1375
1587
|
},
|
|
1376
1588
|
onClick: (p) => p.stopPropagation(),
|
|
1377
1589
|
placeholder: d,
|
|
1378
1590
|
style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
1379
1591
|
}
|
|
1380
1592
|
),
|
|
1381
|
-
/* @__PURE__ */ t(
|
|
1593
|
+
/* @__PURE__ */ t(Bt, { open: u })
|
|
1382
1594
|
]
|
|
1383
1595
|
}
|
|
1384
1596
|
),
|
|
@@ -1392,13 +1604,13 @@ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", mult
|
|
|
1392
1604
|
borderRadius: e.r,
|
|
1393
1605
|
boxShadow: e.shadowLg,
|
|
1394
1606
|
zIndex: 100
|
|
1395
|
-
}, children: /* @__PURE__ */
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1398
|
-
return /* @__PURE__ */
|
|
1607
|
+
}, children: /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
|
|
1608
|
+
s.map((p) => {
|
|
1609
|
+
const I = p.id || p.value, W = b(I);
|
|
1610
|
+
return /* @__PURE__ */ g(
|
|
1399
1611
|
"div",
|
|
1400
1612
|
{
|
|
1401
|
-
onClick: () =>
|
|
1613
|
+
onClick: () => M(p),
|
|
1402
1614
|
style: {
|
|
1403
1615
|
padding: "8px 12px",
|
|
1404
1616
|
cursor: "pointer",
|
|
@@ -1406,114 +1618,114 @@ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", mult
|
|
|
1406
1618
|
alignItems: "center",
|
|
1407
1619
|
gap: 8,
|
|
1408
1620
|
fontSize: 13,
|
|
1409
|
-
background:
|
|
1410
|
-
color:
|
|
1621
|
+
background: W ? e.primaryLt : "transparent",
|
|
1622
|
+
color: W ? e.primary : e.text
|
|
1411
1623
|
},
|
|
1412
|
-
onMouseEnter: (
|
|
1413
|
-
onMouseLeave: (
|
|
1624
|
+
onMouseEnter: (v) => !W && (v.currentTarget.style.background = e.bg),
|
|
1625
|
+
onMouseLeave: (v) => !W && (v.currentTarget.style.background = "transparent"),
|
|
1414
1626
|
children: [
|
|
1415
|
-
|
|
1627
|
+
l && /* @__PURE__ */ t("span", { style: {
|
|
1416
1628
|
width: 14,
|
|
1417
1629
|
height: 14,
|
|
1418
1630
|
flexShrink: 0,
|
|
1419
|
-
border: `2px solid ${
|
|
1631
|
+
border: `2px solid ${W ? e.primary : e.borderDk}`,
|
|
1420
1632
|
borderRadius: 3,
|
|
1421
1633
|
display: "flex",
|
|
1422
1634
|
alignItems: "center",
|
|
1423
1635
|
justifyContent: "center",
|
|
1424
|
-
background:
|
|
1425
|
-
}, children:
|
|
1636
|
+
background: W ? e.primary : "transparent"
|
|
1637
|
+
}, children: W && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
|
|
1426
1638
|
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: p.value }),
|
|
1427
|
-
!
|
|
1428
|
-
p.count !== void 0 && /* @__PURE__ */
|
|
1639
|
+
!l && W && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
|
|
1640
|
+
p.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
1429
1641
|
"(",
|
|
1430
1642
|
p.count,
|
|
1431
1643
|
")"
|
|
1432
1644
|
] })
|
|
1433
1645
|
]
|
|
1434
1646
|
},
|
|
1435
|
-
|
|
1647
|
+
I
|
|
1436
1648
|
);
|
|
1437
1649
|
}),
|
|
1438
|
-
|
|
1650
|
+
s.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
|
|
1439
1651
|
] }) })
|
|
1440
1652
|
] });
|
|
1441
1653
|
}
|
|
1442
|
-
function
|
|
1443
|
-
const [r, i] =
|
|
1444
|
-
|
|
1445
|
-
const c = (
|
|
1654
|
+
function He({ min: n = 0, max: o = 100, step: d = 1, value: l, range: f = !1, label: a, tick: h, disabled: u = !1, onChange: x, style: w }) {
|
|
1655
|
+
const [r, i] = N(l ?? (f ? [n, o] : n));
|
|
1656
|
+
_(q, []);
|
|
1657
|
+
const c = (M, D) => {
|
|
1446
1658
|
if (!u)
|
|
1447
1659
|
if (f) {
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1660
|
+
const R = [...r];
|
|
1661
|
+
R[M] = D, i(R), x == null || x(R);
|
|
1450
1662
|
} else
|
|
1451
|
-
i(
|
|
1452
|
-
}, m = (
|
|
1453
|
-
return /* @__PURE__ */
|
|
1663
|
+
i(D), x == null || x(D);
|
|
1664
|
+
}, m = (M) => (M - n) / (o - n) * 100, S = f ? r : [r], s = f ? { left: `${m(S[0])}%`, width: `${m(S[1]) - m(S[0])}%` } : { left: 0, width: `${m(S[0])}%` }, b = u ? e.border : e.primary;
|
|
1665
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: u ? 0.5 : 1, ...w }, children: [
|
|
1454
1666
|
a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
|
|
1455
|
-
/* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */ t("div", { style: { position: "absolute", ...
|
|
1457
|
-
|
|
1667
|
+
/* @__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: [
|
|
1668
|
+
/* @__PURE__ */ t("div", { style: { position: "absolute", ...s, height: "100%", background: b, borderRadius: 2 } }),
|
|
1669
|
+
S.map((M, D) => /* @__PURE__ */ t(
|
|
1458
1670
|
"input",
|
|
1459
1671
|
{
|
|
1460
1672
|
type: "range",
|
|
1461
1673
|
min: n,
|
|
1462
1674
|
max: o,
|
|
1463
1675
|
step: d,
|
|
1464
|
-
value:
|
|
1676
|
+
value: M,
|
|
1465
1677
|
disabled: u,
|
|
1466
|
-
onChange: (
|
|
1467
|
-
const
|
|
1468
|
-
f &&
|
|
1678
|
+
onChange: (R) => {
|
|
1679
|
+
const z = +R.target.value;
|
|
1680
|
+
f && D === 0 && z >= r[1] || f && D === 1 && z <= r[0] || c(D, z);
|
|
1469
1681
|
},
|
|
1470
1682
|
style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: u ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
|
|
1471
1683
|
},
|
|
1472
|
-
|
|
1684
|
+
D
|
|
1473
1685
|
)),
|
|
1474
|
-
|
|
1686
|
+
S.map((M, D) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${m(M)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${b}`, 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: u ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: M }) }, D))
|
|
1475
1687
|
] }) }),
|
|
1476
|
-
h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((o + n) / 2), o].map((
|
|
1688
|
+
h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((o + n) / 2), o].map((M) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: M }, M)) })
|
|
1477
1689
|
] });
|
|
1478
1690
|
}
|
|
1479
|
-
const
|
|
1480
|
-
function
|
|
1481
|
-
const o = parseInt(n.slice(1, 3), 16) / 255, d = parseInt(n.slice(3, 5), 16) / 255,
|
|
1691
|
+
const Ht = ["#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"];
|
|
1692
|
+
function we(n) {
|
|
1693
|
+
const o = parseInt(n.slice(1, 3), 16) / 255, d = parseInt(n.slice(3, 5), 16) / 255, l = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(o, d, l), a = Math.min(o, d, l);
|
|
1482
1694
|
let h = 0, u = 0;
|
|
1483
|
-
const
|
|
1695
|
+
const x = (f + a) / 2;
|
|
1484
1696
|
if (f !== a) {
|
|
1485
|
-
const
|
|
1486
|
-
u =
|
|
1697
|
+
const w = f - a;
|
|
1698
|
+
u = x > 0.5 ? w / (2 - f - a) : w / (f + a), h = f === o ? ((d - l) / w + (d < l ? 6 : 0)) / 6 : f === d ? ((l - o) / w + 2) / 6 : ((o - d) / w + 4) / 6;
|
|
1487
1699
|
}
|
|
1488
|
-
return [Math.round(h * 360), Math.round(u * 100), Math.round(
|
|
1700
|
+
return [Math.round(h * 360), Math.round(u * 100), Math.round(x * 100)];
|
|
1489
1701
|
}
|
|
1490
|
-
function
|
|
1702
|
+
function je(n, o, d) {
|
|
1491
1703
|
o /= 100, d /= 100;
|
|
1492
|
-
const
|
|
1493
|
-
const h = (a + n / 30) % 12, u = d -
|
|
1704
|
+
const l = o * Math.min(d, 1 - d), f = (a) => {
|
|
1705
|
+
const h = (a + n / 30) % 12, u = d - l * Math.max(Math.min(h - 3, 9 - h, 1), -1);
|
|
1494
1706
|
return Math.round(255 * u).toString(16).padStart(2, "0");
|
|
1495
1707
|
};
|
|
1496
1708
|
return "#" + f(0) + f(8) + f(4);
|
|
1497
1709
|
}
|
|
1498
|
-
function
|
|
1499
|
-
const [
|
|
1500
|
-
|
|
1710
|
+
function en({ value: n = "#0288d1", onChange: o, style: d }) {
|
|
1711
|
+
const [l, f] = N(() => we(n)), a = je(...l);
|
|
1712
|
+
_(q, []);
|
|
1501
1713
|
const h = (u) => {
|
|
1502
|
-
f(u), o == null || o(
|
|
1714
|
+
f(u), o == null || o(je(...u));
|
|
1503
1715
|
};
|
|
1504
|
-
return /* @__PURE__ */
|
|
1505
|
-
/* @__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(${
|
|
1506
|
-
[["Hue", 0, 360,
|
|
1507
|
-
/* @__PURE__ */
|
|
1716
|
+
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, ...d }, children: [
|
|
1717
|
+
/* @__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(${l[0]},100%,50%))`, cursor: "crosshair" } }),
|
|
1718
|
+
[["Hue", 0, 360, l[0]], ["Saturation", 0, 100, l[1]], ["Lightness", 0, 100, l[2]]].map(([u, x, w, r], i) => /* @__PURE__ */ g("div", { style: { marginBottom: i < 2 ? 8 : 12 }, children: [
|
|
1719
|
+
/* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
|
|
1508
1720
|
u,
|
|
1509
1721
|
i > 0 ? ` (${r}%)` : ""
|
|
1510
1722
|
] }),
|
|
1511
|
-
/* @__PURE__ */ t("input", { type: "range", min:
|
|
1512
|
-
const m = [...
|
|
1723
|
+
/* @__PURE__ */ t("input", { type: "range", min: x, max: w, value: r, onChange: (c) => {
|
|
1724
|
+
const m = [...l];
|
|
1513
1725
|
m[i] = +c.target.value, h(m);
|
|
1514
1726
|
}, style: { width: "100%", accentColor: e.primary } })
|
|
1515
1727
|
] }, u)),
|
|
1516
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
1517
1729
|
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
|
|
1518
1730
|
/* @__PURE__ */ t(
|
|
1519
1731
|
"input",
|
|
@@ -1523,34 +1735,34 @@ function Ut({ value: n = "#0288d1", onChange: o, style: d }) {
|
|
|
1523
1735
|
value: a,
|
|
1524
1736
|
onChange: (u) => {
|
|
1525
1737
|
try {
|
|
1526
|
-
h(
|
|
1738
|
+
h(we(u.target.value)), o == null || o(u.target.value);
|
|
1527
1739
|
} catch {
|
|
1528
1740
|
}
|
|
1529
1741
|
}
|
|
1530
1742
|
}
|
|
1531
1743
|
)
|
|
1532
1744
|
] }),
|
|
1533
|
-
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children:
|
|
1745
|
+
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: Ht.map((u) => /* @__PURE__ */ t(
|
|
1534
1746
|
"div",
|
|
1535
1747
|
{
|
|
1536
1748
|
onClick: () => {
|
|
1537
|
-
f(
|
|
1749
|
+
f(we(u)), o == null || o(u);
|
|
1538
1750
|
},
|
|
1539
1751
|
style: { width: 14, height: 14, borderRadius: 2, background: u, cursor: "pointer", border: a === u ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
|
|
1540
|
-
onMouseEnter: (
|
|
1541
|
-
onMouseLeave: (
|
|
1752
|
+
onMouseEnter: (x) => x.currentTarget.style.transform = "scale(1.3)",
|
|
1753
|
+
onMouseLeave: (x) => x.currentTarget.style.transform = "scale(1)"
|
|
1542
1754
|
},
|
|
1543
1755
|
u
|
|
1544
1756
|
)) })
|
|
1545
1757
|
] });
|
|
1546
1758
|
}
|
|
1547
|
-
function
|
|
1548
|
-
const [f, a] =
|
|
1549
|
-
return
|
|
1550
|
-
/* @__PURE__ */ t("div", { ref:
|
|
1759
|
+
function tn({ trigger: n, children: o, placement: d = "bottom-start", style: l }) {
|
|
1760
|
+
const [f, a] = N(!1), [h, u] = N({ top: "100%", left: 0 }), x = oe(null), w = oe(null);
|
|
1761
|
+
return _(q, []), ge(x, ae(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
|
|
1762
|
+
/* @__PURE__ */ t("div", { ref: w, onClick: () => {
|
|
1551
1763
|
a((i) => {
|
|
1552
|
-
if (!i &&
|
|
1553
|
-
const c =
|
|
1764
|
+
if (!i && w.current) {
|
|
1765
|
+
const c = w.current.getBoundingClientRect(), m = {
|
|
1554
1766
|
"bottom-start": { top: c.height + 4, left: 0 },
|
|
1555
1767
|
"bottom-end": { top: c.height + 4, right: 0, left: "auto" },
|
|
1556
1768
|
"top-start": { bottom: c.height + 4, top: "auto", left: 0 }
|
|
@@ -1560,123 +1772,123 @@ function Qt({ trigger: n, children: o, placement: d = "bottom-start", style: s }
|
|
|
1560
1772
|
return !i;
|
|
1561
1773
|
});
|
|
1562
1774
|
}, children: n }),
|
|
1563
|
-
f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...
|
|
1775
|
+
f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...l }, children: o })
|
|
1564
1776
|
] });
|
|
1565
1777
|
}
|
|
1566
|
-
function
|
|
1567
|
-
const [i, c] =
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1570
|
-
c(!1),
|
|
1778
|
+
function nn({ title: n, children: o, width: d = 480, height: l, closable: f = !0, movable: a = !0, modal: h = !1, defaultOpen: u = !0, footer: x, onClose: w, style: r }) {
|
|
1779
|
+
const [i, c] = N(u), [m, S] = N({ x: 0, y: 0 });
|
|
1780
|
+
_(q, []);
|
|
1781
|
+
const s = St(ae((M, D) => a && S({ x: M, y: D }), [a])), b = () => {
|
|
1782
|
+
c(!1), w == null || w();
|
|
1571
1783
|
};
|
|
1572
|
-
return i ? /* @__PURE__ */
|
|
1573
|
-
h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ?
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1784
|
+
return i ? /* @__PURE__ */ g(Ye, { children: [
|
|
1785
|
+
h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? b : void 0 }),
|
|
1786
|
+
/* @__PURE__ */ g("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${m.x}px), calc(-50% + ${m.y}px))`, width: d, ...l ? { height: l } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
|
|
1787
|
+
/* @__PURE__ */ g("div", { onMouseDown: (M) => s(M, m.x, m.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
|
|
1576
1788
|
/* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
|
|
1577
1789
|
f && /* @__PURE__ */ t(
|
|
1578
1790
|
"button",
|
|
1579
1791
|
{
|
|
1580
|
-
onClick:
|
|
1792
|
+
onClick: b,
|
|
1581
1793
|
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 },
|
|
1582
|
-
onMouseEnter: (
|
|
1583
|
-
onMouseLeave: (
|
|
1794
|
+
onMouseEnter: (M) => M.currentTarget.style.background = e.border,
|
|
1795
|
+
onMouseLeave: (M) => M.currentTarget.style.background = "none",
|
|
1584
1796
|
children: "×"
|
|
1585
1797
|
}
|
|
1586
1798
|
)
|
|
1587
1799
|
] }),
|
|
1588
1800
|
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: o }),
|
|
1589
|
-
|
|
1801
|
+
x && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: x })
|
|
1590
1802
|
] })
|
|
1591
1803
|
] }) : null;
|
|
1592
1804
|
}
|
|
1593
|
-
const
|
|
1594
|
-
function
|
|
1595
|
-
const [o, d] =
|
|
1596
|
-
|
|
1597
|
-
const
|
|
1805
|
+
const Ke = Qe(null), jt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Fe = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
|
|
1806
|
+
function rn({ children: n }) {
|
|
1807
|
+
const [o, d] = N([]);
|
|
1808
|
+
_(q, []);
|
|
1809
|
+
const l = ae((h) => d((u) => u.filter((x) => x.id !== h)), []), f = ae((h) => {
|
|
1598
1810
|
const u = Date.now();
|
|
1599
|
-
return d((
|
|
1600
|
-
}, [
|
|
1811
|
+
return d((x) => [...x, { id: u, ...h }]), h.duration !== 0 && setTimeout(() => l(u), h.duration || 4e3), u;
|
|
1812
|
+
}, [l]), a = {
|
|
1601
1813
|
message: f,
|
|
1602
1814
|
alert: (h, u) => f({ type: "info", title: h, ...u }),
|
|
1603
|
-
confirm: (h, u,
|
|
1815
|
+
confirm: (h, u, x) => f({ type: "warning", title: h, confirm: u, ...x })
|
|
1604
1816
|
};
|
|
1605
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ g(Ke.Provider, { value: a, children: [
|
|
1606
1818
|
n,
|
|
1607
1819
|
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: o.map((h) => {
|
|
1608
1820
|
const u = h.type || "info";
|
|
1609
|
-
return /* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 18, color: Fe[u], lineHeight: 1 }, children:
|
|
1611
|
-
/* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Fe[u]}`, 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: [
|
|
1822
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 18, color: Fe[u], lineHeight: 1 }, children: jt[u] }),
|
|
1823
|
+
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
1612
1824
|
h.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: h.text ? 3 : 0 }, children: h.title }),
|
|
1613
1825
|
h.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: h.text }),
|
|
1614
|
-
h.confirm && /* @__PURE__ */
|
|
1826
|
+
h.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
|
|
1615
1827
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
1616
|
-
h.confirm(!0),
|
|
1828
|
+
h.confirm(!0), l(h.id);
|
|
1617
1829
|
}, children: "Confirm" }),
|
|
1618
1830
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
1619
|
-
h.confirm(!1),
|
|
1831
|
+
h.confirm(!1), l(h.id);
|
|
1620
1832
|
}, children: "Cancel" })
|
|
1621
1833
|
] })
|
|
1622
1834
|
] }),
|
|
1623
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
1835
|
+
/* @__PURE__ */ t("button", { onClick: () => l(h.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
|
|
1624
1836
|
] }, h.id);
|
|
1625
1837
|
}) })
|
|
1626
1838
|
] });
|
|
1627
1839
|
}
|
|
1628
|
-
function
|
|
1629
|
-
const n = Ze(
|
|
1840
|
+
function on() {
|
|
1841
|
+
const n = Ze(Ke);
|
|
1630
1842
|
if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
|
|
1631
1843
|
return n;
|
|
1632
1844
|
}
|
|
1633
|
-
function
|
|
1634
|
-
const [
|
|
1635
|
-
|
|
1636
|
-
const
|
|
1637
|
-
const
|
|
1638
|
-
r((
|
|
1639
|
-
const p =
|
|
1640
|
-
return p.has(
|
|
1641
|
-
}),
|
|
1642
|
-
},
|
|
1643
|
-
u == null || u({ ...
|
|
1845
|
+
function ln({ data: n = [], template: o, keyNavigation: d = !0, multiselection: l = !1, editable: f = !1, height: a = 400, onSelect: h, onEdit: u, style: x }) {
|
|
1846
|
+
const [w, r] = N(/* @__PURE__ */ new Set()), [i, c] = N(null), [m, S] = N(""), [s, b] = N(null);
|
|
1847
|
+
_(q, []);
|
|
1848
|
+
const M = (R, z) => {
|
|
1849
|
+
const C = R.id ?? z;
|
|
1850
|
+
r((F) => {
|
|
1851
|
+
const p = l ? new Set(F) : /* @__PURE__ */ new Set();
|
|
1852
|
+
return p.has(C) ? p.delete(C) : p.add(C), p;
|
|
1853
|
+
}), b(z), h == null || h(R);
|
|
1854
|
+
}, D = (R, z) => {
|
|
1855
|
+
u == null || u({ ...R, value: m }, z), c(null);
|
|
1644
1856
|
};
|
|
1645
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ g(
|
|
1646
1858
|
"div",
|
|
1647
1859
|
{
|
|
1648
1860
|
className: "dhx dhx-scroll",
|
|
1649
|
-
style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...
|
|
1861
|
+
style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...x },
|
|
1650
1862
|
tabIndex: 0,
|
|
1651
|
-
onKeyDown: (
|
|
1652
|
-
d && (
|
|
1863
|
+
onKeyDown: (R) => {
|
|
1864
|
+
d && (R.key === "ArrowDown" && b((z) => Math.min((z ?? -1) + 1, n.length - 1)), R.key === "ArrowUp" && b((z) => Math.max((z ?? 1) - 1, 0)));
|
|
1653
1865
|
},
|
|
1654
1866
|
children: [
|
|
1655
|
-
n.map((
|
|
1656
|
-
const
|
|
1867
|
+
n.map((R, z) => {
|
|
1868
|
+
const C = R.id ?? z, F = w.has(C), p = s === z;
|
|
1657
1869
|
return /* @__PURE__ */ t(
|
|
1658
1870
|
"div",
|
|
1659
1871
|
{
|
|
1660
|
-
onClick: () =>
|
|
1661
|
-
onDoubleClick: () => f && (c(
|
|
1662
|
-
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background:
|
|
1663
|
-
children: i ===
|
|
1872
|
+
onClick: () => M(R, z),
|
|
1873
|
+
onDoubleClick: () => f && (c(z), S(String(R.value || ""))),
|
|
1874
|
+
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: F ? e.primaryLt : p ? e.bg : e.surface, color: F ? e.primary : e.text, outline: p ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
|
|
1875
|
+
children: i === z ? /* @__PURE__ */ t(
|
|
1664
1876
|
"input",
|
|
1665
1877
|
{
|
|
1666
1878
|
autoFocus: !0,
|
|
1667
1879
|
className: "dhx dhx-input",
|
|
1668
1880
|
style: { height: 28, flex: 1 },
|
|
1669
1881
|
value: m,
|
|
1670
|
-
onChange: (
|
|
1671
|
-
onBlur: () =>
|
|
1672
|
-
onKeyDown: (
|
|
1673
|
-
|
|
1882
|
+
onChange: (I) => S(I.target.value),
|
|
1883
|
+
onBlur: () => D(R, z),
|
|
1884
|
+
onKeyDown: (I) => {
|
|
1885
|
+
I.key === "Enter" && D(R, z), I.key === "Escape" && c(null);
|
|
1674
1886
|
},
|
|
1675
|
-
onClick: (
|
|
1887
|
+
onClick: (I) => I.stopPropagation()
|
|
1676
1888
|
}
|
|
1677
|
-
) : o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(
|
|
1889
|
+
) : o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(R) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(R.value ?? "") })
|
|
1678
1890
|
},
|
|
1679
|
-
String(
|
|
1891
|
+
String(C)
|
|
1680
1892
|
);
|
|
1681
1893
|
}),
|
|
1682
1894
|
n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
|
|
@@ -1684,30 +1896,30 @@ function nn({ data: n = [], template: o, keyNavigation: d = !0, multiselection:
|
|
|
1684
1896
|
}
|
|
1685
1897
|
);
|
|
1686
1898
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const [u,
|
|
1689
|
-
|
|
1690
|
-
const
|
|
1899
|
+
function sn({ data: n = [], template: o, itemsInRow: d = 3, gap: l = 12, multiselection: f = !1, onSelect: a, style: h }) {
|
|
1900
|
+
const [u, x] = N(/* @__PURE__ */ new Set());
|
|
1901
|
+
_(q, []);
|
|
1902
|
+
const w = (r) => {
|
|
1691
1903
|
const i = r.id ?? String(r.title);
|
|
1692
|
-
|
|
1904
|
+
x((c) => {
|
|
1693
1905
|
const m = f ? new Set(c) : /* @__PURE__ */ new Set();
|
|
1694
1906
|
return m.has(i) ? m.delete(i) : m.add(i), m;
|
|
1695
1907
|
}), a == null || a(r);
|
|
1696
1908
|
};
|
|
1697
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap:
|
|
1909
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap: l, padding: l, ...h }, children: n.map((r, i) => {
|
|
1698
1910
|
const c = r.id ?? i, m = u.has(c);
|
|
1699
1911
|
return /* @__PURE__ */ t(
|
|
1700
1912
|
"div",
|
|
1701
1913
|
{
|
|
1702
|
-
onClick: () =>
|
|
1914
|
+
onClick: () => w(r),
|
|
1703
1915
|
style: { background: e.surface, border: `2px solid ${m ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: m ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: m ? "translateY(-2px)" : "none" },
|
|
1704
|
-
onMouseEnter: (
|
|
1705
|
-
|
|
1916
|
+
onMouseEnter: (S) => {
|
|
1917
|
+
S.currentTarget.style.boxShadow = e.shadowLg, S.currentTarget.style.transform = "translateY(-2px)";
|
|
1706
1918
|
},
|
|
1707
|
-
onMouseLeave: (
|
|
1708
|
-
|
|
1919
|
+
onMouseLeave: (S) => {
|
|
1920
|
+
S.currentTarget.style.boxShadow = m ? `0 0 0 3px ${e.primary}33` : e.shadow, S.currentTarget.style.transform = m ? "translateY(-2px)" : "none";
|
|
1709
1921
|
},
|
|
1710
|
-
children: o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(r) } }) : /* @__PURE__ */
|
|
1922
|
+
children: o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
|
|
1711
1923
|
r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
|
|
1712
1924
|
/* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
|
|
1713
1925
|
r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
|
|
@@ -1717,474 +1929,474 @@ function rn({ data: n = [], template: o, itemsInRow: d = 3, gap: s = 12, multise
|
|
|
1717
1929
|
);
|
|
1718
1930
|
}) });
|
|
1719
1931
|
}
|
|
1720
|
-
function
|
|
1721
|
-
return n.map((o) => ({ ...o, items: o.items ?
|
|
1932
|
+
function ze(n) {
|
|
1933
|
+
return n.map((o) => ({ ...o, items: o.items ? ze(o.items) : void 0 }));
|
|
1722
1934
|
}
|
|
1723
|
-
function
|
|
1935
|
+
function Me(n, o = {}) {
|
|
1724
1936
|
return n.forEach((d) => {
|
|
1725
|
-
d.opened && (o[d.id] = !0), d.items &&
|
|
1937
|
+
d.opened && (o[d.id] = !0), d.items && Me(d.items, o);
|
|
1726
1938
|
}), o;
|
|
1727
1939
|
}
|
|
1728
|
-
function
|
|
1940
|
+
function _e(n, o) {
|
|
1729
1941
|
let d = null;
|
|
1730
1942
|
return [n.filter((f) => f.id === o ? (d = f, !1) : !0).map((f) => {
|
|
1731
1943
|
if (f.items) {
|
|
1732
|
-
const [a, h] =
|
|
1944
|
+
const [a, h] = _e(f.items, o);
|
|
1733
1945
|
return h && (d = h), { ...f, items: a };
|
|
1734
1946
|
}
|
|
1735
1947
|
return f;
|
|
1736
1948
|
}), d];
|
|
1737
1949
|
}
|
|
1738
|
-
function
|
|
1739
|
-
if (
|
|
1740
|
-
return n.map((a) => a.id === o ? { ...a, items: [...a.items || [], d] } : a.items ? { ...a, items:
|
|
1950
|
+
function $e(n, o, d, l) {
|
|
1951
|
+
if (l === "inside")
|
|
1952
|
+
return n.map((a) => a.id === o ? { ...a, items: [...a.items || [], d] } : a.items ? { ...a, items: $e(a.items, o, d, l) } : a);
|
|
1741
1953
|
if (n.some((a) => a.id === o)) {
|
|
1742
1954
|
const a = [];
|
|
1743
1955
|
for (const h of n)
|
|
1744
|
-
h.id === o ?
|
|
1956
|
+
h.id === o ? l === "before" ? (a.push(d), a.push(h)) : (a.push(h), a.push(d)) : a.push(h);
|
|
1745
1957
|
return a;
|
|
1746
1958
|
}
|
|
1747
|
-
return n.map((a) => a.items ? { ...a, items:
|
|
1959
|
+
return n.map((a) => a.items ? { ...a, items: $e(a.items, o, d, l) } : a);
|
|
1748
1960
|
}
|
|
1749
|
-
function
|
|
1750
|
-
function
|
|
1961
|
+
function Ft(n, o, d) {
|
|
1962
|
+
function l(f) {
|
|
1751
1963
|
var a, h;
|
|
1752
1964
|
if (f.id === o) {
|
|
1753
|
-
const u = (
|
|
1754
|
-
var
|
|
1755
|
-
return
|
|
1965
|
+
const u = (x) => {
|
|
1966
|
+
var w;
|
|
1967
|
+
return x.id === d || (((w = x.items) == null ? void 0 : w.some(u)) ?? !1);
|
|
1756
1968
|
};
|
|
1757
1969
|
return ((a = f.items) == null ? void 0 : a.some(u)) ?? !1;
|
|
1758
1970
|
}
|
|
1759
|
-
return ((h = f.items) == null ? void 0 : h.some(
|
|
1971
|
+
return ((h = f.items) == null ? void 0 : h.some(l)) ?? !1;
|
|
1760
1972
|
}
|
|
1761
|
-
return n.some(
|
|
1973
|
+
return n.some(l);
|
|
1762
1974
|
}
|
|
1763
|
-
function
|
|
1975
|
+
function Ve(n, o, d) {
|
|
1764
1976
|
return n.map(
|
|
1765
|
-
(
|
|
1977
|
+
(l) => l.id === o ? { ...l, value: d } : { ...l, items: l.items ? Ve(l.items, o, d) : void 0 }
|
|
1766
1978
|
);
|
|
1767
1979
|
}
|
|
1768
|
-
function
|
|
1980
|
+
function Pt(n, o) {
|
|
1769
1981
|
var a;
|
|
1770
|
-
let d = 0,
|
|
1982
|
+
let d = 0, l = 0;
|
|
1771
1983
|
const f = (h) => {
|
|
1772
1984
|
var u;
|
|
1773
|
-
d++, o[h.id] &&
|
|
1985
|
+
d++, o[h.id] && l++, (u = h.items) == null || u.forEach(f);
|
|
1774
1986
|
};
|
|
1775
|
-
return (a = n.items) == null || a.forEach(f), { total: d, checkedCount:
|
|
1987
|
+
return (a = n.items) == null || a.forEach(f), { total: d, checkedCount: l };
|
|
1776
1988
|
}
|
|
1777
|
-
function
|
|
1989
|
+
function an({
|
|
1778
1990
|
data: n = [],
|
|
1779
1991
|
checkbox: o = !1,
|
|
1780
1992
|
editable: d = !1,
|
|
1781
|
-
dragMode:
|
|
1993
|
+
dragMode: l,
|
|
1782
1994
|
tooltip: f,
|
|
1783
1995
|
onSelect: a,
|
|
1784
1996
|
onCheck: h,
|
|
1785
1997
|
onChange: u,
|
|
1786
|
-
style:
|
|
1998
|
+
style: x
|
|
1787
1999
|
}) {
|
|
1788
|
-
const [
|
|
1789
|
-
|
|
1790
|
-
r(
|
|
2000
|
+
const [w, r] = N(() => ze(n)), [i, c] = N(() => Me(n)), [m, S] = N(null), [s, b] = N({}), [M, D] = N(null), [R, z] = N(""), [C, F] = N(null), [p, I] = N(null);
|
|
2001
|
+
_(q, []), _(() => {
|
|
2002
|
+
r(ze(n)), c(($) => ({ ...Me(n), ...$ }));
|
|
1791
2003
|
}, [n]);
|
|
1792
|
-
const
|
|
1793
|
-
|
|
2004
|
+
const W = ($) => c((j) => ({ ...j, [$]: !j[$] })), v = ($, j) => {
|
|
2005
|
+
b((k) => ({ ...k, [$]: j })), h == null || h($, j);
|
|
1794
2006
|
}, X = () => {
|
|
1795
|
-
if (!
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1798
|
-
const
|
|
1799
|
-
return u == null || u(
|
|
2007
|
+
if (!M) return;
|
|
2008
|
+
const $ = M, j = R;
|
|
2009
|
+
D(null), r((k) => {
|
|
2010
|
+
const P = Ve(k, $, j);
|
|
2011
|
+
return u == null || u(P), P;
|
|
1800
2012
|
});
|
|
1801
|
-
},
|
|
1802
|
-
|
|
1803
|
-
}, se = (
|
|
1804
|
-
if (
|
|
1805
|
-
|
|
1806
|
-
const
|
|
1807
|
-
|
|
1808
|
-
},
|
|
1809
|
-
if (
|
|
1810
|
-
|
|
2013
|
+
}, J = ($, j) => {
|
|
2014
|
+
$.dataTransfer.effectAllowed = "move", F(j);
|
|
2015
|
+
}, se = ($, j) => {
|
|
2016
|
+
if (!C || C === j || Ft(w, C, j)) return;
|
|
2017
|
+
$.preventDefault();
|
|
2018
|
+
const k = $.currentTarget.getBoundingClientRect(), P = $.clientY - k.top, O = k.height, G = P < O * 0.25 ? "before" : P > O * 0.75 ? "after" : "inside";
|
|
2019
|
+
I((K) => (K == null ? void 0 : K.id) === j && (K == null ? void 0 : K.pos) === G ? K : { id: j, pos: G });
|
|
2020
|
+
}, U = ($, j) => {
|
|
2021
|
+
if ($.preventDefault(), !C || !p || C === j) {
|
|
2022
|
+
I(null), F(null);
|
|
1811
2023
|
return;
|
|
1812
2024
|
}
|
|
1813
|
-
r((
|
|
1814
|
-
const [
|
|
1815
|
-
if (!
|
|
1816
|
-
const
|
|
1817
|
-
return u == null || u(
|
|
1818
|
-
}), p.pos === "inside" && c((
|
|
2025
|
+
r((k) => {
|
|
2026
|
+
const [P, O] = _e(k, C);
|
|
2027
|
+
if (!O) return k;
|
|
2028
|
+
const G = $e(P, j, O, p.pos);
|
|
2029
|
+
return u == null || u(G), G;
|
|
2030
|
+
}), p.pos === "inside" && c((k) => ({ ...k, [j]: !0 })), I(null), F(null);
|
|
1819
2031
|
}, ie = () => {
|
|
1820
|
-
|
|
1821
|
-
}, E = (
|
|
1822
|
-
var
|
|
1823
|
-
const
|
|
1824
|
-
let
|
|
1825
|
-
if (o &&
|
|
1826
|
-
const { total:
|
|
1827
|
-
de > 0 && de <
|
|
2032
|
+
F(null), I(null);
|
|
2033
|
+
}, E = ($, j = 0) => {
|
|
2034
|
+
var ne;
|
|
2035
|
+
const k = (((ne = $.items) == null ? void 0 : ne.length) ?? 0) > 0, P = i[$.id], O = m === $.id, G = C === $.id, K = (p == null ? void 0 : p.id) === $.id;
|
|
2036
|
+
let V = !!s[$.id], Q = !1;
|
|
2037
|
+
if (o && k) {
|
|
2038
|
+
const { total: H, checkedCount: de } = Pt($, s);
|
|
2039
|
+
de > 0 && de < H ? Q = !0 : H > 0 && de === H && (V = !0);
|
|
1828
2040
|
}
|
|
1829
|
-
const Z =
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
2041
|
+
const Z = K && p.pos !== "inside" ? { boxShadow: p.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, fe = K && p.pos === "inside" || O ? e.primaryLt : "transparent";
|
|
2042
|
+
return /* @__PURE__ */ g("div", { style: { opacity: G ? 0.4 : 1 }, children: [
|
|
2043
|
+
/* @__PURE__ */ g(
|
|
1832
2044
|
"div",
|
|
1833
2045
|
{
|
|
1834
|
-
draggable: !!
|
|
1835
|
-
onDragStart:
|
|
1836
|
-
onDragOver:
|
|
1837
|
-
onDrop:
|
|
1838
|
-
onDragEnd:
|
|
1839
|
-
title: f == null ? void 0 : f(
|
|
2046
|
+
draggable: !!l,
|
|
2047
|
+
onDragStart: l ? (H) => J(H, $.id) : void 0,
|
|
2048
|
+
onDragOver: l ? (H) => se(H, $.id) : void 0,
|
|
2049
|
+
onDrop: l ? (H) => U(H, $.id) : void 0,
|
|
2050
|
+
onDragEnd: l ? ie : void 0,
|
|
2051
|
+
title: f == null ? void 0 : f($),
|
|
1840
2052
|
onClick: () => {
|
|
1841
|
-
|
|
2053
|
+
S($.id), a == null || a($), k && W($.id);
|
|
1842
2054
|
},
|
|
1843
2055
|
onDoubleClick: () => {
|
|
1844
|
-
d && (
|
|
2056
|
+
d && (D($.id), z($.value || ""));
|
|
1845
2057
|
},
|
|
1846
2058
|
style: {
|
|
1847
2059
|
display: "flex",
|
|
1848
2060
|
alignItems: "center",
|
|
1849
2061
|
gap: 4,
|
|
1850
|
-
padding: `5px 8px 5px ${12 +
|
|
1851
|
-
cursor:
|
|
2062
|
+
padding: `5px 8px 5px ${12 + j * 18}px`,
|
|
2063
|
+
cursor: l ? "grab" : "pointer",
|
|
1852
2064
|
borderRadius: e.r,
|
|
1853
2065
|
margin: "1px 4px",
|
|
1854
|
-
background:
|
|
1855
|
-
color:
|
|
2066
|
+
background: fe,
|
|
2067
|
+
color: O ? e.primary : e.text,
|
|
1856
2068
|
userSelect: "none",
|
|
1857
2069
|
fontSize: 13,
|
|
1858
2070
|
...Z
|
|
1859
2071
|
},
|
|
1860
|
-
onMouseEnter: (
|
|
1861
|
-
onMouseLeave: (
|
|
2072
|
+
onMouseEnter: (H) => !O && !K && (H.currentTarget.style.background = e.bg),
|
|
2073
|
+
onMouseLeave: (H) => !O && !K && (H.currentTarget.style.background = "transparent"),
|
|
1862
2074
|
children: [
|
|
1863
2075
|
/* @__PURE__ */ t(
|
|
1864
2076
|
"span",
|
|
1865
2077
|
{
|
|
1866
2078
|
style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
|
|
1867
|
-
onClick: (
|
|
1868
|
-
|
|
2079
|
+
onClick: (H) => {
|
|
2080
|
+
H.stopPropagation(), k && W($.id);
|
|
1869
2081
|
},
|
|
1870
|
-
children:
|
|
2082
|
+
children: k ? P ? "▾" : "▸" : ""
|
|
1871
2083
|
}
|
|
1872
2084
|
),
|
|
1873
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children:
|
|
2085
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: k ? P ? "📂" : "📁" : "📄" }),
|
|
1874
2086
|
o && /* @__PURE__ */ t(
|
|
1875
2087
|
"input",
|
|
1876
2088
|
{
|
|
1877
|
-
ref: (
|
|
1878
|
-
|
|
2089
|
+
ref: (H) => {
|
|
2090
|
+
H && (H.indeterminate = Q);
|
|
1879
2091
|
},
|
|
1880
2092
|
type: "checkbox",
|
|
1881
|
-
checked:
|
|
1882
|
-
onChange: (
|
|
1883
|
-
|
|
2093
|
+
checked: V,
|
|
2094
|
+
onChange: (H) => {
|
|
2095
|
+
H.stopPropagation(), v($.id, H.target.checked);
|
|
1884
2096
|
},
|
|
1885
2097
|
style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
|
|
1886
|
-
onClick: (
|
|
2098
|
+
onClick: (H) => H.stopPropagation()
|
|
1887
2099
|
}
|
|
1888
2100
|
),
|
|
1889
|
-
|
|
2101
|
+
M === $.id ? /* @__PURE__ */ t(
|
|
1890
2102
|
"input",
|
|
1891
2103
|
{
|
|
1892
2104
|
autoFocus: !0,
|
|
1893
2105
|
className: "dhx dhx-input",
|
|
1894
2106
|
style: { height: 24, fontSize: 12, flex: 1 },
|
|
1895
|
-
value:
|
|
1896
|
-
onChange: (
|
|
2107
|
+
value: R,
|
|
2108
|
+
onChange: (H) => z(H.target.value),
|
|
1897
2109
|
onBlur: X,
|
|
1898
|
-
onKeyDown: (
|
|
1899
|
-
|
|
2110
|
+
onKeyDown: (H) => {
|
|
2111
|
+
H.key === "Enter" && X(), H.key === "Escape" && D(null);
|
|
1900
2112
|
},
|
|
1901
|
-
onClick: (
|
|
2113
|
+
onClick: (H) => H.stopPropagation()
|
|
1902
2114
|
}
|
|
1903
|
-
) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
1904
|
-
|
|
2115
|
+
) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: $.value }),
|
|
2116
|
+
$.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
1905
2117
|
"(",
|
|
1906
|
-
|
|
2118
|
+
$.count,
|
|
1907
2119
|
")"
|
|
1908
2120
|
] })
|
|
1909
2121
|
]
|
|
1910
2122
|
}
|
|
1911
2123
|
),
|
|
1912
|
-
|
|
1913
|
-
] },
|
|
2124
|
+
k && P && /* @__PURE__ */ t("div", { children: $.items.map((H) => E(H, j + 1)) })
|
|
2125
|
+
] }, $.id);
|
|
1914
2126
|
};
|
|
1915
2127
|
return /* @__PURE__ */ t(
|
|
1916
2128
|
"div",
|
|
1917
2129
|
{
|
|
1918
2130
|
className: "dhx dhx-scroll",
|
|
1919
|
-
style: { overflowY: "auto", ...
|
|
1920
|
-
onDragOver:
|
|
1921
|
-
onDrop:
|
|
1922
|
-
|
|
2131
|
+
style: { overflowY: "auto", ...x },
|
|
2132
|
+
onDragOver: l ? ($) => $.preventDefault() : void 0,
|
|
2133
|
+
onDrop: l ? ($) => {
|
|
2134
|
+
$.preventDefault(), I(null), F(null);
|
|
1923
2135
|
} : void 0,
|
|
1924
|
-
children:
|
|
2136
|
+
children: w.map(($) => E($))
|
|
1925
2137
|
}
|
|
1926
2138
|
);
|
|
1927
2139
|
}
|
|
1928
|
-
function
|
|
1929
|
-
const [a, h] =
|
|
1930
|
-
|
|
1931
|
-
const
|
|
2140
|
+
function dn({ total: n, pageSize: o = 10, page: d, onChange: l, style: f }) {
|
|
2141
|
+
const [a, h] = N(d || 1), u = Math.ceil(n / o);
|
|
2142
|
+
_(q, []);
|
|
2143
|
+
const x = (r) => {
|
|
1932
2144
|
const i = Math.min(Math.max(1, r), u);
|
|
1933
|
-
h(i),
|
|
1934
|
-
},
|
|
2145
|
+
h(i), l == null || l(i);
|
|
2146
|
+
}, w = ue(() => {
|
|
1935
2147
|
const r = [];
|
|
1936
2148
|
for (let c = Math.max(1, a - 2); c <= Math.min(u, a + 2); c++) r.push(c);
|
|
1937
2149
|
return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < u && (r[r.length - 1] < u - 1 && r.push("..."), r.push(u)), r;
|
|
1938
2150
|
}, [a, u]);
|
|
1939
|
-
return /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
|
|
2152
|
+
/* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
|
|
1941
2153
|
(a - 1) * o + 1,
|
|
1942
2154
|
"–",
|
|
1943
2155
|
Math.min(a * o, n),
|
|
1944
2156
|
" of ",
|
|
1945
2157
|
n
|
|
1946
2158
|
] }),
|
|
1947
|
-
[["«", 1], ["‹", a - 1]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () =>
|
|
1948
|
-
|
|
1949
|
-
[["›", a + 1], ["»", u]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === u, onClick: () =>
|
|
2159
|
+
[["«", 1], ["‹", a - 1]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => x(i), children: r }, r)),
|
|
2160
|
+
w.map((r, i) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && x(r), className: `dhx dhx-btn ${r === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, i)),
|
|
2161
|
+
[["›", a + 1], ["»", u]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === u, onClick: () => x(i), children: r }, r))
|
|
1950
2162
|
] });
|
|
1951
2163
|
}
|
|
1952
|
-
function
|
|
1953
|
-
const [f, a] =
|
|
1954
|
-
|
|
1955
|
-
const r = (
|
|
1956
|
-
a((
|
|
1957
|
-
}, i = (
|
|
1958
|
-
const
|
|
1959
|
-
return
|
|
1960
|
-
!
|
|
1961
|
-
}),
|
|
2164
|
+
function cn({ config: n = {}, defaultValues: o = {}, onSubmit: d, style: l }) {
|
|
2165
|
+
const [f, a] = N(o), [h, u] = N({}), [x, w] = N(null);
|
|
2166
|
+
_(q, []);
|
|
2167
|
+
const r = (s, b) => {
|
|
2168
|
+
a((M) => ({ ...M, [s]: b })), u((M) => ({ ...M, [s]: null }));
|
|
2169
|
+
}, i = (s) => {
|
|
2170
|
+
const b = [];
|
|
2171
|
+
return s.flat().forEach((M) => {
|
|
2172
|
+
!M || typeof M != "object" || !("name" in M) || (b.push(M), M.type === "fieldset" && M.rows && b.push(...i(M.rows)));
|
|
2173
|
+
}), b;
|
|
1962
2174
|
}, c = () => {
|
|
1963
|
-
const
|
|
1964
|
-
return i(n.rows || []).forEach((
|
|
1965
|
-
|
|
1966
|
-
}), u(
|
|
1967
|
-
}, m = (
|
|
1968
|
-
const
|
|
1969
|
-
if (
|
|
1970
|
-
/* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children:
|
|
1971
|
-
(
|
|
1972
|
-
] },
|
|
1973
|
-
if (
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
] }, "lbl") : null,
|
|
2175
|
+
const s = {};
|
|
2176
|
+
return i(n.rows || []).forEach((b) => {
|
|
2177
|
+
b.required && !f[b.name] && (s[b.name] = `${b.label || b.name} is required`);
|
|
2178
|
+
}), u(s), Object.keys(s).length === 0;
|
|
2179
|
+
}, m = (s) => {
|
|
2180
|
+
const b = f[s.name] ?? s.value ?? "", M = h[s.name], D = s.labelWidth ?? n.labelWidth, R = D !== void 0 || s.labelPosition === "left";
|
|
2181
|
+
if (s.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
|
|
2182
|
+
/* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: s.label }),
|
|
2183
|
+
(s.rows || []).map((v) => m(v))
|
|
2184
|
+
] }, s.name);
|
|
2185
|
+
if (s.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: s.height || 16 } }, s.name);
|
|
2186
|
+
const z = D ? { minWidth: D, width: D, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, C = s.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...z }, children: [
|
|
2187
|
+
s.label,
|
|
2188
|
+
s.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
|
|
2189
|
+
] }, "lbl") : null, F = M ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: M }) : null, p = s.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
|
|
1978
2190
|
"ⓘ ",
|
|
1979
|
-
|
|
1980
|
-
] }) : null,
|
|
1981
|
-
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
|
|
1984
|
-
|
|
2191
|
+
s.helpMessage
|
|
2192
|
+
] }) : null, I = { key: s.name, className: "dhx-form-group" }, W = (v) => R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
2193
|
+
C,
|
|
2194
|
+
/* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2195
|
+
v,
|
|
2196
|
+
F,
|
|
1985
2197
|
p
|
|
1986
2198
|
] })
|
|
1987
|
-
] }) : /* @__PURE__ */
|
|
1988
|
-
$,
|
|
2199
|
+
] }) : /* @__PURE__ */ g("div", { ...I, children: [
|
|
1989
2200
|
C,
|
|
1990
|
-
|
|
2201
|
+
v,
|
|
2202
|
+
F,
|
|
1991
2203
|
p
|
|
1992
2204
|
] });
|
|
1993
|
-
if (!
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
|
|
2205
|
+
if (!s.type || s.type === "input") return W(
|
|
2206
|
+
/* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
|
|
2207
|
+
s.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: s.icon }),
|
|
1996
2208
|
/* @__PURE__ */ t(
|
|
1997
2209
|
"input",
|
|
1998
2210
|
{
|
|
1999
|
-
className: `dhx dhx-input${
|
|
2000
|
-
style: { borderColor:
|
|
2001
|
-
type:
|
|
2002
|
-
placeholder:
|
|
2003
|
-
value:
|
|
2004
|
-
onChange: (
|
|
2005
|
-
disabled:
|
|
2211
|
+
className: `dhx dhx-input${s.icon ? " dhx-input--with-icon" : ""}`,
|
|
2212
|
+
style: { borderColor: M ? e.danger : void 0 },
|
|
2213
|
+
type: s.inputType || "text",
|
|
2214
|
+
placeholder: s.placeholder,
|
|
2215
|
+
value: b,
|
|
2216
|
+
onChange: (v) => r(s.name, v.target.value),
|
|
2217
|
+
disabled: s.disabled
|
|
2006
2218
|
}
|
|
2007
2219
|
)
|
|
2008
2220
|
] })
|
|
2009
2221
|
);
|
|
2010
|
-
if (
|
|
2222
|
+
if (s.type === "textarea") return W(
|
|
2011
2223
|
/* @__PURE__ */ t(
|
|
2012
2224
|
"textarea",
|
|
2013
2225
|
{
|
|
2014
2226
|
className: "dhx dhx-input",
|
|
2015
2227
|
style: { height: 80, resize: "vertical", padding: "8px 10px" },
|
|
2016
|
-
placeholder:
|
|
2017
|
-
value:
|
|
2018
|
-
onChange: (
|
|
2228
|
+
placeholder: s.placeholder,
|
|
2229
|
+
value: b,
|
|
2230
|
+
onChange: (v) => r(s.name, v.target.value)
|
|
2019
2231
|
}
|
|
2020
2232
|
)
|
|
2021
2233
|
);
|
|
2022
|
-
if (
|
|
2023
|
-
/* @__PURE__ */
|
|
2234
|
+
if (s.type === "select") return W(
|
|
2235
|
+
/* @__PURE__ */ g("select", { className: "dhx dhx-input", value: b, onChange: (v) => r(s.name, v.target.value), style: { cursor: "pointer" }, children: [
|
|
2024
2236
|
/* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
|
|
2025
|
-
(
|
|
2237
|
+
(s.options || []).map((v) => /* @__PURE__ */ t("option", { value: v.value, children: v.label || v.value }, v.value))
|
|
2026
2238
|
] })
|
|
2027
2239
|
);
|
|
2028
|
-
if (
|
|
2029
|
-
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value:
|
|
2240
|
+
if (s.type === "datepicker") return W(
|
|
2241
|
+
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: b, onChange: (v) => r(s.name, v.target.value) })
|
|
2030
2242
|
);
|
|
2031
|
-
if (
|
|
2032
|
-
const
|
|
2033
|
-
/* @__PURE__ */
|
|
2243
|
+
if (s.type === "timepicker") {
|
|
2244
|
+
const v = f[s.name] ?? { h: 12, m: 0, ampm: "AM" }, X = !!f[s.name], J = X ? `${String(v.h).padStart(2, "0")}:${String(v.m).padStart(2, "0")}${v.ampm ? " " + v.ampm : ""}` : s.placeholder || "Click to select", se = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
2245
|
+
/* @__PURE__ */ g(
|
|
2034
2246
|
"div",
|
|
2035
2247
|
{
|
|
2036
2248
|
className: "dhx dhx-input",
|
|
2037
2249
|
style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
2038
|
-
onClick: () =>
|
|
2250
|
+
onClick: () => w(x === s.name ? null : s.name),
|
|
2039
2251
|
children: [
|
|
2040
|
-
/* @__PURE__ */ t("span", { style: { color: X ? e.text : e.textMut }, children:
|
|
2252
|
+
/* @__PURE__ */ t("span", { style: { color: X ? e.text : e.textMut }, children: J }),
|
|
2041
2253
|
/* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
|
|
2042
2254
|
]
|
|
2043
2255
|
}
|
|
2044
2256
|
),
|
|
2045
|
-
|
|
2046
|
-
r(
|
|
2257
|
+
x === s.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(At, { value: v, controls: !0, onChange: (U) => {
|
|
2258
|
+
r(s.name, U), w(null);
|
|
2047
2259
|
} }) })
|
|
2048
2260
|
] });
|
|
2049
|
-
return
|
|
2261
|
+
return W(se);
|
|
2050
2262
|
}
|
|
2051
|
-
if (
|
|
2052
|
-
/* @__PURE__ */
|
|
2263
|
+
if (s.type === "colorpicker") return W(
|
|
2264
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
2053
2265
|
/* @__PURE__ */ t(
|
|
2054
2266
|
"input",
|
|
2055
2267
|
{
|
|
2056
2268
|
type: "color",
|
|
2057
|
-
value:
|
|
2058
|
-
onChange: (
|
|
2269
|
+
value: b || "#000000",
|
|
2270
|
+
onChange: (v) => r(s.name, v.target.value),
|
|
2059
2271
|
style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
|
|
2060
2272
|
}
|
|
2061
2273
|
),
|
|
2062
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children:
|
|
2274
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: b || "#000000" })
|
|
2063
2275
|
] })
|
|
2064
2276
|
);
|
|
2065
|
-
if (
|
|
2066
|
-
/* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children:
|
|
2277
|
+
if (s.type === "text") return W(
|
|
2278
|
+
/* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: s.value })
|
|
2067
2279
|
);
|
|
2068
|
-
if (
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
2073
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children:
|
|
2280
|
+
if (s.type === "checkbox") return /* @__PURE__ */ g("div", { ...I, children: [
|
|
2281
|
+
R ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
2282
|
+
D && /* @__PURE__ */ t("div", { style: { width: D, flexShrink: 0 } }),
|
|
2283
|
+
/* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
2284
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (v) => r(s.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
2285
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: s.label })
|
|
2074
2286
|
] })
|
|
2075
|
-
] }) : /* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
2077
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children:
|
|
2287
|
+
] }) : /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
2288
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (v) => r(s.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
2289
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: s.label })
|
|
2078
2290
|
] }),
|
|
2079
2291
|
p
|
|
2080
2292
|
] });
|
|
2081
|
-
if (
|
|
2082
|
-
const
|
|
2293
|
+
if (s.type === "radio") {
|
|
2294
|
+
const v = (s.options || []).map((X) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
|
|
2083
2295
|
/* @__PURE__ */ t(
|
|
2084
2296
|
"input",
|
|
2085
2297
|
{
|
|
2086
2298
|
type: "radio",
|
|
2087
|
-
name:
|
|
2299
|
+
name: s.name,
|
|
2088
2300
|
value: X.value,
|
|
2089
|
-
checked:
|
|
2090
|
-
onChange: () => r(
|
|
2301
|
+
checked: b === X.value,
|
|
2302
|
+
onChange: () => r(s.name, X.value),
|
|
2091
2303
|
style: { accentColor: e.primary, cursor: "pointer" }
|
|
2092
2304
|
}
|
|
2093
2305
|
),
|
|
2094
2306
|
X.label || X.value
|
|
2095
2307
|
] }, X.value));
|
|
2096
|
-
return
|
|
2097
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children:
|
|
2308
|
+
return W(
|
|
2309
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: v })
|
|
2098
2310
|
);
|
|
2099
2311
|
}
|
|
2100
|
-
if (
|
|
2101
|
-
|
|
2102
|
-
/* @__PURE__ */
|
|
2312
|
+
if (s.type === "slider") return R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
2313
|
+
C,
|
|
2314
|
+
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
2103
2315
|
/* @__PURE__ */ t(
|
|
2104
|
-
|
|
2316
|
+
He,
|
|
2105
2317
|
{
|
|
2106
|
-
min:
|
|
2107
|
-
max:
|
|
2108
|
-
step:
|
|
2109
|
-
value:
|
|
2110
|
-
range:
|
|
2111
|
-
onChange: (
|
|
2318
|
+
min: s.min,
|
|
2319
|
+
max: s.max,
|
|
2320
|
+
step: s.step,
|
|
2321
|
+
value: b || s.min,
|
|
2322
|
+
range: s.range,
|
|
2323
|
+
onChange: (v) => r(s.name, v)
|
|
2112
2324
|
}
|
|
2113
2325
|
),
|
|
2114
2326
|
p
|
|
2115
2327
|
] })
|
|
2116
|
-
] }) : /* @__PURE__ */
|
|
2328
|
+
] }) : /* @__PURE__ */ g("div", { ...I, children: [
|
|
2117
2329
|
/* @__PURE__ */ t(
|
|
2118
|
-
|
|
2330
|
+
He,
|
|
2119
2331
|
{
|
|
2120
|
-
label:
|
|
2121
|
-
min:
|
|
2122
|
-
max:
|
|
2123
|
-
step:
|
|
2124
|
-
value:
|
|
2125
|
-
range:
|
|
2126
|
-
onChange: (
|
|
2332
|
+
label: s.label,
|
|
2333
|
+
min: s.min,
|
|
2334
|
+
max: s.max,
|
|
2335
|
+
step: s.step,
|
|
2336
|
+
value: b || s.min,
|
|
2337
|
+
range: s.range,
|
|
2338
|
+
onChange: (v) => r(s.name, v)
|
|
2127
2339
|
}
|
|
2128
2340
|
),
|
|
2129
2341
|
p
|
|
2130
2342
|
] });
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2133
|
-
/* @__PURE__ */
|
|
2343
|
+
if (s.type === "combo") return R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
2344
|
+
C,
|
|
2345
|
+
/* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
|
|
2134
2346
|
/* @__PURE__ */ t(
|
|
2135
|
-
|
|
2347
|
+
Be,
|
|
2136
2348
|
{
|
|
2137
|
-
data:
|
|
2138
|
-
multiselection:
|
|
2139
|
-
placeholder:
|
|
2140
|
-
value:
|
|
2141
|
-
onChange: (
|
|
2349
|
+
data: s.data || [],
|
|
2350
|
+
multiselection: s.multiselection,
|
|
2351
|
+
placeholder: s.placeholder || "Select...",
|
|
2352
|
+
value: b || (s.multiselection ? [] : null),
|
|
2353
|
+
onChange: (v) => r(s.name, v)
|
|
2142
2354
|
}
|
|
2143
2355
|
),
|
|
2144
|
-
|
|
2356
|
+
F,
|
|
2145
2357
|
p
|
|
2146
2358
|
] })
|
|
2147
|
-
] }) : /* @__PURE__ */
|
|
2359
|
+
] }) : /* @__PURE__ */ g("div", { ...I, children: [
|
|
2148
2360
|
/* @__PURE__ */ t(
|
|
2149
|
-
|
|
2361
|
+
Be,
|
|
2150
2362
|
{
|
|
2151
|
-
label:
|
|
2152
|
-
data:
|
|
2153
|
-
multiselection:
|
|
2154
|
-
placeholder:
|
|
2155
|
-
value:
|
|
2156
|
-
onChange: (
|
|
2363
|
+
label: s.label,
|
|
2364
|
+
data: s.data || [],
|
|
2365
|
+
multiselection: s.multiselection,
|
|
2366
|
+
placeholder: s.placeholder || "Select...",
|
|
2367
|
+
value: b || (s.multiselection ? [] : null),
|
|
2368
|
+
onChange: (v) => r(s.name, v)
|
|
2157
2369
|
}
|
|
2158
2370
|
),
|
|
2159
|
-
|
|
2371
|
+
F,
|
|
2160
2372
|
p
|
|
2161
2373
|
] });
|
|
2162
|
-
if (
|
|
2163
|
-
const
|
|
2164
|
-
return /* @__PURE__ */
|
|
2165
|
-
|
|
2166
|
-
/* @__PURE__ */ t("div", { style: { width:
|
|
2167
|
-
/* @__PURE__ */
|
|
2168
|
-
/* @__PURE__ */ t(Pe, { on:
|
|
2374
|
+
if (s.type === "toggle") {
|
|
2375
|
+
const v = !!b, X = v ? s.icon : s.offIcon || s.icon, J = v ? s.text || s.label : s.offText || s.text || s.label;
|
|
2376
|
+
return /* @__PURE__ */ g("div", { ...I, children: [
|
|
2377
|
+
R && D && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
2378
|
+
/* @__PURE__ */ t("div", { style: { width: D, flexShrink: 0 } }),
|
|
2379
|
+
/* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
2380
|
+
/* @__PURE__ */ t(Pe, { on: v, onClick: () => r(s.name, !b) }),
|
|
2169
2381
|
X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
|
|
2170
|
-
|
|
2382
|
+
J && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: J })
|
|
2171
2383
|
] })
|
|
2172
2384
|
] }),
|
|
2173
|
-
!
|
|
2174
|
-
/* @__PURE__ */ t(Pe, { on:
|
|
2385
|
+
!R && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
|
|
2386
|
+
/* @__PURE__ */ t(Pe, { on: v, onClick: () => r(s.name, !b) }),
|
|
2175
2387
|
X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
|
|
2176
|
-
|
|
2388
|
+
J && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: J })
|
|
2177
2389
|
] }),
|
|
2178
2390
|
p
|
|
2179
2391
|
] });
|
|
2180
2392
|
}
|
|
2181
2393
|
return null;
|
|
2182
|
-
},
|
|
2183
|
-
(
|
|
2394
|
+
}, S = (s) => s.map(
|
|
2395
|
+
(b, M) => Array.isArray(b) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: b.map(m) }, M) : m(b)
|
|
2184
2396
|
);
|
|
2185
|
-
return /* @__PURE__ */
|
|
2186
|
-
|
|
2187
|
-
(n.buttons || d) && /* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...l }, children: [
|
|
2398
|
+
S(n.rows || []),
|
|
2399
|
+
(n.buttons || d) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
|
|
2188
2400
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c() && (d == null ? void 0 : d(f)), children: n.submitText || "Submit" }),
|
|
2189
2401
|
n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
|
|
2190
2402
|
a(o), u({});
|
|
@@ -2193,45 +2405,45 @@ function sn({ config: n = {}, defaultValues: o = {}, onSubmit: d, style: s }) {
|
|
|
2193
2405
|
] });
|
|
2194
2406
|
}
|
|
2195
2407
|
function Pe({ on: n, onClick: o }) {
|
|
2196
|
-
return /* @__PURE__ */
|
|
2408
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: o, children: [
|
|
2197
2409
|
/* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
|
|
2198
2410
|
/* @__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)" } })
|
|
2199
2411
|
] });
|
|
2200
2412
|
}
|
|
2201
|
-
function
|
|
2413
|
+
function De(n) {
|
|
2202
2414
|
const o = [];
|
|
2203
2415
|
for (const d of n)
|
|
2204
|
-
d.type === "block" ? o.push(...
|
|
2416
|
+
d.type === "block" ? o.push(...De(d.items || [])) : o.push(d);
|
|
2205
2417
|
return o;
|
|
2206
2418
|
}
|
|
2207
|
-
function
|
|
2208
|
-
|
|
2209
|
-
const [
|
|
2419
|
+
function un({ items: n = [], onAction: o, style: d }) {
|
|
2420
|
+
_(q, []);
|
|
2421
|
+
const [l, f] = N(() => {
|
|
2210
2422
|
const i = {};
|
|
2211
|
-
for (const c of
|
|
2423
|
+
for (const c of De(n))
|
|
2212
2424
|
c.id && (i[c.id] = !!c.active);
|
|
2213
2425
|
return i;
|
|
2214
|
-
}), a =
|
|
2426
|
+
}), a = De(n), h = (i) => {
|
|
2215
2427
|
var c;
|
|
2216
2428
|
if (!i.disabled) {
|
|
2217
2429
|
if (i.id)
|
|
2218
2430
|
if (i.group) {
|
|
2219
|
-
const m = a.filter((
|
|
2220
|
-
f((
|
|
2221
|
-
const
|
|
2222
|
-
for (const
|
|
2223
|
-
return
|
|
2431
|
+
const m = a.filter((S) => S.group === i.group && S.id);
|
|
2432
|
+
f((S) => {
|
|
2433
|
+
const s = { ...S };
|
|
2434
|
+
for (const b of m) s[b.id] = !1;
|
|
2435
|
+
return s[i.id] = !0, s;
|
|
2224
2436
|
});
|
|
2225
2437
|
} else i.twoState && f((m) => ({ ...m, [i.id]: !m[i.id] }));
|
|
2226
2438
|
(c = i.onClick) == null || c.call(i, i), i.id && (o == null || o(i.id, i));
|
|
2227
2439
|
}
|
|
2228
2440
|
}, u = (i, c) => {
|
|
2229
|
-
var
|
|
2441
|
+
var b;
|
|
2230
2442
|
if (i.hidden) return null;
|
|
2231
|
-
const m = i.value ?? i.text,
|
|
2232
|
-
return i.type === "separator" || i.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : i.type === "input" ? /* @__PURE__ */
|
|
2443
|
+
const m = i.value ?? i.text, S = i.size === "auto", s = i.id !== void 0 ? l[i.id] ?? !!i.active : !!i.active;
|
|
2444
|
+
return i.type === "separator" || i.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : i.type === "input" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
|
|
2233
2445
|
i.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: i.label }),
|
|
2234
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
2235
2447
|
i.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: i.icon }),
|
|
2236
2448
|
/* @__PURE__ */ t(
|
|
2237
2449
|
"input",
|
|
@@ -2240,9 +2452,9 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2240
2452
|
style: { width: i.width || 110, height: 26, fontSize: 12, paddingLeft: i.icon ? 24 : void 0 },
|
|
2241
2453
|
placeholder: i.placeholder,
|
|
2242
2454
|
defaultValue: i.value,
|
|
2243
|
-
onChange: (
|
|
2244
|
-
var
|
|
2245
|
-
return (
|
|
2455
|
+
onChange: (M) => {
|
|
2456
|
+
var D;
|
|
2457
|
+
return (D = i.onChange) == null ? void 0 : D.call(i, M.target.value);
|
|
2246
2458
|
}
|
|
2247
2459
|
}
|
|
2248
2460
|
)
|
|
@@ -2253,41 +2465,41 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2253
2465
|
className: "dhx dhx-input",
|
|
2254
2466
|
style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: i.width },
|
|
2255
2467
|
defaultValue: i.value,
|
|
2256
|
-
onChange: (
|
|
2257
|
-
var
|
|
2258
|
-
return (
|
|
2468
|
+
onChange: (M) => {
|
|
2469
|
+
var D;
|
|
2470
|
+
return (D = i.onChange) == null ? void 0 : D.call(i, M.target.value);
|
|
2259
2471
|
},
|
|
2260
|
-
children: (
|
|
2472
|
+
children: (b = i.items) == null ? void 0 : b.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.value }, M.value))
|
|
2261
2473
|
},
|
|
2262
2474
|
c
|
|
2263
|
-
) : /* @__PURE__ */
|
|
2475
|
+
) : /* @__PURE__ */ g(
|
|
2264
2476
|
"button",
|
|
2265
2477
|
{
|
|
2266
2478
|
title: i.tooltip,
|
|
2267
2479
|
disabled: i.disabled,
|
|
2268
2480
|
className: "dhx dhx-btn dhx-btn-ghost",
|
|
2269
2481
|
style: {
|
|
2270
|
-
flexDirection:
|
|
2271
|
-
alignSelf:
|
|
2482
|
+
flexDirection: S ? "column" : "row",
|
|
2483
|
+
alignSelf: S ? "stretch" : "center",
|
|
2272
2484
|
justifyContent: "center",
|
|
2273
|
-
minHeight:
|
|
2274
|
-
padding:
|
|
2275
|
-
gap:
|
|
2485
|
+
minHeight: S ? 48 : 26,
|
|
2486
|
+
padding: S ? "6px 10px" : "0 8px",
|
|
2487
|
+
gap: S ? 4 : 5,
|
|
2276
2488
|
position: "relative",
|
|
2277
|
-
background:
|
|
2278
|
-
color:
|
|
2489
|
+
background: s ? e.primaryLt : "transparent",
|
|
2490
|
+
color: s ? e.primary : i.disabled ? e.textMut : e.text,
|
|
2279
2491
|
opacity: i.disabled ? 0.55 : 1,
|
|
2280
2492
|
cursor: i.disabled ? "not-allowed" : "pointer"
|
|
2281
2493
|
},
|
|
2282
2494
|
onClick: () => h(i),
|
|
2283
2495
|
children: [
|
|
2284
|
-
i.icon && /* @__PURE__ */ t("span", { style: { fontSize:
|
|
2496
|
+
i.icon && /* @__PURE__ */ t("span", { style: { fontSize: S ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: i.icon }),
|
|
2285
2497
|
m && /* @__PURE__ */ t("span", { style: {
|
|
2286
2498
|
fontSize: 10,
|
|
2287
|
-
maxWidth:
|
|
2288
|
-
textAlign:
|
|
2499
|
+
maxWidth: S ? 64 : void 0,
|
|
2500
|
+
textAlign: S ? "center" : "left",
|
|
2289
2501
|
lineHeight: 1.2,
|
|
2290
|
-
whiteSpace:
|
|
2502
|
+
whiteSpace: S ? "normal" : "nowrap"
|
|
2291
2503
|
}, children: m }),
|
|
2292
2504
|
i.count !== void 0 && /* @__PURE__ */ t("span", { style: {
|
|
2293
2505
|
position: "absolute",
|
|
@@ -2310,7 +2522,7 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2310
2522
|
},
|
|
2311
2523
|
c
|
|
2312
2524
|
);
|
|
2313
|
-
},
|
|
2525
|
+
}, x = (i, c) => {
|
|
2314
2526
|
var m;
|
|
2315
2527
|
return /* @__PURE__ */ t("div", { style: {
|
|
2316
2528
|
display: "flex",
|
|
@@ -2318,12 +2530,12 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2318
2530
|
alignItems: i.direction === "col" ? "flex-start" : "center",
|
|
2319
2531
|
gap: 2
|
|
2320
2532
|
}, children: (m = i.items) == null ? void 0 : m.map(
|
|
2321
|
-
(
|
|
2533
|
+
(S, s) => S.type === "block" ? x(S, `${c}-${s}`) : u(S, `${c}-${s}`)
|
|
2322
2534
|
) }, c);
|
|
2323
|
-
},
|
|
2324
|
-
var
|
|
2535
|
+
}, w = (i, c) => {
|
|
2536
|
+
var S;
|
|
2325
2537
|
const m = i.title || i.label;
|
|
2326
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ g("div", { style: {
|
|
2327
2539
|
display: "flex",
|
|
2328
2540
|
flexDirection: "column",
|
|
2329
2541
|
alignItems: "stretch",
|
|
@@ -2337,8 +2549,8 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2337
2549
|
alignItems: i.direction === "col" ? "stretch" : "center",
|
|
2338
2550
|
gap: 2,
|
|
2339
2551
|
flex: 1
|
|
2340
|
-
}, children: (
|
|
2341
|
-
(
|
|
2552
|
+
}, children: (S = i.items) == null ? void 0 : S.map(
|
|
2553
|
+
(s, b) => s.type === "block" ? x(s, b) : u(s, b)
|
|
2342
2554
|
) }),
|
|
2343
2555
|
m && /* @__PURE__ */ t("div", { style: {
|
|
2344
2556
|
fontSize: 10,
|
|
@@ -2349,7 +2561,7 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2349
2561
|
borderTop: `1px solid ${e.border}`
|
|
2350
2562
|
}, children: m })
|
|
2351
2563
|
] }, c);
|
|
2352
|
-
}, r = (i, c) => i.type === "block" ?
|
|
2564
|
+
}, r = (i, c) => i.type === "block" ? w(i, c) : u(i, c);
|
|
2353
2565
|
return /* @__PURE__ */ t("div", { className: "dhx", style: {
|
|
2354
2566
|
display: "flex",
|
|
2355
2567
|
alignItems: "stretch",
|
|
@@ -2361,7 +2573,7 @@ function an({ items: n = [], onAction: o, style: d }) {
|
|
|
2361
2573
|
...d
|
|
2362
2574
|
}, children: n.map(r) });
|
|
2363
2575
|
}
|
|
2364
|
-
function
|
|
2576
|
+
function Oe({ count: n }) {
|
|
2365
2577
|
return /* @__PURE__ */ t("span", { style: {
|
|
2366
2578
|
position: "absolute",
|
|
2367
2579
|
top: 3,
|
|
@@ -2381,25 +2593,25 @@ function je({ count: n }) {
|
|
|
2381
2593
|
pointerEvents: "none"
|
|
2382
2594
|
}, children: n });
|
|
2383
2595
|
}
|
|
2384
|
-
function
|
|
2385
|
-
const [a, h] =
|
|
2596
|
+
function pn({ logo: n, items: o = [], vertical: d = !1, onAction: l, style: f }) {
|
|
2597
|
+
const [a, h] = N(null), [u, x] = N(() => {
|
|
2386
2598
|
const c = {};
|
|
2387
2599
|
return o.forEach((m) => {
|
|
2388
2600
|
m.id && m.twoState && m.active && (c[m.id] = !0);
|
|
2389
2601
|
}), c;
|
|
2390
|
-
}),
|
|
2391
|
-
|
|
2602
|
+
}), w = oe(null);
|
|
2603
|
+
_(q, []), ge(w, ae(() => h(null), []));
|
|
2392
2604
|
const r = (c, m) => {
|
|
2393
|
-
var
|
|
2605
|
+
var S, s;
|
|
2394
2606
|
if (!c.disabled) {
|
|
2395
|
-
if (c.twoState && c.id &&
|
|
2396
|
-
h((
|
|
2607
|
+
if (c.twoState && c.id && x((b) => ({ ...b, [c.id]: !b[c.id] })), (S = c.items) != null && S.length) {
|
|
2608
|
+
h((b) => b === m ? null : m);
|
|
2397
2609
|
return;
|
|
2398
2610
|
}
|
|
2399
|
-
(
|
|
2611
|
+
(s = c.onClick) == null || s.call(c, c.id || ""), l == null || l(c.id || "");
|
|
2400
2612
|
}
|
|
2401
2613
|
}, i = (c, m) => {
|
|
2402
|
-
var
|
|
2614
|
+
var M;
|
|
2403
2615
|
if (c.hidden) return null;
|
|
2404
2616
|
if (c.type === "separator") return /* @__PURE__ */ t("div", { style: {
|
|
2405
2617
|
[d ? "height" : "width"]: 1,
|
|
@@ -2408,7 +2620,7 @@ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f })
|
|
|
2408
2620
|
alignSelf: "stretch"
|
|
2409
2621
|
} }, m);
|
|
2410
2622
|
if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, m);
|
|
2411
|
-
if (c.type === "input") return /* @__PURE__ */
|
|
2623
|
+
if (c.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
|
|
2412
2624
|
c.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: c.icon }),
|
|
2413
2625
|
/* @__PURE__ */ t(
|
|
2414
2626
|
"input",
|
|
@@ -2416,14 +2628,14 @@ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f })
|
|
|
2416
2628
|
className: "dhx dhx-input",
|
|
2417
2629
|
style: { width: c.width || 200, height: 28, paddingLeft: c.icon ? 30 : void 0 },
|
|
2418
2630
|
placeholder: c.placeholder,
|
|
2419
|
-
onChange: (
|
|
2420
|
-
var
|
|
2421
|
-
return (
|
|
2631
|
+
onChange: (D) => {
|
|
2632
|
+
var R;
|
|
2633
|
+
return (R = c.onChange) == null ? void 0 : R.call(c, D.target.value);
|
|
2422
2634
|
}
|
|
2423
2635
|
}
|
|
2424
2636
|
)
|
|
2425
2637
|
] }, m);
|
|
2426
|
-
if (c.type === "imageButton") return /* @__PURE__ */
|
|
2638
|
+
if (c.type === "imageButton") return /* @__PURE__ */ g(
|
|
2427
2639
|
"button",
|
|
2428
2640
|
{
|
|
2429
2641
|
title: c.tooltip,
|
|
@@ -2443,17 +2655,17 @@ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f })
|
|
|
2443
2655
|
onClick: () => r(c, m),
|
|
2444
2656
|
children: [
|
|
2445
2657
|
c.src && /* @__PURE__ */ t("img", { src: c.src, alt: c.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
|
|
2446
|
-
c.count !== void 0 && /* @__PURE__ */ t(
|
|
2658
|
+
c.count !== void 0 && /* @__PURE__ */ t(Oe, { count: c.count })
|
|
2447
2659
|
]
|
|
2448
2660
|
},
|
|
2449
2661
|
m
|
|
2450
2662
|
);
|
|
2451
|
-
const
|
|
2663
|
+
const S = !!(c.twoState && c.id && u[c.id]), s = !!((M = c.items) != null && M.length), b = {
|
|
2452
2664
|
position: "relative",
|
|
2453
2665
|
height: d ? 40 : 36,
|
|
2454
2666
|
gap: 6,
|
|
2455
|
-
background:
|
|
2456
|
-
color:
|
|
2667
|
+
background: S ? e.primaryLt : "transparent",
|
|
2668
|
+
color: S ? e.primary : c.disabled ? e.textMut : e.text,
|
|
2457
2669
|
opacity: c.disabled ? 0.55 : 1,
|
|
2458
2670
|
cursor: c.disabled ? "not-allowed" : "pointer",
|
|
2459
2671
|
...d ? {
|
|
@@ -2463,40 +2675,40 @@ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f })
|
|
|
2463
2675
|
borderRadius: 0
|
|
2464
2676
|
} : {}
|
|
2465
2677
|
};
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */
|
|
2678
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
2679
|
+
/* @__PURE__ */ g(
|
|
2468
2680
|
"button",
|
|
2469
2681
|
{
|
|
2470
2682
|
className: "dhx dhx-btn dhx-btn-ghost",
|
|
2471
2683
|
title: c.tooltip,
|
|
2472
2684
|
disabled: c.disabled,
|
|
2473
|
-
style:
|
|
2685
|
+
style: b,
|
|
2474
2686
|
onClick: () => r(c, m),
|
|
2475
2687
|
children: [
|
|
2476
2688
|
c.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: c.icon }),
|
|
2477
2689
|
c.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: c.value }),
|
|
2478
|
-
|
|
2479
|
-
c.count !== void 0 && /* @__PURE__ */ t(
|
|
2690
|
+
s && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
|
|
2691
|
+
c.count !== void 0 && /* @__PURE__ */ t(Oe, { count: c.count })
|
|
2480
2692
|
]
|
|
2481
2693
|
}
|
|
2482
2694
|
),
|
|
2483
|
-
|
|
2484
|
-
|
|
2695
|
+
s && a === m && /* @__PURE__ */ t(
|
|
2696
|
+
be,
|
|
2485
2697
|
{
|
|
2486
2698
|
items: c.items,
|
|
2487
|
-
onSelect: (
|
|
2488
|
-
var
|
|
2489
|
-
h(null),
|
|
2699
|
+
onSelect: (D) => {
|
|
2700
|
+
var R;
|
|
2701
|
+
h(null), D.id && ((R = c.onClick) == null || R.call(c, D.id), l == null || l(D.id));
|
|
2490
2702
|
},
|
|
2491
2703
|
style: d ? { left: "100%", top: 0 } : { top: "100%" }
|
|
2492
2704
|
}
|
|
2493
2705
|
)
|
|
2494
2706
|
] }, m);
|
|
2495
2707
|
};
|
|
2496
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ g(
|
|
2497
2709
|
"nav",
|
|
2498
2710
|
{
|
|
2499
|
-
ref:
|
|
2711
|
+
ref: w,
|
|
2500
2712
|
className: "dhx",
|
|
2501
2713
|
style: {
|
|
2502
2714
|
display: "flex",
|
|
@@ -2528,35 +2740,35 @@ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f })
|
|
|
2528
2740
|
);
|
|
2529
2741
|
}
|
|
2530
2742
|
export {
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2743
|
+
_t as Button,
|
|
2744
|
+
Zt as Calendar,
|
|
2745
|
+
Qt as Chart,
|
|
2746
|
+
en as Colorpicker,
|
|
2747
|
+
Be as Combobox,
|
|
2748
|
+
Xt as ContextMenu,
|
|
2749
|
+
sn as DataView,
|
|
2750
|
+
cn as Form,
|
|
2751
|
+
Ut as Grid,
|
|
2752
|
+
Dt as Layout,
|
|
2753
|
+
ln as List,
|
|
2754
|
+
Vt as Menu,
|
|
2755
|
+
be as MenuDropdown,
|
|
2756
|
+
Ke as MessageContext,
|
|
2757
|
+
rn as MessageProvider,
|
|
2758
|
+
pn as Navbar,
|
|
2759
|
+
dn as Pagination,
|
|
2760
|
+
tn as Popup,
|
|
2761
|
+
un as Ribbon,
|
|
2762
|
+
Gt as Sidebar,
|
|
2763
|
+
He as Slider,
|
|
2764
|
+
Jt as Tabbar,
|
|
2765
|
+
At as Timepicker,
|
|
2766
|
+
qt as Toolbar,
|
|
2767
|
+
an as Tree,
|
|
2768
|
+
nn as Window,
|
|
2557
2769
|
e as tokens,
|
|
2558
|
-
|
|
2770
|
+
ge as useClickOutside,
|
|
2559
2771
|
St as useDrag,
|
|
2560
|
-
|
|
2772
|
+
on as useMessage
|
|
2561
2773
|
};
|
|
2562
2774
|
//# sourceMappingURL=dhx-react-suite.js.map
|