@kingsimba/nc-ui 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +525 -509
- package/dist/index.js.map +1 -1
- package/dist/styles.css +39 -6
- package/dist/yaml.cjs +1 -0
- package/dist/yaml.cjs.map +1 -1
- package/dist/yaml.js +1 -0
- package/dist/yaml.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,36 +37,36 @@ function Te({
|
|
|
37
37
|
);
|
|
38
38
|
return n ? /* @__PURE__ */ s("div", { className: "nc-activity-indicator-overlay", children: o }) : o;
|
|
39
39
|
}
|
|
40
|
-
function G({ variant: e = "default", block: t, size: n = "default", className: r, disabled: o, textSelectable: i, loading:
|
|
41
|
-
const
|
|
40
|
+
function G({ variant: e = "default", block: t, size: n = "default", className: r, disabled: o, textSelectable: i, loading: l, onClick: c, children: d, ...p }) {
|
|
41
|
+
const h = [
|
|
42
42
|
"nc-button",
|
|
43
43
|
e !== "default" ? `nc-${e}` : "",
|
|
44
44
|
t ? "nc-block" : "",
|
|
45
45
|
n === "small" ? "nc-small" : "",
|
|
46
46
|
n === "large" ? "nc-large" : "",
|
|
47
|
-
o ||
|
|
47
|
+
o || l ? "nc-disabled" : "",
|
|
48
48
|
i ? "nc-text-selectable" : "",
|
|
49
|
-
|
|
49
|
+
l ? "nc-loading" : "",
|
|
50
50
|
r ?? ""
|
|
51
51
|
].filter(Boolean).join(" ");
|
|
52
52
|
return /* @__PURE__ */ y(
|
|
53
53
|
"button",
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
56
|
-
disabled: o ||
|
|
57
|
-
onClick: (
|
|
58
|
-
if (!
|
|
55
|
+
className: h,
|
|
56
|
+
disabled: o || l,
|
|
57
|
+
onClick: (a) => {
|
|
58
|
+
if (!l) {
|
|
59
59
|
if (i) {
|
|
60
60
|
const u = window.getSelection();
|
|
61
61
|
if (u && u.toString().length > 0)
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
c == null || c(a);
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
...p,
|
|
68
68
|
children: [
|
|
69
|
-
|
|
69
|
+
l && /* @__PURE__ */ s(
|
|
70
70
|
Te,
|
|
71
71
|
{
|
|
72
72
|
size: "small",
|
|
@@ -105,21 +105,21 @@ function xn({
|
|
|
105
105
|
const o = Math.max(0, Math.min(1, Number(e) || 0));
|
|
106
106
|
let i;
|
|
107
107
|
r ? o < 0.1 ? i = "var(--nc-danger)" : o < 0.2 ? i = "var(--nc-warning)" : i = "var(--nc-success)" : i = n ? "#ffffff" : "#000000";
|
|
108
|
-
const
|
|
108
|
+
const l = n ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.2)", c = 24, d = 14, p = 2, h = 0, w = 12, a = 0, u = 0, m = 0, v = c, f = d, x = f - a * 2, k = v - a * 2, $ = Math.max(1, Math.min(4, f / 4)), g = o === 0 ? 0 : 0.05 + o * 0.95, I = c + p + w, P = 20, b = 0.65, S = Math.max(d, P * b), N = c + p + 1, E = (d - P * b) / 2;
|
|
109
109
|
return /* @__PURE__ */ y(
|
|
110
110
|
"svg",
|
|
111
111
|
{
|
|
112
112
|
className: "nc-battery",
|
|
113
|
-
width:
|
|
113
|
+
width: I,
|
|
114
114
|
height: S,
|
|
115
|
-
viewBox: `0 0 ${
|
|
115
|
+
viewBox: `0 0 ${I} ${S}`,
|
|
116
116
|
role: "img",
|
|
117
117
|
"aria-label": `Battery ${o === 0 ? "-" : Math.round(o * 100) + "%"} ${t}`,
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ y("defs", { children: [
|
|
120
120
|
/* @__PURE__ */ s("mask", { id: `nc-battery-fill-mask-${o}`, children: /* @__PURE__ */ s("rect", { x: "0", y: "0", width: k * g, height: x, fill: "white" }) }),
|
|
121
121
|
/* @__PURE__ */ y("mask", { id: `nc-battery-text-mask-${o}`, children: [
|
|
122
|
-
/* @__PURE__ */ s("rect", { x: "0", y: "0", width:
|
|
122
|
+
/* @__PURE__ */ s("rect", { x: "0", y: "0", width: I, height: S, fill: "white" }),
|
|
123
123
|
/* @__PURE__ */ s("text", { x: u + v / 2, y: d - 3, fontSize: 11, fontWeight: "bold", fill: "black", textAnchor: "middle", children: o === 0 ? "-" : Math.round(o * 100) })
|
|
124
124
|
] })
|
|
125
125
|
] }),
|
|
@@ -128,19 +128,19 @@ function xn({
|
|
|
128
128
|
"rect",
|
|
129
129
|
{
|
|
130
130
|
x: u,
|
|
131
|
-
y:
|
|
131
|
+
y: m,
|
|
132
132
|
rx: $,
|
|
133
133
|
ry: $,
|
|
134
134
|
width: v,
|
|
135
|
-
height:
|
|
136
|
-
fill:
|
|
135
|
+
height: f,
|
|
136
|
+
fill: l
|
|
137
137
|
}
|
|
138
138
|
),
|
|
139
139
|
/* @__PURE__ */ s(
|
|
140
140
|
"rect",
|
|
141
141
|
{
|
|
142
|
-
x: u +
|
|
143
|
-
y:
|
|
142
|
+
x: u + a,
|
|
143
|
+
y: m + a,
|
|
144
144
|
width: k,
|
|
145
145
|
height: x,
|
|
146
146
|
fill: i,
|
|
@@ -152,16 +152,16 @@ function xn({
|
|
|
152
152
|
/* @__PURE__ */ s(
|
|
153
153
|
"rect",
|
|
154
154
|
{
|
|
155
|
-
x:
|
|
155
|
+
x: c + h,
|
|
156
156
|
y: d * 0.26,
|
|
157
157
|
width: p,
|
|
158
158
|
height: d * 0.48,
|
|
159
159
|
rx: 0.8,
|
|
160
160
|
ry: 0.8,
|
|
161
|
-
fill: o === 1 ? i :
|
|
161
|
+
fill: o === 1 ? i : l
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
|
-
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${N}, ${E}) scale(${
|
|
164
|
+
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${N}, ${E}) scale(${b})`, fill: i, children: /* @__PURE__ */ s("path", { d: "M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z" }) }) : null
|
|
165
165
|
] })
|
|
166
166
|
]
|
|
167
167
|
}
|
|
@@ -175,15 +175,15 @@ function kn({
|
|
|
175
175
|
labels: o,
|
|
176
176
|
size: i = "default"
|
|
177
177
|
}) {
|
|
178
|
-
return /* @__PURE__ */ s("div", { className: `nc-button-group ${i === "small" ? "nc-small" : ""}`, children: n.map((
|
|
178
|
+
return /* @__PURE__ */ s("div", { className: `nc-button-group ${i === "small" ? "nc-small" : ""}`, children: n.map((l, c) => /* @__PURE__ */ s(
|
|
179
179
|
"button",
|
|
180
180
|
{
|
|
181
|
-
className: `nc-button-group-item ${e ===
|
|
182
|
-
onClick: () => !r && t(
|
|
181
|
+
className: `nc-button-group-item ${e === l ? "nc-active" : ""} ${c < n.length - 1 ? "nc-has-border" : ""}`,
|
|
182
|
+
onClick: () => !r && t(l),
|
|
183
183
|
disabled: r,
|
|
184
|
-
children: o && o[
|
|
184
|
+
children: o && o[l] ? o[l] : l
|
|
185
185
|
},
|
|
186
|
-
|
|
186
|
+
l
|
|
187
187
|
)) });
|
|
188
188
|
}
|
|
189
189
|
function ut({ size: e }) {
|
|
@@ -198,13 +198,13 @@ function ut({ size: e }) {
|
|
|
198
198
|
}
|
|
199
199
|
) });
|
|
200
200
|
}
|
|
201
|
-
function Nn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default", labelColor: i, style:
|
|
201
|
+
function Nn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default", labelColor: i, style: l, className: c = "" }) {
|
|
202
202
|
const d = o === "small";
|
|
203
203
|
return /* @__PURE__ */ y(
|
|
204
204
|
"label",
|
|
205
205
|
{
|
|
206
|
-
className: `nc-checkbox-label ${d ? "nc-small" : ""} ${n ? "nc-disabled" : ""} ${
|
|
207
|
-
style:
|
|
206
|
+
className: `nc-checkbox-label ${d ? "nc-small" : ""} ${n ? "nc-disabled" : ""} ${c}`.trim(),
|
|
207
|
+
style: l,
|
|
208
208
|
onClick: (p) => {
|
|
209
209
|
n || (p.preventDefault(), t(!e));
|
|
210
210
|
},
|
|
@@ -228,7 +228,7 @@ function Nn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
230
|
function pt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
231
|
-
const i = H(null), { t:
|
|
231
|
+
const i = H(null), { t: l } = J();
|
|
232
232
|
return T(() => {
|
|
233
233
|
r && i.current && i.current.scrollIntoView({ block: "nearest" });
|
|
234
234
|
}, [r]), /* @__PURE__ */ y(
|
|
@@ -247,7 +247,7 @@ function pt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
|
247
247
|
e.label,
|
|
248
248
|
e.default && /* @__PURE__ */ y("span", { style: { fontSize: "0.85em", color: "var(--nc-text-weak)", marginLeft: 6 }, children: [
|
|
249
249
|
"(",
|
|
250
|
-
|
|
250
|
+
l("common.default"),
|
|
251
251
|
")"
|
|
252
252
|
] })
|
|
253
253
|
]
|
|
@@ -261,22 +261,22 @@ function ft({
|
|
|
261
261
|
selectedValue: r,
|
|
262
262
|
placement: o = "bottom",
|
|
263
263
|
anchorRef: i,
|
|
264
|
-
small:
|
|
265
|
-
highlightedIndex:
|
|
264
|
+
small: l,
|
|
265
|
+
highlightedIndex: c = -1
|
|
266
266
|
}) {
|
|
267
|
-
const [d, p] = R({ top: 0, left: 0, width: 0 }), [
|
|
267
|
+
const [d, p] = R({ top: 0, left: 0, width: 0 }), [h, w] = R(o), { t: a } = J();
|
|
268
268
|
if (T(() => {
|
|
269
269
|
if (e && i.current) {
|
|
270
|
-
const
|
|
270
|
+
const m = i.current.getBoundingClientRect();
|
|
271
271
|
let v = o;
|
|
272
272
|
if (o === "bottom") {
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
const f = window.innerHeight - m.bottom, x = m.top;
|
|
274
|
+
f < 320 && x > f && (v = "top");
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
top: v === "top" ?
|
|
278
|
-
left:
|
|
279
|
-
width:
|
|
276
|
+
w(v), p({
|
|
277
|
+
top: v === "top" ? m.top - 4 : m.bottom + 4,
|
|
278
|
+
left: m.left,
|
|
279
|
+
width: m.width
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
}, [e, i, o]), !e) return null;
|
|
@@ -286,15 +286,15 @@ function ft({
|
|
|
286
286
|
className: "nc-combo-dropdown",
|
|
287
287
|
style: {
|
|
288
288
|
position: "fixed",
|
|
289
|
-
top:
|
|
290
|
-
bottom:
|
|
289
|
+
top: h === "top" ? void 0 : d.top,
|
|
290
|
+
bottom: h === "top" ? window.innerHeight - d.top : void 0,
|
|
291
291
|
left: d.left,
|
|
292
292
|
width: d.width,
|
|
293
293
|
zIndex: 1e3,
|
|
294
294
|
maxHeight: 300,
|
|
295
295
|
overflowY: "auto"
|
|
296
296
|
},
|
|
297
|
-
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${
|
|
297
|
+
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${l ? "nc-small" : ""}`, children: a("common.noResults") }) : t.map((m, v) => /* @__PURE__ */ s(pt, { option: m, onChange: n, selected: m.value === r, highlighted: v === c, small: l }, m.value))
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
return pe(u, document.body);
|
|
@@ -330,38 +330,38 @@ function An({
|
|
|
330
330
|
options: r,
|
|
331
331
|
disabled: o,
|
|
332
332
|
label: i,
|
|
333
|
-
clearable:
|
|
334
|
-
allowTyping:
|
|
333
|
+
clearable: l = !0,
|
|
334
|
+
allowTyping: c = !1,
|
|
335
335
|
placement: d = "bottom",
|
|
336
336
|
size: p = "default",
|
|
337
|
-
style:
|
|
338
|
-
className:
|
|
337
|
+
style: h,
|
|
338
|
+
className: w
|
|
339
339
|
}) {
|
|
340
|
-
const [
|
|
341
|
-
const C =
|
|
342
|
-
return
|
|
343
|
-
}, [r,
|
|
340
|
+
const [a, u] = R(!1), [m, v] = R(""), [f, x] = R(-1), k = H(null), $ = H(null), g = p === "small", { t: I } = J(), P = xe(() => {
|
|
341
|
+
const C = m.toLowerCase();
|
|
342
|
+
return c ? r.filter((z) => z.label.toLowerCase().includes(C)) : r;
|
|
343
|
+
}, [r, m, c]);
|
|
344
344
|
T(() => {
|
|
345
|
-
|
|
346
|
-
}, [
|
|
347
|
-
if (!
|
|
345
|
+
a && x(-1);
|
|
346
|
+
}, [a, P]), T(() => {
|
|
347
|
+
if (!l && !e && r.length > 0 && t) {
|
|
348
348
|
const C = r.find((z) => z.default) || r[0];
|
|
349
349
|
t(C.value);
|
|
350
350
|
}
|
|
351
|
-
}, [
|
|
351
|
+
}, [l, e, r, t]), T(() => {
|
|
352
352
|
function C(z) {
|
|
353
353
|
var B;
|
|
354
354
|
z.target instanceof Node && k.current && ((B = k.current.parentElement) != null && B.contains(z.target) || u(!1));
|
|
355
355
|
}
|
|
356
356
|
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
357
357
|
}, []);
|
|
358
|
-
const
|
|
358
|
+
const b = r.find((C) => C.value === e), S = b && l, N = !o && !S, E = !(a && c) && !!b, D = (C, z = !1) => {
|
|
359
359
|
var B;
|
|
360
360
|
t == null || t(C), u(!1), v(""), z && ((B = k.current) == null || B.blur());
|
|
361
|
-
},
|
|
361
|
+
}, M = () => {
|
|
362
362
|
t == null || t(void 0), v(""), u(!1);
|
|
363
363
|
}, O = (C) => {
|
|
364
|
-
if (!
|
|
364
|
+
if (!a) {
|
|
365
365
|
(C.key === "ArrowDown" || C.key === "ArrowUp") && (u(!0), C.preventDefault());
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
@@ -379,14 +379,14 @@ function An({
|
|
|
379
379
|
});
|
|
380
380
|
break;
|
|
381
381
|
case "Enter":
|
|
382
|
-
C.preventDefault(),
|
|
382
|
+
C.preventDefault(), f >= 0 && f < P.length && D(P[f].value, !0);
|
|
383
383
|
break;
|
|
384
384
|
case "Escape":
|
|
385
385
|
C.preventDefault(), u(!1), v("");
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
return /* @__PURE__ */ y("div", { className: `nc-combo-container ${
|
|
389
|
+
return /* @__PURE__ */ y("div", { className: `nc-combo-container ${w || ""}`.trim(), style: { position: "relative", ...h }, children: [
|
|
390
390
|
i && /* @__PURE__ */ s("span", { className: `nc-label ${g ? "nc-small" : ""}`, children: i }),
|
|
391
391
|
/* @__PURE__ */ y(
|
|
392
392
|
"div",
|
|
@@ -394,7 +394,7 @@ function An({
|
|
|
394
394
|
ref: $,
|
|
395
395
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
396
396
|
onMouseDown: (C) => {
|
|
397
|
-
o ||
|
|
397
|
+
o || c && C.target === k.current || (u((z) => (!z && c && b && v(b.label), !z)), c && !a && setTimeout(() => {
|
|
398
398
|
var z, B;
|
|
399
399
|
(z = k.current) == null || z.focus(), (B = k.current) == null || B.select();
|
|
400
400
|
}, 0));
|
|
@@ -408,21 +408,21 @@ function An({
|
|
|
408
408
|
placeholder: n,
|
|
409
409
|
onFocus: () => {
|
|
410
410
|
var C;
|
|
411
|
-
!o &&
|
|
411
|
+
!o && c && (u(!0), b && (v(b.label), setTimeout(() => {
|
|
412
412
|
var z;
|
|
413
413
|
return (z = k.current) == null ? void 0 : z.select();
|
|
414
|
-
}, 0))),
|
|
414
|
+
}, 0))), c || (C = k.current) == null || C.blur();
|
|
415
415
|
},
|
|
416
|
-
onChange: (C) =>
|
|
416
|
+
onChange: (C) => c && v(C.target.value),
|
|
417
417
|
onKeyDown: O,
|
|
418
|
-
value:
|
|
419
|
-
readOnly: o || !
|
|
418
|
+
value: a && c ? m : (b == null ? void 0 : b.label) || "",
|
|
419
|
+
readOnly: o || !c,
|
|
420
420
|
style: {
|
|
421
421
|
width: "100%",
|
|
422
422
|
paddingRight: N || S ? g ? 32 : 44 : 12,
|
|
423
|
-
caretColor:
|
|
424
|
-
cursor:
|
|
425
|
-
userSelect:
|
|
423
|
+
caretColor: c ? void 0 : "transparent",
|
|
424
|
+
cursor: c ? void 0 : "pointer",
|
|
425
|
+
userSelect: c ? void 0 : "none",
|
|
426
426
|
color: E ? "transparent" : "var(--nc-text)"
|
|
427
427
|
}
|
|
428
428
|
}
|
|
@@ -446,21 +446,21 @@ function An({
|
|
|
446
446
|
textOverflow: "ellipsis"
|
|
447
447
|
},
|
|
448
448
|
children: [
|
|
449
|
-
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${g ? "nc-small" : ""}`, children:
|
|
450
|
-
(
|
|
449
|
+
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${g ? "nc-small" : ""}`, children: b == null ? void 0 : b.label }),
|
|
450
|
+
(b == null ? void 0 : b.default) && /* @__PURE__ */ y("span", { className: `nc-combo-overlay-default ${g ? "nc-small" : ""}`, children: [
|
|
451
451
|
"(",
|
|
452
|
-
|
|
452
|
+
I("common.default"),
|
|
453
453
|
")"
|
|
454
454
|
] })
|
|
455
455
|
]
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
|
-
S && /* @__PURE__ */ s(ht, { onClick:
|
|
459
|
-
N && /* @__PURE__ */ s(mt, { open:
|
|
458
|
+
S && /* @__PURE__ */ s(ht, { onClick: M, small: g }),
|
|
459
|
+
N && /* @__PURE__ */ s(mt, { open: a, onClick: () => u((C) => !C), small: g })
|
|
460
460
|
]
|
|
461
461
|
}
|
|
462
462
|
),
|
|
463
|
-
/* @__PURE__ */ s(ft, { isOpen:
|
|
463
|
+
/* @__PURE__ */ s(ft, { isOpen: a, options: P, onSelect: D, selectedValue: e, placement: d, anchorRef: $, small: g, highlightedIndex: f })
|
|
464
464
|
] });
|
|
465
465
|
}
|
|
466
466
|
function Sn({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default", title: o, "aria-label": i }) {
|
|
@@ -519,7 +519,7 @@ function In({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Del
|
|
|
519
519
|
}
|
|
520
520
|
);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Mn({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label": o, size: i = "default" }) {
|
|
523
523
|
return /* @__PURE__ */ s(
|
|
524
524
|
"button",
|
|
525
525
|
{
|
|
@@ -533,7 +533,7 @@ function $n({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label":
|
|
|
533
533
|
}
|
|
534
534
|
);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function $n({
|
|
537
537
|
open: e,
|
|
538
538
|
onClose: t,
|
|
539
539
|
options: n,
|
|
@@ -541,62 +541,79 @@ function Mn({
|
|
|
541
541
|
anchor: o,
|
|
542
542
|
preferredDirection: i = "down"
|
|
543
543
|
}) {
|
|
544
|
-
const
|
|
544
|
+
const l = H(null), [c, d] = R({ top: 0, left: 0 }), p = o || (r == null ? void 0 : r.current);
|
|
545
545
|
if (T(() => {
|
|
546
|
-
if (!e || !p || !
|
|
547
|
-
const
|
|
548
|
-
let
|
|
549
|
-
(!
|
|
550
|
-
let
|
|
551
|
-
|
|
552
|
-
let
|
|
553
|
-
|
|
554
|
-
top: Math.max(8,
|
|
546
|
+
if (!e || !p || !l.current) return;
|
|
547
|
+
const a = p.getBoundingClientRect(), u = l.current.getBoundingClientRect(), m = window.innerHeight, v = window.innerWidth, f = a.bottom + 8, x = f + u.height <= m - 8;
|
|
548
|
+
let k = i;
|
|
549
|
+
(!x && i === "down" || i === "up" && x) && (k = "up");
|
|
550
|
+
let $;
|
|
551
|
+
k === "down" ? $ = f : $ = a.top - u.height - 8;
|
|
552
|
+
let g = a.left;
|
|
553
|
+
g + u.width > v - 8 && (g = a.right - u.width), d({
|
|
554
|
+
top: Math.max(8, $),
|
|
555
555
|
// Ensure minimum 8px from top
|
|
556
|
-
left: Math.max(8,
|
|
556
|
+
left: Math.max(8, g)
|
|
557
557
|
// Ensure minimum 8px from left
|
|
558
558
|
});
|
|
559
559
|
}, [e, p, i]), T(() => {
|
|
560
560
|
if (!e) return;
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
},
|
|
564
|
-
|
|
561
|
+
const a = (m) => {
|
|
562
|
+
l.current && !l.current.contains(m.target) && p && !p.contains(m.target) && t();
|
|
563
|
+
}, u = (m) => {
|
|
564
|
+
m.key === "Escape" && t();
|
|
565
565
|
};
|
|
566
|
-
return document.addEventListener("mousedown",
|
|
567
|
-
document.removeEventListener("mousedown",
|
|
566
|
+
return document.addEventListener("mousedown", a), document.addEventListener("keydown", u), () => {
|
|
567
|
+
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", u);
|
|
568
568
|
};
|
|
569
569
|
}, [e, t, p]), !e) return null;
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
};
|
|
570
|
+
const h = (a) => {
|
|
571
|
+
a.type !== "separator" && !a.disabled && a.onClick && (a.onClick(), t());
|
|
572
|
+
}, w = n.some((a) => a.icon);
|
|
573
573
|
return pe(
|
|
574
574
|
/* @__PURE__ */ s(
|
|
575
575
|
"div",
|
|
576
576
|
{
|
|
577
|
-
ref:
|
|
577
|
+
ref: l,
|
|
578
578
|
className: "nc-context-menu",
|
|
579
579
|
style: {
|
|
580
580
|
position: "fixed",
|
|
581
|
-
top: `${
|
|
582
|
-
left: `${
|
|
581
|
+
top: `${c.top}px`,
|
|
582
|
+
left: `${c.left}px`,
|
|
583
583
|
zIndex: 1e4
|
|
584
584
|
},
|
|
585
585
|
role: "menu",
|
|
586
|
-
children: n.map((
|
|
587
|
-
"
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
586
|
+
children: n.map((a) => {
|
|
587
|
+
if (a.type === "separator")
|
|
588
|
+
return /* @__PURE__ */ s(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
className: "nc-context-menu-separator",
|
|
592
|
+
role: "separator"
|
|
593
|
+
},
|
|
594
|
+
a.id
|
|
595
|
+
);
|
|
596
|
+
const u = [
|
|
597
|
+
"nc-context-menu-item",
|
|
598
|
+
a.variant && a.variant !== "default" ? `nc-${a.variant}` : "",
|
|
599
|
+
a.disabled ? "nc-disabled" : "",
|
|
600
|
+
w && !a.icon ? "nc-indented" : ""
|
|
601
|
+
].filter(Boolean).join(" ");
|
|
602
|
+
return /* @__PURE__ */ y(
|
|
603
|
+
"button",
|
|
604
|
+
{
|
|
605
|
+
className: u,
|
|
606
|
+
onClick: () => h(a),
|
|
607
|
+
disabled: a.disabled,
|
|
608
|
+
role: "menuitem",
|
|
609
|
+
children: [
|
|
610
|
+
a.icon && /* @__PURE__ */ s("span", { className: "nc-context-menu-icon", children: a.icon }),
|
|
611
|
+
/* @__PURE__ */ s("span", { className: "nc-context-menu-label", children: a.label })
|
|
612
|
+
]
|
|
613
|
+
},
|
|
614
|
+
a.id
|
|
615
|
+
);
|
|
616
|
+
})
|
|
600
617
|
}
|
|
601
618
|
),
|
|
602
619
|
document.body
|
|
@@ -611,8 +628,8 @@ function gt() {
|
|
|
611
628
|
}
|
|
612
629
|
function ne({ children: e, onClick: t, ...n }) {
|
|
613
630
|
const { close: r } = gt(), { t: o } = J();
|
|
614
|
-
return /* @__PURE__ */ s(G, { onClick: (
|
|
615
|
-
t == null || t(
|
|
631
|
+
return /* @__PURE__ */ s(G, { onClick: (l) => {
|
|
632
|
+
t == null || t(l), r();
|
|
616
633
|
}, ...n, children: e ?? o("common.close") });
|
|
617
634
|
}
|
|
618
635
|
function Rn({
|
|
@@ -622,21 +639,21 @@ function Rn({
|
|
|
622
639
|
children: r,
|
|
623
640
|
style: o,
|
|
624
641
|
footerType: i = "ok-cancel",
|
|
625
|
-
footer:
|
|
626
|
-
onOk:
|
|
642
|
+
footer: l,
|
|
643
|
+
onOk: c,
|
|
627
644
|
onSave: d,
|
|
628
645
|
onDelete: p,
|
|
629
|
-
onCancel:
|
|
630
|
-
onConnect:
|
|
631
|
-
closeOnOverlay:
|
|
646
|
+
onCancel: h,
|
|
647
|
+
onConnect: w,
|
|
648
|
+
closeOnOverlay: a = !0,
|
|
632
649
|
primaryDisabled: u = !1,
|
|
633
|
-
fullScreen:
|
|
650
|
+
fullScreen: m = !1,
|
|
634
651
|
hideTitleBar: v = !1,
|
|
635
|
-
className:
|
|
652
|
+
className: f = "",
|
|
636
653
|
onContentHeightChange: x
|
|
637
654
|
}) {
|
|
638
|
-
const k = H(null), $ = H(null), { t: g } = J(),
|
|
639
|
-
|
|
655
|
+
const k = H(null), $ = H(null), { t: g } = J(), I = { close: t }, P = (N) => {
|
|
656
|
+
a && N.target === N.currentTarget && t();
|
|
640
657
|
};
|
|
641
658
|
if (T(() => {
|
|
642
659
|
e && k.current && k.current.focus();
|
|
@@ -644,54 +661,54 @@ function Rn({
|
|
|
644
661
|
if (!x || !$.current) return;
|
|
645
662
|
const N = new ResizeObserver((E) => {
|
|
646
663
|
for (const D of E) {
|
|
647
|
-
const
|
|
648
|
-
x(
|
|
664
|
+
const M = D.contentRect.height;
|
|
665
|
+
x(M);
|
|
649
666
|
}
|
|
650
667
|
});
|
|
651
668
|
return N.observe($.current), () => {
|
|
652
669
|
N.disconnect();
|
|
653
670
|
};
|
|
654
671
|
}, [x]), !e) return null;
|
|
655
|
-
const
|
|
672
|
+
const b = () => {
|
|
656
673
|
switch (i) {
|
|
657
674
|
case "ok":
|
|
658
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(G, { variant: "primary", onClick:
|
|
675
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(G, { variant: "primary", onClick: c ?? t, disabled: u, children: g("common.ok") }) });
|
|
659
676
|
case "ok-cancel":
|
|
660
677
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
661
|
-
/* @__PURE__ */ s(G, { variant: "primary", onClick:
|
|
662
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
678
|
+
/* @__PURE__ */ s(G, { variant: "primary", onClick: c ?? t, disabled: u, children: g("common.ok") }),
|
|
679
|
+
/* @__PURE__ */ s(ne, { onClick: h, children: g("common.cancel") })
|
|
663
680
|
] });
|
|
664
681
|
case "save-cancel":
|
|
665
682
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
666
683
|
/* @__PURE__ */ s(G, { variant: "primary", onClick: d, disabled: u, children: g("common.save") }),
|
|
667
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
684
|
+
/* @__PURE__ */ s(ne, { onClick: h, children: g("common.cancel") })
|
|
668
685
|
] });
|
|
669
686
|
case "delete-cancel":
|
|
670
687
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
671
688
|
/* @__PURE__ */ s(G, { variant: "danger", onClick: p, disabled: u, children: g("common.delete") }),
|
|
672
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
689
|
+
/* @__PURE__ */ s(ne, { onClick: h, children: g("common.cancel") })
|
|
673
690
|
] });
|
|
674
691
|
case "connect":
|
|
675
692
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
676
|
-
/* @__PURE__ */ s(G, { variant: "primary", onClick:
|
|
677
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
693
|
+
/* @__PURE__ */ s(G, { variant: "primary", onClick: w, disabled: u, children: g("common.connect") }),
|
|
694
|
+
/* @__PURE__ */ s(ne, { onClick: h, children: g("common.cancel") })
|
|
678
695
|
] });
|
|
679
696
|
case "close":
|
|
680
697
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary" }) });
|
|
681
698
|
case "gotit":
|
|
682
699
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary", children: g("common.gotit") }) });
|
|
683
700
|
case "custom":
|
|
684
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children:
|
|
701
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: l });
|
|
685
702
|
case "none":
|
|
686
703
|
return null;
|
|
687
704
|
default:
|
|
688
705
|
return null;
|
|
689
706
|
}
|
|
690
|
-
}, S = /* @__PURE__ */ s(De.Provider, { value:
|
|
707
|
+
}, S = /* @__PURE__ */ s(De.Provider, { value: I, children: /* @__PURE__ */ s("div", { className: `nc-dialog-overlay${m ? " nc-fullscreen" : ""}`, onClick: P, children: /* @__PURE__ */ y(
|
|
691
708
|
"div",
|
|
692
709
|
{
|
|
693
710
|
ref: k,
|
|
694
|
-
className: `nc-dialog-container ${
|
|
711
|
+
className: `nc-dialog-container ${f}`,
|
|
695
712
|
style: o,
|
|
696
713
|
tabIndex: -1,
|
|
697
714
|
role: "dialog",
|
|
@@ -703,11 +720,11 @@ function Rn({
|
|
|
703
720
|
/* @__PURE__ */ s(Be, { onClick: t, "aria-label": "Close dialog" })
|
|
704
721
|
] }),
|
|
705
722
|
/* @__PURE__ */ s("div", { ref: $, className: "nc-dialog-content", children: r }),
|
|
706
|
-
|
|
723
|
+
b()
|
|
707
724
|
]
|
|
708
725
|
}
|
|
709
726
|
) }) });
|
|
710
|
-
return
|
|
727
|
+
return m ? pe(S, document.body) : S;
|
|
711
728
|
}
|
|
712
729
|
function bt({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
713
730
|
const r = t === "small" ? 28 : 34;
|
|
@@ -773,39 +790,39 @@ function En({
|
|
|
773
790
|
onEnter: r,
|
|
774
791
|
onClear: o,
|
|
775
792
|
placeholder: i,
|
|
776
|
-
disabled:
|
|
777
|
-
label:
|
|
793
|
+
disabled: l,
|
|
794
|
+
label: c,
|
|
778
795
|
clearable: d = !0,
|
|
779
796
|
type: p = "text",
|
|
780
|
-
className:
|
|
781
|
-
size:
|
|
782
|
-
style:
|
|
797
|
+
className: h = "",
|
|
798
|
+
size: w = "default",
|
|
799
|
+
style: a,
|
|
783
800
|
showPasswordToggle: u = !1,
|
|
784
|
-
multiline:
|
|
801
|
+
multiline: m = !1,
|
|
785
802
|
rows: v = 3,
|
|
786
|
-
validator:
|
|
803
|
+
validator: f,
|
|
787
804
|
showErrorMessage: x = !0
|
|
788
805
|
}) {
|
|
789
|
-
const k = H(null), $ = H(null), [g,
|
|
806
|
+
const k = H(null), $ = H(null), [g, I] = R(!1), [P, b] = R(!1), S = e !== void 0, [N, E] = R(t), D = S ? e : N, M = f ? f(D) : null, O = !!M, C = p === "password", z = C && u && !l && !m, B = d && D && !l && P, ee = w === "small" ? 32 : 44;
|
|
790
807
|
let K = 12;
|
|
791
808
|
B && z ? K = ee * 2 : (B || z) && (K = ee);
|
|
792
809
|
const Q = () => {
|
|
793
810
|
var te, ce;
|
|
794
|
-
S || E(""), n == null || n(""), o == null || o(),
|
|
811
|
+
S || E(""), n == null || n(""), o == null || o(), m ? (te = $.current) == null || te.focus() : (ce = k.current) == null || ce.focus();
|
|
795
812
|
}, ae = (te) => {
|
|
796
|
-
te.key === "Enter" && !
|
|
813
|
+
te.key === "Enter" && !m && (r == null || r());
|
|
797
814
|
}, V = (te) => {
|
|
798
815
|
const ce = te.target.value;
|
|
799
816
|
S || E(ce), n == null || n(ce);
|
|
800
817
|
}, Se = () => {
|
|
801
|
-
|
|
818
|
+
b(!0);
|
|
802
819
|
}, Ce = () => {
|
|
803
|
-
|
|
804
|
-
}, Ie = `nc-input ${
|
|
805
|
-
return /* @__PURE__ */ y("div", { className: "nc-col", style: { position: "relative", flex: 1, ...
|
|
806
|
-
|
|
807
|
-
/* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems:
|
|
808
|
-
|
|
820
|
+
b(!1);
|
|
821
|
+
}, Ie = `nc-input ${w === "small" ? "nc-small " : ""} ${O ? "nc-error " : ""}${h}`;
|
|
822
|
+
return /* @__PURE__ */ y("div", { className: "nc-col", style: { position: "relative", flex: 1, ...a }, children: [
|
|
823
|
+
c && /* @__PURE__ */ s("span", { className: "nc-label", children: c }),
|
|
824
|
+
/* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems: m ? "flex-start" : "center" }, children: [
|
|
825
|
+
m ? /* @__PURE__ */ s(
|
|
809
826
|
"textarea",
|
|
810
827
|
{
|
|
811
828
|
ref: $,
|
|
@@ -816,12 +833,11 @@ function En({
|
|
|
816
833
|
onKeyDown: ae,
|
|
817
834
|
onFocus: Se,
|
|
818
835
|
onBlur: Ce,
|
|
819
|
-
disabled:
|
|
836
|
+
disabled: l,
|
|
820
837
|
rows: v,
|
|
821
838
|
style: {
|
|
822
839
|
width: "100%",
|
|
823
|
-
paddingRight: K
|
|
824
|
-
resize: "vertical"
|
|
840
|
+
paddingRight: K
|
|
825
841
|
}
|
|
826
842
|
}
|
|
827
843
|
) : /* @__PURE__ */ s(
|
|
@@ -836,17 +852,17 @@ function En({
|
|
|
836
852
|
onKeyDown: ae,
|
|
837
853
|
onFocus: Se,
|
|
838
854
|
onBlur: Ce,
|
|
839
|
-
disabled:
|
|
855
|
+
disabled: l,
|
|
840
856
|
style: {
|
|
841
857
|
width: "100%",
|
|
842
858
|
paddingRight: K
|
|
843
859
|
}
|
|
844
860
|
}
|
|
845
861
|
),
|
|
846
|
-
B && /* @__PURE__ */ s(bt, { onClick: Q, size:
|
|
847
|
-
z && /* @__PURE__ */ s(vt, { visible: g, onClick: () =>
|
|
862
|
+
B && /* @__PURE__ */ s(bt, { onClick: Q, size: w, rightOffset: z ? ee + 4 : 4 }),
|
|
863
|
+
z && /* @__PURE__ */ s(vt, { visible: g, onClick: () => I(!g), size: w })
|
|
848
864
|
] }),
|
|
849
|
-
O && x && /* @__PURE__ */ s("span", { className: "nc-error-message", children:
|
|
865
|
+
O && x && /* @__PURE__ */ s("span", { className: "nc-error-message", children: M })
|
|
850
866
|
] });
|
|
851
867
|
}
|
|
852
868
|
function zn({
|
|
@@ -856,7 +872,7 @@ function zn({
|
|
|
856
872
|
selectable: r = !1,
|
|
857
873
|
style: o
|
|
858
874
|
}) {
|
|
859
|
-
const [i,
|
|
875
|
+
const [i, l] = ye.useState(!1);
|
|
860
876
|
return /* @__PURE__ */ s(
|
|
861
877
|
"div",
|
|
862
878
|
{
|
|
@@ -870,9 +886,9 @@ function zn({
|
|
|
870
886
|
t(d);
|
|
871
887
|
}
|
|
872
888
|
},
|
|
873
|
-
onMouseDown: () => t &&
|
|
874
|
-
onMouseUp: () =>
|
|
875
|
-
onMouseLeave: () =>
|
|
889
|
+
onMouseDown: () => t && l(!0),
|
|
890
|
+
onMouseUp: () => l(!1),
|
|
891
|
+
onMouseLeave: () => l(!1),
|
|
876
892
|
style: {
|
|
877
893
|
cursor: t ? "pointer" : "default",
|
|
878
894
|
userSelect: r ? "text" : void 0,
|
|
@@ -900,22 +916,22 @@ function Pn({ title: e, titleTools: t, children: n, style: r }) {
|
|
|
900
916
|
] });
|
|
901
917
|
}
|
|
902
918
|
function Ln({ values: e, onChange: t, options: n, placeholder: r = "Select…", label: o }) {
|
|
903
|
-
const [i,
|
|
919
|
+
const [i, l] = R(!1), [c, d] = R(""), p = H(null), h = xe(() => n.filter((a) => a.label.toLowerCase().includes(c.toLowerCase())), [n, c]);
|
|
904
920
|
T(() => {
|
|
905
|
-
function
|
|
906
|
-
!(u.target instanceof Node) || !p.current || p.current.contains(u.target) ||
|
|
921
|
+
function a(u) {
|
|
922
|
+
!(u.target instanceof Node) || !p.current || p.current.contains(u.target) || l(!1);
|
|
907
923
|
}
|
|
908
|
-
return document.addEventListener("mousedown",
|
|
924
|
+
return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
|
|
909
925
|
}, []);
|
|
910
|
-
const
|
|
911
|
-
e.includes(
|
|
926
|
+
const w = (a) => {
|
|
927
|
+
e.includes(a) ? t(e.filter((u) => u !== a)) : t([...e, a]);
|
|
912
928
|
};
|
|
913
929
|
return /* @__PURE__ */ y("div", { ref: p, className: "nc-col", style: { position: "relative" }, children: [
|
|
914
930
|
o && /* @__PURE__ */ s("span", { className: "nc-label", children: o }),
|
|
915
931
|
/* @__PURE__ */ y("div", { className: "nc-row", style: { flexWrap: "wrap", gap: 6, minHeight: 42, alignItems: "center", border: "1px solid var(--nc-button-border)", borderRadius: 8, background: "var(--nc-button-bg)", padding: "4px 8px" }, children: [
|
|
916
932
|
e.length === 0 && /* @__PURE__ */ s("span", { className: "nc-label", children: r }),
|
|
917
|
-
e.map((
|
|
918
|
-
const u = n.find((
|
|
933
|
+
e.map((a) => {
|
|
934
|
+
const u = n.find((m) => m.value === a);
|
|
919
935
|
return u ? /* @__PURE__ */ y("span", { style: { padding: "4px 8px", borderRadius: 6, display: "inline-flex", alignItems: "center", gap: 4, background: "var(--nc-button-bg)", border: "1px solid var(--nc-button-border)" }, children: [
|
|
920
936
|
u.label,
|
|
921
937
|
/* @__PURE__ */ s(
|
|
@@ -923,33 +939,33 @@ function Ln({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
923
939
|
{
|
|
924
940
|
className: "nc-button nc-ghost",
|
|
925
941
|
style: { padding: 0, minHeight: 0, height: 20, width: 20, display: "inline-flex", alignItems: "center", justifyContent: "center", border: "none" },
|
|
926
|
-
onClick: () =>
|
|
942
|
+
onClick: () => w(a),
|
|
927
943
|
"aria-label": `Remove ${u.label}`,
|
|
928
944
|
children: "✕"
|
|
929
945
|
}
|
|
930
946
|
)
|
|
931
|
-
] },
|
|
947
|
+
] }, a) : null;
|
|
932
948
|
}),
|
|
933
949
|
/* @__PURE__ */ s(
|
|
934
950
|
"input",
|
|
935
951
|
{
|
|
936
952
|
className: "nc-input",
|
|
937
|
-
value:
|
|
938
|
-
onChange: (
|
|
939
|
-
onFocus: () =>
|
|
953
|
+
value: c,
|
|
954
|
+
onChange: (a) => d(a.target.value),
|
|
955
|
+
onFocus: () => l(!0),
|
|
940
956
|
style: { minWidth: 50, border: "none", background: "transparent", padding: 4, minHeight: 32, flex: 1 }
|
|
941
957
|
}
|
|
942
958
|
)
|
|
943
959
|
] }),
|
|
944
960
|
i && /* @__PURE__ */ y("div", { className: "nc-combo-dropdown", style: { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 10, marginTop: 4, boxShadow: "0 4px 12px var(--nc-shadow)" }, children: [
|
|
945
|
-
|
|
946
|
-
const u = e.includes(
|
|
947
|
-
return /* @__PURE__ */ y("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () =>
|
|
948
|
-
/* @__PURE__ */ s("span", { children:
|
|
961
|
+
h.map((a) => {
|
|
962
|
+
const u = e.includes(a.value);
|
|
963
|
+
return /* @__PURE__ */ y("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () => w(a.value), children: [
|
|
964
|
+
/* @__PURE__ */ s("span", { children: a.label }),
|
|
949
965
|
/* @__PURE__ */ s("span", { children: u ? "✔️" : "" })
|
|
950
|
-
] },
|
|
966
|
+
] }, a.value);
|
|
951
967
|
}),
|
|
952
|
-
|
|
968
|
+
h.length === 0 && /* @__PURE__ */ s("div", { className: "nc-section nc-label", children: "No results" })
|
|
953
969
|
] })
|
|
954
970
|
] });
|
|
955
971
|
}
|
|
@@ -973,14 +989,14 @@ function ue(e) {
|
|
|
973
989
|
}
|
|
974
990
|
return `${n}-${r}`;
|
|
975
991
|
}
|
|
976
|
-
function
|
|
992
|
+
function Me(e) {
|
|
977
993
|
if (!e) return "";
|
|
978
994
|
const t = ue(e);
|
|
979
995
|
if (!/^\d{4}-\d{2}$/.test(t)) return e;
|
|
980
996
|
const [n, r] = t.split("-");
|
|
981
997
|
return `${n}/${r}`;
|
|
982
998
|
}
|
|
983
|
-
function
|
|
999
|
+
function $e() {
|
|
984
1000
|
const e = /* @__PURE__ */ new Date(), t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0");
|
|
985
1001
|
return `${t}-${n}`;
|
|
986
1002
|
}
|
|
@@ -992,34 +1008,34 @@ function Tn({
|
|
|
992
1008
|
className: o = "",
|
|
993
1009
|
disabled: i = !1
|
|
994
1010
|
}) {
|
|
995
|
-
const [
|
|
1011
|
+
const [l, c] = R(!1), [d, p] = R(""), [h, w] = R(""), [a, u] = R({ top: 0, left: 0, width: 0 }), m = H(null), v = H(null);
|
|
996
1012
|
T(() => {
|
|
997
|
-
if (
|
|
998
|
-
const E =
|
|
1013
|
+
if (l && m.current) {
|
|
1014
|
+
const E = m.current.getBoundingClientRect();
|
|
999
1015
|
u({
|
|
1000
1016
|
top: E.bottom + 4,
|
|
1001
1017
|
left: E.left,
|
|
1002
1018
|
width: E.width
|
|
1003
1019
|
});
|
|
1004
1020
|
}
|
|
1005
|
-
}, [
|
|
1006
|
-
if (!
|
|
1021
|
+
}, [l]), T(() => {
|
|
1022
|
+
if (!l) return;
|
|
1007
1023
|
const E = (D) => {
|
|
1008
|
-
|
|
1024
|
+
m.current && !m.current.contains(D.target) && v.current && !v.current.contains(D.target) && c(!1);
|
|
1009
1025
|
};
|
|
1010
1026
|
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
1011
|
-
}, [
|
|
1012
|
-
const
|
|
1013
|
-
p(e ||
|
|
1027
|
+
}, [l]);
|
|
1028
|
+
const f = () => {
|
|
1029
|
+
p(e || $e()), w(t || $e()), c(!0);
|
|
1014
1030
|
}, x = () => {
|
|
1015
|
-
|
|
1031
|
+
c(!1);
|
|
1016
1032
|
}, k = () => {
|
|
1017
|
-
const E = fe(d), D = fe(
|
|
1033
|
+
const E = fe(d), D = fe(h);
|
|
1018
1034
|
if (E || D)
|
|
1019
1035
|
return;
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
}, $ = e && t ? `${
|
|
1036
|
+
const M = ue(d), O = ue(h);
|
|
1037
|
+
M && O && (n == null || n(M, O)), c(!1);
|
|
1038
|
+
}, $ = e && t ? `${Me(e)} - ${Me(t)}` : "Select month range", g = fe(d), I = fe(h), P = ue(d), b = ue(h), S = P && b && P > b, N = l ? pe(
|
|
1023
1039
|
/* @__PURE__ */ s(
|
|
1024
1040
|
"div",
|
|
1025
1041
|
{
|
|
@@ -1027,9 +1043,9 @@ function Tn({
|
|
|
1027
1043
|
className: "nc-month-range-picker-popup",
|
|
1028
1044
|
style: {
|
|
1029
1045
|
position: "fixed",
|
|
1030
|
-
top:
|
|
1031
|
-
left:
|
|
1032
|
-
width: Math.max(
|
|
1046
|
+
top: a.top,
|
|
1047
|
+
left: a.left,
|
|
1048
|
+
width: Math.max(a.width, 400),
|
|
1033
1049
|
zIndex: 1e3
|
|
1034
1050
|
},
|
|
1035
1051
|
children: /* @__PURE__ */ y("div", { className: "nc-month-range-picker-content", children: [
|
|
@@ -1054,23 +1070,23 @@ function Tn({
|
|
|
1054
1070
|
"input",
|
|
1055
1071
|
{
|
|
1056
1072
|
type: "text",
|
|
1057
|
-
className: `nc-month-input ${
|
|
1058
|
-
value:
|
|
1059
|
-
onChange: (E) =>
|
|
1073
|
+
className: `nc-month-input ${I ? "nc-error" : ""}`,
|
|
1074
|
+
value: h,
|
|
1075
|
+
onChange: (E) => w(E.target.value),
|
|
1060
1076
|
placeholder: "YY-M(M) or YYYY-M(M)"
|
|
1061
1077
|
}
|
|
1062
1078
|
),
|
|
1063
|
-
|
|
1079
|
+
I && /* @__PURE__ */ s("div", { className: "nc-month-error-text", children: I })
|
|
1064
1080
|
] })
|
|
1065
1081
|
] }),
|
|
1066
|
-
S && !g && !
|
|
1082
|
+
S && !g && !I && /* @__PURE__ */ s("div", { className: "nc-month-range-error", children: "End month must be after or equal to start month" }),
|
|
1067
1083
|
/* @__PURE__ */ y("div", { className: "nc-month-range-picker-footer", children: [
|
|
1068
1084
|
/* @__PURE__ */ s(
|
|
1069
1085
|
G,
|
|
1070
1086
|
{
|
|
1071
1087
|
variant: "primary",
|
|
1072
1088
|
onClick: k,
|
|
1073
|
-
disabled: !d || !
|
|
1089
|
+
disabled: !d || !h || !!g || !!I || !!S,
|
|
1074
1090
|
children: "Apply"
|
|
1075
1091
|
}
|
|
1076
1092
|
),
|
|
@@ -1086,9 +1102,9 @@ function Tn({
|
|
|
1086
1102
|
/* @__PURE__ */ s(
|
|
1087
1103
|
"button",
|
|
1088
1104
|
{
|
|
1089
|
-
ref:
|
|
1105
|
+
ref: m,
|
|
1090
1106
|
className: "nc-month-range-picker-input",
|
|
1091
|
-
onClick:
|
|
1107
|
+
onClick: f,
|
|
1092
1108
|
disabled: i,
|
|
1093
1109
|
children: $
|
|
1094
1110
|
}
|
|
@@ -1096,13 +1112,13 @@ function Tn({
|
|
|
1096
1112
|
N
|
|
1097
1113
|
] });
|
|
1098
1114
|
}
|
|
1099
|
-
function Bn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disabled:
|
|
1100
|
-
const d =
|
|
1101
|
-
const
|
|
1102
|
-
n !== void 0 &&
|
|
1103
|
-
},
|
|
1104
|
-
const
|
|
1105
|
-
r !== void 0 &&
|
|
1115
|
+
function Bn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disabled: l, size: c = "default" }) {
|
|
1116
|
+
const d = c === "small", p = () => {
|
|
1117
|
+
const a = e - o;
|
|
1118
|
+
n !== void 0 && a < n || t(parseFloat(a.toFixed(10)));
|
|
1119
|
+
}, h = () => {
|
|
1120
|
+
const a = e + o;
|
|
1121
|
+
r !== void 0 && a > r || t(parseFloat(a.toFixed(10)));
|
|
1106
1122
|
};
|
|
1107
1123
|
return /* @__PURE__ */ y("div", { className: `nc-col nc-number-input-col ${d ? "nc-small" : ""}`, children: [
|
|
1108
1124
|
i && /* @__PURE__ */ s("span", { className: `nc-label ${d ? "nc-small" : ""}`, children: i }),
|
|
@@ -1113,14 +1129,14 @@ function Bn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1113
1129
|
className: `nc-input nc-number-input ${d ? "nc-small" : ""}`,
|
|
1114
1130
|
type: "number",
|
|
1115
1131
|
value: e,
|
|
1116
|
-
onChange: (
|
|
1117
|
-
const u = parseFloat(
|
|
1132
|
+
onChange: (a) => {
|
|
1133
|
+
const u = parseFloat(a.target.value);
|
|
1118
1134
|
isNaN(u) || n !== void 0 && u < n || r !== void 0 && u > r || t(u);
|
|
1119
1135
|
},
|
|
1120
1136
|
min: n,
|
|
1121
1137
|
max: r,
|
|
1122
1138
|
step: o,
|
|
1123
|
-
disabled:
|
|
1139
|
+
disabled: l
|
|
1124
1140
|
}
|
|
1125
1141
|
),
|
|
1126
1142
|
/* @__PURE__ */ s(
|
|
@@ -1128,7 +1144,7 @@ function Bn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1128
1144
|
{
|
|
1129
1145
|
className: `nc-button nc-ghost nc-number-input-button ${d ? "nc-small" : ""}`,
|
|
1130
1146
|
onClick: p,
|
|
1131
|
-
disabled:
|
|
1147
|
+
disabled: l || n !== void 0 && e <= n,
|
|
1132
1148
|
children: "−"
|
|
1133
1149
|
}
|
|
1134
1150
|
),
|
|
@@ -1136,8 +1152,8 @@ function Bn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1136
1152
|
"button",
|
|
1137
1153
|
{
|
|
1138
1154
|
className: `nc-button nc-ghost nc-number-input-button ${d ? "nc-small" : ""}`,
|
|
1139
|
-
onClick:
|
|
1140
|
-
disabled:
|
|
1155
|
+
onClick: h,
|
|
1156
|
+
disabled: l || r !== void 0 && e >= r,
|
|
1141
1157
|
children: "+"
|
|
1142
1158
|
}
|
|
1143
1159
|
)
|
|
@@ -1151,15 +1167,15 @@ function Dn({
|
|
|
1151
1167
|
max: r = 100,
|
|
1152
1168
|
step: o = 1,
|
|
1153
1169
|
label: i,
|
|
1154
|
-
disabled:
|
|
1155
|
-
showValue:
|
|
1156
|
-
formatValue: d = (
|
|
1170
|
+
disabled: l,
|
|
1171
|
+
showValue: c = !0,
|
|
1172
|
+
formatValue: d = (h) => h.toString(),
|
|
1157
1173
|
width: p = 200
|
|
1158
1174
|
}) {
|
|
1159
|
-
const
|
|
1160
|
-
const u = parseFloat(
|
|
1175
|
+
const h = (a) => {
|
|
1176
|
+
const u = parseFloat(a.target.value);
|
|
1161
1177
|
t(u);
|
|
1162
|
-
},
|
|
1178
|
+
}, w = (e - n) / (r - n) * 100;
|
|
1163
1179
|
return /* @__PURE__ */ y("div", { className: "nc-col", style: { gap: 6 }, children: [
|
|
1164
1180
|
i && /* @__PURE__ */ s("span", { className: "nc-label", children: i }),
|
|
1165
1181
|
/* @__PURE__ */ y("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
|
|
@@ -1169,18 +1185,18 @@ function Dn({
|
|
|
1169
1185
|
type: "range",
|
|
1170
1186
|
className: "nc-slider",
|
|
1171
1187
|
value: e,
|
|
1172
|
-
onChange:
|
|
1188
|
+
onChange: h,
|
|
1173
1189
|
min: n,
|
|
1174
1190
|
max: r,
|
|
1175
1191
|
step: o,
|
|
1176
|
-
disabled:
|
|
1192
|
+
disabled: l,
|
|
1177
1193
|
style: {
|
|
1178
1194
|
width: p,
|
|
1179
|
-
"--nc-slider-percentage": `${
|
|
1195
|
+
"--nc-slider-percentage": `${w}%`
|
|
1180
1196
|
}
|
|
1181
1197
|
}
|
|
1182
1198
|
),
|
|
1183
|
-
|
|
1199
|
+
c && /* @__PURE__ */ s(
|
|
1184
1200
|
"span",
|
|
1185
1201
|
{
|
|
1186
1202
|
style: {
|
|
@@ -1202,68 +1218,68 @@ function yt({ children: e, className: t = "", style: n }) {
|
|
|
1202
1218
|
}
|
|
1203
1219
|
function Hn({ active: e, children: t, keepMounted: n = !1, className: r = "", style: o }) {
|
|
1204
1220
|
const i = Qe.toArray(t).filter(
|
|
1205
|
-
(
|
|
1221
|
+
(c) => Ze(c) && (c.type === yt || c.type.displayName === "TabPanel")
|
|
1206
1222
|
);
|
|
1207
1223
|
if (n)
|
|
1208
|
-
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: i.map((
|
|
1209
|
-
const d =
|
|
1224
|
+
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: i.map((c) => {
|
|
1225
|
+
const d = c.props.tab === e;
|
|
1210
1226
|
return /* @__PURE__ */ s(
|
|
1211
1227
|
"div",
|
|
1212
1228
|
{
|
|
1213
1229
|
className: `nc-tab-panel-wrapper ${d ? "nc-active" : ""}`,
|
|
1214
|
-
style: { display: d ?
|
|
1230
|
+
style: { display: d ? void 0 : "none" },
|
|
1215
1231
|
"aria-hidden": !d,
|
|
1216
|
-
children:
|
|
1232
|
+
children: c
|
|
1217
1233
|
},
|
|
1218
|
-
|
|
1234
|
+
c.props.tab
|
|
1219
1235
|
);
|
|
1220
1236
|
}) });
|
|
1221
|
-
const
|
|
1222
|
-
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children:
|
|
1237
|
+
const l = i.find((c) => c.props.tab === e);
|
|
1238
|
+
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: l });
|
|
1223
1239
|
}
|
|
1224
|
-
function Wn({ tabs: e, active: t, onChange: n, className: r, toolbar: o, multiline: i, orientation:
|
|
1225
|
-
const d = H(null), [p,
|
|
1240
|
+
function Wn({ tabs: e, active: t, onChange: n, className: r, toolbar: o, multiline: i, orientation: l = "horizontal", style: c }) {
|
|
1241
|
+
const d = H(null), [p, h] = R(!1), [w, a] = R(!1), u = l === "verticalLeft" || l === "verticalRight", m = H(!1), v = H(0), f = H(0), x = H(!1);
|
|
1226
1242
|
T(() => {
|
|
1227
|
-
const
|
|
1243
|
+
const b = () => {
|
|
1228
1244
|
if (d.current)
|
|
1229
1245
|
if (u) {
|
|
1230
1246
|
const { scrollTop: N, scrollHeight: E, clientHeight: D } = d.current;
|
|
1231
|
-
|
|
1247
|
+
h(N > 1), a(N < E - D - 1);
|
|
1232
1248
|
} else {
|
|
1233
1249
|
const { scrollLeft: N, scrollWidth: E, clientWidth: D } = d.current;
|
|
1234
|
-
|
|
1250
|
+
h(N > 1), a(N < E - D - 1);
|
|
1235
1251
|
}
|
|
1236
1252
|
}, S = d.current;
|
|
1237
1253
|
if (S)
|
|
1238
|
-
return
|
|
1239
|
-
S.removeEventListener("scroll",
|
|
1254
|
+
return b(), S.addEventListener("scroll", b), window.addEventListener("resize", b), () => {
|
|
1255
|
+
S.removeEventListener("scroll", b), window.removeEventListener("resize", b);
|
|
1240
1256
|
};
|
|
1241
1257
|
}, [e, u]);
|
|
1242
|
-
const k = (
|
|
1243
|
-
d.current && (
|
|
1244
|
-
}, $ = (
|
|
1245
|
-
if (!
|
|
1246
|
-
const S = u ?
|
|
1247
|
-
Math.abs(N) > 3 && (x.current = !0), u ? d.current.scrollTop =
|
|
1258
|
+
const k = (b) => {
|
|
1259
|
+
d.current && (m.current = !0, x.current = !1, v.current = u ? b.clientY : b.clientX, f.current = u ? d.current.scrollTop : d.current.scrollLeft, d.current.style.cursor = "grabbing", d.current.style.userSelect = "none");
|
|
1260
|
+
}, $ = (b) => {
|
|
1261
|
+
if (!m.current || !d.current) return;
|
|
1262
|
+
const S = u ? b.clientY : b.clientX, N = v.current - S;
|
|
1263
|
+
Math.abs(N) > 3 && (x.current = !0), u ? d.current.scrollTop = f.current + N : d.current.scrollLeft = f.current + N;
|
|
1248
1264
|
}, g = () => {
|
|
1249
|
-
d.current && (
|
|
1250
|
-
},
|
|
1265
|
+
d.current && (m.current = !1, d.current.style.cursor = "", d.current.style.userSelect = "");
|
|
1266
|
+
}, I = () => {
|
|
1251
1267
|
g();
|
|
1252
1268
|
};
|
|
1253
1269
|
T(() => {
|
|
1254
|
-
const
|
|
1255
|
-
if (!
|
|
1270
|
+
const b = d.current;
|
|
1271
|
+
if (!b || u) return;
|
|
1256
1272
|
const S = (N) => {
|
|
1257
|
-
N.deltaY !== 0 && (N.preventDefault(),
|
|
1273
|
+
N.deltaY !== 0 && (N.preventDefault(), b.scrollLeft += N.deltaY * 0.3);
|
|
1258
1274
|
};
|
|
1259
|
-
return
|
|
1260
|
-
|
|
1275
|
+
return b.addEventListener("wheel", S, { passive: !1 }), () => {
|
|
1276
|
+
b.removeEventListener("wheel", S);
|
|
1261
1277
|
};
|
|
1262
1278
|
}, [u]);
|
|
1263
|
-
const P = (
|
|
1264
|
-
x.current || n(
|
|
1279
|
+
const P = (b) => {
|
|
1280
|
+
x.current || n(b);
|
|
1265
1281
|
};
|
|
1266
|
-
return /* @__PURE__ */ y("div", { className: `nc-tab-container ${u ? `nc-vertical nc-${
|
|
1282
|
+
return /* @__PURE__ */ y("div", { className: `nc-tab-container ${u ? `nc-vertical nc-${l}` : ""} ${r || ""}`, style: c, children: [
|
|
1267
1283
|
/* @__PURE__ */ y("div", { className: "nc-tab-scroll-wrapper", children: [
|
|
1268
1284
|
p && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${u ? "nc-top" : "nc-left"}`, children: u ? /* @__PURE__ */ s(wt, { size: 16 }) : /* @__PURE__ */ s(it, { size: 16 }) }),
|
|
1269
1285
|
/* @__PURE__ */ s(
|
|
@@ -1274,25 +1290,25 @@ function Wn({ tabs: e, active: t, onChange: n, className: r, toolbar: o, multili
|
|
|
1274
1290
|
onMouseDown: k,
|
|
1275
1291
|
onMouseMove: $,
|
|
1276
1292
|
onMouseUp: g,
|
|
1277
|
-
onMouseLeave:
|
|
1293
|
+
onMouseLeave: I,
|
|
1278
1294
|
style: { cursor: "grab" },
|
|
1279
|
-
children: e.map((
|
|
1295
|
+
children: e.map((b) => /* @__PURE__ */ s(
|
|
1280
1296
|
"div",
|
|
1281
1297
|
{
|
|
1282
|
-
className: `nc-tab-item ${t ===
|
|
1283
|
-
onClick: () => P(
|
|
1298
|
+
className: `nc-tab-item ${t === b ? "nc-active" : ""}`,
|
|
1299
|
+
onClick: () => P(b),
|
|
1284
1300
|
role: "button",
|
|
1285
1301
|
tabIndex: 0,
|
|
1286
1302
|
onKeyDown: (S) => {
|
|
1287
|
-
(S.key === "Enter" || S.key === " ") && n(
|
|
1303
|
+
(S.key === "Enter" || S.key === " ") && n(b);
|
|
1288
1304
|
},
|
|
1289
|
-
children: u ?
|
|
1305
|
+
children: u ? b : b.toUpperCase()
|
|
1290
1306
|
},
|
|
1291
|
-
|
|
1307
|
+
b
|
|
1292
1308
|
))
|
|
1293
1309
|
}
|
|
1294
1310
|
),
|
|
1295
|
-
|
|
1311
|
+
w && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${u ? "nc-bottom" : "nc-right"}`, children: u ? /* @__PURE__ */ s(at, { size: 16 }) : /* @__PURE__ */ s(ct, { size: 16 }) })
|
|
1296
1312
|
] }),
|
|
1297
1313
|
o && /* @__PURE__ */ s("div", { className: "nc-tab-toolbar", children: o })
|
|
1298
1314
|
] });
|
|
@@ -1427,23 +1443,23 @@ function Nt({ notification: e }) {
|
|
|
1427
1443
|
);
|
|
1428
1444
|
}
|
|
1429
1445
|
function Fn() {
|
|
1430
|
-
const [e, t] = R([]), [n, r] = R(/* @__PURE__ */ new Map()), [o, i] = R(/* @__PURE__ */ new Set()),
|
|
1446
|
+
const [e, t] = R([]), [n, r] = R(/* @__PURE__ */ new Map()), [o, i] = R(/* @__PURE__ */ new Set()), l = H(null), c = H([]);
|
|
1431
1447
|
return T(() => xt((p) => {
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1448
|
+
const h = new Set(c.current.map((a) => a.id)), w = p.filter((a) => !h.has(a.id)).map((a) => a.id);
|
|
1449
|
+
w.length > 0 ? (t(p), i(new Set(w)), requestAnimationFrame(() => {
|
|
1434
1450
|
requestAnimationFrame(() => {
|
|
1435
1451
|
i(/* @__PURE__ */ new Set());
|
|
1436
1452
|
});
|
|
1437
|
-
})) : t(p),
|
|
1453
|
+
})) : t(p), c.current = p;
|
|
1438
1454
|
}), []), T(() => {
|
|
1439
|
-
if (!
|
|
1455
|
+
if (!l.current) return;
|
|
1440
1456
|
const d = /* @__PURE__ */ new Map();
|
|
1441
1457
|
let p = 0;
|
|
1442
|
-
const
|
|
1443
|
-
e.forEach((
|
|
1444
|
-
if (d.set(
|
|
1445
|
-
const u =
|
|
1446
|
-
|
|
1458
|
+
const h = l.current.children;
|
|
1459
|
+
e.forEach((w, a) => {
|
|
1460
|
+
if (d.set(w.id, p), h[a]) {
|
|
1461
|
+
const u = h[a].offsetHeight;
|
|
1462
|
+
w.isRemoving || (p += u + 12);
|
|
1447
1463
|
}
|
|
1448
1464
|
}), r(d);
|
|
1449
1465
|
}, [e]), /* @__PURE__ */ s(
|
|
@@ -1459,13 +1475,13 @@ function Fn() {
|
|
|
1459
1475
|
children: /* @__PURE__ */ s(
|
|
1460
1476
|
"div",
|
|
1461
1477
|
{
|
|
1462
|
-
ref:
|
|
1478
|
+
ref: l,
|
|
1463
1479
|
style: {
|
|
1464
1480
|
pointerEvents: "auto",
|
|
1465
1481
|
position: "relative"
|
|
1466
1482
|
},
|
|
1467
1483
|
children: e.map((d) => {
|
|
1468
|
-
const p = o.has(d.id),
|
|
1484
|
+
const p = o.has(d.id), h = d.isRemoving, w = n.get(d.id) || 0;
|
|
1469
1485
|
return /* @__PURE__ */ s(
|
|
1470
1486
|
"div",
|
|
1471
1487
|
{
|
|
@@ -1473,10 +1489,10 @@ function Fn() {
|
|
|
1473
1489
|
position: "absolute",
|
|
1474
1490
|
top: 0,
|
|
1475
1491
|
left: 0,
|
|
1476
|
-
transform: p ? "translateY(-120px)" : `translateY(${
|
|
1492
|
+
transform: p ? "translateY(-120px)" : `translateY(${w}px)`,
|
|
1477
1493
|
// Only animate transform when not leaving, animate opacity always
|
|
1478
|
-
transition:
|
|
1479
|
-
opacity:
|
|
1494
|
+
transition: h ? "opacity 300ms ease-out" : "transform 300ms ease-out, opacity 300ms ease-out",
|
|
1495
|
+
opacity: h ? 0 : 1,
|
|
1480
1496
|
width: "100%"
|
|
1481
1497
|
},
|
|
1482
1498
|
children: /* @__PURE__ */ s(Nt, { notification: d })
|
|
@@ -1506,10 +1522,10 @@ function Yn(e) {
|
|
|
1506
1522
|
// React already escapes by default
|
|
1507
1523
|
}
|
|
1508
1524
|
}), typeof MutationObserver < "u" && typeof document < "u" && new MutationObserver((i) => {
|
|
1509
|
-
for (const
|
|
1510
|
-
if (
|
|
1511
|
-
const
|
|
1512
|
-
t.changeLanguage(
|
|
1525
|
+
for (const l of i)
|
|
1526
|
+
if (l.type === "attributes" && l.attributeName === "lang") {
|
|
1527
|
+
const c = document.documentElement.lang || "en";
|
|
1528
|
+
t.changeLanguage(c);
|
|
1513
1529
|
}
|
|
1514
1530
|
}).observe(document.documentElement, { attributes: !0 }), t;
|
|
1515
1531
|
}
|
|
@@ -1621,7 +1637,7 @@ class Ct {
|
|
|
1621
1637
|
const { launchInBackground: r = !1 } = n || {};
|
|
1622
1638
|
if (!oe.has(t))
|
|
1623
1639
|
return console.error(`Cannot launch app "${t}": not registered`), null;
|
|
1624
|
-
const o = this.apps.find((
|
|
1640
|
+
const o = this.apps.find((l) => l.appId === t);
|
|
1625
1641
|
if (o)
|
|
1626
1642
|
return r || (this.setActiveApp(t), j._setActiveAppId(t)), o.ref ? o : this.waitForRef(t);
|
|
1627
1643
|
const i = {
|
|
@@ -1728,7 +1744,7 @@ function It() {
|
|
|
1728
1744
|
throw new Error("useApp must be used inside an App");
|
|
1729
1745
|
return e;
|
|
1730
1746
|
}
|
|
1731
|
-
function
|
|
1747
|
+
function Mt({ size: e = 16 }) {
|
|
1732
1748
|
return /* @__PURE__ */ y(
|
|
1733
1749
|
"svg",
|
|
1734
1750
|
{
|
|
@@ -1747,7 +1763,7 @@ function $t({ size: e = 16 }) {
|
|
|
1747
1763
|
}
|
|
1748
1764
|
);
|
|
1749
1765
|
}
|
|
1750
|
-
function
|
|
1766
|
+
function $t({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: o }) {
|
|
1751
1767
|
return /* @__PURE__ */ y("div", { className: "nc-app-title-bar", children: [
|
|
1752
1768
|
/* @__PURE__ */ y("div", { className: "nc-app-title-bar-left", children: [
|
|
1753
1769
|
n && !o && /* @__PURE__ */ s(
|
|
@@ -1757,7 +1773,7 @@ function Mt({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: o })
|
|
|
1757
1773
|
onClick: n,
|
|
1758
1774
|
title: "Back",
|
|
1759
1775
|
"aria-label": "Go back",
|
|
1760
|
-
children: /* @__PURE__ */ s(
|
|
1776
|
+
children: /* @__PURE__ */ s(Mt, { size: 16 })
|
|
1761
1777
|
}
|
|
1762
1778
|
),
|
|
1763
1779
|
/* @__PURE__ */ s("span", { className: "nc-app-title-bar-title", children: e })
|
|
@@ -1802,37 +1818,37 @@ class Rt extends ye.Component {
|
|
|
1802
1818
|
}
|
|
1803
1819
|
}
|
|
1804
1820
|
function Ve({ appId: e, isActive: t, onClose: n }) {
|
|
1805
|
-
const { t: r } = J(), o = oe.get(e), [i,
|
|
1821
|
+
const { t: r } = J(), o = oe.get(e), [i, l] = R(""), [c, d] = R(null), [p, h] = R(null), [w, a] = R(!1), [u, m] = R(!1);
|
|
1806
1822
|
ye.useEffect(() => {
|
|
1807
|
-
o != null && o.titleKey &&
|
|
1823
|
+
o != null && o.titleKey && l(r(o.titleKey));
|
|
1808
1824
|
}, [o, r]);
|
|
1809
1825
|
const v = W((N) => {
|
|
1810
|
-
|
|
1811
|
-
}, []),
|
|
1826
|
+
l(N);
|
|
1827
|
+
}, []), f = W((N) => {
|
|
1812
1828
|
d(() => N);
|
|
1813
1829
|
}, []), x = W(() => {
|
|
1814
1830
|
d(null);
|
|
1815
1831
|
}, []), k = W((N) => {
|
|
1816
|
-
|
|
1832
|
+
h(N);
|
|
1817
1833
|
}, []), $ = W(() => {
|
|
1818
|
-
|
|
1834
|
+
h(null);
|
|
1819
1835
|
}, []), g = W((N) => {
|
|
1820
|
-
|
|
1821
|
-
}, []),
|
|
1822
|
-
|
|
1836
|
+
a(N);
|
|
1837
|
+
}, []), I = W((N) => {
|
|
1838
|
+
m(N);
|
|
1823
1839
|
}, []), P = xe(() => ({
|
|
1824
1840
|
setTitle: v,
|
|
1825
|
-
setBackHandler:
|
|
1841
|
+
setBackHandler: f,
|
|
1826
1842
|
clearBackHandler: x,
|
|
1827
1843
|
setToolbar: k,
|
|
1828
1844
|
clearToolbar: $,
|
|
1829
1845
|
setHideBackButton: g,
|
|
1830
|
-
setHideTitleBar:
|
|
1846
|
+
setHideTitleBar: I,
|
|
1831
1847
|
close: n
|
|
1832
|
-
}), [v,
|
|
1848
|
+
}), [v, f, x, k, $, g, I, n]);
|
|
1833
1849
|
if (!o)
|
|
1834
1850
|
return null;
|
|
1835
|
-
const
|
|
1851
|
+
const b = o.component, S = !o.hideTitleBar && !u;
|
|
1836
1852
|
return /* @__PURE__ */ y(
|
|
1837
1853
|
"div",
|
|
1838
1854
|
{
|
|
@@ -1844,13 +1860,13 @@ function Ve({ appId: e, isActive: t, onClose: n }) {
|
|
|
1844
1860
|
},
|
|
1845
1861
|
children: [
|
|
1846
1862
|
S && /* @__PURE__ */ s(
|
|
1847
|
-
|
|
1863
|
+
$t,
|
|
1848
1864
|
{
|
|
1849
1865
|
title: i,
|
|
1850
1866
|
onClose: n,
|
|
1851
|
-
onBack:
|
|
1867
|
+
onBack: c ?? void 0,
|
|
1852
1868
|
toolbar: p,
|
|
1853
|
-
hideBackButton:
|
|
1869
|
+
hideBackButton: w
|
|
1854
1870
|
}
|
|
1855
1871
|
),
|
|
1856
1872
|
/* @__PURE__ */ s(
|
|
@@ -1881,7 +1897,7 @@ function Ve({ appId: e, isActive: t, onClose: n }) {
|
|
|
1881
1897
|
children: /* @__PURE__ */ s(Te, {})
|
|
1882
1898
|
}
|
|
1883
1899
|
),
|
|
1884
|
-
children: /* @__PURE__ */ s(
|
|
1900
|
+
children: /* @__PURE__ */ s(b, {})
|
|
1885
1901
|
}
|
|
1886
1902
|
) }) })
|
|
1887
1903
|
}
|
|
@@ -1932,17 +1948,17 @@ const ke = "-", Et = (e) => {
|
|
|
1932
1948
|
conflictingClassGroupModifiers: r
|
|
1933
1949
|
} = e;
|
|
1934
1950
|
return {
|
|
1935
|
-
getClassGroupId: (
|
|
1936
|
-
const
|
|
1937
|
-
return
|
|
1951
|
+
getClassGroupId: (l) => {
|
|
1952
|
+
const c = l.split(ke);
|
|
1953
|
+
return c[0] === "" && c.length !== 1 && c.shift(), Ge(c, t) || zt(l);
|
|
1938
1954
|
},
|
|
1939
|
-
getConflictingClassGroupIds: (
|
|
1940
|
-
const d = n[
|
|
1941
|
-
return
|
|
1955
|
+
getConflictingClassGroupIds: (l, c) => {
|
|
1956
|
+
const d = n[l] || [];
|
|
1957
|
+
return c && r[l] ? [...d, ...r[l]] : d;
|
|
1942
1958
|
}
|
|
1943
1959
|
};
|
|
1944
1960
|
}, Ge = (e, t) => {
|
|
1945
|
-
var
|
|
1961
|
+
var l;
|
|
1946
1962
|
if (e.length === 0)
|
|
1947
1963
|
return t.classGroupId;
|
|
1948
1964
|
const n = e[0], r = t.nextPart.get(n), o = r ? Ge(e.slice(1), r) : void 0;
|
|
@@ -1951,9 +1967,9 @@ const ke = "-", Et = (e) => {
|
|
|
1951
1967
|
if (t.validators.length === 0)
|
|
1952
1968
|
return;
|
|
1953
1969
|
const i = e.join(ke);
|
|
1954
|
-
return (
|
|
1955
|
-
validator:
|
|
1956
|
-
}) =>
|
|
1970
|
+
return (l = t.validators.find(({
|
|
1971
|
+
validator: c
|
|
1972
|
+
}) => c(i))) == null ? void 0 : l.classGroupId;
|
|
1957
1973
|
}, ze = /^\[(.+)\]$/, zt = (e) => {
|
|
1958
1974
|
if (ze.test(e)) {
|
|
1959
1975
|
const t = ze.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
|
|
@@ -1968,8 +1984,8 @@ const ke = "-", Et = (e) => {
|
|
|
1968
1984
|
nextPart: /* @__PURE__ */ new Map(),
|
|
1969
1985
|
validators: []
|
|
1970
1986
|
};
|
|
1971
|
-
return Tt(Object.entries(e.classGroups), n).forEach(([i,
|
|
1972
|
-
we(
|
|
1987
|
+
return Tt(Object.entries(e.classGroups), n).forEach(([i, l]) => {
|
|
1988
|
+
we(l, r, i, t);
|
|
1973
1989
|
}), r;
|
|
1974
1990
|
}, we = (e, t, n, r) => {
|
|
1975
1991
|
e.forEach((o) => {
|
|
@@ -1989,8 +2005,8 @@ const ke = "-", Et = (e) => {
|
|
|
1989
2005
|
});
|
|
1990
2006
|
return;
|
|
1991
2007
|
}
|
|
1992
|
-
Object.entries(o).forEach(([i,
|
|
1993
|
-
we(
|
|
2008
|
+
Object.entries(o).forEach(([i, l]) => {
|
|
2009
|
+
we(l, Pe(t, i), n, r);
|
|
1994
2010
|
});
|
|
1995
2011
|
});
|
|
1996
2012
|
}, Pe = (e, t) => {
|
|
@@ -2002,7 +2018,7 @@ const ke = "-", Et = (e) => {
|
|
|
2002
2018
|
}), n = n.nextPart.get(r);
|
|
2003
2019
|
}), n;
|
|
2004
2020
|
}, Lt = (e) => e.isThemeGetter, Tt = (e, t) => t ? e.map(([n, r]) => {
|
|
2005
|
-
const o = r.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([
|
|
2021
|
+
const o = r.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([l, c]) => [t + l, c])) : i);
|
|
2006
2022
|
return [n, o];
|
|
2007
2023
|
}) : e, Bt = (e) => {
|
|
2008
2024
|
if (e < 1)
|
|
@@ -2013,54 +2029,54 @@ const ke = "-", Et = (e) => {
|
|
|
2013
2029
|
}
|
|
2014
2030
|
};
|
|
2015
2031
|
let t = 0, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2016
|
-
const o = (i,
|
|
2017
|
-
n.set(i,
|
|
2032
|
+
const o = (i, l) => {
|
|
2033
|
+
n.set(i, l), t++, t > e && (t = 0, r = n, n = /* @__PURE__ */ new Map());
|
|
2018
2034
|
};
|
|
2019
2035
|
return {
|
|
2020
2036
|
get(i) {
|
|
2021
|
-
let
|
|
2022
|
-
if (
|
|
2023
|
-
return
|
|
2024
|
-
if ((
|
|
2025
|
-
return o(i,
|
|
2037
|
+
let l = n.get(i);
|
|
2038
|
+
if (l !== void 0)
|
|
2039
|
+
return l;
|
|
2040
|
+
if ((l = r.get(i)) !== void 0)
|
|
2041
|
+
return o(i, l), l;
|
|
2026
2042
|
},
|
|
2027
|
-
set(i,
|
|
2028
|
-
n.has(i) ? n.set(i,
|
|
2043
|
+
set(i, l) {
|
|
2044
|
+
n.has(i) ? n.set(i, l) : o(i, l);
|
|
2029
2045
|
}
|
|
2030
2046
|
};
|
|
2031
2047
|
}, je = "!", Dt = (e) => {
|
|
2032
2048
|
const {
|
|
2033
2049
|
separator: t,
|
|
2034
2050
|
experimentalParseClassName: n
|
|
2035
|
-
} = e, r = t.length === 1, o = t[0], i = t.length,
|
|
2051
|
+
} = e, r = t.length === 1, o = t[0], i = t.length, l = (c) => {
|
|
2036
2052
|
const d = [];
|
|
2037
|
-
let p = 0,
|
|
2038
|
-
for (let
|
|
2039
|
-
let x =
|
|
2053
|
+
let p = 0, h = 0, w;
|
|
2054
|
+
for (let f = 0; f < c.length; f++) {
|
|
2055
|
+
let x = c[f];
|
|
2040
2056
|
if (p === 0) {
|
|
2041
|
-
if (x === o && (r ||
|
|
2042
|
-
d.push(
|
|
2057
|
+
if (x === o && (r || c.slice(f, f + i) === t)) {
|
|
2058
|
+
d.push(c.slice(h, f)), h = f + i;
|
|
2043
2059
|
continue;
|
|
2044
2060
|
}
|
|
2045
2061
|
if (x === "/") {
|
|
2046
|
-
|
|
2062
|
+
w = f;
|
|
2047
2063
|
continue;
|
|
2048
2064
|
}
|
|
2049
2065
|
}
|
|
2050
2066
|
x === "[" ? p++ : x === "]" && p--;
|
|
2051
2067
|
}
|
|
2052
|
-
const
|
|
2068
|
+
const a = d.length === 0 ? c : c.substring(h), u = a.startsWith(je), m = u ? a.substring(1) : a, v = w && w > h ? w - h : void 0;
|
|
2053
2069
|
return {
|
|
2054
2070
|
modifiers: d,
|
|
2055
2071
|
hasImportantModifier: u,
|
|
2056
|
-
baseClassName:
|
|
2072
|
+
baseClassName: m,
|
|
2057
2073
|
maybePostfixModifierPosition: v
|
|
2058
2074
|
};
|
|
2059
2075
|
};
|
|
2060
|
-
return n ? (
|
|
2061
|
-
className:
|
|
2062
|
-
parseClassName:
|
|
2063
|
-
}) :
|
|
2076
|
+
return n ? (c) => n({
|
|
2077
|
+
className: c,
|
|
2078
|
+
parseClassName: l
|
|
2079
|
+
}) : l;
|
|
2064
2080
|
}, Ht = (e) => {
|
|
2065
2081
|
if (e.length <= 1)
|
|
2066
2082
|
return e;
|
|
@@ -2078,39 +2094,39 @@ const ke = "-", Et = (e) => {
|
|
|
2078
2094
|
parseClassName: n,
|
|
2079
2095
|
getClassGroupId: r,
|
|
2080
2096
|
getConflictingClassGroupIds: o
|
|
2081
|
-
} = t, i = [],
|
|
2082
|
-
let
|
|
2083
|
-
for (let d =
|
|
2084
|
-
const p =
|
|
2085
|
-
modifiers:
|
|
2086
|
-
hasImportantModifier:
|
|
2087
|
-
baseClassName:
|
|
2097
|
+
} = t, i = [], l = e.trim().split(Vt);
|
|
2098
|
+
let c = "";
|
|
2099
|
+
for (let d = l.length - 1; d >= 0; d -= 1) {
|
|
2100
|
+
const p = l[d], {
|
|
2101
|
+
modifiers: h,
|
|
2102
|
+
hasImportantModifier: w,
|
|
2103
|
+
baseClassName: a,
|
|
2088
2104
|
maybePostfixModifierPosition: u
|
|
2089
2105
|
} = n(p);
|
|
2090
|
-
let
|
|
2106
|
+
let m = !!u, v = r(m ? a.substring(0, u) : a);
|
|
2091
2107
|
if (!v) {
|
|
2092
|
-
if (!
|
|
2093
|
-
|
|
2108
|
+
if (!m) {
|
|
2109
|
+
c = p + (c.length > 0 ? " " + c : c);
|
|
2094
2110
|
continue;
|
|
2095
2111
|
}
|
|
2096
|
-
if (v = r(
|
|
2097
|
-
|
|
2112
|
+
if (v = r(a), !v) {
|
|
2113
|
+
c = p + (c.length > 0 ? " " + c : c);
|
|
2098
2114
|
continue;
|
|
2099
2115
|
}
|
|
2100
|
-
|
|
2116
|
+
m = !1;
|
|
2101
2117
|
}
|
|
2102
|
-
const
|
|
2118
|
+
const f = Ht(h).join(":"), x = w ? f + je : f, k = x + v;
|
|
2103
2119
|
if (i.includes(k))
|
|
2104
2120
|
continue;
|
|
2105
2121
|
i.push(k);
|
|
2106
|
-
const $ = o(v,
|
|
2122
|
+
const $ = o(v, m);
|
|
2107
2123
|
for (let g = 0; g < $.length; ++g) {
|
|
2108
|
-
const
|
|
2109
|
-
i.push(x +
|
|
2124
|
+
const I = $[g];
|
|
2125
|
+
i.push(x + I);
|
|
2110
2126
|
}
|
|
2111
|
-
|
|
2127
|
+
c = p + (c.length > 0 ? " " + c : c);
|
|
2112
2128
|
}
|
|
2113
|
-
return
|
|
2129
|
+
return c;
|
|
2114
2130
|
};
|
|
2115
2131
|
function Ot() {
|
|
2116
2132
|
let e = 0, t, n, r = "";
|
|
@@ -2127,17 +2143,17 @@ const Ke = (e) => {
|
|
|
2127
2143
|
return n;
|
|
2128
2144
|
};
|
|
2129
2145
|
function Yt(e, ...t) {
|
|
2130
|
-
let n, r, o, i =
|
|
2131
|
-
function
|
|
2132
|
-
const p = t.reduce((
|
|
2133
|
-
return n = Wt(p), r = n.cache.get, o = n.cache.set, i =
|
|
2146
|
+
let n, r, o, i = l;
|
|
2147
|
+
function l(d) {
|
|
2148
|
+
const p = t.reduce((h, w) => w(h), e());
|
|
2149
|
+
return n = Wt(p), r = n.cache.get, o = n.cache.set, i = c, c(d);
|
|
2134
2150
|
}
|
|
2135
|
-
function
|
|
2151
|
+
function c(d) {
|
|
2136
2152
|
const p = r(d);
|
|
2137
2153
|
if (p)
|
|
2138
2154
|
return p;
|
|
2139
|
-
const
|
|
2140
|
-
return o(d,
|
|
2155
|
+
const h = Ft(d, n);
|
|
2156
|
+
return o(d, h), h;
|
|
2141
2157
|
}
|
|
2142
2158
|
return function() {
|
|
2143
2159
|
return i(Ot.apply(null, arguments));
|
|
@@ -2155,7 +2171,7 @@ const L = (e) => {
|
|
|
2155
2171
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2156
2172
|
_t.test(e) && !Ut.test(e)
|
|
2157
2173
|
), Ue = () => !1, sn = (e) => qt.test(e), an = (e) => Xt.test(e), cn = () => {
|
|
2158
|
-
const e = L("colors"), t = L("spacing"), n = L("blur"), r = L("brightness"), o = L("borderColor"), i = L("borderRadius"),
|
|
2174
|
+
const e = L("colors"), t = L("spacing"), n = L("blur"), r = L("brightness"), o = L("borderColor"), i = L("borderRadius"), l = L("borderSpacing"), c = L("borderWidth"), d = L("contrast"), p = L("grayscale"), h = L("hueRotate"), w = L("invert"), a = L("gap"), u = L("gradientColorStops"), m = L("gradientColorStopPositions"), v = L("inset"), f = L("margin"), x = L("opacity"), k = L("padding"), $ = L("saturate"), g = L("scale"), I = L("sepia"), P = L("skew"), b = L("space"), S = L("translate"), N = () => ["auto", "contain", "none"], E = () => ["auto", "hidden", "clip", "visible", "scroll"], D = () => ["auto", A, t], M = () => [A, t], O = () => ["", Y, U], C = () => ["auto", re, A], z = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], B = () => ["solid", "dashed", "dotted", "double", "none"], ee = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], K = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], Q = () => ["", "0", A], ae = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], V = () => [re, A];
|
|
2159
2175
|
return {
|
|
2160
2176
|
cacheSize: 500,
|
|
2161
2177
|
separator: ":",
|
|
@@ -2166,25 +2182,25 @@ const L = (e) => {
|
|
|
2166
2182
|
brightness: V(),
|
|
2167
2183
|
borderColor: [e],
|
|
2168
2184
|
borderRadius: ["none", "", "full", q, A],
|
|
2169
|
-
borderSpacing:
|
|
2185
|
+
borderSpacing: M(),
|
|
2170
2186
|
borderWidth: O(),
|
|
2171
2187
|
contrast: V(),
|
|
2172
2188
|
grayscale: Q(),
|
|
2173
2189
|
hueRotate: V(),
|
|
2174
2190
|
invert: Q(),
|
|
2175
|
-
gap:
|
|
2191
|
+
gap: M(),
|
|
2176
2192
|
gradientColorStops: [e],
|
|
2177
2193
|
gradientColorStopPositions: [Jt, U],
|
|
2178
2194
|
inset: D(),
|
|
2179
2195
|
margin: D(),
|
|
2180
2196
|
opacity: V(),
|
|
2181
|
-
padding:
|
|
2197
|
+
padding: M(),
|
|
2182
2198
|
saturate: V(),
|
|
2183
2199
|
scale: V(),
|
|
2184
2200
|
sepia: Q(),
|
|
2185
2201
|
skew: V(),
|
|
2186
|
-
space:
|
|
2187
|
-
translate:
|
|
2202
|
+
space: M(),
|
|
2203
|
+
translate: M()
|
|
2188
2204
|
},
|
|
2189
2205
|
classGroups: {
|
|
2190
2206
|
// Layout
|
|
@@ -2538,21 +2554,21 @@ const L = (e) => {
|
|
|
2538
2554
|
* @see https://tailwindcss.com/docs/gap
|
|
2539
2555
|
*/
|
|
2540
2556
|
gap: [{
|
|
2541
|
-
gap: [
|
|
2557
|
+
gap: [a]
|
|
2542
2558
|
}],
|
|
2543
2559
|
/**
|
|
2544
2560
|
* Gap X
|
|
2545
2561
|
* @see https://tailwindcss.com/docs/gap
|
|
2546
2562
|
*/
|
|
2547
2563
|
"gap-x": [{
|
|
2548
|
-
"gap-x": [
|
|
2564
|
+
"gap-x": [a]
|
|
2549
2565
|
}],
|
|
2550
2566
|
/**
|
|
2551
2567
|
* Gap Y
|
|
2552
2568
|
* @see https://tailwindcss.com/docs/gap
|
|
2553
2569
|
*/
|
|
2554
2570
|
"gap-y": [{
|
|
2555
|
-
"gap-y": [
|
|
2571
|
+
"gap-y": [a]
|
|
2556
2572
|
}],
|
|
2557
2573
|
/**
|
|
2558
2574
|
* Justify Content
|
|
@@ -2686,70 +2702,70 @@ const L = (e) => {
|
|
|
2686
2702
|
* @see https://tailwindcss.com/docs/margin
|
|
2687
2703
|
*/
|
|
2688
2704
|
m: [{
|
|
2689
|
-
m: [
|
|
2705
|
+
m: [f]
|
|
2690
2706
|
}],
|
|
2691
2707
|
/**
|
|
2692
2708
|
* Margin X
|
|
2693
2709
|
* @see https://tailwindcss.com/docs/margin
|
|
2694
2710
|
*/
|
|
2695
2711
|
mx: [{
|
|
2696
|
-
mx: [
|
|
2712
|
+
mx: [f]
|
|
2697
2713
|
}],
|
|
2698
2714
|
/**
|
|
2699
2715
|
* Margin Y
|
|
2700
2716
|
* @see https://tailwindcss.com/docs/margin
|
|
2701
2717
|
*/
|
|
2702
2718
|
my: [{
|
|
2703
|
-
my: [
|
|
2719
|
+
my: [f]
|
|
2704
2720
|
}],
|
|
2705
2721
|
/**
|
|
2706
2722
|
* Margin Start
|
|
2707
2723
|
* @see https://tailwindcss.com/docs/margin
|
|
2708
2724
|
*/
|
|
2709
2725
|
ms: [{
|
|
2710
|
-
ms: [
|
|
2726
|
+
ms: [f]
|
|
2711
2727
|
}],
|
|
2712
2728
|
/**
|
|
2713
2729
|
* Margin End
|
|
2714
2730
|
* @see https://tailwindcss.com/docs/margin
|
|
2715
2731
|
*/
|
|
2716
2732
|
me: [{
|
|
2717
|
-
me: [
|
|
2733
|
+
me: [f]
|
|
2718
2734
|
}],
|
|
2719
2735
|
/**
|
|
2720
2736
|
* Margin Top
|
|
2721
2737
|
* @see https://tailwindcss.com/docs/margin
|
|
2722
2738
|
*/
|
|
2723
2739
|
mt: [{
|
|
2724
|
-
mt: [
|
|
2740
|
+
mt: [f]
|
|
2725
2741
|
}],
|
|
2726
2742
|
/**
|
|
2727
2743
|
* Margin Right
|
|
2728
2744
|
* @see https://tailwindcss.com/docs/margin
|
|
2729
2745
|
*/
|
|
2730
2746
|
mr: [{
|
|
2731
|
-
mr: [
|
|
2747
|
+
mr: [f]
|
|
2732
2748
|
}],
|
|
2733
2749
|
/**
|
|
2734
2750
|
* Margin Bottom
|
|
2735
2751
|
* @see https://tailwindcss.com/docs/margin
|
|
2736
2752
|
*/
|
|
2737
2753
|
mb: [{
|
|
2738
|
-
mb: [
|
|
2754
|
+
mb: [f]
|
|
2739
2755
|
}],
|
|
2740
2756
|
/**
|
|
2741
2757
|
* Margin Left
|
|
2742
2758
|
* @see https://tailwindcss.com/docs/margin
|
|
2743
2759
|
*/
|
|
2744
2760
|
ml: [{
|
|
2745
|
-
ml: [
|
|
2761
|
+
ml: [f]
|
|
2746
2762
|
}],
|
|
2747
2763
|
/**
|
|
2748
2764
|
* Space Between X
|
|
2749
2765
|
* @see https://tailwindcss.com/docs/space
|
|
2750
2766
|
*/
|
|
2751
2767
|
"space-x": [{
|
|
2752
|
-
"space-x": [
|
|
2768
|
+
"space-x": [b]
|
|
2753
2769
|
}],
|
|
2754
2770
|
/**
|
|
2755
2771
|
* Space Between X Reverse
|
|
@@ -2761,7 +2777,7 @@ const L = (e) => {
|
|
|
2761
2777
|
* @see https://tailwindcss.com/docs/space
|
|
2762
2778
|
*/
|
|
2763
2779
|
"space-y": [{
|
|
2764
|
-
"space-y": [
|
|
2780
|
+
"space-y": [b]
|
|
2765
2781
|
}],
|
|
2766
2782
|
/**
|
|
2767
2783
|
* Space Between Y Reverse
|
|
@@ -3015,7 +3031,7 @@ const L = (e) => {
|
|
|
3015
3031
|
* @see https://tailwindcss.com/docs/text-indent
|
|
3016
3032
|
*/
|
|
3017
3033
|
indent: [{
|
|
3018
|
-
indent:
|
|
3034
|
+
indent: M()
|
|
3019
3035
|
}],
|
|
3020
3036
|
/**
|
|
3021
3037
|
* Vertical Alignment
|
|
@@ -3126,21 +3142,21 @@ const L = (e) => {
|
|
|
3126
3142
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3127
3143
|
*/
|
|
3128
3144
|
"gradient-from-pos": [{
|
|
3129
|
-
from: [
|
|
3145
|
+
from: [m]
|
|
3130
3146
|
}],
|
|
3131
3147
|
/**
|
|
3132
3148
|
* Gradient Color Stops Via Position
|
|
3133
3149
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3134
3150
|
*/
|
|
3135
3151
|
"gradient-via-pos": [{
|
|
3136
|
-
via: [
|
|
3152
|
+
via: [m]
|
|
3137
3153
|
}],
|
|
3138
3154
|
/**
|
|
3139
3155
|
* Gradient Color Stops To Position
|
|
3140
3156
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3141
3157
|
*/
|
|
3142
3158
|
"gradient-to-pos": [{
|
|
3143
|
-
to: [
|
|
3159
|
+
to: [m]
|
|
3144
3160
|
}],
|
|
3145
3161
|
/**
|
|
3146
3162
|
* Gradient Color Stops From
|
|
@@ -3274,63 +3290,63 @@ const L = (e) => {
|
|
|
3274
3290
|
* @see https://tailwindcss.com/docs/border-width
|
|
3275
3291
|
*/
|
|
3276
3292
|
"border-w": [{
|
|
3277
|
-
border: [
|
|
3293
|
+
border: [c]
|
|
3278
3294
|
}],
|
|
3279
3295
|
/**
|
|
3280
3296
|
* Border Width X
|
|
3281
3297
|
* @see https://tailwindcss.com/docs/border-width
|
|
3282
3298
|
*/
|
|
3283
3299
|
"border-w-x": [{
|
|
3284
|
-
"border-x": [
|
|
3300
|
+
"border-x": [c]
|
|
3285
3301
|
}],
|
|
3286
3302
|
/**
|
|
3287
3303
|
* Border Width Y
|
|
3288
3304
|
* @see https://tailwindcss.com/docs/border-width
|
|
3289
3305
|
*/
|
|
3290
3306
|
"border-w-y": [{
|
|
3291
|
-
"border-y": [
|
|
3307
|
+
"border-y": [c]
|
|
3292
3308
|
}],
|
|
3293
3309
|
/**
|
|
3294
3310
|
* Border Width Start
|
|
3295
3311
|
* @see https://tailwindcss.com/docs/border-width
|
|
3296
3312
|
*/
|
|
3297
3313
|
"border-w-s": [{
|
|
3298
|
-
"border-s": [
|
|
3314
|
+
"border-s": [c]
|
|
3299
3315
|
}],
|
|
3300
3316
|
/**
|
|
3301
3317
|
* Border Width End
|
|
3302
3318
|
* @see https://tailwindcss.com/docs/border-width
|
|
3303
3319
|
*/
|
|
3304
3320
|
"border-w-e": [{
|
|
3305
|
-
"border-e": [
|
|
3321
|
+
"border-e": [c]
|
|
3306
3322
|
}],
|
|
3307
3323
|
/**
|
|
3308
3324
|
* Border Width Top
|
|
3309
3325
|
* @see https://tailwindcss.com/docs/border-width
|
|
3310
3326
|
*/
|
|
3311
3327
|
"border-w-t": [{
|
|
3312
|
-
"border-t": [
|
|
3328
|
+
"border-t": [c]
|
|
3313
3329
|
}],
|
|
3314
3330
|
/**
|
|
3315
3331
|
* Border Width Right
|
|
3316
3332
|
* @see https://tailwindcss.com/docs/border-width
|
|
3317
3333
|
*/
|
|
3318
3334
|
"border-w-r": [{
|
|
3319
|
-
"border-r": [
|
|
3335
|
+
"border-r": [c]
|
|
3320
3336
|
}],
|
|
3321
3337
|
/**
|
|
3322
3338
|
* Border Width Bottom
|
|
3323
3339
|
* @see https://tailwindcss.com/docs/border-width
|
|
3324
3340
|
*/
|
|
3325
3341
|
"border-w-b": [{
|
|
3326
|
-
"border-b": [
|
|
3342
|
+
"border-b": [c]
|
|
3327
3343
|
}],
|
|
3328
3344
|
/**
|
|
3329
3345
|
* Border Width Left
|
|
3330
3346
|
* @see https://tailwindcss.com/docs/border-width
|
|
3331
3347
|
*/
|
|
3332
3348
|
"border-w-l": [{
|
|
3333
|
-
"border-l": [
|
|
3349
|
+
"border-l": [c]
|
|
3334
3350
|
}],
|
|
3335
3351
|
/**
|
|
3336
3352
|
* Border Opacity
|
|
@@ -3351,7 +3367,7 @@ const L = (e) => {
|
|
|
3351
3367
|
* @see https://tailwindcss.com/docs/divide-width
|
|
3352
3368
|
*/
|
|
3353
3369
|
"divide-x": [{
|
|
3354
|
-
"divide-x": [
|
|
3370
|
+
"divide-x": [c]
|
|
3355
3371
|
}],
|
|
3356
3372
|
/**
|
|
3357
3373
|
* Divide Width X Reverse
|
|
@@ -3363,7 +3379,7 @@ const L = (e) => {
|
|
|
3363
3379
|
* @see https://tailwindcss.com/docs/divide-width
|
|
3364
3380
|
*/
|
|
3365
3381
|
"divide-y": [{
|
|
3366
|
-
"divide-y": [
|
|
3382
|
+
"divide-y": [c]
|
|
3367
3383
|
}],
|
|
3368
3384
|
/**
|
|
3369
3385
|
* Divide Width Y Reverse
|
|
@@ -3607,14 +3623,14 @@ const L = (e) => {
|
|
|
3607
3623
|
* @see https://tailwindcss.com/docs/hue-rotate
|
|
3608
3624
|
*/
|
|
3609
3625
|
"hue-rotate": [{
|
|
3610
|
-
"hue-rotate": [
|
|
3626
|
+
"hue-rotate": [h]
|
|
3611
3627
|
}],
|
|
3612
3628
|
/**
|
|
3613
3629
|
* Invert
|
|
3614
3630
|
* @see https://tailwindcss.com/docs/invert
|
|
3615
3631
|
*/
|
|
3616
3632
|
invert: [{
|
|
3617
|
-
invert: [
|
|
3633
|
+
invert: [w]
|
|
3618
3634
|
}],
|
|
3619
3635
|
/**
|
|
3620
3636
|
* Saturate
|
|
@@ -3628,7 +3644,7 @@ const L = (e) => {
|
|
|
3628
3644
|
* @see https://tailwindcss.com/docs/sepia
|
|
3629
3645
|
*/
|
|
3630
3646
|
sepia: [{
|
|
3631
|
-
sepia: [
|
|
3647
|
+
sepia: [I]
|
|
3632
3648
|
}],
|
|
3633
3649
|
/**
|
|
3634
3650
|
* Backdrop Filter
|
|
@@ -3671,14 +3687,14 @@ const L = (e) => {
|
|
|
3671
3687
|
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
3672
3688
|
*/
|
|
3673
3689
|
"backdrop-hue-rotate": [{
|
|
3674
|
-
"backdrop-hue-rotate": [
|
|
3690
|
+
"backdrop-hue-rotate": [h]
|
|
3675
3691
|
}],
|
|
3676
3692
|
/**
|
|
3677
3693
|
* Backdrop Invert
|
|
3678
3694
|
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
3679
3695
|
*/
|
|
3680
3696
|
"backdrop-invert": [{
|
|
3681
|
-
"backdrop-invert": [
|
|
3697
|
+
"backdrop-invert": [w]
|
|
3682
3698
|
}],
|
|
3683
3699
|
/**
|
|
3684
3700
|
* Backdrop Opacity
|
|
@@ -3699,7 +3715,7 @@ const L = (e) => {
|
|
|
3699
3715
|
* @see https://tailwindcss.com/docs/backdrop-sepia
|
|
3700
3716
|
*/
|
|
3701
3717
|
"backdrop-sepia": [{
|
|
3702
|
-
"backdrop-sepia": [
|
|
3718
|
+
"backdrop-sepia": [I]
|
|
3703
3719
|
}],
|
|
3704
3720
|
// Tables
|
|
3705
3721
|
/**
|
|
@@ -3714,21 +3730,21 @@ const L = (e) => {
|
|
|
3714
3730
|
* @see https://tailwindcss.com/docs/border-spacing
|
|
3715
3731
|
*/
|
|
3716
3732
|
"border-spacing": [{
|
|
3717
|
-
"border-spacing": [
|
|
3733
|
+
"border-spacing": [l]
|
|
3718
3734
|
}],
|
|
3719
3735
|
/**
|
|
3720
3736
|
* Border Spacing X
|
|
3721
3737
|
* @see https://tailwindcss.com/docs/border-spacing
|
|
3722
3738
|
*/
|
|
3723
3739
|
"border-spacing-x": [{
|
|
3724
|
-
"border-spacing-x": [
|
|
3740
|
+
"border-spacing-x": [l]
|
|
3725
3741
|
}],
|
|
3726
3742
|
/**
|
|
3727
3743
|
* Border Spacing Y
|
|
3728
3744
|
* @see https://tailwindcss.com/docs/border-spacing
|
|
3729
3745
|
*/
|
|
3730
3746
|
"border-spacing-y": [{
|
|
3731
|
-
"border-spacing-y": [
|
|
3747
|
+
"border-spacing-y": [l]
|
|
3732
3748
|
}],
|
|
3733
3749
|
/**
|
|
3734
3750
|
* Table Layout
|
|
@@ -3906,126 +3922,126 @@ const L = (e) => {
|
|
|
3906
3922
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3907
3923
|
*/
|
|
3908
3924
|
"scroll-m": [{
|
|
3909
|
-
"scroll-m":
|
|
3925
|
+
"scroll-m": M()
|
|
3910
3926
|
}],
|
|
3911
3927
|
/**
|
|
3912
3928
|
* Scroll Margin X
|
|
3913
3929
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3914
3930
|
*/
|
|
3915
3931
|
"scroll-mx": [{
|
|
3916
|
-
"scroll-mx":
|
|
3932
|
+
"scroll-mx": M()
|
|
3917
3933
|
}],
|
|
3918
3934
|
/**
|
|
3919
3935
|
* Scroll Margin Y
|
|
3920
3936
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3921
3937
|
*/
|
|
3922
3938
|
"scroll-my": [{
|
|
3923
|
-
"scroll-my":
|
|
3939
|
+
"scroll-my": M()
|
|
3924
3940
|
}],
|
|
3925
3941
|
/**
|
|
3926
3942
|
* Scroll Margin Start
|
|
3927
3943
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3928
3944
|
*/
|
|
3929
3945
|
"scroll-ms": [{
|
|
3930
|
-
"scroll-ms":
|
|
3946
|
+
"scroll-ms": M()
|
|
3931
3947
|
}],
|
|
3932
3948
|
/**
|
|
3933
3949
|
* Scroll Margin End
|
|
3934
3950
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3935
3951
|
*/
|
|
3936
3952
|
"scroll-me": [{
|
|
3937
|
-
"scroll-me":
|
|
3953
|
+
"scroll-me": M()
|
|
3938
3954
|
}],
|
|
3939
3955
|
/**
|
|
3940
3956
|
* Scroll Margin Top
|
|
3941
3957
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3942
3958
|
*/
|
|
3943
3959
|
"scroll-mt": [{
|
|
3944
|
-
"scroll-mt":
|
|
3960
|
+
"scroll-mt": M()
|
|
3945
3961
|
}],
|
|
3946
3962
|
/**
|
|
3947
3963
|
* Scroll Margin Right
|
|
3948
3964
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3949
3965
|
*/
|
|
3950
3966
|
"scroll-mr": [{
|
|
3951
|
-
"scroll-mr":
|
|
3967
|
+
"scroll-mr": M()
|
|
3952
3968
|
}],
|
|
3953
3969
|
/**
|
|
3954
3970
|
* Scroll Margin Bottom
|
|
3955
3971
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3956
3972
|
*/
|
|
3957
3973
|
"scroll-mb": [{
|
|
3958
|
-
"scroll-mb":
|
|
3974
|
+
"scroll-mb": M()
|
|
3959
3975
|
}],
|
|
3960
3976
|
/**
|
|
3961
3977
|
* Scroll Margin Left
|
|
3962
3978
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3963
3979
|
*/
|
|
3964
3980
|
"scroll-ml": [{
|
|
3965
|
-
"scroll-ml":
|
|
3981
|
+
"scroll-ml": M()
|
|
3966
3982
|
}],
|
|
3967
3983
|
/**
|
|
3968
3984
|
* Scroll Padding
|
|
3969
3985
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3970
3986
|
*/
|
|
3971
3987
|
"scroll-p": [{
|
|
3972
|
-
"scroll-p":
|
|
3988
|
+
"scroll-p": M()
|
|
3973
3989
|
}],
|
|
3974
3990
|
/**
|
|
3975
3991
|
* Scroll Padding X
|
|
3976
3992
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3977
3993
|
*/
|
|
3978
3994
|
"scroll-px": [{
|
|
3979
|
-
"scroll-px":
|
|
3995
|
+
"scroll-px": M()
|
|
3980
3996
|
}],
|
|
3981
3997
|
/**
|
|
3982
3998
|
* Scroll Padding Y
|
|
3983
3999
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3984
4000
|
*/
|
|
3985
4001
|
"scroll-py": [{
|
|
3986
|
-
"scroll-py":
|
|
4002
|
+
"scroll-py": M()
|
|
3987
4003
|
}],
|
|
3988
4004
|
/**
|
|
3989
4005
|
* Scroll Padding Start
|
|
3990
4006
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3991
4007
|
*/
|
|
3992
4008
|
"scroll-ps": [{
|
|
3993
|
-
"scroll-ps":
|
|
4009
|
+
"scroll-ps": M()
|
|
3994
4010
|
}],
|
|
3995
4011
|
/**
|
|
3996
4012
|
* Scroll Padding End
|
|
3997
4013
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3998
4014
|
*/
|
|
3999
4015
|
"scroll-pe": [{
|
|
4000
|
-
"scroll-pe":
|
|
4016
|
+
"scroll-pe": M()
|
|
4001
4017
|
}],
|
|
4002
4018
|
/**
|
|
4003
4019
|
* Scroll Padding Top
|
|
4004
4020
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
4005
4021
|
*/
|
|
4006
4022
|
"scroll-pt": [{
|
|
4007
|
-
"scroll-pt":
|
|
4023
|
+
"scroll-pt": M()
|
|
4008
4024
|
}],
|
|
4009
4025
|
/**
|
|
4010
4026
|
* Scroll Padding Right
|
|
4011
4027
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
4012
4028
|
*/
|
|
4013
4029
|
"scroll-pr": [{
|
|
4014
|
-
"scroll-pr":
|
|
4030
|
+
"scroll-pr": M()
|
|
4015
4031
|
}],
|
|
4016
4032
|
/**
|
|
4017
4033
|
* Scroll Padding Bottom
|
|
4018
4034
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
4019
4035
|
*/
|
|
4020
4036
|
"scroll-pb": [{
|
|
4021
|
-
"scroll-pb":
|
|
4037
|
+
"scroll-pb": M()
|
|
4022
4038
|
}],
|
|
4023
4039
|
/**
|
|
4024
4040
|
* Scroll Padding Left
|
|
4025
4041
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
4026
4042
|
*/
|
|
4027
4043
|
"scroll-pl": [{
|
|
4028
|
-
"scroll-pl":
|
|
4044
|
+
"scroll-pl": M()
|
|
4029
4045
|
}],
|
|
4030
4046
|
/**
|
|
4031
4047
|
* Scroll Snap Align
|
|
@@ -4188,89 +4204,89 @@ function dn(...e) {
|
|
|
4188
4204
|
return ln(dt(e));
|
|
4189
4205
|
}
|
|
4190
4206
|
function jn({ autoWidth: e = !0, className: t, style: n }) {
|
|
4191
|
-
const [r, o] = R(() => j.getActiveAppId()), [i,
|
|
4207
|
+
const [r, o] = R(() => j.getActiveAppId()), [i, l] = R(() => F.getRunningApps()), { isMobile: c } = Ye();
|
|
4192
4208
|
T(() => {
|
|
4193
|
-
const
|
|
4209
|
+
const f = j.subscribe("activeAppId", (x) => {
|
|
4194
4210
|
o(x);
|
|
4195
4211
|
});
|
|
4196
4212
|
return () => {
|
|
4197
|
-
|
|
4213
|
+
f();
|
|
4198
4214
|
};
|
|
4199
4215
|
}, []), T(() => F.subscribe(() => {
|
|
4200
|
-
|
|
4216
|
+
l(F.getRunningApps());
|
|
4201
4217
|
}), []), T(() => {
|
|
4202
4218
|
if (!new URLSearchParams(window.location.search).has("app")) {
|
|
4203
4219
|
const k = j.getActiveAppId();
|
|
4204
4220
|
k && !F.isRunning(k) && F.launchApp(k);
|
|
4205
4221
|
}
|
|
4206
4222
|
}, []);
|
|
4207
|
-
const d = (
|
|
4208
|
-
F.closeApp(
|
|
4209
|
-
}, p = r ? oe.get(r) : null,
|
|
4223
|
+
const d = (f) => {
|
|
4224
|
+
F.closeApp(f);
|
|
4225
|
+
}, p = r ? oe.get(r) : null, w = (p == null ? void 0 : p.width) ?? 400, a = r !== null, v = { ...{
|
|
4210
4226
|
overflow: "hidden",
|
|
4211
|
-
display:
|
|
4227
|
+
display: a ? "flex" : "none",
|
|
4212
4228
|
flexDirection: "column",
|
|
4213
4229
|
flexShrink: 0,
|
|
4214
4230
|
// Only set width if autoWidth is enabled
|
|
4215
|
-
...e &&
|
|
4231
|
+
...e && a ? { width: c ? "100%" : w } : {}
|
|
4216
4232
|
}, ...n };
|
|
4217
|
-
return /* @__PURE__ */ s("div", { className: dn("nc-app-panel", t), style: v, children: i.map((
|
|
4233
|
+
return /* @__PURE__ */ s("div", { className: dn("nc-app-panel", t), style: v, children: i.map((f) => /* @__PURE__ */ s(
|
|
4218
4234
|
Ve,
|
|
4219
4235
|
{
|
|
4220
|
-
appId:
|
|
4221
|
-
isActive: r ===
|
|
4222
|
-
onClose: () => d(
|
|
4236
|
+
appId: f.appId,
|
|
4237
|
+
isActive: r === f.appId,
|
|
4238
|
+
onClose: () => d(f.appId)
|
|
4223
4239
|
},
|
|
4224
|
-
|
|
4240
|
+
f.appId
|
|
4225
4241
|
)) });
|
|
4226
4242
|
}
|
|
4227
4243
|
function Kn({ pinnedAppIds: e, className: t = "" }) {
|
|
4228
|
-
const { isMobile: n } = Ye(), [r, o] = R(() => j.getActiveAppId()), [i,
|
|
4244
|
+
const { isMobile: n } = Ye(), [r, o] = R(() => j.getActiveAppId()), [i, l] = R(() => F.getRunningApps());
|
|
4229
4245
|
T(() => {
|
|
4230
|
-
const
|
|
4246
|
+
const a = j.subscribe("activeAppId", (u) => {
|
|
4231
4247
|
o(u);
|
|
4232
4248
|
});
|
|
4233
4249
|
return () => {
|
|
4234
|
-
|
|
4250
|
+
a();
|
|
4235
4251
|
};
|
|
4236
4252
|
}, []), T(() => F.subscribe(() => {
|
|
4237
|
-
|
|
4253
|
+
l(F.getRunningApps());
|
|
4238
4254
|
}), []);
|
|
4239
|
-
const
|
|
4240
|
-
r ===
|
|
4241
|
-
}, d = e.map((
|
|
4255
|
+
const c = (a) => {
|
|
4256
|
+
r === a ? F.setActiveApp(null) : F.launchApp(a);
|
|
4257
|
+
}, d = e.map((a) => oe.get(a)).filter((a) => !!a), p = i.filter((a) => !e.includes(a.appId)).map((a) => ({ running: a, def: oe.get(a.appId) })).filter((a) => !!a.def), h = (a) => i.some((u) => u.appId === a), w = n ? 24 : 28;
|
|
4242
4258
|
return /* @__PURE__ */ y("div", { className: `nc-app-taskbar ${n ? "nc-mobile" : "nc-desktop"} ${t}`, children: [
|
|
4243
|
-
d.map((
|
|
4244
|
-
const u =
|
|
4259
|
+
d.map((a) => {
|
|
4260
|
+
const u = a.icon, m = r === a.id, v = h(a.id);
|
|
4245
4261
|
return /* @__PURE__ */ y(
|
|
4246
4262
|
"button",
|
|
4247
4263
|
{
|
|
4248
|
-
className: `nc-app-taskbar-button ${
|
|
4249
|
-
onClick: () => a
|
|
4250
|
-
title:
|
|
4264
|
+
className: `nc-app-taskbar-button ${m ? "nc-active" : ""} ${v ? "nc-running" : ""}`,
|
|
4265
|
+
onClick: () => c(a.id),
|
|
4266
|
+
title: a.titleKey || a.id,
|
|
4251
4267
|
children: [
|
|
4252
|
-
/* @__PURE__ */ s(u, { size:
|
|
4268
|
+
/* @__PURE__ */ s(u, { size: w }),
|
|
4253
4269
|
v && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4254
4270
|
]
|
|
4255
4271
|
},
|
|
4256
|
-
|
|
4272
|
+
a.id
|
|
4257
4273
|
);
|
|
4258
4274
|
}),
|
|
4259
4275
|
p.length > 0 && /* @__PURE__ */ s("div", { className: "nc-app-taskbar-separator" }),
|
|
4260
|
-
p.map(({ running:
|
|
4261
|
-
const
|
|
4276
|
+
p.map(({ running: a, def: u }) => {
|
|
4277
|
+
const m = u.icon, v = r === a.appId;
|
|
4262
4278
|
return /* @__PURE__ */ y(
|
|
4263
4279
|
"button",
|
|
4264
4280
|
{
|
|
4265
4281
|
className: `nc-app-taskbar-button ${v ? "nc-active" : ""} nc-running`,
|
|
4266
|
-
onClick: () => a
|
|
4282
|
+
onClick: () => c(a.appId),
|
|
4267
4283
|
title: u.titleKey || u.id,
|
|
4268
4284
|
children: [
|
|
4269
|
-
/* @__PURE__ */ s(
|
|
4285
|
+
/* @__PURE__ */ s(m, { size: w }),
|
|
4270
4286
|
/* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4271
4287
|
]
|
|
4272
4288
|
},
|
|
4273
|
-
|
|
4289
|
+
a.appId
|
|
4274
4290
|
);
|
|
4275
4291
|
})
|
|
4276
4292
|
] });
|
|
@@ -4283,15 +4299,15 @@ function _n({
|
|
|
4283
4299
|
className: o = "",
|
|
4284
4300
|
style: i
|
|
4285
4301
|
}) {
|
|
4286
|
-
const
|
|
4302
|
+
const l = (d) => {
|
|
4287
4303
|
r && d.target === d.currentTarget && n();
|
|
4288
4304
|
};
|
|
4289
4305
|
if (!t) return null;
|
|
4290
|
-
const
|
|
4306
|
+
const c = /* @__PURE__ */ s(
|
|
4291
4307
|
"div",
|
|
4292
4308
|
{
|
|
4293
4309
|
className: "nc-dialog-overlay nc-fullscreen",
|
|
4294
|
-
onClick:
|
|
4310
|
+
onClick: l,
|
|
4295
4311
|
children: /* @__PURE__ */ s(
|
|
4296
4312
|
"div",
|
|
4297
4313
|
{
|
|
@@ -4310,7 +4326,7 @@ function _n({
|
|
|
4310
4326
|
)
|
|
4311
4327
|
}
|
|
4312
4328
|
);
|
|
4313
|
-
return pe(
|
|
4329
|
+
return pe(c, document.body);
|
|
4314
4330
|
}
|
|
4315
4331
|
const Ne = se(null), qe = se(null);
|
|
4316
4332
|
function Un() {
|
|
@@ -4327,41 +4343,41 @@ function qn() {
|
|
|
4327
4343
|
}
|
|
4328
4344
|
const Ae = se(null);
|
|
4329
4345
|
function Xn({ rootView: e, children: t }) {
|
|
4330
|
-
const { t: n } = J(), r = It(), [o, i] = R([e]), [
|
|
4331
|
-
|
|
4332
|
-
const
|
|
4333
|
-
return
|
|
4346
|
+
const { t: n } = J(), r = It(), [o, i] = R([e]), [l, c] = R([null]), d = W((g, I) => {
|
|
4347
|
+
c((P) => {
|
|
4348
|
+
const b = [...P];
|
|
4349
|
+
return b[g] = I, b;
|
|
4334
4350
|
});
|
|
4335
4351
|
}, []), p = W((g) => {
|
|
4336
|
-
|
|
4337
|
-
const P = [...
|
|
4352
|
+
c((I) => {
|
|
4353
|
+
const P = [...I];
|
|
4338
4354
|
return P[g] = null, P;
|
|
4339
4355
|
});
|
|
4340
|
-
}, []),
|
|
4341
|
-
i((
|
|
4342
|
-
}, []),
|
|
4343
|
-
i((g) => g.length <= 1 ? g : g.slice(0, -1)),
|
|
4344
|
-
}, []),
|
|
4345
|
-
i([e]),
|
|
4346
|
-
}, [e]), u = o.length,
|
|
4356
|
+
}, []), h = W((g) => {
|
|
4357
|
+
i((I) => [...I, g]), c((I) => [...I, null]);
|
|
4358
|
+
}, []), w = W(() => {
|
|
4359
|
+
i((g) => g.length <= 1 ? g : g.slice(0, -1)), c((g) => g.slice(0, -1));
|
|
4360
|
+
}, []), a = W(() => {
|
|
4361
|
+
i([e]), c([null]);
|
|
4362
|
+
}, [e]), u = o.length, m = u > 1, v = o.length - 1, f = o[o.length - 1], x = f != null && f.titleKey ? n(f.titleKey) : (f == null ? void 0 : f.title) ?? "";
|
|
4347
4363
|
T(() => {
|
|
4348
4364
|
r.setTitle(x);
|
|
4349
4365
|
}, [x, r]), T(() => {
|
|
4350
|
-
|
|
4351
|
-
}, [
|
|
4352
|
-
const g =
|
|
4366
|
+
m ? r.setBackHandler(w) : r.clearBackHandler();
|
|
4367
|
+
}, [m, w, r]), T(() => {
|
|
4368
|
+
const g = l[l.length - 1];
|
|
4353
4369
|
g ? r.setToolbar(g) : r.clearToolbar();
|
|
4354
|
-
}, [
|
|
4370
|
+
}, [l, r]);
|
|
4355
4371
|
const k = {
|
|
4356
|
-
push:
|
|
4357
|
-
pop:
|
|
4358
|
-
reset:
|
|
4372
|
+
push: h,
|
|
4373
|
+
pop: w,
|
|
4374
|
+
reset: a,
|
|
4359
4375
|
depth: u,
|
|
4360
|
-
canGoBack:
|
|
4376
|
+
canGoBack: m,
|
|
4361
4377
|
currentTitle: x
|
|
4362
4378
|
}, $ = {
|
|
4363
4379
|
stack: o,
|
|
4364
|
-
toolbarStack:
|
|
4380
|
+
toolbarStack: l,
|
|
4365
4381
|
updateToolbar: d,
|
|
4366
4382
|
clearToolbarAt: p,
|
|
4367
4383
|
topIndex: v
|
|
@@ -4372,13 +4388,13 @@ function un({ index: e, children: t }) {
|
|
|
4372
4388
|
const n = X(Ae);
|
|
4373
4389
|
if (!n)
|
|
4374
4390
|
throw new Error("NavViewProvider must be used within NavStackProvider");
|
|
4375
|
-
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n,
|
|
4391
|
+
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n, l = W((p) => {
|
|
4376
4392
|
e === i && r(e, p);
|
|
4377
|
-
}, [e, i, r]),
|
|
4393
|
+
}, [e, i, r]), c = W(() => {
|
|
4378
4394
|
e === i && o(e);
|
|
4379
4395
|
}, [e, i, o]), d = {
|
|
4380
|
-
setToolbar:
|
|
4381
|
-
clearToolbar:
|
|
4396
|
+
setToolbar: l,
|
|
4397
|
+
clearToolbar: c
|
|
4382
4398
|
};
|
|
4383
4399
|
return /* @__PURE__ */ s(qe.Provider, { value: d, children: t });
|
|
4384
4400
|
}
|
|
@@ -4406,18 +4422,18 @@ export {
|
|
|
4406
4422
|
_n as AppDialog,
|
|
4407
4423
|
jn as AppPanel,
|
|
4408
4424
|
Kn as AppTaskbar,
|
|
4409
|
-
|
|
4425
|
+
$t as AppTitleBar,
|
|
4410
4426
|
xn as Battery,
|
|
4411
4427
|
G as Button,
|
|
4412
4428
|
kn as ButtonGroup,
|
|
4413
4429
|
Nn as Checkbox,
|
|
4414
4430
|
Be as CloseButton,
|
|
4415
4431
|
An as ComboBox,
|
|
4416
|
-
|
|
4432
|
+
$n as ContextMenu,
|
|
4417
4433
|
Rn as Dialog,
|
|
4418
4434
|
ne as DialogClose,
|
|
4419
4435
|
Cn as EditButton,
|
|
4420
|
-
|
|
4436
|
+
Mn as Hyperlink,
|
|
4421
4437
|
En as Input,
|
|
4422
4438
|
Pn as ListGroup,
|
|
4423
4439
|
zn as ListGroupItem,
|