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