dhx-react-suite 1.0.2 → 1.0.3

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.
@@ -1,6 +1,6 @@
1
- import { jsxs as f, jsx as t, Fragment as Z } from "react/jsx-runtime";
2
- import { useEffect as T, useState as z, useMemo as F, useRef as B, useCallback as H, createContext as ee, useContext as te } from "react";
3
- import { Tooltip as re, Legend as ne, CartesianGrid as oe, XAxis as _, YAxis as X, BarChart as ie, Bar as le, LineChart as ae, Line as se, AreaChart as de, Area as ce, PieChart as pe, Pie as ue, Cell as he, RadarChart as xe, PolarGrid as ge, PolarAngleAxis as fe, Radar as ye, ScatterChart as be, Scatter as me, ResponsiveContainer as ve } from "recharts";
1
+ import { jsxs as f, jsx as t, Fragment as ee } from "react/jsx-runtime";
2
+ import { useEffect as D, useState as z, useMemo as K, useRef as H, useCallback as B, createContext as te, useContext as re } from "react";
3
+ import { Tooltip as ne, Legend as oe, CartesianGrid as ie, XAxis as F, YAxis as X, BarChart as le, Bar as ae, LineChart as se, Line as de, AreaChart as ce, Area as pe, PieChart as he, Pie as ue, Cell as xe, RadarChart as ge, PolarGrid as fe, PolarAngleAxis as ye, Radar as be, ScatterChart as me, Scatter as ve, ResponsiveContainer as ke } from "recharts";
4
4
  const e = {
5
5
  primary: "#0288d1",
6
6
  primaryDk: "#01579b",
@@ -23,8 +23,8 @@ const e = {
23
23
  }, V = "dhx-react-styles";
24
24
  function W() {
25
25
  if (typeof document > "u" || document.getElementById(V)) return;
26
- const r = document.createElement("style");
27
- r.id = V, r.textContent = `
26
+ const n = document.createElement("style");
27
+ n.id = V, n.textContent = `
28
28
  *,*::before,*::after{box-sizing:border-box}
29
29
  .dhx{font-family:${e.font};font-size:14px;color:${e.text}}
30
30
  .dhx *{box-sizing:border-box}
@@ -64,239 +64,239 @@ function W() {
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(r);
67
+ `, document.head.appendChild(n);
68
68
  }
69
- const ke = {
69
+ const we = {
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 We({
75
- children: r,
76
- variant: l = "primary",
77
- size: g = "md",
78
- icon: o,
79
- disabled: s,
80
- onClick: a,
81
- style: c,
82
- className: n = ""
74
+ function Ae({
75
+ children: n,
76
+ variant: s = "primary",
77
+ size: u = "md",
78
+ icon: i,
79
+ disabled: g,
80
+ onClick: h,
81
+ style: x,
82
+ className: r = ""
83
83
  }) {
84
- return T(W, []), /* @__PURE__ */ f(
84
+ return D(W, []), /* @__PURE__ */ f(
85
85
  "button",
86
86
  {
87
- className: `dhx dhx-btn dhx-btn-${l} ${n}`,
88
- style: { ...ke[g], ...c },
89
- disabled: s,
90
- onClick: a,
87
+ className: `dhx dhx-btn dhx-btn-${s} ${r}`,
88
+ style: { ...we[u], ...x },
89
+ disabled: g,
90
+ onClick: h,
91
91
  children: [
92
- o && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: o }),
93
- r
92
+ i && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i }),
93
+ n
94
94
  ]
95
95
  }
96
96
  );
97
97
  }
98
- function Ee({ items: r = [], style: l }) {
99
- T(W, []);
100
- const g = (o, s) => {
101
- var c;
102
- if (o.type === "separator")
103
- return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, s);
104
- if (o.type === "spacer")
105
- return /* @__PURE__ */ t("div", { style: { flex: 1 } }, s);
106
- if (o.type === "input")
98
+ function Ee({ items: n = [], style: s }) {
99
+ D(W, []);
100
+ const u = (i, g) => {
101
+ var x;
102
+ if (i.type === "separator")
103
+ return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, g);
104
+ if (i.type === "spacer")
105
+ return /* @__PURE__ */ t("div", { style: { flex: 1 } }, g);
106
+ if (i.type === "input")
107
107
  return /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
108
- o.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: o.label }),
108
+ i.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: i.label }),
109
109
  /* @__PURE__ */ t(
110
110
  "input",
111
111
  {
112
112
  className: "dhx dhx-input",
113
- style: { width: o.width || 140, height: 28 },
114
- placeholder: o.placeholder,
115
- defaultValue: o.value,
116
- onChange: (n) => {
117
- var p;
118
- return (p = o.onChange) == null ? void 0 : p.call(o, n.target.value);
113
+ style: { width: i.width || 140, height: 28 },
114
+ placeholder: i.placeholder,
115
+ defaultValue: i.value,
116
+ onChange: (r) => {
117
+ var l;
118
+ return (l = i.onChange) == null ? void 0 : l.call(i, r.target.value);
119
119
  }
120
120
  }
121
121
  )
122
- ] }, s);
123
- if (o.type === "select")
122
+ ] }, g);
123
+ if (i.type === "select")
124
124
  return /* @__PURE__ */ t(
125
125
  "select",
126
126
  {
127
127
  className: "dhx dhx-input",
128
- style: { width: o.width || 100, height: 28, cursor: "pointer" },
129
- defaultValue: o.value,
130
- onChange: (n) => {
131
- var p;
132
- return (p = o.onChange) == null ? void 0 : p.call(o, n.target.value);
128
+ style: { width: i.width || 100, height: 28, cursor: "pointer" },
129
+ defaultValue: i.value,
130
+ onChange: (r) => {
131
+ var l;
132
+ return (l = i.onChange) == null ? void 0 : l.call(i, r.target.value);
133
133
  },
134
- children: (c = o.options) == null ? void 0 : c.map((n) => /* @__PURE__ */ t("option", { value: n.value, children: n.label }, n.value))
134
+ children: (x = i.options) == null ? void 0 : x.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
135
135
  },
136
- s
136
+ g
137
137
  );
138
- const a = o.active;
138
+ const h = i.active;
139
139
  return /* @__PURE__ */ f(
140
140
  "button",
141
141
  {
142
- className: `dhx dhx-btn ${a ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
143
- style: { height: 32, gap: 4, ...o.twoState && a ? { background: e.primaryLt, color: e.primary, borderColor: `${e.primary}66` } : {} },
144
- disabled: o.disabled,
142
+ className: `dhx dhx-btn ${h ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
143
+ style: { height: 32, gap: 4, ...i.twoState && h ? { background: e.primaryLt, color: e.primary, borderColor: `${e.primary}66` } : {} },
144
+ disabled: i.disabled,
145
145
  onClick: () => {
146
- var n;
147
- return (n = o.onClick) == null ? void 0 : n.call(o, o);
146
+ var r;
147
+ return (r = i.onClick) == null ? void 0 : r.call(i, i);
148
148
  },
149
149
  children: [
150
- o.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: o.icon }),
151
- o.text && /* @__PURE__ */ t("span", { children: o.text })
150
+ i.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i.icon }),
151
+ i.text && /* @__PURE__ */ t("span", { children: i.text })
152
152
  ]
153
153
  },
154
- s
154
+ g
155
155
  );
156
156
  };
157
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...l }, children: r.map(g) });
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", ...s }, children: n.map(u) });
158
158
  }
159
- function Ae({ items: r = [], width: l = 240, collapsed: g, onSelect: o, header: s, footer: a, style: c }) {
160
- const [n, p] = z(g ?? !1), [m, d] = z(null), [h, i] = z({});
161
- T(W, []);
162
- const y = n ? 56 : l, $ = (v) => {
163
- d(v.id), o == null || o(v);
164
- }, S = (v, N = 0) => {
165
- var M;
166
- if (v.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, v.id);
167
- if (v.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: v.html || "" } }, v.id);
168
- const k = (((M = v.items) == null ? void 0 : M.length) ?? 0) > 0, u = h[v.id], x = m === v.id;
159
+ function Be({ items: n = [], width: s = 240, collapsed: u, onSelect: i, header: g, footer: h, style: x }) {
160
+ const [r, l] = z(u ?? !1), [y, d] = z(null), [k, a] = z({});
161
+ D(W, []);
162
+ const c = r ? 56 : s, M = (S) => {
163
+ d(S.id), i == null || i(S);
164
+ }, $ = (S, C = 0) => {
165
+ var v;
166
+ if (S.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, S.id);
167
+ if (S.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: S.html || "" } }, S.id);
168
+ const m = (((v = S.items) == null ? void 0 : v.length) ?? 0) > 0, p = k[S.id], o = y === S.id;
169
169
  return /* @__PURE__ */ f("div", { children: [
170
170
  /* @__PURE__ */ f(
171
171
  "div",
172
172
  {
173
173
  onClick: () => {
174
- k && i((D) => ({ ...D, [v.id]: !D[v.id] })), $(v);
174
+ m && a((L) => ({ ...L, [S.id]: !L[S.id] })), M(S);
175
175
  },
176
- style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${n ? "0px" : `${12 + N * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: n ? "center" : "flex-start", transition: "all .15s", background: x ? e.primaryLt : "transparent", color: x ? e.primary : e.text, userSelect: "none" },
177
- onMouseEnter: (D) => !x && (D.currentTarget.style.background = e.bg),
178
- onMouseLeave: (D) => !x && (D.currentTarget.style.background = "transparent"),
176
+ style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${r ? "0px" : `${12 + C * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: r ? "center" : "flex-start", transition: "all .15s", background: o ? e.primaryLt : "transparent", color: o ? e.primary : e.text, userSelect: "none" },
177
+ onMouseEnter: (L) => !o && (L.currentTarget.style.background = e.bg),
178
+ onMouseLeave: (L) => !o && (L.currentTarget.style.background = "transparent"),
179
179
  children: [
180
- v.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: v.icon }),
181
- !n && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: x ? 600 : 400 }, children: v.value }),
182
- !n && v.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: v.count }),
183
- !n && k && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: u ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
180
+ S.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: S.icon }),
181
+ !r && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: o ? 600 : 400 }, children: S.value }),
182
+ !r && S.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: S.count }),
183
+ !r && m && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: p ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
184
184
  ]
185
185
  }
186
186
  ),
187
- k && u && !n && v.items.map((D) => S(D, N + 1))
188
- ] }, v.id);
187
+ m && p && !r && S.items.map((L) => $(L, C + 1))
188
+ ] }, S.id);
189
189
  };
190
- return /* @__PURE__ */ f("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", ...c }, children: [
191
- s && !n && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: s }),
192
- /* @__PURE__ */ t("button", { onClick: () => p((v) => !v), 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((v) => S(v)) }),
194
- a && !n && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
190
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { width: c, minWidth: c, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...x }, children: [
191
+ g && !r && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: g }),
192
+ /* @__PURE__ */ t("button", { onClick: () => l((S) => !S), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: r ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: r ? "☰" : "✕" }) }),
193
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((S) => $(S)) }),
194
+ h && !r && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: h })
195
195
  ] });
196
196
  }
197
- function we({ config: r }) {
198
- const [l, g] = z(!1), o = {
197
+ function Se({ config: n }) {
198
+ const [s, u] = z(!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
- ...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" } : {}
204
+ ...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
205
+ ...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
206
+ ...s ? { flex: "0 0 auto" } : {}
207
207
  };
208
- return /* @__PURE__ */ f("div", { style: o, children: [
209
- r.header && /* @__PURE__ */ f("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: () => g((s) => !s), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: l ? "▼" : "▲" })
208
+ return /* @__PURE__ */ f("div", { style: i, children: [
209
+ n.header && /* @__PURE__ */ f("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: n.header }),
211
+ n.collapsable && /* @__PURE__ */ t("button", { onClick: () => u((g) => !g), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: s ? "▼" : "▲" })
212
212
  ] }),
213
- !l && /* @__PURE__ */ f("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(Se, { rows: r.rows, cols: r.cols, style: { height: "100%" } })
213
+ !s && /* @__PURE__ */ f("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
214
+ n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
215
+ (n.rows || n.cols) && /* @__PURE__ */ t(Me, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
216
216
  ] })
217
217
  ] });
218
218
  }
219
- function Se({ rows: r, cols: l, type: g = "line", style: o, children: s }) {
220
- T(W, []);
221
- const a = g === "space" ? 12 : g === "wide" ? 8 : 1, c = r || l, n = !!r;
222
- return c ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: n ? "column" : "row", gap: a, width: "100%", height: "100%", ...o }, children: c.map((p, m) => /* @__PURE__ */ t(we, { config: p }, p.id || m)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...o }, children: s });
219
+ function Me({ rows: n, cols: s, type: u = "line", style: i, children: g }) {
220
+ D(W, []);
221
+ const h = u === "space" ? 12 : u === "wide" ? 8 : 1, x = n || s, r = !!n;
222
+ return x ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: r ? "column" : "row", gap: h, width: "100%", height: "100%", ...i }, children: x.map((l, y) => /* @__PURE__ */ t(Se, { config: l }, l.id || y)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...i }, children: g });
223
223
  }
224
- function He({ views: r = [], mode: l = "top", tabAlign: g = "left", closable: o = [], disabled: s = [], defaultActive: a, onBeforeChange: c, onChange: n, style: p }) {
225
- var x;
226
- const [m, d] = z(a || ((x = r[0]) == null ? void 0 : x.id)), [h, i] = z(r.map((M) => M.id));
227
- T(W, []);
228
- const y = (M, D) => {
229
- M.stopPropagation(), i((b) => b.filter((C) => C !== D)), m === D && d(h.find((b) => b !== D) ?? "");
230
- }, $ = (M) => {
231
- s.includes(M) || c && c(M) === !1 || (d(M), n == null || n(M));
232
- }, S = l === "left" || l === "right", v = r.filter((M) => h.includes(M.id)), N = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: S ? "column" : "row", justifyContent: g === "center" ? "center" : g === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !S && 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: v.map((M) => {
233
- const D = m === M.id, b = s.includes(M.id), C = l === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : S ? { 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 };
224
+ function He({ views: n = [], mode: s = "top", tabAlign: u = "left", closable: i = [], disabled: g = [], defaultActive: h, onBeforeChange: x, onChange: r, style: l }) {
225
+ var o;
226
+ const [y, d] = z(h || ((o = n[0]) == null ? void 0 : o.id)), [k, a] = z(n.map((v) => v.id));
227
+ D(W, []);
228
+ const c = (v, L) => {
229
+ v.stopPropagation(), a((b) => b.filter((N) => N !== L)), y === L && d(k.find((b) => b !== L) ?? "");
230
+ }, M = (v) => {
231
+ g.includes(v) || x && x(v) === !1 || (d(v), r == null || r(v));
232
+ }, $ = s === "left" || s === "right", S = n.filter((v) => k.includes(v.id)), C = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: $ ? "column" : "row", justifyContent: u === "center" ? "center" : u === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !$ && s !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: s === "bottom" ? `2px solid ${e.border}` : "none", borderRight: s === "left" ? `2px solid ${e.border}` : "none", borderLeft: s === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: S.map((v) => {
233
+ const L = y === v.id, b = g.includes(v.id), N = s === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : $ ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [s === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
234
234
  return /* @__PURE__ */ f(
235
235
  "div",
236
236
  {
237
- onClick: () => $(M.id),
238
- style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: b ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: S ? 120 : "auto", ...D ? C : { color: b ? e.textMut : e.textSec } },
237
+ onClick: () => M(v.id),
238
+ style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: b ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: $ ? 120 : "auto", ...L ? N : { color: b ? e.textMut : e.textSec } },
239
239
  children: [
240
- M.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: M.icon }),
241
- /* @__PURE__ */ t("span", { children: M.tab }),
242
- o.includes(M.id) && /* @__PURE__ */ t("span", { onClick: (w) => y(w, M.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
240
+ v.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: v.icon }),
241
+ /* @__PURE__ */ t("span", { children: v.tab }),
242
+ i.includes(v.id) && /* @__PURE__ */ t("span", { onClick: (w) => c(w, v.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
243
243
  ]
244
244
  },
245
- M.id
245
+ v.id
246
246
  );
247
- }) }), k = v.find((M) => M.id === m), u = /* @__PURE__ */ f("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
248
- k == null ? void 0 : k.content,
249
- (k == null ? void 0 : k.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: k.html }, style: { padding: 16 } })
247
+ }) }), m = S.find((v) => v.id === y), p = /* @__PURE__ */ f("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
248
+ m == null ? void 0 : m.content,
249
+ (m == null ? void 0 : m.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: m.html }, style: { padding: 16 } })
250
250
  ] });
251
- return /* @__PURE__ */ f("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", ...p }, children: [
252
- N,
253
- u
251
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", flexDirection: s === "top" ? "column" : s === "bottom" ? "column-reverse" : s === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...l }, children: [
252
+ C,
253
+ p
254
254
  ] });
255
255
  }
256
- function Be({ columns: r, data: l = [], height: g = 400, rowHeight: o = 40, sortable: s = !0, resizable: a = !0, selection: c, multiselect: n, onSelect: p, style: m }) {
257
- const [d, h] = z(null), [i, y] = z("asc"), [$, S] = z({}), [v, N] = z(/* @__PURE__ */ new Set()), [k, u] = z(r.map((w) => w.width || w.minWidth || 140));
258
- T(W, []);
259
- const x = F(() => {
260
- let w = l.filter(
261
- (L) => Object.entries($).every(([E, I]) => !I || String(L[E] ?? "").toLowerCase().includes(I.toLowerCase()))
256
+ function je({ columns: n, data: s = [], height: u = 400, rowHeight: i = 40, sortable: g = !0, resizable: h = !0, selection: x, multiselect: r, onSelect: l, style: y }) {
257
+ const [d, k] = z(null), [a, c] = z("asc"), [M, $] = z({}), [S, C] = z(/* @__PURE__ */ new Set()), [m, p] = z(n.map((w) => w.width || w.minWidth || 140));
258
+ D(W, []);
259
+ const o = K(() => {
260
+ let w = s.filter(
261
+ (T) => Object.entries(M).every(([A, I]) => !I || String(T[A] ?? "").toLowerCase().includes(I.toLowerCase()))
262
262
  );
263
- return d && (w = [...w].sort((L, E) => {
264
- const I = L[d], R = E[d];
265
- return I == null ? 1 : R == null ? -1 : i === "asc" ? I < R ? -1 : I > R ? 1 : 0 : I > R ? -1 : I < R ? 1 : 0;
263
+ return d && (w = [...w].sort((T, A) => {
264
+ const I = T[d], R = A[d];
265
+ return I == null ? 1 : R == null ? -1 : a === "asc" ? I < R ? -1 : I > R ? 1 : 0 : I > R ? -1 : I < R ? 1 : 0;
266
266
  })), w;
267
- }, [l, d, i, $]), M = (w) => {
268
- !s || w.sortable === !1 || (y((L) => d === w.id && L === "asc" ? "desc" : "asc"), h(w.id));
269
- }, D = (w, L) => {
270
- if (!c) return;
271
- const E = w.id ?? L;
272
- N((I) => {
273
- const R = n ? new Set(I) : /* @__PURE__ */ new Set();
274
- return R.has(E) ? R.delete(E) : R.add(E), R;
275
- }), p == null || p(w);
276
- }, b = (w, L) => {
277
- const E = w.clientX, I = k[L], R = (U) => u((Q) => {
278
- const K = [...Q];
279
- return K[L] = Math.max(60, I + U.clientX - E), K;
267
+ }, [s, d, a, M]), v = (w) => {
268
+ !g || w.sortable === !1 || (c((T) => d === w.id && T === "asc" ? "desc" : "asc"), k(w.id));
269
+ }, L = (w, T) => {
270
+ if (!x) return;
271
+ const A = w.id ?? T;
272
+ C((I) => {
273
+ const R = r ? new Set(I) : /* @__PURE__ */ new Set();
274
+ return R.has(A) ? R.delete(A) : R.add(A), R;
275
+ }), l == null || l(w);
276
+ }, b = (w, T) => {
277
+ const A = w.clientX, I = m[T], R = (Q) => p((Z) => {
278
+ const _ = [...Z];
279
+ return _[T] = Math.max(60, I + Q.clientX - A), _;
280
280
  }), j = () => {
281
281
  document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", j);
282
282
  };
283
283
  document.addEventListener("mousemove", R), document.addEventListener("mouseup", j), w.preventDefault();
284
- }, C = r.some((w) => w.filterable !== !1);
285
- return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: g, display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...m }, children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ f("div", { style: { minWidth: k.reduce((w, L) => w + L, 0) + "px", display: "flex", flexDirection: "column", height: "100%" }, children: [
286
- /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: `1px solid ${e.border}`, position: "sticky", top: 0, zIndex: 2 }, children: r.map((w, L) => {
287
- var E;
284
+ }, N = n.some((w) => w.filterable !== !1);
285
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: u, display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...y }, children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ f("div", { style: { minWidth: m.reduce((w, T) => w + T, 0) + "px", display: "flex", flexDirection: "column", height: "100%" }, children: [
286
+ /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: `1px solid ${e.border}`, position: "sticky", top: 0, zIndex: 2 }, children: n.map((w, T) => {
287
+ var A;
288
288
  return /* @__PURE__ */ f(
289
289
  "div",
290
290
  {
291
- style: { width: k[L], minWidth: k[L], position: "relative", padding: "0 10px", height: 40, display: "flex", alignItems: "center", fontSize: 12, fontWeight: 600, color: e.textSec, cursor: s && w.sortable !== !1 ? "pointer" : "default", userSelect: "none", gap: 4 },
292
- onClick: () => M(w),
291
+ style: { width: m[T], minWidth: m[T], position: "relative", padding: "0 10px", height: 40, display: "flex", alignItems: "center", fontSize: 12, fontWeight: 600, color: e.textSec, cursor: g && w.sortable !== !1 ? "pointer" : "default", userSelect: "none", gap: 4 },
292
+ onClick: () => v(w),
293
293
  children: [
294
- /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(w.header) ? (E = w.header[0]) == null ? void 0 : E.text : w.header || w.id }),
295
- s && w.sortable !== !1 && /* @__PURE__ */ t("span", { style: { opacity: d === w.id ? 1 : 0.25, fontSize: 10 }, children: d === w.id ? i === "asc" ? "▲" : "▼" : "⇅" }),
296
- a && L < r.length - 1 && /* @__PURE__ */ t(
294
+ /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(w.header) ? (A = w.header[0]) == null ? void 0 : A.text : w.header || w.id }),
295
+ g && w.sortable !== !1 && /* @__PURE__ */ t("span", { style: { opacity: d === w.id ? 1 : 0.25, fontSize: 10 }, children: d === w.id ? a === "asc" ? "▲" : "▼" : "⇅" }),
296
+ h && T < n.length - 1 && /* @__PURE__ */ t(
297
297
  "div",
298
298
  {
299
- onMouseDown: (I) => b(I, L),
299
+ onMouseDown: (I) => b(I, T),
300
300
  style: { position: "absolute", right: 0, top: 4, bottom: 4, width: 4, cursor: "col-resize", background: "transparent" },
301
301
  onMouseEnter: (I) => I.currentTarget.style.background = e.border,
302
302
  onMouseLeave: (I) => I.currentTarget.style.background = "transparent"
@@ -307,865 +307,947 @@ function Be({ columns: r, data: l = [], height: g = 400, rowHeight: o = 40, sort
307
307
  w.id
308
308
  );
309
309
  }) }),
310
- C && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: `1px solid ${e.border}`, background: e.surface }, children: r.map((w, L) => /* @__PURE__ */ t("div", { style: { width: k[L], minWidth: k[L], padding: "4px 6px" }, children: w.filterable !== !1 && /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { height: 24, fontSize: 12 }, placeholder: "🔍", value: $[w.id] || "", onChange: (E) => S((I) => ({ ...I, [w.id]: E.target.value })) }) }, w.id)) }),
310
+ N && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: `1px solid ${e.border}`, background: e.surface }, children: n.map((w, T) => /* @__PURE__ */ t("div", { style: { width: m[T], minWidth: m[T], padding: "4px 6px" }, children: w.filterable !== !1 && /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { height: 24, fontSize: 12 }, placeholder: "🔍", value: M[w.id] || "", onChange: (A) => $((I) => ({ ...I, [w.id]: A.target.value })) }) }, w.id)) }),
311
311
  /* @__PURE__ */ f("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto" }, children: [
312
- x.map((w, L) => {
313
- const E = w.id ?? L, I = v.has(E);
312
+ o.map((w, T) => {
313
+ const A = w.id ?? T, I = S.has(A);
314
314
  return /* @__PURE__ */ t(
315
315
  "div",
316
316
  {
317
- onClick: () => D(w, L),
318
- style: { display: "flex", height: o, alignItems: "center", borderBottom: `1px solid ${e.border}`, cursor: c ? "pointer" : "default", background: I ? e.primaryLt : L % 2 === 0 ? e.surface : e.bg, transition: "background .1s" },
317
+ onClick: () => L(w, T),
318
+ style: { display: "flex", height: i, alignItems: "center", borderBottom: `1px solid ${e.border}`, cursor: x ? "pointer" : "default", background: I ? e.primaryLt : T % 2 === 0 ? e.surface : e.bg, transition: "background .1s" },
319
319
  onMouseEnter: (R) => !I && (R.currentTarget.style.background = "#f0f8ff"),
320
- onMouseLeave: (R) => !I && (R.currentTarget.style.background = L % 2 === 0 ? e.surface : e.bg),
321
- children: r.map((R, j) => /* @__PURE__ */ t("div", { style: { width: k[j], minWidth: k[j], padding: "0 10px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontSize: 13, textAlign: R.align || "left" }, children: R.template ? R.template(w[R.id], w) : String(w[R.id] ?? "") }, R.id))
320
+ onMouseLeave: (R) => !I && (R.currentTarget.style.background = T % 2 === 0 ? e.surface : e.bg),
321
+ children: n.map((R, j) => /* @__PURE__ */ t("div", { style: { width: m[j], minWidth: m[j], padding: "0 10px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontSize: 13, textAlign: R.align || "left" }, children: R.template ? R.template(w[R.id], w) : String(w[R.id] ?? "") }, R.id))
322
322
  },
323
- String(E)
323
+ String(A)
324
324
  );
325
325
  }),
326
- x.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut }, children: "No data" })
326
+ o.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut }, children: "No data" })
327
327
  ] })
328
328
  ] }) }) });
329
329
  }
330
- const A = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
331
- function je({ type: r = "bar", data: l = [], series: g = [], scales: o = {}, legend: s, height: a = 280, style: c }) {
332
- var S, v, N, k, u;
333
- T(W, []);
334
- const n = ((S = o.bottom) == null ? void 0 : S.text) || l[0] && Object.keys(l[0])[0] || "x", p = /* @__PURE__ */ t(re, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), m = s ? /* @__PURE__ */ t(ne, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: s.valign, align: s.halign }) : null, d = /* @__PURE__ */ t(oe, { strokeDasharray: "3 3", stroke: e.border }), h = /* @__PURE__ */ t(_, { dataKey: n, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), i = /* @__PURE__ */ t(X, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((v = o.left) == null ? void 0 : v.min) ?? "auto", ((N = o.left) == null ? void 0 : N.max) ?? "auto"] }), y = { data: l, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
335
- let $;
336
- if (r === "bar")
337
- $ = /* @__PURE__ */ f(ie, { ...y, children: [
330
+ const E = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
331
+ function Ye({ type: n = "bar", data: s = [], series: u = [], scales: i = {}, legend: g, height: h = 280, style: x }) {
332
+ var $, S, C, m, p;
333
+ D(W, []);
334
+ const r = (($ = i.bottom) == null ? void 0 : $.text) || s[0] && Object.keys(s[0])[0] || "x", l = /* @__PURE__ */ t(ne, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), y = g ? /* @__PURE__ */ t(oe, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: g.valign, align: g.halign }) : null, d = /* @__PURE__ */ t(ie, { strokeDasharray: "3 3", stroke: e.border }), k = /* @__PURE__ */ t(F, { dataKey: r, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), a = /* @__PURE__ */ t(X, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((S = i.left) == null ? void 0 : S.min) ?? "auto", ((C = i.left) == null ? void 0 : C.max) ?? "auto"] }), c = { data: s, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
335
+ let M;
336
+ if (n === "bar")
337
+ M = /* @__PURE__ */ f(le, { ...c, children: [
338
338
  d,
339
- h,
340
- i,
341
- p,
342
- m,
343
- g.map((x, M) => /* @__PURE__ */ t(le, { dataKey: x.value || x.id, name: x.label || x.id, fill: x.fill || A[M % A.length], radius: [3, 3, 0, 0] }, x.id))
339
+ k,
340
+ a,
341
+ l,
342
+ y,
343
+ u.map((o, v) => /* @__PURE__ */ t(ae, { dataKey: o.value || o.id, name: o.label || o.id, fill: o.fill || E[v % E.length], radius: [3, 3, 0, 0] }, o.id))
344
344
  ] });
345
- else if (r === "line")
346
- $ = /* @__PURE__ */ f(ae, { ...y, children: [
345
+ else if (n === "line")
346
+ M = /* @__PURE__ */ f(se, { ...c, children: [
347
347
  d,
348
- h,
349
- i,
350
- p,
351
- m,
352
- g.map((x, M) => /* @__PURE__ */ t(se, { type: "monotone", dataKey: x.value || x.id, name: x.label || x.id, stroke: x.color || A[M % A.length], strokeWidth: 2, dot: { r: 3, fill: x.color || A[M % A.length] } }, x.id))
348
+ k,
349
+ a,
350
+ l,
351
+ y,
352
+ u.map((o, v) => /* @__PURE__ */ t(de, { type: "monotone", dataKey: o.value || o.id, name: o.label || o.id, stroke: o.color || E[v % E.length], strokeWidth: 2, dot: { r: 3, fill: o.color || E[v % E.length] } }, o.id))
353
353
  ] });
354
- else if (r === "area")
355
- $ = /* @__PURE__ */ f(de, { ...y, children: [
354
+ else if (n === "area")
355
+ M = /* @__PURE__ */ f(ce, { ...c, children: [
356
356
  d,
357
- h,
358
- i,
359
- p,
360
- m,
361
- g.map((x, M) => /* @__PURE__ */ t(ce, { type: "monotone", dataKey: x.value || x.id, name: x.label || x.id, stroke: x.color || A[M % A.length], fill: (x.fill || A[M % A.length]) + "33", strokeWidth: 2 }, x.id))
357
+ k,
358
+ a,
359
+ l,
360
+ y,
361
+ u.map((o, v) => /* @__PURE__ */ t(pe, { type: "monotone", dataKey: o.value || o.id, name: o.label || o.id, stroke: o.color || E[v % E.length], fill: (o.fill || E[v % E.length]) + "33", strokeWidth: 2 }, o.id))
362
362
  ] });
363
- else if (r === "pie" || r === "donut") {
364
- const x = l[0] || {}, M = Object.keys(x).find((b) => typeof x[b] == "number") || "value", D = Object.keys(x).find((b) => typeof x[b] == "string") || "x";
365
- $ = /* @__PURE__ */ f(pe, { children: [
363
+ else if (n === "pie" || n === "donut") {
364
+ const o = s[0] || {}, v = Object.keys(o).find((b) => typeof o[b] == "number") || "value", L = Object.keys(o).find((b) => typeof o[b] == "string") || "x";
365
+ M = /* @__PURE__ */ f(he, { children: [
366
366
  /* @__PURE__ */ t(
367
367
  ue,
368
368
  {
369
- data: l,
369
+ data: s,
370
370
  cx: "50%",
371
371
  cy: "50%",
372
- outerRadius: r === "donut" ? "70%" : "80%",
373
- innerRadius: r === "donut" ? "40%" : 0,
374
- dataKey: M,
375
- nameKey: D,
376
- label: ({ name: b, percent: C }) => `${b ?? ""} ${((C ?? 0) * 100).toFixed(0)}%`,
372
+ outerRadius: n === "donut" ? "70%" : "80%",
373
+ innerRadius: n === "donut" ? "40%" : 0,
374
+ dataKey: v,
375
+ nameKey: L,
376
+ label: ({ name: b, percent: N }) => `${b ?? ""} ${((N ?? 0) * 100).toFixed(0)}%`,
377
377
  labelLine: !0,
378
378
  paddingAngle: 2,
379
- children: l.map((b, C) => /* @__PURE__ */ t(he, { fill: A[C % A.length] }, C))
379
+ children: s.map((b, N) => /* @__PURE__ */ t(xe, { fill: E[N % E.length] }, N))
380
380
  }
381
381
  ),
382
- p,
383
- m
382
+ l,
383
+ y
384
384
  ] });
385
- } else r === "radar" ? $ = /* @__PURE__ */ f(xe, { ...y, cx: "50%", cy: "50%", children: [
386
- /* @__PURE__ */ t(ge, {}),
387
- /* @__PURE__ */ t(fe, { dataKey: n, tick: { fontSize: 11 } }),
388
- g.map((x, M) => /* @__PURE__ */ t(ye, { dataKey: x.value || x.id, name: x.label || x.id, stroke: x.color || A[M], fill: (x.fill || A[M]) + "44" }, x.id)),
389
- p,
390
- m
391
- ] }) : r === "scatter" && ($ = /* @__PURE__ */ f(be, { ...y, children: [
385
+ } else n === "radar" ? M = /* @__PURE__ */ f(ge, { ...c, cx: "50%", cy: "50%", children: [
386
+ /* @__PURE__ */ t(fe, {}),
387
+ /* @__PURE__ */ t(ye, { dataKey: r, tick: { fontSize: 11 } }),
388
+ u.map((o, v) => /* @__PURE__ */ t(be, { dataKey: o.value || o.id, name: o.label || o.id, stroke: o.color || E[v], fill: (o.fill || E[v]) + "44" }, o.id)),
389
+ l,
390
+ y
391
+ ] }) : n === "scatter" && (M = /* @__PURE__ */ f(me, { ...c, children: [
392
392
  d,
393
- /* @__PURE__ */ t(_, { dataKey: ((k = g[0]) == null ? void 0 : k.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
394
- /* @__PURE__ */ t(X, { dataKey: ((u = g[0]) == null ? void 0 : u.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
395
- p,
396
- g.map((x, M) => /* @__PURE__ */ t(me, { data: x.data || l, name: x.label || x.id, fill: x.color || A[M] }, x.id))
393
+ /* @__PURE__ */ t(F, { dataKey: ((m = u[0]) == null ? void 0 : m.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
394
+ /* @__PURE__ */ t(X, { dataKey: ((p = u[0]) == null ? void 0 : p.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
395
+ l,
396
+ u.map((o, v) => /* @__PURE__ */ t(ve, { data: o.data || s, name: o.label || o.id, fill: o.color || E[v] }, o.id))
397
397
  ] }));
398
- return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...c }, children: /* @__PURE__ */ t(ve, { width: "100%", height: "100%", children: $ }) });
398
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: h, padding: 12, background: e.surface, borderRadius: e.rMd, ...x }, children: /* @__PURE__ */ t(ke, { width: "100%", height: "100%", children: M }) });
399
399
  }
400
- const Me = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], $e = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
401
- function Ye({ value: r, range: l = !1, timepicker: g = !1, onChange: o, style: s }) {
402
- const a = /* @__PURE__ */ new Date(), c = r ? new Date(Array.isArray(r) ? r[0] : r) : a, [n, p] = z(c), [m, d] = z(r ?? (l ? [null, null] : null)), [h, i] = z(null), [y, $] = z({ h: 0, m: 0 });
403
- T(W, []);
404
- const S = n.getFullYear(), v = n.getMonth(), N = new Date(S, v, 1).getDay(), k = new Date(S, v + 1, 0).getDate(), u = [];
405
- for (let b = 0; b < N; b++) u.push(null);
406
- for (let b = 1; b <= k; b++) u.push(new Date(S, v, b));
407
- const x = (b) => b.toDateString() === a.toDateString(), M = (b) => {
408
- if (!m) return !1;
409
- if (l && Array.isArray(m)) {
410
- const [C, w] = m;
411
- if (!C) return !1;
412
- const L = b.getTime();
413
- return w ? L >= C.getTime() && L <= w.getTime() : b.toDateString() === C.toDateString();
400
+ const $e = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ze = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
401
+ function Pe({ value: n, range: s = !1, timepicker: u = !1, onChange: i, style: g }) {
402
+ const h = /* @__PURE__ */ new Date(), x = n ? new Date(Array.isArray(n) ? n[0] : n) : h, [r, l] = z(x), [y, d] = z(n ?? (s ? [null, null] : null)), [k, a] = z(null), [c, M] = z({ h: 0, m: 0 });
403
+ D(W, []);
404
+ const $ = r.getFullYear(), S = r.getMonth(), C = new Date($, S, 1).getDay(), m = new Date($, S + 1, 0).getDate(), p = [];
405
+ for (let b = 0; b < C; b++) p.push(null);
406
+ for (let b = 1; b <= m; b++) p.push(new Date($, S, b));
407
+ const o = (b) => b.toDateString() === h.toDateString(), v = (b) => {
408
+ if (!y) return !1;
409
+ if (s && Array.isArray(y)) {
410
+ const [N, w] = y;
411
+ if (!N) return !1;
412
+ const T = b.getTime();
413
+ return w ? T >= N.getTime() && T <= w.getTime() : b.toDateString() === N.toDateString();
414
414
  }
415
- return b.toDateString() === m.toDateString();
416
- }, D = (b) => {
417
- if (l) {
418
- const [C, w] = Array.isArray(m) ? m : [null, null];
419
- if (!C || w)
415
+ return b.toDateString() === y.toDateString();
416
+ }, L = (b) => {
417
+ if (s) {
418
+ const [N, w] = Array.isArray(y) ? y : [null, null];
419
+ if (!N || w)
420
420
  d([b, null]);
421
421
  else {
422
- const L = b < C ? [b, C] : [C, b];
423
- d(L), o == null || o(L);
422
+ const T = b < N ? [b, N] : [N, b];
423
+ d(T), i == null || i(T);
424
424
  }
425
425
  } else
426
- d(b), o == null || o(b);
426
+ d(b), i == null || i(b);
427
427
  };
428
- return /* @__PURE__ */ f("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: [
428
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
429
429
  /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
430
- /* @__PURE__ */ t("button", { onClick: () => p((b) => new Date(b.getFullYear(), b.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
430
+ /* @__PURE__ */ t("button", { onClick: () => l((b) => new Date(b.getFullYear(), b.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
431
431
  /* @__PURE__ */ f("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
432
- Me[v],
432
+ $e[S],
433
433
  " ",
434
- S
434
+ $
435
435
  ] }),
436
- /* @__PURE__ */ t("button", { onClick: () => p((b) => new Date(b.getFullYear(), b.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
436
+ /* @__PURE__ */ t("button", { onClick: () => l((b) => new Date(b.getFullYear(), b.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
437
437
  ] }),
438
438
  /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
439
- $e.map((b) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: b }, b)),
440
- u.map((b, C) => {
441
- const w = b ? M(b) : !1, L = b && h && b.toDateString() === h.toDateString();
439
+ ze.map((b) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: b }, b)),
440
+ p.map((b, N) => {
441
+ const w = b ? v(b) : !1, T = b && k && b.toDateString() === k.toDateString();
442
442
  return /* @__PURE__ */ t(
443
443
  "div",
444
444
  {
445
- onClick: () => b && D(b),
446
- onMouseEnter: () => b && i(b),
447
- onMouseLeave: () => i(null),
448
- style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: b ? "pointer" : "default", fontSize: 12, fontWeight: b && x(b) ? 700 : 400, background: w ? e.primary : L ? e.bg : "transparent", color: w ? "#fff" : b && x(b) ? e.primary : b ? e.text : "transparent", border: b && x(b) && !w ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
445
+ onClick: () => b && L(b),
446
+ onMouseEnter: () => b && a(b),
447
+ onMouseLeave: () => a(null),
448
+ style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: b ? "pointer" : "default", fontSize: 12, fontWeight: b && o(b) ? 700 : 400, background: w ? e.primary : T ? e.bg : "transparent", color: w ? "#fff" : b && o(b) ? e.primary : b ? e.text : "transparent", border: b && o(b) && !w ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
449
449
  children: b == null ? void 0 : b.getDate()
450
450
  },
451
- C
451
+ N
452
452
  );
453
453
  })
454
454
  ] }),
455
- g && /* @__PURE__ */ f("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
456
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: y.h, onChange: (b) => $((C) => ({ ...C, h: +b.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
455
+ u && /* @__PURE__ */ f("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
456
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: c.h, onChange: (b) => M((N) => ({ ...N, h: +b.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
457
457
  /* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
458
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: y.m, onChange: (b) => $((C) => ({ ...C, m: +b.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
458
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: c.m, onChange: (b) => M((N) => ({ ...N, m: +b.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
459
459
  ] })
460
460
  ] });
461
461
  }
462
- function Oe({ value: r, onChange: l, style: g }) {
463
- const [o, s] = z((r == null ? void 0 : r.h) ?? 12), [a, c] = z((r == null ? void 0 : r.m) ?? 0), [n, p] = z((r == null ? void 0 : r.ampm) ?? "AM");
464
- T(W, []);
465
- const m = Array.from({ length: 12 }, (h, i) => i + 1), d = Array.from({ length: 12 }, (h, i) => i * 5);
466
- return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
462
+ function Oe({ value: n, onChange: s, timeFormat: u = 12, controls: i = !1, minuteStep: g = 5, style: h }) {
463
+ const [x, r] = z((n == null ? void 0 : n.h) ?? (u === 24 ? 0 : 12)), [l, y] = z((n == null ? void 0 : n.m) ?? 0), [d, k] = z((n == null ? void 0 : n.ampm) ?? "AM"), [a, c] = z(null);
464
+ D(W, []);
465
+ const M = u === 24 ? Array.from({ length: 24 }, (o, v) => v) : Array.from({ length: 12 }, (o, v) => v + 1), $ = Array.from({ length: Math.ceil(60 / g) }, (o, v) => v * g), S = (o, v, L) => {
466
+ const b = u === 24 ? { h: o, m: v } : { h: o, m: v, ampm: L };
467
+ i ? c(b) : s == null || s(b);
468
+ }, C = () => {
469
+ c(null), r((n == null ? void 0 : n.h) ?? (u === 24 ? 0 : 12)), y((n == null ? void 0 : n.m) ?? 0), k((n == null ? void 0 : n.ampm) ?? "AM");
470
+ }, m = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, p = (o) => ({
471
+ height: 32,
472
+ display: "flex",
473
+ alignItems: "center",
474
+ justifyContent: "center",
475
+ cursor: "pointer",
476
+ fontSize: 13,
477
+ fontWeight: o ? 700 : 400,
478
+ background: o ? e.primaryLt : "transparent",
479
+ color: o ? e.primary : e.text
480
+ });
481
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...h }, children: [
467
482
  /* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
468
- [{ label: "Hours", values: m, val: o, setFn: s }, { label: "Minutes", values: d, val: a, setFn: c }].map(({ label: h, values: i, val: y, setFn: $ }) => /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, children: [
469
- /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: h }),
470
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: i.map((S) => /* @__PURE__ */ t(
483
+ /* @__PURE__ */ f("div", { style: m, children: [
484
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
485
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: M.map((o) => /* @__PURE__ */ t(
486
+ "div",
487
+ {
488
+ onClick: () => {
489
+ r(o), S(o, l, d);
490
+ },
491
+ style: p(x === o),
492
+ onMouseEnter: (v) => x !== o && (v.currentTarget.style.background = e.bg),
493
+ onMouseLeave: (v) => x !== o && (v.currentTarget.style.background = "transparent"),
494
+ children: String(o).padStart(2, "0")
495
+ },
496
+ o
497
+ )) })
498
+ ] }),
499
+ /* @__PURE__ */ f("div", { style: m, children: [
500
+ /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
501
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: $.map((o) => /* @__PURE__ */ t(
471
502
  "div",
472
503
  {
473
504
  onClick: () => {
474
- $(S), l == null || l({ h: h === "Hours" ? S : o, m: h === "Minutes" ? S : a, ampm: n });
505
+ y(o), S(x, o, d);
475
506
  },
476
- style: { height: 32, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", fontSize: 13, fontWeight: y === S ? 700 : 400, background: y === S ? e.primaryLt : "transparent", color: y === S ? e.primary : e.text },
477
- onMouseEnter: (v) => y !== S && (v.currentTarget.style.background = e.bg),
478
- onMouseLeave: (v) => y !== S && (v.currentTarget.style.background = "transparent"),
479
- children: String(S).padStart(2, "0")
507
+ style: p(l === o),
508
+ onMouseEnter: (v) => l !== o && (v.currentTarget.style.background = e.bg),
509
+ onMouseLeave: (v) => l !== o && (v.currentTarget.style.background = "transparent"),
510
+ children: String(o).padStart(2, "0")
480
511
  },
481
- S
512
+ o
482
513
  )) })
483
- ] }, h)),
484
- /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
514
+ ] }),
515
+ u === 12 && /* @__PURE__ */ f("div", { style: m, children: [
485
516
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
486
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((h) => /* @__PURE__ */ t(
517
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((o) => /* @__PURE__ */ t(
487
518
  "div",
488
519
  {
489
520
  onClick: () => {
490
- p(h), l == null || l({ h: o, m: a, ampm: h });
521
+ k(o), S(x, l, o);
491
522
  },
492
- style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: n === h ? 700 : 400, background: n === h ? e.primary : e.surface, color: n === h ? "#fff" : e.text },
493
- children: h
523
+ style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: d === o ? 700 : 400, background: d === o ? e.primary : e.surface, color: d === o ? "#fff" : e.text },
524
+ children: o
494
525
  },
495
- h
526
+ o
496
527
  )) })
497
528
  ] })
498
529
  ] }),
499
530
  /* @__PURE__ */ f("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
500
- String(o).padStart(2, "0"),
531
+ String(x).padStart(2, "0"),
501
532
  ":",
502
- String(a).padStart(2, "0"),
503
- " ",
504
- n
533
+ String(l).padStart(2, "0"),
534
+ u === 12 ? ` ${d}` : ""
535
+ ] }),
536
+ i && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
537
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: C, children: "Cancel" }),
538
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => a && (s == null ? void 0 : s(a)), children: "Apply" })
505
539
  ] })
506
540
  ] });
507
541
  }
508
- function Y(r, l) {
509
- T(() => {
510
- const g = (o) => {
511
- r.current && !r.current.contains(o.target) && l(o);
542
+ function Y(n, s) {
543
+ D(() => {
544
+ const u = (i) => {
545
+ n.current && !n.current.contains(i.target) && s(i);
512
546
  };
513
- return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
514
- }, [r, l]);
547
+ return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
548
+ }, [n, s]);
515
549
  }
516
- function ze(r) {
517
- const l = B(!1), g = B({ x: 0, y: 0, ox: 0, oy: 0 });
518
- return H(
519
- (o, s = 0, a = 0) => {
520
- l.current = !0, g.current = { x: o.clientX, y: o.clientY, ox: s, oy: a };
521
- const c = (p) => {
522
- if (!l.current) return;
523
- const { x: m, y: d, ox: h, oy: i } = g.current;
524
- r(h + p.clientX - m, i + p.clientY - d);
525
- }, n = () => {
526
- l.current = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", n);
550
+ function Ce(n) {
551
+ const s = H(!1), u = H({ x: 0, y: 0, ox: 0, oy: 0 });
552
+ return B(
553
+ (i, g = 0, h = 0) => {
554
+ s.current = !0, u.current = { x: i.clientX, y: i.clientY, ox: g, oy: h };
555
+ const x = (l) => {
556
+ if (!s.current) return;
557
+ const { x: y, y: d, ox: k, oy: a } = u.current;
558
+ n(k + l.clientX - y, a + l.clientY - d);
559
+ }, r = () => {
560
+ s.current = !1, document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", r);
527
561
  };
528
- document.addEventListener("mousemove", c), document.addEventListener("mouseup", n), o.preventDefault();
562
+ document.addEventListener("mousemove", x), document.addEventListener("mouseup", r), i.preventDefault();
529
563
  },
530
- [r]
564
+ [n]
531
565
  );
532
566
  }
533
- function Ne({ data: r = [], value: l, placeholder: g = "Select or type...", multiselection: o = !1, label: s, onChange: a, style: c }) {
534
- var k;
535
- const [n, p] = z(!1), [m, d] = z(""), [h, i] = z(o ? l ? [].concat(l) : [] : l || null), y = B(null);
536
- T(W, []), Y(y, H(() => p(!1), []));
537
- const $ = F(() => r.filter((u) => !m || u.value.toLowerCase().includes(m.toLowerCase())), [r, m]), S = (u) => o ? (h || []).includes(u) : h === u, v = (u) => {
538
- const x = u.id || u.value;
539
- if (o) {
540
- const M = S(x) ? h.filter((D) => D !== x) : [...h || [], x];
541
- i(M), a == null || a(M);
567
+ function Ne({ data: n = [], value: s, placeholder: u = "Select or type...", multiselection: i = !1, label: g, onChange: h, style: x }) {
568
+ var m;
569
+ const [r, l] = z(!1), [y, d] = z(""), [k, a] = z(i ? s ? [].concat(s) : [] : s || null), c = H(null);
570
+ D(W, []), Y(c, B(() => l(!1), []));
571
+ const M = K(() => n.filter((p) => !y || p.value.toLowerCase().includes(y.toLowerCase())), [n, y]), $ = (p) => i ? (k || []).includes(p) : k === p, S = (p) => {
572
+ const o = p.id || p.value;
573
+ if (i) {
574
+ const v = $(o) ? k.filter((L) => L !== o) : [...k || [], o];
575
+ a(v), h == null || h(v);
542
576
  } else
543
- i(x), d(""), p(!1), a == null || a(x);
544
- }, N = o ? h != null && h.length ? `${h.length} selected` : "" : ((k = r.find((u) => (u.id || u.value) === h)) == null ? void 0 : k.value) || "";
545
- return /* @__PURE__ */ f("div", { ref: y, className: "dhx", style: { position: "relative", ...c }, children: [
546
- s && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: s }),
547
- /* @__PURE__ */ f("div", { onClick: () => p((u) => !u), style: { display: "flex", alignItems: "center", border: `1px solid ${n ? e.primary : e.border}`, borderRadius: e.r, height: 32, padding: "0 10px", cursor: "pointer", background: e.surface, gap: 6, transition: "border-color .15s", boxShadow: n ? `0 0 0 3px ${e.primary}22` : "none" }, children: [
548
- o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 3, flex: 1, flexWrap: "wrap", overflow: "hidden" }, children: [
549
- h.slice(0, 3).map((u) => {
550
- var x;
577
+ a(o), d(""), l(!1), h == null || h(o);
578
+ }, C = i ? k != null && k.length ? `${k.length} selected` : "" : ((m = n.find((p) => (p.id || p.value) === k)) == null ? void 0 : m.value) || "";
579
+ return /* @__PURE__ */ f("div", { ref: c, className: "dhx", style: { position: "relative", ...x }, children: [
580
+ g && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: g }),
581
+ /* @__PURE__ */ f("div", { onClick: () => l((p) => !p), style: { display: "flex", alignItems: "center", border: `1px solid ${r ? e.primary : e.border}`, borderRadius: e.r, height: 32, padding: "0 10px", cursor: "pointer", background: e.surface, gap: 6, transition: "border-color .15s", boxShadow: r ? `0 0 0 3px ${e.primary}22` : "none" }, children: [
582
+ i && (k == null ? void 0 : k.length) > 0 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 3, flex: 1, flexWrap: "wrap", overflow: "hidden" }, children: [
583
+ k.slice(0, 3).map((p) => {
584
+ var o;
551
585
  return /* @__PURE__ */ f("span", { className: "dhx dhx-tag dhx-tag-primary", style: { fontSize: 10, padding: "0 5px" }, children: [
552
- ((x = r.find((M) => (M.id || M.value) === u)) == null ? void 0 : x.value) || u,
553
- /* @__PURE__ */ t("span", { onClick: (M) => {
554
- M.stopPropagation(), v({ value: u });
586
+ ((o = n.find((v) => (v.id || v.value) === p)) == null ? void 0 : o.value) || p,
587
+ /* @__PURE__ */ t("span", { onClick: (v) => {
588
+ v.stopPropagation(), S({ value: p });
555
589
  }, style: { cursor: "pointer", marginLeft: 3 }, children: "×" })
556
- ] }, u);
590
+ ] }, p);
557
591
  }),
558
- h.length > 3 && /* @__PURE__ */ f("span", { className: "dhx dhx-tag dhx-tag-primary", style: { fontSize: 10, padding: "0 5px" }, children: [
592
+ k.length > 3 && /* @__PURE__ */ f("span", { className: "dhx dhx-tag dhx-tag-primary", style: { fontSize: 10, padding: "0 5px" }, children: [
559
593
  "+",
560
- h.length - 3
594
+ k.length - 3
561
595
  ] })
562
596
  ] }),
563
- !o && /* @__PURE__ */ t("input", { value: n ? m : N, onChange: (u) => {
564
- d(u.target.value), p(!0);
565
- }, onFocus: () => p(!0), onClick: (u) => u.stopPropagation(), placeholder: g, style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text } }),
566
- o && !(h != null && h.length) && /* @__PURE__ */ t("span", { style: { flex: 1, color: e.textMut, fontSize: 13 }, children: g }),
567
- /* @__PURE__ */ t("span", { style: { color: e.textMut, fontSize: 12, marginLeft: "auto" }, children: n ? "▲" : "▼" })
597
+ !i && /* @__PURE__ */ t("input", { value: r ? y : C, onChange: (p) => {
598
+ d(p.target.value), l(!0);
599
+ }, onFocus: () => l(!0), onClick: (p) => p.stopPropagation(), placeholder: u, style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text } }),
600
+ i && !(k != null && k.length) && /* @__PURE__ */ t("span", { style: { flex: 1, color: e.textMut, fontSize: 13 }, children: u }),
601
+ /* @__PURE__ */ t("span", { style: { color: e.textMut, fontSize: 12, marginLeft: "auto" }, children: r ? "▲" : "▼" })
568
602
  ] }),
569
- n && /* @__PURE__ */ f("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, right: 0, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 100, maxHeight: 220 }, children: [
570
- o && /* @__PURE__ */ t("div", { style: { padding: "6px 10px", borderBottom: `1px solid ${e.border}` }, children: /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 26, fontSize: 12 }, placeholder: "Search...", value: m, onChange: (u) => d(u.target.value) }) }),
603
+ r && /* @__PURE__ */ f("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, right: 0, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 100, maxHeight: 220 }, children: [
604
+ i && /* @__PURE__ */ t("div", { style: { padding: "6px 10px", borderBottom: `1px solid ${e.border}` }, children: /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 26, fontSize: 12 }, placeholder: "Search...", value: y, onChange: (p) => d(p.target.value) }) }),
571
605
  /* @__PURE__ */ f("div", { className: "dhx-scroll", style: { maxHeight: 180, overflowY: "auto" }, children: [
572
- $.map((u) => /* @__PURE__ */ f(
606
+ M.map((p) => /* @__PURE__ */ f(
573
607
  "div",
574
608
  {
575
- onClick: () => v(u),
576
- style: { padding: "8px 12px", cursor: "pointer", display: "flex", alignItems: "center", gap: 8, fontSize: 13, background: S(u.id || u.value) ? e.primaryLt : "transparent", color: S(u.id || u.value) ? e.primary : e.text },
577
- onMouseEnter: (x) => !S(u.id || u.value) && (x.currentTarget.style.background = e.bg),
578
- onMouseLeave: (x) => !S(u.id || u.value) && (x.currentTarget.style.background = "transparent"),
609
+ onClick: () => S(p),
610
+ style: { padding: "8px 12px", cursor: "pointer", display: "flex", alignItems: "center", gap: 8, fontSize: 13, background: $(p.id || p.value) ? e.primaryLt : "transparent", color: $(p.id || p.value) ? e.primary : e.text },
611
+ onMouseEnter: (o) => !$(p.id || p.value) && (o.currentTarget.style.background = e.bg),
612
+ onMouseLeave: (o) => !$(p.id || p.value) && (o.currentTarget.style.background = "transparent"),
579
613
  children: [
580
- o && /* @__PURE__ */ t("span", { style: { width: 14, height: 14, border: `2px solid ${S(u.id || u.value) ? e.primary : e.borderDk}`, borderRadius: 2, display: "flex", alignItems: "center", justifyContent: "center", background: S(u.id || u.value) ? e.primary : "transparent" }, children: S(u.id || u.value) && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9 }, children: "✓" }) }),
581
- u.value,
582
- u.count !== void 0 && /* @__PURE__ */ f("span", { style: { marginLeft: "auto", fontSize: 11, color: e.textMut }, children: [
614
+ i && /* @__PURE__ */ t("span", { style: { width: 14, height: 14, border: `2px solid ${$(p.id || p.value) ? e.primary : e.borderDk}`, borderRadius: 2, display: "flex", alignItems: "center", justifyContent: "center", background: $(p.id || p.value) ? e.primary : "transparent" }, children: $(p.id || p.value) && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9 }, children: "✓" }) }),
615
+ p.value,
616
+ p.count !== void 0 && /* @__PURE__ */ f("span", { style: { marginLeft: "auto", fontSize: 11, color: e.textMut }, children: [
583
617
  "(",
584
- u.count,
618
+ p.count,
585
619
  ")"
586
620
  ] })
587
621
  ]
588
622
  },
589
- u.id || u.value
623
+ p.id || p.value
590
624
  )),
591
- $.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
625
+ M.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
592
626
  ] })
593
627
  ] })
594
628
  ] });
595
629
  }
596
- function Ce({ min: r = 0, max: l = 100, step: g = 1, value: o, range: s = !1, label: a, tick: c, onChange: n, style: p }) {
597
- const [m, d] = z(o ?? (s ? [r, l] : r));
598
- T(W, []);
599
- const h = (S, v) => {
600
- if (s) {
601
- const N = [...m];
602
- N[S] = v, d(N), n == null || n(N);
603
- } else
604
- d(v), n == null || n(v);
605
- }, i = (S) => (S - r) / (l - r) * 100, y = s ? m : [m], $ = s ? { left: `${i(y[0])}%`, width: `${i(y[1]) - i(y[0])}%` } : { left: 0, width: `${i(y[0])}%` };
606
- return /* @__PURE__ */ f("div", { className: "dhx", style: { width: "100%", ...p }, children: [
607
- a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
630
+ function Le({ min: n = 0, max: s = 100, step: u = 1, value: i, range: g = !1, label: h, tick: x, disabled: r = !1, onChange: l, style: y }) {
631
+ const [d, k] = z(i ?? (g ? [n, s] : n));
632
+ D(W, []);
633
+ const a = (C, m) => {
634
+ if (!r)
635
+ if (g) {
636
+ const p = [...d];
637
+ p[C] = m, k(p), l == null || l(p);
638
+ } else
639
+ k(m), l == null || l(m);
640
+ }, c = (C) => (C - n) / (s - n) * 100, M = g ? d : [d], $ = g ? { left: `${c(M[0])}%`, width: `${c(M[1]) - c(M[0])}%` } : { left: 0, width: `${c(M[0])}%` }, S = r ? e.border : e.primary;
641
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { width: "100%", opacity: r ? 0.5 : 1, ...y }, children: [
642
+ h && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: h }),
608
643
  /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ f("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
609
- /* @__PURE__ */ t("div", { style: { position: "absolute", ...$, height: "100%", background: e.primary, borderRadius: 2 } }),
610
- y.map((S, v) => /* @__PURE__ */ t(
644
+ /* @__PURE__ */ t("div", { style: { position: "absolute", ...$, height: "100%", background: S, borderRadius: 2 } }),
645
+ M.map((C, m) => /* @__PURE__ */ t(
611
646
  "input",
612
647
  {
613
648
  type: "range",
614
- min: r,
615
- max: l,
616
- step: g,
617
- value: S,
618
- onChange: (N) => {
619
- const k = +N.target.value;
620
- s && v === 0 && k >= m[1] || s && v === 1 && k <= m[0] || h(v, k);
649
+ min: n,
650
+ max: s,
651
+ step: u,
652
+ value: C,
653
+ disabled: r,
654
+ onChange: (p) => {
655
+ const o = +p.target.value;
656
+ g && m === 0 && o >= d[1] || g && m === 1 && o <= d[0] || a(m, o);
621
657
  },
622
- style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: "pointer", top: 0, left: 0, margin: 0 }
658
+ style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: r ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
623
659
  },
624
- v
660
+ m
625
661
  )),
626
- y.map((S, v) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${i(S)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${e.primary}`, 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: e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: S }) }, v))
662
+ M.map((C, m) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${c(C)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${S}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: r ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: C }) }, m))
627
663
  ] }) }),
