@kingsimba/nc-ui 0.1.15 → 0.1.16
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +474 -473
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var Je = Object.defineProperty;
|
|
|
2
2
|
var Qe = (e, t, n) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var _ = (e, t, n) => Qe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as s, jsxs as y } from "react/jsx-runtime";
|
|
5
|
-
import xe, { useState as T, useRef as W, useMemo as ge, useEffect as
|
|
5
|
+
import xe, { useState as T, useRef as W, useMemo as ge, useEffect as B, createContext as se, useContext as X, Children as Ze, isValidElement as et, forwardRef as tt, useImperativeHandle as nt, useCallback as O, Suspense as rt } from "react";
|
|
6
6
|
import { createPortal as pe } from "react-dom";
|
|
7
7
|
import { useTranslation as J } from "react-i18next";
|
|
8
8
|
import { d as Le, E as ot, R as st, T as it, g as ct, V as at, b as lt, a as dt, c as ut } from "./GeneratedIcons-HFZmBTBT.js";
|
|
@@ -37,8 +37,8 @@ function Be({
|
|
|
37
37
|
);
|
|
38
38
|
return n ? /* @__PURE__ */ s("div", { className: "nc-activity-indicator-overlay", children: o }) : o;
|
|
39
39
|
}
|
|
40
|
-
function Y({ variant: e = "default", block: t, size: n = "default", className: r, disabled: o, textSelectable: i, loading: l, onClick: a, children: d, ...
|
|
41
|
-
const
|
|
40
|
+
function Y({ variant: e = "default", block: t, size: n = "default", className: r, disabled: o, textSelectable: i, loading: l, onClick: a, children: d, ...p }) {
|
|
41
|
+
const f = [
|
|
42
42
|
"nc-button",
|
|
43
43
|
e !== "default" ? `nc-${e}` : "",
|
|
44
44
|
t ? "nc-block" : "",
|
|
@@ -52,19 +52,19 @@ function Y({ variant: e = "default", block: t, size: n = "default", className: r
|
|
|
52
52
|
return /* @__PURE__ */ y(
|
|
53
53
|
"button",
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
55
|
+
className: f,
|
|
56
56
|
disabled: o || l,
|
|
57
57
|
onClick: (c) => {
|
|
58
58
|
if (!l) {
|
|
59
59
|
if (i) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
60
|
+
const u = window.getSelection();
|
|
61
|
+
if (u && u.toString().length > 0)
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
a == null || a(c);
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
...
|
|
67
|
+
...p,
|
|
68
68
|
children: [
|
|
69
69
|
l && /* @__PURE__ */ s(
|
|
70
70
|
Be,
|
|
@@ -105,7 +105,7 @@ function In({
|
|
|
105
105
|
const o = Math.max(0, Math.min(1, Number(e) || 0));
|
|
106
106
|
let i;
|
|
107
107
|
r ? o < 0.1 ? i = "var(--nc-danger)" : o < 0.2 ? i = "var(--nc-warning)" : i = "var(--nc-success)" : i = n ? "#ffffff" : "#000000";
|
|
108
|
-
const l = n ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.2)", a = 24, d = 14,
|
|
108
|
+
const l = n ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.2)", a = 24, d = 14, p = 2, f = 0, g = 12, c = 0, u = 0, w = 0, m = a, v = d, N = v - c * 2, h = m - c * 2, k = Math.max(1, Math.min(4, v / 4)), b = o === 0 ? 0 : 0.05 + o * 0.95, S = a + p + g, R = 20, I = 0.65, z = Math.max(d, R * I), x = a + p + 1, E = (d - R * I) / 2;
|
|
109
109
|
return /* @__PURE__ */ y(
|
|
110
110
|
"svg",
|
|
111
111
|
{
|
|
@@ -117,21 +117,21 @@ function In({
|
|
|
117
117
|
"aria-label": `Battery ${o === 0 ? "-" : Math.round(o * 100) + "%"} ${t}`,
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ y("defs", { children: [
|
|
120
|
-
/* @__PURE__ */ s("mask", { id: `nc-battery-fill-mask-${o}`, children: /* @__PURE__ */ s("rect", { x: "0", y: "0", width: h *
|
|
120
|
+
/* @__PURE__ */ s("mask", { id: `nc-battery-fill-mask-${o}`, children: /* @__PURE__ */ s("rect", { x: "0", y: "0", width: h * b, height: N, fill: "white" }) }),
|
|
121
121
|
/* @__PURE__ */ y("mask", { id: `nc-battery-text-mask-${o}`, children: [
|
|
122
122
|
/* @__PURE__ */ s("rect", { x: "0", y: "0", width: S, height: z, fill: "white" }),
|
|
123
|
-
/* @__PURE__ */ s("text", { x:
|
|
123
|
+
/* @__PURE__ */ s("text", { x: u + m / 2, y: d - 3, fontSize: 11, fontWeight: "bold", fill: "black", textAnchor: "middle", children: o === 0 ? "-" : Math.round(o * 100) })
|
|
124
124
|
] })
|
|
125
125
|
] }),
|
|
126
126
|
/* @__PURE__ */ y("g", { mask: `url(#nc-battery-text-mask-${o})`, children: [
|
|
127
127
|
/* @__PURE__ */ s(
|
|
128
128
|
"rect",
|
|
129
129
|
{
|
|
130
|
-
x:
|
|
131
|
-
y:
|
|
130
|
+
x: u,
|
|
131
|
+
y: w,
|
|
132
132
|
rx: k,
|
|
133
133
|
ry: k,
|
|
134
|
-
width:
|
|
134
|
+
width: m,
|
|
135
135
|
height: v,
|
|
136
136
|
fill: l
|
|
137
137
|
}
|
|
@@ -139,8 +139,8 @@ function In({
|
|
|
139
139
|
/* @__PURE__ */ s(
|
|
140
140
|
"rect",
|
|
141
141
|
{
|
|
142
|
-
x:
|
|
143
|
-
y:
|
|
142
|
+
x: u + c,
|
|
143
|
+
y: w + c,
|
|
144
144
|
width: h,
|
|
145
145
|
height: N,
|
|
146
146
|
fill: i,
|
|
@@ -152,16 +152,16 @@ function In({
|
|
|
152
152
|
/* @__PURE__ */ s(
|
|
153
153
|
"rect",
|
|
154
154
|
{
|
|
155
|
-
x: a +
|
|
155
|
+
x: a + f,
|
|
156
156
|
y: d * 0.26,
|
|
157
|
-
width:
|
|
157
|
+
width: p,
|
|
158
158
|
height: d * 0.48,
|
|
159
159
|
rx: 0.8,
|
|
160
160
|
ry: 0.8,
|
|
161
161
|
fill: o === 1 ? i : l
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
|
-
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${x}, ${
|
|
164
|
+
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${x}, ${E}) scale(${I})`, fill: i, children: /* @__PURE__ */ s("path", { d: "M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z" }) }) : null
|
|
165
165
|
] })
|
|
166
166
|
]
|
|
167
167
|
}
|
|
@@ -205,8 +205,8 @@ function $n({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
205
205
|
{
|
|
206
206
|
className: `nc-checkbox-label ${d ? "nc-small" : ""} ${n ? "nc-disabled" : ""} ${a}`.trim(),
|
|
207
207
|
style: l,
|
|
208
|
-
onClick: (
|
|
209
|
-
n || (
|
|
208
|
+
onClick: (p) => {
|
|
209
|
+
n || (p.preventDefault(), t(!e));
|
|
210
210
|
},
|
|
211
211
|
children: [
|
|
212
212
|
/* @__PURE__ */ s(
|
|
@@ -216,8 +216,8 @@ function $n({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
216
216
|
"aria-checked": e,
|
|
217
217
|
tabIndex: 0,
|
|
218
218
|
className: `nc-checkbox-box ${d ? "nc-small" : ""} ${e ? "nc-checked" : ""}`,
|
|
219
|
-
onKeyDown: (
|
|
220
|
-
n || (
|
|
219
|
+
onKeyDown: (p) => {
|
|
220
|
+
n || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), t(!e));
|
|
221
221
|
},
|
|
222
222
|
children: e && /* @__PURE__ */ s(ht, { size: o })
|
|
223
223
|
}
|
|
@@ -229,7 +229,7 @@ function $n({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
229
229
|
}
|
|
230
230
|
function mt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
231
231
|
const i = W(null), { t: l } = J();
|
|
232
|
-
return
|
|
232
|
+
return B(() => {
|
|
233
233
|
r && i.current && i.current.scrollIntoView({ block: "nearest" });
|
|
234
234
|
}, [r]), /* @__PURE__ */ y(
|
|
235
235
|
"div",
|
|
@@ -264,40 +264,40 @@ function gt({
|
|
|
264
264
|
small: l,
|
|
265
265
|
highlightedIndex: a = -1
|
|
266
266
|
}) {
|
|
267
|
-
const [d,
|
|
268
|
-
if (
|
|
267
|
+
const [d, p] = T({ top: 0, left: 0, width: 0 }), [f, g] = T(o), { t: c } = J();
|
|
268
|
+
if (B(() => {
|
|
269
269
|
if (e && i.current) {
|
|
270
|
-
const
|
|
271
|
-
let
|
|
270
|
+
const w = i.current.getBoundingClientRect();
|
|
271
|
+
let m = o;
|
|
272
272
|
if (o === "bottom") {
|
|
273
|
-
const v = window.innerHeight -
|
|
274
|
-
v < 320 && N > v && (
|
|
273
|
+
const v = window.innerHeight - w.bottom, N = w.top;
|
|
274
|
+
v < 320 && N > v && (m = "top");
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
top:
|
|
278
|
-
left:
|
|
279
|
-
width:
|
|
276
|
+
g(m), p({
|
|
277
|
+
top: m === "top" ? w.top - 4 : w.bottom + 4,
|
|
278
|
+
left: w.left,
|
|
279
|
+
width: w.width
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
}, [e, i, o]), !e) return null;
|
|
283
|
-
const
|
|
283
|
+
const u = /* @__PURE__ */ s(
|
|
284
284
|
"div",
|
|
285
285
|
{
|
|
286
286
|
className: "nc-combo-dropdown",
|
|
287
287
|
style: {
|
|
288
288
|
position: "fixed",
|
|
289
|
-
top:
|
|
290
|
-
bottom:
|
|
289
|
+
top: f === "top" ? void 0 : d.top,
|
|
290
|
+
bottom: f === "top" ? window.innerHeight - d.top : void 0,
|
|
291
291
|
left: d.left,
|
|
292
292
|
width: d.width,
|
|
293
293
|
zIndex: 1e3,
|
|
294
294
|
maxHeight: 300,
|
|
295
295
|
overflowY: "auto"
|
|
296
296
|
},
|
|
297
|
-
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${l ? "nc-small" : ""}`, children: c("common.noResults") }) : t.map((
|
|
297
|
+
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${l ? "nc-small" : ""}`, children: c("common.noResults") }) : t.map((w, m) => /* @__PURE__ */ s(mt, { option: w, onChange: n, selected: w.value === r, highlighted: m === a, small: l }, w.value))
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
|
-
return pe(
|
|
300
|
+
return pe(u, document.body);
|
|
301
301
|
}
|
|
302
302
|
function bt({ onClick: e, small: t }) {
|
|
303
303
|
return /* @__PURE__ */ s(
|
|
@@ -333,68 +333,68 @@ function Rn({
|
|
|
333
333
|
clearable: l = !0,
|
|
334
334
|
allowTyping: a = !1,
|
|
335
335
|
placement: d = "bottom",
|
|
336
|
-
size:
|
|
337
|
-
style:
|
|
338
|
-
className:
|
|
336
|
+
size: p = "default",
|
|
337
|
+
style: f,
|
|
338
|
+
className: g
|
|
339
339
|
}) {
|
|
340
|
-
const [c,
|
|
341
|
-
const
|
|
342
|
-
return a ? r.filter((P) => P.label.toLowerCase().includes(
|
|
343
|
-
}, [r,
|
|
344
|
-
|
|
340
|
+
const [c, u] = T(!1), [w, m] = T(""), [v, N] = T(-1), h = W(null), k = W(null), b = p === "small", { t: S } = J(), R = ge(() => {
|
|
341
|
+
const $ = w.toLowerCase();
|
|
342
|
+
return a ? r.filter((P) => P.label.toLowerCase().includes($)) : r;
|
|
343
|
+
}, [r, w, a]);
|
|
344
|
+
B(() => {
|
|
345
345
|
c && N(-1);
|
|
346
|
-
}, [c,
|
|
346
|
+
}, [c, R]), B(() => {
|
|
347
347
|
if (!l && !e && r.length > 0 && t) {
|
|
348
|
-
const
|
|
349
|
-
t(
|
|
348
|
+
const $ = r.find((P) => P.default) || r[0];
|
|
349
|
+
t($.value);
|
|
350
350
|
}
|
|
351
|
-
}, [l, e, r, t]),
|
|
352
|
-
function
|
|
351
|
+
}, [l, e, r, t]), B(() => {
|
|
352
|
+
function $(P) {
|
|
353
353
|
var H;
|
|
354
|
-
P.target instanceof Node && h.current && ((H = h.current.parentElement) != null && H.contains(P.target) ||
|
|
354
|
+
P.target instanceof Node && h.current && ((H = h.current.parentElement) != null && H.contains(P.target) || u(!1));
|
|
355
355
|
}
|
|
356
|
-
return document.addEventListener("mousedown",
|
|
356
|
+
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
357
357
|
}, []);
|
|
358
|
-
const I = r.find((
|
|
358
|
+
const I = r.find(($) => $.value === e), z = I && l, x = !o && !z, E = !(c && a) && !!I, A = ($, P = !1) => {
|
|
359
359
|
var H;
|
|
360
|
-
t == null || t(
|
|
360
|
+
t == null || t($), u(!1), m(""), P && ((H = h.current) == null || H.blur());
|
|
361
361
|
}, C = () => {
|
|
362
|
-
t == null || t(void 0),
|
|
363
|
-
},
|
|
362
|
+
t == null || t(void 0), m(""), u(!1);
|
|
363
|
+
}, L = ($) => {
|
|
364
364
|
if (!c) {
|
|
365
|
-
(
|
|
365
|
+
($.key === "ArrowDown" || $.key === "ArrowUp") && (u(!0), $.preventDefault());
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
switch (
|
|
368
|
+
switch ($.key) {
|
|
369
369
|
case "ArrowDown":
|
|
370
|
-
|
|
370
|
+
$.preventDefault(), N((P) => {
|
|
371
371
|
const H = P + 1;
|
|
372
|
-
return H >=
|
|
372
|
+
return H >= R.length ? 0 : H;
|
|
373
373
|
});
|
|
374
374
|
break;
|
|
375
375
|
case "ArrowUp":
|
|
376
|
-
|
|
376
|
+
$.preventDefault(), N((P) => {
|
|
377
377
|
const H = P - 1;
|
|
378
|
-
return H < 0 ?
|
|
378
|
+
return H < 0 ? R.length - 1 : H;
|
|
379
379
|
});
|
|
380
380
|
break;
|
|
381
381
|
case "Enter":
|
|
382
|
-
|
|
382
|
+
$.preventDefault(), v >= 0 && v < R.length && A(R[v].value, !0);
|
|
383
383
|
break;
|
|
384
384
|
case "Escape":
|
|
385
|
-
|
|
385
|
+
$.preventDefault(), u(!1), m("");
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
return /* @__PURE__ */ y("div", { className: `nc-combo-container ${
|
|
390
|
-
i && /* @__PURE__ */ s("span", { className: `nc-label ${
|
|
389
|
+
return /* @__PURE__ */ y("div", { className: `nc-combo-container ${g || ""}`.trim(), style: { position: "relative", ...f }, children: [
|
|
390
|
+
i && /* @__PURE__ */ s("span", { className: `nc-label ${b ? "nc-small" : ""}`, children: i }),
|
|
391
391
|
/* @__PURE__ */ y(
|
|
392
392
|
"div",
|
|
393
393
|
{
|
|
394
394
|
ref: k,
|
|
395
395
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
396
|
-
onMouseDown: (
|
|
397
|
-
o || a &&
|
|
396
|
+
onMouseDown: ($) => {
|
|
397
|
+
o || a && $.target === h.current || (u((P) => (!P && a && I && m(I.label), !P)), a && !c && setTimeout(() => {
|
|
398
398
|
var P, H;
|
|
399
399
|
(P = h.current) == null || P.focus(), (H = h.current) == null || H.select();
|
|
400
400
|
}, 0));
|
|
@@ -404,37 +404,37 @@ function Rn({
|
|
|
404
404
|
"input",
|
|
405
405
|
{
|
|
406
406
|
ref: h,
|
|
407
|
-
className: `nc-input ${
|
|
407
|
+
className: `nc-input ${b ? "nc-small" : ""}`,
|
|
408
408
|
placeholder: n,
|
|
409
409
|
onFocus: () => {
|
|
410
|
-
var
|
|
411
|
-
!o && a && (
|
|
410
|
+
var $;
|
|
411
|
+
!o && a && (u(!0), I && (m(I.label), setTimeout(() => {
|
|
412
412
|
var P;
|
|
413
413
|
return (P = h.current) == null ? void 0 : P.select();
|
|
414
|
-
}, 0))), a || (
|
|
414
|
+
}, 0))), a || ($ = h.current) == null || $.blur();
|
|
415
415
|
},
|
|
416
|
-
onChange: (
|
|
417
|
-
onKeyDown:
|
|
418
|
-
value: c && a ?
|
|
416
|
+
onChange: ($) => a && m($.target.value),
|
|
417
|
+
onKeyDown: L,
|
|
418
|
+
value: c && a ? w : (I == null ? void 0 : I.label) || "",
|
|
419
419
|
readOnly: o || !a,
|
|
420
420
|
style: {
|
|
421
421
|
width: "100%",
|
|
422
|
-
paddingRight: x || z ?
|
|
422
|
+
paddingRight: x || z ? b ? 32 : 44 : 12,
|
|
423
423
|
caretColor: a ? void 0 : "transparent",
|
|
424
424
|
cursor: a ? void 0 : "pointer",
|
|
425
425
|
userSelect: a ? void 0 : "none",
|
|
426
|
-
color:
|
|
426
|
+
color: E ? "transparent" : "var(--nc-text)"
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
),
|
|
430
|
-
|
|
430
|
+
E && /* @__PURE__ */ y(
|
|
431
431
|
"div",
|
|
432
432
|
{
|
|
433
433
|
"aria-hidden": !0,
|
|
434
434
|
style: {
|
|
435
435
|
position: "absolute",
|
|
436
|
-
left:
|
|
437
|
-
right: x || z ?
|
|
436
|
+
left: b ? 8 : 12,
|
|
437
|
+
right: x || z ? b ? 12 : 24 : b ? 8 : 12,
|
|
438
438
|
top: "50%",
|
|
439
439
|
transform: "translateY(-50%)",
|
|
440
440
|
pointerEvents: "none",
|
|
@@ -446,8 +446,8 @@ function Rn({
|
|
|
446
446
|
textOverflow: "ellipsis"
|
|
447
447
|
},
|
|
448
448
|
children: [
|
|
449
|
-
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${
|
|
450
|
-
(I == null ? void 0 : I.default) && /* @__PURE__ */ y("span", { className: `nc-combo-overlay-default ${
|
|
449
|
+
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${b ? "nc-small" : ""}`, children: I == null ? void 0 : I.label }),
|
|
450
|
+
(I == null ? void 0 : I.default) && /* @__PURE__ */ y("span", { className: `nc-combo-overlay-default ${b ? "nc-small" : ""}`, children: [
|
|
451
451
|
"(",
|
|
452
452
|
S("common.default"),
|
|
453
453
|
")"
|
|
@@ -455,12 +455,12 @@ function Rn({
|
|
|
455
455
|
]
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
|
-
z && /* @__PURE__ */ s(bt, { onClick: C, small:
|
|
459
|
-
x && /* @__PURE__ */ s(vt, { open: c, onClick: () =>
|
|
458
|
+
z && /* @__PURE__ */ s(bt, { onClick: C, small: b }),
|
|
459
|
+
x && /* @__PURE__ */ s(vt, { open: c, onClick: () => u(($) => !$), small: b })
|
|
460
460
|
]
|
|
461
461
|
}
|
|
462
462
|
),
|
|
463
|
-
/* @__PURE__ */ s(gt, { isOpen: c, options:
|
|
463
|
+
/* @__PURE__ */ s(gt, { isOpen: c, options: R, onSelect: A, selectedValue: e, placement: d, anchorRef: k, small: b, highlightedIndex: v })
|
|
464
464
|
] });
|
|
465
465
|
}
|
|
466
466
|
function En({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default", title: o, "aria-label": i }) {
|
|
@@ -541,35 +541,35 @@ function Ln({
|
|
|
541
541
|
anchor: o,
|
|
542
542
|
preferredDirection: i = "down"
|
|
543
543
|
}) {
|
|
544
|
-
const l = W(null), [a, d] = T({ top: 0, left: 0 }),
|
|
545
|
-
if (
|
|
546
|
-
if (!e || !
|
|
547
|
-
const c =
|
|
544
|
+
const l = W(null), [a, d] = T({ top: 0, left: 0 }), p = o || (r == null ? void 0 : r.current);
|
|
545
|
+
if (B(() => {
|
|
546
|
+
if (!e || !p || !l.current) return;
|
|
547
|
+
const c = p.getBoundingClientRect(), u = l.current.getBoundingClientRect(), w = window.innerHeight, m = window.innerWidth, v = c.bottom + 8, N = v + u.height <= w - 8;
|
|
548
548
|
let h = i;
|
|
549
549
|
(!N && i === "down" || i === "up" && N) && (h = "up");
|
|
550
550
|
let k;
|
|
551
|
-
h === "down" ? k = v : k = c.top -
|
|
552
|
-
let
|
|
553
|
-
|
|
551
|
+
h === "down" ? k = v : k = c.top - u.height - 8;
|
|
552
|
+
let b = c.left;
|
|
553
|
+
b + u.width > m - 8 && (b = c.right - u.width), d({
|
|
554
554
|
top: Math.max(8, k),
|
|
555
555
|
// Ensure minimum 8px from top
|
|
556
|
-
left: Math.max(8,
|
|
556
|
+
left: Math.max(8, b)
|
|
557
557
|
// Ensure minimum 8px from left
|
|
558
558
|
});
|
|
559
|
-
}, [e,
|
|
559
|
+
}, [e, p, i]), B(() => {
|
|
560
560
|
if (!e) return;
|
|
561
|
-
const c = (
|
|
562
|
-
l.current && !l.current.contains(
|
|
563
|
-
},
|
|
564
|
-
|
|
561
|
+
const c = (w) => {
|
|
562
|
+
l.current && !l.current.contains(w.target) && p && !p.contains(w.target) && t();
|
|
563
|
+
}, u = (w) => {
|
|
564
|
+
w.key === "Escape" && t();
|
|
565
565
|
};
|
|
566
|
-
return document.addEventListener("mousedown", c), document.addEventListener("keydown",
|
|
567
|
-
document.removeEventListener("mousedown", c), document.removeEventListener("keydown",
|
|
566
|
+
return document.addEventListener("mousedown", c), document.addEventListener("keydown", u), () => {
|
|
567
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("keydown", u);
|
|
568
568
|
};
|
|
569
|
-
}, [e, t,
|
|
570
|
-
const
|
|
569
|
+
}, [e, t, p]), !e) return null;
|
|
570
|
+
const f = (c) => {
|
|
571
571
|
c.type !== "separator" && !c.disabled && c.onClick && (c.onClick(), t());
|
|
572
|
-
},
|
|
572
|
+
}, g = n.some((c) => c.icon);
|
|
573
573
|
return pe(
|
|
574
574
|
/* @__PURE__ */ s(
|
|
575
575
|
"div",
|
|
@@ -593,17 +593,17 @@ function Ln({
|
|
|
593
593
|
},
|
|
594
594
|
c.id
|
|
595
595
|
);
|
|
596
|
-
const
|
|
596
|
+
const u = [
|
|
597
597
|
"nc-context-menu-item",
|
|
598
598
|
c.variant && c.variant !== "default" ? `nc-${c.variant}` : "",
|
|
599
599
|
c.disabled ? "nc-disabled" : "",
|
|
600
|
-
|
|
600
|
+
g && !c.icon ? "nc-indented" : ""
|
|
601
601
|
].filter(Boolean).join(" ");
|
|
602
602
|
return /* @__PURE__ */ y(
|
|
603
603
|
"button",
|
|
604
604
|
{
|
|
605
|
-
className:
|
|
606
|
-
onClick: () =>
|
|
605
|
+
className: u,
|
|
606
|
+
onClick: () => f(c),
|
|
607
607
|
disabled: c.disabled,
|
|
608
608
|
role: "menuitem",
|
|
609
609
|
children: [
|
|
@@ -642,26 +642,26 @@ function Bn({
|
|
|
642
642
|
footer: l,
|
|
643
643
|
onOk: a,
|
|
644
644
|
onSave: d,
|
|
645
|
-
onDelete:
|
|
646
|
-
onCancel:
|
|
647
|
-
onConnect:
|
|
645
|
+
onDelete: p,
|
|
646
|
+
onCancel: f,
|
|
647
|
+
onConnect: g,
|
|
648
648
|
closeOnOverlay: c = !0,
|
|
649
|
-
primaryDisabled:
|
|
650
|
-
fullScreen:
|
|
651
|
-
hideTitleBar:
|
|
649
|
+
primaryDisabled: u = !1,
|
|
650
|
+
fullScreen: w = !1,
|
|
651
|
+
hideTitleBar: m = !1,
|
|
652
652
|
className: v = "",
|
|
653
653
|
onContentHeightChange: N
|
|
654
654
|
}) {
|
|
655
|
-
const h = W(null), k = W(null), { t:
|
|
655
|
+
const h = W(null), k = W(null), { t: b } = J(), S = { close: t }, R = (x) => {
|
|
656
656
|
c && x.target === x.currentTarget && t();
|
|
657
657
|
};
|
|
658
|
-
if (
|
|
658
|
+
if (B(() => {
|
|
659
659
|
e && h.current && h.current.focus();
|
|
660
|
-
}, [e]),
|
|
660
|
+
}, [e]), B(() => {
|
|
661
661
|
if (!N || !k.current) return;
|
|
662
|
-
const x = new ResizeObserver((
|
|
663
|
-
for (const
|
|
664
|
-
const C =
|
|
662
|
+
const x = new ResizeObserver((E) => {
|
|
663
|
+
for (const A of E) {
|
|
664
|
+
const C = A.contentRect.height;
|
|
665
665
|
N(C);
|
|
666
666
|
}
|
|
667
667
|
});
|
|
@@ -672,31 +672,31 @@ function Bn({
|
|
|
672
672
|
const I = () => {
|
|
673
673
|
switch (i) {
|
|
674
674
|
case "ok":
|
|
675
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(Y, { variant: "primary", onClick: a ?? t, disabled:
|
|
675
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(Y, { variant: "primary", onClick: a ?? t, disabled: u, children: b("common.ok") }) });
|
|
676
676
|
case "ok-cancel":
|
|
677
677
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
678
|
-
/* @__PURE__ */ s(Y, { variant: "primary", onClick: a ?? t, disabled:
|
|
679
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
678
|
+
/* @__PURE__ */ s(Y, { variant: "primary", onClick: a ?? t, disabled: u, children: b("common.ok") }),
|
|
679
|
+
/* @__PURE__ */ s(ne, { onClick: f, children: b("common.cancel") })
|
|
680
680
|
] });
|
|
681
681
|
case "save-cancel":
|
|
682
682
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
683
|
-
/* @__PURE__ */ s(Y, { variant: "primary", onClick: d, disabled:
|
|
684
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
683
|
+
/* @__PURE__ */ s(Y, { variant: "primary", onClick: d, disabled: u, children: b("common.save") }),
|
|
684
|
+
/* @__PURE__ */ s(ne, { onClick: f, children: b("common.cancel") })
|
|
685
685
|
] });
|
|
686
686
|
case "delete-cancel":
|
|
687
687
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
688
|
-
/* @__PURE__ */ s(Y, { variant: "danger", onClick:
|
|
689
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
688
|
+
/* @__PURE__ */ s(Y, { variant: "danger", onClick: p, disabled: u, children: b("common.delete") }),
|
|
689
|
+
/* @__PURE__ */ s(ne, { onClick: f, children: b("common.cancel") })
|
|
690
690
|
] });
|
|
691
691
|
case "connect":
|
|
692
692
|
return /* @__PURE__ */ y("div", { className: "nc-dialog-footer", children: [
|
|
693
|
-
/* @__PURE__ */ s(Y, { variant: "primary", onClick:
|
|
694
|
-
/* @__PURE__ */ s(ne, { onClick:
|
|
693
|
+
/* @__PURE__ */ s(Y, { variant: "primary", onClick: g, disabled: u, children: b("common.connect") }),
|
|
694
|
+
/* @__PURE__ */ s(ne, { onClick: f, children: b("common.cancel") })
|
|
695
695
|
] });
|
|
696
696
|
case "close":
|
|
697
697
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary" }) });
|
|
698
698
|
case "gotit":
|
|
699
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary", children:
|
|
699
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary", children: b("common.gotit") }) });
|
|
700
700
|
case "custom":
|
|
701
701
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: l });
|
|
702
702
|
case "none":
|
|
@@ -704,7 +704,7 @@ function Bn({
|
|
|
704
704
|
default:
|
|
705
705
|
return null;
|
|
706
706
|
}
|
|
707
|
-
}, z = /* @__PURE__ */ s(He.Provider, { value: S, children: /* @__PURE__ */ s("div", { className: `nc-dialog-overlay${
|
|
707
|
+
}, z = /* @__PURE__ */ s(He.Provider, { value: S, children: /* @__PURE__ */ s("div", { className: `nc-dialog-overlay${w ? " nc-fullscreen" : ""}`, onClick: R, children: /* @__PURE__ */ y(
|
|
708
708
|
"div",
|
|
709
709
|
{
|
|
710
710
|
ref: h,
|
|
@@ -713,9 +713,9 @@ function Bn({
|
|
|
713
713
|
tabIndex: -1,
|
|
714
714
|
role: "dialog",
|
|
715
715
|
"aria-modal": "true",
|
|
716
|
-
"aria-labelledby":
|
|
716
|
+
"aria-labelledby": m ? void 0 : "nc-dialog-title",
|
|
717
717
|
children: [
|
|
718
|
-
!
|
|
718
|
+
!m && /* @__PURE__ */ y("div", { className: "nc-dialog-header", children: [
|
|
719
719
|
/* @__PURE__ */ s("h3", { id: "nc-dialog-title", className: "nc-dialog-title", children: n }),
|
|
720
720
|
/* @__PURE__ */ s(De, { onClick: t, "aria-label": "Close dialog" })
|
|
721
721
|
] }),
|
|
@@ -724,7 +724,7 @@ function Bn({
|
|
|
724
724
|
]
|
|
725
725
|
}
|
|
726
726
|
) }) });
|
|
727
|
-
return
|
|
727
|
+
return w ? pe(z, document.body) : z;
|
|
728
728
|
}
|
|
729
729
|
function yt({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
730
730
|
const r = t === "small" ? 28 : 34;
|
|
@@ -793,48 +793,48 @@ function Dn({
|
|
|
793
793
|
disabled: l,
|
|
794
794
|
label: a,
|
|
795
795
|
clearable: d = !0,
|
|
796
|
-
type:
|
|
797
|
-
className:
|
|
798
|
-
size:
|
|
796
|
+
type: p = "text",
|
|
797
|
+
className: f = "",
|
|
798
|
+
size: g = "default",
|
|
799
799
|
style: c,
|
|
800
|
-
showPasswordToggle:
|
|
801
|
-
multiline:
|
|
802
|
-
rows:
|
|
800
|
+
showPasswordToggle: u = !1,
|
|
801
|
+
multiline: w = !1,
|
|
802
|
+
rows: m = 3,
|
|
803
803
|
validator: v,
|
|
804
804
|
showErrorMessage: N = !0
|
|
805
805
|
}) {
|
|
806
|
-
const h = W(null), k = W(null), [
|
|
806
|
+
const h = W(null), k = W(null), [b, S] = T(!1), [R, I] = T(!1), z = e !== void 0, [x, E] = T(t), A = z ? e : x, C = v ? v(A) : null, L = !!C, $ = p === "password", P = $ && u && !l && !w, H = d && A && !l && R, ee = g === "small" ? 32 : 44;
|
|
807
807
|
let K = 12;
|
|
808
808
|
H && P ? K = ee * 2 : (H || P) && (K = ee);
|
|
809
809
|
const Q = () => {
|
|
810
810
|
var te, ae;
|
|
811
|
-
z ||
|
|
811
|
+
z || E(""), n == null || n(""), o == null || o(), w ? (te = k.current) == null || te.focus() : (ae = h.current) == null || ae.focus();
|
|
812
812
|
}, ce = (te) => {
|
|
813
|
-
te.key === "Enter" && !
|
|
813
|
+
te.key === "Enter" && !w && (r == null || r());
|
|
814
814
|
}, F = (te) => {
|
|
815
815
|
const ae = te.target.value;
|
|
816
|
-
z ||
|
|
816
|
+
z || E(ae), n == null || n(ae);
|
|
817
817
|
}, Se = () => {
|
|
818
818
|
I(!0);
|
|
819
819
|
}, Ce = () => {
|
|
820
820
|
I(!1);
|
|
821
|
-
}, Ie = `nc-input ${
|
|
821
|
+
}, Ie = `nc-input ${g === "small" ? "nc-small " : ""} ${L ? "nc-error " : ""}${f}`;
|
|
822
822
|
return /* @__PURE__ */ y("div", { className: "nc-col", style: { position: "relative", flex: 1, ...c }, children: [
|
|
823
823
|
a && /* @__PURE__ */ s("span", { className: "nc-label", children: a }),
|
|
824
|
-
/* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems:
|
|
825
|
-
|
|
824
|
+
/* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems: w ? "flex-start" : "center" }, children: [
|
|
825
|
+
w ? /* @__PURE__ */ s(
|
|
826
826
|
"textarea",
|
|
827
827
|
{
|
|
828
828
|
ref: k,
|
|
829
829
|
className: Ie,
|
|
830
830
|
placeholder: i,
|
|
831
|
-
value:
|
|
831
|
+
value: A,
|
|
832
832
|
onChange: F,
|
|
833
833
|
onKeyDown: ce,
|
|
834
834
|
onFocus: Se,
|
|
835
835
|
onBlur: Ce,
|
|
836
836
|
disabled: l,
|
|
837
|
-
rows:
|
|
837
|
+
rows: m,
|
|
838
838
|
style: {
|
|
839
839
|
width: "100%",
|
|
840
840
|
paddingRight: K
|
|
@@ -844,10 +844,10 @@ function Dn({
|
|
|
844
844
|
"input",
|
|
845
845
|
{
|
|
846
846
|
ref: h,
|
|
847
|
-
type:
|
|
847
|
+
type: $ && b ? "text" : p,
|
|
848
848
|
className: Ie,
|
|
849
849
|
placeholder: i,
|
|
850
|
-
value:
|
|
850
|
+
value: A,
|
|
851
851
|
onChange: F,
|
|
852
852
|
onKeyDown: ce,
|
|
853
853
|
onFocus: Se,
|
|
@@ -859,10 +859,10 @@ function Dn({
|
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
861
|
),
|
|
862
|
-
H && /* @__PURE__ */ s(yt, { onClick: Q, size:
|
|
863
|
-
P && /* @__PURE__ */ s(xt, { visible:
|
|
862
|
+
H && /* @__PURE__ */ s(yt, { onClick: Q, size: g, rightOffset: P ? ee + 4 : 4 }),
|
|
863
|
+
P && /* @__PURE__ */ s(xt, { visible: b, onClick: () => S(!b), size: g })
|
|
864
864
|
] }),
|
|
865
|
-
|
|
865
|
+
L && N && /* @__PURE__ */ s("span", { className: "nc-error-message", children: C })
|
|
866
866
|
] });
|
|
867
867
|
}
|
|
868
868
|
function Hn({
|
|
@@ -879,8 +879,8 @@ function Hn({
|
|
|
879
879
|
onClick: (d) => {
|
|
880
880
|
if (t) {
|
|
881
881
|
if (r) {
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
882
|
+
const p = window.getSelection();
|
|
883
|
+
if (p && p.toString().length > 0)
|
|
884
884
|
return;
|
|
885
885
|
}
|
|
886
886
|
t(d);
|
|
@@ -916,31 +916,31 @@ function Wn({ title: e, titleTools: t, children: n, style: r }) {
|
|
|
916
916
|
] });
|
|
917
917
|
}
|
|
918
918
|
function On({ values: e, onChange: t, options: n, placeholder: r = "Select…", label: o }) {
|
|
919
|
-
const [i, l] = T(!1), [a, d] = T(""),
|
|
920
|
-
|
|
921
|
-
function c(
|
|
922
|
-
!(
|
|
919
|
+
const [i, l] = T(!1), [a, d] = T(""), p = W(null), f = ge(() => n.filter((c) => c.label.toLowerCase().includes(a.toLowerCase())), [n, a]);
|
|
920
|
+
B(() => {
|
|
921
|
+
function c(u) {
|
|
922
|
+
!(u.target instanceof Node) || !p.current || p.current.contains(u.target) || l(!1);
|
|
923
923
|
}
|
|
924
924
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
925
925
|
}, []);
|
|
926
|
-
const
|
|
927
|
-
e.includes(c) ? t(e.filter((
|
|
926
|
+
const g = (c) => {
|
|
927
|
+
e.includes(c) ? t(e.filter((u) => u !== c)) : t([...e, c]);
|
|
928
928
|
};
|
|
929
|
-
return /* @__PURE__ */ y("div", { ref:
|
|
929
|
+
return /* @__PURE__ */ y("div", { ref: p, className: "nc-col", style: { position: "relative" }, children: [
|
|
930
930
|
o && /* @__PURE__ */ s("span", { className: "nc-label", children: o }),
|
|
931
931
|
/* @__PURE__ */ y("div", { className: "nc-row", style: { flexWrap: "wrap", gap: 6, minHeight: 42, alignItems: "center", border: "1px solid var(--nc-button-border)", borderRadius: 8, background: "var(--nc-button-bg)", padding: "4px 8px" }, children: [
|
|
932
932
|
e.length === 0 && /* @__PURE__ */ s("span", { className: "nc-label", children: r }),
|
|
933
933
|
e.map((c) => {
|
|
934
|
-
const
|
|
935
|
-
return
|
|
936
|
-
|
|
934
|
+
const u = n.find((w) => w.value === c);
|
|
935
|
+
return u ? /* @__PURE__ */ y("span", { style: { padding: "4px 8px", borderRadius: 6, display: "inline-flex", alignItems: "center", gap: 4, background: "var(--nc-button-bg)", border: "1px solid var(--nc-button-border)" }, children: [
|
|
936
|
+
u.label,
|
|
937
937
|
/* @__PURE__ */ s(
|
|
938
938
|
"button",
|
|
939
939
|
{
|
|
940
940
|
className: "nc-button nc-ghost",
|
|
941
941
|
style: { padding: 0, minHeight: 0, height: 20, width: 20, display: "inline-flex", alignItems: "center", justifyContent: "center", border: "none" },
|
|
942
|
-
onClick: () =>
|
|
943
|
-
"aria-label": `Remove ${
|
|
942
|
+
onClick: () => g(c),
|
|
943
|
+
"aria-label": `Remove ${u.label}`,
|
|
944
944
|
children: "✕"
|
|
945
945
|
}
|
|
946
946
|
)
|
|
@@ -958,14 +958,14 @@ function On({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
958
958
|
)
|
|
959
959
|
] }),
|
|
960
960
|
i && /* @__PURE__ */ y("div", { className: "nc-combo-dropdown", style: { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 10, marginTop: 4, boxShadow: "0 4px 12px var(--nc-shadow)" }, children: [
|
|
961
|
-
|
|
962
|
-
const
|
|
963
|
-
return /* @__PURE__ */ y("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () =>
|
|
961
|
+
f.map((c) => {
|
|
962
|
+
const u = e.includes(c.value);
|
|
963
|
+
return /* @__PURE__ */ y("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () => g(c.value), children: [
|
|
964
964
|
/* @__PURE__ */ s("span", { children: c.label }),
|
|
965
|
-
/* @__PURE__ */ s("span", { children:
|
|
965
|
+
/* @__PURE__ */ s("span", { children: u ? "✔️" : "" })
|
|
966
966
|
] }, c.value);
|
|
967
967
|
}),
|
|
968
|
-
|
|
968
|
+
f.length === 0 && /* @__PURE__ */ s("div", { className: "nc-section nc-label", children: "No results" })
|
|
969
969
|
] })
|
|
970
970
|
] });
|
|
971
971
|
}
|
|
@@ -1006,53 +1006,54 @@ function Fn({
|
|
|
1006
1006
|
onChange: n,
|
|
1007
1007
|
label: r,
|
|
1008
1008
|
className: o = "",
|
|
1009
|
-
disabled: i = !1
|
|
1009
|
+
disabled: i = !1,
|
|
1010
|
+
size: l = "default"
|
|
1010
1011
|
}) {
|
|
1011
|
-
const [
|
|
1012
|
-
|
|
1013
|
-
if (
|
|
1014
|
-
const A =
|
|
1015
|
-
window.innerWidth - A.left <
|
|
1012
|
+
const [a, d] = T(!1), [p, f] = T(""), [g, c] = T(""), [u, w] = T({ top: 0, left: 0, width: 0, right: void 0 }), m = W(null), v = W(null);
|
|
1013
|
+
B(() => {
|
|
1014
|
+
if (a && m.current) {
|
|
1015
|
+
const A = m.current.getBoundingClientRect(), L = Math.max(A.width, 400);
|
|
1016
|
+
window.innerWidth - A.left < L && A.right >= L ? w({
|
|
1016
1017
|
top: A.bottom + 4,
|
|
1017
1018
|
left: 0,
|
|
1018
1019
|
// Not used but type needs it, let's just use 0
|
|
1019
1020
|
right: window.innerWidth - A.right,
|
|
1020
|
-
width:
|
|
1021
|
-
}) :
|
|
1021
|
+
width: L
|
|
1022
|
+
}) : w({
|
|
1022
1023
|
top: A.bottom + 4,
|
|
1023
1024
|
left: A.left,
|
|
1024
1025
|
right: void 0,
|
|
1025
|
-
width:
|
|
1026
|
+
width: L
|
|
1026
1027
|
});
|
|
1027
1028
|
}
|
|
1028
|
-
}, [
|
|
1029
|
-
if (!
|
|
1030
|
-
const A = (
|
|
1031
|
-
|
|
1029
|
+
}, [a]), B(() => {
|
|
1030
|
+
if (!a) return;
|
|
1031
|
+
const A = (C) => {
|
|
1032
|
+
m.current && !m.current.contains(C.target) && v.current && !v.current.contains(C.target) && d(!1);
|
|
1032
1033
|
};
|
|
1033
1034
|
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
1034
|
-
}, [
|
|
1035
|
-
const
|
|
1036
|
-
f(e || $e()),
|
|
1037
|
-
}, N = () => {
|
|
1038
|
-
a(!1);
|
|
1035
|
+
}, [a]);
|
|
1036
|
+
const N = () => {
|
|
1037
|
+
f(e || $e()), c(t || $e()), d(!0);
|
|
1039
1038
|
}, h = () => {
|
|
1040
|
-
|
|
1041
|
-
|
|
1039
|
+
d(!1);
|
|
1040
|
+
}, k = () => {
|
|
1041
|
+
const A = fe(p), C = fe(g);
|
|
1042
|
+
if (A || C)
|
|
1042
1043
|
return;
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
},
|
|
1044
|
+
const L = ue(p), $ = ue(g);
|
|
1045
|
+
L && $ && (n == null || n(L, $)), d(!1);
|
|
1046
|
+
}, b = e && t ? `${Me(e)} - ${Me(t)}` : "Select month range", S = fe(p), R = fe(g), I = ue(p), z = ue(g), x = I && z && I > z, E = a ? pe(
|
|
1046
1047
|
/* @__PURE__ */ s(
|
|
1047
1048
|
"div",
|
|
1048
1049
|
{
|
|
1049
|
-
ref:
|
|
1050
|
+
ref: v,
|
|
1050
1051
|
className: "nc-month-range-picker-popup",
|
|
1051
1052
|
style: {
|
|
1052
1053
|
position: "fixed",
|
|
1053
|
-
top:
|
|
1054
|
-
...
|
|
1055
|
-
width:
|
|
1054
|
+
top: u.top,
|
|
1055
|
+
...u.right !== void 0 ? { right: u.right } : { left: u.left },
|
|
1056
|
+
width: u.width,
|
|
1056
1057
|
zIndex: 1e3
|
|
1057
1058
|
},
|
|
1058
1059
|
children: /* @__PURE__ */ y("div", { className: "nc-month-range-picker-content", children: [
|
|
@@ -1063,13 +1064,13 @@ function Fn({
|
|
|
1063
1064
|
"input",
|
|
1064
1065
|
{
|
|
1065
1066
|
type: "text",
|
|
1066
|
-
className: `nc-month-input ${
|
|
1067
|
-
value:
|
|
1067
|
+
className: `nc-month-input ${S ? "nc-error" : ""}`,
|
|
1068
|
+
value: p,
|
|
1068
1069
|
onChange: (A) => f(A.target.value),
|
|
1069
1070
|
placeholder: "YY-M(M) or YYYY-M(M)"
|
|
1070
1071
|
}
|
|
1071
1072
|
),
|
|
1072
|
-
|
|
1073
|
+
S && /* @__PURE__ */ s("div", { className: "nc-month-error-text", children: S })
|
|
1073
1074
|
] }),
|
|
1074
1075
|
/* @__PURE__ */ y("div", { className: "nc-month-range-picker-column", children: [
|
|
1075
1076
|
/* @__PURE__ */ s("label", { className: "nc-label", children: "End Month" }),
|
|
@@ -1077,53 +1078,53 @@ function Fn({
|
|
|
1077
1078
|
"input",
|
|
1078
1079
|
{
|
|
1079
1080
|
type: "text",
|
|
1080
|
-
className: `nc-month-input ${
|
|
1081
|
-
value:
|
|
1082
|
-
onChange: (A) =>
|
|
1081
|
+
className: `nc-month-input ${R ? "nc-error" : ""}`,
|
|
1082
|
+
value: g,
|
|
1083
|
+
onChange: (A) => c(A.target.value),
|
|
1083
1084
|
placeholder: "YY-M(M) or YYYY-M(M)"
|
|
1084
1085
|
}
|
|
1085
1086
|
),
|
|
1086
|
-
|
|
1087
|
+
R && /* @__PURE__ */ s("div", { className: "nc-month-error-text", children: R })
|
|
1087
1088
|
] })
|
|
1088
1089
|
] }),
|
|
1089
|
-
|
|
1090
|
+
x && !S && !R && /* @__PURE__ */ s("div", { className: "nc-month-range-error", children: "End month must be after or equal to start month" }),
|
|
1090
1091
|
/* @__PURE__ */ y("div", { className: "nc-month-range-picker-footer", children: [
|
|
1091
1092
|
/* @__PURE__ */ s(
|
|
1092
1093
|
Y,
|
|
1093
1094
|
{
|
|
1094
1095
|
variant: "primary",
|
|
1095
|
-
onClick:
|
|
1096
|
-
disabled: !
|
|
1096
|
+
onClick: k,
|
|
1097
|
+
disabled: !p || !g || !!S || !!R || !!x,
|
|
1097
1098
|
children: "Apply"
|
|
1098
1099
|
}
|
|
1099
1100
|
),
|
|
1100
|
-
/* @__PURE__ */ s(Y, { variant: "ghost", onClick:
|
|
1101
|
+
/* @__PURE__ */ s(Y, { variant: "ghost", onClick: h, children: "Cancel" })
|
|
1101
1102
|
] })
|
|
1102
1103
|
] })
|
|
1103
1104
|
}
|
|
1104
1105
|
),
|
|
1105
1106
|
document.body
|
|
1106
1107
|
) : null;
|
|
1107
|
-
return /* @__PURE__ */ y("div", { className: `nc-month-range-picker ${o}`, children: [
|
|
1108
|
-
r && /* @__PURE__ */ s("label", { className:
|
|
1108
|
+
return /* @__PURE__ */ y("div", { className: `nc-month-range-picker ${l === "small" ? "nc-small " : ""}${o}`, children: [
|
|
1109
|
+
r && /* @__PURE__ */ s("label", { className: `nc-label${l === "small" ? " nc-small" : ""}`, children: r }),
|
|
1109
1110
|
/* @__PURE__ */ s(
|
|
1110
1111
|
"button",
|
|
1111
1112
|
{
|
|
1112
|
-
ref:
|
|
1113
|
-
className:
|
|
1114
|
-
onClick:
|
|
1113
|
+
ref: m,
|
|
1114
|
+
className: `nc-month-range-picker-input${l === "small" ? " nc-small" : ""}`,
|
|
1115
|
+
onClick: N,
|
|
1115
1116
|
disabled: i,
|
|
1116
|
-
children:
|
|
1117
|
+
children: b
|
|
1117
1118
|
}
|
|
1118
1119
|
),
|
|
1119
|
-
|
|
1120
|
+
E
|
|
1120
1121
|
] });
|
|
1121
1122
|
}
|
|
1122
1123
|
function Vn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disabled: l, size: a = "default" }) {
|
|
1123
|
-
const d = a === "small",
|
|
1124
|
+
const d = a === "small", p = () => {
|
|
1124
1125
|
const c = e - o;
|
|
1125
1126
|
n !== void 0 && c < n || t(parseFloat(c.toFixed(10)));
|
|
1126
|
-
},
|
|
1127
|
+
}, f = () => {
|
|
1127
1128
|
const c = e + o;
|
|
1128
1129
|
r !== void 0 && c > r || t(parseFloat(c.toFixed(10)));
|
|
1129
1130
|
};
|
|
@@ -1137,8 +1138,8 @@ function Vn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1137
1138
|
type: "number",
|
|
1138
1139
|
value: e,
|
|
1139
1140
|
onChange: (c) => {
|
|
1140
|
-
const
|
|
1141
|
-
isNaN(
|
|
1141
|
+
const u = parseFloat(c.target.value);
|
|
1142
|
+
isNaN(u) || n !== void 0 && u < n || r !== void 0 && u > r || t(u);
|
|
1142
1143
|
},
|
|
1143
1144
|
min: n,
|
|
1144
1145
|
max: r,
|
|
@@ -1150,7 +1151,7 @@ function Vn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1150
1151
|
"button",
|
|
1151
1152
|
{
|
|
1152
1153
|
className: `nc-button nc-ghost nc-number-input-button ${d ? "nc-small" : ""}`,
|
|
1153
|
-
onClick:
|
|
1154
|
+
onClick: p,
|
|
1154
1155
|
disabled: l || n !== void 0 && e <= n,
|
|
1155
1156
|
children: "−"
|
|
1156
1157
|
}
|
|
@@ -1159,7 +1160,7 @@ function Vn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1159
1160
|
"button",
|
|
1160
1161
|
{
|
|
1161
1162
|
className: `nc-button nc-ghost nc-number-input-button ${d ? "nc-small" : ""}`,
|
|
1162
|
-
onClick:
|
|
1163
|
+
onClick: f,
|
|
1163
1164
|
disabled: l || r !== void 0 && e >= r,
|
|
1164
1165
|
children: "+"
|
|
1165
1166
|
}
|
|
@@ -1176,13 +1177,13 @@ function Gn({
|
|
|
1176
1177
|
label: i,
|
|
1177
1178
|
disabled: l,
|
|
1178
1179
|
showValue: a = !0,
|
|
1179
|
-
formatValue: d = (
|
|
1180
|
-
width:
|
|
1180
|
+
formatValue: d = (f) => f.toString(),
|
|
1181
|
+
width: p = 200
|
|
1181
1182
|
}) {
|
|
1182
|
-
const
|
|
1183
|
-
const
|
|
1184
|
-
t(
|
|
1185
|
-
},
|
|
1183
|
+
const f = (c) => {
|
|
1184
|
+
const u = parseFloat(c.target.value);
|
|
1185
|
+
t(u);
|
|
1186
|
+
}, g = (e - n) / (r - n) * 100;
|
|
1186
1187
|
return /* @__PURE__ */ y("div", { className: "nc-col", style: { gap: 6 }, children: [
|
|
1187
1188
|
i && /* @__PURE__ */ s("span", { className: "nc-label", children: i }),
|
|
1188
1189
|
/* @__PURE__ */ y("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
|
|
@@ -1192,14 +1193,14 @@ function Gn({
|
|
|
1192
1193
|
type: "range",
|
|
1193
1194
|
className: "nc-slider",
|
|
1194
1195
|
value: e,
|
|
1195
|
-
onChange:
|
|
1196
|
+
onChange: f,
|
|
1196
1197
|
min: n,
|
|
1197
1198
|
max: r,
|
|
1198
1199
|
step: o,
|
|
1199
1200
|
disabled: l,
|
|
1200
1201
|
style: {
|
|
1201
|
-
width:
|
|
1202
|
-
"--nc-slider-percentage": `${
|
|
1202
|
+
width: p,
|
|
1203
|
+
"--nc-slider-percentage": `${g}%`
|
|
1203
1204
|
}
|
|
1204
1205
|
}
|
|
1205
1206
|
),
|
|
@@ -1244,87 +1245,87 @@ function Yn({ active: e, children: t, keepMounted: n = !1, className: r = "", st
|
|
|
1244
1245
|
const l = i.find((a) => a.props.tab === e);
|
|
1245
1246
|
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: l });
|
|
1246
1247
|
}
|
|
1247
|
-
function jn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, className: i, toolbar: l, multiline: a, orientation: d = "horizontal", style:
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1248
|
+
function jn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, className: i, toolbar: l, multiline: a, orientation: d = "horizontal", style: p }) {
|
|
1249
|
+
const f = W(null), [g, c] = T(!1), [u, w] = T(!1), m = d === "verticalLeft" || d === "verticalRight", v = W(!1), N = W(0), h = W(0), k = W(!1);
|
|
1250
|
+
B(() => {
|
|
1250
1251
|
const x = () => {
|
|
1251
|
-
if (
|
|
1252
|
-
if (
|
|
1253
|
-
const { scrollTop:
|
|
1254
|
-
c(
|
|
1252
|
+
if (f.current)
|
|
1253
|
+
if (m) {
|
|
1254
|
+
const { scrollTop: A, scrollHeight: C, clientHeight: L } = f.current;
|
|
1255
|
+
c(A > 1), w(A < C - L - 1);
|
|
1255
1256
|
} else {
|
|
1256
|
-
const { scrollLeft:
|
|
1257
|
-
c(
|
|
1257
|
+
const { scrollLeft: A, scrollWidth: C, clientWidth: L } = f.current;
|
|
1258
|
+
c(A > 1), w(A < C - L - 1);
|
|
1258
1259
|
}
|
|
1259
|
-
},
|
|
1260
|
-
if (
|
|
1261
|
-
return x(),
|
|
1262
|
-
|
|
1260
|
+
}, E = f.current;
|
|
1261
|
+
if (E)
|
|
1262
|
+
return x(), E.addEventListener("scroll", x), window.addEventListener("resize", x), () => {
|
|
1263
|
+
E.removeEventListener("scroll", x), window.removeEventListener("resize", x);
|
|
1263
1264
|
};
|
|
1264
|
-
}, [e,
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1265
|
+
}, [e, m]);
|
|
1266
|
+
const b = (x) => {
|
|
1267
|
+
f.current && (v.current = !0, k.current = !1, N.current = m ? x.clientY : x.clientX, h.current = m ? f.current.scrollTop : f.current.scrollLeft, f.current.style.cursor = "grabbing", f.current.style.userSelect = "none");
|
|
1267
1268
|
}, S = (x) => {
|
|
1268
|
-
if (!v.current || !
|
|
1269
|
-
const
|
|
1270
|
-
Math.abs(
|
|
1271
|
-
},
|
|
1272
|
-
|
|
1269
|
+
if (!v.current || !f.current) return;
|
|
1270
|
+
const E = m ? x.clientY : x.clientX, A = N.current - E;
|
|
1271
|
+
Math.abs(A) > 3 && (k.current = !0), m ? f.current.scrollTop = h.current + A : f.current.scrollLeft = h.current + A;
|
|
1272
|
+
}, R = () => {
|
|
1273
|
+
f.current && (v.current = !1, f.current.style.cursor = "", f.current.style.userSelect = "");
|
|
1273
1274
|
}, I = () => {
|
|
1274
|
-
|
|
1275
|
+
R();
|
|
1275
1276
|
};
|
|
1276
|
-
|
|
1277
|
-
const x =
|
|
1278
|
-
if (!x ||
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1277
|
+
B(() => {
|
|
1278
|
+
const x = f.current;
|
|
1279
|
+
if (!x || m) return;
|
|
1280
|
+
const E = (A) => {
|
|
1281
|
+
A.deltaY !== 0 && (A.preventDefault(), x.scrollLeft += A.deltaY * 0.3);
|
|
1281
1282
|
};
|
|
1282
|
-
return x.addEventListener("wheel",
|
|
1283
|
-
x.removeEventListener("wheel",
|
|
1283
|
+
return x.addEventListener("wheel", E, { passive: !1 }), () => {
|
|
1284
|
+
x.removeEventListener("wheel", E);
|
|
1284
1285
|
};
|
|
1285
|
-
}, [
|
|
1286
|
+
}, [m]);
|
|
1286
1287
|
const z = (x) => {
|
|
1287
1288
|
k.current || n(x);
|
|
1288
1289
|
};
|
|
1289
|
-
return /* @__PURE__ */ y("div", { className: `nc-tab-container ${
|
|
1290
|
+
return /* @__PURE__ */ y("div", { className: `nc-tab-container ${m ? `nc-vertical nc-${d}` : ""} ${i || ""}`, style: p, children: [
|
|
1290
1291
|
/* @__PURE__ */ y("div", { className: "nc-tab-scroll-wrapper", children: [
|
|
1291
|
-
|
|
1292
|
+
g && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${m ? "nc-top" : "nc-left"}`, children: m ? /* @__PURE__ */ s(kt, { size: 16 }) : /* @__PURE__ */ s(lt, { size: 16 }) }),
|
|
1292
1293
|
/* @__PURE__ */ s(
|
|
1293
1294
|
"div",
|
|
1294
1295
|
{
|
|
1295
|
-
ref:
|
|
1296
|
+
ref: f,
|
|
1296
1297
|
className: `nc-tab-scroll ${a ? "nc-multiline" : ""}`,
|
|
1297
|
-
onMouseDown:
|
|
1298
|
+
onMouseDown: b,
|
|
1298
1299
|
onMouseMove: S,
|
|
1299
|
-
onMouseUp:
|
|
1300
|
+
onMouseUp: R,
|
|
1300
1301
|
onMouseLeave: I,
|
|
1301
1302
|
style: { cursor: "grab" },
|
|
1302
1303
|
children: e.map((x) => {
|
|
1303
|
-
const
|
|
1304
|
+
const E = typeof x == "string" ? x : x.id, A = typeof x == "string" ? x : x.label, C = r && !(o != null && o.includes(E));
|
|
1304
1305
|
return /* @__PURE__ */ y(
|
|
1305
1306
|
"div",
|
|
1306
1307
|
{
|
|
1307
|
-
className: `nc-tab-item ${t ===
|
|
1308
|
-
onClick: () => z(
|
|
1308
|
+
className: `nc-tab-item ${t === E ? "nc-active" : ""} ${C ? "nc-closable" : ""}`,
|
|
1309
|
+
onClick: () => z(E),
|
|
1309
1310
|
role: "button",
|
|
1310
1311
|
tabIndex: 0,
|
|
1311
|
-
onKeyDown: (
|
|
1312
|
-
(
|
|
1312
|
+
onKeyDown: (L) => {
|
|
1313
|
+
(L.key === "Enter" || L.key === " ") && n(E);
|
|
1313
1314
|
},
|
|
1314
1315
|
children: [
|
|
1315
|
-
/* @__PURE__ */ s("span", { className: "nc-tab-label", children:
|
|
1316
|
+
/* @__PURE__ */ s("span", { className: "nc-tab-label", children: m ? A : typeof A == "string" ? A.toUpperCase() : A }),
|
|
1316
1317
|
C && /* @__PURE__ */ s(
|
|
1317
1318
|
"span",
|
|
1318
1319
|
{
|
|
1319
1320
|
className: "nc-tab-close",
|
|
1320
1321
|
role: "button",
|
|
1321
1322
|
tabIndex: 0,
|
|
1322
|
-
"aria-label": `Close ${typeof
|
|
1323
|
-
onClick: (
|
|
1324
|
-
|
|
1323
|
+
"aria-label": `Close ${typeof A == "string" ? A : E}`,
|
|
1324
|
+
onClick: (L) => {
|
|
1325
|
+
L.stopPropagation(), r(E);
|
|
1325
1326
|
},
|
|
1326
|
-
onKeyDown: (
|
|
1327
|
-
(
|
|
1327
|
+
onKeyDown: (L) => {
|
|
1328
|
+
(L.key === "Enter" || L.key === " ") && (L.stopPropagation(), r(E));
|
|
1328
1329
|
},
|
|
1329
1330
|
children: /* @__PURE__ */ y("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1330
1331
|
/* @__PURE__ */ s("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -1334,12 +1335,12 @@ function jn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1334
1335
|
)
|
|
1335
1336
|
]
|
|
1336
1337
|
},
|
|
1337
|
-
|
|
1338
|
+
E
|
|
1338
1339
|
);
|
|
1339
1340
|
})
|
|
1340
1341
|
}
|
|
1341
1342
|
),
|
|
1342
|
-
|
|
1343
|
+
u && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${m ? "nc-bottom" : "nc-right"}`, children: m ? /* @__PURE__ */ s(dt, { size: 16 }) : /* @__PURE__ */ s(ut, { size: 16 }) })
|
|
1343
1344
|
] }),
|
|
1344
1345
|
l && /* @__PURE__ */ s("div", { className: "nc-tab-toolbar", children: l })
|
|
1345
1346
|
] });
|
|
@@ -1417,13 +1418,13 @@ function St(e, t, n, r) {
|
|
|
1417
1418
|
const o = e.split(`
|
|
1418
1419
|
`), i = Math.max(1, Math.min(t, o.length));
|
|
1419
1420
|
let l = 0;
|
|
1420
|
-
for (let
|
|
1421
|
-
l += o[
|
|
1422
|
-
const d = o[i - 1].split(" "),
|
|
1423
|
-
for (let
|
|
1424
|
-
l += d[
|
|
1425
|
-
const
|
|
1426
|
-
return l +=
|
|
1421
|
+
for (let g = 0; g < i - 1; g++)
|
|
1422
|
+
l += o[g].length + 1;
|
|
1423
|
+
const d = o[i - 1].split(" "), p = Math.max(1, Math.min(n, d.length));
|
|
1424
|
+
for (let g = 0; g < p - 1; g++)
|
|
1425
|
+
l += d[g].length + 1;
|
|
1426
|
+
const f = Math.max(1, Math.min(r, d[p - 1].length + 1));
|
|
1427
|
+
return l += f - 1, l;
|
|
1427
1428
|
}
|
|
1428
1429
|
function Ct(e, t) {
|
|
1429
1430
|
const n = e.split(`
|
|
@@ -1434,78 +1435,78 @@ function Ct(e, t) {
|
|
|
1434
1435
|
return o;
|
|
1435
1436
|
}
|
|
1436
1437
|
const _n = tt(
|
|
1437
|
-
function({ value: t, onChange: n, placeholder: r, className: o, style: i, showLineNumbers: l = !1, onCursorChange: a, highlightLine: d },
|
|
1438
|
-
const
|
|
1439
|
-
nt(
|
|
1438
|
+
function({ value: t, onChange: n, placeholder: r, className: o, style: i, showLineNumbers: l = !1, onCursorChange: a, highlightLine: d }, p) {
|
|
1439
|
+
const f = W(null), g = W(null), c = W(null);
|
|
1440
|
+
nt(p, () => ({
|
|
1440
1441
|
goToLine(h) {
|
|
1441
|
-
const k =
|
|
1442
|
+
const k = f.current;
|
|
1442
1443
|
if (!k) return;
|
|
1443
|
-
const
|
|
1444
|
-
k.focus(), k.setSelectionRange(
|
|
1444
|
+
const b = Ct(t, h);
|
|
1445
|
+
k.focus(), k.setSelectionRange(b, b);
|
|
1445
1446
|
const S = parseFloat(getComputedStyle(k).lineHeight) || 18;
|
|
1446
|
-
k.scrollTop = (Math.max(1, h) - 1) * S,
|
|
1447
|
+
k.scrollTop = (Math.max(1, h) - 1) * S, w(), u();
|
|
1447
1448
|
},
|
|
1448
|
-
goToPosition(h, k,
|
|
1449
|
-
const S =
|
|
1449
|
+
goToPosition(h, k, b) {
|
|
1450
|
+
const S = f.current;
|
|
1450
1451
|
if (!S) return;
|
|
1451
|
-
const
|
|
1452
|
-
S.focus(), S.setSelectionRange(
|
|
1452
|
+
const R = St(t, h, k, b);
|
|
1453
|
+
S.focus(), S.setSelectionRange(R, R);
|
|
1453
1454
|
const I = parseFloat(getComputedStyle(S).lineHeight) || 18;
|
|
1454
|
-
S.scrollTop = (Math.max(1, h) - 1) * I,
|
|
1455
|
+
S.scrollTop = (Math.max(1, h) - 1) * I, w(), u();
|
|
1455
1456
|
}
|
|
1456
1457
|
}), [t]);
|
|
1457
|
-
const
|
|
1458
|
-
if (!a || !
|
|
1459
|
-
const h = At(t,
|
|
1458
|
+
const u = O(() => {
|
|
1459
|
+
if (!a || !f.current) return;
|
|
1460
|
+
const h = At(t, f.current.selectionStart);
|
|
1460
1461
|
a(h);
|
|
1461
|
-
}, [a, t]),
|
|
1462
|
-
const h =
|
|
1463
|
-
h && (
|
|
1462
|
+
}, [a, t]), w = O(() => {
|
|
1463
|
+
const h = f.current;
|
|
1464
|
+
h && (g.current && (g.current.scrollTop = h.scrollTop, g.current.scrollLeft = h.scrollLeft), c.current && (c.current.scrollTop = h.scrollTop));
|
|
1464
1465
|
}, []);
|
|
1465
|
-
|
|
1466
|
+
B(() => {
|
|
1466
1467
|
if (d == null || d < 1) return;
|
|
1467
|
-
const h =
|
|
1468
|
+
const h = f.current;
|
|
1468
1469
|
if (!h) return;
|
|
1469
|
-
const k = parseFloat(getComputedStyle(h).lineHeight) || 18,
|
|
1470
|
-
(
|
|
1470
|
+
const k = parseFloat(getComputedStyle(h).lineHeight) || 18, b = (d - 1) * k, S = b + k;
|
|
1471
|
+
(b < h.scrollTop || S > h.scrollTop + h.clientHeight) && (h.scrollTop = b - h.clientHeight / 2 + k / 2), w();
|
|
1471
1472
|
}, [d]);
|
|
1472
|
-
const
|
|
1473
|
+
const m = ge(() => t.split(`
|
|
1473
1474
|
`).length, [t]), v = () => {
|
|
1474
1475
|
const h = [];
|
|
1475
|
-
for (let k = 1; k <=
|
|
1476
|
+
for (let k = 1; k <= m; k++)
|
|
1476
1477
|
h.push(
|
|
1477
1478
|
/* @__PURE__ */ s("div", { className: `nc-csv-line-number ${d === k ? "nc-csv-highlight" : ""}`, children: k }, k)
|
|
1478
1479
|
);
|
|
1479
1480
|
return /* @__PURE__ */ s("div", { className: "nc-csv-gutter", ref: c, children: h });
|
|
1480
1481
|
}, N = (h) => h ? h.split(`
|
|
1481
|
-
`).map((
|
|
1482
|
-
const
|
|
1482
|
+
`).map((b, S) => {
|
|
1483
|
+
const R = b.split(" ");
|
|
1483
1484
|
return /* @__PURE__ */ y("div", { className: `nc-csv-line ${d === S + 1 ? "nc-csv-highlight" : ""}`, children: [
|
|
1484
|
-
|
|
1485
|
+
R.map((I, z) => /* @__PURE__ */ y("span", { children: [
|
|
1485
1486
|
z > 0 && /* @__PURE__ */ s("span", { className: "nc-csv-tab-char", children: " " }),
|
|
1486
1487
|
/* @__PURE__ */ s("span", { style: { color: Re[z % Re.length] }, children: I })
|
|
1487
1488
|
] }, z)),
|
|
1488
|
-
|
|
1489
|
+
b === "" && `
|
|
1489
1490
|
`
|
|
1490
1491
|
] }, S);
|
|
1491
1492
|
}) : null;
|
|
1492
1493
|
return /* @__PURE__ */ y("div", { className: `nc-csv-textarea-container ${l ? "nc-csv-with-gutter" : ""} ${o ?? ""}`, style: i, children: [
|
|
1493
1494
|
l && v(),
|
|
1494
1495
|
/* @__PURE__ */ y("div", { className: "nc-csv-textarea-editor", children: [
|
|
1495
|
-
/* @__PURE__ */ s("div", { className: "nc-csv-textarea-backdrop", ref:
|
|
1496
|
+
/* @__PURE__ */ s("div", { className: "nc-csv-textarea-backdrop", ref: g, children: /* @__PURE__ */ s("pre", { className: "nc-csv-textarea-highlights", children: N(t) }) }),
|
|
1496
1497
|
/* @__PURE__ */ s(
|
|
1497
1498
|
"textarea",
|
|
1498
1499
|
{
|
|
1499
|
-
ref:
|
|
1500
|
+
ref: f,
|
|
1500
1501
|
className: "nc-csv-textarea-input",
|
|
1501
1502
|
value: t,
|
|
1502
1503
|
onChange: (h) => {
|
|
1503
|
-
n(h.target.value), requestAnimationFrame(
|
|
1504
|
+
n(h.target.value), requestAnimationFrame(u);
|
|
1504
1505
|
},
|
|
1505
|
-
onScroll:
|
|
1506
|
-
onSelect:
|
|
1507
|
-
onKeyUp:
|
|
1508
|
-
onClick:
|
|
1506
|
+
onScroll: w,
|
|
1507
|
+
onSelect: u,
|
|
1508
|
+
onKeyUp: u,
|
|
1509
|
+
onClick: u,
|
|
1509
1510
|
placeholder: r,
|
|
1510
1511
|
spellCheck: !1,
|
|
1511
1512
|
autoComplete: "off",
|
|
@@ -1595,22 +1596,22 @@ function $t({ notification: e }) {
|
|
|
1595
1596
|
}
|
|
1596
1597
|
function Un() {
|
|
1597
1598
|
const [e, t] = T([]), [n, r] = T(/* @__PURE__ */ new Map()), [o, i] = T(/* @__PURE__ */ new Set()), l = W(null), a = W([]);
|
|
1598
|
-
return
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1599
|
+
return B(() => It((p) => {
|
|
1600
|
+
const f = new Set(a.current.map((c) => c.id)), g = p.filter((c) => !f.has(c.id)).map((c) => c.id);
|
|
1601
|
+
g.length > 0 ? (t(p), i(new Set(g)), requestAnimationFrame(() => {
|
|
1601
1602
|
requestAnimationFrame(() => {
|
|
1602
1603
|
i(/* @__PURE__ */ new Set());
|
|
1603
1604
|
});
|
|
1604
|
-
})) : t(
|
|
1605
|
-
}), []),
|
|
1605
|
+
})) : t(p), a.current = p;
|
|
1606
|
+
}), []), B(() => {
|
|
1606
1607
|
if (!l.current) return;
|
|
1607
1608
|
const d = /* @__PURE__ */ new Map();
|
|
1608
|
-
let
|
|
1609
|
-
const
|
|
1610
|
-
e.forEach((
|
|
1611
|
-
if (d.set(
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1609
|
+
let p = 0;
|
|
1610
|
+
const f = l.current.children;
|
|
1611
|
+
e.forEach((g, c) => {
|
|
1612
|
+
if (d.set(g.id, p), f[c]) {
|
|
1613
|
+
const u = f[c].offsetHeight;
|
|
1614
|
+
g.isRemoving || (p += u + 12);
|
|
1614
1615
|
}
|
|
1615
1616
|
}), r(d);
|
|
1616
1617
|
}, [e]), /* @__PURE__ */ s(
|
|
@@ -1632,7 +1633,7 @@ function Un() {
|
|
|
1632
1633
|
position: "relative"
|
|
1633
1634
|
},
|
|
1634
1635
|
children: e.map((d) => {
|
|
1635
|
-
const
|
|
1636
|
+
const p = o.has(d.id), f = d.isRemoving, g = n.get(d.id) || 0;
|
|
1636
1637
|
return /* @__PURE__ */ s(
|
|
1637
1638
|
"div",
|
|
1638
1639
|
{
|
|
@@ -1640,10 +1641,10 @@ function Un() {
|
|
|
1640
1641
|
position: "absolute",
|
|
1641
1642
|
top: 0,
|
|
1642
1643
|
left: 0,
|
|
1643
|
-
transform:
|
|
1644
|
+
transform: p ? "translateY(-120px)" : `translateY(${g}px)`,
|
|
1644
1645
|
// Only animate transform when not leaving, animate opacity always
|
|
1645
|
-
transition:
|
|
1646
|
-
opacity:
|
|
1646
|
+
transition: f ? "opacity 300ms ease-out" : "transform 300ms ease-out, opacity 300ms ease-out",
|
|
1647
|
+
opacity: f ? 0 : 1,
|
|
1647
1648
|
width: "100%"
|
|
1648
1649
|
},
|
|
1649
1650
|
children: /* @__PURE__ */ s($t, { notification: d })
|
|
@@ -1969,37 +1970,37 @@ class Bt extends xe.Component {
|
|
|
1969
1970
|
}
|
|
1970
1971
|
}
|
|
1971
1972
|
function Fe({ appId: e, isActive: t, onClose: n }) {
|
|
1972
|
-
const { t: r } = J(), o = oe.get(e), [i, l] = T(""), [a, d] = T(null), [
|
|
1973
|
+
const { t: r } = J(), o = oe.get(e), [i, l] = T(""), [a, d] = T(null), [p, f] = T(null), [g, c] = T(!1), [u, w] = T(!1);
|
|
1973
1974
|
xe.useEffect(() => {
|
|
1974
1975
|
o != null && o.titleKey && l(r(o.titleKey));
|
|
1975
1976
|
}, [o, r]);
|
|
1976
|
-
const
|
|
1977
|
+
const m = O((x) => {
|
|
1977
1978
|
l(x);
|
|
1978
1979
|
}, []), v = O((x) => {
|
|
1979
1980
|
d(() => x);
|
|
1980
1981
|
}, []), N = O(() => {
|
|
1981
1982
|
d(null);
|
|
1982
1983
|
}, []), h = O((x) => {
|
|
1983
|
-
|
|
1984
|
+
f(x);
|
|
1984
1985
|
}, []), k = O(() => {
|
|
1985
|
-
|
|
1986
|
-
}, []),
|
|
1986
|
+
f(null);
|
|
1987
|
+
}, []), b = O((x) => {
|
|
1987
1988
|
c(x);
|
|
1988
1989
|
}, []), S = O((x) => {
|
|
1989
|
-
|
|
1990
|
-
}, []),
|
|
1991
|
-
setTitle:
|
|
1990
|
+
w(x);
|
|
1991
|
+
}, []), R = ge(() => ({
|
|
1992
|
+
setTitle: m,
|
|
1992
1993
|
setBackHandler: v,
|
|
1993
1994
|
clearBackHandler: N,
|
|
1994
1995
|
setToolbar: h,
|
|
1995
1996
|
clearToolbar: k,
|
|
1996
|
-
setHideBackButton:
|
|
1997
|
+
setHideBackButton: b,
|
|
1997
1998
|
setHideTitleBar: S,
|
|
1998
1999
|
close: n
|
|
1999
|
-
}), [
|
|
2000
|
+
}), [m, v, N, h, k, b, S, n]);
|
|
2000
2001
|
if (!o)
|
|
2001
2002
|
return null;
|
|
2002
|
-
const I = o.component, z = !o.hideTitleBar && !
|
|
2003
|
+
const I = o.component, z = !o.hideTitleBar && !u;
|
|
2003
2004
|
return /* @__PURE__ */ y(
|
|
2004
2005
|
"div",
|
|
2005
2006
|
{
|
|
@@ -2016,8 +2017,8 @@ function Fe({ appId: e, isActive: t, onClose: n }) {
|
|
|
2016
2017
|
title: i,
|
|
2017
2018
|
onClose: n,
|
|
2018
2019
|
onBack: a ?? void 0,
|
|
2019
|
-
toolbar:
|
|
2020
|
-
hideBackButton:
|
|
2020
|
+
toolbar: p,
|
|
2021
|
+
hideBackButton: g
|
|
2021
2022
|
}
|
|
2022
2023
|
),
|
|
2023
2024
|
/* @__PURE__ */ s(
|
|
@@ -2033,7 +2034,7 @@ function Fe({ appId: e, isActive: t, onClose: n }) {
|
|
|
2033
2034
|
backgroundColor: "var(--nc-bg-secondary)",
|
|
2034
2035
|
position: "relative"
|
|
2035
2036
|
},
|
|
2036
|
-
children: /* @__PURE__ */ s(Oe.Provider, { value:
|
|
2037
|
+
children: /* @__PURE__ */ s(Oe.Provider, { value: R, children: /* @__PURE__ */ s(Bt, { appId: e, children: /* @__PURE__ */ s(
|
|
2037
2038
|
rt,
|
|
2038
2039
|
{
|
|
2039
2040
|
fallback: /* @__PURE__ */ s(
|
|
@@ -2076,7 +2077,7 @@ function Jn({ children: e }) {
|
|
|
2076
2077
|
height: o
|
|
2077
2078
|
};
|
|
2078
2079
|
});
|
|
2079
|
-
return
|
|
2080
|
+
return B(() => {
|
|
2080
2081
|
const r = () => {
|
|
2081
2082
|
const o = window.innerWidth, i = window.innerHeight;
|
|
2082
2083
|
n({
|
|
@@ -2201,27 +2202,27 @@ const ke = "-", Dt = (e) => {
|
|
|
2201
2202
|
experimentalParseClassName: n
|
|
2202
2203
|
} = e, r = t.length === 1, o = t[0], i = t.length, l = (a) => {
|
|
2203
2204
|
const d = [];
|
|
2204
|
-
let
|
|
2205
|
+
let p = 0, f = 0, g;
|
|
2205
2206
|
for (let v = 0; v < a.length; v++) {
|
|
2206
2207
|
let N = a[v];
|
|
2207
|
-
if (
|
|
2208
|
+
if (p === 0) {
|
|
2208
2209
|
if (N === o && (r || a.slice(v, v + i) === t)) {
|
|
2209
|
-
d.push(a.slice(
|
|
2210
|
+
d.push(a.slice(f, v)), f = v + i;
|
|
2210
2211
|
continue;
|
|
2211
2212
|
}
|
|
2212
2213
|
if (N === "/") {
|
|
2213
|
-
|
|
2214
|
+
g = v;
|
|
2214
2215
|
continue;
|
|
2215
2216
|
}
|
|
2216
2217
|
}
|
|
2217
|
-
N === "[" ?
|
|
2218
|
+
N === "[" ? p++ : N === "]" && p--;
|
|
2218
2219
|
}
|
|
2219
|
-
const c = d.length === 0 ? a : a.substring(
|
|
2220
|
+
const c = d.length === 0 ? a : a.substring(f), u = c.startsWith(Ke), w = u ? c.substring(1) : c, m = g && g > f ? g - f : void 0;
|
|
2220
2221
|
return {
|
|
2221
2222
|
modifiers: d,
|
|
2222
|
-
hasImportantModifier:
|
|
2223
|
-
baseClassName:
|
|
2224
|
-
maybePostfixModifierPosition:
|
|
2223
|
+
hasImportantModifier: u,
|
|
2224
|
+
baseClassName: w,
|
|
2225
|
+
maybePostfixModifierPosition: m
|
|
2225
2226
|
};
|
|
2226
2227
|
};
|
|
2227
2228
|
return n ? (a) => n({
|
|
@@ -2248,34 +2249,34 @@ const ke = "-", Dt = (e) => {
|
|
|
2248
2249
|
} = t, i = [], l = e.trim().split(Kt);
|
|
2249
2250
|
let a = "";
|
|
2250
2251
|
for (let d = l.length - 1; d >= 0; d -= 1) {
|
|
2251
|
-
const
|
|
2252
|
-
modifiers:
|
|
2253
|
-
hasImportantModifier:
|
|
2252
|
+
const p = l[d], {
|
|
2253
|
+
modifiers: f,
|
|
2254
|
+
hasImportantModifier: g,
|
|
2254
2255
|
baseClassName: c,
|
|
2255
|
-
maybePostfixModifierPosition:
|
|
2256
|
-
} = n(
|
|
2257
|
-
let
|
|
2258
|
-
if (!
|
|
2259
|
-
if (!
|
|
2260
|
-
a =
|
|
2256
|
+
maybePostfixModifierPosition: u
|
|
2257
|
+
} = n(p);
|
|
2258
|
+
let w = !!u, m = r(w ? c.substring(0, u) : c);
|
|
2259
|
+
if (!m) {
|
|
2260
|
+
if (!w) {
|
|
2261
|
+
a = p + (a.length > 0 ? " " + a : a);
|
|
2261
2262
|
continue;
|
|
2262
2263
|
}
|
|
2263
|
-
if (
|
|
2264
|
-
a =
|
|
2264
|
+
if (m = r(c), !m) {
|
|
2265
|
+
a = p + (a.length > 0 ? " " + a : a);
|
|
2265
2266
|
continue;
|
|
2266
2267
|
}
|
|
2267
|
-
|
|
2268
|
+
w = !1;
|
|
2268
2269
|
}
|
|
2269
|
-
const v = Yt(
|
|
2270
|
+
const v = Yt(f).join(":"), N = g ? v + Ke : v, h = N + m;
|
|
2270
2271
|
if (i.includes(h))
|
|
2271
2272
|
continue;
|
|
2272
2273
|
i.push(h);
|
|
2273
|
-
const k = o(
|
|
2274
|
-
for (let
|
|
2275
|
-
const S = k[
|
|
2274
|
+
const k = o(m, w);
|
|
2275
|
+
for (let b = 0; b < k.length; ++b) {
|
|
2276
|
+
const S = k[b];
|
|
2276
2277
|
i.push(N + S);
|
|
2277
2278
|
}
|
|
2278
|
-
a =
|
|
2279
|
+
a = p + (a.length > 0 ? " " + a : a);
|
|
2279
2280
|
}
|
|
2280
2281
|
return a;
|
|
2281
2282
|
};
|
|
@@ -2296,21 +2297,21 @@ const _e = (e) => {
|
|
|
2296
2297
|
function qt(e, ...t) {
|
|
2297
2298
|
let n, r, o, i = l;
|
|
2298
2299
|
function l(d) {
|
|
2299
|
-
const
|
|
2300
|
-
return n = jt(
|
|
2300
|
+
const p = t.reduce((f, g) => g(f), e());
|
|
2301
|
+
return n = jt(p), r = n.cache.get, o = n.cache.set, i = a, a(d);
|
|
2301
2302
|
}
|
|
2302
2303
|
function a(d) {
|
|
2303
|
-
const
|
|
2304
|
-
if (
|
|
2305
|
-
return
|
|
2306
|
-
const
|
|
2307
|
-
return o(d,
|
|
2304
|
+
const p = r(d);
|
|
2305
|
+
if (p)
|
|
2306
|
+
return p;
|
|
2307
|
+
const f = _t(d, n);
|
|
2308
|
+
return o(d, f), f;
|
|
2308
2309
|
}
|
|
2309
2310
|
return function() {
|
|
2310
2311
|
return i(Ut.apply(null, arguments));
|
|
2311
2312
|
};
|
|
2312
2313
|
}
|
|
2313
|
-
const
|
|
2314
|
+
const D = (e) => {
|
|
2314
2315
|
const t = (n) => n[e] || [];
|
|
2315
2316
|
return t.isThemeGetter = !0, t;
|
|
2316
2317
|
}, Ue = /^\[(?:([a-z-]+):)?(.+)\]$/i, Xt = /^\d+\/\d+$/, Jt = /* @__PURE__ */ new Set(["px", "full", "screen"]), Qt = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Zt = /\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$/, en = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, tn = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, nn = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, G = (e) => re(e) || Jt.has(e) || Xt.test(e), U = (e) => ie(e, "length", un), re = (e) => !!e && !Number.isNaN(Number(e)), be = (e) => ie(e, "number", re), le = (e) => !!e && Number.isInteger(Number(e)), rn = (e) => e.endsWith("%") && re(e.slice(0, -1)), M = (e) => Ue.test(e), q = (e) => Qt.test(e), on = /* @__PURE__ */ new Set(["length", "size", "percentage"]), sn = (e) => ie(e, on, qe), cn = (e) => ie(e, "position", qe), an = /* @__PURE__ */ new Set(["image", "url"]), ln = (e) => ie(e, an, fn), dn = (e) => ie(e, "", pn), de = () => !0, ie = (e, t, n) => {
|
|
@@ -2322,7 +2323,7 @@ const B = (e) => {
|
|
|
2322
2323
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2323
2324
|
Zt.test(e) && !en.test(e)
|
|
2324
2325
|
), qe = () => !1, pn = (e) => tn.test(e), fn = (e) => nn.test(e), hn = () => {
|
|
2325
|
-
const e =
|
|
2326
|
+
const e = D("colors"), t = D("spacing"), n = D("blur"), r = D("brightness"), o = D("borderColor"), i = D("borderRadius"), l = D("borderSpacing"), a = D("borderWidth"), d = D("contrast"), p = D("grayscale"), f = D("hueRotate"), g = D("invert"), c = D("gap"), u = D("gradientColorStops"), w = D("gradientColorStopPositions"), m = D("inset"), v = D("margin"), N = D("opacity"), h = D("padding"), k = D("saturate"), b = D("scale"), S = D("sepia"), R = D("skew"), I = D("space"), z = D("translate"), x = () => ["auto", "contain", "none"], E = () => ["auto", "hidden", "clip", "visible", "scroll"], A = () => ["auto", M, t], C = () => [M, t], L = () => ["", G, U], $ = () => ["auto", re, M], P = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], H = () => ["solid", "dashed", "dotted", "double", "none"], ee = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], K = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], Q = () => ["", "0", M], ce = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], F = () => [re, M];
|
|
2326
2327
|
return {
|
|
2327
2328
|
cacheSize: 500,
|
|
2328
2329
|
separator: ":",
|
|
@@ -2334,7 +2335,7 @@ const B = (e) => {
|
|
|
2334
2335
|
borderColor: [e],
|
|
2335
2336
|
borderRadius: ["none", "", "full", q, M],
|
|
2336
2337
|
borderSpacing: C(),
|
|
2337
|
-
borderWidth:
|
|
2338
|
+
borderWidth: L(),
|
|
2338
2339
|
contrast: F(),
|
|
2339
2340
|
grayscale: Q(),
|
|
2340
2341
|
hueRotate: F(),
|
|
@@ -2342,8 +2343,8 @@ const B = (e) => {
|
|
|
2342
2343
|
gap: C(),
|
|
2343
2344
|
gradientColorStops: [e],
|
|
2344
2345
|
gradientColorStopPositions: [rn, U],
|
|
2345
|
-
inset:
|
|
2346
|
-
margin:
|
|
2346
|
+
inset: A(),
|
|
2347
|
+
margin: A(),
|
|
2347
2348
|
opacity: F(),
|
|
2348
2349
|
padding: C(),
|
|
2349
2350
|
saturate: F(),
|
|
@@ -2452,21 +2453,21 @@ const B = (e) => {
|
|
|
2452
2453
|
* @see https://tailwindcss.com/docs/overflow
|
|
2453
2454
|
*/
|
|
2454
2455
|
overflow: [{
|
|
2455
|
-
overflow:
|
|
2456
|
+
overflow: E()
|
|
2456
2457
|
}],
|
|
2457
2458
|
/**
|
|
2458
2459
|
* Overflow X
|
|
2459
2460
|
* @see https://tailwindcss.com/docs/overflow
|
|
2460
2461
|
*/
|
|
2461
2462
|
"overflow-x": [{
|
|
2462
|
-
"overflow-x":
|
|
2463
|
+
"overflow-x": E()
|
|
2463
2464
|
}],
|
|
2464
2465
|
/**
|
|
2465
2466
|
* Overflow Y
|
|
2466
2467
|
* @see https://tailwindcss.com/docs/overflow
|
|
2467
2468
|
*/
|
|
2468
2469
|
"overflow-y": [{
|
|
2469
|
-
"overflow-y":
|
|
2470
|
+
"overflow-y": E()
|
|
2470
2471
|
}],
|
|
2471
2472
|
/**
|
|
2472
2473
|
* Overscroll Behavior
|
|
@@ -2499,63 +2500,63 @@ const B = (e) => {
|
|
|
2499
2500
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2500
2501
|
*/
|
|
2501
2502
|
inset: [{
|
|
2502
|
-
inset: [
|
|
2503
|
+
inset: [m]
|
|
2503
2504
|
}],
|
|
2504
2505
|
/**
|
|
2505
2506
|
* Right / Left
|
|
2506
2507
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2507
2508
|
*/
|
|
2508
2509
|
"inset-x": [{
|
|
2509
|
-
"inset-x": [
|
|
2510
|
+
"inset-x": [m]
|
|
2510
2511
|
}],
|
|
2511
2512
|
/**
|
|
2512
2513
|
* Top / Bottom
|
|
2513
2514
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2514
2515
|
*/
|
|
2515
2516
|
"inset-y": [{
|
|
2516
|
-
"inset-y": [
|
|
2517
|
+
"inset-y": [m]
|
|
2517
2518
|
}],
|
|
2518
2519
|
/**
|
|
2519
2520
|
* Start
|
|
2520
2521
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2521
2522
|
*/
|
|
2522
2523
|
start: [{
|
|
2523
|
-
start: [
|
|
2524
|
+
start: [m]
|
|
2524
2525
|
}],
|
|
2525
2526
|
/**
|
|
2526
2527
|
* End
|
|
2527
2528
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2528
2529
|
*/
|
|
2529
2530
|
end: [{
|
|
2530
|
-
end: [
|
|
2531
|
+
end: [m]
|
|
2531
2532
|
}],
|
|
2532
2533
|
/**
|
|
2533
2534
|
* Top
|
|
2534
2535
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2535
2536
|
*/
|
|
2536
2537
|
top: [{
|
|
2537
|
-
top: [
|
|
2538
|
+
top: [m]
|
|
2538
2539
|
}],
|
|
2539
2540
|
/**
|
|
2540
2541
|
* Right
|
|
2541
2542
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2542
2543
|
*/
|
|
2543
2544
|
right: [{
|
|
2544
|
-
right: [
|
|
2545
|
+
right: [m]
|
|
2545
2546
|
}],
|
|
2546
2547
|
/**
|
|
2547
2548
|
* Bottom
|
|
2548
2549
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2549
2550
|
*/
|
|
2550
2551
|
bottom: [{
|
|
2551
|
-
bottom: [
|
|
2552
|
+
bottom: [m]
|
|
2552
2553
|
}],
|
|
2553
2554
|
/**
|
|
2554
2555
|
* Left
|
|
2555
2556
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2556
2557
|
*/
|
|
2557
2558
|
left: [{
|
|
2558
|
-
left: [
|
|
2559
|
+
left: [m]
|
|
2559
2560
|
}],
|
|
2560
2561
|
/**
|
|
2561
2562
|
* Visibility
|
|
@@ -2575,7 +2576,7 @@ const B = (e) => {
|
|
|
2575
2576
|
* @see https://tailwindcss.com/docs/flex-basis
|
|
2576
2577
|
*/
|
|
2577
2578
|
basis: [{
|
|
2578
|
-
basis:
|
|
2579
|
+
basis: A()
|
|
2579
2580
|
}],
|
|
2580
2581
|
/**
|
|
2581
2582
|
* Flex Direction
|
|
@@ -2640,14 +2641,14 @@ const B = (e) => {
|
|
|
2640
2641
|
* @see https://tailwindcss.com/docs/grid-column
|
|
2641
2642
|
*/
|
|
2642
2643
|
"col-start": [{
|
|
2643
|
-
"col-start":
|
|
2644
|
+
"col-start": $()
|
|
2644
2645
|
}],
|
|
2645
2646
|
/**
|
|
2646
2647
|
* Grid Column End
|
|
2647
2648
|
* @see https://tailwindcss.com/docs/grid-column
|
|
2648
2649
|
*/
|
|
2649
2650
|
"col-end": [{
|
|
2650
|
-
"col-end":
|
|
2651
|
+
"col-end": $()
|
|
2651
2652
|
}],
|
|
2652
2653
|
/**
|
|
2653
2654
|
* Grid Template Rows
|
|
@@ -2670,14 +2671,14 @@ const B = (e) => {
|
|
|
2670
2671
|
* @see https://tailwindcss.com/docs/grid-row
|
|
2671
2672
|
*/
|
|
2672
2673
|
"row-start": [{
|
|
2673
|
-
"row-start":
|
|
2674
|
+
"row-start": $()
|
|
2674
2675
|
}],
|
|
2675
2676
|
/**
|
|
2676
2677
|
* Grid Row End
|
|
2677
2678
|
* @see https://tailwindcss.com/docs/grid-row
|
|
2678
2679
|
*/
|
|
2679
2680
|
"row-end": [{
|
|
2680
|
-
"row-end":
|
|
2681
|
+
"row-end": $()
|
|
2681
2682
|
}],
|
|
2682
2683
|
/**
|
|
2683
2684
|
* Grid Auto Flow
|
|
@@ -3293,42 +3294,42 @@ const B = (e) => {
|
|
|
3293
3294
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3294
3295
|
*/
|
|
3295
3296
|
"gradient-from-pos": [{
|
|
3296
|
-
from: [
|
|
3297
|
+
from: [w]
|
|
3297
3298
|
}],
|
|
3298
3299
|
/**
|
|
3299
3300
|
* Gradient Color Stops Via Position
|
|
3300
3301
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3301
3302
|
*/
|
|
3302
3303
|
"gradient-via-pos": [{
|
|
3303
|
-
via: [
|
|
3304
|
+
via: [w]
|
|
3304
3305
|
}],
|
|
3305
3306
|
/**
|
|
3306
3307
|
* Gradient Color Stops To Position
|
|
3307
3308
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3308
3309
|
*/
|
|
3309
3310
|
"gradient-to-pos": [{
|
|
3310
|
-
to: [
|
|
3311
|
+
to: [w]
|
|
3311
3312
|
}],
|
|
3312
3313
|
/**
|
|
3313
3314
|
* Gradient Color Stops From
|
|
3314
3315
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3315
3316
|
*/
|
|
3316
3317
|
"gradient-from": [{
|
|
3317
|
-
from: [
|
|
3318
|
+
from: [u]
|
|
3318
3319
|
}],
|
|
3319
3320
|
/**
|
|
3320
3321
|
* Gradient Color Stops Via
|
|
3321
3322
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3322
3323
|
*/
|
|
3323
3324
|
"gradient-via": [{
|
|
3324
|
-
via: [
|
|
3325
|
+
via: [u]
|
|
3325
3326
|
}],
|
|
3326
3327
|
/**
|
|
3327
3328
|
* Gradient Color Stops To
|
|
3328
3329
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3329
3330
|
*/
|
|
3330
3331
|
"gradient-to": [{
|
|
3331
|
-
to: [
|
|
3332
|
+
to: [u]
|
|
3332
3333
|
}],
|
|
3333
3334
|
// Borders
|
|
3334
3335
|
/**
|
|
@@ -3654,7 +3655,7 @@ const B = (e) => {
|
|
|
3654
3655
|
* @see https://tailwindcss.com/docs/ring-width
|
|
3655
3656
|
*/
|
|
3656
3657
|
"ring-w": [{
|
|
3657
|
-
ring:
|
|
3658
|
+
ring: L()
|
|
3658
3659
|
}],
|
|
3659
3660
|
/**
|
|
3660
3661
|
* Ring Width Inset
|
|
@@ -3767,21 +3768,21 @@ const B = (e) => {
|
|
|
3767
3768
|
* @see https://tailwindcss.com/docs/grayscale
|
|
3768
3769
|
*/
|
|
3769
3770
|
grayscale: [{
|
|
3770
|
-
grayscale: [
|
|
3771
|
+
grayscale: [p]
|
|
3771
3772
|
}],
|
|
3772
3773
|
/**
|
|
3773
3774
|
* Hue Rotate
|
|
3774
3775
|
* @see https://tailwindcss.com/docs/hue-rotate
|
|
3775
3776
|
*/
|
|
3776
3777
|
"hue-rotate": [{
|
|
3777
|
-
"hue-rotate": [
|
|
3778
|
+
"hue-rotate": [f]
|
|
3778
3779
|
}],
|
|
3779
3780
|
/**
|
|
3780
3781
|
* Invert
|
|
3781
3782
|
* @see https://tailwindcss.com/docs/invert
|
|
3782
3783
|
*/
|
|
3783
3784
|
invert: [{
|
|
3784
|
-
invert: [
|
|
3785
|
+
invert: [g]
|
|
3785
3786
|
}],
|
|
3786
3787
|
/**
|
|
3787
3788
|
* Saturate
|
|
@@ -3831,21 +3832,21 @@ const B = (e) => {
|
|
|
3831
3832
|
* @see https://tailwindcss.com/docs/backdrop-grayscale
|
|
3832
3833
|
*/
|
|
3833
3834
|
"backdrop-grayscale": [{
|
|
3834
|
-
"backdrop-grayscale": [
|
|
3835
|
+
"backdrop-grayscale": [p]
|
|
3835
3836
|
}],
|
|
3836
3837
|
/**
|
|
3837
3838
|
* Backdrop Hue Rotate
|
|
3838
3839
|
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
3839
3840
|
*/
|
|
3840
3841
|
"backdrop-hue-rotate": [{
|
|
3841
|
-
"backdrop-hue-rotate": [
|
|
3842
|
+
"backdrop-hue-rotate": [f]
|
|
3842
3843
|
}],
|
|
3843
3844
|
/**
|
|
3844
3845
|
* Backdrop Invert
|
|
3845
3846
|
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
3846
3847
|
*/
|
|
3847
3848
|
"backdrop-invert": [{
|
|
3848
|
-
"backdrop-invert": [
|
|
3849
|
+
"backdrop-invert": [g]
|
|
3849
3850
|
}],
|
|
3850
3851
|
/**
|
|
3851
3852
|
* Backdrop Opacity
|
|
@@ -3960,21 +3961,21 @@ const B = (e) => {
|
|
|
3960
3961
|
* @see https://tailwindcss.com/docs/scale
|
|
3961
3962
|
*/
|
|
3962
3963
|
scale: [{
|
|
3963
|
-
scale: [
|
|
3964
|
+
scale: [b]
|
|
3964
3965
|
}],
|
|
3965
3966
|
/**
|
|
3966
3967
|
* Scale X
|
|
3967
3968
|
* @see https://tailwindcss.com/docs/scale
|
|
3968
3969
|
*/
|
|
3969
3970
|
"scale-x": [{
|
|
3970
|
-
"scale-x": [
|
|
3971
|
+
"scale-x": [b]
|
|
3971
3972
|
}],
|
|
3972
3973
|
/**
|
|
3973
3974
|
* Scale Y
|
|
3974
3975
|
* @see https://tailwindcss.com/docs/scale
|
|
3975
3976
|
*/
|
|
3976
3977
|
"scale-y": [{
|
|
3977
|
-
"scale-y": [
|
|
3978
|
+
"scale-y": [b]
|
|
3978
3979
|
}],
|
|
3979
3980
|
/**
|
|
3980
3981
|
* Rotate
|
|
@@ -4002,14 +4003,14 @@ const B = (e) => {
|
|
|
4002
4003
|
* @see https://tailwindcss.com/docs/skew
|
|
4003
4004
|
*/
|
|
4004
4005
|
"skew-x": [{
|
|
4005
|
-
"skew-x": [
|
|
4006
|
+
"skew-x": [R]
|
|
4006
4007
|
}],
|
|
4007
4008
|
/**
|
|
4008
4009
|
* Skew Y
|
|
4009
4010
|
* @see https://tailwindcss.com/docs/skew
|
|
4010
4011
|
*/
|
|
4011
4012
|
"skew-y": [{
|
|
4012
|
-
"skew-y": [
|
|
4013
|
+
"skew-y": [R]
|
|
4013
4014
|
}],
|
|
4014
4015
|
/**
|
|
4015
4016
|
* Transform Origin
|
|
@@ -4356,16 +4357,16 @@ function gn(...e) {
|
|
|
4356
4357
|
}
|
|
4357
4358
|
function Qn({ autoWidth: e = !0, className: t, style: n }) {
|
|
4358
4359
|
const [r, o] = T(() => j.getActiveAppId()), [i, l] = T(() => V.getRunningApps()), { isMobile: a } = Ye();
|
|
4359
|
-
|
|
4360
|
+
B(() => {
|
|
4360
4361
|
const v = j.subscribe("activeAppId", (N) => {
|
|
4361
4362
|
o(N);
|
|
4362
4363
|
});
|
|
4363
4364
|
return () => {
|
|
4364
4365
|
v();
|
|
4365
4366
|
};
|
|
4366
|
-
}, []),
|
|
4367
|
+
}, []), B(() => V.subscribe(() => {
|
|
4367
4368
|
l(V.getRunningApps());
|
|
4368
|
-
}), []),
|
|
4369
|
+
}), []), B(() => {
|
|
4369
4370
|
if (!new URLSearchParams(window.location.search).has("app")) {
|
|
4370
4371
|
const h = j.getActiveAppId();
|
|
4371
4372
|
h && !V.isRunning(h) && V.launchApp(h);
|
|
@@ -4373,15 +4374,15 @@ function Qn({ autoWidth: e = !0, className: t, style: n }) {
|
|
|
4373
4374
|
}, []);
|
|
4374
4375
|
const d = (v) => {
|
|
4375
4376
|
V.closeApp(v);
|
|
4376
|
-
},
|
|
4377
|
+
}, p = r ? oe.get(r) : null, g = (p == null ? void 0 : p.width) ?? 400, c = r !== null, m = { ...{
|
|
4377
4378
|
overflow: "hidden",
|
|
4378
4379
|
display: c ? "flex" : "none",
|
|
4379
4380
|
flexDirection: "column",
|
|
4380
4381
|
flexShrink: 0,
|
|
4381
4382
|
// Only set width if autoWidth is enabled
|
|
4382
|
-
...e && c ? { width: a ? "100%" :
|
|
4383
|
+
...e && c ? { width: a ? "100%" : g } : {}
|
|
4383
4384
|
}, ...n };
|
|
4384
|
-
return /* @__PURE__ */ s("div", { className: gn("nc-app-panel", t), style:
|
|
4385
|
+
return /* @__PURE__ */ s("div", { className: gn("nc-app-panel", t), style: m, children: i.map((v) => /* @__PURE__ */ s(
|
|
4385
4386
|
Fe,
|
|
4386
4387
|
{
|
|
4387
4388
|
appId: v.appId,
|
|
@@ -4393,47 +4394,47 @@ function Qn({ autoWidth: e = !0, className: t, style: n }) {
|
|
|
4393
4394
|
}
|
|
4394
4395
|
function Zn({ pinnedAppIds: e, className: t = "" }) {
|
|
4395
4396
|
const { isMobile: n } = Ye(), [r, o] = T(() => j.getActiveAppId()), [i, l] = T(() => V.getRunningApps());
|
|
4396
|
-
|
|
4397
|
-
const c = j.subscribe("activeAppId", (
|
|
4398
|
-
o(
|
|
4397
|
+
B(() => {
|
|
4398
|
+
const c = j.subscribe("activeAppId", (u) => {
|
|
4399
|
+
o(u);
|
|
4399
4400
|
});
|
|
4400
4401
|
return () => {
|
|
4401
4402
|
c();
|
|
4402
4403
|
};
|
|
4403
|
-
}, []),
|
|
4404
|
+
}, []), B(() => V.subscribe(() => {
|
|
4404
4405
|
l(V.getRunningApps());
|
|
4405
4406
|
}), []);
|
|
4406
4407
|
const a = (c) => {
|
|
4407
4408
|
r === c ? V.setActiveApp(null) : V.launchApp(c);
|
|
4408
|
-
}, d = e.map((c) => oe.get(c)).filter((c) => !!c),
|
|
4409
|
+
}, d = e.map((c) => oe.get(c)).filter((c) => !!c), p = i.filter((c) => !e.includes(c.appId)).map((c) => ({ running: c, def: oe.get(c.appId) })).filter((c) => !!c.def), f = (c) => i.some((u) => u.appId === c), g = n ? 24 : 28;
|
|
4409
4410
|
return /* @__PURE__ */ y("div", { className: `nc-app-taskbar ${n ? "nc-mobile" : "nc-desktop"} ${t}`, children: [
|
|
4410
4411
|
d.map((c) => {
|
|
4411
|
-
const
|
|
4412
|
+
const u = c.icon, w = r === c.id, m = f(c.id);
|
|
4412
4413
|
return /* @__PURE__ */ y(
|
|
4413
4414
|
"button",
|
|
4414
4415
|
{
|
|
4415
|
-
className: `nc-app-taskbar-button ${
|
|
4416
|
+
className: `nc-app-taskbar-button ${w ? "nc-active" : ""} ${m ? "nc-running" : ""}`,
|
|
4416
4417
|
onClick: () => a(c.id),
|
|
4417
4418
|
title: c.titleKey || c.id,
|
|
4418
4419
|
children: [
|
|
4419
|
-
/* @__PURE__ */ s(
|
|
4420
|
-
|
|
4420
|
+
/* @__PURE__ */ s(u, { size: g }),
|
|
4421
|
+
m && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4421
4422
|
]
|
|
4422
4423
|
},
|
|
4423
4424
|
c.id
|
|
4424
4425
|
);
|
|
4425
4426
|
}),
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
const
|
|
4427
|
+
p.length > 0 && /* @__PURE__ */ s("div", { className: "nc-app-taskbar-separator" }),
|
|
4428
|
+
p.map(({ running: c, def: u }) => {
|
|
4429
|
+
const w = u.icon, m = r === c.appId;
|
|
4429
4430
|
return /* @__PURE__ */ y(
|
|
4430
4431
|
"button",
|
|
4431
4432
|
{
|
|
4432
|
-
className: `nc-app-taskbar-button ${
|
|
4433
|
+
className: `nc-app-taskbar-button ${m ? "nc-active" : ""} nc-running`,
|
|
4433
4434
|
onClick: () => a(c.appId),
|
|
4434
|
-
title:
|
|
4435
|
+
title: u.titleKey || u.id,
|
|
4435
4436
|
children: [
|
|
4436
|
-
/* @__PURE__ */ s(
|
|
4437
|
+
/* @__PURE__ */ s(w, { size: g }),
|
|
4437
4438
|
/* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4438
4439
|
]
|
|
4439
4440
|
},
|
|
@@ -4494,44 +4495,44 @@ function nr() {
|
|
|
4494
4495
|
}
|
|
4495
4496
|
const Ae = se(null);
|
|
4496
4497
|
function rr({ rootView: e, children: t }) {
|
|
4497
|
-
const { t: n } = J(), r = zt(), [o, i] = T([e]), [l, a] = T([null]), d = O((
|
|
4498
|
-
a((
|
|
4499
|
-
const I = [...
|
|
4500
|
-
return I[
|
|
4498
|
+
const { t: n } = J(), r = zt(), [o, i] = T([e]), [l, a] = T([null]), d = O((b, S) => {
|
|
4499
|
+
a((R) => {
|
|
4500
|
+
const I = [...R];
|
|
4501
|
+
return I[b] = S, I;
|
|
4501
4502
|
});
|
|
4502
|
-
}, []),
|
|
4503
|
+
}, []), p = O((b) => {
|
|
4503
4504
|
a((S) => {
|
|
4504
|
-
const
|
|
4505
|
-
return
|
|
4505
|
+
const R = [...S];
|
|
4506
|
+
return R[b] = null, R;
|
|
4506
4507
|
});
|
|
4507
|
-
}, []),
|
|
4508
|
-
i((S) => [...S,
|
|
4509
|
-
}, []),
|
|
4510
|
-
i((
|
|
4508
|
+
}, []), f = O((b) => {
|
|
4509
|
+
i((S) => [...S, b]), a((S) => [...S, null]);
|
|
4510
|
+
}, []), g = O(() => {
|
|
4511
|
+
i((b) => b.length <= 1 ? b : b.slice(0, -1)), a((b) => b.slice(0, -1));
|
|
4511
4512
|
}, []), c = O(() => {
|
|
4512
4513
|
i([e]), a([null]);
|
|
4513
|
-
}, [e]),
|
|
4514
|
-
|
|
4514
|
+
}, [e]), u = o.length, w = u > 1, m = o.length - 1, v = o[o.length - 1], N = v != null && v.titleKey ? n(v.titleKey) : (v == null ? void 0 : v.title) ?? "";
|
|
4515
|
+
B(() => {
|
|
4515
4516
|
r.setTitle(N);
|
|
4516
|
-
}, [N, r]),
|
|
4517
|
-
|
|
4518
|
-
}, [
|
|
4519
|
-
const
|
|
4520
|
-
|
|
4517
|
+
}, [N, r]), B(() => {
|
|
4518
|
+
w ? r.setBackHandler(g) : r.clearBackHandler();
|
|
4519
|
+
}, [w, g, r]), B(() => {
|
|
4520
|
+
const b = l[l.length - 1];
|
|
4521
|
+
b ? r.setToolbar(b) : r.clearToolbar();
|
|
4521
4522
|
}, [l, r]);
|
|
4522
4523
|
const h = {
|
|
4523
|
-
push:
|
|
4524
|
-
pop:
|
|
4524
|
+
push: f,
|
|
4525
|
+
pop: g,
|
|
4525
4526
|
reset: c,
|
|
4526
|
-
depth:
|
|
4527
|
-
canGoBack:
|
|
4527
|
+
depth: u,
|
|
4528
|
+
canGoBack: w,
|
|
4528
4529
|
currentTitle: N
|
|
4529
4530
|
}, k = {
|
|
4530
4531
|
stack: o,
|
|
4531
4532
|
toolbarStack: l,
|
|
4532
4533
|
updateToolbar: d,
|
|
4533
|
-
clearToolbarAt:
|
|
4534
|
-
topIndex:
|
|
4534
|
+
clearToolbarAt: p,
|
|
4535
|
+
topIndex: m
|
|
4535
4536
|
};
|
|
4536
4537
|
return /* @__PURE__ */ s(Ne.Provider, { value: h, children: /* @__PURE__ */ s(Ae.Provider, { value: k, children: t }) });
|
|
4537
4538
|
}
|
|
@@ -4539,8 +4540,8 @@ function bn({ index: e, children: t }) {
|
|
|
4539
4540
|
const n = X(Ae);
|
|
4540
4541
|
if (!n)
|
|
4541
4542
|
throw new Error("NavViewProvider must be used within NavStackProvider");
|
|
4542
|
-
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n, l = O((
|
|
4543
|
-
e === i && r(e,
|
|
4543
|
+
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n, l = O((p) => {
|
|
4544
|
+
e === i && r(e, p);
|
|
4544
4545
|
}, [e, i, r]), a = O(() => {
|
|
4545
4546
|
e === i && o(e);
|
|
4546
4547
|
}, [e, i, o]), d = {
|