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