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