628
- c && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [r, Math.round((l + r) / 2), l].map((S) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: S }, S)) })
664
+ x && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((s + n) / 2), s].map((C) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: C }, C)) })
629
665
  ] });
630
666
  }
631
- const Le = ["#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"];
632
- function P(r) {
633
- const l = parseInt(r.slice(1, 3), 16) / 255, g = parseInt(r.slice(3, 5), 16) / 255, o = parseInt(r.slice(5, 7), 16) / 255, s = Math.max(l, g, o), a = Math.min(l, g, o);
634
- let c = 0, n = 0;
635
- const p = (s + a) / 2;
636
- if (s !== a) {
637
- const m = s - a;
638
- n = p > 0.5 ? m / (2 - s - a) : m / (s + a), c = s === l ? ((g - o) / m + (g < o ? 6 : 0)) / 6 : s === g ? ((o - l) / m + 2) / 6 : ((l - g) / m + 4) / 6;
667
+ const Te = ["#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"];
668
+ function O(n) {
669
+ const s = parseInt(n.slice(1, 3), 16) / 255, u = parseInt(n.slice(3, 5), 16) / 255, i = parseInt(n.slice(5, 7), 16) / 255, g = Math.max(s, u, i), h = Math.min(s, u, i);
670
+ let x = 0, r = 0;
671
+ const l = (g + h) / 2;
672
+ if (g !== h) {
673
+ const y = g - h;
674
+ r = l > 0.5 ? y / (2 - g - h) : y / (g + h), x = g === s ? ((u - i) / y + (u < i ? 6 : 0)) / 6 : g === u ? ((i - s) / y + 2) / 6 : ((s - u) / y + 4) / 6;
639
675
  }
640
- return [Math.round(c * 360), Math.round(n * 100), Math.round(p * 100)];
676
+ return [Math.round(x * 360), Math.round(r * 100), Math.round(l * 100)];
641
677
  }
642
- function q(r, l, g) {
643
- l /= 100, g /= 100;
644
- const o = l * Math.min(g, 1 - g), s = (a) => {
645
- const c = (a + r / 30) % 12, n = g - o * Math.max(Math.min(c - 3, 9 - c, 1), -1);
646
- return Math.round(255 * n).toString(16).padStart(2, "0");
678
+ function q(n, s, u) {
679
+ s /= 100, u /= 100;
680
+ const i = s * Math.min(u, 1 - u), g = (h) => {
681
+ const x = (h + n / 30) % 12, r = u - i * Math.max(Math.min(x - 3, 9 - x, 1), -1);
682
+ return Math.round(255 * r).toString(16).padStart(2, "0");
647
683
  };
648
- return "#" + s(0) + s(8) + s(4);
684
+ return "#" + g(0) + g(8) + g(4);
649
685
  }
650
- function Pe({ value: r = "#0288d1", onChange: l, style: g }) {
651
- const [o, s] = z(() => P(r)), a = q(...o);
652
- T(W, []);
653
- const c = (n) => {
654
- s(n), l == null || l(q(...n));
686
+ function Ke({ value: n = "#0288d1", onChange: s, style: u }) {
687
+ const [i, g] = z(() => O(n)), h = q(...i);
688
+ D(W, []);
689
+ const x = (r) => {
690
+ g(r), s == null || s(q(...r));
655
691
  };
656
- return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...g }, children: [
657
- /* @__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(${o[0]},100%,50%))`, cursor: "crosshair" } }),
658
- [["Hue", 0, 360, o[0]], ["Saturation", 0, 100, o[1]], ["Lightness", 0, 100, o[2]]].map(([n, p, m, d], h) => /* @__PURE__ */ f("div", { style: { marginBottom: h < 2 ? 8 : 12 }, children: [
692
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...u }, children: [
693
+ /* @__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" } }),
694
+ [["Hue", 0, 360, i[0]], ["Saturation", 0, 100, i[1]], ["Lightness", 0, 100, i[2]]].map(([r, l, y, d], k) => /* @__PURE__ */ f("div", { style: { marginBottom: k < 2 ? 8 : 12 }, children: [
659
695
  /* @__PURE__ */ f("div", { className: "dhx dhx-label", children: [
660
- n,
661
- h > 0 ? ` (${d}%)` : ""
696
+ r,
697
+ k > 0 ? ` (${d}%)` : ""
662
698
  ] }),
663
- /* @__PURE__ */ t("input", { type: "range", min: p, max: m, value: d, onChange: (i) => {
664
- const y = [...o];
665
- y[h] = +i.target.value, c(y);
699
+ /* @__PURE__ */ t("input", { type: "range", min: l, max: y, value: d, onChange: (a) => {
700
+ const c = [...i];
701
+ c[k] = +a.target.value, x(c);
666
702
  }, style: { width: "100%", accentColor: e.primary } })
667
- ] }, n)),
703
+ ] }, r)),
668
704
  /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
669
- /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
705
+ /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: h, border: `1px solid ${e.border}`, flexShrink: 0 } }),
670
706
  /* @__PURE__ */ t(
671
707
  "input",
672
708
  {
673
709
  className: "dhx dhx-input",
674
710
  style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
675
- value: a,
676
- onChange: (n) => {
711
+ value: h,
712
+ onChange: (r) => {
677
713
  try {
678
- c(P(n.target.value)), l == null || l(n.target.value);
714
+ x(O(r.target.value)), s == null || s(r.target.value);
679
715
  } catch {
680
716
  }
681
717
  }
682
718
  }
683
719
  )
684
720
  ] }),
685
- /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: Le.map((n) => /* @__PURE__ */ t(
721
+ /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: Te.map((r) => /* @__PURE__ */ t(
686
722
  "div",
687
723
  {
688
724
  onClick: () => {
689
- s(P(n)), l == null || l(n);
725
+ g(O(r)), s == null || s(r);
690
726
  },
691
- style: { width: 14, height: 14, borderRadius: 2, background: n, cursor: "pointer", border: a === n ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
692
- onMouseEnter: (p) => p.currentTarget.style.transform = "scale(1.3)",
693
- onMouseLeave: (p) => p.currentTarget.style.transform = "scale(1)"
727
+ style: { width: 14, height: 14, borderRadius: 2, background: r, cursor: "pointer", border: h === r ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
728
+ onMouseEnter: (l) => l.currentTarget.style.transform = "scale(1.3)",
729
+ onMouseLeave: (l) => l.currentTarget.style.transform = "scale(1)"
694
730
  },
695
- n
731
+ r
696
732
  )) })
697
733
  ] });
698
734
  }
699
- function O({ items: r, onSelect: l, style: g }) {
700
- const [o, s] = z(null);
701
- 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", ...g }, children: r.map((a, c) => {
702
- var p, m;
703
- if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, c);
704
- const n = o === c;
705
- return /* @__PURE__ */ f("div", { style: { position: "relative" }, onMouseEnter: () => s(c), onMouseLeave: () => s(null), children: [
735
+ function P({ items: n, onSelect: s, style: u }) {
736
+ const [i, g] = z(null);
737
+ 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", ...u }, children: n.map((h, x) => {
738
+ var l, y;
739
+ if (h.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, x);
740
+ const r = i === x;
741
+ return /* @__PURE__ */ f("div", { style: { position: "relative" }, onMouseEnter: () => g(x), onMouseLeave: () => g(null), children: [
706
742
  /* @__PURE__ */ f(
707
743
  "div",
708
744
  {
709
745
  onClick: () => {
710
746
  var d;
711
- return !a.disabled && !((d = a.items) != null && d.length) && l(a);
747
+ return !h.disabled && !((d = h.items) != null && d.length) && s(h);
712
748
  },
713
- style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: n && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
749
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: h.disabled ? "not-allowed" : "pointer", fontSize: 13, color: h.disabled ? e.textMut : e.text, background: r && !h.disabled ? e.bg : "transparent", opacity: h.disabled ? 0.5 : 1 },
714
750
  children: [
715
- a.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: a.icon }),
716
- /* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value || a.id }),
717
- a.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: a.hotkey }),
718
- (p = a.items) != null && p.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
751
+ h.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: h.icon }),
752
+ /* @__PURE__ */ t("span", { style: { flex: 1 }, children: h.value || h.id }),
753
+ h.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: h.hotkey }),
754
+ (l = h.items) != null && l.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
719
755
  ]
720
756
  }
721
757
  ),
722
- n && ((m = a.items) != null && m.length) ? /* @__PURE__ */ t(O, { items: a.items, onSelect: l, style: { position: "absolute", left: "100%", top: -4 } }) : null
723
- ] }, a.id || c);
758
+ r && ((y = h.items) != null && y.length) ? /* @__PURE__ */ t(P, { items: h.items, onSelect: s, style: { position: "absolute", left: "100%", top: -4 } }) : null
759
+ ] }, h.id || x);
724
760
  }) });
