dhx-react-suite 1.0.2 → 1.0.4

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