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