725
761
  }
726
- function Fe({ items: r = [], label: l = "Menu", onSelect: g, style: o }) {
727
- const [s, a] = z(!1), c = B(null);
728
- return T(W, []), Y(c, H(() => a(!1), [])), /* @__PURE__ */ f("div", { ref: c, className: "dhx", style: { position: "relative", display: "inline-block", ...o }, children: [
729
- /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((n) => !n), children: [
730
- l,
762
+ function _e({ items: n = [], label: s = "Menu", onSelect: u, style: i }) {
763
+ const [g, h] = z(!1), x = H(null);
764
+ return D(W, []), Y(x, B(() => h(!1), [])), /* @__PURE__ */ f("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block", ...i }, children: [
765
+ /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => h((r) => !r), children: [
766
+ s,
731
767
  " ",
732
- /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: s ? "▲" : "▼" })
768
+ /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: g ? "▲" : "▼" })
733
769
  ] }),
734
- s && /* @__PURE__ */ t(O, { items: r, onSelect: (n) => {
735
- g == null || g(n), a(!1);
770
+ g && /* @__PURE__ */ t(P, { items: n, onSelect: (r) => {
771
+ u == null || u(r), h(!1);
736
772
  } })
737
773
  ] });
738
774
  }
739
- function Ke({ items: r = [], onSelect: l, children: g }) {
740
- const [o, s] = z(null), a = B(null);
741
- return T(W, []), Y(a, H(() => s(null), [])), /* @__PURE__ */ f("div", { ref: a, onContextMenu: (n) => {
742
- n.preventDefault(), s({ x: n.clientX, y: n.clientY });
775
+ function Fe({ items: n = [], onSelect: s, children: u }) {
776
+ const [i, g] = z(null), h = H(null);
777
+ return D(W, []), Y(h, B(() => g(null), [])), /* @__PURE__ */ f("div", { ref: h, onContextMenu: (r) => {
778
+ r.preventDefault(), g({ x: r.clientX, y: r.clientY });
743
779
  }, style: { position: "relative", display: "contents" }, children: [
744
- g,
745
- o && /* @__PURE__ */ t("div", { style: { position: "fixed", left: o.x, top: o.y, zIndex: 9999 }, children: /* @__PURE__ */ t(O, { items: r, onSelect: (n) => {
746
- l == null || l(n), s(null);
780
+ u,
781
+ i && /* @__PURE__ */ t("div", { style: { position: "fixed", left: i.x, top: i.y, zIndex: 9999 }, children: /* @__PURE__ */ t(P, { items: n, onSelect: (r) => {
782
+ s == null || s(r), g(null);
747
783
  } }) })
748
784
  ] });
749
785
  }
750
- function _e({ trigger: r, children: l, placement: g = "bottom-start", style: o }) {
751
- const [s, a] = z(!1), [c, n] = z({ top: "100%", left: 0 }), p = B(null), m = B(null);
752
- return T(W, []), Y(p, H(() => a(!1), [])), /* @__PURE__ */ f("div", { ref: p, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
753
- /* @__PURE__ */ t("div", { ref: m, onClick: () => {
754
- a((h) => {
755
- if (!h && m.current) {
756
- const i = m.current.getBoundingClientRect(), y = {
757
- "bottom-start": { top: i.height + 4, left: 0 },
758
- "bottom-end": { top: i.height + 4, right: 0, left: "auto" },
759
- "top-start": { bottom: i.height + 4, top: "auto", left: 0 }
786
+ function Xe({ trigger: n, children: s, placement: u = "bottom-start", style: i }) {
787
+ const [g, h] = z(!1), [x, r] = z({ top: "100%", left: 0 }), l = H(null), y = H(null);
788
+ return D(W, []), Y(l, B(() => h(!1), [])), /* @__PURE__ */ f("div", { ref: l, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
789
+ /* @__PURE__ */ t("div", { ref: y, onClick: () => {
790
+ h((k) => {
791
+ if (!k && y.current) {
792
+ const a = y.current.getBoundingClientRect(), c = {
793
+ "bottom-start": { top: a.height + 4, left: 0 },
794
+ "bottom-end": { top: a.height + 4, right: 0, left: "auto" },
795
+ "top-start": { bottom: a.height + 4, top: "auto", left: 0 }
760
796
  };
761
- n(y[g] || y["bottom-start"]);
797
+ r(c[u] || c["bottom-start"]);
762
798
  }
763
- return !h;
799
+ return !k;
764
800
  });
765
- }, children: r }),
766
- s && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...c, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...o }, children: l })
801
+ }, children: n }),
802
+ g && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...x, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...i }, children: s })
767
803
  ] });
768
804
  }
769
- function Xe({ title: r, children: l, width: g = 480, height: o, closable: s = !0, movable: a = !0, modal: c = !1, defaultOpen: n = !0, footer: p, onClose: m, style: d }) {
770
- const [h, i] = z(n), [y, $] = z({ x: 0, y: 0 });
771
- T(W, []);
772
- const S = ze(H((N, k) => a && $({ x: N, y: k }), [a])), v = () => {
773
- i(!1), m == null || m();
805
+ function Ve({ title: n, children: s, width: u = 480, height: i, closable: g = !0, movable: h = !0, modal: x = !1, defaultOpen: r = !0, footer: l, onClose: y, style: d }) {
806
+ const [k, a] = z(r), [c, M] = z({ x: 0, y: 0 });
807
+ D(W, []);
808
+ const $ = Ce(B((C, m) => h && M({ x: C, y: m }), [h])), S = () => {
809
+ a(!1), y == null || y();
774
810
  };
775
- return h ? /* @__PURE__ */ f(Z, { children: [
776
- c && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: s ? v : void 0 }),
777
- /* @__PURE__ */ f("div", { className: "dhx", style: { position: c ? "fixed" : "absolute", left: c ? "50%" : `calc(50% + ${y.x}px)`, top: c ? "50%" : `calc(50% + ${y.y}px)`, transform: `translate(calc(-50% + ${y.x}px), calc(-50% + ${y.y}px))`, width: g, ...o ? { height: o } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...d }, children: [
778
- /* @__PURE__ */ f("div", { onMouseDown: (N) => S(N, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
779
- /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: r }),
780
- s && /* @__PURE__ */ t(
811
+ return k ? /* @__PURE__ */ f(ee, { children: [
812
+ x && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: g ? S : void 0 }),
813
+ /* @__PURE__ */ f("div", { className: "dhx", style: { position: x ? "fixed" : "absolute", left: x ? "50%" : `calc(50% + ${c.x}px)`, top: x ? "50%" : `calc(50% + ${c.y}px)`, transform: `translate(calc(-50% + ${c.x}px), calc(-50% + ${c.y}px))`, width: u, ...i ? { height: i } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...d }, children: [
814
+ /* @__PURE__ */ f("div", { onMouseDown: (C) => $(C, c.x, c.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: h ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
815
+ /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
816
+ g && /* @__PURE__ */ t(
781
817
  "button",
782
818
  {
783
- onClick: v,
819
+ onClick: S,
784
820
  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 },
785
- onMouseEnter: (N) => N.currentTarget.style.background = e.border,
786
- onMouseLeave: (N) => N.currentTarget.style.background = "none",
821
+ onMouseEnter: (C) => C.currentTarget.style.background = e.border,
822
+ onMouseLeave: (C) => C.currentTarget.style.background = "none",
787
823
  children: "×"
788
824
  }
789
825
  )
790
826
  ] }),
791
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: l }),
792
- p && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: p })
827
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: s }),
828
+ l && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: l })
793
829
  ] })
794
830
  ] }) : null;
795
831
  }
796
- const J = ee(null), De = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, G = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
797
- function Ve({ children: r }) {
798
- const [l, g] = z([]);
799
- T(W, []);
800
- const o = H((c) => g((n) => n.filter((p) => p.id !== c)), []), s = H((c) => {
801
- const n = Date.now();
802
- return g((p) => [...p, { id: n, ...c }]), c.duration !== 0 && setTimeout(() => o(n), c.duration || 4e3), n;
803
- }, [o]), a = {
804
- message: s,
805
- alert: (c, n) => s({ type: "info", title: c, ...n }),
806
- confirm: (c, n, p) => s({ type: "warning", title: c, confirm: n, ...p })
832
+ const U = te(null), De = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, G = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
833
+ function qe({ children: n }) {
834
+ const [s, u] = z([]);
835
+ D(W, []);
836
+ const i = B((x) => u((r) => r.filter((l) => l.id !== x)), []), g = B((x) => {
837
+ const r = Date.now();
838
+ return u((l) => [...l, { id: r, ...x }]), x.duration !== 0 && setTimeout(() => i(r), x.duration || 4e3), r;
839
+ }, [i]), h = {
840
+ message: g,
841
+ alert: (x, r) => g({ type: "info", title: x, ...r }),
842
+ confirm: (x, r, l) => g({ type: "warning", title: x, confirm: r, ...l })
807
843
  };
808
- return /* @__PURE__ */ f(J.Provider, { value: a, children: [
809
- r,
810
- /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: l.map((c) => {
811
- const n = c.type || "info";
812
- return /* @__PURE__ */ f("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${G[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: [
813
- /* @__PURE__ */ t("span", { style: { fontSize: 18, color: G[n], lineHeight: 1 }, children: De[n] }),
844
+ return /* @__PURE__ */ f(U.Provider, { value: h, children: [
845
+ n,
846
+ /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: s.map((x) => {
847
+ const r = x.type || "info";
848
+ return /* @__PURE__ */ f("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${G[r]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
849
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, color: G[r], lineHeight: 1 }, children: De[r] }),
814
850
  /* @__PURE__ */ f("div", { style: { flex: 1 }, children: [
815
- c.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: c.text ? 3 : 0 }, children: c.title }),
816
- c.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: c.text }),
817
- c.confirm && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
851
+ x.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: x.text ? 3 : 0 }, children: x.title }),
852
+ x.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: x.text }),
853
+ x.confirm && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
818
854
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
819
- c.confirm(!0), o(c.id);
855
+ x.confirm(!0), i(x.id);
820
856
  }, children: "Confirm" }),
821
857
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
822
- c.confirm(!1), o(c.id);
858
+ x.confirm(!1), i(x.id);
823
859
  }, children: "Cancel" })
824
860
  ] })
825
861
  ] }),
