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