dhx-react-suite 1.0.4 → 1.0.6
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { Tooltip as
|
|
1
|
+
import { jsxs as u, jsx as t, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as A, useState as N, useRef as O, useMemo as J, useCallback as K, createContext as Le, useContext as Re } from "react";
|
|
3
|
+
import { Tooltip as We, Legend as Ee, CartesianGrid as Ae, XAxis as ce, YAxis as pe, BarChart as Be, Bar as He, LineChart as Pe, Line as je, AreaChart as Oe, Area as Ye, PieChart as Ke, Pie as Fe, Cell as Ve, RadarChart as _e, PolarGrid as Xe, PolarAngleAxis as qe, Radar as Ge, ScatterChart as Je, Scatter as Ue, ResponsiveContainer as Qe } from "recharts";
|
|
4
4
|
const e = {
|
|
5
5
|
primary: "#0288d1",
|
|
6
6
|
primaryDk: "#01579b",
|
|
@@ -20,11 +20,11 @@ const e = {
|
|
|
20
20
|
r: "4px",
|
|
21
21
|
rMd: "8px",
|
|
22
22
|
font: "'Segoe UI', system-ui, -apple-system, sans-serif"
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
if (typeof document > "u" || document.getElementById(
|
|
23
|
+
}, he = "dhx-react-styles";
|
|
24
|
+
function H() {
|
|
25
|
+
if (typeof document > "u" || document.getElementById(he)) return;
|
|
26
26
|
const n = document.createElement("style");
|
|
27
|
-
n.id =
|
|
27
|
+
n.id = he, n.textContent = `
|
|
28
28
|
*,*::before,*::after{box-sizing:border-box}
|
|
29
29
|
.dhx{font-family:${e.font};font-size:14px;color:${e.text}}
|
|
30
30
|
.dhx *{box-sizing:border-box}
|
|
@@ -66,136 +66,136 @@ function A() {
|
|
|
66
66
|
.dhx-tag-warning{background:#fff3e0;color:#e65100}
|
|
67
67
|
`, document.head.appendChild(n);
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const Ze = {
|
|
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 ut({
|
|
75
75
|
children: n,
|
|
76
|
-
variant:
|
|
77
|
-
size:
|
|
78
|
-
icon:
|
|
79
|
-
disabled:
|
|
80
|
-
onClick:
|
|
81
|
-
style:
|
|
76
|
+
variant: a = "primary",
|
|
77
|
+
size: h = "md",
|
|
78
|
+
icon: i,
|
|
79
|
+
disabled: g,
|
|
80
|
+
onClick: p,
|
|
81
|
+
style: x,
|
|
82
82
|
className: r = ""
|
|
83
83
|
}) {
|
|
84
|
-
return
|
|
84
|
+
return A(H, []), /* @__PURE__ */ u(
|
|
85
85
|
"button",
|
|
86
86
|
{
|
|
87
|
-
className: `dhx dhx-btn dhx-btn-${
|
|
88
|
-
style: {
|
|
89
|
-
disabled:
|
|
90
|
-
onClick:
|
|
87
|
+
className: `dhx dhx-btn dhx-btn-${a} ${r}`,
|
|
88
|
+
style: { ...Ze[h], ...x },
|
|
89
|
+
disabled: g,
|
|
90
|
+
onClick: p,
|
|
91
91
|
children: [
|
|
92
|
-
|
|
92
|
+
i && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i }),
|
|
93
93
|
n
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
var
|
|
102
|
-
if (
|
|
103
|
-
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } },
|
|
104
|
-
if (
|
|
105
|
-
return /* @__PURE__ */ t("div", { style: { flex: 1 } },
|
|
106
|
-
if (
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
98
|
+
function xt({ items: n = [], style: a }) {
|
|
99
|
+
A(H, []);
|
|
100
|
+
const h = (i, g) => {
|
|
101
|
+
var x;
|
|
102
|
+
if (i.type === "separator")
|
|
103
|
+
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, g);
|
|
104
|
+
if (i.type === "spacer")
|
|
105
|
+
return /* @__PURE__ */ t("div", { style: { flex: 1 } }, g);
|
|
106
|
+
if (i.type === "input")
|
|
107
|
+
return /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
108
|
+
i.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: i.label }),
|
|
109
109
|
/* @__PURE__ */ t(
|
|
110
110
|
"input",
|
|
111
111
|
{
|
|
112
112
|
className: "dhx dhx-input",
|
|
113
|
-
style: { width:
|
|
114
|
-
placeholder:
|
|
115
|
-
defaultValue:
|
|
113
|
+
style: { width: i.width || 140, height: 28 },
|
|
114
|
+
placeholder: i.placeholder,
|
|
115
|
+
defaultValue: i.value,
|
|
116
116
|
onChange: (r) => {
|
|
117
|
-
var
|
|
118
|
-
return (
|
|
117
|
+
var d;
|
|
118
|
+
return (d = i.onChange) == null ? void 0 : d.call(i, r.target.value);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
|
-
] },
|
|
123
|
-
if (
|
|
122
|
+
] }, g);
|
|
123
|
+
if (i.type === "select")
|
|
124
124
|
return /* @__PURE__ */ t(
|
|
125
125
|
"select",
|
|
126
126
|
{
|
|
127
127
|
className: "dhx dhx-input",
|
|
128
|
-
style: { width:
|
|
129
|
-
defaultValue:
|
|
128
|
+
style: { width: i.width || 100, height: 28, cursor: "pointer" },
|
|
129
|
+
defaultValue: i.value,
|
|
130
130
|
onChange: (r) => {
|
|
131
|
-
var
|
|
132
|
-
return (
|
|
131
|
+
var d;
|
|
132
|
+
return (d = i.onChange) == null ? void 0 : d.call(i, r.target.value);
|
|
133
133
|
},
|
|
134
|
-
children: (
|
|
134
|
+
children: (x = i.options) == null ? void 0 : x.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
g
|
|
137
137
|
);
|
|
138
|
-
const
|
|
139
|
-
return /* @__PURE__ */
|
|
138
|
+
const p = i.active;
|
|
139
|
+
return /* @__PURE__ */ u(
|
|
140
140
|
"button",
|
|
141
141
|
{
|
|
142
|
-
className: `dhx dhx-btn ${
|
|
143
|
-
style: { height: 32, gap: 4, ...
|
|
144
|
-
disabled:
|
|
142
|
+
className: `dhx dhx-btn ${p ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
|
|
143
|
+
style: { height: 32, gap: 4, ...i.twoState && p ? { background: e.primaryLt, color: e.primary, borderColor: `${e.primary}66` } : {} },
|
|
144
|
+
disabled: i.disabled,
|
|
145
145
|
onClick: () => {
|
|
146
146
|
var r;
|
|
147
|
-
return (r =
|
|
147
|
+
return (r = i.onClick) == null ? void 0 : r.call(i, i);
|
|
148
148
|
},
|
|
149
149
|
children: [
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
i.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i.icon }),
|
|
151
|
+
i.text && /* @__PURE__ */ t("span", { children: i.text })
|
|
152
152
|
]
|
|
153
153
|
},
|
|
154
|
-
|
|
154
|
+
g
|
|
155
155
|
);
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...
|
|
157
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...a }, children: n.map(h) });
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const [r,
|
|
161
|
-
|
|
162
|
-
const m = r ? 56 :
|
|
163
|
-
c(
|
|
164
|
-
},
|
|
159
|
+
function gt({ items: n = [], width: a = 240, collapsed: h, onSelect: i, header: g, footer: p, style: x }) {
|
|
160
|
+
const [r, d] = N(h ?? !1), [y, c] = N(null), [S, C] = N({});
|
|
161
|
+
A(H, []);
|
|
162
|
+
const m = r ? 56 : a, o = (z) => {
|
|
163
|
+
c(z.id), i == null || i(z);
|
|
164
|
+
}, k = (z, T = 0) => {
|
|
165
165
|
var b;
|
|
166
|
-
if (
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
166
|
+
if (z.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, z.id);
|
|
167
|
+
if (z.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: z.html || "" } }, z.id);
|
|
168
|
+
const D = (((b = z.items) == null ? void 0 : b.length) ?? 0) > 0, w = S[z.id], s = y === z.id;
|
|
169
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
170
|
+
/* @__PURE__ */ u(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
173
|
onClick: () => {
|
|
174
|
-
|
|
174
|
+
D && C((R) => ({ ...R, [z.id]: !R[z.id] })), o(z);
|
|
175
175
|
},
|
|
176
|
-
style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${r ? "0px" : `${12 +
|
|
177
|
-
onMouseEnter: (
|
|
178
|
-
onMouseLeave: (
|
|
176
|
+
style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${r ? "0px" : `${12 + T * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: r ? "center" : "flex-start", transition: "all .15s", background: s ? e.primaryLt : "transparent", color: s ? e.primary : e.text, userSelect: "none" },
|
|
177
|
+
onMouseEnter: (R) => !s && (R.currentTarget.style.background = e.bg),
|
|
178
|
+
onMouseLeave: (R) => !s && (R.currentTarget.style.background = "transparent"),
|
|
179
179
|
children: [
|
|
180
|
-
|
|
181
|
-
!r && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: s ? 600 : 400 }, children:
|
|
182
|
-
!r &&
|
|
183
|
-
!r &&
|
|
180
|
+
z.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: z.icon }),
|
|
181
|
+
!r && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: s ? 600 : 400 }, children: z.value }),
|
|
182
|
+
!r && z.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: z.count }),
|
|
183
|
+
!r && D && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: w ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
|
|
184
184
|
]
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
188
|
-
] },
|
|
187
|
+
D && w && !r && z.items.map((R) => k(R, T + 1))
|
|
188
|
+
] }, z.id);
|
|
189
189
|
};
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
193
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((
|
|
194
|
-
|
|
190
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { width: m, minWidth: m, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...x }, children: [
|
|
191
|
+
g && !r && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: g }),
|
|
192
|
+
/* @__PURE__ */ t("button", { onClick: () => d((z) => !z), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: r ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: r ? "☰" : "✕" }) }),
|
|
193
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((z) => k(z)) }),
|
|
194
|
+
p && !r && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: p })
|
|
195
195
|
] });
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const [
|
|
197
|
+
function et({ config: n }) {
|
|
198
|
+
const [a, h] = N(!1), i = {
|
|
199
199
|
position: "relative",
|
|
200
200
|
background: e.surface,
|
|
201
201
|
border: `1px solid ${e.border}`,
|
|
@@ -203,271 +203,439 @@ function ze({ config: n }) {
|
|
|
203
203
|
overflow: "hidden",
|
|
204
204
|
...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
|
|
205
205
|
...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
|
|
206
|
-
...
|
|
206
|
+
...a ? { flex: "0 0 auto" } : {}
|
|
207
207
|
};
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
n.header && /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ u("div", { style: i, children: [
|
|
209
|
+
n.header && /* @__PURE__ */ u("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: [
|
|
210
210
|
/* @__PURE__ */ t("span", { children: n.header }),
|
|
211
|
-
n.collapsable && /* @__PURE__ */ t("button", { onClick: () =>
|
|
211
|
+
n.collapsable && /* @__PURE__ */ t("button", { onClick: () => h((g) => !g), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: a ? "▼" : "▲" })
|
|
212
212
|
] }),
|
|
213
|
-
!
|
|
213
|
+
!a && /* @__PURE__ */ u("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
|
|
214
214
|
n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
|
|
215
|
-
(n.rows || n.cols) && /* @__PURE__ */ t(
|
|
215
|
+
(n.rows || n.cols) && /* @__PURE__ */ t(tt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
|
|
216
216
|
] })
|
|
217
217
|
] });
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
return
|
|
219
|
+
function tt({ rows: n, cols: a, type: h = "line", style: i, children: g }) {
|
|
220
|
+
A(H, []);
|
|
221
|
+
const p = h === "space" ? 12 : h === "wide" ? 8 : 1, x = n || a, r = !!n;
|
|
222
|
+
return x ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: r ? "column" : "row", gap: p, width: "100%", height: "100%", ...i }, children: x.map((d, y) => /* @__PURE__ */ t(et, { config: d }, d.id || y)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...i }, children: g });
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function ft({ views: n = [], mode: a = "top", tabAlign: h = "left", closable: i = [], disabled: g = [], defaultActive: p, onBeforeChange: x, onChange: r, style: d }) {
|
|
225
225
|
var s;
|
|
226
|
-
const [y, c] =
|
|
227
|
-
|
|
228
|
-
const m = (b,
|
|
229
|
-
b.stopPropagation(),
|
|
226
|
+
const [y, c] = N(p || ((s = n[0]) == null ? void 0 : s.id)), [S, C] = N(n.map((b) => b.id));
|
|
227
|
+
A(H, []);
|
|
228
|
+
const m = (b, R) => {
|
|
229
|
+
b.stopPropagation(), C((l) => l.filter(($) => $ !== R)), y === R && c(S.find((l) => l !== R) ?? "");
|
|
230
230
|
}, o = (b) => {
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
const
|
|
234
|
-
return /* @__PURE__ */
|
|
231
|
+
g.includes(b) || x && x(b) === !1 || (c(b), r == null || r(b));
|
|
232
|
+
}, k = a === "left" || a === "right", z = n.filter((b) => S.includes(b.id)), T = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: k ? "column" : "row", justifyContent: h === "center" ? "center" : h === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !k && a !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: a === "bottom" ? `2px solid ${e.border}` : "none", borderRight: a === "left" ? `2px solid ${e.border}` : "none", borderLeft: a === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: z.map((b) => {
|
|
233
|
+
const R = y === b.id, l = g.includes(b.id), $ = a === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : k ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [a === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
|
|
234
|
+
return /* @__PURE__ */ u(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
237
|
onClick: () => o(b.id),
|
|
238
|
-
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor:
|
|
238
|
+
style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: l ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: k ? 120 : "auto", ...R ? $ : { color: l ? e.textMut : e.textSec } },
|
|
239
239
|
children: [
|
|
240
240
|
b.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: b.icon }),
|
|
241
241
|
/* @__PURE__ */ t("span", { children: b.tab }),
|
|
242
|
-
|
|
242
|
+
i.includes(b.id) && /* @__PURE__ */ t("span", { onClick: (f) => m(f, b.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
|
|
243
243
|
]
|
|
244
244
|
},
|
|
245
245
|
b.id
|
|
246
246
|
);
|
|
247
|
-
}) }),
|
|
248
|
-
|
|
249
|
-
(
|
|
247
|
+
}) }), D = z.find((b) => b.id === y), w = /* @__PURE__ */ u("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
|
|
248
|
+
D == null ? void 0 : D.content,
|
|
249
|
+
(D == null ? void 0 : D.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: D.html }, style: { padding: 16 } })
|
|
250
250
|
] });
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
|
|
251
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { display: "flex", flexDirection: a === "top" ? "column" : a === "bottom" ? "column-reverse" : a === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...d }, children: [
|
|
252
|
+
T,
|
|
253
253
|
w
|
|
254
254
|
] });
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
const F = `1px solid ${e.border}`;
|
|
257
|
+
function nt({ active: n, dir: a }) {
|
|
258
|
+
return /* @__PURE__ */ u("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
|
|
259
|
+
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && a === "asc" ? e.primary : e.borderDk }) }),
|
|
260
|
+
/* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && a === "desc" ? e.primary : e.borderDk }) })
|
|
261
|
+
] });
|
|
262
|
+
}
|
|
263
|
+
function yt({
|
|
264
|
+
columns: n,
|
|
265
|
+
data: a = [],
|
|
266
|
+
height: h = 400,
|
|
267
|
+
rowHeight: i = 40,
|
|
268
|
+
sortable: g = !0,
|
|
269
|
+
resizable: p = !0,
|
|
270
|
+
editable: x = !1,
|
|
271
|
+
stripe: r = !1,
|
|
272
|
+
autoWidth: d = !1,
|
|
273
|
+
keyNavigation: y = !1,
|
|
274
|
+
selection: c,
|
|
275
|
+
multiselect: S,
|
|
276
|
+
onSelect: C,
|
|
277
|
+
onChange: m,
|
|
278
|
+
style: o
|
|
279
|
+
}) {
|
|
280
|
+
const [k, z] = N(null), [T, D] = N("asc"), [w, s] = N({}), [b, R] = N(/* @__PURE__ */ new Set()), [l, $] = N(-1), [f, W] = N(() => n.map((v) => v.width ?? v.minWidth ?? 150)), [P, V] = N(null), [U, se] = N(""), [ne, ke] = N({}), Z = O(null), [ee, Se] = N(0);
|
|
281
|
+
A(H, []), A(() => {
|
|
282
|
+
if (!d || !Z.current) return;
|
|
283
|
+
const v = new ResizeObserver(() => {
|
|
284
|
+
var M;
|
|
285
|
+
return Se(((M = Z.current) == null ? void 0 : M.offsetWidth) ?? 0);
|
|
286
|
+
});
|
|
287
|
+
return v.observe(Z.current), () => v.disconnect();
|
|
288
|
+
}, [d]);
|
|
289
|
+
const _ = J(() => {
|
|
290
|
+
if (!d || ee === 0) return f;
|
|
291
|
+
const v = f.reduce((L, I) => L + I, 0);
|
|
292
|
+
if (ee <= v) return f;
|
|
293
|
+
const M = (ee - v) / n.length;
|
|
294
|
+
return f.map((L) => L + M);
|
|
295
|
+
}, [d, ee, f, n.length]), Y = J(() => {
|
|
296
|
+
let v = a.map((M, L) => {
|
|
297
|
+
const I = String(M.id ?? L);
|
|
298
|
+
return ne[I] ? { ...M, ...ne[I] } : M;
|
|
299
|
+
}).filter(
|
|
300
|
+
(M) => Object.entries(w).every(([L, I]) => !I || String(M[L] ?? "").toLowerCase().includes(I.toLowerCase()))
|
|
262
301
|
);
|
|
263
|
-
return
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
302
|
+
return k && (v = [...v].sort((M, L) => {
|
|
303
|
+
const I = M[k], B = L[k];
|
|
304
|
+
if (I == null) return 1;
|
|
305
|
+
if (B == null) return -1;
|
|
306
|
+
const E = I < B ? -1 : I > B ? 1 : 0;
|
|
307
|
+
return T === "asc" ? E : -E;
|
|
308
|
+
})), v;
|
|
309
|
+
}, [a, k, T, w, ne]), we = J(() => {
|
|
310
|
+
const v = {};
|
|
311
|
+
return n.forEach((M) => {
|
|
312
|
+
var L;
|
|
313
|
+
if ((L = M.footer) != null && L.some((I) => I.summary)) {
|
|
314
|
+
const I = Y.map((E) => Number(E[M.id])).filter((E) => !isNaN(E)), B = I.reduce((E, X) => E + X, 0);
|
|
315
|
+
v[M.id] = { sum: B, avg: I.length ? B / I.length : 0, count: Y.length, min: I.length ? Math.min(...I) : 0, max: I.length ? Math.max(...I) : 0 };
|
|
316
|
+
}
|
|
317
|
+
}), v;
|
|
318
|
+
}, [Y, n]), Me = J(() => {
|
|
319
|
+
const v = {};
|
|
320
|
+
return n.filter((M) => M.filterType === "select").forEach((M) => {
|
|
321
|
+
v[M.id] = [...new Set(a.map((L) => String(L[M.id] ?? "")))].sort();
|
|
322
|
+
}), v;
|
|
323
|
+
}, [a, n]), ze = n.some((v) => v.filterable), $e = n.some((v) => {
|
|
324
|
+
var M;
|
|
325
|
+
return (M = v.footer) == null ? void 0 : M.length;
|
|
326
|
+
}), Ce = _.reduce((v, M) => v + M, 0), re = (v, M) => v.id ?? M, Ne = (v) => {
|
|
327
|
+
!g || v.sortable === !1 || (D((M) => k === v.id && M === "asc" ? "desc" : "asc"), z(v.id));
|
|
328
|
+
}, oe = (v, M) => {
|
|
329
|
+
if (!c) return;
|
|
330
|
+
const L = re(v, M);
|
|
331
|
+
$(M), R((I) => {
|
|
332
|
+
const B = S ? new Set(I) : /* @__PURE__ */ new Set();
|
|
333
|
+
return B.has(L) ? B.delete(L) : B.add(L), B;
|
|
334
|
+
}), C == null || C(v);
|
|
335
|
+
}, de = () => {
|
|
336
|
+
if (!P) return;
|
|
337
|
+
const { key: v, colId: M } = P;
|
|
338
|
+
ke((I) => ({ ...I, [String(v)]: { ...I[String(v)] || {}, [M]: U } }));
|
|
339
|
+
const L = Y.find((I, B) => re(I, B) === v);
|
|
340
|
+
L && (m == null || m(L, M, U)), V(null);
|
|
341
|
+
}, Ie = (v) => {
|
|
342
|
+
if (P && v.key === "Escape") {
|
|
343
|
+
V(null);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (!(!y || !c)) {
|
|
347
|
+
if (v.key === "ArrowDown") {
|
|
348
|
+
v.preventDefault();
|
|
349
|
+
const M = Math.min(l + 1, Y.length - 1);
|
|
350
|
+
M >= 0 && oe(Y[M], M);
|
|
351
|
+
} else if (v.key === "ArrowUp") {
|
|
352
|
+
v.preventDefault();
|
|
353
|
+
const M = Math.max(l - 1, 0);
|
|
354
|
+
M >= 0 && oe(Y[M], M);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}, Te = (v, M) => {
|
|
358
|
+
v.preventDefault(), v.stopPropagation();
|
|
359
|
+
const L = v.clientX, I = f[M], B = (X) => W((le) => {
|
|
360
|
+
const q = [...le];
|
|
361
|
+
return q[M] = Math.max(n[M].minWidth || 50, I + X.clientX - L), q;
|
|
362
|
+
}), E = () => {
|
|
363
|
+
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", E);
|
|
282
364
|
};
|
|
283
|
-
document.addEventListener("mousemove",
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
365
|
+
document.addEventListener("mousemove", B), document.addEventListener("mouseup", E);
|
|
366
|
+
}, ie = (v, M, L, I) => ({
|
|
367
|
+
width: v,
|
|
368
|
+
minWidth: v,
|
|
369
|
+
flexShrink: 0,
|
|
370
|
+
boxSizing: "border-box",
|
|
371
|
+
padding: "0 12px",
|
|
372
|
+
height: I,
|
|
373
|
+
display: "flex",
|
|
374
|
+
alignItems: "center",
|
|
375
|
+
overflow: "hidden",
|
|
376
|
+
textOverflow: "ellipsis",
|
|
377
|
+
whiteSpace: "nowrap",
|
|
378
|
+
fontSize: 13,
|
|
379
|
+
textAlign: M.align,
|
|
380
|
+
justifyContent: M.align === "center" ? "center" : M.align === "right" ? "flex-end" : "flex-start",
|
|
381
|
+
borderLeft: L ? "none" : F
|
|
382
|
+
});
|
|
383
|
+
return /* @__PURE__ */ t(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
ref: Z,
|
|
387
|
+
className: "dhx",
|
|
388
|
+
tabIndex: y ? 0 : void 0,
|
|
389
|
+
onKeyDown: Ie,
|
|
390
|
+
style: { width: "100%", height: h, display: "flex", flexDirection: "column", border: F, borderRadius: e.r, overflow: "hidden", outline: "none", ...o },
|
|
391
|
+
children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ u("div", { style: { minWidth: Ce, display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
392
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: F, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((v, M) => {
|
|
393
|
+
var L;
|
|
394
|
+
return /* @__PURE__ */ u(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
onClick: () => Ne(v),
|
|
398
|
+
style: {
|
|
399
|
+
...ie(_[M], v, M === 0, 40),
|
|
400
|
+
position: "relative",
|
|
401
|
+
fontWeight: 500,
|
|
402
|
+
color: e.text,
|
|
403
|
+
cursor: g && v.sortable !== !1 ? "pointer" : "default",
|
|
404
|
+
userSelect: "none"
|
|
405
|
+
},
|
|
406
|
+
children: [
|
|
407
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(v.header) ? (L = v.header[0]) == null ? void 0 : L.text : v.header || v.id }),
|
|
408
|
+
g && v.sortable !== !1 && /* @__PURE__ */ t(nt, { active: k === v.id, dir: T }),
|
|
409
|
+
p && v.resizable !== !1 && M < n.length - 1 && /* @__PURE__ */ t(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
onMouseDown: (I) => Te(I, M),
|
|
413
|
+
onClick: (I) => I.stopPropagation(),
|
|
414
|
+
style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
|
|
415
|
+
onMouseEnter: (I) => I.currentTarget.style.background = e.primary + "55",
|
|
416
|
+
onMouseLeave: (I) => I.currentTarget.style.background = "transparent"
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
v.id
|
|
422
|
+
);
|
|
423
|
+
}) }),
|
|
424
|
+
ze && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: F, background: e.surface, flexShrink: 0 }, children: n.map((v, M) => /* @__PURE__ */ t("div", { style: { width: _[M], minWidth: _[M], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: M === 0 ? "none" : F }, children: v.filterable && v.filterType === "select" ? /* @__PURE__ */ u(
|
|
425
|
+
"select",
|
|
426
|
+
{
|
|
427
|
+
className: "dhx dhx-input",
|
|
428
|
+
style: { height: 26, fontSize: 12, padding: "0 4px" },
|
|
429
|
+
value: w[v.id] || "",
|
|
430
|
+
onChange: (L) => s((I) => ({ ...I, [v.id]: L.target.value })),
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ t("option", { value: "", children: "All" }),
|
|
433
|
+
(Me[v.id] || []).map((L) => /* @__PURE__ */ t("option", { value: L, children: L }, L))
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
) : v.filterable ? /* @__PURE__ */ t(
|
|
437
|
+
"input",
|
|
438
|
+
{
|
|
439
|
+
className: "dhx dhx-input",
|
|
440
|
+
style: { height: 26, fontSize: 12 },
|
|
441
|
+
placeholder: "Filter...",
|
|
442
|
+
value: w[v.id] || "",
|
|
443
|
+
onChange: (L) => s((I) => ({ ...I, [v.id]: L.target.value }))
|
|
444
|
+
}
|
|
445
|
+
) : null }, v.id)) }),
|
|
446
|
+
/* @__PURE__ */ u("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
|
|
447
|
+
Y.map((v, M) => {
|
|
448
|
+
const L = re(v, M), I = b.has(L), B = I ? e.primaryLt : r && M % 2 !== 0 ? e.bg : e.surface;
|
|
449
|
+
return /* @__PURE__ */ t(
|
|
297
450
|
"div",
|
|
298
451
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
452
|
+
style: { display: "flex", height: i, borderBottom: F, flexShrink: 0, background: B, transition: "background .1s", cursor: c ? "pointer" : "default" },
|
|
453
|
+
onMouseEnter: (E) => !I && (E.currentTarget.style.background = e.primaryLt + "80"),
|
|
454
|
+
onMouseLeave: (E) => !I && (E.currentTarget.style.background = B),
|
|
455
|
+
children: n.map((E, X) => {
|
|
456
|
+
const le = (P == null ? void 0 : P.key) === L && (P == null ? void 0 : P.colId) === E.id, q = v[E.id], De = E.template ? E.template(q, v) : String(q ?? "");
|
|
457
|
+
return /* @__PURE__ */ t(
|
|
458
|
+
"div",
|
|
459
|
+
{
|
|
460
|
+
onClick: () => {
|
|
461
|
+
oe(v, M), x && E.editable !== !1 && (V({ key: L, colId: E.id }), se(String(q ?? "")));
|
|
462
|
+
},
|
|
463
|
+
style: ie(_[X], E, X === 0, i),
|
|
464
|
+
children: le ? /* @__PURE__ */ t(
|
|
465
|
+
"input",
|
|
466
|
+
{
|
|
467
|
+
autoFocus: !0,
|
|
468
|
+
value: U,
|
|
469
|
+
onChange: (G) => se(G.target.value),
|
|
470
|
+
onBlur: de,
|
|
471
|
+
onKeyDown: (G) => {
|
|
472
|
+
G.key === "Enter" && de(), G.key === "Escape" && V(null);
|
|
473
|
+
},
|
|
474
|
+
onClick: (G) => G.stopPropagation(),
|
|
475
|
+
style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
|
|
476
|
+
}
|
|
477
|
+
) : De
|
|
478
|
+
},
|
|
479
|
+
E.id
|
|
480
|
+
);
|
|
481
|
+
})
|
|
482
|
+
},
|
|
483
|
+
String(L)
|
|
484
|
+
);
|
|
485
|
+
}),
|
|
486
|
+
Y.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
|
|
487
|
+
] }),
|
|
488
|
+
$e && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: F, background: e.bg, flexShrink: 0 }, children: n.map((v, M) => {
|
|
489
|
+
var E;
|
|
490
|
+
const L = (E = v.footer) == null ? void 0 : E[0], I = we[v.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
|
|
491
|
+
let B = "";
|
|
492
|
+
return L && (typeof L.text == "function" ? B = L.text(I) : L.text ? B = L.text : L.summary && (B = String(Math.round(I[L.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...ie(_[M], v, M === 0, 40), fontWeight: 600, color: e.text }, children: B }, v.id);
|
|
493
|
+
}) })
|
|
494
|
+
] }) })
|
|
495
|
+
}
|
|
496
|
+
);
|
|
329
497
|
}
|
|
330
|
-
const
|
|
331
|
-
function
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
const r = ((
|
|
498
|
+
const j = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
|
|
499
|
+
function bt({ type: n = "bar", data: a = [], series: h = [], scales: i = {}, legend: g, height: p = 280, style: x }) {
|
|
500
|
+
var k, z, T, D, w;
|
|
501
|
+
A(H, []);
|
|
502
|
+
const r = ((k = i.bottom) == null ? void 0 : k.text) || a[0] && Object.keys(a[0])[0] || "x", d = /* @__PURE__ */ t(We, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), y = g ? /* @__PURE__ */ t(Ee, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: g.valign, align: g.halign }) : null, c = /* @__PURE__ */ t(Ae, { strokeDasharray: "3 3", stroke: e.border }), S = /* @__PURE__ */ t(ce, { dataKey: r, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), C = /* @__PURE__ */ t(pe, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((z = i.left) == null ? void 0 : z.min) ?? "auto", ((T = i.left) == null ? void 0 : T.max) ?? "auto"] }), m = { data: a, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
|
|
335
503
|
let o;
|
|
336
504
|
if (n === "bar")
|
|
337
|
-
o = /* @__PURE__ */
|
|
505
|
+
o = /* @__PURE__ */ u(Be, { ...m, children: [
|
|
338
506
|
c,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
507
|
+
S,
|
|
508
|
+
C,
|
|
509
|
+
d,
|
|
342
510
|
y,
|
|
343
|
-
|
|
511
|
+
h.map((s, b) => /* @__PURE__ */ t(He, { dataKey: s.value || s.id, name: s.label || s.id, fill: s.fill || j[b % j.length], radius: [3, 3, 0, 0] }, s.id))
|
|
344
512
|
] });
|
|
345
513
|
else if (n === "line")
|
|
346
|
-
o = /* @__PURE__ */
|
|
514
|
+
o = /* @__PURE__ */ u(Pe, { ...m, children: [
|
|
347
515
|
c,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
516
|
+
S,
|
|
517
|
+
C,
|
|
518
|
+
d,
|
|
351
519
|
y,
|
|
352
|
-
|
|
520
|
+
h.map((s, b) => /* @__PURE__ */ t(je, { type: "monotone", dataKey: s.value || s.id, name: s.label || s.id, stroke: s.color || j[b % j.length], strokeWidth: 2, dot: { r: 3, fill: s.color || j[b % j.length] } }, s.id))
|
|
353
521
|
] });
|
|
354
522
|
else if (n === "area")
|
|
355
|
-
o = /* @__PURE__ */
|
|
523
|
+
o = /* @__PURE__ */ u(Oe, { ...m, children: [
|
|
356
524
|
c,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
525
|
+
S,
|
|
526
|
+
C,
|
|
527
|
+
d,
|
|
360
528
|
y,
|
|
361
|
-
|
|
529
|
+
h.map((s, b) => /* @__PURE__ */ t(Ye, { type: "monotone", dataKey: s.value || s.id, name: s.label || s.id, stroke: s.color || j[b % j.length], fill: (s.fill || j[b % j.length]) + "33", strokeWidth: 2 }, s.id))
|
|
362
530
|
] });
|
|
363
531
|
else if (n === "pie" || n === "donut") {
|
|
364
|
-
const s =
|
|
365
|
-
o = /* @__PURE__ */
|
|
532
|
+
const s = a[0] || {}, b = Object.keys(s).find((l) => typeof s[l] == "number") || "value", R = Object.keys(s).find((l) => typeof s[l] == "string") || "x";
|
|
533
|
+
o = /* @__PURE__ */ u(Ke, { children: [
|
|
366
534
|
/* @__PURE__ */ t(
|
|
367
|
-
|
|
535
|
+
Fe,
|
|
368
536
|
{
|
|
369
|
-
data:
|
|
537
|
+
data: a,
|
|
370
538
|
cx: "50%",
|
|
371
539
|
cy: "50%",
|
|
372
540
|
outerRadius: n === "donut" ? "70%" : "80%",
|
|
373
541
|
innerRadius: n === "donut" ? "40%" : 0,
|
|
374
542
|
dataKey: b,
|
|
375
|
-
nameKey:
|
|
376
|
-
label: ({ name:
|
|
543
|
+
nameKey: R,
|
|
544
|
+
label: ({ name: l, percent: $ }) => `${l ?? ""} ${(($ ?? 0) * 100).toFixed(0)}%`,
|
|
377
545
|
labelLine: !0,
|
|
378
546
|
paddingAngle: 2,
|
|
379
|
-
children:
|
|
547
|
+
children: a.map((l, $) => /* @__PURE__ */ t(Ve, { fill: j[$ % j.length] }, $))
|
|
380
548
|
}
|
|
381
549
|
),
|
|
382
|
-
|
|
550
|
+
d,
|
|
383
551
|
y
|
|
384
552
|
] });
|
|
385
|
-
} else n === "radar" ? o = /* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */ t(
|
|
387
|
-
/* @__PURE__ */ t(
|
|
388
|
-
|
|
389
|
-
|
|
553
|
+
} else n === "radar" ? o = /* @__PURE__ */ u(_e, { ...m, cx: "50%", cy: "50%", children: [
|
|
554
|
+
/* @__PURE__ */ t(Xe, {}),
|
|
555
|
+
/* @__PURE__ */ t(qe, { dataKey: r, tick: { fontSize: 11 } }),
|
|
556
|
+
h.map((s, b) => /* @__PURE__ */ t(Ge, { dataKey: s.value || s.id, name: s.label || s.id, stroke: s.color || j[b], fill: (s.fill || j[b]) + "44" }, s.id)),
|
|
557
|
+
d,
|
|
390
558
|
y
|
|
391
|
-
] }) : n === "scatter" && (o = /* @__PURE__ */
|
|
559
|
+
] }) : n === "scatter" && (o = /* @__PURE__ */ u(Je, { ...m, children: [
|
|
392
560
|
c,
|
|
393
|
-
/* @__PURE__ */ t(
|
|
394
|
-
/* @__PURE__ */ t(
|
|
395
|
-
|
|
396
|
-
|
|
561
|
+
/* @__PURE__ */ t(ce, { dataKey: ((D = h[0]) == null ? void 0 : D.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
|
|
562
|
+
/* @__PURE__ */ t(pe, { dataKey: ((w = h[0]) == null ? void 0 : w.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
|
|
563
|
+
d,
|
|
564
|
+
h.map((s, b) => /* @__PURE__ */ t(Ue, { data: s.data || a, name: s.label || s.id, fill: s.color || j[b] }, s.id))
|
|
397
565
|
] }));
|
|
398
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height:
|
|
566
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: p, padding: 12, background: e.surface, borderRadius: e.rMd, ...x }, children: /* @__PURE__ */ t(Qe, { width: "100%", height: "100%", children: o }) });
|
|
399
567
|
}
|
|
400
|
-
const
|
|
401
|
-
function
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
for (let
|
|
406
|
-
for (let
|
|
407
|
-
const s = (
|
|
568
|
+
const rt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ot = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
569
|
+
function mt({ value: n, range: a = !1, timepicker: h = !1, onChange: i, style: g }) {
|
|
570
|
+
const p = /* @__PURE__ */ new Date(), x = n ? new Date(Array.isArray(n) ? n[0] : n) : p, [r, d] = N(x), [y, c] = N(n ?? (a ? [null, null] : null)), [S, C] = N(null), [m, o] = N({ h: 0, m: 0 });
|
|
571
|
+
A(H, []);
|
|
572
|
+
const k = r.getFullYear(), z = r.getMonth(), T = new Date(k, z, 1).getDay(), D = new Date(k, z + 1, 0).getDate(), w = [];
|
|
573
|
+
for (let l = 0; l < T; l++) w.push(null);
|
|
574
|
+
for (let l = 1; l <= D; l++) w.push(new Date(k, z, l));
|
|
575
|
+
const s = (l) => l.toDateString() === p.toDateString(), b = (l) => {
|
|
408
576
|
if (!y) return !1;
|
|
409
|
-
if (
|
|
410
|
-
const [
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
return
|
|
577
|
+
if (a && Array.isArray(y)) {
|
|
578
|
+
const [$, f] = y;
|
|
579
|
+
if (!$) return !1;
|
|
580
|
+
const W = l.getTime();
|
|
581
|
+
return f ? W >= $.getTime() && W <= f.getTime() : l.toDateString() === $.toDateString();
|
|
414
582
|
}
|
|
415
|
-
return
|
|
416
|
-
},
|
|
417
|
-
if (
|
|
418
|
-
const [
|
|
419
|
-
if (
|
|
420
|
-
c([
|
|
583
|
+
return l.toDateString() === y.toDateString();
|
|
584
|
+
}, R = (l) => {
|
|
585
|
+
if (a) {
|
|
586
|
+
const [$, f] = Array.isArray(y) ? y : [null, null];
|
|
587
|
+
if (!$ || f)
|
|
588
|
+
c([l, null]);
|
|
421
589
|
else {
|
|
422
|
-
const
|
|
423
|
-
c(
|
|
590
|
+
const W = l < $ ? [l, $] : [$, l];
|
|
591
|
+
c(W), i == null || i(W);
|
|
424
592
|
}
|
|
425
593
|
} else
|
|
426
|
-
c(
|
|
594
|
+
c(l), i == null || i(l);
|
|
427
595
|
};
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
|
|
596
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
|
|
597
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
|
|
598
|
+
/* @__PURE__ */ t("button", { onClick: () => d((l) => new Date(l.getFullYear(), l.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
|
|
599
|
+
/* @__PURE__ */ u("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
|
|
600
|
+
rt[z],
|
|
433
601
|
" ",
|
|
434
|
-
|
|
602
|
+
k
|
|
435
603
|
] }),
|
|
436
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
604
|
+
/* @__PURE__ */ t("button", { onClick: () => d((l) => new Date(l.getFullYear(), l.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
|
|
437
605
|
] }),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
|
|
440
|
-
w.map((
|
|
441
|
-
const
|
|
606
|
+
/* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
|
|
607
|
+
ot.map((l) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: l }, l)),
|
|
608
|
+
w.map((l, $) => {
|
|
609
|
+
const f = l ? b(l) : !1, W = l && S && l.toDateString() === S.toDateString();
|
|
442
610
|
return /* @__PURE__ */ t(
|
|
443
611
|
"div",
|
|
444
612
|
{
|
|
445
|
-
onClick: () =>
|
|
446
|
-
onMouseEnter: () =>
|
|
447
|
-
onMouseLeave: () =>
|
|
448
|
-
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor:
|
|
449
|
-
children:
|
|
613
|
+
onClick: () => l && R(l),
|
|
614
|
+
onMouseEnter: () => l && C(l),
|
|
615
|
+
onMouseLeave: () => C(null),
|
|
616
|
+
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: l ? "pointer" : "default", fontSize: 12, fontWeight: l && s(l) ? 700 : 400, background: f ? e.primary : W ? e.bg : "transparent", color: f ? "#fff" : l && s(l) ? e.primary : l ? e.text : "transparent", border: l && s(l) && !f ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
|
|
617
|
+
children: l == null ? void 0 : l.getDate()
|
|
450
618
|
},
|
|
451
|
-
|
|
619
|
+
$
|
|
452
620
|
);
|
|
453
621
|
})
|
|
454
622
|
] }),
|
|
455
|
-
|
|
456
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (
|
|
623
|
+
h && /* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
|
|
624
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (l) => o(($) => ({ ...$, h: +l.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
|
|
457
625
|
/* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
|
|
458
|
-
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (
|
|
626
|
+
/* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (l) => o(($) => ({ ...$, m: +l.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
|
|
459
627
|
] })
|
|
460
628
|
] });
|
|
461
629
|
}
|
|
462
|
-
function
|
|
463
|
-
const [
|
|
464
|
-
|
|
465
|
-
const o =
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
m(null), r((n == null ? void 0 : n.h) ?? (
|
|
470
|
-
},
|
|
630
|
+
function it({ value: n, onChange: a, timeFormat: h = 12, controls: i = !1, minuteStep: g = 5, style: p }) {
|
|
631
|
+
const [x, r] = N((n == null ? void 0 : n.h) ?? (h === 24 ? 0 : 12)), [d, y] = N((n == null ? void 0 : n.m) ?? 0), [c, S] = N((n == null ? void 0 : n.ampm) ?? "AM"), [C, m] = N(null);
|
|
632
|
+
A(H, []);
|
|
633
|
+
const o = h === 24 ? Array.from({ length: 24 }, (s, b) => b) : Array.from({ length: 12 }, (s, b) => b + 1), k = Array.from({ length: Math.ceil(60 / g) }, (s, b) => b * g), z = (s, b, R) => {
|
|
634
|
+
const l = h === 24 ? { h: s, m: b } : { h: s, m: b, ampm: R };
|
|
635
|
+
i ? m(l) : a == null || a(l);
|
|
636
|
+
}, T = () => {
|
|
637
|
+
m(null), r((n == null ? void 0 : n.h) ?? (h === 24 ? 0 : 12)), y((n == null ? void 0 : n.m) ?? 0), S((n == null ? void 0 : n.ampm) ?? "AM");
|
|
638
|
+
}, D = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, w = (s) => ({
|
|
471
639
|
height: 32,
|
|
472
640
|
display: "flex",
|
|
473
641
|
alignItems: "center",
|
|
@@ -478,47 +646,47 @@ function Te({ value: n, onChange: d, timeFormat: u = 12, controls: l = !1, minut
|
|
|
478
646
|
background: s ? e.primaryLt : "transparent",
|
|
479
647
|
color: s ? e.primary : e.text
|
|
480
648
|
});
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ u("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: [
|
|
650
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
|
|
651
|
+
/* @__PURE__ */ u("div", { style: D, children: [
|
|
484
652
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
|
|
485
653
|
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((s) => /* @__PURE__ */ t(
|
|
486
654
|
"div",
|
|
487
655
|
{
|
|
488
656
|
onClick: () => {
|
|
489
|
-
r(s),
|
|
657
|
+
r(s), z(s, d, c);
|
|
490
658
|
},
|
|
491
|
-
style: w(
|
|
492
|
-
onMouseEnter: (b) =>
|
|
493
|
-
onMouseLeave: (b) =>
|
|
659
|
+
style: w(x === s),
|
|
660
|
+
onMouseEnter: (b) => x !== s && (b.currentTarget.style.background = e.bg),
|
|
661
|
+
onMouseLeave: (b) => x !== s && (b.currentTarget.style.background = "transparent"),
|
|
494
662
|
children: String(s).padStart(2, "0")
|
|
495
663
|
},
|
|
496
664
|
s
|
|
497
665
|
)) })
|
|
498
666
|
] }),
|
|
499
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ u("div", { style: D, children: [
|
|
500
668
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
|
|
501
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children:
|
|
669
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: k.map((s) => /* @__PURE__ */ t(
|
|
502
670
|
"div",
|
|
503
671
|
{
|
|
504
672
|
onClick: () => {
|
|
505
|
-
y(s),
|
|
673
|
+
y(s), z(x, s, c);
|
|
506
674
|
},
|
|
507
|
-
style: w(
|
|
508
|
-
onMouseEnter: (b) =>
|
|
509
|
-
onMouseLeave: (b) =>
|
|
675
|
+
style: w(d === s),
|
|
676
|
+
onMouseEnter: (b) => d !== s && (b.currentTarget.style.background = e.bg),
|
|
677
|
+
onMouseLeave: (b) => d !== s && (b.currentTarget.style.background = "transparent"),
|
|
510
678
|
children: String(s).padStart(2, "0")
|
|
511
679
|
},
|
|
512
680
|
s
|
|
513
681
|
)) })
|
|
514
682
|
] }),
|
|
515
|
-
|
|
683
|
+
h === 12 && /* @__PURE__ */ u("div", { style: D, children: [
|
|
516
684
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
|
|
517
685
|
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((s) => /* @__PURE__ */ t(
|
|
518
686
|
"div",
|
|
519
687
|
{
|
|
520
688
|
onClick: () => {
|
|
521
|
-
|
|
689
|
+
S(s), z(x, d, s);
|
|
522
690
|
},
|
|
523
691
|
style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: c === s ? 700 : 400, background: c === s ? e.primary : e.surface, color: c === s ? "#fff" : e.text },
|
|
524
692
|
children: s
|
|
@@ -527,81 +695,81 @@ function Te({ value: n, onChange: d, timeFormat: u = 12, controls: l = !1, minut
|
|
|
527
695
|
)) })
|
|
528
696
|
] })
|
|
529
697
|
] }),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
String(
|
|
698
|
+
/* @__PURE__ */ u("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
|
|
699
|
+
String(x).padStart(2, "0"),
|
|
532
700
|
":",
|
|
533
|
-
String(
|
|
534
|
-
|
|
701
|
+
String(d).padStart(2, "0"),
|
|
702
|
+
h === 12 ? ` ${c}` : ""
|
|
535
703
|
] }),
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick:
|
|
538
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () =>
|
|
704
|
+
i && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
|
|
705
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: T, children: "Cancel" }),
|
|
706
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => C && (a == null ? void 0 : a(C)), children: "Apply" })
|
|
539
707
|
] })
|
|
540
708
|
] });
|
|
541
709
|
}
|
|
542
|
-
function
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
n.current && !n.current.contains(
|
|
710
|
+
function Q(n, a) {
|
|
711
|
+
A(() => {
|
|
712
|
+
const h = (i) => {
|
|
713
|
+
n.current && !n.current.contains(i.target) && a(i);
|
|
546
714
|
};
|
|
547
|
-
return document.addEventListener("mousedown",
|
|
548
|
-
}, [n,
|
|
715
|
+
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
716
|
+
}, [n, a]);
|
|
549
717
|
}
|
|
550
|
-
function
|
|
551
|
-
const
|
|
552
|
-
return
|
|
553
|
-
(
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
if (!
|
|
557
|
-
const { x: y, y: c, ox:
|
|
558
|
-
n(
|
|
718
|
+
function lt(n) {
|
|
719
|
+
const a = O(!1), h = O({ x: 0, y: 0, ox: 0, oy: 0 });
|
|
720
|
+
return K(
|
|
721
|
+
(i, g = 0, p = 0) => {
|
|
722
|
+
a.current = !0, h.current = { x: i.clientX, y: i.clientY, ox: g, oy: p };
|
|
723
|
+
const x = (d) => {
|
|
724
|
+
if (!a.current) return;
|
|
725
|
+
const { x: y, y: c, ox: S, oy: C } = h.current;
|
|
726
|
+
n(S + d.clientX - y, C + d.clientY - c);
|
|
559
727
|
}, r = () => {
|
|
560
|
-
|
|
728
|
+
a.current = !1, document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", r);
|
|
561
729
|
};
|
|
562
|
-
document.addEventListener("mousemove",
|
|
730
|
+
document.addEventListener("mousemove", x), document.addEventListener("mouseup", r), i.preventDefault();
|
|
563
731
|
},
|
|
564
732
|
[n]
|
|
565
733
|
);
|
|
566
734
|
}
|
|
567
|
-
const
|
|
568
|
-
function
|
|
569
|
-
var
|
|
570
|
-
const [r,
|
|
571
|
-
|
|
572
|
-
), m =
|
|
573
|
-
|
|
574
|
-
|
|
735
|
+
const at = ({ open: n }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: n ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
736
|
+
function ue({ data: n = [], value: a, placeholder: h = "Select or type...", multiselection: i = !1, label: g, onChange: p, style: x }) {
|
|
737
|
+
var R;
|
|
738
|
+
const [r, d] = N(!1), [y, c] = N(""), [S, C] = N(
|
|
739
|
+
i ? a ? [].concat(a) : [] : a || null
|
|
740
|
+
), m = O(null), o = O(null);
|
|
741
|
+
A(H, []), Q(m, K(() => {
|
|
742
|
+
d(!1), c("");
|
|
575
743
|
}, []));
|
|
576
|
-
const
|
|
577
|
-
() => n.filter((
|
|
744
|
+
const k = J(
|
|
745
|
+
() => n.filter((l) => !y || l.value.toLowerCase().includes(y.toLowerCase())),
|
|
578
746
|
[n, y]
|
|
579
|
-
),
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
583
|
-
|
|
747
|
+
), z = (l) => i ? (S || []).includes(l) : S === l, T = (l) => {
|
|
748
|
+
const $ = l.id || l.value;
|
|
749
|
+
if (i) {
|
|
750
|
+
const f = z($) ? S.filter((W) => W !== $) : [...S || [], $];
|
|
751
|
+
C(f), p == null || p(f);
|
|
584
752
|
} else
|
|
585
|
-
$
|
|
586
|
-
},
|
|
587
|
-
const
|
|
588
|
-
$
|
|
753
|
+
C($), c(""), d(!1), p == null || p($);
|
|
754
|
+
}, D = (l) => {
|
|
755
|
+
const $ = S.filter((f) => f !== l);
|
|
756
|
+
C($), p == null || p($);
|
|
589
757
|
}, w = () => {
|
|
590
|
-
|
|
591
|
-
var
|
|
592
|
-
return (
|
|
758
|
+
d(!0), setTimeout(() => {
|
|
759
|
+
var l;
|
|
760
|
+
return (l = o.current) == null ? void 0 : l.focus();
|
|
593
761
|
}, 0);
|
|
594
|
-
}, s = ((
|
|
595
|
-
return /* @__PURE__ */
|
|
596
|
-
|
|
597
|
-
/* @__PURE__ */
|
|
762
|
+
}, s = ((R = n.find((l) => (l.id || l.value) === S)) == null ? void 0 : R.value) || "", b = i ? S || [] : [];
|
|
763
|
+
return /* @__PURE__ */ u("div", { ref: m, className: "dhx", style: { position: "relative", ...x }, children: [
|
|
764
|
+
g && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: g }),
|
|
765
|
+
/* @__PURE__ */ u(
|
|
598
766
|
"div",
|
|
599
767
|
{
|
|
600
768
|
onClick: w,
|
|
601
769
|
style: {
|
|
602
770
|
display: "flex",
|
|
603
771
|
alignItems: "center",
|
|
604
|
-
flexWrap:
|
|
772
|
+
flexWrap: i ? "wrap" : "nowrap",
|
|
605
773
|
border: `1px solid ${r ? e.primary : e.border}`,
|
|
606
774
|
borderRadius: e.r,
|
|
607
775
|
minHeight: 34,
|
|
@@ -613,65 +781,66 @@ function q({ data: n = [], value: d, placeholder: u = "Select or type...", multi
|
|
|
613
781
|
boxShadow: r ? `0 0 0 3px ${e.primary}22` : "none"
|
|
614
782
|
},
|
|
615
783
|
children: [
|
|
616
|
-
|
|
617
|
-
b.map((
|
|
618
|
-
var
|
|
619
|
-
return /* @__PURE__ */
|
|
784
|
+
i && /* @__PURE__ */ u(me, { children: [
|
|
785
|
+
b.map((l) => {
|
|
786
|
+
var $;
|
|
787
|
+
return /* @__PURE__ */ u("span", { style: {
|
|
620
788
|
display: "inline-flex",
|
|
621
789
|
alignItems: "center",
|
|
622
|
-
gap:
|
|
623
|
-
background: e.
|
|
624
|
-
color:
|
|
625
|
-
borderRadius:
|
|
626
|
-
padding: "2px
|
|
790
|
+
gap: 4,
|
|
791
|
+
background: e.primary,
|
|
792
|
+
color: "#fff",
|
|
793
|
+
borderRadius: 12,
|
|
794
|
+
padding: "2px 10px 2px 8px",
|
|
627
795
|
fontSize: 12,
|
|
628
|
-
lineHeight: 1.
|
|
796
|
+
lineHeight: 1.5,
|
|
797
|
+
whiteSpace: "nowrap"
|
|
629
798
|
}, children: [
|
|
630
|
-
((
|
|
799
|
+
(($ = n.find((f) => (f.id || f.value) === l)) == null ? void 0 : $.value) || l,
|
|
631
800
|
/* @__PURE__ */ t(
|
|
632
801
|
"span",
|
|
633
802
|
{
|
|
634
|
-
onClick: (
|
|
635
|
-
|
|
803
|
+
onClick: (f) => {
|
|
804
|
+
f.stopPropagation(), D(l);
|
|
636
805
|
},
|
|
637
|
-
style: { cursor: "pointer", fontSize:
|
|
806
|
+
style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
|
|
638
807
|
children: "×"
|
|
639
808
|
}
|
|
640
809
|
)
|
|
641
|
-
] },
|
|
810
|
+
] }, l);
|
|
642
811
|
}),
|
|
643
812
|
/* @__PURE__ */ t(
|
|
644
813
|
"input",
|
|
645
814
|
{
|
|
646
815
|
ref: o,
|
|
647
816
|
value: y,
|
|
648
|
-
onChange: (
|
|
649
|
-
c(
|
|
817
|
+
onChange: (l) => {
|
|
818
|
+
c(l.target.value), d(!0);
|
|
650
819
|
},
|
|
651
|
-
onFocus: () =>
|
|
652
|
-
onClick: (
|
|
653
|
-
placeholder: b.length ? "" :
|
|
820
|
+
onFocus: () => d(!0),
|
|
821
|
+
onClick: (l) => l.stopPropagation(),
|
|
822
|
+
placeholder: b.length ? "" : h,
|
|
654
823
|
style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
655
824
|
}
|
|
656
825
|
)
|
|
657
826
|
] }),
|
|
658
|
-
!
|
|
827
|
+
!i && /* @__PURE__ */ t(
|
|
659
828
|
"input",
|
|
660
829
|
{
|
|
661
830
|
ref: o,
|
|
662
831
|
value: r ? y : s,
|
|
663
|
-
onChange: (
|
|
664
|
-
c(
|
|
832
|
+
onChange: (l) => {
|
|
833
|
+
c(l.target.value), d(!0);
|
|
665
834
|
},
|
|
666
835
|
onFocus: () => {
|
|
667
|
-
|
|
836
|
+
d(!0), c("");
|
|
668
837
|
},
|
|
669
|
-
onClick: (
|
|
670
|
-
placeholder:
|
|
838
|
+
onClick: (l) => l.stopPropagation(),
|
|
839
|
+
placeholder: h,
|
|
671
840
|
style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
|
|
672
841
|
}
|
|
673
842
|
),
|
|
674
|
-
/* @__PURE__ */ t(
|
|
843
|
+
/* @__PURE__ */ t(at, { open: r })
|
|
675
844
|
]
|
|
676
845
|
}
|
|
677
846
|
),
|
|
@@ -685,13 +854,13 @@ function q({ data: n = [], value: d, placeholder: u = "Select or type...", multi
|
|
|
685
854
|
borderRadius: e.r,
|
|
686
855
|
boxShadow: e.shadowLg,
|
|
687
856
|
zIndex: 100
|
|
688
|
-
}, children: /* @__PURE__ */
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
return /* @__PURE__ */
|
|
857
|
+
}, children: /* @__PURE__ */ u("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
|
|
858
|
+
k.map((l) => {
|
|
859
|
+
const $ = l.id || l.value, f = z($);
|
|
860
|
+
return /* @__PURE__ */ u(
|
|
692
861
|
"div",
|
|
693
862
|
{
|
|
694
|
-
onClick: () =>
|
|
863
|
+
onClick: () => T(l),
|
|
695
864
|
style: {
|
|
696
865
|
padding: "8px 12px",
|
|
697
866
|
cursor: "pointer",
|
|
@@ -699,326 +868,326 @@ function q({ data: n = [], value: d, placeholder: u = "Select or type...", multi
|
|
|
699
868
|
alignItems: "center",
|
|
700
869
|
gap: 8,
|
|
701
870
|
fontSize: 13,
|
|
702
|
-
background:
|
|
703
|
-
color:
|
|
871
|
+
background: f ? e.primaryLt : "transparent",
|
|
872
|
+
color: f ? e.primary : e.text
|
|
704
873
|
},
|
|
705
|
-
onMouseEnter: (
|
|
706
|
-
onMouseLeave: (
|
|
874
|
+
onMouseEnter: (W) => !f && (W.currentTarget.style.background = e.bg),
|
|
875
|
+
onMouseLeave: (W) => !f && (W.currentTarget.style.background = "transparent"),
|
|
707
876
|
children: [
|
|
708
|
-
|
|
877
|
+
i && /* @__PURE__ */ t("span", { style: {
|
|
709
878
|
width: 14,
|
|
710
879
|
height: 14,
|
|
711
880
|
flexShrink: 0,
|
|
712
|
-
border: `2px solid ${
|
|
881
|
+
border: `2px solid ${f ? e.primary : e.borderDk}`,
|
|
713
882
|
borderRadius: 3,
|
|
714
883
|
display: "flex",
|
|
715
884
|
alignItems: "center",
|
|
716
885
|
justifyContent: "center",
|
|
717
|
-
background:
|
|
718
|
-
}, children:
|
|
719
|
-
/* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
720
|
-
!
|
|
721
|
-
|
|
886
|
+
background: f ? e.primary : "transparent"
|
|
887
|
+
}, children: f && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
|
|
888
|
+
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: l.value }),
|
|
889
|
+
!i && f && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
|
|
890
|
+
l.count !== void 0 && /* @__PURE__ */ u("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
722
891
|
"(",
|
|
723
|
-
|
|
892
|
+
l.count,
|
|
724
893
|
")"
|
|
725
894
|
] })
|
|
726
895
|
]
|
|
727
896
|
},
|
|
728
|
-
|
|
897
|
+
$
|
|
729
898
|
);
|
|
730
899
|
}),
|
|
731
|
-
|
|
900
|
+
k.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
|
|
732
901
|
] }) })
|
|
733
902
|
] });
|
|
734
903
|
}
|
|
735
|
-
function
|
|
736
|
-
const [c,
|
|
737
|
-
|
|
738
|
-
const
|
|
904
|
+
function xe({ min: n = 0, max: a = 100, step: h = 1, value: i, range: g = !1, label: p, tick: x, disabled: r = !1, onChange: d, style: y }) {
|
|
905
|
+
const [c, S] = N(i ?? (g ? [n, a] : n));
|
|
906
|
+
A(H, []);
|
|
907
|
+
const C = (T, D) => {
|
|
739
908
|
if (!r)
|
|
740
|
-
if (
|
|
909
|
+
if (g) {
|
|
741
910
|
const w = [...c];
|
|
742
|
-
w[
|
|
911
|
+
w[T] = D, S(w), d == null || d(w);
|
|
743
912
|
} else
|
|
744
|
-
|
|
745
|
-
}, m = (
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
|
|
748
|
-
/* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */ t("div", { style: { position: "absolute", ...
|
|
750
|
-
o.map((
|
|
913
|
+
S(D), d == null || d(D);
|
|
914
|
+
}, m = (T) => (T - n) / (a - n) * 100, o = g ? c : [c], k = g ? { left: `${m(o[0])}%`, width: `${m(o[1]) - m(o[0])}%` } : { left: 0, width: `${m(o[0])}%` }, z = r ? e.border : e.primary;
|
|
915
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { width: "100%", opacity: r ? 0.5 : 1, ...y }, children: [
|
|
916
|
+
p && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: p }),
|
|
917
|
+
/* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ u("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
|
|
918
|
+
/* @__PURE__ */ t("div", { style: { position: "absolute", ...k, height: "100%", background: z, borderRadius: 2 } }),
|
|
919
|
+
o.map((T, D) => /* @__PURE__ */ t(
|
|
751
920
|
"input",
|
|
752
921
|
{
|
|
753
922
|
type: "range",
|
|
754
923
|
min: n,
|
|
755
|
-
max:
|
|
756
|
-
step:
|
|
757
|
-
value:
|
|
924
|
+
max: a,
|
|
925
|
+
step: h,
|
|
926
|
+
value: T,
|
|
758
927
|
disabled: r,
|
|
759
928
|
onChange: (w) => {
|
|
760
929
|
const s = +w.target.value;
|
|
761
|
-
|
|
930
|
+
g && D === 0 && s >= c[1] || g && D === 1 && s <= c[0] || C(D, s);
|
|
762
931
|
},
|
|
763
932
|
style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: r ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
|
|
764
933
|
},
|
|
765
|
-
|
|
934
|
+
D
|
|
766
935
|
)),
|
|
767
|
-
o.map((
|
|
936
|
+
o.map((T, D) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${m(T)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${z}`, 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: r ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: T }) }, D))
|
|
768
937
|
] }) }),
|
|
769
|
-
|
|
938
|
+
x && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((a + n) / 2), a].map((T) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: T }, T)) })
|
|
770
939
|
] });
|
|
771
940
|
}
|
|
772
|
-
const
|
|
773
|
-
function
|
|
774
|
-
const
|
|
775
|
-
let
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
const y =
|
|
779
|
-
r =
|
|
941
|
+
const st = ["#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"];
|
|
942
|
+
function ae(n) {
|
|
943
|
+
const a = parseInt(n.slice(1, 3), 16) / 255, h = parseInt(n.slice(3, 5), 16) / 255, i = parseInt(n.slice(5, 7), 16) / 255, g = Math.max(a, h, i), p = Math.min(a, h, i);
|
|
944
|
+
let x = 0, r = 0;
|
|
945
|
+
const d = (g + p) / 2;
|
|
946
|
+
if (g !== p) {
|
|
947
|
+
const y = g - p;
|
|
948
|
+
r = d > 0.5 ? y / (2 - g - p) : y / (g + p), x = g === a ? ((h - i) / y + (h < i ? 6 : 0)) / 6 : g === h ? ((i - a) / y + 2) / 6 : ((a - h) / y + 4) / 6;
|
|
780
949
|
}
|
|
781
|
-
return [Math.round(
|
|
950
|
+
return [Math.round(x * 360), Math.round(r * 100), Math.round(d * 100)];
|
|
782
951
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
const
|
|
952
|
+
function ge(n, a, h) {
|
|
953
|
+
a /= 100, h /= 100;
|
|
954
|
+
const i = a * Math.min(h, 1 - h), g = (p) => {
|
|
955
|
+
const x = (p + n / 30) % 12, r = h - i * Math.max(Math.min(x - 3, 9 - x, 1), -1);
|
|
787
956
|
return Math.round(255 * r).toString(16).padStart(2, "0");
|
|
788
957
|
};
|
|
789
|
-
return "#" +
|
|
958
|
+
return "#" + g(0) + g(8) + g(4);
|
|
790
959
|
}
|
|
791
|
-
function
|
|
792
|
-
const [
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
|
|
960
|
+
function vt({ value: n = "#0288d1", onChange: a, style: h }) {
|
|
961
|
+
const [i, g] = N(() => ae(n)), p = ge(...i);
|
|
962
|
+
A(H, []);
|
|
963
|
+
const x = (r) => {
|
|
964
|
+
g(r), a == null || a(ge(...r));
|
|
796
965
|
};
|
|
797
|
-
return /* @__PURE__ */
|
|
798
|
-
/* @__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(${
|
|
799
|
-
[["Hue", 0, 360,
|
|
800
|
-
/* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...h }, children: [
|
|
967
|
+
/* @__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(${i[0]},100%,50%))`, cursor: "crosshair" } }),
|
|
968
|
+
[["Hue", 0, 360, i[0]], ["Saturation", 0, 100, i[1]], ["Lightness", 0, 100, i[2]]].map(([r, d, y, c], S) => /* @__PURE__ */ u("div", { style: { marginBottom: S < 2 ? 8 : 12 }, children: [
|
|
969
|
+
/* @__PURE__ */ u("div", { className: "dhx dhx-label", children: [
|
|
801
970
|
r,
|
|
802
|
-
|
|
971
|
+
S > 0 ? ` (${c}%)` : ""
|
|
803
972
|
] }),
|
|
804
|
-
/* @__PURE__ */ t("input", { type: "range", min:
|
|
805
|
-
const m = [...
|
|
806
|
-
m[
|
|
973
|
+
/* @__PURE__ */ t("input", { type: "range", min: d, max: y, value: c, onChange: (C) => {
|
|
974
|
+
const m = [...i];
|
|
975
|
+
m[S] = +C.target.value, x(m);
|
|
807
976
|
}, style: { width: "100%", accentColor: e.primary } })
|
|
808
977
|
] }, r)),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background:
|
|
978
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
979
|
+
/* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: p, border: `1px solid ${e.border}`, flexShrink: 0 } }),
|
|
811
980
|
/* @__PURE__ */ t(
|
|
812
981
|
"input",
|
|
813
982
|
{
|
|
814
983
|
className: "dhx dhx-input",
|
|
815
984
|
style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
|
|
816
|
-
value:
|
|
985
|
+
value: p,
|
|
817
986
|
onChange: (r) => {
|
|
818
987
|
try {
|
|
819
|
-
|
|
988
|
+
x(ae(r.target.value)), a == null || a(r.target.value);
|
|
820
989
|
} catch {
|
|
821
990
|
}
|
|
822
991
|
}
|
|
823
992
|
}
|
|
824
993
|
)
|
|
825
994
|
] }),
|
|
826
|
-
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children:
|
|
995
|
+
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: st.map((r) => /* @__PURE__ */ t(
|
|
827
996
|
"div",
|
|
828
997
|
{
|
|
829
998
|
onClick: () => {
|
|
830
|
-
|
|
999
|
+
g(ae(r)), a == null || a(r);
|
|
831
1000
|
},
|
|
832
|
-
style: { width: 14, height: 14, borderRadius: 2, background: r, cursor: "pointer", border:
|
|
833
|
-
onMouseEnter: (
|
|
834
|
-
onMouseLeave: (
|
|
1001
|
+
style: { width: 14, height: 14, borderRadius: 2, background: r, cursor: "pointer", border: p === r ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
|
|
1002
|
+
onMouseEnter: (d) => d.currentTarget.style.transform = "scale(1.3)",
|
|
1003
|
+
onMouseLeave: (d) => d.currentTarget.style.transform = "scale(1)"
|
|
835
1004
|
},
|
|
836
1005
|
r
|
|
837
1006
|
)) })
|
|
838
1007
|
] });
|
|
839
1008
|
}
|
|
840
|
-
function
|
|
841
|
-
const [
|
|
842
|
-
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", ...
|
|
843
|
-
var
|
|
844
|
-
if (
|
|
845
|
-
const r =
|
|
846
|
-
return /* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
1009
|
+
function te({ items: n, onSelect: a, style: h }) {
|
|
1010
|
+
const [i, g] = N(null);
|
|
1011
|
+
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", ...h }, children: n.map((p, x) => {
|
|
1012
|
+
var d, y;
|
|
1013
|
+
if (p.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, x);
|
|
1014
|
+
const r = i === x;
|
|
1015
|
+
return /* @__PURE__ */ u("div", { style: { position: "relative" }, onMouseEnter: () => g(x), onMouseLeave: () => g(null), children: [
|
|
1016
|
+
/* @__PURE__ */ u(
|
|
848
1017
|
"div",
|
|
849
1018
|
{
|
|
850
1019
|
onClick: () => {
|
|
851
1020
|
var c;
|
|
852
|
-
return !
|
|
1021
|
+
return !p.disabled && !((c = p.items) != null && c.length) && a(p);
|
|
853
1022
|
},
|
|
854
|
-
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor:
|
|
1023
|
+
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: p.disabled ? "not-allowed" : "pointer", fontSize: 13, color: p.disabled ? e.textMut : e.text, background: r && !p.disabled ? e.bg : "transparent", opacity: p.disabled ? 0.5 : 1 },
|
|
855
1024
|
children: [
|
|
856
|
-
|
|
857
|
-
/* @__PURE__ */ t("span", { style: { flex: 1 }, children:
|
|
858
|
-
|
|
859
|
-
(
|
|
1025
|
+
p.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: p.icon }),
|
|
1026
|
+
/* @__PURE__ */ t("span", { style: { flex: 1 }, children: p.value || p.id }),
|
|
1027
|
+
p.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: p.hotkey }),
|
|
1028
|
+
(d = p.items) != null && d.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
|
|
860
1029
|
]
|
|
861
1030
|
}
|
|
862
1031
|
),
|
|
863
|
-
r && ((y =
|
|
864
|
-
] },
|
|
1032
|
+
r && ((y = p.items) != null && y.length) ? /* @__PURE__ */ t(te, { items: p.items, onSelect: a, style: { position: "absolute", left: "100%", top: -4 } }) : null
|
|
1033
|
+
] }, p.id || x);
|
|
865
1034
|
}) });
|
|
866
1035
|
}
|
|
867
|
-
function
|
|
868
|
-
const [
|
|
869
|
-
return
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
|
|
1036
|
+
function kt({ items: n = [], label: a = "Menu", onSelect: h, style: i }) {
|
|
1037
|
+
const [g, p] = N(!1), x = O(null);
|
|
1038
|
+
return A(H, []), Q(x, K(() => p(!1), [])), /* @__PURE__ */ u("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block", ...i }, children: [
|
|
1039
|
+
/* @__PURE__ */ u("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => p((r) => !r), children: [
|
|
1040
|
+
a,
|
|
872
1041
|
" ",
|
|
873
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children:
|
|
1042
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: g ? "▲" : "▼" })
|
|
874
1043
|
] }),
|
|
875
|
-
|
|
876
|
-
|
|
1044
|
+
g && /* @__PURE__ */ t(te, { items: n, onSelect: (r) => {
|
|
1045
|
+
h == null || h(r), p(!1);
|
|
877
1046
|
} })
|
|
878
1047
|
] });
|
|
879
1048
|
}
|
|
880
|
-
function
|
|
881
|
-
const [
|
|
882
|
-
return
|
|
883
|
-
r.preventDefault(),
|
|
1049
|
+
function St({ items: n = [], onSelect: a, children: h }) {
|
|
1050
|
+
const [i, g] = N(null), p = O(null);
|
|
1051
|
+
return A(H, []), Q(p, K(() => g(null), [])), /* @__PURE__ */ u("div", { ref: p, onContextMenu: (r) => {
|
|
1052
|
+
r.preventDefault(), g({ x: r.clientX, y: r.clientY });
|
|
884
1053
|
}, style: { position: "relative", display: "contents" }, children: [
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1054
|
+
h,
|
|
1055
|
+
i && /* @__PURE__ */ t("div", { style: { position: "fixed", left: i.x, top: i.y, zIndex: 9999 }, children: /* @__PURE__ */ t(te, { items: n, onSelect: (r) => {
|
|
1056
|
+
a == null || a(r), g(null);
|
|
888
1057
|
} }) })
|
|
889
1058
|
] });
|
|
890
1059
|
}
|
|
891
|
-
function
|
|
892
|
-
const [
|
|
893
|
-
return
|
|
1060
|
+
function wt({ trigger: n, children: a, placement: h = "bottom-start", style: i }) {
|
|
1061
|
+
const [g, p] = N(!1), [x, r] = N({ top: "100%", left: 0 }), d = O(null), y = O(null);
|
|
1062
|
+
return A(H, []), Q(d, K(() => p(!1), [])), /* @__PURE__ */ u("div", { ref: d, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
|
|
894
1063
|
/* @__PURE__ */ t("div", { ref: y, onClick: () => {
|
|
895
|
-
|
|
896
|
-
if (!
|
|
897
|
-
const
|
|
898
|
-
"bottom-start": { top:
|
|
899
|
-
"bottom-end": { top:
|
|
900
|
-
"top-start": { bottom:
|
|
1064
|
+
p((S) => {
|
|
1065
|
+
if (!S && y.current) {
|
|
1066
|
+
const C = y.current.getBoundingClientRect(), m = {
|
|
1067
|
+
"bottom-start": { top: C.height + 4, left: 0 },
|
|
1068
|
+
"bottom-end": { top: C.height + 4, right: 0, left: "auto" },
|
|
1069
|
+
"top-start": { bottom: C.height + 4, top: "auto", left: 0 }
|
|
901
1070
|
};
|
|
902
|
-
r(m[
|
|
1071
|
+
r(m[h] || m["bottom-start"]);
|
|
903
1072
|
}
|
|
904
|
-
return !
|
|
1073
|
+
return !S;
|
|
905
1074
|
});
|
|
906
1075
|
}, children: n }),
|
|
907
|
-
|
|
1076
|
+
g && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...x, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...i }, children: a })
|
|
908
1077
|
] });
|
|
909
1078
|
}
|
|
910
|
-
function
|
|
911
|
-
const [
|
|
912
|
-
|
|
913
|
-
const
|
|
914
|
-
|
|
1079
|
+
function Mt({ title: n, children: a, width: h = 480, height: i, closable: g = !0, movable: p = !0, modal: x = !1, defaultOpen: r = !0, footer: d, onClose: y, style: c }) {
|
|
1080
|
+
const [S, C] = N(r), [m, o] = N({ x: 0, y: 0 });
|
|
1081
|
+
A(H, []);
|
|
1082
|
+
const k = lt(K((T, D) => p && o({ x: T, y: D }), [p])), z = () => {
|
|
1083
|
+
C(!1), y == null || y();
|
|
915
1084
|
};
|
|
916
|
-
return
|
|
917
|
-
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
1085
|
+
return S ? /* @__PURE__ */ u(me, { children: [
|
|
1086
|
+
x && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: g ? z : void 0 }),
|
|
1087
|
+
/* @__PURE__ */ u("div", { className: "dhx", style: { position: x ? "fixed" : "absolute", left: x ? "50%" : `calc(50% + ${m.x}px)`, top: x ? "50%" : `calc(50% + ${m.y}px)`, transform: `translate(calc(-50% + ${m.x}px), calc(-50% + ${m.y}px))`, width: h, ...i ? { height: i } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...c }, children: [
|
|
1088
|
+
/* @__PURE__ */ u("div", { onMouseDown: (T) => k(T, m.x, m.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: p ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
|
|
920
1089
|
/* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
|
|
921
|
-
|
|
1090
|
+
g && /* @__PURE__ */ t(
|
|
922
1091
|
"button",
|
|
923
1092
|
{
|
|
924
|
-
onClick:
|
|
1093
|
+
onClick: z,
|
|
925
1094
|
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 },
|
|
926
|
-
onMouseEnter: (
|
|
927
|
-
onMouseLeave: (
|
|
1095
|
+
onMouseEnter: (T) => T.currentTarget.style.background = e.border,
|
|
1096
|
+
onMouseLeave: (T) => T.currentTarget.style.background = "none",
|
|
928
1097
|
children: "×"
|
|
929
1098
|
}
|
|
930
1099
|
)
|
|
931
1100
|
] }),
|
|
932
|
-
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children:
|
|
933
|
-
|
|
1101
|
+
/* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: a }),
|
|
1102
|
+
d && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: d })
|
|
934
1103
|
] })
|
|
935
1104
|
] }) : null;
|
|
936
1105
|
}
|
|
937
|
-
const
|
|
938
|
-
function
|
|
939
|
-
const [
|
|
940
|
-
|
|
941
|
-
const
|
|
1106
|
+
const ve = Le(null), dt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, fe = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
|
|
1107
|
+
function zt({ children: n }) {
|
|
1108
|
+
const [a, h] = N([]);
|
|
1109
|
+
A(H, []);
|
|
1110
|
+
const i = K((x) => h((r) => r.filter((d) => d.id !== x)), []), g = K((x) => {
|
|
942
1111
|
const r = Date.now();
|
|
943
|
-
return
|
|
944
|
-
}, [
|
|
945
|
-
message:
|
|
946
|
-
alert: (
|
|
947
|
-
confirm: (
|
|
1112
|
+
return h((d) => [...d, { id: r, ...x }]), x.duration !== 0 && setTimeout(() => i(r), x.duration || 4e3), r;
|
|
1113
|
+
}, [i]), p = {
|
|
1114
|
+
message: g,
|
|
1115
|
+
alert: (x, r) => g({ type: "info", title: x, ...r }),
|
|
1116
|
+
confirm: (x, r, d) => g({ type: "warning", title: x, confirm: r, ...d })
|
|
948
1117
|
};
|
|
949
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ u(ve.Provider, { value: p, children: [
|
|
950
1119
|
n,
|
|
951
|
-
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children:
|
|
952
|
-
const r =
|
|
953
|
-
return /* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 18, color:
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
1120
|
+
/* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: a.map((x) => {
|
|
1121
|
+
const r = x.type || "info";
|
|
1122
|
+
return /* @__PURE__ */ u("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${fe[r]}`, 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: [
|
|
1123
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 18, color: fe[r], lineHeight: 1 }, children: dt[r] }),
|
|
1124
|
+
/* @__PURE__ */ u("div", { style: { flex: 1 }, children: [
|
|
1125
|
+
x.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: x.text ? 3 : 0 }, children: x.title }),
|
|
1126
|
+
x.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: x.text }),
|
|
1127
|
+
x.confirm && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
|
|
959
1128
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
960
|
-
|
|
1129
|
+
x.confirm(!0), i(x.id);
|
|
961
1130
|
}, children: "Confirm" }),
|
|
962
1131
|
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
|
|
963
|
-
|
|
1132
|
+
x.confirm(!1), i(x.id);
|
|
964
1133
|
}, children: "Cancel" })
|
|
965
1134
|
] })
|
|
966
1135
|
] }),
|
|
967
|
-
/* @__PURE__ */ t("button", { onClick: () =>
|
|
968
|
-
] },
|
|
1136
|
+
/* @__PURE__ */ t("button", { onClick: () => i(x.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
|
|
1137
|
+
] }, x.id);
|
|
969
1138
|
}) })
|
|
970
1139
|
] });
|
|
971
1140
|
}
|
|
972
|
-
function
|
|
973
|
-
const n =
|
|
1141
|
+
function $t() {
|
|
1142
|
+
const n = Re(ve);
|
|
974
1143
|
if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
|
|
975
1144
|
return n;
|
|
976
1145
|
}
|
|
977
|
-
function
|
|
978
|
-
const [y, c] =
|
|
979
|
-
|
|
980
|
-
const
|
|
1146
|
+
function Ct({ data: n = [], template: a, keyNavigation: h = !0, multiselection: i = !1, editable: g = !1, height: p = 400, onSelect: x, onEdit: r, style: d }) {
|
|
1147
|
+
const [y, c] = N(/* @__PURE__ */ new Set()), [S, C] = N(null), [m, o] = N(""), [k, z] = N(null);
|
|
1148
|
+
A(H, []);
|
|
1149
|
+
const T = (w, s) => {
|
|
981
1150
|
const b = w.id ?? s;
|
|
982
|
-
c((
|
|
983
|
-
const
|
|
984
|
-
return
|
|
985
|
-
}),
|
|
986
|
-
},
|
|
987
|
-
r == null || r({ ...w, value: m }, s),
|
|
1151
|
+
c((R) => {
|
|
1152
|
+
const l = i ? new Set(R) : /* @__PURE__ */ new Set();
|
|
1153
|
+
return l.has(b) ? l.delete(b) : l.add(b), l;
|
|
1154
|
+
}), z(s), x == null || x(w);
|
|
1155
|
+
}, D = (w, s) => {
|
|
1156
|
+
r == null || r({ ...w, value: m }, s), C(null);
|
|
988
1157
|
};
|
|
989
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ u(
|
|
990
1159
|
"div",
|
|
991
1160
|
{
|
|
992
1161
|
className: "dhx dhx-scroll",
|
|
993
|
-
style: { height:
|
|
1162
|
+
style: { height: p, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...d },
|
|
994
1163
|
tabIndex: 0,
|
|
995
1164
|
onKeyDown: (w) => {
|
|
996
|
-
|
|
1165
|
+
h && (w.key === "ArrowDown" && z((s) => Math.min((s ?? -1) + 1, n.length - 1)), w.key === "ArrowUp" && z((s) => Math.max((s ?? 1) - 1, 0)));
|
|
997
1166
|
},
|
|
998
1167
|
children: [
|
|
999
1168
|
n.map((w, s) => {
|
|
1000
|
-
const b = w.id ?? s,
|
|
1169
|
+
const b = w.id ?? s, R = y.has(b), l = k === s;
|
|
1001
1170
|
return /* @__PURE__ */ t(
|
|
1002
1171
|
"div",
|
|
1003
1172
|
{
|
|
1004
|
-
onClick: () =>
|
|
1005
|
-
onDoubleClick: () =>
|
|
1006
|
-
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background:
|
|
1007
|
-
children:
|
|
1173
|
+
onClick: () => T(w, s),
|
|
1174
|
+
onDoubleClick: () => g && (C(s), o(String(w.value || ""))),
|
|
1175
|
+
style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: R ? e.primaryLt : l ? e.bg : e.surface, color: R ? e.primary : e.text, outline: l ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
|
|
1176
|
+
children: S === s ? /* @__PURE__ */ t(
|
|
1008
1177
|
"input",
|
|
1009
1178
|
{
|
|
1010
1179
|
autoFocus: !0,
|
|
1011
1180
|
className: "dhx dhx-input",
|
|
1012
1181
|
style: { height: 28, flex: 1 },
|
|
1013
1182
|
value: m,
|
|
1014
|
-
onChange: (
|
|
1015
|
-
onBlur: () =>
|
|
1016
|
-
onKeyDown: (
|
|
1017
|
-
|
|
1183
|
+
onChange: ($) => o($.target.value),
|
|
1184
|
+
onBlur: () => D(w, s),
|
|
1185
|
+
onKeyDown: ($) => {
|
|
1186
|
+
$.key === "Enter" && D(w, s), $.key === "Escape" && C(null);
|
|
1018
1187
|
},
|
|
1019
|
-
onClick: (
|
|
1188
|
+
onClick: ($) => $.stopPropagation()
|
|
1020
1189
|
}
|
|
1021
|
-
) :
|
|
1190
|
+
) : a ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: a(w) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(w.value ?? "") })
|
|
1022
1191
|
},
|
|
1023
1192
|
String(b)
|
|
1024
1193
|
);
|
|
@@ -1028,18 +1197,18 @@ function Qe({ data: n = [], template: d, keyNavigation: u = !0, multiselection:
|
|
|
1028
1197
|
}
|
|
1029
1198
|
);
|
|
1030
1199
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const [r,
|
|
1033
|
-
|
|
1200
|
+
function Nt({ data: n = [], template: a, itemsInRow: h = 3, gap: i = 12, multiselection: g = !1, onSelect: p, style: x }) {
|
|
1201
|
+
const [r, d] = N(/* @__PURE__ */ new Set());
|
|
1202
|
+
A(H, []);
|
|
1034
1203
|
const y = (c) => {
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
const m =
|
|
1038
|
-
return m.has(
|
|
1039
|
-
}),
|
|
1204
|
+
const S = c.id ?? String(c.title);
|
|
1205
|
+
d((C) => {
|
|
1206
|
+
const m = g ? new Set(C) : /* @__PURE__ */ new Set();
|
|
1207
|
+
return m.has(S) ? m.delete(S) : m.add(S), m;
|
|
1208
|
+
}), p == null || p(c);
|
|
1040
1209
|
};
|
|
1041
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${
|
|
1042
|
-
const
|
|
1210
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${h}, 1fr)`, gap: i, padding: i, ...x }, children: n.map((c, S) => {
|
|
1211
|
+
const C = c.id ?? S, m = r.has(C);
|
|
1043
1212
|
return /* @__PURE__ */ t(
|
|
1044
1213
|
"div",
|
|
1045
1214
|
{
|
|
@@ -1051,45 +1220,45 @@ function Ze({ data: n = [], template: d, itemsInRow: u = 3, gap: l = 12, multise
|
|
|
1051
1220
|
onMouseLeave: (o) => {
|
|
1052
1221
|
o.currentTarget.style.boxShadow = m ? `0 0 0 3px ${e.primary}33` : e.shadow, o.currentTarget.style.transform = m ? "translateY(-2px)" : "none";
|
|
1053
1222
|
},
|
|
1054
|
-
children:
|
|
1223
|
+
children: a ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: a(c) } }) : /* @__PURE__ */ u("div", { style: { padding: 16 }, children: [
|
|
1055
1224
|
c.img && /* @__PURE__ */ t("img", { src: c.img, alt: c.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
|
|
1056
1225
|
/* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: c.title || c.value }),
|
|
1057
1226
|
c.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: c.subtitle })
|
|
1058
1227
|
] })
|
|
1059
1228
|
},
|
|
1060
|
-
String(
|
|
1229
|
+
String(C)
|
|
1061
1230
|
);
|
|
1062
1231
|
}) });
|
|
1063
1232
|
}
|
|
1064
|
-
function
|
|
1065
|
-
const [
|
|
1066
|
-
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1069
|
-
},
|
|
1070
|
-
var
|
|
1071
|
-
const b = (((
|
|
1072
|
-
return /* @__PURE__ */
|
|
1073
|
-
/* @__PURE__ */
|
|
1233
|
+
function It({ data: n = [], checkbox: a = !1, editable: h = !1, onSelect: i, onCheck: g, style: p }) {
|
|
1234
|
+
const [x, r] = N({}), [d, y] = N(null), [c, S] = N({}), [C, m] = N(null), [o, k] = N("");
|
|
1235
|
+
A(H, []);
|
|
1236
|
+
const z = (w) => r((s) => ({ ...s, [w]: !s[w] })), T = (w, s) => {
|
|
1237
|
+
S((b) => ({ ...b, [w]: s })), g == null || g(w, s);
|
|
1238
|
+
}, D = (w, s = 0) => {
|
|
1239
|
+
var $;
|
|
1240
|
+
const b = ((($ = w.items) == null ? void 0 : $.length) ?? 0) > 0, R = x[w.id], l = d === w.id;
|
|
1241
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
1242
|
+
/* @__PURE__ */ u(
|
|
1074
1243
|
"div",
|
|
1075
1244
|
{
|
|
1076
1245
|
onClick: () => {
|
|
1077
|
-
y(w.id),
|
|
1246
|
+
y(w.id), i == null || i(w), b && z(w.id);
|
|
1078
1247
|
},
|
|
1079
1248
|
onDoubleClick: () => {
|
|
1080
|
-
|
|
1249
|
+
h && (m(w.id), k(w.value || ""));
|
|
1081
1250
|
},
|
|
1082
|
-
style: { display: "flex", alignItems: "center", gap: 4, padding: `5px 8px 5px ${12 + s * 18}px`, cursor: "pointer", borderRadius: e.r, margin: "1px 4px", background:
|
|
1083
|
-
onMouseEnter: (
|
|
1084
|
-
onMouseLeave: (
|
|
1251
|
+
style: { display: "flex", alignItems: "center", gap: 4, padding: `5px 8px 5px ${12 + s * 18}px`, cursor: "pointer", borderRadius: e.r, margin: "1px 4px", background: l ? e.primaryLt : "transparent", color: l ? e.primary : e.text, userSelect: "none", fontSize: 13 },
|
|
1252
|
+
onMouseEnter: (f) => !l && (f.currentTarget.style.background = e.bg),
|
|
1253
|
+
onMouseLeave: (f) => !l && (f.currentTarget.style.background = "transparent"),
|
|
1085
1254
|
children: [
|
|
1086
|
-
/* @__PURE__ */ t("span", { style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 }, children: b ?
|
|
1087
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: b ?
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}, style: { cursor: "pointer", accentColor: e.primary }, onClick: (
|
|
1091
|
-
|
|
1092
|
-
w.count !== void 0 && /* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ t("span", { style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 }, children: b ? R ? "▾" : "▸" : "" }),
|
|
1256
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: b ? R ? "📂" : "📁" : "📄" }),
|
|
1257
|
+
a && /* @__PURE__ */ t("input", { type: "checkbox", checked: !!c[w.id], onChange: (f) => {
|
|
1258
|
+
f.stopPropagation(), T(w.id, f.target.checked);
|
|
1259
|
+
}, style: { cursor: "pointer", accentColor: e.primary }, onClick: (f) => f.stopPropagation() }),
|
|
1260
|
+
C === w.id ? /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 24, fontSize: 12, flex: 1 }, value: o, onChange: (f) => k(f.target.value), onBlur: () => m(null), onKeyDown: (f) => f.key === "Enter" && m(null), onClick: (f) => f.stopPropagation() }) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: w.value }),
|
|
1261
|
+
w.count !== void 0 && /* @__PURE__ */ u("span", { style: { fontSize: 11, color: e.textMut }, children: [
|
|
1093
1262
|
"(",
|
|
1094
1263
|
w.count,
|
|
1095
1264
|
")"
|
|
@@ -1097,407 +1266,407 @@ function et({ data: n = [], checkbox: d = !1, editable: u = !1, onSelect: l, onC
|
|
|
1097
1266
|
]
|
|
1098
1267
|
}
|
|
1099
1268
|
),
|
|
1100
|
-
b &&
|
|
1269
|
+
b && R && /* @__PURE__ */ t("div", { children: w.items.map((f) => D(f, s + 1)) })
|
|
1101
1270
|
] }, w.id);
|
|
1102
1271
|
};
|
|
1103
|
-
return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...
|
|
1272
|
+
return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...p }, children: n.map((w) => D(w)) });
|
|
1104
1273
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const [
|
|
1107
|
-
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
}, y =
|
|
1274
|
+
function Tt({ total: n, pageSize: a = 10, page: h, onChange: i, style: g }) {
|
|
1275
|
+
const [p, x] = N(h || 1), r = Math.ceil(n / a);
|
|
1276
|
+
A(H, []);
|
|
1277
|
+
const d = (c) => {
|
|
1278
|
+
const S = Math.min(Math.max(1, c), r);
|
|
1279
|
+
x(S), i == null || i(S);
|
|
1280
|
+
}, y = J(() => {
|
|
1112
1281
|
const c = [];
|
|
1113
|
-
for (let
|
|
1282
|
+
for (let C = Math.max(1, p - 2); C <= Math.min(r, p + 2); C++) c.push(C);
|
|
1114
1283
|
return c[0] > 1 && (c[0] > 2 && c.unshift("..."), c.unshift(1)), c[c.length - 1] < r && (c[c.length - 1] < r - 1 && c.push("..."), c.push(r)), c;
|
|
1115
|
-
}, [
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
(
|
|
1284
|
+
}, [p, r]);
|
|
1285
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...g }, children: [
|
|
1286
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
|
|
1287
|
+
(p - 1) * a + 1,
|
|
1119
1288
|
"–",
|
|
1120
|
-
Math.min(
|
|
1289
|
+
Math.min(p * a, n),
|
|
1121
1290
|
" of ",
|
|
1122
1291
|
n
|
|
1123
1292
|
] }),
|
|
1124
|
-
[["«", 1], ["‹",
|
|
1125
|
-
y.map((c,
|
|
1126
|
-
[["›",
|
|
1293
|
+
[["«", 1], ["‹", p - 1]].map(([c, S]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: p === 1, onClick: () => d(S), children: c }, c)),
|
|
1294
|
+
y.map((c, S) => /* @__PURE__ */ t("button", { onClick: () => typeof c == "number" && d(c), className: `dhx dhx-btn ${c === p ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: c === "...", children: c }, S)),
|
|
1295
|
+
[["›", p + 1], ["»", r]].map(([c, S]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: p === r, onClick: () => d(S), children: c }, c))
|
|
1127
1296
|
] });
|
|
1128
1297
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const [
|
|
1131
|
-
|
|
1132
|
-
const c = (o,
|
|
1133
|
-
|
|
1134
|
-
},
|
|
1298
|
+
function Dt({ config: n = {}, defaultValues: a = {}, onSubmit: h, style: i }) {
|
|
1299
|
+
const [g, p] = N(a), [x, r] = N({}), [d, y] = N(null);
|
|
1300
|
+
A(H, []);
|
|
1301
|
+
const c = (o, k) => {
|
|
1302
|
+
p((z) => ({ ...z, [o]: k })), r((z) => ({ ...z, [o]: null }));
|
|
1303
|
+
}, S = () => {
|
|
1135
1304
|
const o = {};
|
|
1136
|
-
return (n.rows || []).flat().forEach((
|
|
1137
|
-
|
|
1305
|
+
return (n.rows || []).flat().forEach((k) => {
|
|
1306
|
+
k && typeof k == "object" && "name" in k && k.required && !g[k.name] && (o[k.name] = `${k.label || k.name} is required`);
|
|
1138
1307
|
}), r(o), Object.keys(o).length === 0;
|
|
1139
|
-
},
|
|
1140
|
-
const
|
|
1141
|
-
if (o.type === "fieldset") return /* @__PURE__ */
|
|
1308
|
+
}, C = (o) => {
|
|
1309
|
+
const k = g[o.name] ?? o.value ?? "", z = x[o.name], T = o.labelWidth ?? n.labelWidth, D = T !== void 0 || o.labelPosition === "left";
|
|
1310
|
+
if (o.type === "fieldset") return /* @__PURE__ */ u("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
|
|
1142
1311
|
/* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
|
|
1143
|
-
(o.rows || []).map((
|
|
1312
|
+
(o.rows || []).map((f) => C(f))
|
|
1144
1313
|
] }, o.name);
|
|
1145
1314
|
if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
|
|
1146
|
-
const w =
|
|
1315
|
+
const w = T ? { minWidth: T, width: T, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, s = o.label ? /* @__PURE__ */ u("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...w }, children: [
|
|
1147
1316
|
o.label,
|
|
1148
1317
|
o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
|
|
1149
|
-
] }, "lbl") : null, b =
|
|
1318
|
+
] }, "lbl") : null, b = z ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: z }) : null, R = o.helpMessage ? /* @__PURE__ */ u("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
|
|
1150
1319
|
"ⓘ ",
|
|
1151
1320
|
o.helpMessage
|
|
1152
|
-
] }) : null,
|
|
1321
|
+
] }) : null, l = { key: o.name, className: "dhx-form-group" }, $ = (f) => D ? /* @__PURE__ */ u("div", { ...l, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1153
1322
|
s,
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
|
|
1323
|
+
/* @__PURE__ */ u("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1324
|
+
f,
|
|
1156
1325
|
b,
|
|
1157
|
-
|
|
1326
|
+
R
|
|
1158
1327
|
] })
|
|
1159
|
-
] }) : /* @__PURE__ */
|
|
1328
|
+
] }) : /* @__PURE__ */ u("div", { ...l, children: [
|
|
1160
1329
|
s,
|
|
1161
|
-
|
|
1330
|
+
f,
|
|
1162
1331
|
b,
|
|
1163
|
-
|
|
1332
|
+
R
|
|
1164
1333
|
] });
|
|
1165
|
-
if (!o.type || o.type === "input") return
|
|
1166
|
-
/* @__PURE__ */
|
|
1334
|
+
if (!o.type || o.type === "input") return $(
|
|
1335
|
+
/* @__PURE__ */ u("div", { className: "dhx-input-wrap", children: [
|
|
1167
1336
|
o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
|
|
1168
1337
|
/* @__PURE__ */ t(
|
|
1169
1338
|
"input",
|
|
1170
1339
|
{
|
|
1171
1340
|
className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
|
|
1172
|
-
style: { borderColor:
|
|
1341
|
+
style: { borderColor: z ? e.danger : void 0 },
|
|
1173
1342
|
type: o.inputType || "text",
|
|
1174
1343
|
placeholder: o.placeholder,
|
|
1175
|
-
value:
|
|
1176
|
-
onChange: (
|
|
1344
|
+
value: k,
|
|
1345
|
+
onChange: (f) => c(o.name, f.target.value),
|
|
1177
1346
|
disabled: o.disabled
|
|
1178
1347
|
}
|
|
1179
1348
|
)
|
|
1180
1349
|
] })
|
|
1181
1350
|
);
|
|
1182
|
-
if (o.type === "textarea") return
|
|
1351
|
+
if (o.type === "textarea") return $(
|
|
1183
1352
|
/* @__PURE__ */ t(
|
|
1184
1353
|
"textarea",
|
|
1185
1354
|
{
|
|
1186
1355
|
className: "dhx dhx-input",
|
|
1187
1356
|
style: { height: 80, resize: "vertical", padding: "8px 10px" },
|
|
1188
1357
|
placeholder: o.placeholder,
|
|
1189
|
-
value:
|
|
1190
|
-
onChange: (
|
|
1358
|
+
value: k,
|
|
1359
|
+
onChange: (f) => c(o.name, f.target.value)
|
|
1191
1360
|
}
|
|
1192
1361
|
)
|
|
1193
1362
|
);
|
|
1194
|
-
if (o.type === "select") return
|
|
1195
|
-
/* @__PURE__ */
|
|
1363
|
+
if (o.type === "select") return $(
|
|
1364
|
+
/* @__PURE__ */ u("select", { className: "dhx dhx-input", value: k, onChange: (f) => c(o.name, f.target.value), style: { cursor: "pointer" }, children: [
|
|
1196
1365
|
/* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
|
|
1197
|
-
(o.options || []).map((
|
|
1366
|
+
(o.options || []).map((f) => /* @__PURE__ */ t("option", { value: f.value, children: f.label || f.value }, f.value))
|
|
1198
1367
|
] })
|
|
1199
1368
|
);
|
|
1200
|
-
if (o.type === "datepicker") return
|
|
1201
|
-
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value:
|
|
1369
|
+
if (o.type === "datepicker") return $(
|
|
1370
|
+
/* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: k, onChange: (f) => c(o.name, f.target.value) })
|
|
1202
1371
|
);
|
|
1203
1372
|
if (o.type === "timepicker") {
|
|
1204
|
-
const
|
|
1205
|
-
/* @__PURE__ */
|
|
1373
|
+
const f = g[o.name] ?? { h: 12, m: 0, ampm: "AM" }, W = !!g[o.name], P = W ? `${String(f.h).padStart(2, "0")}:${String(f.m).padStart(2, "0")}${f.ampm ? " " + f.ampm : ""}` : o.placeholder || "Click to select", V = /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
|
|
1374
|
+
/* @__PURE__ */ u(
|
|
1206
1375
|
"div",
|
|
1207
1376
|
{
|
|
1208
1377
|
className: "dhx dhx-input",
|
|
1209
1378
|
style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
|
|
1210
|
-
onClick: () => y(
|
|
1379
|
+
onClick: () => y(d === o.name ? null : o.name),
|
|
1211
1380
|
children: [
|
|
1212
|
-
/* @__PURE__ */ t("span", { style: { color:
|
|
1381
|
+
/* @__PURE__ */ t("span", { style: { color: W ? e.text : e.textMut }, children: P }),
|
|
1213
1382
|
/* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
|
|
1214
1383
|
]
|
|
1215
1384
|
}
|
|
1216
1385
|
),
|
|
1217
|
-
|
|
1218
|
-
c(o.name,
|
|
1386
|
+
d === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(it, { value: f, controls: !0, onChange: (U) => {
|
|
1387
|
+
c(o.name, U), y(null);
|
|
1219
1388
|
} }) })
|
|
1220
1389
|
] });
|
|
1221
|
-
return
|
|
1390
|
+
return $(V);
|
|
1222
1391
|
}
|
|
1223
|
-
if (o.type === "colorpicker") return
|
|
1224
|
-
/* @__PURE__ */
|
|
1392
|
+
if (o.type === "colorpicker") return $(
|
|
1393
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1225
1394
|
/* @__PURE__ */ t(
|
|
1226
1395
|
"input",
|
|
1227
1396
|
{
|
|
1228
1397
|
type: "color",
|
|
1229
|
-
value:
|
|
1230
|
-
onChange: (
|
|
1398
|
+
value: k || "#000000",
|
|
1399
|
+
onChange: (f) => c(o.name, f.target.value),
|
|
1231
1400
|
style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
|
|
1232
1401
|
}
|
|
1233
1402
|
),
|
|
1234
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children:
|
|
1403
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: k || "#000000" })
|
|
1235
1404
|
] })
|
|
1236
1405
|
);
|
|
1237
|
-
if (o.type === "text") return
|
|
1406
|
+
if (o.type === "text") return $(
|
|
1238
1407
|
/* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
|
|
1239
1408
|
);
|
|
1240
|
-
if (o.type === "checkbox") return /* @__PURE__ */
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
1409
|
+
if (o.type === "checkbox") return /* @__PURE__ */ u("div", { ...l, children: [
|
|
1410
|
+
D ? /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1411
|
+
T && /* @__PURE__ */ t("div", { style: { width: T, flexShrink: 0 } }),
|
|
1412
|
+
/* @__PURE__ */ u("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1413
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!k, onChange: (f) => c(o.name, f.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
1245
1414
|
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
|
|
1246
1415
|
] })
|
|
1247
|
-
] }) : /* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!
|
|
1416
|
+
] }) : /* @__PURE__ */ u("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1417
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: !!k, onChange: (f) => c(o.name, f.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
|
|
1249
1418
|
/* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
|
|
1250
1419
|
] }),
|
|
1251
|
-
|
|
1420
|
+
R
|
|
1252
1421
|
] });
|
|
1253
1422
|
if (o.type === "radio") {
|
|
1254
|
-
const
|
|
1423
|
+
const f = (o.options || []).map((W) => /* @__PURE__ */ u("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
|
|
1255
1424
|
/* @__PURE__ */ t(
|
|
1256
1425
|
"input",
|
|
1257
1426
|
{
|
|
1258
1427
|
type: "radio",
|
|
1259
1428
|
name: o.name,
|
|
1260
|
-
value:
|
|
1261
|
-
checked:
|
|
1262
|
-
onChange: () => c(o.name,
|
|
1429
|
+
value: W.value,
|
|
1430
|
+
checked: k === W.value,
|
|
1431
|
+
onChange: () => c(o.name, W.value),
|
|
1263
1432
|
style: { accentColor: e.primary, cursor: "pointer" }
|
|
1264
1433
|
}
|
|
1265
1434
|
),
|
|
1266
|
-
|
|
1267
|
-
] },
|
|
1268
|
-
return
|
|
1269
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children:
|
|
1435
|
+
W.label || W.value
|
|
1436
|
+
] }, W.value));
|
|
1437
|
+
return $(
|
|
1438
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: f })
|
|
1270
1439
|
);
|
|
1271
1440
|
}
|
|
1272
|
-
if (o.type === "slider") return
|
|
1441
|
+
if (o.type === "slider") return D ? /* @__PURE__ */ u("div", { ...l, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1273
1442
|
s,
|
|
1274
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ u("div", { style: { flex: 1 }, children: [
|
|
1275
1444
|
/* @__PURE__ */ t(
|
|
1276
|
-
|
|
1445
|
+
xe,
|
|
1277
1446
|
{
|
|
1278
1447
|
min: o.min,
|
|
1279
1448
|
max: o.max,
|
|
1280
1449
|
step: o.step,
|
|
1281
|
-
value:
|
|
1450
|
+
value: k || o.min,
|
|
1282
1451
|
range: o.range,
|
|
1283
|
-
onChange: (
|
|
1452
|
+
onChange: (f) => c(o.name, f)
|
|
1284
1453
|
}
|
|
1285
1454
|
),
|
|
1286
|
-
|
|
1455
|
+
R
|
|
1287
1456
|
] })
|
|
1288
|
-
] }) : /* @__PURE__ */
|
|
1457
|
+
] }) : /* @__PURE__ */ u("div", { ...l, children: [
|
|
1289
1458
|
/* @__PURE__ */ t(
|
|
1290
|
-
|
|
1459
|
+
xe,
|
|
1291
1460
|
{
|
|
1292
1461
|
label: o.label,
|
|
1293
1462
|
min: o.min,
|
|
1294
1463
|
max: o.max,
|
|
1295
1464
|
step: o.step,
|
|
1296
|
-
value:
|
|
1465
|
+
value: k || o.min,
|
|
1297
1466
|
range: o.range,
|
|
1298
|
-
onChange: (
|
|
1467
|
+
onChange: (f) => c(o.name, f)
|
|
1299
1468
|
}
|
|
1300
1469
|
),
|
|
1301
|
-
|
|
1470
|
+
R
|
|
1302
1471
|
] });
|
|
1303
|
-
if (o.type === "combo") return
|
|
1472
|
+
if (o.type === "combo") return D ? /* @__PURE__ */ u("div", { ...l, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
1304
1473
|
s,
|
|
1305
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ u("div", { style: { flex: 1 }, children: [
|
|
1306
1475
|
/* @__PURE__ */ t(
|
|
1307
|
-
|
|
1476
|
+
ue,
|
|
1308
1477
|
{
|
|
1309
1478
|
data: o.data || [],
|
|
1310
1479
|
multiselection: o.multiselection,
|
|
1311
1480
|
placeholder: o.placeholder || "Select...",
|
|
1312
|
-
value:
|
|
1313
|
-
onChange: (
|
|
1481
|
+
value: k || (o.multiselection ? [] : null),
|
|
1482
|
+
onChange: (f) => c(o.name, f)
|
|
1314
1483
|
}
|
|
1315
1484
|
),
|
|
1316
1485
|
b,
|
|
1317
|
-
|
|
1486
|
+
R
|
|
1318
1487
|
] })
|
|
1319
|
-
] }) : /* @__PURE__ */
|
|
1488
|
+
] }) : /* @__PURE__ */ u("div", { ...l, children: [
|
|
1320
1489
|
/* @__PURE__ */ t(
|
|
1321
|
-
|
|
1490
|
+
ue,
|
|
1322
1491
|
{
|
|
1323
1492
|
label: o.label,
|
|
1324
1493
|
data: o.data || [],
|
|
1325
1494
|
multiselection: o.multiselection,
|
|
1326
1495
|
placeholder: o.placeholder || "Select...",
|
|
1327
|
-
value:
|
|
1328
|
-
onChange: (
|
|
1496
|
+
value: k || (o.multiselection ? [] : null),
|
|
1497
|
+
onChange: (f) => c(o.name, f)
|
|
1329
1498
|
}
|
|
1330
1499
|
),
|
|
1331
1500
|
b,
|
|
1332
|
-
|
|
1501
|
+
R
|
|
1333
1502
|
] });
|
|
1334
1503
|
if (o.type === "toggle") {
|
|
1335
|
-
const
|
|
1336
|
-
return /* @__PURE__ */
|
|
1337
|
-
|
|
1338
|
-
/* @__PURE__ */ t("div", { style: { width:
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */ t(
|
|
1341
|
-
|
|
1342
|
-
|
|
1504
|
+
const f = !!k, W = f ? o.icon : o.offIcon || o.icon, P = f ? o.text || o.label : o.offText || o.text || o.label;
|
|
1505
|
+
return /* @__PURE__ */ u("div", { ...l, children: [
|
|
1506
|
+
D && T && /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1507
|
+
/* @__PURE__ */ t("div", { style: { width: T, flexShrink: 0 } }),
|
|
1508
|
+
/* @__PURE__ */ u("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
|
|
1509
|
+
/* @__PURE__ */ t(ye, { on: f, onClick: () => c(o.name, !k) }),
|
|
1510
|
+
W && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: W }),
|
|
1511
|
+
P && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: P })
|
|
1343
1512
|
] })
|
|
1344
1513
|
] }),
|
|
1345
|
-
!
|
|
1346
|
-
/* @__PURE__ */ t(
|
|
1347
|
-
|
|
1348
|
-
|
|
1514
|
+
!D && /* @__PURE__ */ u("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
|
|
1515
|
+
/* @__PURE__ */ t(ye, { on: f, onClick: () => c(o.name, !k) }),
|
|
1516
|
+
W && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: W }),
|
|
1517
|
+
P && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: P })
|
|
1349
1518
|
] }),
|
|
1350
|
-
|
|
1519
|
+
R
|
|
1351
1520
|
] });
|
|
1352
1521
|
}
|
|
1353
1522
|
return null;
|
|
1354
1523
|
}, m = (o) => o.map(
|
|
1355
|
-
(
|
|
1524
|
+
(k, z) => Array.isArray(k) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: k.map(C) }, z) : C(k)
|
|
1356
1525
|
);
|
|
1357
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ u("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...i }, children: [
|
|
1358
1527
|
m(n.rows || []),
|
|
1359
|
-
(n.buttons ||
|
|
1360
|
-
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () =>
|
|
1528
|
+
(n.buttons || h) && /* @__PURE__ */ u("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
|
|
1529
|
+
/* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => S() && (h == null ? void 0 : h(g)), children: n.submitText || "Submit" }),
|
|
1361
1530
|
n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
|
|
1362
|
-
|
|
1531
|
+
p(a), r({});
|
|
1363
1532
|
}, children: n.resetText || "Reset" })
|
|
1364
1533
|
] })
|
|
1365
1534
|
] });
|
|
1366
1535
|
}
|
|
1367
|
-
function
|
|
1368
|
-
return /* @__PURE__ */
|
|
1536
|
+
function ye({ on: n, onClick: a }) {
|
|
1537
|
+
return /* @__PURE__ */ u("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: a, children: [
|
|
1369
1538
|
/* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
|
|
1370
1539
|
/* @__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)" } })
|
|
1371
1540
|
] });
|
|
1372
1541
|
}
|
|
1373
|
-
function
|
|
1374
|
-
const
|
|
1375
|
-
for (const
|
|
1376
|
-
"type" in
|
|
1377
|
-
return
|
|
1542
|
+
function be(n) {
|
|
1543
|
+
const a = [];
|
|
1544
|
+
for (const h of n)
|
|
1545
|
+
"type" in h && h.type === "block" ? a.push(...h.items || []) : a.push(h);
|
|
1546
|
+
return a;
|
|
1378
1547
|
}
|
|
1379
|
-
function
|
|
1380
|
-
|
|
1381
|
-
const [
|
|
1548
|
+
function Lt({ items: n = [], onAction: a, style: h }) {
|
|
1549
|
+
A(H, []);
|
|
1550
|
+
const [i, g] = N(() => {
|
|
1382
1551
|
const r = {};
|
|
1383
|
-
for (const
|
|
1384
|
-
|
|
1552
|
+
for (const d of be(n))
|
|
1553
|
+
d.id && (r[d.id] = !!d.active);
|
|
1385
1554
|
return r;
|
|
1386
|
-
}),
|
|
1387
|
-
var
|
|
1555
|
+
}), p = (r) => {
|
|
1556
|
+
var d;
|
|
1388
1557
|
if (r.id)
|
|
1389
1558
|
if (r.group) {
|
|
1390
|
-
const y =
|
|
1391
|
-
|
|
1392
|
-
const
|
|
1393
|
-
for (const
|
|
1394
|
-
return
|
|
1559
|
+
const y = be(n).filter((c) => c.group === r.group && c.id);
|
|
1560
|
+
g((c) => {
|
|
1561
|
+
const S = { ...c };
|
|
1562
|
+
for (const C of y) S[C.id] = !1;
|
|
1563
|
+
return S[r.id] = !0, S;
|
|
1395
1564
|
});
|
|
1396
|
-
} else r.twoState &&
|
|
1397
|
-
(
|
|
1398
|
-
},
|
|
1399
|
-
var
|
|
1565
|
+
} else r.twoState && g((y) => ({ ...y, [r.id]: !y[r.id] }));
|
|
1566
|
+
(d = r.onClick) == null || d.call(r, r), r.id && (a == null || a(r.id, r));
|
|
1567
|
+
}, x = (r, d) => {
|
|
1568
|
+
var S, C;
|
|
1400
1569
|
if ("type" in r && (r.type === "separator" || r.type === "sep"))
|
|
1401
|
-
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } },
|
|
1570
|
+
return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, d);
|
|
1402
1571
|
if ("type" in r && r.type === "input") {
|
|
1403
1572
|
const m = r;
|
|
1404
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
|
|
1405
1574
|
m.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: m.label }),
|
|
1406
1575
|
/* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: m.width || 110, height: 26, fontSize: 12 }, placeholder: m.placeholder, defaultValue: m.value, onChange: (o) => {
|
|
1407
|
-
var
|
|
1408
|
-
return (
|
|
1576
|
+
var k;
|
|
1577
|
+
return (k = m.onChange) == null ? void 0 : k.call(m, o.target.value);
|
|
1409
1578
|
} })
|
|
1410
|
-
] },
|
|
1579
|
+
] }, d);
|
|
1411
1580
|
}
|
|
1412
1581
|
if ("type" in r && r.type === "block") {
|
|
1413
1582
|
const m = r;
|
|
1414
|
-
return /* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (
|
|
1583
|
+
return /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: m.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
|
|
1584
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (S = m.items) == null ? void 0 : S.map((o, k) => x(o, k)) }),
|
|
1416
1585
|
m.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: m.label })
|
|
1417
|
-
] },
|
|
1586
|
+
] }, d);
|
|
1418
1587
|
}
|
|
1419
1588
|
if ("type" in r && r.type === "selectButton") {
|
|
1420
1589
|
const m = r;
|
|
1421
1590
|
return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: m.value, onChange: (o) => {
|
|
1422
|
-
var
|
|
1423
|
-
return (
|
|
1424
|
-
}, children: (
|
|
1591
|
+
var k;
|
|
1592
|
+
return (k = m.onChange) == null ? void 0 : k.call(m, o.target.value);
|
|
1593
|
+
}, children: (C = m.items) == null ? void 0 : C.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.value }, o.value)) }, d);
|
|
1425
1594
|
}
|
|
1426
|
-
const y = r, c = y.id !== void 0 ?
|
|
1427
|
-
return /* @__PURE__ */
|
|
1595
|
+
const y = r, c = y.id !== void 0 ? i[y.id] ?? !!y.active : !!y.active;
|
|
1596
|
+
return /* @__PURE__ */ u(
|
|
1428
1597
|
"button",
|
|
1429
1598
|
{
|
|
1430
1599
|
title: y.tooltip,
|
|
1431
1600
|
className: `dhx dhx-btn ${c ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
|
|
1432
1601
|
style: { flexDirection: "column", minHeight: 48, padding: "4px 8px", gap: 4, fontSize: 12 },
|
|
1433
1602
|
disabled: y.disabled,
|
|
1434
|
-
onClick: () =>
|
|
1603
|
+
onClick: () => p(y),
|
|
1435
1604
|
children: [
|
|
1436
1605
|
y.icon && /* @__PURE__ */ t("span", { style: { fontSize: y.size === "large" ? 24 : 18 }, children: y.icon }),
|
|
1437
1606
|
y.text && /* @__PURE__ */ t("span", { style: { fontSize: 10, maxWidth: 60, textAlign: "center", lineHeight: 1.2, whiteSpace: "normal" }, children: y.text })
|
|
1438
1607
|
]
|
|
1439
1608
|
},
|
|
1440
|
-
|
|
1609
|
+
d
|
|
1441
1610
|
);
|
|
1442
1611
|
};
|
|
1443
|
-
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "stretch", background: e.bg, borderBottom: `1px solid ${e.border}`, padding: "4px 0", overflowX: "auto", gap: 0, ...
|
|
1612
|
+
return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "stretch", background: e.bg, borderBottom: `1px solid ${e.border}`, padding: "4px 0", overflowX: "auto", gap: 0, ...h }, children: n.map(x) });
|
|
1444
1613
|
}
|
|
1445
|
-
function
|
|
1446
|
-
const [
|
|
1447
|
-
|
|
1448
|
-
const r = (
|
|
1614
|
+
function Rt({ logo: n, items: a = [], vertical: h = !1, style: i }) {
|
|
1615
|
+
const [g, p] = N(null), x = O(null);
|
|
1616
|
+
A(H, []), Q(x, K(() => p(null), []));
|
|
1617
|
+
const r = (d, y) => {
|
|
1449
1618
|
var c;
|
|
1450
|
-
return
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
|
|
1453
|
-
|
|
1619
|
+
return d.type === "separator" ? /* @__PURE__ */ t("div", { style: { [h ? "height" : "width"]: 1, background: e.border, margin: h ? "4px 8px" : "0 6px", alignSelf: "stretch" } }, y) : d.type === "spacer" ? /* @__PURE__ */ t("div", { style: { flex: 1 } }, y) : d.type === "input" ? /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: d.width || 200, height: 28, margin: "0 4px" }, placeholder: d.placeholder }, y) : d.type === "menuItem" && ((c = d.items) != null && c.length) ? /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
|
|
1620
|
+
/* @__PURE__ */ u("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, color: e.text }, onClick: () => p(g === y ? null : y), children: [
|
|
1621
|
+
d.icon && /* @__PURE__ */ t("span", { children: d.icon }),
|
|
1622
|
+
d.value,
|
|
1454
1623
|
" ",
|
|
1455
1624
|
/* @__PURE__ */ t("span", { style: { fontSize: 9 }, children: "▼" })
|
|
1456
1625
|
] }),
|
|
1457
|
-
|
|
1458
|
-
] }, y) : /* @__PURE__ */
|
|
1459
|
-
var
|
|
1460
|
-
return (
|
|
1626
|
+
g === y && /* @__PURE__ */ t(te, { items: d.items, onSelect: () => p(null), style: { top: "100%" } })
|
|
1627
|
+
] }, y) : /* @__PURE__ */ u("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, gap: 6, color: e.text }, onClick: () => {
|
|
1628
|
+
var S;
|
|
1629
|
+
return (S = d.onClick) == null ? void 0 : S.call(d);
|
|
1461
1630
|
}, children: [
|
|
1462
|
-
|
|
1463
|
-
|
|
1631
|
+
d.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: d.icon }),
|
|
1632
|
+
d.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: d.value })
|
|
1464
1633
|
] }, y);
|
|
1465
1634
|
};
|
|
1466
|
-
return /* @__PURE__ */
|
|
1467
|
-
n && /* @__PURE__ */ t("div", { style: { color: e.text, fontWeight: 800, fontSize: 16, padding:
|
|
1468
|
-
|
|
1635
|
+
return /* @__PURE__ */ u("nav", { ref: x, className: "dhx", style: { display: "flex", flexDirection: h ? "column" : "row", alignItems: h ? "stretch" : "center", background: e.surface, borderBottom: h ? "none" : `1px solid ${e.border}`, borderRight: h ? `1px solid ${e.border}` : "none", padding: h ? "12px 0" : "0 12px", minHeight: h ? void 0 : 48, gap: 2, ...i }, children: [
|
|
1636
|
+
n && /* @__PURE__ */ t("div", { style: { color: e.text, fontWeight: 800, fontSize: 16, padding: h ? "8px 16px" : "0 12px 0 4px", borderRight: h ? "none" : `1px solid ${e.border}`, marginRight: h ? 0 : 8 }, children: n }),
|
|
1637
|
+
a.map(r)
|
|
1469
1638
|
] });
|
|
1470
1639
|
}
|
|
1471
1640
|
export {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1641
|
+
ut as Button,
|
|
1642
|
+
mt as Calendar,
|
|
1643
|
+
bt as Chart,
|
|
1644
|
+
vt as Colorpicker,
|
|
1645
|
+
ue as Combobox,
|
|
1646
|
+
St as ContextMenu,
|
|
1647
|
+
Nt as DataView,
|
|
1648
|
+
Dt as Form,
|
|
1649
|
+
yt as Grid,
|
|
1650
|
+
tt as Layout,
|
|
1651
|
+
Ct as List,
|
|
1652
|
+
kt as Menu,
|
|
1653
|
+
te as MenuDropdown,
|
|
1654
|
+
ve as MessageContext,
|
|
1655
|
+
zt as MessageProvider,
|
|
1656
|
+
Rt as Navbar,
|
|
1657
|
+
Tt as Pagination,
|
|
1658
|
+
wt as Popup,
|
|
1659
|
+
Lt as Ribbon,
|
|
1660
|
+
gt as Sidebar,
|
|
1661
|
+
xe as Slider,
|
|
1662
|
+
ft as Tabbar,
|
|
1663
|
+
it as Timepicker,
|
|
1664
|
+
xt as Toolbar,
|
|
1665
|
+
It as Tree,
|
|
1666
|
+
Mt as Window,
|
|
1498
1667
|
e as tokens,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1668
|
+
Q as useClickOutside,
|
|
1669
|
+
lt as useDrag,
|
|
1670
|
+
$t as useMessage
|
|
1502
1671
|
};
|
|
1503
1672
|
//# sourceMappingURL=dhx-react-suite.js.map
|