826
- /* @__PURE__ */ t("button", { onClick: () => o(c.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
827
- ] }, c.id);
862
+ /* @__PURE__ */ t("button", { onClick: () => i(x.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
863
+ ] }, x.id);
828
864
  }) })
829
865
  ] });
830
866
  }
831
- function qe() {
832
- const r = te(J);
833
- if (!r) throw new Error("useMessage must be used inside <MessageProvider>");
834
- return r;
867
+ function Ge() {
868
+ const n = re(U);
869
+ if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
870
+ return n;
835
871
  }
836
- function Ge({ data: r = [], template: l, keyNavigation: g = !0, multiselection: o = !1, editable: s = !1, height: a = 400, onSelect: c, onEdit: n, style: p }) {
837
- const [m, d] = z(/* @__PURE__ */ new Set()), [h, i] = z(null), [y, $] = z(""), [S, v] = z(null);
838
- T(W, []);
839
- const N = (u, x) => {
840
- const M = u.id ?? x;
841
- d((D) => {
842
- const b = o ? new Set(D) : /* @__PURE__ */ new Set();
843
- return b.has(M) ? b.delete(M) : b.add(M), b;
844
- }), v(x), c == null || c(u);
845
- }, k = (u, x) => {
846
- n == null || n({ ...u, value: y }, x), i(null);
872
+ function Je({ data: n = [], template: s, keyNavigation: u = !0, multiselection: i = !1, editable: g = !1, height: h = 400, onSelect: x, onEdit: r, style: l }) {
873
+ const [y, d] = z(/* @__PURE__ */ new Set()), [k, a] = z(null), [c, M] = z(""), [$, S] = z(null);
874
+ D(W, []);
875
+ const C = (p, o) => {
876
+ const v = p.id ?? o;
877
+ d((L) => {
878
+ const b = i ? new Set(L) : /* @__PURE__ */ new Set();
879
+ return b.has(v) ? b.delete(v) : b.add(v), b;
880
+ }), S(o), x == null || x(p);
881
+ }, m = (p, o) => {
882
+ r == null || r({ ...p, value: c }, o), a(null);
847
883
  };
848
884
  return /* @__PURE__ */ f(
849
885
  "div",
850
886
  {
851
887
  className: "dhx dhx-scroll",
852
- style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...p },
888
+ style: { height: h, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...l },
853
889
  tabIndex: 0,
854
- onKeyDown: (u) => {
855
- g && (u.key === "ArrowDown" && v((x) => Math.min((x ?? -1) + 1, r.length - 1)), u.key === "ArrowUp" && v((x) => Math.max((x ?? 1) - 1, 0)));
890
+ onKeyDown: (p) => {
891
+ u && (p.key === "ArrowDown" && S((o) => Math.min((o ?? -1) + 1, n.length - 1)), p.key === "ArrowUp" && S((o) => Math.max((o ?? 1) - 1, 0)));
856
892
  },
857
893
  children: [
858
- r.map((u, x) => {
859
- const M = u.id ?? x, D = m.has(M), b = S === x;
894
+ n.map((p, o) => {
895
+ const v = p.id ?? o, L = y.has(v), b = $ === o;
860
896
  return /* @__PURE__ */ t(
861
897
  "div",
862
898
  {
863
- onClick: () => N(u, x),
864
- onDoubleClick: () => s && (i(x), $(String(u.value || ""))),
865
- style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: D ? e.primaryLt : b ? e.bg : e.surface, color: D ? e.primary : e.text, outline: b ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
866
- children: h === x ? /* @__PURE__ */ t(
899
+ onClick: () => C(p, o),
900
+ onDoubleClick: () => g && (a(o), M(String(p.value || ""))),
901
+ style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: L ? e.primaryLt : b ? e.bg : e.surface, color: L ? e.primary : e.text, outline: b ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
902
+ children: k === o ? /* @__PURE__ */ t(
867
903
  "input",
868
904
  {
869
905
  autoFocus: !0,
870
906
  className: "dhx dhx-input",
871
907
  style: { height: 28, flex: 1 },
872
- value: y,
873
- onChange: (C) => $(C.target.value),
874
- onBlur: () => k(u, x),
875
- onKeyDown: (C) => {
876
- C.key === "Enter" && k(u, x), C.key === "Escape" && i(null);
908
+ value: c,
909
+ onChange: (N) => M(N.target.value),
910
+ onBlur: () => m(p, o),
911
+ onKeyDown: (N) => {
912
+ N.key === "Enter" && m(p, o), N.key === "Escape" && a(null);
877
913
  },
878
- onClick: (C) => C.stopPropagation()
914
+ onClick: (N) => N.stopPropagation()
879
915
  }
880
- ) : l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(u) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(u.value ?? "") })
916
+ ) : s ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: s(p) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(p.value ?? "") })
881
917
  },
882
- String(M)
918
+ String(v)
883
919
  );
884
920
  }),
885
- r.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
921
+ n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
886
922
  ]
887
923
  }
888
924
  );
889
925
  }
890
- function Je({ data: r = [], template: l, itemsInRow: g = 3, gap: o = 12, multiselection: s = !1, onSelect: a, style: c }) {
891
- const [n, p] = z(/* @__PURE__ */ new Set());
892
- T(W, []);
893
- const m = (d) => {
894
- const h = d.id ?? String(d.title);
895
- p((i) => {
896
- const y = s ? new Set(i) : /* @__PURE__ */ new Set();
897
- return y.has(h) ? y.delete(h) : y.add(h), y;
898
- }), a == null || a(d);
926
+ function Ue({ data: n = [], template: s, itemsInRow: u = 3, gap: i = 12, multiselection: g = !1, onSelect: h, style: x }) {
927
+ const [r, l] = z(/* @__PURE__ */ new Set());
928
+ D(W, []);
929
+ const y = (d) => {
930
+ const k = d.id ?? String(d.title);
931
+ l((a) => {
932
+ const c = g ? new Set(a) : /* @__PURE__ */ new Set();
933
+ return c.has(k) ? c.delete(k) : c.add(k), c;
934
+ }), h == null || h(d);
899
935
  };
900
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${g}, 1fr)`, gap: o, padding: o, ...c }, children: r.map((d, h) => {
901
- const i = d.id ?? h, y = n.has(i);
936
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${u}, 1fr)`, gap: i, padding: i, ...x }, children: n.map((d, k) => {
937
+ const a = d.id ?? k, c = r.has(a);
902
938
  return /* @__PURE__ */ t(
903
939
  "div",
904
940
  {
905
- onClick: () => m(d),
906
- 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" },
907
- onMouseEnter: ($) => {
908
- $.currentTarget.style.boxShadow = e.shadowLg, $.currentTarget.style.transform = "translateY(-2px)";
941
+ onClick: () => y(d),
942
+ style: { background: e.surface, border: `2px solid ${c ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: c ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: c ? "translateY(-2px)" : "none" },
943
+ onMouseEnter: (M) => {
944
+ M.currentTarget.style.boxShadow = e.shadowLg, M.currentTarget.style.transform = "translateY(-2px)";
909
945
  },
910
- onMouseLeave: ($) => {
911
- $.currentTarget.style.boxShadow = y ? `0 0 0 3px ${e.primary}33` : e.shadow, $.currentTarget.style.transform = y ? "translateY(-2px)" : "none";
946
+ onMouseLeave: (M) => {
947
+ M.currentTarget.style.boxShadow = c ? `0 0 0 3px ${e.primary}33` : e.shadow, M.currentTarget.style.transform = c ? "translateY(-2px)" : "none";
912
948
  },
913
- children: l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(d) } }) : /* @__PURE__ */ f("div", { style: { padding: 16 }, children: [
949
+ children: s ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: s(d) } }) : /* @__PURE__ */ f("div", { style: { padding: 16 }, children: [
914
950
  d.img && /* @__PURE__ */ t("img", { src: d.img, alt: d.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
915
951
  /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: d.title || d.value }),
916
952
  d.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: d.subtitle })
917
953
  ] })
918
954
  },
919
- String(i)
955
+ String(a)
920
956
  );
921
957
  }) });
922
958
  }
923
- function Ue({ data: r = [], checkbox: l = !1, editable: g = !1, onSelect: o, onCheck: s, style: a }) {
924
- const [c, n] = z({}), [p, m] = z(null), [d, h] = z({}), [i, y] = z(null), [$, S] = z("");
925
- T(W, []);
926
- const v = (u) => n((x) => ({ ...x, [u]: !x[u] })), N = (u, x) => {
927
- h((M) => ({ ...M, [u]: x })), s == null || s(u, x);
928
- }, k = (u, x = 0) => {
929
- var C;
930
- const M = (((C = u.items) == null ? void 0 : C.length) ?? 0) > 0, D = c[u.id], b = p === u.id;
959
+ function Qe({ data: n = [], checkbox: s = !1, editable: u = !1, onSelect: i, onCheck: g, style: h }) {
960
+ const [x, r] = z({}), [l, y] = z(null), [d, k] = z({}), [a, c] = z(null), [M, $] = z("");
961
+ D(W, []);
962
+ const S = (p) => r((o) => ({ ...o, [p]: !o[p] })), C = (p, o) => {
963
+ k((v) => ({ ...v, [p]: o })), g == null || g(p, o);
964
+ }, m = (p, o = 0) => {
965
+ var N;
966
+ const v = (((N = p.items) == null ? void 0 : N.length) ?? 0) > 0, L = x[p.id], b = l === p.id;
931
967
  return /* @__PURE__ */ f("div", { children: [
932
968
  /* @__PURE__ */ f(
933
969
  "div",
934
970
  {
935
971
  onClick: () => {
936
- m(u.id), o == null || o(u), M && v(u.id);
972
+ y(p.id), i == null || i(p), v && S(p.id);
937
973
  },
938
974
  onDoubleClick: () => {
939
- g && (y(u.id), S(u.value || ""));
975
+ u && (c(p.id), $(p.value || ""));
940
976
  },
941
- style: { display: "flex", alignItems: "center", gap: 4, padding: `5px 8px 5px ${12 + x * 18}px`, cursor: "pointer", borderRadius: e.r, margin: "1px 4px", background: b ? e.primaryLt : "transparent", color: b ? e.primary : e.text, userSelect: "none", fontSize: 13 },
977
+ style: { display: "flex", alignItems: "center", gap: 4, padding: `5px 8px 5px ${12 + o * 18}px`, cursor: "pointer", borderRadius: e.r, margin: "1px 4px", background: b ? e.primaryLt : "transparent", color: b ? e.primary : e.text, userSelect: "none", fontSize: 13 },
942
978
  onMouseEnter: (w) => !b && (w.currentTarget.style.background = e.bg),
943
979
  onMouseLeave: (w) => !b && (w.currentTarget.style.background = "transparent"),
944
980
  children: [
945
- /* @__PURE__ */ t("span", { style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 }, children: M ? D ? "▾" : "▸" : "" }),
946
- /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: M ? D ? "📂" : "📁" : "📄" }),
947
- l && /* @__PURE__ */ t("input", { type: "checkbox", checked: !!d[u.id], onChange: (w) => {
948
- w.stopPropagation(), N(u.id, w.target.checked);
981
+ /* @__PURE__ */ t("span", { style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 }, children: v ? L ? "▾" : "▸" : "" }),
982
+ /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: v ? L ? "📂" : "📁" : "📄" }),
983
+ s && /* @__PURE__ */ t("input", { type: "checkbox", checked: !!d[p.id], onChange: (w) => {
984
+ w.stopPropagation(), C(p.id, w.target.checked);
949
985
  }, style: { cursor: "pointer", accentColor: e.primary }, onClick: (w) => w.stopPropagation() }),
950
- i === u.id ? /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 24, fontSize: 12, flex: 1 }, value: $, onChange: (w) => S(w.target.value), onBlur: () => y(null), onKeyDown: (w) => w.key === "Enter" && y(null), onClick: (w) => w.stopPropagation() }) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: u.value }),
951
- u.count !== void 0 && /* @__PURE__ */ f("span", { style: { fontSize: 11, color: e.textMut }, children: [
986
+ a === p.id ? /* @__PURE__ */ t("input", { autoFocus: !0, className: "dhx dhx-input", style: { height: 24, fontSize: 12, flex: 1 }, value: M, onChange: (w) => $(w.target.value), onBlur: () => c(null), onKeyDown: (w) => w.key === "Enter" && c(null), onClick: (w) => w.stopPropagation() }) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: p.value }),
987
+ p.count !== void 0 && /* @__PURE__ */ f("span", { style: { fontSize: 11, color: e.textMut }, children: [
952
988
  "(",
953
- u.count,
989
+ p.count,
954
990
  ")"
955
991
  ] })
956
992
  ]
957
993
  }
958
994
  ),
959
- M && D && /* @__PURE__ */ t("div", { children: u.items.map((w) => k(w, x + 1)) })
960
- ] }, u.id);
995
+ v && L && /* @__PURE__ */ t("div", { children: p.items.map((w) => m(w, o + 1)) })
996
+ ] }, p.id);
961
997
  };
962
- return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...a }, children: r.map((u) => k(u)) });
998
+ return /* @__PURE__ */ t("div", { className: "dhx dhx-scroll", style: { overflowY: "auto", ...h }, children: n.map((p) => m(p)) });
963
999
  }
964
- function Qe({ total: r, pageSize: l = 10, page: g, onChange: o, style: s }) {
965
- const [a, c] = z(g || 1), n = Math.ceil(r / l);
966
- T(W, []);
967
- const p = (d) => {
968
- const h = Math.min(Math.max(1, d), n);
969
- c(h), o == null || o(h);
970
- }, m = F(() => {
1000
+ function Ze({ total: n, pageSize: s = 10, page: u, onChange: i, style: g }) {
1001
+ const [h, x] = z(u || 1), r = Math.ceil(n / s);
1002
+ D(W, []);
1003
+ const l = (d) => {
1004
+ const k = Math.min(Math.max(1, d), r);
1005
+ x(k), i == null || i(k);
1006
+ }, y = K(() => {
971
1007
  const d = [];
972
- for (let i = Math.max(1, a - 2); i <= Math.min(n, a + 2); i++) d.push(i);
973
- return d[0] > 1 && (d[0] > 2 && d.unshift("..."), d.unshift(1)), d[d.length - 1] < n && (d[d.length - 1] < n - 1 && d.push("..."), d.push(n)), d;
974
- }, [a, n]);
975
- return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...s }, children: [
1008
+ for (let a = Math.max(1, h - 2); a <= Math.min(r, h + 2); a++) d.push(a);
1009
+ return d[0] > 1 && (d[0] > 2 && d.unshift("..."), d.unshift(1)), d[d.length - 1] < r && (d[d.length - 1] < r - 1 && d.push("..."), d.push(r)), d;
1010
+ }, [h, r]);
1011
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...g }, children: [
976
1012
  /* @__PURE__ */ f("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
977
- (a - 1) * l + 1,
1013
+ (h - 1) * s + 1,
978
1014
  "–",
979
- Math.min(a * l, r),
1015
+ Math.min(h * s, n),
980
1016
  " of ",
981
- r
1017
+ n
982
1018
  ] }),
983
- [["«", 1], ["‹", a - 1]].map(([d, h]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => p(h), children: d }, d)),
984
- m.map((d, h) => /* @__PURE__ */ t("button", { onClick: () => typeof d == "number" && p(d), className: `dhx dhx-btn ${d === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: d === "...", children: d }, h)),
985
- [["›", a + 1], ["»", n]].map(([d, h]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === n, onClick: () => p(h), children: d }, d))
1019
+ [["«", 1], ["‹", h - 1]].map(([d, k]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: h === 1, onClick: () => l(k), children: d }, d)),
1020
+ y.map((d, k) => /* @__PURE__ */ t("button", { onClick: () => typeof d == "number" && l(d), className: `dhx dhx-btn ${d === h ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: d === "...", children: d }, k)),
1021
+ [["›", h + 1], ["»", r]].map(([d, k]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: h === r, onClick: () => l(k), children: d }, d))
986
1022
  ] });
987
1023
  }
988
- function Ze({ config: r = {}, defaultValues: l = {}, onSubmit: g, style: o }) {
989
- const [s, a] = z(l), [c, n] = z({});
990
- T(W, []);
991
- const p = (i, y) => {
992
- a(($) => ({ ...$, [i]: y })), n(($) => ({ ...$, [i]: null }));
993
- }, m = () => {
994
- const i = {};
995
- return (r.rows || []).flat().forEach((y) => {
996
- y && typeof y == "object" && "name" in y && y.required && !s[y.name] && (i[y.name] = `${y.label || y.name} is required`);
997
- }), n(i), Object.keys(i).length === 0;
998
- }, d = (i) => {
999
- const y = s[i.name] ?? i.value ?? "", $ = c[i.name];
1000
- if (i.type === "fieldset") return /* @__PURE__ */ f("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1001
- /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: i.label }),
1002
- (i.rows || []).map((k) => d(k))
1003
- ] }, i.name);
1004
- const S = { key: i.name, className: "dhx-form-group" }, v = i.label && /* @__PURE__ */ f("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4 }, children: [
1005
- i.label,
1006
- i.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1007
- ] }), N = $ && /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: $ });
1008
- return !i.type || i.type === "input" ? /* @__PURE__ */ f("div", { ...S, children: [
1009
- v,
1024
+ function et({ config: n = {}, defaultValues: s = {}, onSubmit: u, style: i }) {
1025
+ const [g, h] = z(s), [x, r] = z({});
1026
+ D(W, []);
1027
+ const l = (a, c) => {
1028
+ h((M) => ({ ...M, [a]: c })), r((M) => ({ ...M, [a]: null }));
1029
+ }, y = () => {
1030
+ const a = {};
1031
+ return (n.rows || []).flat().forEach((c) => {
1032
+ c && typeof c == "object" && "name" in c && c.required && !g[c.name] && (a[c.name] = `${c.label || c.name} is required`);
1033
+ }), r(a), Object.keys(a).length === 0;
1034
+ }, d = (a) => {
1035
+ const c = g[a.name] ?? a.value ?? "", M = x[a.name];
1036
+ if (a.type === "fieldset") return /* @__PURE__ */ f("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1037
+ /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: a.label }),
1038
+ (a.rows || []).map((m) => d(m))
1039
+ ] }, a.name);
1040
+ const $ = { key: a.name, className: "dhx-form-group" }, S = a.label && /* @__PURE__ */ f("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4 }, children: [
1041
+ a.label,
1042
+ a.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1043
+ ] }), C = M && /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: M });
1044
+ return !a.type || a.type === "input" ? /* @__PURE__ */ f("div", { ...$, children: [
1045
+ S,
1010
1046
  /* @__PURE__ */ f("div", { className: "dhx-input-wrap", children: [
1011
- i.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: i.icon }),
1012
- /* @__PURE__ */ t("input", { className: `dhx dhx-input${i.icon ? " dhx-input--with-icon" : ""}`, style: { borderColor: $ ? e.danger : void 0 }, type: i.inputType || "text", placeholder: i.placeholder, value: y, onChange: (k) => p(i.name, k.target.value), disabled: i.disabled })
1047
+ a.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: a.icon }),
1048
+ /* @__PURE__ */ t("input", { className: `dhx dhx-input${a.icon ? " dhx-input--with-icon" : ""}`, style: { borderColor: M ? e.danger : void 0 }, type: a.inputType || "text", placeholder: a.placeholder, value: c, onChange: (m) => l(a.name, m.target.value), disabled: a.disabled })
1013
1049
  ] }),
1014
- i.helpMessage && /* @__PURE__ */ f("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1050
+ a.helpMessage && /* @__PURE__ */ f("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1015
1051
  "ⓘ ",
1016
- i.helpMessage
1052
+ a.helpMessage
1017
1053
  ] }),
1018
- N
1019
- ] }) : i.type === "textarea" ? /* @__PURE__ */ f("div", { ...S, children: [
1020
- v,
1021
- /* @__PURE__ */ t("textarea", { className: "dhx dhx-input", style: { height: 80, resize: "vertical", padding: "8px 10px" }, placeholder: i.placeholder, value: y, onChange: (k) => p(i.name, k.target.value) }),
1022
- N
1023
- ] }) : i.type === "select" ? /* @__PURE__ */ f("div", { ...S, children: [
1024
- v,
1025
- /* @__PURE__ */ f("select", { className: "dhx dhx-input", value: y, onChange: (k) => p(i.name, k.target.value), style: { cursor: "pointer" }, children: [
1054
+ C
1055
+ ] }) : a.type === "textarea" ? /* @__PURE__ */ f("div", { ...$, children: [
1056
+ S,
1057
+ /* @__PURE__ */ t("textarea", { className: "dhx dhx-input", style: { height: 80, resize: "vertical", padding: "8px 10px" }, placeholder: a.placeholder, value: c, onChange: (m) => l(a.name, m.target.value) }),
1058
+ C
1059
+ ] }) : a.type === "select" ? /* @__PURE__ */ f("div", { ...$, children: [
1060
+ S,
1061
+ /* @__PURE__ */ f("select", { className: "dhx dhx-input", value: c, onChange: (m) => l(a.name, m.target.value), style: { cursor: "pointer" }, children: [
1026
1062
  /* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
1027
- (i.options || []).map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.label || k.value }, k.value))
1063
+ (a.options || []).map((m) => /* @__PURE__ */ t("option", { value: m.value, children: m.label || m.value }, m.value))
1064
+ ] }),
1065
+ C
1066
+ ] }) : a.type === "checkbox" ? /* @__PURE__ */ t("div", { ...$, children: /* @__PURE__ */ f("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1067
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!c, onChange: (m) => l(a.name, m.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1068
+ /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: a.label })
1069
+ ] }) }) : a.type === "radio" ? /* @__PURE__ */ f("div", { ...$, children: [
1070
+ S,
1071
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: (a.options || []).map((m) => /* @__PURE__ */ f("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1072
+ /* @__PURE__ */ t("input", { type: "radio", name: a.name, value: m.value, checked: c === m.value, onChange: () => l(a.name, m.value), style: { accentColor: e.primary, cursor: "pointer" } }),
1073
+ m.label || m.value
1074
+ ] }, m.value)) })
1075
+ ] }) : a.type === "slider" ? /* @__PURE__ */ t("div", { ...$, children: /* @__PURE__ */ t(Le, { label: a.label, min: a.min, max: a.max, step: a.step, value: c || a.min, range: a.range, onChange: (m) => l(a.name, m) }) }) : a.type === "combo" ? /* @__PURE__ */ f("div", { ...$, children: [
1076
+ /* @__PURE__ */ t(Ne, { label: a.label, data: a.data || [], multiselection: a.multiselection, placeholder: a.placeholder || "Select...", value: c || (a.multiselection ? [] : null), onChange: (m) => l(a.name, m) }),
1077
+ C
1078
+ ] }) : a.type === "datepicker" ? /* @__PURE__ */ f("div", { ...$, children: [
1079
+ S,
1080
+ /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: c, onChange: (m) => l(a.name, m.target.value) }),
1081
+ C
1082
+ ] }) : a.type === "timepicker" ? /* @__PURE__ */ f("div", { ...$, children: [
1083
+ S,
1084
+ /* @__PURE__ */ t("input", { type: "time", className: "dhx dhx-input", value: c, onChange: (m) => l(a.name, m.target.value) })
1085
+ ] }) : a.type === "text" ? /* @__PURE__ */ f("div", { ...$, children: [
1086
+ S,
1087
+ /* @__PURE__ */ t("p", { style: { margin: "4px 0", fontSize: 13, color: e.text }, children: a.value })
1088
+ ] }) : a.type === "toggle" ? /* @__PURE__ */ t("div", { ...$, children: /* @__PURE__ */ f("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1089
+ /* @__PURE__ */ f("div", { style: { position: "relative", width: 40, height: 22 }, onClick: () => l(a.name, !c), children: [
1090
+ /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: c ? e.primary : e.border, transition: "background 0.2s" } }),
1091
+ /* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left: c ? 21 : 3, width: 16, height: 16, borderRadius: "50%", background: "#fff", transition: "left 0.2s", boxShadow: "0 1px 3px rgba(0,0,0,.3)" } })
1028
1092
  ] }),
1029
- N
1030
- ] }) : i.type === "checkbox" ? /* @__PURE__ */ t("div", { ...S, children: /* @__PURE__ */ f("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1031
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!y, onChange: (k) => p(i.name, k.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1032
- /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: i.label })
1033
- ] }) }) : i.type === "radio" ? /* @__PURE__ */ f("div", { ...S, children: [
1034
- v,
1035
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: (i.options || []).map((k) => /* @__PURE__ */ f("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1036
- /* @__PURE__ */ t("input", { type: "radio", name: i.name, value: k.value, checked: y === k.value, onChange: () => p(i.name, k.value), style: { accentColor: e.primary, cursor: "pointer" } }),
1037
- k.label || k.value
1038
- ] }, k.value)) })
1039
- ] }) : i.type === "slider" ? /* @__PURE__ */ t("div", { ...S, children: /* @__PURE__ */ t(Ce, { label: i.label, min: i.min, max: i.max, step: i.step, value: y || i.min, range: i.range, onChange: (k) => p(i.name, k) }) }) : i.type === "combo" ? /* @__PURE__ */ f("div", { ...S, children: [
1040
- /* @__PURE__ */ t(Ne, { label: i.label, data: i.data || [], multiselection: i.multiselection, placeholder: i.placeholder || "Select...", value: y || (i.multiselection ? [] : null), onChange: (k) => p(i.name, k) }),
1041
- N
1042
- ] }) : i.type === "datepicker" ? /* @__PURE__ */ f("div", { ...S, children: [
1043
- v,
1044
- /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: y, onChange: (k) => p(i.name, k.target.value) }),
1045
- N
1046
- ] }) : i.type === "timepicker" ? /* @__PURE__ */ f("div", { ...S, children: [
1047
- v,
1048
- /* @__PURE__ */ t("input", { type: "time", className: "dhx dhx-input", value: y, onChange: (k) => p(i.name, k.target.value) })
1049
- ] }) : i.type === "spacer" ? /* @__PURE__ */ t("div", { style: { height: i.height || 16 } }, i.name) : null;
1050
- }, h = (i) => i.map(
1051
- (y, $) => Array.isArray(y) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: y.map(d) }, $) : d(y)
1093
+ a.label && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: a.label })
1094
+ ] }) }) : a.type === "colorpicker" ? /* @__PURE__ */ f("div", { ...$, children: [
1095
+ S,
1096
+ /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1097
+ /* @__PURE__ */ t(
1098
+ "input",
1099
+ {
1100
+ type: "color",
1101
+ value: c || "#000000",
1102
+ onChange: (m) => l(a.name, m.target.value),
1103
+ style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
1104
+ }
1105
+ ),
1106
+ /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: c || "#000000" })
1107
+ ] }),
1108
+ C
1109
+ ] }) : a.type === "spacer" ? /* @__PURE__ */ t("div", { style: { height: a.height || 16 } }, a.name) : null;
1110
+ }, k = (a) => a.map(
1111
+ (c, M) => Array.isArray(c) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: c.map(d) }, M) : d(c)
1052
1112
  );
1053
- return /* @__PURE__ */ f("div", { className: "dhx", style: { padding: r.padding || 0, width: r.width || "100%", ...o }, children: [
1054
- h(r.rows || []),
1055
- (r.buttons || g) && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, justifyContent: r.buttonAlign || "flex-start", marginTop: 8 }, children: [
1056
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => m() && (g == null ? void 0 : g(s)), children: r.submitText || "Submit" }),
1057
- r.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
1058
- a(l), n({});
1059
- }, children: r.resetText || "Reset" })
1113
+ return /* @__PURE__ */ f("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...i }, children: [
1114
+ k(n.rows || []),
1115
+ (n.buttons || u) && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
1116
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => y() && (u == null ? void 0 : u(g)), children: n.submitText || "Submit" }),
1117
+ n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
1118
+ h(s), r({});
1119
+ }, children: n.resetText || "Reset" })
1060
1120
  ] })
1061
1121
  ] });
1062
1122
  }
1063
- function et({ items: r = [], onAction: l, style: g }) {
1064
- T(W, []);
1065
- const o = (s, a) => {
1066
- var p, m;
1067
- if ("type" in s && (s.type === "separator" || s.type === "sep"))
1068
- return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, a);
1069
- if ("type" in s && s.type === "input")
1123
+ function J(n) {
1124
+ const s = [];
1125
+ for (const u of n)
1126
+ "type" in u && u.type === "block" ? s.push(...u.items || []) : s.push(u);
1127
+ return s;
1128
+ }
1129
+ function tt({ items: n = [], onAction: s, style: u }) {
1130
+ D(W, []);
1131
+ const [i, g] = z(() => {
1132
+ const r = {};
1133
+ for (const l of J(n))
1134
+ l.id && (r[l.id] = !!l.active);
1135
+ return r;
1136
+ }), h = (r) => {
1137
+ var l;
1138
+ if (r.id)
1139
+ if (r.group) {
1140
+ const y = J(n).filter((d) => d.group === r.group && d.id);
1141
+ g((d) => {
1142
+ const k = { ...d };
1143
+ for (const a of y) k[a.id] = !1;
1144
+ return k[r.id] = !0, k;
1145
+ });
1146
+ } else r.twoState && g((y) => ({ ...y, [r.id]: !y[r.id] }));
1147
+ (l = r.onClick) == null || l.call(r, r), r.id && (s == null || s(r.id, r));
1148
+ }, x = (r, l) => {
1149
+ var k, a;
1150
+ if ("type" in r && (r.type === "separator" || r.type === "sep"))
1151
+ return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, l);
1152
+ if ("type" in r && r.type === "input") {
1153
+ const c = r;
1070
1154
  return /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
1071
- s.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: s.label }),
1072
- /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: s.width || 110, height: 26, fontSize: 12 }, placeholder: s.placeholder, defaultValue: s.value, onChange: (d) => {
1073
- var h;
1074
- return (h = s.onChange) == null ? void 0 : h.call(s, d.target.value);
1155
+ c.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: c.label }),
1156
+ /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: c.width || 110, height: 26, fontSize: 12 }, placeholder: c.placeholder, defaultValue: c.value, onChange: (M) => {
1157
+ var $;
1158
+ return ($ = c.onChange) == null ? void 0 : $.call(c, M.target.value);
1075
1159
  } })
1076
- ] }, a);
1077
- if ("type" in s && s.type === "block") {
1078
- const d = s;
1079
- return /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: d.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
1080
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (p = d.items) == null ? void 0 : p.map((h, i) => o(h, i)) }),
1081
- d.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: d.label })
1082
- ] }, a);
1160
+ ] }, l);
1161
+ }
1162
+ if ("type" in r && r.type === "block") {
1163
+ const c = r;
1164
+ return /* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: c.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
1165
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (k = c.items) == null ? void 0 : k.map((M, $) => x(M, $)) }),
1166
+ c.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: c.label })
1167
+ ] }, l);
1083
1168
  }
1084
- if ("type" in s && s.type === "selectButton") {
1085
- const d = s;
1086
- return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: d.value, onChange: (h) => {
1087
- var i;
1088
- return (i = d.onChange) == null ? void 0 : i.call(d, h.target.value);
1089
- }, children: (m = d.items) == null ? void 0 : m.map((h) => /* @__PURE__ */ t("option", { value: h.value, children: h.value }, h.value)) }, a);
1169
+ if ("type" in r && r.type === "selectButton") {
1170
+ const c = r;
1171
+ return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: c.value, onChange: (M) => {
1172
+ var $;
1173
+ return ($ = c.onChange) == null ? void 0 : $.call(c, M.target.value);
1174
+ }, children: (a = c.items) == null ? void 0 : a.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.value }, M.value)) }, l);
1090
1175
  }
1091
- const c = s, n = c.active;
1176
+ const y = r, d = y.id !== void 0 ? i[y.id] ?? !!y.active : !!y.active;
1092
1177
  return /* @__PURE__ */ f(
1093
1178
  "button",
1094
1179
  {
1095
- title: c.tooltip,
1096
- className: `dhx dhx-btn ${n ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
1180
+ title: y.tooltip,
1181
+ className: `dhx dhx-btn ${d ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
1097
1182
  style: { flexDirection: "column", minHeight: 48, padding: "4px 8px", gap: 4, fontSize: 12 },
1098
- disabled: c.disabled,
1099
- onClick: () => {
1100
- var d;
1101
- (d = c.onClick) == null || d.call(c, c), c.id && (l == null || l(c.id, c));
1102
- },
1183
+ disabled: y.disabled,
1184
+ onClick: () => h(y),
1103
1185
  children: [
1104
- c.icon && /* @__PURE__ */ t("span", { style: { fontSize: c.size === "large" ? 24 : 18 }, children: c.icon }),
1105
- c.text && /* @__PURE__ */ t("span", { style: { fontSize: 10, maxWidth: 60, textAlign: "center", lineHeight: 1.2, whiteSpace: "normal" }, children: c.text })
1186
+ y.icon && /* @__PURE__ */ t("span", { style: { fontSize: y.size === "large" ? 24 : 18 }, children: y.icon }),
1187
+ y.text && /* @__PURE__ */ t("span", { style: { fontSize: 10, maxWidth: 60, textAlign: "center", lineHeight: 1.2, whiteSpace: "normal" }, children: y.text })
1106
1188
  ]
1107
1189
  },
1108
- a
1190
+ l
1109
1191
  );
1110
1192
  };
1111
- 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, ...g }, children: r.map(o) });
1193
+ 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, ...u }, children: n.map(x) });
1112
1194
  }
1113
- function tt({ logo: r, items: l = [], vertical: g = !1, style: o }) {
1114
- const [s, a] = z(null), c = B(null);
1115
- T(W, []), Y(c, H(() => a(null), []));
1116
- const n = (p, m) => {
1195
+ function rt({ logo: n, items: s = [], vertical: u = !1, style: i }) {
1196
+ const [g, h] = z(null), x = H(null);
1197
+ D(W, []), Y(x, B(() => h(null), []));
1198
+ const r = (l, y) => {
1117
1199
  var d;
1118
- return p.type === "separator" ? /* @__PURE__ */ t("div", { style: { [g ? "height" : "width"]: 1, background: e.border, margin: g ? "4px 8px" : "0 6px", alignSelf: "stretch" } }, m) : p.type === "spacer" ? /* @__PURE__ */ t("div", { style: { flex: 1 } }, m) : p.type === "input" ? /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: p.width || 200, height: 28, margin: "0 4px" }, placeholder: p.placeholder }, m) : p.type === "menuItem" && ((d = p.items) != null && d.length) ? /* @__PURE__ */ f("div", { style: { position: "relative" }, children: [
1119
- /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, color: e.text }, onClick: () => a(s === m ? null : m), children: [
1120
- p.icon && /* @__PURE__ */ t("span", { children: p.icon }),
1121
- p.value,
1200
+ return l.type === "separator" ? /* @__PURE__ */ t("div", { style: { [u ? "height" : "width"]: 1, background: e.border, margin: u ? "4px 8px" : "0 6px", alignSelf: "stretch" } }, y) : l.type === "spacer" ? /* @__PURE__ */ t("div", { style: { flex: 1 } }, y) : l.type === "input" ? /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: l.width || 200, height: 28, margin: "0 4px" }, placeholder: l.placeholder }, y) : l.type === "menuItem" && ((d = l.items) != null && d.length) ? /* @__PURE__ */ f("div", { style: { position: "relative" }, children: [
1201
+ /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, color: e.text }, onClick: () => h(g === y ? null : y), children: [
1202
+ l.icon && /* @__PURE__ */ t("span", { children: l.icon }),
1203
+ l.value,
1122
1204
  " ",
1123
1205
  /* @__PURE__ */ t("span", { style: { fontSize: 9 }, children: "▼" })
1124
1206
  ] }),
1125
- s === m && /* @__PURE__ */ t(O, { items: p.items, onSelect: () => a(null), style: { top: "100%" } })
1126
- ] }, m) : /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, gap: 6, color: e.text }, onClick: () => {
1127
- var h;
1128
- return (h = p.onClick) == null ? void 0 : h.call(p);
1207
+ g === y && /* @__PURE__ */ t(P, { items: l.items, onSelect: () => h(null), style: { top: "100%" } })
1208
+ ] }, y) : /* @__PURE__ */ f("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 36, gap: 6, color: e.text }, onClick: () => {
1209
+ var k;
1210
+ return (k = l.onClick) == null ? void 0 : k.call(l);
1129
1211
  }, children: [
1130
- p.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: p.icon }),
1131
- p.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: p.value })
1132
- ] }, m);
1212
+ l.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: l.icon }),
1213
+ l.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: l.value })
1214
+ ] }, y);
1133
1215
  };
1134
- return /* @__PURE__ */ f("nav", { ref: c, className: "dhx", style: { display: "flex", flexDirection: g ? "column" : "row", alignItems: g ? "stretch" : "center", background: e.surface, borderBottom: g ? "none" : `1px solid ${e.border}`, borderRight: g ? `1px solid ${e.border}` : "none", padding: g ? "12px 0" : "0 12px", minHeight: g ? void 0 : 48, gap: 2, ...o }, children: [
1135
- r && /* @__PURE__ */ t("div", { style: { color: e.text, fontWeight: 800, fontSize: 16, padding: g ? "8px 16px" : "0 12px 0 4px", borderRight: g ? "none" : `1px solid ${e.border}`, marginRight: g ? 0 : 8 }, children: r }),
1136
- l.map(n)
1216
+ return /* @__PURE__ */ f("nav", { ref: x, className: "dhx", style: { display: "flex", flexDirection: u ? "column" : "row", alignItems: u ? "stretch" : "center", background: e.surface, borderBottom: u ? "none" : `1px solid ${e.border}`, borderRight: u ? `1px solid ${e.border}` : "none", padding: u ? "12px 0" : "0 12px", minHeight: u ? void 0 : 48, gap: 2, ...i }, children: [
1217
+ n && /* @__PURE__ */ t("div", { style: { color: e.text, fontWeight: 800, fontSize: 16, padding: u ? "8px 16px" : "0 12px 0 4px", borderRight: u ? "none" : `1px solid ${e.border}`, marginRight: u ? 0 : 8 }, children: n }),
1218
+ s.map(r)
1137
1219
  ] });
1138
1220
  }
1139
1221
  export {
1140
- We as Button,
1141
- Ye as Calendar,
1142
- je as Chart,
1143
- Pe as Colorpicker,
1222
+ Ae as Button,
1223
+ Pe as Calendar,
1224
+ Ye as Chart,
1225
+ Ke as Colorpicker,
1144
1226
  Ne as Combobox,
1145
- Ke as ContextMenu,
1146
- Je as DataView,
1147
- Ze as Form,
1148
- Be as Grid,
1149
- Se as Layout,
1150
- Ge as List,
1151
- Fe as Menu,
1152
- O as MenuDropdown,
1153
- J as MessageContext,
1154
- Ve as MessageProvider,
1155
- tt as Navbar,
1156
- Qe as Pagination,
1157
- _e as Popup,
1158
- et as Ribbon,
1159
- Ae as Sidebar,
1160
- Ce as Slider,
1227
+ Fe as ContextMenu,
1228
+ Ue as DataView,
1229
+ et as Form,
1230
+ je as Grid,
1231
+ Me as Layout,
1232
+ Je as List,
1233
+ _e as Menu,
1234
+ P as MenuDropdown,
1235
+ U as MessageContext,
1236
+ qe as MessageProvider,
1237
+ rt as Navbar,
1238
+ Ze as Pagination,
1239
+ Xe as Popup,
1240
+ tt as Ribbon,
1241
+ Be as Sidebar,
1242
+ Le as Slider,
1161
1243
  He as Tabbar,
1162
1244
  Oe as Timepicker,
1163
1245
  Ee as Toolbar,
1164
- Ue as Tree,
1165
- Xe as Window,
1246
+ Qe as Tree,
1247
+ Ve as Window,
1166
1248
  e as tokens,
1167
1249
  Y as useClickOutside,
1168
- ze as useDrag,
1169
- qe as useMessage
1250
+ Ce as useDrag,
1251
+ Ge as useMessage
1170
1252
  };
1171
1253
  //# sourceMappingURL=dhx-react-suite.js.map