@kingsimba/nc-ui 0.1.50 → 0.1.51
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 +7 -7
- package/dist/index.js +651 -647
- package/dist/style.css +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Nt = Object.defineProperty;
|
|
2
|
+
var At = (e, t, n) => t in e ? Nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var de = (e, t, n) => At(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as o, jsxs as N, Fragment as Ie } from "react/jsx-runtime";
|
|
5
|
-
import { d as
|
|
6
|
-
import
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import
|
|
10
|
-
import { c as
|
|
11
|
-
function
|
|
5
|
+
import { d as De, E as St, R as rt, W as Ct, k as $t, Z as Mt, b as Pt, a as ot, c as st, _ as It, A as Rt } from "./GeneratedIcons-Jg9slqRu.js";
|
|
6
|
+
import Ve, { useState as R, useRef as Y, useEffect as F, useMemo as fe, createContext as we, useContext as he, Children as Et, isValidElement as Tt, forwardRef as Lt, useImperativeHandle as zt, useCallback as Z, Suspense as Bt } from "react";
|
|
7
|
+
import { createPortal as ye } from "react-dom";
|
|
8
|
+
import { useTranslation as ne } from "react-i18next";
|
|
9
|
+
import Dt from "i18next";
|
|
10
|
+
import { c as Vt } from "./clsx-OuTLNxxd.js";
|
|
11
|
+
function it({
|
|
12
12
|
size: e = "default",
|
|
13
13
|
color: t,
|
|
14
14
|
overlay: n = !1,
|
|
@@ -38,7 +38,7 @@ function ot({
|
|
|
38
38
|
return n ? /* @__PURE__ */ o("div", { className: "nc-activity-indicator-overlay", children: s }) : s;
|
|
39
39
|
}
|
|
40
40
|
function J({ variant: e = "default", block: t, size: n = "default", appearance: r = "default", className: s, disabled: i, textSelectable: c, loading: a, onClick: l, children: d, ...u }) {
|
|
41
|
-
const
|
|
41
|
+
const w = [
|
|
42
42
|
"nc-button",
|
|
43
43
|
e !== "default" ? `nc-${e}` : "",
|
|
44
44
|
t ? "nc-block" : "",
|
|
@@ -53,7 +53,7 @@ function J({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
53
53
|
return /* @__PURE__ */ N(
|
|
54
54
|
"button",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: w,
|
|
57
57
|
disabled: i || a,
|
|
58
58
|
onClick: (h) => {
|
|
59
59
|
if (!a) {
|
|
@@ -68,7 +68,7 @@ function J({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
68
68
|
...u,
|
|
69
69
|
children: [
|
|
70
70
|
a && /* @__PURE__ */ o(
|
|
71
|
-
|
|
71
|
+
it,
|
|
72
72
|
{
|
|
73
73
|
size: "small",
|
|
74
74
|
className: "nc-button-spinner",
|
|
@@ -80,14 +80,14 @@ function J({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const Wt = {
|
|
84
84
|
info: "primary",
|
|
85
85
|
success: "success",
|
|
86
86
|
warning: "warning",
|
|
87
87
|
error: "danger",
|
|
88
88
|
danger: "danger"
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function ur({
|
|
91
91
|
code: e,
|
|
92
92
|
text: t,
|
|
93
93
|
type: n,
|
|
@@ -112,7 +112,7 @@ function ar({
|
|
|
112
112
|
className: "nc-alert-close",
|
|
113
113
|
"aria-label": "Close alert",
|
|
114
114
|
onClick: c,
|
|
115
|
-
children: /* @__PURE__ */ o(
|
|
115
|
+
children: /* @__PURE__ */ o(De, { size: 16 })
|
|
116
116
|
}
|
|
117
117
|
)
|
|
118
118
|
] }),
|
|
@@ -120,14 +120,14 @@ function ar({
|
|
|
120
120
|
J,
|
|
121
121
|
{
|
|
122
122
|
size: "small",
|
|
123
|
-
variant: r.variant ??
|
|
123
|
+
variant: r.variant ?? Wt[n],
|
|
124
124
|
onClick: s,
|
|
125
125
|
children: r.text
|
|
126
126
|
}
|
|
127
127
|
) })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function pr({
|
|
131
131
|
percentage: e = 0.5,
|
|
132
132
|
status: t = "discharging",
|
|
133
133
|
darkMode: n = !1,
|
|
@@ -136,7 +136,7 @@ function lr({
|
|
|
136
136
|
const s = Math.max(0, Math.min(1, Number(e) || 0)), i = s === 0 ? "-" : String(Math.round(s * 100));
|
|
137
137
|
let c;
|
|
138
138
|
r ? s < 0.1 ? c = "var(--nc-danger)" : s < 0.2 ? c = "var(--nc-warning)" : c = "var(--nc-success)" : c = n ? "rgba(255,255,255,0.35)" : "#000000";
|
|
139
|
-
const a = "var(--nc-battery-shell-bg)", l = 24, d = 14, u = 2,
|
|
139
|
+
const a = "var(--nc-battery-shell-bg)", l = 24, d = 14, u = 2, w = 0, p = 12, h = 0, A = 0, b = 0, v = l, y = d, m = y - h * 2, f = v - h * 2, g = Math.max(1, Math.min(4, y / 4)), S = s === 0 ? 0 : 0.05 + s * 0.95, M = l + u + p, B = 20, W = 0.65, k = Math.max(d, B * W), I = l + u + 1, x = (d - B * W) / 2;
|
|
140
140
|
return /* @__PURE__ */ N(
|
|
141
141
|
"svg",
|
|
142
142
|
{
|
|
@@ -155,7 +155,7 @@ function lr({
|
|
|
155
155
|
y: b,
|
|
156
156
|
rx: g,
|
|
157
157
|
ry: g,
|
|
158
|
-
width:
|
|
158
|
+
width: v,
|
|
159
159
|
height: y,
|
|
160
160
|
fill: a
|
|
161
161
|
}
|
|
@@ -176,7 +176,7 @@ function lr({
|
|
|
176
176
|
/* @__PURE__ */ o(
|
|
177
177
|
"text",
|
|
178
178
|
{
|
|
179
|
-
x: A +
|
|
179
|
+
x: A + v / 2,
|
|
180
180
|
y: d - 3,
|
|
181
181
|
fontSize: 11,
|
|
182
182
|
fontWeight: "bold",
|
|
@@ -188,7 +188,7 @@ function lr({
|
|
|
188
188
|
/* @__PURE__ */ o(
|
|
189
189
|
"rect",
|
|
190
190
|
{
|
|
191
|
-
x: l +
|
|
191
|
+
x: l + w,
|
|
192
192
|
y: d * 0.26,
|
|
193
193
|
width: u,
|
|
194
194
|
height: d * 0.48,
|
|
@@ -197,12 +197,12 @@ function lr({
|
|
|
197
197
|
fill: s === 1 ? c : a
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
t === "charging" ? /* @__PURE__ */ o("g", { transform: `translate(${
|
|
200
|
+
t === "charging" ? /* @__PURE__ */ o("g", { transform: `translate(${I}, ${x}) scale(${W})`, fill: c, children: /* @__PURE__ */ o("path", { d: "M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z" }) }) : null
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function fr({
|
|
206
206
|
value: e,
|
|
207
207
|
onChange: t,
|
|
208
208
|
options: n,
|
|
@@ -224,7 +224,7 @@ function dr({
|
|
|
224
224
|
);
|
|
225
225
|
}) });
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Ht({ size: e }) {
|
|
228
228
|
return /* @__PURE__ */ o("svg", { className: `nc-checkbox-icon ${e === "small" ? "nc-small" : e === "tiny" ? "nc-tiny" : ""}`, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ o(
|
|
229
229
|
"path",
|
|
230
230
|
{
|
|
@@ -236,7 +236,7 @@ function Wt({ size: e }) {
|
|
|
236
236
|
}
|
|
237
237
|
) });
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function hr({ checked: e, onChange: t, disabled: n, label: r, size: s = "default", labelColor: i, style: c, className: a = "" }) {
|
|
240
240
|
const l = s === "small", d = s === "tiny";
|
|
241
241
|
return /* @__PURE__ */ N(
|
|
242
242
|
"label",
|
|
@@ -257,7 +257,7 @@ function ur({ checked: e, onChange: t, disabled: n, label: r, size: s = "default
|
|
|
257
257
|
onKeyDown: (u) => {
|
|
258
258
|
n || (u.key === "Enter" || u.key === " ") && (u.preventDefault(), t(!e));
|
|
259
259
|
},
|
|
260
|
-
children: e && /* @__PURE__ */ o(
|
|
260
|
+
children: e && /* @__PURE__ */ o(Ht, { size: s })
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
r && /* @__PURE__ */ o("span", { className: "nc-checkbox-text", style: i ? { color: i } : void 0, children: r })
|
|
@@ -265,8 +265,8 @@ function ur({ checked: e, onChange: t, disabled: n, label: r, size: s = "default
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
const a =
|
|
268
|
+
function Ot({ option: e, onChange: t, selected: n, highlighted: r, small: s, renderOption: i, index: c }) {
|
|
269
|
+
const a = Y(null), { t: l } = ne(), d = e.disabled === !0;
|
|
270
270
|
return F(() => {
|
|
271
271
|
r && a.current && a.current.scrollIntoView({ block: "nearest" });
|
|
272
272
|
}, [r]), /* @__PURE__ */ o(
|
|
@@ -296,7 +296,7 @@ function Ht({ option: e, onChange: t, selected: n, highlighted: r, small: s, ren
|
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Ft({
|
|
300
300
|
isOpen: e,
|
|
301
301
|
options: t,
|
|
302
302
|
onSelect: n,
|
|
@@ -307,17 +307,17 @@ function Vt({
|
|
|
307
307
|
highlightedIndex: a = -1,
|
|
308
308
|
renderOption: l
|
|
309
309
|
}) {
|
|
310
|
-
const [d, u] = R({ top: 0, left: 0, width: 0 }), [
|
|
310
|
+
const [d, u] = R({ top: 0, left: 0, width: 0 }), [w, p] = R(s), { t: h } = ne();
|
|
311
311
|
if (F(() => {
|
|
312
312
|
if (e && i.current) {
|
|
313
313
|
const b = i.current.getBoundingClientRect();
|
|
314
|
-
let
|
|
314
|
+
let v = s;
|
|
315
315
|
if (s === "bottom") {
|
|
316
316
|
const y = window.innerHeight - b.bottom, m = b.top;
|
|
317
|
-
y < 320 && m > y && (
|
|
317
|
+
y < 320 && m > y && (v = "top");
|
|
318
318
|
}
|
|
319
|
-
p(
|
|
320
|
-
top:
|
|
319
|
+
p(v), u({
|
|
320
|
+
top: v === "top" ? b.top - 4 : b.bottom + 4,
|
|
321
321
|
left: b.left,
|
|
322
322
|
width: b.width
|
|
323
323
|
});
|
|
@@ -330,20 +330,20 @@ function Vt({
|
|
|
330
330
|
onMouseDown: (b) => b.stopPropagation(),
|
|
331
331
|
style: {
|
|
332
332
|
position: "fixed",
|
|
333
|
-
top:
|
|
334
|
-
bottom:
|
|
333
|
+
top: w === "top" ? void 0 : d.top,
|
|
334
|
+
bottom: w === "top" ? window.innerHeight - d.top : void 0,
|
|
335
335
|
left: d.left,
|
|
336
336
|
width: d.width,
|
|
337
337
|
zIndex: 1e3,
|
|
338
338
|
maxHeight: 300,
|
|
339
339
|
overflowY: "auto"
|
|
340
340
|
},
|
|
341
|
-
children: t.length === 0 ? /* @__PURE__ */ o("div", { className: `nc-combo-dropdown-option nc-no-results ${c ? "nc-small" : ""}`, children: h("common.noResults") }) : t.map((b,
|
|
341
|
+
children: t.length === 0 ? /* @__PURE__ */ o("div", { className: `nc-combo-dropdown-option nc-no-results ${c ? "nc-small" : ""}`, children: h("common.noResults") }) : t.map((b, v) => /* @__PURE__ */ o(Ot, { option: b, onChange: n, selected: b.value === r, highlighted: v === a, small: c, renderOption: l, index: v }, b.value))
|
|
342
342
|
}
|
|
343
343
|
);
|
|
344
|
-
return
|
|
344
|
+
return ye(A, document.body);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Gt({ onClick: e, small: t }) {
|
|
347
347
|
return /* @__PURE__ */ o(
|
|
348
348
|
"span",
|
|
349
349
|
{
|
|
@@ -362,7 +362,7 @@ function Ot({ onClick: e, small: t }) {
|
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function _t({ open: e, small: t }) {
|
|
366
366
|
return /* @__PURE__ */ o(
|
|
367
367
|
"span",
|
|
368
368
|
{
|
|
@@ -372,7 +372,7 @@ function Ft({ open: e, small: t }) {
|
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function mr({
|
|
376
376
|
value: e,
|
|
377
377
|
onChange: t,
|
|
378
378
|
placeholder: n = "Select…",
|
|
@@ -384,18 +384,18 @@ function pr({
|
|
|
384
384
|
disabled: l,
|
|
385
385
|
label: d,
|
|
386
386
|
clearable: u = !0,
|
|
387
|
-
allowTyping:
|
|
387
|
+
allowTyping: w = !1,
|
|
388
388
|
placement: p = "bottom",
|
|
389
389
|
size: h = "default",
|
|
390
390
|
appearance: A = "default",
|
|
391
391
|
textAlign: b = "left",
|
|
392
|
-
style:
|
|
392
|
+
style: v,
|
|
393
393
|
className: y
|
|
394
394
|
}) {
|
|
395
|
-
const [m, f] = R(!1), [g, S] = R(""), [M, B] = R(-1),
|
|
395
|
+
const [m, f] = R(!1), [g, S] = R(""), [M, B] = R(-1), W = Y(null), k = Y(null), I = Y(null), x = h === "small", { t: $ } = ne(), L = !!s, H = w || L, [E, z] = R([]), [O, C] = R(() => {
|
|
396
396
|
if (r && e) {
|
|
397
|
-
const
|
|
398
|
-
return
|
|
397
|
+
const V = r.find((j) => j.value === e);
|
|
398
|
+
return V ? V.label : "";
|
|
399
399
|
}
|
|
400
400
|
return s && e ? e : "";
|
|
401
401
|
});
|
|
@@ -405,155 +405,155 @@ function pr({
|
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
if (r) {
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
const V = r.find((j) => j.value === e);
|
|
409
|
+
V && C(V.label);
|
|
410
410
|
} else s && C(e);
|
|
411
411
|
}, [e, r, s]);
|
|
412
|
-
const
|
|
412
|
+
const P = (V, j = !1) => {
|
|
413
413
|
if (!s) return;
|
|
414
|
-
|
|
415
|
-
const
|
|
414
|
+
I.current && clearTimeout(I.current);
|
|
415
|
+
const _ = async () => {
|
|
416
416
|
try {
|
|
417
|
-
const X = await s(
|
|
417
|
+
const X = await s(V);
|
|
418
418
|
z(X), B(-1);
|
|
419
419
|
} catch {
|
|
420
420
|
z([]);
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
|
-
|
|
424
|
-
}, G =
|
|
423
|
+
j ? _() : I.current = setTimeout(_, 200);
|
|
424
|
+
}, G = fe(() => {
|
|
425
425
|
if (L) return E;
|
|
426
|
-
const
|
|
427
|
-
return
|
|
428
|
-
}, [r, g,
|
|
426
|
+
const V = g.toLowerCase();
|
|
427
|
+
return H ? (r || []).filter((j) => j.label.toLowerCase().includes(V)) : r || [];
|
|
428
|
+
}, [r, g, H, L, E]);
|
|
429
429
|
F(() => {
|
|
430
430
|
m && B(-1);
|
|
431
431
|
}, [m, G]), F(() => {
|
|
432
432
|
if (!u && !e && r && r.length > 0 && t) {
|
|
433
|
-
const
|
|
434
|
-
t(
|
|
433
|
+
const V = r.find((j) => j.default) || r[0];
|
|
434
|
+
t(V.value);
|
|
435
435
|
}
|
|
436
436
|
}, [u, e, r, t]), F(() => {
|
|
437
|
-
function
|
|
438
|
-
var
|
|
439
|
-
|
|
437
|
+
function V(j) {
|
|
438
|
+
var _;
|
|
439
|
+
j.target instanceof Node && W.current && ((_ = W.current.parentElement) != null && _.contains(j.target) || f(!1));
|
|
440
440
|
}
|
|
441
|
-
return document.addEventListener("mousedown",
|
|
441
|
+
return document.addEventListener("mousedown", V), () => document.removeEventListener("mousedown", V);
|
|
442
442
|
}, []);
|
|
443
|
-
const D = a ?? (r ? r.find((
|
|
443
|
+
const D = a ?? (r ? r.find((V) => V.value === e) : e ? { label: O, value: e } : void 0), q = D && u, te = !l && !q, re = `nc-align-${b}`, oe = !(m && H) && !!D, se = (V, j, _ = !1) => {
|
|
444
444
|
var X;
|
|
445
|
-
C(
|
|
446
|
-
},
|
|
445
|
+
C(j), t == null || t(V), f(!1), S(""), _ && ((X = W.current) == null || X.blur());
|
|
446
|
+
}, le = () => {
|
|
447
447
|
t == null || t(void 0), S(""), f(!1);
|
|
448
|
-
}, ke = (
|
|
448
|
+
}, ke = (V) => {
|
|
449
449
|
if (!m) {
|
|
450
|
-
(
|
|
450
|
+
(V.key === "ArrowDown" || V.key === "ArrowUp") && (f(!0), V.preventDefault());
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
const
|
|
453
|
+
const j = (_, X) => {
|
|
454
454
|
if (X === 1) {
|
|
455
|
-
for (let K =
|
|
455
|
+
for (let K = _; K < G.length; K++)
|
|
456
456
|
if (!G[K].disabled) return K;
|
|
457
|
-
for (let K = 0; K <
|
|
457
|
+
for (let K = 0; K < _; K++)
|
|
458
458
|
if (!G[K].disabled) return K;
|
|
459
459
|
} else {
|
|
460
|
-
for (let K =
|
|
460
|
+
for (let K = _; K >= 0; K--)
|
|
461
461
|
if (!G[K].disabled) return K;
|
|
462
|
-
for (let K = G.length - 1; K >
|
|
462
|
+
for (let K = G.length - 1; K > _; K--)
|
|
463
463
|
if (!G[K].disabled) return K;
|
|
464
464
|
}
|
|
465
|
-
return
|
|
465
|
+
return _;
|
|
466
466
|
};
|
|
467
|
-
switch (
|
|
467
|
+
switch (V.key) {
|
|
468
468
|
case "ArrowDown":
|
|
469
|
-
|
|
470
|
-
const X =
|
|
471
|
-
return
|
|
469
|
+
V.preventDefault(), B((_) => {
|
|
470
|
+
const X = _ + 1, K = X >= G.length ? 0 : X;
|
|
471
|
+
return j(K, 1);
|
|
472
472
|
});
|
|
473
473
|
break;
|
|
474
474
|
case "ArrowUp":
|
|
475
|
-
|
|
476
|
-
const X =
|
|
477
|
-
return
|
|
475
|
+
V.preventDefault(), B((_) => {
|
|
476
|
+
const X = _ - 1, K = X < 0 ? G.length - 1 : X;
|
|
477
|
+
return j(K, -1);
|
|
478
478
|
});
|
|
479
479
|
break;
|
|
480
480
|
case "Enter":
|
|
481
|
-
|
|
481
|
+
V.preventDefault(), M >= 0 && M < G.length && !G[M].disabled && se(G[M].value, G[M].label, !0);
|
|
482
482
|
break;
|
|
483
483
|
case "Escape":
|
|
484
|
-
|
|
484
|
+
V.preventDefault(), f(!1), S("");
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
487
|
};
|
|
488
|
-
return /* @__PURE__ */ N("div", { className: `nc-combo-container ${A === "transparent" ? "nc-transparent" : ""} ${A === "plain" ? "nc-plain" : ""} ${m ? "nc-open" : ""} ${
|
|
488
|
+
return /* @__PURE__ */ N("div", { className: `nc-combo-container ${A === "transparent" ? "nc-transparent" : ""} ${A === "plain" ? "nc-plain" : ""} ${m ? "nc-open" : ""} ${re} ${y || ""}`.trim(), style: { position: "relative", ...v }, children: [
|
|
489
489
|
d && /* @__PURE__ */ o("span", { className: `nc-label ${x ? "nc-small" : ""}`, children: d }),
|
|
490
490
|
/* @__PURE__ */ N(
|
|
491
491
|
"div",
|
|
492
492
|
{
|
|
493
493
|
ref: k,
|
|
494
494
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
495
|
-
onMouseDown: (
|
|
496
|
-
if (l ||
|
|
497
|
-
const
|
|
498
|
-
if (f((
|
|
499
|
-
const
|
|
500
|
-
z([]), setTimeout(() =>
|
|
495
|
+
onMouseDown: (V) => {
|
|
496
|
+
if (l || H && V.target === W.current) return;
|
|
497
|
+
const j = !m;
|
|
498
|
+
if (f((_) => (!_ && H && D && S(D.label), !_)), L && j) {
|
|
499
|
+
const _ = H && D ? D.label : "";
|
|
500
|
+
z([]), setTimeout(() => P(_, !0), 0);
|
|
501
501
|
}
|
|
502
|
-
|
|
503
|
-
var
|
|
504
|
-
(
|
|
502
|
+
H && !m && setTimeout(() => {
|
|
503
|
+
var _, X;
|
|
504
|
+
(_ = W.current) == null || _.focus(), (X = W.current) == null || X.select();
|
|
505
505
|
}, 0);
|
|
506
506
|
},
|
|
507
507
|
children: [
|
|
508
508
|
/* @__PURE__ */ o(
|
|
509
509
|
"input",
|
|
510
510
|
{
|
|
511
|
-
ref:
|
|
512
|
-
className: `nc-input ${x ? "nc-small" : ""} ${
|
|
511
|
+
ref: W,
|
|
512
|
+
className: `nc-input ${x ? "nc-small" : ""} ${oe ? "nc-value-under-overlay" : ""}`.trim(),
|
|
513
513
|
placeholder: n,
|
|
514
514
|
onFocus: () => {
|
|
515
|
-
if (!l &&
|
|
515
|
+
if (!l && H) {
|
|
516
516
|
f(!0);
|
|
517
|
-
const
|
|
518
|
-
D && (S(
|
|
519
|
-
var
|
|
520
|
-
return (
|
|
521
|
-
}, 0)), L && (z([]),
|
|
517
|
+
const V = D ? D.label : "";
|
|
518
|
+
D && (S(V), setTimeout(() => {
|
|
519
|
+
var j;
|
|
520
|
+
return (j = W.current) == null ? void 0 : j.select();
|
|
521
|
+
}, 0)), L && (z([]), P(V, !0));
|
|
522
522
|
}
|
|
523
523
|
},
|
|
524
|
-
onChange: (
|
|
525
|
-
const
|
|
526
|
-
|
|
524
|
+
onChange: (V) => {
|
|
525
|
+
const j = V.target.value;
|
|
526
|
+
H && (S(j), L && P(j));
|
|
527
527
|
},
|
|
528
528
|
onKeyDown: ke,
|
|
529
|
-
value: m &&
|
|
530
|
-
readOnly: l || !
|
|
529
|
+
value: m && H ? g : (D == null ? void 0 : D.label) || "",
|
|
530
|
+
readOnly: l || !H,
|
|
531
531
|
style: {
|
|
532
532
|
width: "100%",
|
|
533
|
-
paddingRight:
|
|
534
|
-
caretColor:
|
|
535
|
-
cursor:
|
|
533
|
+
paddingRight: te || q ? x ? 32 : 44 : 12,
|
|
534
|
+
caretColor: w ? void 0 : "transparent",
|
|
535
|
+
cursor: w ? void 0 : "pointer",
|
|
536
536
|
// The input text is invisible behind the overlay, so it must not be selectable
|
|
537
537
|
// (its selection highlight would be painted over the overlay text).
|
|
538
|
-
userSelect:
|
|
539
|
-
color:
|
|
538
|
+
userSelect: oe ? "none" : void 0,
|
|
539
|
+
color: oe ? "transparent" : "var(--nc-text)"
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
),
|
|
543
|
-
|
|
543
|
+
oe && /* @__PURE__ */ o(
|
|
544
544
|
"div",
|
|
545
545
|
{
|
|
546
546
|
"aria-hidden": !0,
|
|
547
|
-
className: `nc-combo-overlay ${
|
|
547
|
+
className: `nc-combo-overlay ${re}`,
|
|
548
548
|
style: {
|
|
549
549
|
position: "absolute",
|
|
550
550
|
left: x ? 8 : 12,
|
|
551
|
-
right:
|
|
551
|
+
right: te || q ? x ? 12 : 24 : x ? 8 : 12,
|
|
552
552
|
top: "50%",
|
|
553
553
|
transform: "translateY(-50%)",
|
|
554
554
|
// The overlay carries the visible text, so it is the layer that can be selected/copied.
|
|
555
555
|
userSelect: "text",
|
|
556
|
-
cursor:
|
|
556
|
+
cursor: w ? void 0 : "pointer",
|
|
557
557
|
display: "flex",
|
|
558
558
|
alignItems: "center",
|
|
559
559
|
gap: 6
|
|
@@ -568,15 +568,15 @@ function pr({
|
|
|
568
568
|
] })
|
|
569
569
|
}
|
|
570
570
|
),
|
|
571
|
-
q && /* @__PURE__ */ o(
|
|
572
|
-
|
|
571
|
+
q && /* @__PURE__ */ o(Gt, { onClick: le, small: x }),
|
|
572
|
+
te && /* @__PURE__ */ o(_t, { open: m, small: x })
|
|
573
573
|
]
|
|
574
574
|
}
|
|
575
575
|
),
|
|
576
|
-
/* @__PURE__ */ o(
|
|
576
|
+
/* @__PURE__ */ o(Ft, { isOpen: m, options: G, onSelect: se, selectedValue: e, placement: p, anchorRef: k, small: x, highlightedIndex: M, renderOption: i })
|
|
577
577
|
] });
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function gr({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default", title: s, "aria-label": i }) {
|
|
580
580
|
return /* @__PURE__ */ o(
|
|
581
581
|
"button",
|
|
582
582
|
{
|
|
@@ -586,11 +586,11 @@ function fr({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default"
|
|
|
586
586
|
title: s ?? (t ? "Refreshing..." : "Refresh"),
|
|
587
587
|
"aria-label": i ?? (t ? "Refreshing" : "Refresh"),
|
|
588
588
|
"data-size": r,
|
|
589
|
-
children: /* @__PURE__ */ o(
|
|
589
|
+
children: /* @__PURE__ */ o(rt, { size: r === "small" ? 14 : r === "large" ? 20 : 18, className: t ? "nc-spinning" : "" })
|
|
590
590
|
}
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function ct({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Close", "aria-label": s = "Close" }) {
|
|
594
594
|
return /* @__PURE__ */ o(
|
|
595
595
|
"button",
|
|
596
596
|
{
|
|
@@ -600,11 +600,11 @@ function st({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Clo
|
|
|
600
600
|
title: r,
|
|
601
601
|
"aria-label": s,
|
|
602
602
|
"data-size": n,
|
|
603
|
-
children: /* @__PURE__ */ o(
|
|
603
|
+
children: /* @__PURE__ */ o(De, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
604
604
|
}
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function br({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Edit", "aria-label": s = "Edit" }) {
|
|
608
608
|
return /* @__PURE__ */ o(
|
|
609
609
|
"button",
|
|
610
610
|
{
|
|
@@ -614,11 +614,11 @@ function hr({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Edi
|
|
|
614
614
|
title: r,
|
|
615
615
|
"aria-label": s,
|
|
616
616
|
"data-size": n,
|
|
617
|
-
children: /* @__PURE__ */ o(
|
|
617
|
+
children: /* @__PURE__ */ o(St, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
618
618
|
}
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function vr({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Delete", "aria-label": s = "Delete" }) {
|
|
622
622
|
return /* @__PURE__ */ o(
|
|
623
623
|
"button",
|
|
624
624
|
{
|
|
@@ -628,11 +628,11 @@ function mr({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Del
|
|
|
628
628
|
title: r,
|
|
629
629
|
"aria-label": s,
|
|
630
630
|
"data-size": n,
|
|
631
|
-
children: /* @__PURE__ */ o(
|
|
631
|
+
children: /* @__PURE__ */ o(Ct, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
632
632
|
}
|
|
633
633
|
);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function wr({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label": s, size: i = "default" }) {
|
|
636
636
|
return /* @__PURE__ */ o(
|
|
637
637
|
"button",
|
|
638
638
|
{
|
|
@@ -646,7 +646,7 @@ function gr({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label":
|
|
|
646
646
|
}
|
|
647
647
|
);
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function yr({
|
|
650
650
|
open: e,
|
|
651
651
|
onClose: t,
|
|
652
652
|
options: n,
|
|
@@ -654,14 +654,14 @@ function br({
|
|
|
654
654
|
anchor: s,
|
|
655
655
|
preferredDirection: i = "down"
|
|
656
656
|
}) {
|
|
657
|
-
const c =
|
|
657
|
+
const c = Y(null), [a, l] = R({ top: 0, left: 0 }), d = s || (r == null ? void 0 : r.current);
|
|
658
658
|
if (F(() => {
|
|
659
659
|
if (!e || !d || !c.current) return;
|
|
660
|
-
const p = d.getBoundingClientRect(), h = c.current.getBoundingClientRect(), A = window.innerHeight, b = window.innerWidth,
|
|
660
|
+
const p = d.getBoundingClientRect(), h = c.current.getBoundingClientRect(), A = window.innerHeight, b = window.innerWidth, v = p.bottom + 8, y = v + h.height <= A - 8;
|
|
661
661
|
let m = i;
|
|
662
662
|
(!y && i === "down" || i === "up" && y) && (m = "up");
|
|
663
663
|
let f;
|
|
664
|
-
m === "down" ? f =
|
|
664
|
+
m === "down" ? f = v : f = p.top - h.height - 8;
|
|
665
665
|
let g = p.left;
|
|
666
666
|
g + h.width > b - 8 && (g = p.right - h.width), l({
|
|
667
667
|
top: Math.max(8, f),
|
|
@@ -682,8 +682,8 @@ function br({
|
|
|
682
682
|
}, [e, t, d]), !e) return null;
|
|
683
683
|
const u = (p) => {
|
|
684
684
|
p.type !== "separator" && !p.disabled && p.onClick && (p.onClick(), t());
|
|
685
|
-
},
|
|
686
|
-
return
|
|
685
|
+
}, w = n.some((p) => p.icon);
|
|
686
|
+
return ye(
|
|
687
687
|
/* @__PURE__ */ o(
|
|
688
688
|
"div",
|
|
689
689
|
{
|
|
@@ -710,7 +710,7 @@ function br({
|
|
|
710
710
|
"nc-context-menu-item",
|
|
711
711
|
p.variant && p.variant !== "default" ? `nc-${p.variant}` : "",
|
|
712
712
|
p.disabled ? "nc-disabled" : "",
|
|
713
|
-
|
|
713
|
+
w && !p.icon ? "nc-indented" : ""
|
|
714
714
|
].filter(Boolean).join(" ");
|
|
715
715
|
return /* @__PURE__ */ N(
|
|
716
716
|
"button",
|
|
@@ -732,20 +732,20 @@ function br({
|
|
|
732
732
|
document.body
|
|
733
733
|
);
|
|
734
734
|
}
|
|
735
|
-
const
|
|
736
|
-
function
|
|
737
|
-
const e =
|
|
735
|
+
const at = we(null);
|
|
736
|
+
function Yt() {
|
|
737
|
+
const e = he(at);
|
|
738
738
|
if (!e)
|
|
739
739
|
throw new Error("useDialog must be used inside a Dialog component");
|
|
740
740
|
return e;
|
|
741
741
|
}
|
|
742
|
-
function
|
|
743
|
-
const { close: r } =
|
|
742
|
+
function ge({ children: e, onClick: t, ...n }) {
|
|
743
|
+
const { close: r } = Yt(), { t: s } = ne();
|
|
744
744
|
return /* @__PURE__ */ o(J, { onClick: (c) => {
|
|
745
745
|
t == null || t(c), r();
|
|
746
746
|
}, ...n, children: e ?? s("common.close") });
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function xr({
|
|
749
749
|
open: e,
|
|
750
750
|
onClose: t,
|
|
751
751
|
title: n,
|
|
@@ -757,23 +757,23 @@ function vr({
|
|
|
757
757
|
onSave: l,
|
|
758
758
|
onDelete: d,
|
|
759
759
|
onCancel: u,
|
|
760
|
-
onConnect:
|
|
760
|
+
onConnect: w,
|
|
761
761
|
closeOnOverlay: p = !0,
|
|
762
762
|
primaryDisabled: h = !1,
|
|
763
763
|
fullScreen: A = !1,
|
|
764
764
|
hideTitleBar: b = !1,
|
|
765
|
-
className:
|
|
765
|
+
className: v = "",
|
|
766
766
|
onContentHeightChange: y
|
|
767
767
|
}) {
|
|
768
|
-
const m =
|
|
768
|
+
const m = Y(null), f = Y(null), { t: g } = ne(), S = { close: t }, M = (k) => {
|
|
769
769
|
p && k.target === k.currentTarget && t();
|
|
770
770
|
};
|
|
771
771
|
if (F(() => {
|
|
772
772
|
e && m.current && m.current.focus();
|
|
773
773
|
}, [e]), F(() => {
|
|
774
774
|
if (!y || !f.current) return;
|
|
775
|
-
const k = new ResizeObserver((
|
|
776
|
-
for (const x of
|
|
775
|
+
const k = new ResizeObserver((I) => {
|
|
776
|
+
for (const x of I) {
|
|
777
777
|
const $ = x.contentRect.height;
|
|
778
778
|
y($);
|
|
779
779
|
}
|
|
@@ -788,28 +788,28 @@ function vr({
|
|
|
788
788
|
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ o(J, { variant: "primary", onClick: a ?? t, disabled: h, children: g("common.ok") }) });
|
|
789
789
|
case "ok-cancel":
|
|
790
790
|
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
791
|
-
/* @__PURE__ */ o(
|
|
791
|
+
/* @__PURE__ */ o(ge, { onClick: u, children: g("common.cancel") }),
|
|
792
792
|
/* @__PURE__ */ o(J, { variant: "primary", onClick: a ?? t, disabled: h, children: g("common.ok") })
|
|
793
793
|
] });
|
|
794
794
|
case "save-cancel":
|
|
795
795
|
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
796
|
-
/* @__PURE__ */ o(
|
|
796
|
+
/* @__PURE__ */ o(ge, { onClick: u, children: g("common.cancel") }),
|
|
797
797
|
/* @__PURE__ */ o(J, { variant: "primary", onClick: l, disabled: h, children: g("common.save") })
|
|
798
798
|
] });
|
|
799
799
|
case "delete-cancel":
|
|
800
800
|
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
801
|
-
/* @__PURE__ */ o(
|
|
801
|
+
/* @__PURE__ */ o(ge, { onClick: u, children: g("common.cancel") }),
|
|
802
802
|
/* @__PURE__ */ o(J, { variant: "danger", onClick: d, disabled: h, children: g("common.delete") })
|
|
803
803
|
] });
|
|
804
804
|
case "connect":
|
|
805
805
|
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
806
|
-
/* @__PURE__ */ o(
|
|
807
|
-
/* @__PURE__ */ o(J, { variant: "primary", onClick:
|
|
806
|
+
/* @__PURE__ */ o(ge, { onClick: u, children: g("common.cancel") }),
|
|
807
|
+
/* @__PURE__ */ o(J, { variant: "primary", onClick: w, disabled: h, children: g("common.connect") })
|
|
808
808
|
] });
|
|
809
809
|
case "close":
|
|
810
|
-
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ o(
|
|
810
|
+
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ o(ge, { variant: "primary" }) });
|
|
811
811
|
case "gotit":
|
|
812
|
-
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ o(
|
|
812
|
+
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ o(ge, { variant: "primary", children: g("common.gotit") }) });
|
|
813
813
|
case "custom":
|
|
814
814
|
return /* @__PURE__ */ o("div", { className: "nc-dialog-footer", children: c });
|
|
815
815
|
case "none":
|
|
@@ -817,11 +817,11 @@ function vr({
|
|
|
817
817
|
default:
|
|
818
818
|
return null;
|
|
819
819
|
}
|
|
820
|
-
},
|
|
820
|
+
}, W = /* @__PURE__ */ o(at.Provider, { value: S, children: /* @__PURE__ */ o("div", { className: `nc-dialog-overlay${A ? " nc-fullscreen" : ""}`, onClick: M, children: /* @__PURE__ */ N(
|
|
821
821
|
"div",
|
|
822
822
|
{
|
|
823
823
|
ref: m,
|
|
824
|
-
className: `nc-dialog-container ${
|
|
824
|
+
className: `nc-dialog-container ${v}`,
|
|
825
825
|
style: s,
|
|
826
826
|
tabIndex: -1,
|
|
827
827
|
role: "dialog",
|
|
@@ -830,16 +830,16 @@ function vr({
|
|
|
830
830
|
children: [
|
|
831
831
|
!b && /* @__PURE__ */ N("div", { className: "nc-dialog-header", children: [
|
|
832
832
|
/* @__PURE__ */ o("h3", { id: "nc-dialog-title", className: "nc-dialog-title", children: n }),
|
|
833
|
-
/* @__PURE__ */ o(
|
|
833
|
+
/* @__PURE__ */ o(ct, { onClick: t, "aria-label": "Close dialog" })
|
|
834
834
|
] }),
|
|
835
835
|
/* @__PURE__ */ o("div", { ref: f, className: "nc-dialog-content", children: r }),
|
|
836
836
|
B()
|
|
837
837
|
]
|
|
838
838
|
}
|
|
839
839
|
) }) });
|
|
840
|
-
return A ?
|
|
840
|
+
return A ? ye(W, document.body) : W;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function jt({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
843
843
|
const r = t === "small" ? 28 : 34;
|
|
844
844
|
return /* @__PURE__ */ o(
|
|
845
845
|
"button",
|
|
@@ -868,7 +868,7 @@ function Yt({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
|
868
868
|
}
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Kt({ visible: e, onClick: t, size: n = "default" }) {
|
|
872
872
|
const r = n === "small" ? 28 : 34, s = n === "small" ? 16 : 18;
|
|
873
873
|
return /* @__PURE__ */ o(
|
|
874
874
|
"button",
|
|
@@ -892,11 +892,11 @@ function jt({ visible: e, onClick: t, size: n = "default" }) {
|
|
|
892
892
|
alignItems: "center",
|
|
893
893
|
justifyContent: "center"
|
|
894
894
|
},
|
|
895
|
-
children: e ? /* @__PURE__ */ o(
|
|
895
|
+
children: e ? /* @__PURE__ */ o($t, { size: s }) : /* @__PURE__ */ o(Mt, { size: s })
|
|
896
896
|
}
|
|
897
897
|
);
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Ut({
|
|
900
900
|
value: e,
|
|
901
901
|
defaultValue: t = "",
|
|
902
902
|
onChange: n,
|
|
@@ -908,63 +908,63 @@ function _t({
|
|
|
908
908
|
label: l,
|
|
909
909
|
clearable: d = !0,
|
|
910
910
|
type: u = "text",
|
|
911
|
-
className:
|
|
911
|
+
className: w = "",
|
|
912
912
|
size: p = "default",
|
|
913
913
|
appearance: h = "default",
|
|
914
914
|
style: A,
|
|
915
915
|
leadingIcon: b,
|
|
916
|
-
showPasswordToggle:
|
|
916
|
+
showPasswordToggle: v = !1,
|
|
917
917
|
multiline: y = !1,
|
|
918
918
|
rows: m = 3,
|
|
919
919
|
validator: f,
|
|
920
920
|
showErrorMessage: g = !0
|
|
921
921
|
}) {
|
|
922
|
-
const S =
|
|
922
|
+
const S = Y(null), M = Y(null), B = Y(!1), [W, k] = R(!1), [I, x] = R(!1), [$, L] = R(!1), H = e !== void 0, [E, z] = R(t), O = H ? e : E, [C, P] = R(O), G = f ? f(O) : null, D = !!G, q = !y && h === "plain", te = q && I, re = te ? C : O;
|
|
923
923
|
F(() => {
|
|
924
|
-
|
|
925
|
-
}, [O,
|
|
926
|
-
const
|
|
927
|
-
let
|
|
928
|
-
|
|
929
|
-
const
|
|
924
|
+
te || P(O);
|
|
925
|
+
}, [O, te]);
|
|
926
|
+
const oe = u === "password", se = oe && v && !a && !y, le = d && re && !a && (I || $), ke = p === "small" ? 32 : 44;
|
|
927
|
+
let V = 12;
|
|
928
|
+
le && se ? V = ke * 2 : (le || se) && (V = ke);
|
|
929
|
+
const _ = b ? p === "small" ? 28 : 34 : void 0, X = () => {
|
|
930
930
|
if (!q)
|
|
931
931
|
return O;
|
|
932
932
|
const Q = C !== O;
|
|
933
|
-
return
|
|
933
|
+
return H || z(C), Q && (n == null || n(C), r == null || r(C)), C;
|
|
934
934
|
}, K = () => {
|
|
935
|
-
|
|
936
|
-
},
|
|
937
|
-
var Q,
|
|
935
|
+
P(O);
|
|
936
|
+
}, kt = () => {
|
|
937
|
+
var Q, ie, Ke;
|
|
938
938
|
if (q) {
|
|
939
|
-
|
|
939
|
+
P(""), i == null || i(), (Q = S.current) == null || Q.focus();
|
|
940
940
|
return;
|
|
941
941
|
}
|
|
942
|
-
|
|
943
|
-
},
|
|
942
|
+
H || z(""), n == null || n(""), i == null || i(), y ? (ie = M.current) == null || ie.focus() : (Ke = S.current) == null || Ke.focus();
|
|
943
|
+
}, Fe = (Q) => {
|
|
944
944
|
if (q && Q.key === "Escape") {
|
|
945
945
|
Q.preventDefault(), B.current = !0, K(), Q.currentTarget.blur();
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
948
|
if (Q.key === "Enter" && !y) {
|
|
949
|
-
const
|
|
950
|
-
q && (Q.preventDefault(), B.current = !0, Q.currentTarget.blur()), s == null || s(
|
|
949
|
+
const ie = q ? X() : O;
|
|
950
|
+
q && (Q.preventDefault(), B.current = !0, Q.currentTarget.blur()), s == null || s(ie);
|
|
951
951
|
}
|
|
952
|
-
},
|
|
953
|
-
const
|
|
952
|
+
}, Ge = (Q) => {
|
|
953
|
+
const ie = Q.target.value;
|
|
954
954
|
if (q) {
|
|
955
|
-
|
|
955
|
+
P(ie), n == null || n(ie);
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
|
-
|
|
959
|
-
},
|
|
960
|
-
x(!0), q &&
|
|
961
|
-
},
|
|
958
|
+
H || z(ie), n == null || n(ie);
|
|
959
|
+
}, _e = () => {
|
|
960
|
+
x(!0), q && P(O);
|
|
961
|
+
}, Ye = () => {
|
|
962
962
|
if (q && B.current) {
|
|
963
963
|
B.current = !1, x(!1);
|
|
964
964
|
return;
|
|
965
965
|
}
|
|
966
966
|
q && X(), x(!1);
|
|
967
|
-
},
|
|
967
|
+
}, je = `nc-input ${p === "small" ? "nc-small " : ""}${!y && h === "plain" ? "nc-plain " : ""}${D ? "nc-error " : ""}${w}`;
|
|
968
968
|
return /* @__PURE__ */ N(
|
|
969
969
|
"div",
|
|
970
970
|
{
|
|
@@ -980,61 +980,61 @@ function _t({
|
|
|
980
980
|
"textarea",
|
|
981
981
|
{
|
|
982
982
|
ref: M,
|
|
983
|
-
className:
|
|
983
|
+
className: je,
|
|
984
984
|
placeholder: c,
|
|
985
|
-
value:
|
|
986
|
-
onChange:
|
|
987
|
-
onKeyDown:
|
|
988
|
-
onFocus:
|
|
989
|
-
onBlur:
|
|
985
|
+
value: re,
|
|
986
|
+
onChange: Ge,
|
|
987
|
+
onKeyDown: Fe,
|
|
988
|
+
onFocus: _e,
|
|
989
|
+
onBlur: Ye,
|
|
990
990
|
readOnly: a,
|
|
991
991
|
"aria-disabled": a,
|
|
992
992
|
tabIndex: a ? -1 : void 0,
|
|
993
993
|
rows: m,
|
|
994
994
|
style: {
|
|
995
995
|
width: "100%",
|
|
996
|
-
paddingRight:
|
|
997
|
-
...
|
|
996
|
+
paddingRight: V,
|
|
997
|
+
..._ !== void 0 ? { paddingLeft: _ } : {}
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
1000
|
) : /* @__PURE__ */ o(
|
|
1001
1001
|
"input",
|
|
1002
1002
|
{
|
|
1003
1003
|
ref: S,
|
|
1004
|
-
type:
|
|
1005
|
-
className:
|
|
1004
|
+
type: oe && W ? "text" : u,
|
|
1005
|
+
className: je,
|
|
1006
1006
|
placeholder: c,
|
|
1007
|
-
value:
|
|
1008
|
-
onChange:
|
|
1009
|
-
onKeyDown:
|
|
1010
|
-
onFocus:
|
|
1011
|
-
onBlur:
|
|
1007
|
+
value: re,
|
|
1008
|
+
onChange: Ge,
|
|
1009
|
+
onKeyDown: Fe,
|
|
1010
|
+
onFocus: _e,
|
|
1011
|
+
onBlur: Ye,
|
|
1012
1012
|
readOnly: a,
|
|
1013
1013
|
"aria-disabled": a,
|
|
1014
1014
|
tabIndex: a ? -1 : void 0,
|
|
1015
1015
|
style: {
|
|
1016
1016
|
width: "100%",
|
|
1017
|
-
paddingRight:
|
|
1018
|
-
...
|
|
1017
|
+
paddingRight: V,
|
|
1018
|
+
..._ !== void 0 ? { paddingLeft: _ } : {}
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
),
|
|
1022
|
-
|
|
1023
|
-
|
|
1022
|
+
le && /* @__PURE__ */ o(jt, { onClick: kt, size: p, rightOffset: se ? ke + 4 : 4 }),
|
|
1023
|
+
se && /* @__PURE__ */ o(Kt, { visible: W, onClick: () => k(!W), size: p })
|
|
1024
1024
|
] }),
|
|
1025
1025
|
D && g && /* @__PURE__ */ o("span", { className: "nc-error-message", children: G })
|
|
1026
1026
|
]
|
|
1027
1027
|
}
|
|
1028
1028
|
);
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function kr({
|
|
1031
1031
|
children: e,
|
|
1032
1032
|
onClick: t,
|
|
1033
1033
|
showBorder: n = !0,
|
|
1034
1034
|
selectable: r = !1,
|
|
1035
1035
|
style: s
|
|
1036
1036
|
}) {
|
|
1037
|
-
const [i, c] =
|
|
1037
|
+
const [i, c] = Ve.useState(!1);
|
|
1038
1038
|
return /* @__PURE__ */ o(
|
|
1039
1039
|
"div",
|
|
1040
1040
|
{
|
|
@@ -1062,7 +1062,7 @@ function wr({
|
|
|
1062
1062
|
}
|
|
1063
1063
|
);
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function Nr({ title: e, titleTools: t, children: n, style: r }) {
|
|
1066
1066
|
return /* @__PURE__ */ N("div", { className: "nc-list-group", style: r, children: [
|
|
1067
1067
|
(e || t) && /* @__PURE__ */ N("div", { className: "nc-list-group-title", children: [
|
|
1068
1068
|
/* @__PURE__ */ o("div", { children: e }),
|
|
@@ -1077,15 +1077,15 @@ function yr({ title: e, titleTools: t, children: n, style: r }) {
|
|
|
1077
1077
|
)
|
|
1078
1078
|
] });
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1081
|
-
const [i, c] = R(!1), [a, l] = R(""), d =
|
|
1080
|
+
function Ar({ values: e, onChange: t, options: n, placeholder: r = "Select…", label: s }) {
|
|
1081
|
+
const [i, c] = R(!1), [a, l] = R(""), d = Y(null), u = fe(() => n.filter((p) => p.label.toLowerCase().includes(a.toLowerCase())), [n, a]);
|
|
1082
1082
|
F(() => {
|
|
1083
1083
|
function p(h) {
|
|
1084
1084
|
!(h.target instanceof Node) || !d.current || d.current.contains(h.target) || c(!1);
|
|
1085
1085
|
}
|
|
1086
1086
|
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
1087
1087
|
}, []);
|
|
1088
|
-
const
|
|
1088
|
+
const w = (p) => {
|
|
1089
1089
|
e.includes(p) ? t(e.filter((h) => h !== p)) : t([...e, p]);
|
|
1090
1090
|
};
|
|
1091
1091
|
return /* @__PURE__ */ N("div", { ref: d, className: "nc-col", style: { position: "relative" }, children: [
|
|
@@ -1101,7 +1101,7 @@ function xr({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
1101
1101
|
{
|
|
1102
1102
|
className: "nc-button nc-ghost",
|
|
1103
1103
|
style: { padding: 0, minHeight: 0, height: 20, width: 20, display: "inline-flex", alignItems: "center", justifyContent: "center", border: "none" },
|
|
1104
|
-
onClick: () =>
|
|
1104
|
+
onClick: () => w(p),
|
|
1105
1105
|
"aria-label": `Remove ${h.label}`,
|
|
1106
1106
|
children: "✕"
|
|
1107
1107
|
}
|
|
@@ -1122,7 +1122,7 @@ function xr({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
1122
1122
|
i && /* @__PURE__ */ N("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: [
|
|
1123
1123
|
u.map((p) => {
|
|
1124
1124
|
const h = e.includes(p.value);
|
|
1125
|
-
return /* @__PURE__ */ N("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () =>
|
|
1125
|
+
return /* @__PURE__ */ N("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () => w(p.value), children: [
|
|
1126
1126
|
/* @__PURE__ */ o("span", { children: p.label }),
|
|
1127
1127
|
/* @__PURE__ */ o("span", { children: h ? "✔️" : "" })
|
|
1128
1128
|
] }, p.value);
|
|
@@ -1151,18 +1151,18 @@ function Se(e) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
return `${n}-${r}`;
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Ue(e) {
|
|
1155
1155
|
if (!e) return "";
|
|
1156
1156
|
const t = Se(e);
|
|
1157
1157
|
if (!/^\d{4}-\d{2}$/.test(t)) return e;
|
|
1158
1158
|
const [n, r] = t.split("-");
|
|
1159
1159
|
return `${n}/${r}`;
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function qe() {
|
|
1162
1162
|
const e = /* @__PURE__ */ new Date(), t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0");
|
|
1163
1163
|
return `${t}-${n}`;
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1165
|
+
function Sr({
|
|
1166
1166
|
startMonth: e,
|
|
1167
1167
|
endMonth: t,
|
|
1168
1168
|
onChange: n,
|
|
@@ -1171,7 +1171,7 @@ function kr({
|
|
|
1171
1171
|
disabled: i = !1,
|
|
1172
1172
|
size: c = "default"
|
|
1173
1173
|
}) {
|
|
1174
|
-
const [a, l] = R(!1), [d, u] = R(""), [
|
|
1174
|
+
const [a, l] = R(!1), [d, u] = R(""), [w, p] = R(""), [h, A] = R({ top: 0, left: 0, width: 0, right: void 0 }), b = Y(null), v = Y(null);
|
|
1175
1175
|
F(() => {
|
|
1176
1176
|
if (a && b.current) {
|
|
1177
1177
|
const x = b.current.getBoundingClientRect(), L = Math.max(x.width, 400);
|
|
@@ -1191,25 +1191,25 @@ function kr({
|
|
|
1191
1191
|
}, [a]), F(() => {
|
|
1192
1192
|
if (!a) return;
|
|
1193
1193
|
const x = ($) => {
|
|
1194
|
-
b.current && !b.current.contains($.target) &&
|
|
1194
|
+
b.current && !b.current.contains($.target) && v.current && !v.current.contains($.target) && l(!1);
|
|
1195
1195
|
};
|
|
1196
1196
|
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
1197
1197
|
}, [a]);
|
|
1198
1198
|
const y = () => {
|
|
1199
|
-
u(e ||
|
|
1199
|
+
u(e || qe()), p(t || qe()), l(!0);
|
|
1200
1200
|
}, m = () => {
|
|
1201
1201
|
l(!1);
|
|
1202
1202
|
}, f = () => {
|
|
1203
|
-
const x = Ce(d), $ = Ce(
|
|
1203
|
+
const x = Ce(d), $ = Ce(w);
|
|
1204
1204
|
if (x || $)
|
|
1205
1205
|
return;
|
|
1206
|
-
const L = Se(d),
|
|
1207
|
-
L &&
|
|
1208
|
-
}, g = e && t ? `${
|
|
1206
|
+
const L = Se(d), H = Se(w);
|
|
1207
|
+
L && H && (n == null || n(L, H)), l(!1);
|
|
1208
|
+
}, g = e && t ? `${Ue(e)} - ${Ue(t)}` : "Select month range", S = Ce(d), M = Ce(w), B = Se(d), W = Se(w), k = B && W && B > W, I = a ? ye(
|
|
1209
1209
|
/* @__PURE__ */ o(
|
|
1210
1210
|
"div",
|
|
1211
1211
|
{
|
|
1212
|
-
ref:
|
|
1212
|
+
ref: v,
|
|
1213
1213
|
className: "nc-month-range-picker-popup",
|
|
1214
1214
|
style: {
|
|
1215
1215
|
position: "fixed",
|
|
@@ -1241,7 +1241,7 @@ function kr({
|
|
|
1241
1241
|
{
|
|
1242
1242
|
type: "text",
|
|
1243
1243
|
className: `nc-month-input ${M ? "nc-error" : ""}`,
|
|
1244
|
-
value:
|
|
1244
|
+
value: w,
|
|
1245
1245
|
onChange: (x) => p(x.target.value),
|
|
1246
1246
|
placeholder: "YY-M(M) or YYYY-M(M)"
|
|
1247
1247
|
}
|
|
@@ -1256,7 +1256,7 @@ function kr({
|
|
|
1256
1256
|
{
|
|
1257
1257
|
variant: "primary",
|
|
1258
1258
|
onClick: f,
|
|
1259
|
-
disabled: !d || !
|
|
1259
|
+
disabled: !d || !w || !!S || !!M || !!k,
|
|
1260
1260
|
children: "Apply"
|
|
1261
1261
|
}
|
|
1262
1262
|
),
|
|
@@ -1279,12 +1279,12 @@ function kr({
|
|
|
1279
1279
|
children: g
|
|
1280
1280
|
}
|
|
1281
1281
|
),
|
|
1282
|
-
|
|
1282
|
+
I
|
|
1283
1283
|
] });
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1286
|
-
function
|
|
1287
|
-
const u = d === "small",
|
|
1285
|
+
const qt = 5, Xt = 3;
|
|
1286
|
+
function Cr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disabled: c, className: a = "", style: l, size: d = "default" }) {
|
|
1287
|
+
const u = d === "small", w = (String(s).split(".")[1] || "").length, p = Y(null), h = Y(!1), A = Y(null), [b, v] = R(!1), [y, m] = R(() => String(e)), f = (E) => parseFloat(E.toFixed(w)), g = (E) => {
|
|
1288
1288
|
const z = f(E);
|
|
1289
1289
|
m(String(z)), t(z);
|
|
1290
1290
|
}, S = () => {
|
|
@@ -1298,7 +1298,7 @@ function Nr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disa
|
|
|
1298
1298
|
if (m(z), z === "") return;
|
|
1299
1299
|
const O = parseFloat(z);
|
|
1300
1300
|
isNaN(O) || t(O);
|
|
1301
|
-
},
|
|
1301
|
+
}, W = () => {
|
|
1302
1302
|
const E = y;
|
|
1303
1303
|
if (E === "") {
|
|
1304
1304
|
g(n !== void 0 ? n : 0);
|
|
@@ -1319,37 +1319,37 @@ function Nr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disa
|
|
|
1319
1319
|
hasMoved: !1,
|
|
1320
1320
|
lastValue: e
|
|
1321
1321
|
}, A.current = setTimeout(() => {
|
|
1322
|
-
h.current = !0,
|
|
1322
|
+
h.current = !0, v(!0);
|
|
1323
1323
|
}, 200), E.currentTarget.setPointerCapture(E.pointerId));
|
|
1324
|
-
},
|
|
1324
|
+
}, I = (E) => {
|
|
1325
1325
|
const z = p.current;
|
|
1326
1326
|
if (!z || z.pointerId !== E.pointerId) return;
|
|
1327
1327
|
const O = z.startY - E.clientY;
|
|
1328
|
-
if (Math.abs(O) >=
|
|
1329
|
-
const C = Math.trunc(O /
|
|
1330
|
-
let
|
|
1331
|
-
n !== void 0 && (
|
|
1328
|
+
if (Math.abs(O) >= Xt && (z.hasMoved = !0, h.current = !0, A.current && (clearTimeout(A.current), A.current = null), v(!0)), !z.hasMoved) return;
|
|
1329
|
+
const C = Math.trunc(O / qt);
|
|
1330
|
+
let P = z.startValue + C * s;
|
|
1331
|
+
n !== void 0 && (P = Math.max(n, P)), r !== void 0 && (P = Math.min(r, P)), P = f(P), P !== z.lastValue && (z.lastValue = P, m(String(P)), t(P));
|
|
1332
1332
|
}, x = (E) => {
|
|
1333
1333
|
const z = p.current;
|
|
1334
|
-
!z || z.pointerId !== E.pointerId || (A.current && (clearTimeout(A.current), A.current = null), E.currentTarget.hasPointerCapture(E.pointerId) && E.currentTarget.releasePointerCapture(E.pointerId), p.current = null,
|
|
1334
|
+
!z || z.pointerId !== E.pointerId || (A.current && (clearTimeout(A.current), A.current = null), E.currentTarget.hasPointerCapture(E.pointerId) && E.currentTarget.releasePointerCapture(E.pointerId), p.current = null, v(!1));
|
|
1335
1335
|
}, $ = (E) => (z) => {
|
|
1336
1336
|
if (h.current) {
|
|
1337
1337
|
h.current = !1, z.preventDefault();
|
|
1338
1338
|
return;
|
|
1339
1339
|
}
|
|
1340
1340
|
E();
|
|
1341
|
-
}, L = y === "" ? NaN : parseFloat(y),
|
|
1341
|
+
}, L = y === "" ? NaN : parseFloat(y), H = y === "" || isNaN(L) || n !== void 0 && L < n || r !== void 0 && L > r;
|
|
1342
1342
|
return /* @__PURE__ */ N("div", { className: `nc-col nc-number-input-col ${u ? "nc-small" : ""}`, children: [
|
|
1343
1343
|
i && /* @__PURE__ */ o("span", { className: `nc-label ${u ? "nc-small" : ""}`, children: i }),
|
|
1344
1344
|
/* @__PURE__ */ N("div", { className: `nc-number-input-container ${u ? "nc-small" : ""} ${a}`, style: l, children: [
|
|
1345
1345
|
/* @__PURE__ */ o(
|
|
1346
1346
|
"input",
|
|
1347
1347
|
{
|
|
1348
|
-
className: `nc-input nc-number-input ${u ? "nc-small" : ""} ${
|
|
1348
|
+
className: `nc-input nc-number-input ${u ? "nc-small" : ""} ${H ? "nc-error" : ""}`,
|
|
1349
1349
|
type: "number",
|
|
1350
1350
|
value: y,
|
|
1351
1351
|
onChange: B,
|
|
1352
|
-
onBlur:
|
|
1352
|
+
onBlur: W,
|
|
1353
1353
|
min: n,
|
|
1354
1354
|
max: r,
|
|
1355
1355
|
step: s,
|
|
@@ -1367,7 +1367,7 @@ function Nr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disa
|
|
|
1367
1367
|
className: `nc-number-input-spin nc-number-input-spin-up ${u ? "nc-small" : ""}`,
|
|
1368
1368
|
onClick: $(M),
|
|
1369
1369
|
onPointerDown: k,
|
|
1370
|
-
onPointerMove:
|
|
1370
|
+
onPointerMove: I,
|
|
1371
1371
|
onPointerUp: x,
|
|
1372
1372
|
onPointerCancel: x,
|
|
1373
1373
|
disabled: c || r !== void 0 && e >= r,
|
|
@@ -1381,7 +1381,7 @@ function Nr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disa
|
|
|
1381
1381
|
className: `nc-number-input-spin nc-number-input-spin-down ${u ? "nc-small" : ""}`,
|
|
1382
1382
|
onClick: $(S),
|
|
1383
1383
|
onPointerDown: k,
|
|
1384
|
-
onPointerMove:
|
|
1384
|
+
onPointerMove: I,
|
|
1385
1385
|
onPointerUp: x,
|
|
1386
1386
|
onPointerCancel: x,
|
|
1387
1387
|
disabled: c || n !== void 0 && e <= n,
|
|
@@ -1395,7 +1395,7 @@ function Nr({ value: e, onChange: t, min: n, max: r, step: s = 1, label: i, disa
|
|
|
1395
1395
|
] })
|
|
1396
1396
|
] });
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function $r({
|
|
1399
1399
|
value: e,
|
|
1400
1400
|
onChange: t,
|
|
1401
1401
|
min: n = 0,
|
|
@@ -1410,7 +1410,7 @@ function Ar({
|
|
|
1410
1410
|
const u = (p) => {
|
|
1411
1411
|
const h = parseFloat(p.target.value);
|
|
1412
1412
|
t(h);
|
|
1413
|
-
},
|
|
1413
|
+
}, w = (e - n) / (r - n) * 100;
|
|
1414
1414
|
return /* @__PURE__ */ N("div", { className: "nc-col", style: { gap: 6 }, children: [
|
|
1415
1415
|
i && /* @__PURE__ */ o("span", { className: "nc-label", children: i }),
|
|
1416
1416
|
/* @__PURE__ */ N("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
|
|
@@ -1427,7 +1427,7 @@ function Ar({
|
|
|
1427
1427
|
disabled: c,
|
|
1428
1428
|
style: {
|
|
1429
1429
|
width: d,
|
|
1430
|
-
"--nc-slider-percentage": `${
|
|
1430
|
+
"--nc-slider-percentage": `${w}%`
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
1433
|
),
|
|
@@ -1447,13 +1447,13 @@ function Ar({
|
|
|
1447
1447
|
] })
|
|
1448
1448
|
] });
|
|
1449
1449
|
}
|
|
1450
|
-
const
|
|
1451
|
-
function
|
|
1450
|
+
const Zt = ({ size: e = 24, className: t, style: n }) => /* @__PURE__ */ o("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: t, style: n, children: /* @__PURE__ */ o("polyline", { points: "18 15 12 9 6 15" }) });
|
|
1451
|
+
function Qt({ children: e, className: t = "", style: n }) {
|
|
1452
1452
|
return /* @__PURE__ */ o("div", { className: `nc-tab-panel ${t}`, style: n, children: e });
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1455
|
-
const i =
|
|
1456
|
-
(a) =>
|
|
1454
|
+
function Mr({ active: e, children: t, keepMounted: n = !1, className: r = "", style: s }) {
|
|
1455
|
+
const i = Et.toArray(t).filter(
|
|
1456
|
+
(a) => Tt(a) && (a.type === Qt || a.type.displayName === "TabPanel")
|
|
1457
1457
|
);
|
|
1458
1458
|
if (n)
|
|
1459
1459
|
return /* @__PURE__ */ o("div", { className: `nc-tab-panels ${r}`, style: s, children: i.map((a) => {
|
|
@@ -1472,8 +1472,8 @@ function Sr({ active: e, children: t, keepMounted: n = !1, className: r = "", st
|
|
|
1472
1472
|
const c = i.find((a) => a.props.tab === e);
|
|
1473
1473
|
return /* @__PURE__ */ o("div", { className: `nc-tab-panels ${r}`, style: s, children: c });
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const u =
|
|
1475
|
+
function Pr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: s, className: i, toolbar: c, multiline: a, orientation: l = "horizontal", style: d }) {
|
|
1476
|
+
const u = Y(null), [w, p] = R(!1), [h, A] = R(!1), b = l === "verticalLeft" || l === "verticalRight", v = Y(!1), y = Y(0), m = Y(0), f = Y(!1);
|
|
1477
1477
|
F(() => {
|
|
1478
1478
|
const k = () => {
|
|
1479
1479
|
if (u.current)
|
|
@@ -1484,39 +1484,39 @@ function Cr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: s, cla
|
|
|
1484
1484
|
const { scrollLeft: x, scrollWidth: $, clientWidth: L } = u.current;
|
|
1485
1485
|
p(x > 1), A(x < $ - L - 1);
|
|
1486
1486
|
}
|
|
1487
|
-
},
|
|
1488
|
-
if (
|
|
1489
|
-
return k(),
|
|
1490
|
-
|
|
1487
|
+
}, I = u.current;
|
|
1488
|
+
if (I)
|
|
1489
|
+
return k(), I.addEventListener("scroll", k), window.addEventListener("resize", k), () => {
|
|
1490
|
+
I.removeEventListener("scroll", k), window.removeEventListener("resize", k);
|
|
1491
1491
|
};
|
|
1492
1492
|
}, [e, b]);
|
|
1493
1493
|
const g = (k) => {
|
|
1494
|
-
u.current && (
|
|
1494
|
+
u.current && (v.current = !0, f.current = !1, y.current = b ? k.clientY : k.clientX, m.current = b ? u.current.scrollTop : u.current.scrollLeft, u.current.style.cursor = "grabbing", u.current.style.userSelect = "none");
|
|
1495
1495
|
}, S = (k) => {
|
|
1496
|
-
if (!
|
|
1497
|
-
const
|
|
1496
|
+
if (!v.current || !u.current) return;
|
|
1497
|
+
const I = b ? k.clientY : k.clientX, x = y.current - I;
|
|
1498
1498
|
Math.abs(x) > 3 && (f.current = !0), b ? u.current.scrollTop = m.current + x : u.current.scrollLeft = m.current + x;
|
|
1499
1499
|
}, M = () => {
|
|
1500
|
-
u.current && (
|
|
1500
|
+
u.current && (v.current = !1, u.current.style.cursor = "", u.current.style.userSelect = "");
|
|
1501
1501
|
}, B = () => {
|
|
1502
1502
|
M();
|
|
1503
1503
|
};
|
|
1504
1504
|
F(() => {
|
|
1505
1505
|
const k = u.current;
|
|
1506
1506
|
if (!k || b) return;
|
|
1507
|
-
const
|
|
1507
|
+
const I = (x) => {
|
|
1508
1508
|
x.deltaY !== 0 && (x.preventDefault(), k.scrollLeft += x.deltaY * 0.3);
|
|
1509
1509
|
};
|
|
1510
|
-
return k.addEventListener("wheel",
|
|
1511
|
-
k.removeEventListener("wheel",
|
|
1510
|
+
return k.addEventListener("wheel", I, { passive: !1 }), () => {
|
|
1511
|
+
k.removeEventListener("wheel", I);
|
|
1512
1512
|
};
|
|
1513
1513
|
}, [b]);
|
|
1514
|
-
const
|
|
1514
|
+
const W = (k) => {
|
|
1515
1515
|
f.current || n(k);
|
|
1516
1516
|
};
|
|
1517
1517
|
return /* @__PURE__ */ N("div", { className: `nc-tab-container ${b ? `nc-vertical nc-${l}` : ""} ${i || ""}`, style: d, children: [
|
|
1518
1518
|
/* @__PURE__ */ N("div", { className: "nc-tab-scroll-wrapper", children: [
|
|
1519
|
-
|
|
1519
|
+
w && /* @__PURE__ */ o("div", { className: `nc-tab-scroll-indicator ${b ? "nc-top" : "nc-left"}`, children: b ? /* @__PURE__ */ o(Zt, { size: 16 }) : /* @__PURE__ */ o(Pt, { size: 16 }) }),
|
|
1520
1520
|
/* @__PURE__ */ o(
|
|
1521
1521
|
"div",
|
|
1522
1522
|
{
|
|
@@ -1528,16 +1528,16 @@ function Cr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: s, cla
|
|
|
1528
1528
|
onMouseLeave: B,
|
|
1529
1529
|
style: { cursor: "grab" },
|
|
1530
1530
|
children: e.map((k) => {
|
|
1531
|
-
const
|
|
1531
|
+
const I = typeof k == "string" ? k : k.id, x = typeof k == "string" ? k : k.label, $ = r && !(s != null && s.includes(I));
|
|
1532
1532
|
return /* @__PURE__ */ N(
|
|
1533
1533
|
"div",
|
|
1534
1534
|
{
|
|
1535
|
-
className: `nc-tab-item ${t ===
|
|
1536
|
-
onClick: () =>
|
|
1535
|
+
className: `nc-tab-item ${t === I ? "nc-active" : ""} ${$ ? "nc-closable" : ""}`,
|
|
1536
|
+
onClick: () => W(I),
|
|
1537
1537
|
role: "button",
|
|
1538
1538
|
tabIndex: 0,
|
|
1539
1539
|
onKeyDown: (L) => {
|
|
1540
|
-
(L.key === "Enter" || L.key === " ") && n(
|
|
1540
|
+
(L.key === "Enter" || L.key === " ") && n(I);
|
|
1541
1541
|
},
|
|
1542
1542
|
children: [
|
|
1543
1543
|
/* @__PURE__ */ o("span", { className: "nc-tab-label", children: b ? x : typeof x == "string" ? x.toUpperCase() : x }),
|
|
@@ -1547,12 +1547,12 @@ function Cr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: s, cla
|
|
|
1547
1547
|
className: "nc-tab-close",
|
|
1548
1548
|
role: "button",
|
|
1549
1549
|
tabIndex: 0,
|
|
1550
|
-
"aria-label": `Close ${typeof x == "string" ? x :
|
|
1550
|
+
"aria-label": `Close ${typeof x == "string" ? x : I}`,
|
|
1551
1551
|
onClick: (L) => {
|
|
1552
|
-
L.stopPropagation(), r(
|
|
1552
|
+
L.stopPropagation(), r(I);
|
|
1553
1553
|
},
|
|
1554
1554
|
onKeyDown: (L) => {
|
|
1555
|
-
(L.key === "Enter" || L.key === " ") && (L.stopPropagation(), r(
|
|
1555
|
+
(L.key === "Enter" || L.key === " ") && (L.stopPropagation(), r(I));
|
|
1556
1556
|
},
|
|
1557
1557
|
children: /* @__PURE__ */ N("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1558
1558
|
/* @__PURE__ */ o("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -1562,17 +1562,17 @@ function Cr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: s, cla
|
|
|
1562
1562
|
)
|
|
1563
1563
|
]
|
|
1564
1564
|
},
|
|
1565
|
-
|
|
1565
|
+
I
|
|
1566
1566
|
);
|
|
1567
1567
|
})
|
|
1568
1568
|
}
|
|
1569
1569
|
),
|
|
1570
|
-
h && /* @__PURE__ */ o("div", { className: `nc-tab-scroll-indicator ${b ? "nc-bottom" : "nc-right"}`, children: b ? /* @__PURE__ */ o(
|
|
1570
|
+
h && /* @__PURE__ */ o("div", { className: `nc-tab-scroll-indicator ${b ? "nc-bottom" : "nc-right"}`, children: b ? /* @__PURE__ */ o(ot, { size: 16 }) : /* @__PURE__ */ o(st, { size: 16 }) })
|
|
1571
1571
|
] }),
|
|
1572
1572
|
c && /* @__PURE__ */ o("div", { className: "nc-tab-toolbar", children: c })
|
|
1573
1573
|
] });
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Ir({ checked: e, onChange: t, disabled: n, label: r }) {
|
|
1576
1576
|
return /* @__PURE__ */ N(
|
|
1577
1577
|
"label",
|
|
1578
1578
|
{
|
|
@@ -1624,7 +1624,7 @@ function $r({ checked: e, onChange: t, disabled: n, label: r }) {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
);
|
|
1626
1626
|
}
|
|
1627
|
-
const
|
|
1627
|
+
const Xe = [
|
|
1628
1628
|
"var(--nc-csv-col-0)",
|
|
1629
1629
|
"var(--nc-csv-col-1)",
|
|
1630
1630
|
"var(--nc-csv-col-2)",
|
|
@@ -1636,24 +1636,24 @@ const Ue = [
|
|
|
1636
1636
|
"var(--nc-csv-col-8)",
|
|
1637
1637
|
"var(--nc-csv-col-9)"
|
|
1638
1638
|
];
|
|
1639
|
-
function
|
|
1639
|
+
function Jt(e, t) {
|
|
1640
1640
|
const r = e.slice(0, t).split(`
|
|
1641
1641
|
`), s = r.length, c = r[s - 1].split(" "), a = c.length, l = c[a - 1].length + 1;
|
|
1642
1642
|
return { line: s, column: a, character: l, offset: t };
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function en(e, t, n, r) {
|
|
1645
1645
|
const s = e.split(`
|
|
1646
1646
|
`), i = Math.max(1, Math.min(t, s.length));
|
|
1647
1647
|
let c = 0;
|
|
1648
|
-
for (let
|
|
1649
|
-
c += s[
|
|
1648
|
+
for (let w = 0; w < i - 1; w++)
|
|
1649
|
+
c += s[w].length + 1;
|
|
1650
1650
|
const l = s[i - 1].split(" "), d = Math.max(1, Math.min(n, l.length));
|
|
1651
|
-
for (let
|
|
1652
|
-
c += l[
|
|
1651
|
+
for (let w = 0; w < d - 1; w++)
|
|
1652
|
+
c += l[w].length + 1;
|
|
1653
1653
|
const u = Math.max(1, Math.min(r, l[d - 1].length + 1));
|
|
1654
1654
|
return c += u - 1, c;
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function tn(e, t) {
|
|
1657
1657
|
const n = e.split(`
|
|
1658
1658
|
`), r = Math.max(1, Math.min(t, n.length));
|
|
1659
1659
|
let s = 0;
|
|
@@ -1661,14 +1661,14 @@ function Jt(e, t) {
|
|
|
1661
1661
|
s += n[i].length + 1;
|
|
1662
1662
|
return s;
|
|
1663
1663
|
}
|
|
1664
|
-
const
|
|
1664
|
+
const Rr = Lt(
|
|
1665
1665
|
function({ value: t, onChange: n, placeholder: r, className: s, style: i, showLineNumbers: c = !1, onCursorChange: a, highlightLine: l }, d) {
|
|
1666
|
-
const u =
|
|
1667
|
-
|
|
1666
|
+
const u = Y(null), w = Y(null), p = Y(null);
|
|
1667
|
+
zt(d, () => ({
|
|
1668
1668
|
goToLine(m) {
|
|
1669
1669
|
const f = u.current;
|
|
1670
1670
|
if (!f) return;
|
|
1671
|
-
const g =
|
|
1671
|
+
const g = tn(t, m);
|
|
1672
1672
|
f.focus(), f.setSelectionRange(g, g);
|
|
1673
1673
|
const S = parseFloat(getComputedStyle(f).lineHeight) || 18;
|
|
1674
1674
|
f.scrollTop = (Math.max(1, m) - 1) * S, A(), h();
|
|
@@ -1676,7 +1676,7 @@ const Mr = Et(
|
|
|
1676
1676
|
goToPosition(m, f, g) {
|
|
1677
1677
|
const S = u.current;
|
|
1678
1678
|
if (!S) return;
|
|
1679
|
-
const M =
|
|
1679
|
+
const M = en(t, m, f, g);
|
|
1680
1680
|
S.focus(), S.setSelectionRange(M, M);
|
|
1681
1681
|
const B = parseFloat(getComputedStyle(S).lineHeight) || 18;
|
|
1682
1682
|
S.scrollTop = (Math.max(1, m) - 1) * B, A(), h();
|
|
@@ -1684,11 +1684,11 @@ const Mr = Et(
|
|
|
1684
1684
|
}), [t]);
|
|
1685
1685
|
const h = Z(() => {
|
|
1686
1686
|
if (!a || !u.current) return;
|
|
1687
|
-
const m =
|
|
1687
|
+
const m = Jt(t, u.current.selectionStart);
|
|
1688
1688
|
a(m);
|
|
1689
1689
|
}, [a, t]), A = Z(() => {
|
|
1690
1690
|
const m = u.current;
|
|
1691
|
-
m && (
|
|
1691
|
+
m && (w.current && (w.current.scrollTop = m.scrollTop, w.current.scrollLeft = m.scrollLeft), p.current && (p.current.scrollTop = m.scrollTop));
|
|
1692
1692
|
}, []);
|
|
1693
1693
|
F(() => {
|
|
1694
1694
|
if (l == null || l < 1) return;
|
|
@@ -1697,8 +1697,8 @@ const Mr = Et(
|
|
|
1697
1697
|
const f = parseFloat(getComputedStyle(m).lineHeight) || 18, g = (l - 1) * f, S = g + f;
|
|
1698
1698
|
(g < m.scrollTop || S > m.scrollTop + m.clientHeight) && (m.scrollTop = g - m.clientHeight / 2 + f / 2), A();
|
|
1699
1699
|
}, [l]);
|
|
1700
|
-
const b =
|
|
1701
|
-
`).length, [t]),
|
|
1700
|
+
const b = fe(() => t.split(`
|
|
1701
|
+
`).length, [t]), v = () => {
|
|
1702
1702
|
const m = [];
|
|
1703
1703
|
for (let f = 1; f <= b; f++)
|
|
1704
1704
|
m.push(
|
|
@@ -1709,18 +1709,18 @@ const Mr = Et(
|
|
|
1709
1709
|
`).map((g, S) => {
|
|
1710
1710
|
const M = g.split(" ");
|
|
1711
1711
|
return /* @__PURE__ */ N("div", { className: `nc-csv-line ${l === S + 1 ? "nc-csv-highlight" : ""}`, children: [
|
|
1712
|
-
M.map((B,
|
|
1713
|
-
|
|
1714
|
-
/* @__PURE__ */ o("span", { style: { color:
|
|
1715
|
-
] },
|
|
1712
|
+
M.map((B, W) => /* @__PURE__ */ N("span", { children: [
|
|
1713
|
+
W > 0 && /* @__PURE__ */ o("span", { className: "nc-csv-tab-char", children: " " }),
|
|
1714
|
+
/* @__PURE__ */ o("span", { style: { color: Xe[W % Xe.length] }, children: B })
|
|
1715
|
+
] }, W)),
|
|
1716
1716
|
g === "" && `
|
|
1717
1717
|
`
|
|
1718
1718
|
] }, S);
|
|
1719
1719
|
}) : null;
|
|
1720
1720
|
return /* @__PURE__ */ N("div", { className: `nc-csv-textarea-container ${c ? "nc-csv-with-gutter" : ""} ${s ?? ""}`, style: i, children: [
|
|
1721
|
-
c &&
|
|
1721
|
+
c && v(),
|
|
1722
1722
|
/* @__PURE__ */ N("div", { className: "nc-csv-textarea-editor", children: [
|
|
1723
|
-
/* @__PURE__ */ o("div", { className: "nc-csv-textarea-backdrop", ref:
|
|
1723
|
+
/* @__PURE__ */ o("div", { className: "nc-csv-textarea-backdrop", ref: w, children: /* @__PURE__ */ o("pre", { className: "nc-csv-textarea-highlights", children: y(t) }) }),
|
|
1724
1724
|
/* @__PURE__ */ o(
|
|
1725
1725
|
"textarea",
|
|
1726
1726
|
{
|
|
@@ -1743,41 +1743,41 @@ const Mr = Et(
|
|
|
1743
1743
|
] })
|
|
1744
1744
|
] });
|
|
1745
1745
|
}
|
|
1746
|
-
),
|
|
1747
|
-
function
|
|
1748
|
-
const t = e.trim().match(
|
|
1746
|
+
), Te = /^[vV]?(\d+)\.(\d+)\.(\d+|x)(?:[-._]([0-9A-Za-z._-]+))?$/, nn = /^-+$/, lt = "__branches__", rn = "__unreleased__", on = 340, Re = 6, $e = 12;
|
|
1747
|
+
function Ze(e) {
|
|
1748
|
+
const t = e.trim().match(Te);
|
|
1749
1749
|
return t ? `${t[1]}.${t[2]}` : null;
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function sn(e, t) {
|
|
1752
1752
|
const [n, r] = e.split(".").map(Number), [s, i] = t.split(".").map(Number);
|
|
1753
1753
|
return s - n || i - r;
|
|
1754
1754
|
}
|
|
1755
|
-
function
|
|
1755
|
+
function cn(e, t) {
|
|
1756
1756
|
return e === void 0 ? t === void 0 ? 0 : 1 : t === void 0 ? -1 : e.localeCompare(t, "en", { numeric: !0 });
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function Qe(e) {
|
|
1759
1759
|
return e.toLowerCase() === "x" ? Number.POSITIVE_INFINITY : Number(e);
|
|
1760
1760
|
}
|
|
1761
|
-
function
|
|
1762
|
-
const n = e.trim().match(
|
|
1761
|
+
function an(e, t) {
|
|
1762
|
+
const n = e.trim().match(Te), r = t.trim().match(Te);
|
|
1763
1763
|
if (!n || !r) return 0;
|
|
1764
|
-
const s =
|
|
1765
|
-
return Number(n[1]) - Number(r[1]) || Number(n[2]) - Number(r[2]) || c ||
|
|
1764
|
+
const s = Qe(n[3]), i = Qe(r[3]), c = s === i ? 0 : s < i ? -1 : 1;
|
|
1765
|
+
return Number(n[1]) - Number(r[1]) || Number(n[2]) - Number(r[2]) || c || cn(n[4], r[4]);
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1768
|
-
const n = [], r = /* @__PURE__ */ new Map(), s = { key:
|
|
1769
|
-
key:
|
|
1767
|
+
function ln(e, t) {
|
|
1768
|
+
const n = [], r = /* @__PURE__ */ new Map(), s = { key: lt, label: t.branches, items: [] }, i = {
|
|
1769
|
+
key: rn,
|
|
1770
1770
|
label: t.unreleased,
|
|
1771
1771
|
items: []
|
|
1772
1772
|
};
|
|
1773
1773
|
for (const c of e) {
|
|
1774
1774
|
const a = c.value.trim();
|
|
1775
|
-
if (!a ||
|
|
1775
|
+
if (!a || nn.test(a)) continue;
|
|
1776
1776
|
if (c.kind === "branch") {
|
|
1777
1777
|
s.items.push(c);
|
|
1778
1778
|
continue;
|
|
1779
1779
|
}
|
|
1780
|
-
const l =
|
|
1780
|
+
const l = Ze(a) ?? Ze(c.label);
|
|
1781
1781
|
if (!l) {
|
|
1782
1782
|
i.items.push(c);
|
|
1783
1783
|
continue;
|
|
@@ -1785,20 +1785,20 @@ function sn(e, t) {
|
|
|
1785
1785
|
let d = r.get(l);
|
|
1786
1786
|
d || (d = { key: l, label: l, items: [] }, r.set(l, d), n.push(d)), d.items.push(c);
|
|
1787
1787
|
}
|
|
1788
|
-
s.items.sort((c, a) => c.value === a.value ? 0 : c.value === "master" ? -1 : a.value === "master" ? 1 : a.value.localeCompare(c.value, "en", { numeric: !0 })), n.sort((c, a) =>
|
|
1788
|
+
s.items.sort((c, a) => c.value === a.value ? 0 : c.value === "master" ? -1 : a.value === "master" ? 1 : a.value.localeCompare(c.value, "en", { numeric: !0 })), n.sort((c, a) => sn(c.key, a.key));
|
|
1789
1789
|
for (const c of n)
|
|
1790
|
-
c.items.sort((a, l) => -
|
|
1790
|
+
c.items.sort((a, l) => -an(a.value, l.value));
|
|
1791
1791
|
return [
|
|
1792
1792
|
...s.items.length ? [s] : [],
|
|
1793
1793
|
...i.items.length ? [i] : [],
|
|
1794
1794
|
...n
|
|
1795
1795
|
];
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function dn(e, t) {
|
|
1798
1798
|
var n;
|
|
1799
1799
|
return e.label.toLowerCase().includes(t) || e.value.toLowerCase().includes(t) || (((n = e.description) == null ? void 0 : n.toLowerCase().includes(t)) ?? !1);
|
|
1800
1800
|
}
|
|
1801
|
-
function
|
|
1801
|
+
function Er({
|
|
1802
1802
|
options: e,
|
|
1803
1803
|
value: t,
|
|
1804
1804
|
onChange: n,
|
|
@@ -1810,51 +1810,55 @@ function Ir({
|
|
|
1810
1810
|
loading: l = !1,
|
|
1811
1811
|
error: d,
|
|
1812
1812
|
truncated: u,
|
|
1813
|
-
onRefresh:
|
|
1813
|
+
onRefresh: w,
|
|
1814
1814
|
mode: p
|
|
1815
1815
|
}) {
|
|
1816
|
-
const { t: h } =
|
|
1817
|
-
() =>
|
|
1816
|
+
const { t: h } = ne(), A = p ?? (w ? "refs" : "versions"), b = Y(null), v = Y(null), [y, m] = R(!1), [f, g] = R(""), [S, M] = R(""), [B, W] = R({}), k = fe(
|
|
1817
|
+
() => ln(e, {
|
|
1818
1818
|
branches: h("versionPicker.branches"),
|
|
1819
1819
|
unreleased: h("versionPicker.unreleased")
|
|
1820
1820
|
}),
|
|
1821
1821
|
[e, h]
|
|
1822
|
-
),
|
|
1822
|
+
), I = f.trim().toLowerCase(), x = fe(
|
|
1823
1823
|
() => e.find((C) => C.value === t),
|
|
1824
1824
|
[e, t]
|
|
1825
|
-
), $ =
|
|
1825
|
+
), $ = fe(
|
|
1826
1826
|
() => k.find((C) => C.key === S) ?? k[0],
|
|
1827
1827
|
[k, S]
|
|
1828
|
-
), L =
|
|
1828
|
+
), L = fe(() => I ? k.map((C) => ({
|
|
1829
1829
|
group: C,
|
|
1830
|
-
items: C.items.filter((
|
|
1831
|
-
})).filter((C) => C.items.length > 0) : [], [k,
|
|
1830
|
+
items: C.items.filter((P) => dn(P, I))
|
|
1831
|
+
})).filter((C) => C.items.length > 0) : [], [k, I]);
|
|
1832
1832
|
F(() => {
|
|
1833
1833
|
if (k.length === 0) {
|
|
1834
1834
|
M("");
|
|
1835
1835
|
return;
|
|
1836
1836
|
}
|
|
1837
1837
|
M(
|
|
1838
|
-
(C) => k.some((
|
|
1838
|
+
(C) => k.some((P) => P.key === C) ? C : k[0].key
|
|
1839
1839
|
);
|
|
1840
1840
|
}, [k]), F(() => {
|
|
1841
1841
|
if (!y) return;
|
|
1842
1842
|
const C = (G) => {
|
|
1843
1843
|
var D, q;
|
|
1844
|
-
!((D = b.current) != null && D.contains(G.target)) && !((q =
|
|
1845
|
-
},
|
|
1844
|
+
!((D = b.current) != null && D.contains(G.target)) && !((q = v.current) != null && q.contains(G.target)) && m(!1);
|
|
1845
|
+
}, P = (G) => {
|
|
1846
1846
|
G.key === "Escape" && m(!1);
|
|
1847
1847
|
};
|
|
1848
|
-
return document.addEventListener("mousedown", C), document.addEventListener("keydown",
|
|
1849
|
-
document.removeEventListener("mousedown", C), document.removeEventListener("keydown",
|
|
1848
|
+
return document.addEventListener("mousedown", C), document.addEventListener("keydown", P), () => {
|
|
1849
|
+
document.removeEventListener("mousedown", C), document.removeEventListener("keydown", P);
|
|
1850
1850
|
};
|
|
1851
1851
|
}, [y]), F(() => {
|
|
1852
1852
|
if (!y) return;
|
|
1853
1853
|
const C = () => {
|
|
1854
|
+
var le;
|
|
1854
1855
|
if (!b.current) return;
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
|
|
1856
|
+
const P = b.current.getBoundingClientRect(), G = Math.min(on, window.innerWidth - $e * 2), D = Math.max(
|
|
1857
|
+
$e,
|
|
1858
|
+
Math.min(P.left, window.innerWidth - G - $e)
|
|
1859
|
+
), q = ((le = v.current) == null ? void 0 : le.getBoundingClientRect().height) ?? 0, te = Re + $e, re = window.innerHeight - P.bottom - te, oe = P.top - te, se = q > 0 && re < q && oe > re;
|
|
1860
|
+
W(
|
|
1861
|
+
se ? { bottom: window.innerHeight - P.top + Re, left: D, width: G } : { top: P.bottom + Re, left: D, width: G }
|
|
1858
1862
|
);
|
|
1859
1863
|
};
|
|
1860
1864
|
return C(), window.addEventListener("resize", C), window.addEventListener("scroll", C, !0), () => {
|
|
@@ -1862,10 +1866,10 @@ function Ir({
|
|
|
1862
1866
|
};
|
|
1863
1867
|
}, [y]), F(() => {
|
|
1864
1868
|
if (!y || !t) return;
|
|
1865
|
-
const C = k.find((
|
|
1869
|
+
const C = k.find((P) => P.items.some((G) => G.value === t));
|
|
1866
1870
|
C && M(C.key);
|
|
1867
1871
|
}, [k, y, t]);
|
|
1868
|
-
const
|
|
1872
|
+
const H = (x == null ? void 0 : x.label) ?? t, E = x != null && x.description ? `${H} — ${x.description}` : H, z = (C) => {
|
|
1869
1873
|
r || l || d || (n(C.value), g(""), m(!1));
|
|
1870
1874
|
}, O = (C) => /* @__PURE__ */ o(
|
|
1871
1875
|
J,
|
|
@@ -1903,19 +1907,19 @@ function Ir({
|
|
|
1903
1907
|
/* @__PURE__ */ o(
|
|
1904
1908
|
"span",
|
|
1905
1909
|
{
|
|
1906
|
-
className: `nc-version-picker-trigger-label ${
|
|
1907
|
-
children: l ? h("versionPicker.loading") :
|
|
1910
|
+
className: `nc-version-picker-trigger-label ${H ? "" : "nc-version-picker-trigger-placeholder"}`,
|
|
1911
|
+
children: l ? h("versionPicker.loading") : H || i
|
|
1908
1912
|
}
|
|
1909
1913
|
),
|
|
1910
|
-
d && /* @__PURE__ */ o(
|
|
1911
|
-
/* @__PURE__ */ o(
|
|
1914
|
+
d && /* @__PURE__ */ o(It, { size: 14 }),
|
|
1915
|
+
/* @__PURE__ */ o(ot, { size: 14 })
|
|
1912
1916
|
]
|
|
1913
1917
|
}
|
|
1914
1918
|
),
|
|
1915
|
-
y &&
|
|
1916
|
-
/* @__PURE__ */ N("div", { ref:
|
|
1919
|
+
y && ye(
|
|
1920
|
+
/* @__PURE__ */ N("div", { ref: v, className: "nc-version-picker-popover", style: B, children: [
|
|
1917
1921
|
d && /* @__PURE__ */ o("div", { className: "nc-version-picker-error", role: "alert", children: d }),
|
|
1918
|
-
|
|
1922
|
+
w && /* @__PURE__ */ N("div", { className: "nc-version-picker-ref-header", children: [
|
|
1919
1923
|
/* @__PURE__ */ o("span", { children: h(A === "refs" ? "versionPicker.refsHeader" : "versionPicker.versionsHeader") }),
|
|
1920
1924
|
/* @__PURE__ */ o(
|
|
1921
1925
|
J,
|
|
@@ -1925,17 +1929,17 @@ function Ir({
|
|
|
1925
1929
|
title: h("versionPicker.refresh"),
|
|
1926
1930
|
"aria-label": h("versionPicker.refresh"),
|
|
1927
1931
|
disabled: l,
|
|
1928
|
-
onClick:
|
|
1929
|
-
children: /* @__PURE__ */ o(
|
|
1932
|
+
onClick: w,
|
|
1933
|
+
children: /* @__PURE__ */ o(rt, { size: 15 })
|
|
1930
1934
|
}
|
|
1931
1935
|
)
|
|
1932
1936
|
] }),
|
|
1933
1937
|
(u == null ? void 0 : u.branches) && /* @__PURE__ */ o("div", { className: "nc-version-picker-notice", children: h("versionPicker.branchesIncomplete") }),
|
|
1934
1938
|
(u == null ? void 0 : u.tags) && /* @__PURE__ */ o("div", { className: "nc-version-picker-notice", children: h("versionPicker.tagsIncomplete") }),
|
|
1935
1939
|
/* @__PURE__ */ N("div", { className: "nc-version-picker-search", children: [
|
|
1936
|
-
/* @__PURE__ */ o(
|
|
1940
|
+
/* @__PURE__ */ o(Rt, { size: 15 }),
|
|
1937
1941
|
/* @__PURE__ */ o(
|
|
1938
|
-
|
|
1942
|
+
Ut,
|
|
1939
1943
|
{
|
|
1940
1944
|
value: f,
|
|
1941
1945
|
onChange: g,
|
|
@@ -1945,9 +1949,9 @@ function Ir({
|
|
|
1945
1949
|
}
|
|
1946
1950
|
)
|
|
1947
1951
|
] }),
|
|
1948
|
-
/* @__PURE__ */ o("div", { className: "nc-version-picker-body", children: l || d || k.length === 0 ? /* @__PURE__ */ o("div", { className: "nc-version-picker-empty", children: h(l ? "versionPicker.loading" : d ? "versionPicker.unavailable" : A === "refs" ? "versionPicker.noRefs" : "versionPicker.noVersions") }) :
|
|
1952
|
+
/* @__PURE__ */ o("div", { className: "nc-version-picker-body", children: l || d || k.length === 0 ? /* @__PURE__ */ o("div", { className: "nc-version-picker-empty", children: h(l ? "versionPicker.loading" : d ? "versionPicker.unavailable" : A === "refs" ? "versionPicker.noRefs" : "versionPicker.noVersions") }) : I ? /* @__PURE__ */ o("div", { className: "nc-version-picker-results", children: L.length === 0 ? /* @__PURE__ */ o("div", { className: "nc-version-picker-empty", children: h("versionPicker.noMatches") }) : L.map(({ group: C, items: P }) => /* @__PURE__ */ N("div", { className: "nc-version-picker-result-group", children: [
|
|
1949
1953
|
/* @__PURE__ */ o("div", { className: "nc-version-picker-result-group-label", children: C.label }),
|
|
1950
|
-
/* @__PURE__ */ o("div", { className: "nc-version-picker-option-list", children:
|
|
1954
|
+
/* @__PURE__ */ o("div", { className: "nc-version-picker-option-list", children: P.map(O) })
|
|
1951
1955
|
] }, C.key)) }) : /* @__PURE__ */ N("div", { className: "nc-version-picker-browser", children: [
|
|
1952
1956
|
/* @__PURE__ */ o("div", { className: "nc-version-picker-group-list", children: k.map((C) => /* @__PURE__ */ N(
|
|
1953
1957
|
J,
|
|
@@ -1959,9 +1963,9 @@ function Ir({
|
|
|
1959
1963
|
children: [
|
|
1960
1964
|
/* @__PURE__ */ N("span", { children: [
|
|
1961
1965
|
C.label,
|
|
1962
|
-
(C.key ===
|
|
1966
|
+
(C.key === lt ? u != null && u.branches : u != null && u.tags) ? ` (${h("versionPicker.incomplete")})` : ""
|
|
1963
1967
|
] }),
|
|
1964
|
-
/* @__PURE__ */ o(
|
|
1968
|
+
/* @__PURE__ */ o(st, { size: 13 })
|
|
1965
1969
|
]
|
|
1966
1970
|
},
|
|
1967
1971
|
C.key
|
|
@@ -1978,27 +1982,27 @@ function Ir({
|
|
|
1978
1982
|
}
|
|
1979
1983
|
);
|
|
1980
1984
|
}
|
|
1981
|
-
let
|
|
1982
|
-
const
|
|
1983
|
-
function
|
|
1984
|
-
const e =
|
|
1985
|
-
for (const t of Array.from(
|
|
1985
|
+
let me = { notifications: [] };
|
|
1986
|
+
const Le = /* @__PURE__ */ new Set(), Je = /* @__PURE__ */ new Map();
|
|
1987
|
+
function ze() {
|
|
1988
|
+
const e = me.notifications.slice();
|
|
1989
|
+
for (const t of Array.from(Le))
|
|
1986
1990
|
try {
|
|
1987
1991
|
t(e);
|
|
1988
1992
|
} catch {
|
|
1989
1993
|
}
|
|
1990
1994
|
}
|
|
1991
|
-
function
|
|
1992
|
-
|
|
1995
|
+
function un(e) {
|
|
1996
|
+
Le.add(e);
|
|
1993
1997
|
try {
|
|
1994
|
-
e(
|
|
1998
|
+
e(me.notifications.slice());
|
|
1995
1999
|
} catch {
|
|
1996
2000
|
}
|
|
1997
2001
|
return () => {
|
|
1998
|
-
|
|
2002
|
+
Le.delete(e);
|
|
1999
2003
|
};
|
|
2000
2004
|
}
|
|
2001
|
-
function
|
|
2005
|
+
function pn(e) {
|
|
2002
2006
|
const t = `notification-${Date.now()}-${Math.random()}`, { duration: n, type: r, ...s } = e, i = {
|
|
2003
2007
|
id: t,
|
|
2004
2008
|
dismissible: !0,
|
|
@@ -2006,20 +2010,20 @@ function ln(e) {
|
|
|
2006
2010
|
type: r === "error" ? "danger" : r ?? "info",
|
|
2007
2011
|
duration: n ?? 5e3
|
|
2008
2012
|
};
|
|
2009
|
-
return
|
|
2010
|
-
|
|
2013
|
+
return me.notifications = [i, ...me.notifications], ze(), i.duration && i.duration > 0 && setTimeout(() => {
|
|
2014
|
+
dt(t);
|
|
2011
2015
|
}, i.duration), t;
|
|
2012
2016
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const t =
|
|
2017
|
+
function dt(e) {
|
|
2018
|
+
const t = me.notifications.find((r) => r.id === e);
|
|
2015
2019
|
if (!t) return;
|
|
2016
|
-
t.isRemoving = !0,
|
|
2020
|
+
t.isRemoving = !0, ze();
|
|
2017
2021
|
const n = window.setTimeout(() => {
|
|
2018
|
-
|
|
2022
|
+
me.notifications = me.notifications.filter((r) => r.id !== e), ze(), Je.delete(e);
|
|
2019
2023
|
}, 300);
|
|
2020
|
-
|
|
2024
|
+
Je.set(e, n);
|
|
2021
2025
|
}
|
|
2022
|
-
function
|
|
2026
|
+
function fn({ type: e }) {
|
|
2023
2027
|
switch (e) {
|
|
2024
2028
|
case "success":
|
|
2025
2029
|
return /* @__PURE__ */ o("svg", { viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
@@ -2060,8 +2064,8 @@ function dn({ type: e }) {
|
|
|
2060
2064
|
] });
|
|
2061
2065
|
}
|
|
2062
2066
|
}
|
|
2063
|
-
function
|
|
2064
|
-
const { t } =
|
|
2067
|
+
function hn({ notification: e }) {
|
|
2068
|
+
const { t } = ne(), n = e.type || "info", r = () => {
|
|
2065
2069
|
if (e.title) return e.title;
|
|
2066
2070
|
switch (n) {
|
|
2067
2071
|
case "success":
|
|
@@ -2074,14 +2078,14 @@ function un({ notification: e }) {
|
|
|
2074
2078
|
return t("common.info");
|
|
2075
2079
|
}
|
|
2076
2080
|
}, s = () => {
|
|
2077
|
-
|
|
2081
|
+
dt(e.id);
|
|
2078
2082
|
};
|
|
2079
2083
|
return /* @__PURE__ */ o(
|
|
2080
2084
|
"div",
|
|
2081
2085
|
{
|
|
2082
2086
|
className: `nc-notification nc-notification-${n}`,
|
|
2083
2087
|
children: /* @__PURE__ */ N("div", { className: "nc-notification-content", children: [
|
|
2084
|
-
/* @__PURE__ */ o("div", { className: `nc-notification-icon nc-notification-icon-${n}`, children: /* @__PURE__ */ o(
|
|
2088
|
+
/* @__PURE__ */ o("div", { className: `nc-notification-icon nc-notification-icon-${n}`, children: /* @__PURE__ */ o(fn, { type: n }) }),
|
|
2085
2089
|
/* @__PURE__ */ N("div", { className: "nc-notification-body", children: [
|
|
2086
2090
|
/* @__PURE__ */ o("div", { className: "nc-notification-title", children: r() }),
|
|
2087
2091
|
/* @__PURE__ */ o("div", { className: "nc-notification-message", children: e.message })
|
|
@@ -2092,18 +2096,18 @@ function un({ notification: e }) {
|
|
|
2092
2096
|
className: "nc-notification-dismiss",
|
|
2093
2097
|
onClick: s,
|
|
2094
2098
|
"aria-label": t("common.close"),
|
|
2095
|
-
children: /* @__PURE__ */ o(
|
|
2099
|
+
children: /* @__PURE__ */ o(De, { size: 16 })
|
|
2096
2100
|
}
|
|
2097
2101
|
)
|
|
2098
2102
|
] })
|
|
2099
2103
|
}
|
|
2100
2104
|
);
|
|
2101
2105
|
}
|
|
2102
|
-
function
|
|
2103
|
-
const [e, t] = R([]), [n, r] = R(/* @__PURE__ */ new Map()), [s, i] = R(/* @__PURE__ */ new Set()), c =
|
|
2104
|
-
return F(() =>
|
|
2105
|
-
const u = new Set(a.current.map((p) => p.id)),
|
|
2106
|
-
|
|
2106
|
+
function Tr() {
|
|
2107
|
+
const [e, t] = R([]), [n, r] = R(/* @__PURE__ */ new Map()), [s, i] = R(/* @__PURE__ */ new Set()), c = Y(null), a = Y([]);
|
|
2108
|
+
return F(() => un((d) => {
|
|
2109
|
+
const u = new Set(a.current.map((p) => p.id)), w = d.filter((p) => !u.has(p.id)).map((p) => p.id);
|
|
2110
|
+
w.length > 0 ? (t(d), i(new Set(w)), requestAnimationFrame(() => {
|
|
2107
2111
|
requestAnimationFrame(() => {
|
|
2108
2112
|
i(/* @__PURE__ */ new Set());
|
|
2109
2113
|
});
|
|
@@ -2113,10 +2117,10 @@ function Pr() {
|
|
|
2113
2117
|
const l = /* @__PURE__ */ new Map();
|
|
2114
2118
|
let d = 0;
|
|
2115
2119
|
const u = c.current.children;
|
|
2116
|
-
e.forEach((
|
|
2117
|
-
if (l.set(
|
|
2120
|
+
e.forEach((w, p) => {
|
|
2121
|
+
if (l.set(w.id, d), u[p]) {
|
|
2118
2122
|
const h = u[p].offsetHeight;
|
|
2119
|
-
|
|
2123
|
+
w.isRemoving || (d += h + 12);
|
|
2120
2124
|
}
|
|
2121
2125
|
}), r(l);
|
|
2122
2126
|
}, [e]), /* @__PURE__ */ o(
|
|
@@ -2140,7 +2144,7 @@ function Pr() {
|
|
|
2140
2144
|
width: "100%"
|
|
2141
2145
|
},
|
|
2142
2146
|
children: e.map((l) => {
|
|
2143
|
-
const d = s.has(l.id), u = l.isRemoving,
|
|
2147
|
+
const d = s.has(l.id), u = l.isRemoving, w = n.get(l.id) || 0;
|
|
2144
2148
|
return /* @__PURE__ */ o(
|
|
2145
2149
|
"div",
|
|
2146
2150
|
{
|
|
@@ -2148,13 +2152,13 @@ function Pr() {
|
|
|
2148
2152
|
position: "absolute",
|
|
2149
2153
|
top: 0,
|
|
2150
2154
|
left: 0,
|
|
2151
|
-
transform: d ? `translate3d(-40px, ${
|
|
2155
|
+
transform: d ? `translate3d(-40px, ${w}px, 0)` : `translate3d(0, ${w}px, 0)`,
|
|
2152
2156
|
// Only animate transform when not leaving, animate opacity always
|
|
2153
2157
|
transition: u ? "opacity 300ms ease-out" : "transform 300ms ease-out, opacity 300ms ease-out",
|
|
2154
2158
|
opacity: u ? 0 : 1,
|
|
2155
2159
|
width: "100%"
|
|
2156
2160
|
},
|
|
2157
|
-
children: /* @__PURE__ */ o(
|
|
2161
|
+
children: /* @__PURE__ */ o(hn, { notification: l })
|
|
2158
2162
|
},
|
|
2159
2163
|
l.id
|
|
2160
2164
|
);
|
|
@@ -2164,14 +2168,14 @@ function Pr() {
|
|
|
2164
2168
|
}
|
|
2165
2169
|
);
|
|
2166
2170
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return
|
|
2171
|
+
function mn(e) {
|
|
2172
|
+
return pn(e);
|
|
2169
2173
|
}
|
|
2170
|
-
const
|
|
2171
|
-
show: (e) =>
|
|
2174
|
+
const Lr = {
|
|
2175
|
+
show: (e) => mn(e)
|
|
2172
2176
|
};
|
|
2173
|
-
function
|
|
2174
|
-
const t =
|
|
2177
|
+
function zr(e) {
|
|
2178
|
+
const t = Dt.createInstance(), n = {};
|
|
2175
2179
|
for (const s in e)
|
|
2176
2180
|
n[s] = { translation: e[s] };
|
|
2177
2181
|
const r = typeof document < "u" && document.documentElement.lang || "en";
|
|
@@ -2191,9 +2195,9 @@ function Er(e) {
|
|
|
2191
2195
|
}
|
|
2192
2196
|
}).observe(document.documentElement, { attributes: !0 }), t;
|
|
2193
2197
|
}
|
|
2194
|
-
class
|
|
2198
|
+
class gn {
|
|
2195
2199
|
constructor() {
|
|
2196
|
-
|
|
2200
|
+
de(this, "apps", /* @__PURE__ */ new Map());
|
|
2197
2201
|
}
|
|
2198
2202
|
/**
|
|
2199
2203
|
* Register an app definition.
|
|
@@ -2231,16 +2235,16 @@ class fn {
|
|
|
2231
2235
|
return this.apps.has(t);
|
|
2232
2236
|
}
|
|
2233
2237
|
}
|
|
2234
|
-
const
|
|
2235
|
-
class
|
|
2238
|
+
const ve = new gn(), et = "nc-ui-app-state";
|
|
2239
|
+
class bn {
|
|
2236
2240
|
constructor() {
|
|
2237
|
-
|
|
2238
|
-
|
|
2241
|
+
de(this, "state");
|
|
2242
|
+
de(this, "listeners", /* @__PURE__ */ new Map());
|
|
2239
2243
|
this.state = this.loadState();
|
|
2240
2244
|
}
|
|
2241
2245
|
loadState() {
|
|
2242
2246
|
try {
|
|
2243
|
-
const t = localStorage.getItem(
|
|
2247
|
+
const t = localStorage.getItem(et);
|
|
2244
2248
|
if (t)
|
|
2245
2249
|
return JSON.parse(t);
|
|
2246
2250
|
} catch {
|
|
@@ -2249,7 +2253,7 @@ class hn {
|
|
|
2249
2253
|
}
|
|
2250
2254
|
saveState() {
|
|
2251
2255
|
try {
|
|
2252
|
-
localStorage.setItem(
|
|
2256
|
+
localStorage.setItem(et, JSON.stringify(this.state));
|
|
2253
2257
|
} catch {
|
|
2254
2258
|
}
|
|
2255
2259
|
}
|
|
@@ -2279,13 +2283,13 @@ class hn {
|
|
|
2279
2283
|
(r = this.listeners.get(t)) == null || r.forEach((s) => s(n));
|
|
2280
2284
|
}
|
|
2281
2285
|
}
|
|
2282
|
-
const
|
|
2283
|
-
class
|
|
2286
|
+
const ae = new bn();
|
|
2287
|
+
class vn {
|
|
2284
2288
|
constructor() {
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
+
de(this, "apps", []);
|
|
2290
|
+
de(this, "activeAppId", null);
|
|
2291
|
+
de(this, "listeners", /* @__PURE__ */ new Set());
|
|
2292
|
+
de(this, "refReadyResolvers", /* @__PURE__ */ new Map());
|
|
2289
2293
|
}
|
|
2290
2294
|
/**
|
|
2291
2295
|
* Launch an app and wait for it to be ready (ref populated).
|
|
@@ -2297,16 +2301,16 @@ class mn {
|
|
|
2297
2301
|
*/
|
|
2298
2302
|
async launchApp(t, n) {
|
|
2299
2303
|
const { launchInBackground: r = !1 } = n || {};
|
|
2300
|
-
if (!
|
|
2304
|
+
if (!ve.has(t))
|
|
2301
2305
|
return console.error(`Cannot launch app "${t}": not registered`), null;
|
|
2302
2306
|
const s = this.apps.find((c) => c.appId === t);
|
|
2303
2307
|
if (s)
|
|
2304
|
-
return r || (this.setActiveApp(t),
|
|
2308
|
+
return r || (this.setActiveApp(t), ae._setActiveAppId(t)), s.ref ? s : this.waitForRef(t);
|
|
2305
2309
|
const i = {
|
|
2306
2310
|
appId: t,
|
|
2307
2311
|
launchedAt: Date.now()
|
|
2308
2312
|
};
|
|
2309
|
-
return this.apps.push(i), r || (this.activeAppId = t,
|
|
2313
|
+
return this.apps.push(i), r || (this.activeAppId = t, ae._setActiveAppId(t)), this.notify(), this.waitForRef(t);
|
|
2310
2314
|
}
|
|
2311
2315
|
waitForRef(t) {
|
|
2312
2316
|
return new Promise((n) => {
|
|
@@ -2343,7 +2347,7 @@ class mn {
|
|
|
2343
2347
|
const r = this.apps[n];
|
|
2344
2348
|
if (r.ref && (r.ref = void 0), this.apps.splice(n, 1), this.activeAppId === t) {
|
|
2345
2349
|
const s = window.innerWidth >= 768;
|
|
2346
|
-
this.activeAppId = s && this.apps.length > 0 ? this.apps[this.apps.length - 1].appId : null,
|
|
2350
|
+
this.activeAppId = s && this.apps.length > 0 ? this.apps[this.apps.length - 1].appId : null, ae._setActiveAppId(this.activeAppId);
|
|
2347
2351
|
}
|
|
2348
2352
|
this.notify();
|
|
2349
2353
|
}
|
|
@@ -2355,7 +2359,7 @@ class mn {
|
|
|
2355
2359
|
console.warn(`Cannot activate app "${t}": not running`);
|
|
2356
2360
|
return;
|
|
2357
2361
|
}
|
|
2358
|
-
this.activeAppId !== t && (this.activeAppId = t, this.notify(),
|
|
2362
|
+
this.activeAppId !== t && (this.activeAppId = t, this.notify(), ae._setActiveAppId(t));
|
|
2359
2363
|
}
|
|
2360
2364
|
/**
|
|
2361
2365
|
* Toggle an app: if active, deactivate; if inactive, activate.
|
|
@@ -2373,7 +2377,7 @@ class mn {
|
|
|
2373
2377
|
* Get the currently active app definition.
|
|
2374
2378
|
*/
|
|
2375
2379
|
getActiveApp() {
|
|
2376
|
-
return this.activeAppId ?
|
|
2380
|
+
return this.activeAppId ? ve.get(this.activeAppId) ?? null : null;
|
|
2377
2381
|
}
|
|
2378
2382
|
/**
|
|
2379
2383
|
* Get all running apps.
|
|
@@ -2399,14 +2403,14 @@ class mn {
|
|
|
2399
2403
|
this.listeners.forEach((t) => t());
|
|
2400
2404
|
}
|
|
2401
2405
|
}
|
|
2402
|
-
const ee = new
|
|
2403
|
-
function
|
|
2404
|
-
const e =
|
|
2406
|
+
const ee = new vn(), ut = we(null);
|
|
2407
|
+
function wn() {
|
|
2408
|
+
const e = he(ut);
|
|
2405
2409
|
if (!e)
|
|
2406
2410
|
throw new Error("useApp must be used inside an App");
|
|
2407
2411
|
return e;
|
|
2408
2412
|
}
|
|
2409
|
-
function
|
|
2413
|
+
function yn({ size: e = 16 }) {
|
|
2410
2414
|
return /* @__PURE__ */ N(
|
|
2411
2415
|
"svg",
|
|
2412
2416
|
{
|
|
@@ -2425,7 +2429,7 @@ function bn({ size: e = 16 }) {
|
|
|
2425
2429
|
}
|
|
2426
2430
|
);
|
|
2427
2431
|
}
|
|
2428
|
-
function
|
|
2432
|
+
function xn({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: s }) {
|
|
2429
2433
|
return /* @__PURE__ */ N("div", { className: "nc-app-title-bar", children: [
|
|
2430
2434
|
/* @__PURE__ */ N("div", { className: "nc-app-title-bar-left", children: [
|
|
2431
2435
|
n && !s && /* @__PURE__ */ o(
|
|
@@ -2435,18 +2439,18 @@ function vn({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: s })
|
|
|
2435
2439
|
onClick: n,
|
|
2436
2440
|
title: "Back",
|
|
2437
2441
|
"aria-label": "Go back",
|
|
2438
|
-
children: /* @__PURE__ */ o(
|
|
2442
|
+
children: /* @__PURE__ */ o(yn, { size: 16 })
|
|
2439
2443
|
}
|
|
2440
2444
|
),
|
|
2441
2445
|
/* @__PURE__ */ o("span", { className: "nc-app-title-bar-title", children: e })
|
|
2442
2446
|
] }),
|
|
2443
2447
|
/* @__PURE__ */ N("div", { className: "nc-app-title-bar-right", children: [
|
|
2444
2448
|
r && /* @__PURE__ */ o("div", { className: "nc-app-title-bar-toolbar", children: r }),
|
|
2445
|
-
/* @__PURE__ */ o(
|
|
2449
|
+
/* @__PURE__ */ o(ct, { onClick: t, "aria-label": "Close application" })
|
|
2446
2450
|
] })
|
|
2447
2451
|
] });
|
|
2448
2452
|
}
|
|
2449
|
-
class
|
|
2453
|
+
class kn extends Ve.Component {
|
|
2450
2454
|
constructor(t) {
|
|
2451
2455
|
super(t), this.state = { hasError: !1 };
|
|
2452
2456
|
}
|
|
@@ -2463,14 +2467,14 @@ class wn extends Be.Component {
|
|
|
2463
2467
|
] }) : this.props.children;
|
|
2464
2468
|
}
|
|
2465
2469
|
}
|
|
2466
|
-
function
|
|
2467
|
-
const { t: r } =
|
|
2468
|
-
|
|
2470
|
+
function pt({ appId: e, isActive: t, onClose: n }) {
|
|
2471
|
+
const { t: r } = ne(), s = ve.get(e), [i, c] = R(""), [a, l] = R(null), [d, u] = R(null), [w, p] = R(!1), [h, A] = R(!1);
|
|
2472
|
+
Ve.useEffect(() => {
|
|
2469
2473
|
s != null && s.titleKey && c(r(s.titleKey));
|
|
2470
2474
|
}, [s, r]);
|
|
2471
2475
|
const b = Z((k) => {
|
|
2472
2476
|
c(k);
|
|
2473
|
-
}, []),
|
|
2477
|
+
}, []), v = Z((k) => {
|
|
2474
2478
|
l(() => k);
|
|
2475
2479
|
}, []), y = Z(() => {
|
|
2476
2480
|
l(null);
|
|
@@ -2482,32 +2486,32 @@ function dt({ appId: e, isActive: t, onClose: n }) {
|
|
|
2482
2486
|
p(k);
|
|
2483
2487
|
}, []), S = Z((k) => {
|
|
2484
2488
|
A(k);
|
|
2485
|
-
}, []), M =
|
|
2489
|
+
}, []), M = fe(() => ({
|
|
2486
2490
|
setTitle: b,
|
|
2487
|
-
setBackHandler:
|
|
2491
|
+
setBackHandler: v,
|
|
2488
2492
|
clearBackHandler: y,
|
|
2489
2493
|
setToolbar: m,
|
|
2490
2494
|
clearToolbar: f,
|
|
2491
2495
|
setHideBackButton: g,
|
|
2492
2496
|
setHideTitleBar: S,
|
|
2493
2497
|
close: n
|
|
2494
|
-
}), [b,
|
|
2498
|
+
}), [b, v, y, m, f, g, S, n]);
|
|
2495
2499
|
if (!s)
|
|
2496
2500
|
return null;
|
|
2497
|
-
const B = s.component,
|
|
2501
|
+
const B = s.component, W = !s.hideTitleBar && !h;
|
|
2498
2502
|
return /* @__PURE__ */ N(
|
|
2499
2503
|
"div",
|
|
2500
2504
|
{
|
|
2501
2505
|
className: `nc-app-container${t ? "" : " nc-hidden"}`,
|
|
2502
2506
|
children: [
|
|
2503
|
-
|
|
2504
|
-
|
|
2507
|
+
W && /* @__PURE__ */ o(
|
|
2508
|
+
xn,
|
|
2505
2509
|
{
|
|
2506
2510
|
title: i,
|
|
2507
2511
|
onClose: n,
|
|
2508
2512
|
onBack: a ?? void 0,
|
|
2509
2513
|
toolbar: d,
|
|
2510
|
-
hideBackButton:
|
|
2514
|
+
hideBackButton: w
|
|
2511
2515
|
}
|
|
2512
2516
|
),
|
|
2513
2517
|
/* @__PURE__ */ o(
|
|
@@ -2516,12 +2520,12 @@ function dt({ appId: e, isActive: t, onClose: n }) {
|
|
|
2516
2520
|
className: "nc-app-content-wrapper",
|
|
2517
2521
|
style: {
|
|
2518
2522
|
padding: s.padding,
|
|
2519
|
-
overflowY:
|
|
2523
|
+
overflowY: W ? "auto" : void 0
|
|
2520
2524
|
},
|
|
2521
|
-
children: /* @__PURE__ */ o(
|
|
2522
|
-
|
|
2525
|
+
children: /* @__PURE__ */ o(ut.Provider, { value: M, children: /* @__PURE__ */ o(kn, { appId: e, children: /* @__PURE__ */ o(
|
|
2526
|
+
Bt,
|
|
2523
2527
|
{
|
|
2524
|
-
fallback: /* @__PURE__ */ o("div", { className: "nc-app-loading", children: /* @__PURE__ */ o(
|
|
2528
|
+
fallback: /* @__PURE__ */ o("div", { className: "nc-app-loading", children: /* @__PURE__ */ o(it, {}) }),
|
|
2525
2529
|
children: /* @__PURE__ */ o(B, {})
|
|
2526
2530
|
}
|
|
2527
2531
|
) }) })
|
|
@@ -2531,21 +2535,21 @@ function dt({ appId: e, isActive: t, onClose: n }) {
|
|
|
2531
2535
|
}
|
|
2532
2536
|
);
|
|
2533
2537
|
}
|
|
2534
|
-
const
|
|
2538
|
+
const Me = 768, Pe = 1024, ft = {
|
|
2535
2539
|
isMobile: !1,
|
|
2536
2540
|
isTablet: !1,
|
|
2537
2541
|
isDesktop: !0,
|
|
2538
2542
|
width: typeof window < "u" ? window.innerWidth : 1024,
|
|
2539
2543
|
height: typeof window < "u" ? window.innerHeight : 768
|
|
2540
|
-
},
|
|
2541
|
-
function
|
|
2544
|
+
}, ht = we(ft);
|
|
2545
|
+
function Br({ children: e }) {
|
|
2542
2546
|
const [t, n] = R(() => {
|
|
2543
|
-
if (typeof window > "u") return
|
|
2547
|
+
if (typeof window > "u") return ft;
|
|
2544
2548
|
const r = window.innerWidth, s = window.innerHeight;
|
|
2545
2549
|
return {
|
|
2546
|
-
isMobile: r <
|
|
2547
|
-
isTablet: r >=
|
|
2548
|
-
isDesktop: r >=
|
|
2550
|
+
isMobile: r < Me,
|
|
2551
|
+
isTablet: r >= Me && r < Pe,
|
|
2552
|
+
isDesktop: r >= Pe,
|
|
2549
2553
|
width: r,
|
|
2550
2554
|
height: s
|
|
2551
2555
|
};
|
|
@@ -2554,54 +2558,54 @@ function Tr({ children: e }) {
|
|
|
2554
2558
|
const r = () => {
|
|
2555
2559
|
const s = window.innerWidth, i = window.innerHeight;
|
|
2556
2560
|
n({
|
|
2557
|
-
isMobile: s <
|
|
2558
|
-
isTablet: s >=
|
|
2559
|
-
isDesktop: s >=
|
|
2561
|
+
isMobile: s < Me,
|
|
2562
|
+
isTablet: s >= Me && s < Pe,
|
|
2563
|
+
isDesktop: s >= Pe,
|
|
2560
2564
|
width: s,
|
|
2561
2565
|
height: i
|
|
2562
2566
|
});
|
|
2563
2567
|
};
|
|
2564
2568
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
2565
|
-
}, []), /* @__PURE__ */ o(
|
|
2569
|
+
}, []), /* @__PURE__ */ o(ht.Provider, { value: t, children: e });
|
|
2566
2570
|
}
|
|
2567
|
-
function
|
|
2568
|
-
return
|
|
2571
|
+
function mt() {
|
|
2572
|
+
return he(ht);
|
|
2569
2573
|
}
|
|
2570
|
-
const
|
|
2571
|
-
const t =
|
|
2574
|
+
const We = "-", Nn = (e) => {
|
|
2575
|
+
const t = Sn(e), {
|
|
2572
2576
|
conflictingClassGroups: n,
|
|
2573
2577
|
conflictingClassGroupModifiers: r
|
|
2574
2578
|
} = e;
|
|
2575
2579
|
return {
|
|
2576
2580
|
getClassGroupId: (c) => {
|
|
2577
|
-
const a = c.split(
|
|
2578
|
-
return a[0] === "" && a.length !== 1 && a.shift(),
|
|
2581
|
+
const a = c.split(We);
|
|
2582
|
+
return a[0] === "" && a.length !== 1 && a.shift(), gt(a, t) || An(c);
|
|
2579
2583
|
},
|
|
2580
2584
|
getConflictingClassGroupIds: (c, a) => {
|
|
2581
2585
|
const l = n[c] || [];
|
|
2582
2586
|
return a && r[c] ? [...l, ...r[c]] : l;
|
|
2583
2587
|
}
|
|
2584
2588
|
};
|
|
2585
|
-
},
|
|
2589
|
+
}, gt = (e, t) => {
|
|
2586
2590
|
var c;
|
|
2587
2591
|
if (e.length === 0)
|
|
2588
2592
|
return t.classGroupId;
|
|
2589
|
-
const n = e[0], r = t.nextPart.get(n), s = r ?
|
|
2593
|
+
const n = e[0], r = t.nextPart.get(n), s = r ? gt(e.slice(1), r) : void 0;
|
|
2590
2594
|
if (s)
|
|
2591
2595
|
return s;
|
|
2592
2596
|
if (t.validators.length === 0)
|
|
2593
2597
|
return;
|
|
2594
|
-
const i = e.join(
|
|
2598
|
+
const i = e.join(We);
|
|
2595
2599
|
return (c = t.validators.find(({
|
|
2596
2600
|
validator: a
|
|
2597
2601
|
}) => a(i))) == null ? void 0 : c.classGroupId;
|
|
2598
|
-
},
|
|
2599
|
-
if (
|
|
2600
|
-
const t =
|
|
2602
|
+
}, tt = /^\[(.+)\]$/, An = (e) => {
|
|
2603
|
+
if (tt.test(e)) {
|
|
2604
|
+
const t = tt.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
|
|
2601
2605
|
if (n)
|
|
2602
2606
|
return "arbitrary.." + n;
|
|
2603
2607
|
}
|
|
2604
|
-
},
|
|
2608
|
+
}, Sn = (e) => {
|
|
2605
2609
|
const {
|
|
2606
2610
|
theme: t,
|
|
2607
2611
|
prefix: n
|
|
@@ -2609,19 +2613,19 @@ const De = "-", yn = (e) => {
|
|
|
2609
2613
|
nextPart: /* @__PURE__ */ new Map(),
|
|
2610
2614
|
validators: []
|
|
2611
2615
|
};
|
|
2612
|
-
return
|
|
2613
|
-
|
|
2616
|
+
return $n(Object.entries(e.classGroups), n).forEach(([i, c]) => {
|
|
2617
|
+
Be(c, r, i, t);
|
|
2614
2618
|
}), r;
|
|
2615
|
-
},
|
|
2619
|
+
}, Be = (e, t, n, r) => {
|
|
2616
2620
|
e.forEach((s) => {
|
|
2617
2621
|
if (typeof s == "string") {
|
|
2618
|
-
const i = s === "" ? t :
|
|
2622
|
+
const i = s === "" ? t : nt(t, s);
|
|
2619
2623
|
i.classGroupId = n;
|
|
2620
2624
|
return;
|
|
2621
2625
|
}
|
|
2622
2626
|
if (typeof s == "function") {
|
|
2623
|
-
if (
|
|
2624
|
-
|
|
2627
|
+
if (Cn(s)) {
|
|
2628
|
+
Be(s(r), t, n, r);
|
|
2625
2629
|
return;
|
|
2626
2630
|
}
|
|
2627
2631
|
t.validators.push({
|
|
@@ -2631,21 +2635,21 @@ const De = "-", yn = (e) => {
|
|
|
2631
2635
|
return;
|
|
2632
2636
|
}
|
|
2633
2637
|
Object.entries(s).forEach(([i, c]) => {
|
|
2634
|
-
|
|
2638
|
+
Be(c, nt(t, i), n, r);
|
|
2635
2639
|
});
|
|
2636
2640
|
});
|
|
2637
|
-
},
|
|
2641
|
+
}, nt = (e, t) => {
|
|
2638
2642
|
let n = e;
|
|
2639
|
-
return t.split(
|
|
2643
|
+
return t.split(We).forEach((r) => {
|
|
2640
2644
|
n.nextPart.has(r) || n.nextPart.set(r, {
|
|
2641
2645
|
nextPart: /* @__PURE__ */ new Map(),
|
|
2642
2646
|
validators: []
|
|
2643
2647
|
}), n = n.nextPart.get(r);
|
|
2644
2648
|
}), n;
|
|
2645
|
-
},
|
|
2649
|
+
}, Cn = (e) => e.isThemeGetter, $n = (e, t) => t ? e.map(([n, r]) => {
|
|
2646
2650
|
const s = r.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([c, a]) => [t + c, a])) : i);
|
|
2647
2651
|
return [n, s];
|
|
2648
|
-
}) : e,
|
|
2652
|
+
}) : e, Mn = (e) => {
|
|
2649
2653
|
if (e < 1)
|
|
2650
2654
|
return {
|
|
2651
2655
|
get: () => {
|
|
@@ -2669,28 +2673,28 @@ const De = "-", yn = (e) => {
|
|
|
2669
2673
|
n.has(i) ? n.set(i, c) : s(i, c);
|
|
2670
2674
|
}
|
|
2671
2675
|
};
|
|
2672
|
-
},
|
|
2676
|
+
}, bt = "!", Pn = (e) => {
|
|
2673
2677
|
const {
|
|
2674
2678
|
separator: t,
|
|
2675
2679
|
experimentalParseClassName: n
|
|
2676
2680
|
} = e, r = t.length === 1, s = t[0], i = t.length, c = (a) => {
|
|
2677
2681
|
const l = [];
|
|
2678
|
-
let d = 0, u = 0,
|
|
2679
|
-
for (let
|
|
2680
|
-
let y = a[
|
|
2682
|
+
let d = 0, u = 0, w;
|
|
2683
|
+
for (let v = 0; v < a.length; v++) {
|
|
2684
|
+
let y = a[v];
|
|
2681
2685
|
if (d === 0) {
|
|
2682
|
-
if (y === s && (r || a.slice(
|
|
2683
|
-
l.push(a.slice(u,
|
|
2686
|
+
if (y === s && (r || a.slice(v, v + i) === t)) {
|
|
2687
|
+
l.push(a.slice(u, v)), u = v + i;
|
|
2684
2688
|
continue;
|
|
2685
2689
|
}
|
|
2686
2690
|
if (y === "/") {
|
|
2687
|
-
|
|
2691
|
+
w = v;
|
|
2688
2692
|
continue;
|
|
2689
2693
|
}
|
|
2690
2694
|
}
|
|
2691
2695
|
y === "[" ? d++ : y === "]" && d--;
|
|
2692
2696
|
}
|
|
2693
|
-
const p = l.length === 0 ? a : a.substring(u), h = p.startsWith(
|
|
2697
|
+
const p = l.length === 0 ? a : a.substring(u), h = p.startsWith(bt), A = h ? p.substring(1) : p, b = w && w > u ? w - u : void 0;
|
|
2694
2698
|
return {
|
|
2695
2699
|
modifiers: l,
|
|
2696
2700
|
hasImportantModifier: h,
|
|
@@ -2702,7 +2706,7 @@ const De = "-", yn = (e) => {
|
|
|
2702
2706
|
className: a,
|
|
2703
2707
|
parseClassName: c
|
|
2704
2708
|
}) : c;
|
|
2705
|
-
},
|
|
2709
|
+
}, In = (e) => {
|
|
2706
2710
|
if (e.length <= 1)
|
|
2707
2711
|
return e;
|
|
2708
2712
|
const t = [];
|
|
@@ -2710,21 +2714,21 @@ const De = "-", yn = (e) => {
|
|
|
2710
2714
|
return e.forEach((r) => {
|
|
2711
2715
|
r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
|
|
2712
2716
|
}), t.push(...n.sort()), t;
|
|
2713
|
-
},
|
|
2714
|
-
cache:
|
|
2715
|
-
parseClassName:
|
|
2716
|
-
...
|
|
2717
|
-
}),
|
|
2717
|
+
}, Rn = (e) => ({
|
|
2718
|
+
cache: Mn(e.cacheSize),
|
|
2719
|
+
parseClassName: Pn(e),
|
|
2720
|
+
...Nn(e)
|
|
2721
|
+
}), En = /\s+/, Tn = (e, t) => {
|
|
2718
2722
|
const {
|
|
2719
2723
|
parseClassName: n,
|
|
2720
2724
|
getClassGroupId: r,
|
|
2721
2725
|
getConflictingClassGroupIds: s
|
|
2722
|
-
} = t, i = [], c = e.trim().split(
|
|
2726
|
+
} = t, i = [], c = e.trim().split(En);
|
|
2723
2727
|
let a = "";
|
|
2724
2728
|
for (let l = c.length - 1; l >= 0; l -= 1) {
|
|
2725
2729
|
const d = c[l], {
|
|
2726
2730
|
modifiers: u,
|
|
2727
|
-
hasImportantModifier:
|
|
2731
|
+
hasImportantModifier: w,
|
|
2728
2732
|
baseClassName: p,
|
|
2729
2733
|
maybePostfixModifierPosition: h
|
|
2730
2734
|
} = n(d);
|
|
@@ -2740,7 +2744,7 @@ const De = "-", yn = (e) => {
|
|
|
2740
2744
|
}
|
|
2741
2745
|
A = !1;
|
|
2742
2746
|
}
|
|
2743
|
-
const
|
|
2747
|
+
const v = In(u).join(":"), y = w ? v + bt : v, m = y + b;
|
|
2744
2748
|
if (i.includes(m))
|
|
2745
2749
|
continue;
|
|
2746
2750
|
i.push(m);
|
|
@@ -2753,76 +2757,76 @@ const De = "-", yn = (e) => {
|
|
|
2753
2757
|
}
|
|
2754
2758
|
return a;
|
|
2755
2759
|
};
|
|
2756
|
-
function
|
|
2760
|
+
function Ln() {
|
|
2757
2761
|
let e = 0, t, n, r = "";
|
|
2758
2762
|
for (; e < arguments.length; )
|
|
2759
|
-
(t = arguments[e++]) && (n =
|
|
2763
|
+
(t = arguments[e++]) && (n = vt(t)) && (r && (r += " "), r += n);
|
|
2760
2764
|
return r;
|
|
2761
2765
|
}
|
|
2762
|
-
const
|
|
2766
|
+
const vt = (e) => {
|
|
2763
2767
|
if (typeof e == "string")
|
|
2764
2768
|
return e;
|
|
2765
2769
|
let t, n = "";
|
|
2766
2770
|
for (let r = 0; r < e.length; r++)
|
|
2767
|
-
e[r] && (t =
|
|
2771
|
+
e[r] && (t = vt(e[r])) && (n && (n += " "), n += t);
|
|
2768
2772
|
return n;
|
|
2769
2773
|
};
|
|
2770
|
-
function
|
|
2774
|
+
function zn(e, ...t) {
|
|
2771
2775
|
let n, r, s, i = c;
|
|
2772
2776
|
function c(l) {
|
|
2773
|
-
const d = t.reduce((u,
|
|
2774
|
-
return n =
|
|
2777
|
+
const d = t.reduce((u, w) => w(u), e());
|
|
2778
|
+
return n = Rn(d), r = n.cache.get, s = n.cache.set, i = a, a(l);
|
|
2775
2779
|
}
|
|
2776
2780
|
function a(l) {
|
|
2777
2781
|
const d = r(l);
|
|
2778
2782
|
if (d)
|
|
2779
2783
|
return d;
|
|
2780
|
-
const u =
|
|
2784
|
+
const u = Tn(l, n);
|
|
2781
2785
|
return s(l, u), u;
|
|
2782
2786
|
}
|
|
2783
2787
|
return function() {
|
|
2784
|
-
return i(
|
|
2788
|
+
return i(Ln.apply(null, arguments));
|
|
2785
2789
|
};
|
|
2786
2790
|
}
|
|
2787
2791
|
const U = (e) => {
|
|
2788
2792
|
const t = (n) => n[e] || [];
|
|
2789
2793
|
return t.isThemeGetter = !0, t;
|
|
2790
|
-
},
|
|
2791
|
-
const r =
|
|
2794
|
+
}, wt = /^\[(?:([a-z-]+):)?(.+)\]$/i, Bn = /^\d+\/\d+$/, Dn = /* @__PURE__ */ new Set(["px", "full", "screen"]), Vn = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Wn = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Hn = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, On = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Fn = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ce = (e) => be(e) || Dn.has(e) || Bn.test(e), ue = (e) => xe(e, "length", Xn), be = (e) => !!e && !Number.isNaN(Number(e)), Ee = (e) => xe(e, "number", be), Ne = (e) => !!e && Number.isInteger(Number(e)), Gn = (e) => e.endsWith("%") && be(e.slice(0, -1)), T = (e) => wt.test(e), pe = (e) => Vn.test(e), _n = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Yn = (e) => xe(e, _n, yt), jn = (e) => xe(e, "position", yt), Kn = /* @__PURE__ */ new Set(["image", "url"]), Un = (e) => xe(e, Kn, Qn), qn = (e) => xe(e, "", Zn), Ae = () => !0, xe = (e, t, n) => {
|
|
2795
|
+
const r = wt.exec(e);
|
|
2792
2796
|
return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
|
|
2793
|
-
},
|
|
2797
|
+
}, Xn = (e) => (
|
|
2794
2798
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
2795
2799
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
2796
2800
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2797
|
-
|
|
2798
|
-
),
|
|
2799
|
-
const e = U("colors"), t = U("spacing"), n = U("blur"), r = U("brightness"), s = U("borderColor"), i = U("borderRadius"), c = U("borderSpacing"), a = U("borderWidth"), l = U("contrast"), d = U("grayscale"), u = U("hueRotate"),
|
|
2801
|
+
Wn.test(e) && !Hn.test(e)
|
|
2802
|
+
), yt = () => !1, Zn = (e) => On.test(e), Qn = (e) => Fn.test(e), Jn = () => {
|
|
2803
|
+
const e = U("colors"), t = U("spacing"), n = U("blur"), r = U("brightness"), s = U("borderColor"), i = U("borderRadius"), c = U("borderSpacing"), a = U("borderWidth"), l = U("contrast"), d = U("grayscale"), u = U("hueRotate"), w = U("invert"), p = U("gap"), h = U("gradientColorStops"), A = U("gradientColorStopPositions"), b = U("inset"), v = U("margin"), y = U("opacity"), m = U("padding"), f = U("saturate"), g = U("scale"), S = U("sepia"), M = U("skew"), B = U("space"), W = U("translate"), k = () => ["auto", "contain", "none"], I = () => ["auto", "hidden", "clip", "visible", "scroll"], x = () => ["auto", T, t], $ = () => [T, t], L = () => ["", ce, ue], H = () => ["auto", be, T], E = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], z = () => ["solid", "dashed", "dotted", "double", "none"], O = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], C = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], P = () => ["", "0", T], G = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], D = () => [be, T];
|
|
2800
2804
|
return {
|
|
2801
2805
|
cacheSize: 500,
|
|
2802
2806
|
separator: ":",
|
|
2803
2807
|
theme: {
|
|
2804
2808
|
colors: [Ae],
|
|
2805
|
-
spacing: [
|
|
2806
|
-
blur: ["none", "",
|
|
2809
|
+
spacing: [ce, ue],
|
|
2810
|
+
blur: ["none", "", pe, T],
|
|
2807
2811
|
brightness: D(),
|
|
2808
2812
|
borderColor: [e],
|
|
2809
|
-
borderRadius: ["none", "", "full",
|
|
2813
|
+
borderRadius: ["none", "", "full", pe, T],
|
|
2810
2814
|
borderSpacing: $(),
|
|
2811
2815
|
borderWidth: L(),
|
|
2812
2816
|
contrast: D(),
|
|
2813
|
-
grayscale:
|
|
2817
|
+
grayscale: P(),
|
|
2814
2818
|
hueRotate: D(),
|
|
2815
|
-
invert:
|
|
2819
|
+
invert: P(),
|
|
2816
2820
|
gap: $(),
|
|
2817
2821
|
gradientColorStops: [e],
|
|
2818
|
-
gradientColorStopPositions: [
|
|
2822
|
+
gradientColorStopPositions: [Gn, ue],
|
|
2819
2823
|
inset: x(),
|
|
2820
2824
|
margin: x(),
|
|
2821
2825
|
opacity: D(),
|
|
2822
2826
|
padding: $(),
|
|
2823
2827
|
saturate: D(),
|
|
2824
2828
|
scale: D(),
|
|
2825
|
-
sepia:
|
|
2829
|
+
sepia: P(),
|
|
2826
2830
|
skew: D(),
|
|
2827
2831
|
space: $(),
|
|
2828
2832
|
translate: $()
|
|
@@ -2846,7 +2850,7 @@ const U = (e) => {
|
|
|
2846
2850
|
* @see https://tailwindcss.com/docs/columns
|
|
2847
2851
|
*/
|
|
2848
2852
|
columns: [{
|
|
2849
|
-
columns: [
|
|
2853
|
+
columns: [pe]
|
|
2850
2854
|
}],
|
|
2851
2855
|
/**
|
|
2852
2856
|
* Break After
|
|
@@ -2926,21 +2930,21 @@ const U = (e) => {
|
|
|
2926
2930
|
* @see https://tailwindcss.com/docs/overflow
|
|
2927
2931
|
*/
|
|
2928
2932
|
overflow: [{
|
|
2929
|
-
overflow:
|
|
2933
|
+
overflow: I()
|
|
2930
2934
|
}],
|
|
2931
2935
|
/**
|
|
2932
2936
|
* Overflow X
|
|
2933
2937
|
* @see https://tailwindcss.com/docs/overflow
|
|
2934
2938
|
*/
|
|
2935
2939
|
"overflow-x": [{
|
|
2936
|
-
"overflow-x":
|
|
2940
|
+
"overflow-x": I()
|
|
2937
2941
|
}],
|
|
2938
2942
|
/**
|
|
2939
2943
|
* Overflow Y
|
|
2940
2944
|
* @see https://tailwindcss.com/docs/overflow
|
|
2941
2945
|
*/
|
|
2942
2946
|
"overflow-y": [{
|
|
2943
|
-
"overflow-y":
|
|
2947
|
+
"overflow-y": I()
|
|
2944
2948
|
}],
|
|
2945
2949
|
/**
|
|
2946
2950
|
* Overscroll Behavior
|
|
@@ -3077,14 +3081,14 @@ const U = (e) => {
|
|
|
3077
3081
|
* @see https://tailwindcss.com/docs/flex-grow
|
|
3078
3082
|
*/
|
|
3079
3083
|
grow: [{
|
|
3080
|
-
grow:
|
|
3084
|
+
grow: P()
|
|
3081
3085
|
}],
|
|
3082
3086
|
/**
|
|
3083
3087
|
* Flex Shrink
|
|
3084
3088
|
* @see https://tailwindcss.com/docs/flex-shrink
|
|
3085
3089
|
*/
|
|
3086
3090
|
shrink: [{
|
|
3087
|
-
shrink:
|
|
3091
|
+
shrink: P()
|
|
3088
3092
|
}],
|
|
3089
3093
|
/**
|
|
3090
3094
|
* Order
|
|
@@ -3114,14 +3118,14 @@ const U = (e) => {
|
|
|
3114
3118
|
* @see https://tailwindcss.com/docs/grid-column
|
|
3115
3119
|
*/
|
|
3116
3120
|
"col-start": [{
|
|
3117
|
-
"col-start":
|
|
3121
|
+
"col-start": H()
|
|
3118
3122
|
}],
|
|
3119
3123
|
/**
|
|
3120
3124
|
* Grid Column End
|
|
3121
3125
|
* @see https://tailwindcss.com/docs/grid-column
|
|
3122
3126
|
*/
|
|
3123
3127
|
"col-end": [{
|
|
3124
|
-
"col-end":
|
|
3128
|
+
"col-end": H()
|
|
3125
3129
|
}],
|
|
3126
3130
|
/**
|
|
3127
3131
|
* Grid Template Rows
|
|
@@ -3144,14 +3148,14 @@ const U = (e) => {
|
|
|
3144
3148
|
* @see https://tailwindcss.com/docs/grid-row
|
|
3145
3149
|
*/
|
|
3146
3150
|
"row-start": [{
|
|
3147
|
-
"row-start":
|
|
3151
|
+
"row-start": H()
|
|
3148
3152
|
}],
|
|
3149
3153
|
/**
|
|
3150
3154
|
* Grid Row End
|
|
3151
3155
|
* @see https://tailwindcss.com/docs/grid-row
|
|
3152
3156
|
*/
|
|
3153
3157
|
"row-end": [{
|
|
3154
|
-
"row-end":
|
|
3158
|
+
"row-end": H()
|
|
3155
3159
|
}],
|
|
3156
3160
|
/**
|
|
3157
3161
|
* Grid Auto Flow
|
|
@@ -3327,63 +3331,63 @@ const U = (e) => {
|
|
|
3327
3331
|
* @see https://tailwindcss.com/docs/margin
|
|
3328
3332
|
*/
|
|
3329
3333
|
m: [{
|
|
3330
|
-
m: [
|
|
3334
|
+
m: [v]
|
|
3331
3335
|
}],
|
|
3332
3336
|
/**
|
|
3333
3337
|
* Margin X
|
|
3334
3338
|
* @see https://tailwindcss.com/docs/margin
|
|
3335
3339
|
*/
|
|
3336
3340
|
mx: [{
|
|
3337
|
-
mx: [
|
|
3341
|
+
mx: [v]
|
|
3338
3342
|
}],
|
|
3339
3343
|
/**
|
|
3340
3344
|
* Margin Y
|
|
3341
3345
|
* @see https://tailwindcss.com/docs/margin
|
|
3342
3346
|
*/
|
|
3343
3347
|
my: [{
|
|
3344
|
-
my: [
|
|
3348
|
+
my: [v]
|
|
3345
3349
|
}],
|
|
3346
3350
|
/**
|
|
3347
3351
|
* Margin Start
|
|
3348
3352
|
* @see https://tailwindcss.com/docs/margin
|
|
3349
3353
|
*/
|
|
3350
3354
|
ms: [{
|
|
3351
|
-
ms: [
|
|
3355
|
+
ms: [v]
|
|
3352
3356
|
}],
|
|
3353
3357
|
/**
|
|
3354
3358
|
* Margin End
|
|
3355
3359
|
* @see https://tailwindcss.com/docs/margin
|
|
3356
3360
|
*/
|
|
3357
3361
|
me: [{
|
|
3358
|
-
me: [
|
|
3362
|
+
me: [v]
|
|
3359
3363
|
}],
|
|
3360
3364
|
/**
|
|
3361
3365
|
* Margin Top
|
|
3362
3366
|
* @see https://tailwindcss.com/docs/margin
|
|
3363
3367
|
*/
|
|
3364
3368
|
mt: [{
|
|
3365
|
-
mt: [
|
|
3369
|
+
mt: [v]
|
|
3366
3370
|
}],
|
|
3367
3371
|
/**
|
|
3368
3372
|
* Margin Right
|
|
3369
3373
|
* @see https://tailwindcss.com/docs/margin
|
|
3370
3374
|
*/
|
|
3371
3375
|
mr: [{
|
|
3372
|
-
mr: [
|
|
3376
|
+
mr: [v]
|
|
3373
3377
|
}],
|
|
3374
3378
|
/**
|
|
3375
3379
|
* Margin Bottom
|
|
3376
3380
|
* @see https://tailwindcss.com/docs/margin
|
|
3377
3381
|
*/
|
|
3378
3382
|
mb: [{
|
|
3379
|
-
mb: [
|
|
3383
|
+
mb: [v]
|
|
3380
3384
|
}],
|
|
3381
3385
|
/**
|
|
3382
3386
|
* Margin Left
|
|
3383
3387
|
* @see https://tailwindcss.com/docs/margin
|
|
3384
3388
|
*/
|
|
3385
3389
|
ml: [{
|
|
3386
|
-
ml: [
|
|
3390
|
+
ml: [v]
|
|
3387
3391
|
}],
|
|
3388
3392
|
/**
|
|
3389
3393
|
* Space Between X
|
|
@@ -3430,8 +3434,8 @@ const U = (e) => {
|
|
|
3430
3434
|
*/
|
|
3431
3435
|
"max-w": [{
|
|
3432
3436
|
"max-w": [T, t, "none", "full", "min", "max", "fit", "prose", {
|
|
3433
|
-
screen: [
|
|
3434
|
-
},
|
|
3437
|
+
screen: [pe]
|
|
3438
|
+
}, pe]
|
|
3435
3439
|
}],
|
|
3436
3440
|
/**
|
|
3437
3441
|
* Height
|
|
@@ -3467,7 +3471,7 @@ const U = (e) => {
|
|
|
3467
3471
|
* @see https://tailwindcss.com/docs/font-size
|
|
3468
3472
|
*/
|
|
3469
3473
|
"font-size": [{
|
|
3470
|
-
text: ["base",
|
|
3474
|
+
text: ["base", pe, ue]
|
|
3471
3475
|
}],
|
|
3472
3476
|
/**
|
|
3473
3477
|
* Font Smoothing
|
|
@@ -3484,7 +3488,7 @@ const U = (e) => {
|
|
|
3484
3488
|
* @see https://tailwindcss.com/docs/font-weight
|
|
3485
3489
|
*/
|
|
3486
3490
|
"font-weight": [{
|
|
3487
|
-
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black",
|
|
3491
|
+
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", Ee]
|
|
3488
3492
|
}],
|
|
3489
3493
|
/**
|
|
3490
3494
|
* Font Family
|
|
@@ -3535,14 +3539,14 @@ const U = (e) => {
|
|
|
3535
3539
|
* @see https://tailwindcss.com/docs/line-clamp
|
|
3536
3540
|
*/
|
|
3537
3541
|
"line-clamp": [{
|
|
3538
|
-
"line-clamp": ["none",
|
|
3542
|
+
"line-clamp": ["none", be, Ee]
|
|
3539
3543
|
}],
|
|
3540
3544
|
/**
|
|
3541
3545
|
* Line Height
|
|
3542
3546
|
* @see https://tailwindcss.com/docs/line-height
|
|
3543
3547
|
*/
|
|
3544
3548
|
leading: [{
|
|
3545
|
-
leading: ["none", "tight", "snug", "normal", "relaxed", "loose",
|
|
3549
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", ce, T]
|
|
3546
3550
|
}],
|
|
3547
3551
|
/**
|
|
3548
3552
|
* List Style Image
|
|
@@ -3618,14 +3622,14 @@ const U = (e) => {
|
|
|
3618
3622
|
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
3619
3623
|
*/
|
|
3620
3624
|
"text-decoration-thickness": [{
|
|
3621
|
-
decoration: ["auto", "from-font",
|
|
3625
|
+
decoration: ["auto", "from-font", ce, ue]
|
|
3622
3626
|
}],
|
|
3623
3627
|
/**
|
|
3624
3628
|
* Text Underline Offset
|
|
3625
3629
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
3626
3630
|
*/
|
|
3627
3631
|
"underline-offset": [{
|
|
3628
|
-
"underline-offset": ["auto",
|
|
3632
|
+
"underline-offset": ["auto", ce, T]
|
|
3629
3633
|
}],
|
|
3630
3634
|
/**
|
|
3631
3635
|
* Text Decoration Color
|
|
@@ -3728,7 +3732,7 @@ const U = (e) => {
|
|
|
3728
3732
|
* @see https://tailwindcss.com/docs/background-position
|
|
3729
3733
|
*/
|
|
3730
3734
|
"bg-position": [{
|
|
3731
|
-
bg: [...E(),
|
|
3735
|
+
bg: [...E(), jn]
|
|
3732
3736
|
}],
|
|
3733
3737
|
/**
|
|
3734
3738
|
* Background Repeat
|
|
@@ -3744,7 +3748,7 @@ const U = (e) => {
|
|
|
3744
3748
|
* @see https://tailwindcss.com/docs/background-size
|
|
3745
3749
|
*/
|
|
3746
3750
|
"bg-size": [{
|
|
3747
|
-
bg: ["auto", "cover", "contain",
|
|
3751
|
+
bg: ["auto", "cover", "contain", Yn]
|
|
3748
3752
|
}],
|
|
3749
3753
|
/**
|
|
3750
3754
|
* Background Image
|
|
@@ -3753,7 +3757,7 @@ const U = (e) => {
|
|
|
3753
3757
|
"bg-image": [{
|
|
3754
3758
|
bg: ["none", {
|
|
3755
3759
|
"gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
3756
|
-
},
|
|
3760
|
+
}, Un]
|
|
3757
3761
|
}],
|
|
3758
3762
|
/**
|
|
3759
3763
|
* Background Color
|
|
@@ -4107,14 +4111,14 @@ const U = (e) => {
|
|
|
4107
4111
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
4108
4112
|
*/
|
|
4109
4113
|
"outline-offset": [{
|
|
4110
|
-
"outline-offset": [
|
|
4114
|
+
"outline-offset": [ce, T]
|
|
4111
4115
|
}],
|
|
4112
4116
|
/**
|
|
4113
4117
|
* Outline Width
|
|
4114
4118
|
* @see https://tailwindcss.com/docs/outline-width
|
|
4115
4119
|
*/
|
|
4116
4120
|
"outline-w": [{
|
|
4117
|
-
outline: [
|
|
4121
|
+
outline: [ce, ue]
|
|
4118
4122
|
}],
|
|
4119
4123
|
/**
|
|
4120
4124
|
* Outline Color
|
|
@@ -4154,7 +4158,7 @@ const U = (e) => {
|
|
|
4154
4158
|
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
4155
4159
|
*/
|
|
4156
4160
|
"ring-offset-w": [{
|
|
4157
|
-
"ring-offset": [
|
|
4161
|
+
"ring-offset": [ce, ue]
|
|
4158
4162
|
}],
|
|
4159
4163
|
/**
|
|
4160
4164
|
* Ring Offset Color
|
|
@@ -4169,7 +4173,7 @@ const U = (e) => {
|
|
|
4169
4173
|
* @see https://tailwindcss.com/docs/box-shadow
|
|
4170
4174
|
*/
|
|
4171
4175
|
shadow: [{
|
|
4172
|
-
shadow: ["", "inner", "none",
|
|
4176
|
+
shadow: ["", "inner", "none", pe, qn]
|
|
4173
4177
|
}],
|
|
4174
4178
|
/**
|
|
4175
4179
|
* Box Shadow Color
|
|
@@ -4234,7 +4238,7 @@ const U = (e) => {
|
|
|
4234
4238
|
* @see https://tailwindcss.com/docs/drop-shadow
|
|
4235
4239
|
*/
|
|
4236
4240
|
"drop-shadow": [{
|
|
4237
|
-
"drop-shadow": ["", "none",
|
|
4241
|
+
"drop-shadow": ["", "none", pe, T]
|
|
4238
4242
|
}],
|
|
4239
4243
|
/**
|
|
4240
4244
|
* Grayscale
|
|
@@ -4255,7 +4259,7 @@ const U = (e) => {
|
|
|
4255
4259
|
* @see https://tailwindcss.com/docs/invert
|
|
4256
4260
|
*/
|
|
4257
4261
|
invert: [{
|
|
4258
|
-
invert: [
|
|
4262
|
+
invert: [w]
|
|
4259
4263
|
}],
|
|
4260
4264
|
/**
|
|
4261
4265
|
* Saturate
|
|
@@ -4319,7 +4323,7 @@ const U = (e) => {
|
|
|
4319
4323
|
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
4320
4324
|
*/
|
|
4321
4325
|
"backdrop-invert": [{
|
|
4322
|
-
"backdrop-invert": [
|
|
4326
|
+
"backdrop-invert": [w]
|
|
4323
4327
|
}],
|
|
4324
4328
|
/**
|
|
4325
4329
|
* Backdrop Opacity
|
|
@@ -4462,14 +4466,14 @@ const U = (e) => {
|
|
|
4462
4466
|
* @see https://tailwindcss.com/docs/translate
|
|
4463
4467
|
*/
|
|
4464
4468
|
"translate-x": [{
|
|
4465
|
-
"translate-x": [
|
|
4469
|
+
"translate-x": [W]
|
|
4466
4470
|
}],
|
|
4467
4471
|
/**
|
|
4468
4472
|
* Translate Y
|
|
4469
4473
|
* @see https://tailwindcss.com/docs/translate
|
|
4470
4474
|
*/
|
|
4471
4475
|
"translate-y": [{
|
|
4472
|
-
"translate-y": [
|
|
4476
|
+
"translate-y": [W]
|
|
4473
4477
|
}],
|
|
4474
4478
|
/**
|
|
4475
4479
|
* Skew X
|
|
@@ -4749,7 +4753,7 @@ const U = (e) => {
|
|
|
4749
4753
|
* @see https://tailwindcss.com/docs/stroke-width
|
|
4750
4754
|
*/
|
|
4751
4755
|
"stroke-w": [{
|
|
4752
|
-
stroke: [
|
|
4756
|
+
stroke: [ce, ue, Ee]
|
|
4753
4757
|
}],
|
|
4754
4758
|
/**
|
|
4755
4759
|
* Stroke
|
|
@@ -4824,57 +4828,57 @@ const U = (e) => {
|
|
|
4824
4828
|
"font-size": ["leading"]
|
|
4825
4829
|
}
|
|
4826
4830
|
};
|
|
4827
|
-
},
|
|
4828
|
-
function
|
|
4829
|
-
return
|
|
4831
|
+
}, er = /* @__PURE__ */ zn(Jn);
|
|
4832
|
+
function tr(...e) {
|
|
4833
|
+
return er(Vt(e));
|
|
4830
4834
|
}
|
|
4831
|
-
function
|
|
4832
|
-
const [r, s] = R(() =>
|
|
4835
|
+
function Dr({ autoWidth: e = !0, className: t, style: n }) {
|
|
4836
|
+
const [r, s] = R(() => ae.getActiveAppId()), [i, c] = R(() => ee.getRunningApps()), { isMobile: a } = mt();
|
|
4833
4837
|
F(() => {
|
|
4834
|
-
const
|
|
4838
|
+
const v = ae.subscribe("activeAppId", (y) => {
|
|
4835
4839
|
s(y);
|
|
4836
4840
|
});
|
|
4837
4841
|
return () => {
|
|
4838
|
-
|
|
4842
|
+
v();
|
|
4839
4843
|
};
|
|
4840
4844
|
}, []), F(() => ee.subscribe(() => {
|
|
4841
4845
|
c(ee.getRunningApps());
|
|
4842
4846
|
}), []), F(() => {
|
|
4843
4847
|
if (!new URLSearchParams(window.location.search).has("app")) {
|
|
4844
|
-
const m =
|
|
4848
|
+
const m = ae.getActiveAppId();
|
|
4845
4849
|
m && !ee.isRunning(m) && ee.launchApp(m);
|
|
4846
4850
|
}
|
|
4847
4851
|
}, []);
|
|
4848
|
-
const l = (
|
|
4849
|
-
ee.closeApp(
|
|
4850
|
-
}, d = r ?
|
|
4852
|
+
const l = (v) => {
|
|
4853
|
+
ee.closeApp(v);
|
|
4854
|
+
}, d = r ? ve.get(r) : null, w = (d == null ? void 0 : d.width) ?? 400, p = r !== null, b = { ...{
|
|
4851
4855
|
overflow: "hidden",
|
|
4852
4856
|
display: p ? "flex" : "none",
|
|
4853
4857
|
flexDirection: "column",
|
|
4854
4858
|
flexShrink: 0,
|
|
4855
4859
|
// Only set width if autoWidth is enabled
|
|
4856
|
-
...e && p ? { width: a ? "100%" :
|
|
4860
|
+
...e && p ? { width: a ? "100%" : w } : {}
|
|
4857
4861
|
}, ...n };
|
|
4858
|
-
return /* @__PURE__ */ o("div", { className:
|
|
4859
|
-
|
|
4862
|
+
return /* @__PURE__ */ o("div", { className: tr("nc-app-panel", t), style: b, children: i.map((v) => /* @__PURE__ */ o(
|
|
4863
|
+
pt,
|
|
4860
4864
|
{
|
|
4861
|
-
appId:
|
|
4862
|
-
isActive: r ===
|
|
4863
|
-
onClose: () => l(
|
|
4865
|
+
appId: v.appId,
|
|
4866
|
+
isActive: r === v.appId,
|
|
4867
|
+
onClose: () => l(v.appId)
|
|
4864
4868
|
},
|
|
4865
|
-
|
|
4869
|
+
v.appId
|
|
4866
4870
|
)) });
|
|
4867
4871
|
}
|
|
4868
|
-
function
|
|
4872
|
+
function Vr({
|
|
4869
4873
|
pinnedAppIds: e,
|
|
4870
4874
|
className: t = "",
|
|
4871
4875
|
showIndicators: n = !0,
|
|
4872
4876
|
side: r = "left",
|
|
4873
4877
|
getBadge: s
|
|
4874
4878
|
}) {
|
|
4875
|
-
const { t: i } =
|
|
4879
|
+
const { t: i } = ne(), { isMobile: c } = mt(), [a, l] = R(() => ae.getActiveAppId()), [d, u] = R(() => ee.getRunningApps());
|
|
4876
4880
|
F(() => {
|
|
4877
|
-
const f =
|
|
4881
|
+
const f = ae.subscribe("activeAppId", (g) => {
|
|
4878
4882
|
l(g);
|
|
4879
4883
|
});
|
|
4880
4884
|
return () => {
|
|
@@ -4883,16 +4887,16 @@ function zr({
|
|
|
4883
4887
|
}, []), F(() => ee.subscribe(() => {
|
|
4884
4888
|
u(ee.getRunningApps());
|
|
4885
4889
|
}), []);
|
|
4886
|
-
const
|
|
4890
|
+
const w = (f) => {
|
|
4887
4891
|
a === f ? ee.setActiveApp(null) : ee.launchApp(f);
|
|
4888
|
-
}, p = e.map((f) =>
|
|
4892
|
+
}, p = e.map((f) => ve.get(f)).filter((f) => !!f), h = d.filter((f) => !e.includes(f.appId)).map((f) => ({ running: f, def: ve.get(f.appId) })).filter((f) => !!f.def), A = (f) => d.some((g) => g.appId === f), b = (f) => f.titleKey ? String(i(f.titleKey)) : f.id, v = (f) => typeof f == "number" && f > 99 ? "99+" : f, y = (f, g) => {
|
|
4889
4893
|
const S = s == null ? void 0 : s(f, g);
|
|
4890
4894
|
return S ? /* @__PURE__ */ o(
|
|
4891
4895
|
"span",
|
|
4892
4896
|
{
|
|
4893
4897
|
className: `nc-app-taskbar-badge nc-${S.tone ?? "default"}`,
|
|
4894
4898
|
"aria-label": S.ariaLabel,
|
|
4895
|
-
children:
|
|
4899
|
+
children: v(S.content)
|
|
4896
4900
|
}
|
|
4897
4901
|
) : null;
|
|
4898
4902
|
}, m = c ? 24 : 28;
|
|
@@ -4903,7 +4907,7 @@ function zr({
|
|
|
4903
4907
|
"button",
|
|
4904
4908
|
{
|
|
4905
4909
|
className: `nc-app-taskbar-button ${S ? "nc-active" : ""} ${M ? "nc-running" : ""}`,
|
|
4906
|
-
onClick: () =>
|
|
4910
|
+
onClick: () => w(f.id),
|
|
4907
4911
|
title: b(f),
|
|
4908
4912
|
children: [
|
|
4909
4913
|
/* @__PURE__ */ o(g, { size: m }),
|
|
@@ -4921,7 +4925,7 @@ function zr({
|
|
|
4921
4925
|
"button",
|
|
4922
4926
|
{
|
|
4923
4927
|
className: `nc-app-taskbar-button ${M ? "nc-active" : ""} nc-running`,
|
|
4924
|
-
onClick: () =>
|
|
4928
|
+
onClick: () => w(f.appId),
|
|
4925
4929
|
title: b(g),
|
|
4926
4930
|
children: [
|
|
4927
4931
|
/* @__PURE__ */ o(S, { size: m }),
|
|
@@ -4934,7 +4938,7 @@ function zr({
|
|
|
4934
4938
|
})
|
|
4935
4939
|
] });
|
|
4936
4940
|
}
|
|
4937
|
-
function
|
|
4941
|
+
function Wr({
|
|
4938
4942
|
appId: e,
|
|
4939
4943
|
open: t,
|
|
4940
4944
|
onClose: n,
|
|
@@ -4958,7 +4962,7 @@ function Br({
|
|
|
4958
4962
|
style: i,
|
|
4959
4963
|
onClick: (l) => l.stopPropagation(),
|
|
4960
4964
|
children: /* @__PURE__ */ o(
|
|
4961
|
-
|
|
4965
|
+
pt,
|
|
4962
4966
|
{
|
|
4963
4967
|
appId: e,
|
|
4964
4968
|
isActive: !0,
|
|
@@ -4969,24 +4973,24 @@ function Br({
|
|
|
4969
4973
|
)
|
|
4970
4974
|
}
|
|
4971
4975
|
);
|
|
4972
|
-
return
|
|
4976
|
+
return ye(a, document.body);
|
|
4973
4977
|
}
|
|
4974
|
-
const
|
|
4975
|
-
function
|
|
4976
|
-
const e =
|
|
4978
|
+
const He = we(null), xt = we(null);
|
|
4979
|
+
function Hr() {
|
|
4980
|
+
const e = he(He);
|
|
4977
4981
|
if (!e)
|
|
4978
4982
|
throw new Error("useNavStack must be used within a NavStackProvider");
|
|
4979
4983
|
return e;
|
|
4980
4984
|
}
|
|
4981
|
-
function
|
|
4982
|
-
const e =
|
|
4985
|
+
function Or() {
|
|
4986
|
+
const e = he(xt);
|
|
4983
4987
|
if (!e)
|
|
4984
4988
|
throw new Error("useNavView must be used within NavStack");
|
|
4985
4989
|
return e;
|
|
4986
4990
|
}
|
|
4987
|
-
const
|
|
4988
|
-
function
|
|
4989
|
-
const { t: n } =
|
|
4991
|
+
const Oe = we(null);
|
|
4992
|
+
function Fr({ rootView: e, children: t }) {
|
|
4993
|
+
const { t: n } = ne(), r = wn(), [s, i] = R([e]), [c, a] = R([null]), l = Z((g, S) => {
|
|
4990
4994
|
a((M) => {
|
|
4991
4995
|
const B = [...M];
|
|
4992
4996
|
return B[g] = S, B;
|
|
@@ -4998,22 +5002,22 @@ function Hr({ rootView: e, children: t }) {
|
|
|
4998
5002
|
});
|
|
4999
5003
|
}, []), u = Z((g) => {
|
|
5000
5004
|
i((S) => [...S, g]), a((S) => [...S, null]);
|
|
5001
|
-
}, []),
|
|
5005
|
+
}, []), w = Z(() => {
|
|
5002
5006
|
i((g) => g.length <= 1 ? g : g.slice(0, -1)), a((g) => g.slice(0, -1));
|
|
5003
5007
|
}, []), p = Z(() => {
|
|
5004
5008
|
i([e]), a([null]);
|
|
5005
|
-
}, [e]), h = s.length, A = h > 1, b = s.length - 1,
|
|
5009
|
+
}, [e]), h = s.length, A = h > 1, b = s.length - 1, v = s[s.length - 1], y = v != null && v.titleKey ? n(v.titleKey) : (v == null ? void 0 : v.title) ?? "";
|
|
5006
5010
|
F(() => {
|
|
5007
5011
|
r.setTitle(y);
|
|
5008
5012
|
}, [y, r]), F(() => {
|
|
5009
|
-
A ? r.setBackHandler(
|
|
5010
|
-
}, [A,
|
|
5013
|
+
A ? r.setBackHandler(w) : r.clearBackHandler();
|
|
5014
|
+
}, [A, w, r]), F(() => {
|
|
5011
5015
|
const g = c[c.length - 1];
|
|
5012
5016
|
g ? r.setToolbar(g) : r.clearToolbar();
|
|
5013
5017
|
}, [c, r]);
|
|
5014
5018
|
const m = {
|
|
5015
5019
|
push: u,
|
|
5016
|
-
pop:
|
|
5020
|
+
pop: w,
|
|
5017
5021
|
reset: p,
|
|
5018
5022
|
depth: h,
|
|
5019
5023
|
canGoBack: A,
|
|
@@ -5025,10 +5029,10 @@ function Hr({ rootView: e, children: t }) {
|
|
|
5025
5029
|
clearToolbarAt: d,
|
|
5026
5030
|
topIndex: b
|
|
5027
5031
|
};
|
|
5028
|
-
return /* @__PURE__ */ o(
|
|
5032
|
+
return /* @__PURE__ */ o(He.Provider, { value: m, children: /* @__PURE__ */ o(Oe.Provider, { value: f, children: t }) });
|
|
5029
5033
|
}
|
|
5030
|
-
function
|
|
5031
|
-
const n =
|
|
5034
|
+
function nr({ index: e, children: t }) {
|
|
5035
|
+
const n = he(Oe);
|
|
5032
5036
|
if (!n)
|
|
5033
5037
|
throw new Error("NavViewProvider must be used within NavStackProvider");
|
|
5034
5038
|
const { updateToolbar: r, clearToolbarAt: s, topIndex: i } = n, c = Z((d) => {
|
|
@@ -5039,16 +5043,16 @@ function Jn({ index: e, children: t }) {
|
|
|
5039
5043
|
setToolbar: c,
|
|
5040
5044
|
clearToolbar: a
|
|
5041
5045
|
};
|
|
5042
|
-
return /* @__PURE__ */ o(
|
|
5046
|
+
return /* @__PURE__ */ o(xt.Provider, { value: l, children: t });
|
|
5043
5047
|
}
|
|
5044
|
-
function
|
|
5045
|
-
const e =
|
|
5048
|
+
function Gr() {
|
|
5049
|
+
const e = he(He), t = he(Oe);
|
|
5046
5050
|
if (!e || !t)
|
|
5047
5051
|
throw new Error("NavStackContainer must be used within a NavStackProvider");
|
|
5048
5052
|
const { stack: n } = t;
|
|
5049
5053
|
return /* @__PURE__ */ o("div", { className: "nav-stack-container", children: /* @__PURE__ */ o("div", { className: "nav-stack-content", children: n.map((r, s) => {
|
|
5050
5054
|
const i = s === n.length - 1;
|
|
5051
|
-
return /* @__PURE__ */ o(
|
|
5055
|
+
return /* @__PURE__ */ o(nr, { index: s, children: /* @__PURE__ */ o(
|
|
5052
5056
|
"div",
|
|
5053
5057
|
{
|
|
5054
5058
|
style: { display: i ? "flex" : "none", flexDirection: "column", height: "100%" },
|
|
@@ -5058,55 +5062,55 @@ function Vr() {
|
|
|
5058
5062
|
}) }) });
|
|
5059
5063
|
}
|
|
5060
5064
|
export {
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5065
|
+
it as ActivityIndicator,
|
|
5066
|
+
ur as Alert,
|
|
5067
|
+
pt as AppContainer,
|
|
5068
|
+
ut as AppContext,
|
|
5069
|
+
Wr as AppDialog,
|
|
5070
|
+
Dr as AppPanel,
|
|
5071
|
+
Vr as AppTaskbar,
|
|
5072
|
+
xn as AppTitleBar,
|
|
5073
|
+
pr as Battery,
|
|
5070
5074
|
J as Button,
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5075
|
+
fr as ButtonGroup,
|
|
5076
|
+
hr as Checkbox,
|
|
5077
|
+
ct as CloseButton,
|
|
5078
|
+
mr as ComboBox,
|
|
5079
|
+
yr as ContextMenu,
|
|
5080
|
+
Rr as CsvTextArea,
|
|
5081
|
+
xr as Dialog,
|
|
5082
|
+
ge as DialogClose,
|
|
5083
|
+
br as EditButton,
|
|
5084
|
+
wr as Hyperlink,
|
|
5085
|
+
Ut as Input,
|
|
5086
|
+
Nr as ListGroup,
|
|
5087
|
+
kr as ListGroupItem,
|
|
5088
|
+
Sr as MonthRangePicker,
|
|
5089
|
+
Ar as MultiSelect,
|
|
5090
|
+
Gr as NavStackContainer,
|
|
5091
|
+
Fr as NavStackProvider,
|
|
5092
|
+
hn as Notification,
|
|
5093
|
+
Tr as NotificationContainer,
|
|
5094
|
+
Cr as NumberInput,
|
|
5095
|
+
gr as RefreshButton,
|
|
5096
|
+
$r as Slider,
|
|
5097
|
+
Qt as TabPanel,
|
|
5098
|
+
Mr as TabPanels,
|
|
5099
|
+
Pr as Tabs,
|
|
5100
|
+
Ir as Toggle,
|
|
5101
|
+
vr as TrashButton,
|
|
5102
|
+
Er as VersionPicker,
|
|
5103
|
+
Br as ViewportProvider,
|
|
5104
|
+
ve as appRegistry,
|
|
5105
|
+
ae as appStateStore,
|
|
5106
|
+
tr as cn,
|
|
5107
|
+
zr as createAppI18nFactory,
|
|
5108
|
+
Lr as notificationManager,
|
|
5105
5109
|
ee as runningAppsStore,
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5110
|
+
mn as showNotification,
|
|
5111
|
+
wn as useApp,
|
|
5112
|
+
Yt as useDialog,
|
|
5113
|
+
Hr as useNavStack,
|
|
5114
|
+
Or as useNavView,
|
|
5115
|
+
mt as useViewport
|
|
5112
5116
|
};
|