@kingsimba/nc-ui 0.1.29 → 0.1.31
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.cjs.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +773 -738
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as s, jsxs as
|
|
5
|
-
import { d as
|
|
6
|
-
import
|
|
1
|
+
var dt = Object.defineProperty;
|
|
2
|
+
var ut = (e, t, n) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var Q = (e, t, n) => ut(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { jsx as s, jsxs as N, Fragment as pt } from "react/jsx-runtime";
|
|
5
|
+
import { d as $e, E as ft, R as ht, T as mt, g as gt, V as bt, b as vt, a as wt, c as yt } from "./GeneratedIcons-HFZmBTBT.js";
|
|
6
|
+
import Me, { useState as E, useRef as H, useMemo as we, useEffect as z, createContext as ce, useContext as ne, Children as xt, isValidElement as kt, forwardRef as Nt, useImperativeHandle as At, useCallback as V, Suspense as St } from "react";
|
|
7
7
|
import { createPortal as pe } from "react-dom";
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import
|
|
10
|
-
import { c as
|
|
11
|
-
function
|
|
8
|
+
import { useTranslation as J } from "react-i18next";
|
|
9
|
+
import Ct from "i18next";
|
|
10
|
+
import { c as $t } from "./clsx-OuTLNxxd.js";
|
|
11
|
+
function _e({
|
|
12
12
|
size: e = "default",
|
|
13
13
|
color: t,
|
|
14
14
|
overlay: n = !1,
|
|
@@ -37,7 +37,7 @@ function He({
|
|
|
37
37
|
);
|
|
38
38
|
return n ? /* @__PURE__ */ s("div", { className: "nc-activity-indicator-overlay", children: o }) : o;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function q({ variant: e = "default", block: t, size: n = "default", appearance: r = "default", className: o, disabled: i, textSelectable: a, loading: c, onClick: l, children: u, ...f }) {
|
|
41
41
|
const v = [
|
|
42
42
|
"nc-button",
|
|
43
43
|
e !== "default" ? `nc-${e}` : "",
|
|
@@ -50,7 +50,7 @@ function K({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
50
50
|
c ? "nc-loading" : "",
|
|
51
51
|
o ?? ""
|
|
52
52
|
].filter(Boolean).join(" ");
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ N(
|
|
54
54
|
"button",
|
|
55
55
|
{
|
|
56
56
|
className: v,
|
|
@@ -68,7 +68,7 @@ function K({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
68
68
|
...f,
|
|
69
69
|
children: [
|
|
70
70
|
c && /* @__PURE__ */ s(
|
|
71
|
-
|
|
71
|
+
_e,
|
|
72
72
|
{
|
|
73
73
|
size: "small",
|
|
74
74
|
className: "nc-button-spinner",
|
|
@@ -80,14 +80,14 @@ function K({ variant: e = "default", block: t, size: n = "default", appearance:
|
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const Mt = {
|
|
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 Gn({
|
|
91
91
|
code: e,
|
|
92
92
|
text: t,
|
|
93
93
|
type: n,
|
|
@@ -98,12 +98,12 @@ function zn({
|
|
|
98
98
|
className: c = "",
|
|
99
99
|
style: l
|
|
100
100
|
}) {
|
|
101
|
-
const u = i ?? /* @__PURE__ */
|
|
101
|
+
const u = i ?? /* @__PURE__ */ N(pt, { children: [
|
|
102
102
|
e !== void 0 && /* @__PURE__ */ s("span", { className: "nc-alert-code", children: e }),
|
|
103
103
|
t
|
|
104
104
|
] });
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ N("div", { className: `nc-alert nc-${n} ${c}`.trim(), style: l, children: [
|
|
106
|
+
/* @__PURE__ */ N("div", { className: "nc-alert-main", children: [
|
|
107
107
|
/* @__PURE__ */ s("div", { className: `nc-alert-message nc-${n}`, children: u }),
|
|
108
108
|
a && /* @__PURE__ */ s(
|
|
109
109
|
"button",
|
|
@@ -112,22 +112,22 @@ function zn({
|
|
|
112
112
|
className: "nc-alert-close",
|
|
113
113
|
"aria-label": "Close alert",
|
|
114
114
|
onClick: a,
|
|
115
|
-
children: /* @__PURE__ */ s(
|
|
115
|
+
children: /* @__PURE__ */ s($e, { size: 16 })
|
|
116
116
|
}
|
|
117
117
|
)
|
|
118
118
|
] }),
|
|
119
119
|
r && /* @__PURE__ */ s("span", { className: "nc-alert-action", children: /* @__PURE__ */ s(
|
|
120
|
-
|
|
120
|
+
q,
|
|
121
121
|
{
|
|
122
122
|
size: "small",
|
|
123
|
-
variant: r.variant ??
|
|
123
|
+
variant: r.variant ?? Mt[n],
|
|
124
124
|
onClick: o,
|
|
125
125
|
children: r.text
|
|
126
126
|
}
|
|
127
127
|
) })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Yn({
|
|
131
131
|
percentage: e = 0.5,
|
|
132
132
|
status: t = "discharging",
|
|
133
133
|
darkMode: n = !1,
|
|
@@ -136,8 +136,8 @@ function Pn({
|
|
|
136
136
|
const o = Math.max(0, Math.min(1, Number(e) || 0)), i = o === 0 ? "-" : String(Math.round(o * 100));
|
|
137
137
|
let a;
|
|
138
138
|
r ? o < 0.1 ? a = "var(--nc-danger)" : o < 0.2 ? a = "var(--nc-warning)" : a = "var(--nc-success)" : a = n ? "#ffffff" : "#000000";
|
|
139
|
-
const c = "var(--nc-battery-shell-bg)", l = 24, u = 14, f = 2, v = 0, d = 12, m = 0, y = 0,
|
|
140
|
-
return /* @__PURE__ */
|
|
139
|
+
const c = "var(--nc-battery-shell-bg)", l = 24, u = 14, f = 2, v = 0, d = 12, m = 0, y = 0, b = 0, w = l, k = u, g = k - m * 2, p = w - m * 2, h = Math.max(1, Math.min(4, k / 4)), A = o === 0 ? 0 : 0.05 + o * 0.95, C = l + f + d, T = 20, P = 0.65, x = Math.max(u, T * P), I = l + f + 1, S = (u - T * P) / 2;
|
|
140
|
+
return /* @__PURE__ */ N(
|
|
141
141
|
"svg",
|
|
142
142
|
{
|
|
143
143
|
className: "nc-battery",
|
|
@@ -147,16 +147,16 @@ function Pn({
|
|
|
147
147
|
role: "img",
|
|
148
148
|
"aria-label": `Battery ${i === "-" ? "-" : `${i}%`} ${t}`,
|
|
149
149
|
children: [
|
|
150
|
-
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ s("mask", { id: `nc-battery-fill-mask-${o}`, children: /* @__PURE__ */ s("rect", { x: "0", y: "0", width: p * A, height:
|
|
150
|
+
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ s("mask", { id: `nc-battery-fill-mask-${o}`, children: /* @__PURE__ */ s("rect", { x: "0", y: "0", width: p * A, height: g, fill: "white" }) }) }),
|
|
151
151
|
/* @__PURE__ */ s(
|
|
152
152
|
"rect",
|
|
153
153
|
{
|
|
154
154
|
x: y,
|
|
155
|
-
y:
|
|
155
|
+
y: b,
|
|
156
156
|
rx: h,
|
|
157
157
|
ry: h,
|
|
158
|
-
width:
|
|
159
|
-
height:
|
|
158
|
+
width: w,
|
|
159
|
+
height: k,
|
|
160
160
|
fill: c
|
|
161
161
|
}
|
|
162
162
|
),
|
|
@@ -164,9 +164,9 @@ function Pn({
|
|
|
164
164
|
"rect",
|
|
165
165
|
{
|
|
166
166
|
x: y + m,
|
|
167
|
-
y:
|
|
167
|
+
y: b + m,
|
|
168
168
|
width: p,
|
|
169
|
-
height:
|
|
169
|
+
height: g,
|
|
170
170
|
fill: a,
|
|
171
171
|
rx: h,
|
|
172
172
|
ry: h,
|
|
@@ -176,7 +176,7 @@ function Pn({
|
|
|
176
176
|
/* @__PURE__ */ s(
|
|
177
177
|
"text",
|
|
178
178
|
{
|
|
179
|
-
x: y +
|
|
179
|
+
x: y + w / 2,
|
|
180
180
|
y: u - 3,
|
|
181
181
|
fontSize: 11,
|
|
182
182
|
fontWeight: "bold",
|
|
@@ -197,12 +197,12 @@ function Pn({
|
|
|
197
197
|
fill: o === 1 ? a : c
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${I}, ${S}) scale(${
|
|
200
|
+
t === "charging" ? /* @__PURE__ */ s("g", { transform: `translate(${I}, ${S}) scale(${P})`, fill: a, children: /* @__PURE__ */ s("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 Kn({
|
|
206
206
|
value: e,
|
|
207
207
|
onChange: t,
|
|
208
208
|
options: n,
|
|
@@ -224,7 +224,7 @@ function Bn({
|
|
|
224
224
|
);
|
|
225
225
|
}) });
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function It({ size: e }) {
|
|
228
228
|
return /* @__PURE__ */ s("svg", { className: `nc-checkbox-icon ${e === "small" ? "nc-small" : ""}`, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ s(
|
|
229
229
|
"path",
|
|
230
230
|
{
|
|
@@ -236,9 +236,9 @@ function yt({ size: e }) {
|
|
|
236
236
|
}
|
|
237
237
|
) });
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function _n({ checked: e, onChange: t, disabled: n, label: r, size: o = "default", labelColor: i, style: a, className: c = "" }) {
|
|
240
240
|
const l = o === "small";
|
|
241
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ N(
|
|
242
242
|
"label",
|
|
243
243
|
{
|
|
244
244
|
className: `nc-checkbox-label ${l ? "nc-small" : ""} ${n ? "nc-disabled" : ""} ${c}`.trim(),
|
|
@@ -257,7 +257,7 @@ function Dn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
257
257
|
onKeyDown: (u) => {
|
|
258
258
|
n || (u.key === "Enter" || u.key === " ") && (u.preventDefault(), t(!e));
|
|
259
259
|
},
|
|
260
|
-
children: e && /* @__PURE__ */ s(
|
|
260
|
+
children: e && /* @__PURE__ */ s(It, { size: o })
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
r && /* @__PURE__ */ s("span", { className: "nc-checkbox-text", style: i ? { color: i } : void 0, children: r })
|
|
@@ -265,11 +265,11 @@ function Dn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
const i = H(null), { t: a } =
|
|
270
|
-
return
|
|
268
|
+
function Rt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
269
|
+
const i = H(null), { t: a } = J();
|
|
270
|
+
return z(() => {
|
|
271
271
|
r && i.current && i.current.scrollIntoView({ block: "nearest" });
|
|
272
|
-
}, [r]), /* @__PURE__ */
|
|
272
|
+
}, [r]), /* @__PURE__ */ N(
|
|
273
273
|
"div",
|
|
274
274
|
{
|
|
275
275
|
ref: i,
|
|
@@ -283,7 +283,7 @@ function xt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
|
283
283
|
},
|
|
284
284
|
children: [
|
|
285
285
|
e.label,
|
|
286
|
-
e.default && /* @__PURE__ */
|
|
286
|
+
e.default && /* @__PURE__ */ N("span", { style: { fontSize: "0.85em", color: "var(--nc-text-weak)", marginLeft: 6 }, children: [
|
|
287
287
|
"(",
|
|
288
288
|
a("common.default"),
|
|
289
289
|
")"
|
|
@@ -292,7 +292,7 @@ function xt({ option: e, onChange: t, selected: n, highlighted: r, small: o }) {
|
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Et({
|
|
296
296
|
isOpen: e,
|
|
297
297
|
options: t,
|
|
298
298
|
onSelect: n,
|
|
@@ -302,17 +302,17 @@ function kt({
|
|
|
302
302
|
small: a,
|
|
303
303
|
highlightedIndex: c = -1
|
|
304
304
|
}) {
|
|
305
|
-
const [l, u] = E({ top: 0, left: 0, width: 0 }), [f, v] = E(o), { t: d } =
|
|
306
|
-
if (
|
|
305
|
+
const [l, u] = E({ top: 0, left: 0, width: 0 }), [f, v] = E(o), { t: d } = J();
|
|
306
|
+
if (z(() => {
|
|
307
307
|
if (e && i.current) {
|
|
308
308
|
const y = i.current.getBoundingClientRect();
|
|
309
|
-
let
|
|
309
|
+
let b = o;
|
|
310
310
|
if (o === "bottom") {
|
|
311
|
-
const
|
|
312
|
-
|
|
311
|
+
const w = window.innerHeight - y.bottom, k = y.top;
|
|
312
|
+
w < 320 && k > w && (b = "top");
|
|
313
313
|
}
|
|
314
|
-
v(
|
|
315
|
-
top:
|
|
314
|
+
v(b), u({
|
|
315
|
+
top: b === "top" ? y.top - 4 : y.bottom + 4,
|
|
316
316
|
left: y.left,
|
|
317
317
|
width: y.width
|
|
318
318
|
});
|
|
@@ -332,36 +332,41 @@ function kt({
|
|
|
332
332
|
maxHeight: 300,
|
|
333
333
|
overflowY: "auto"
|
|
334
334
|
},
|
|
335
|
-
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${a ? "nc-small" : ""}`, children: d("common.noResults") }) : t.map((y,
|
|
335
|
+
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${a ? "nc-small" : ""}`, children: d("common.noResults") }) : t.map((y, b) => /* @__PURE__ */ s(Rt, { option: y, onChange: n, selected: y.value === r, highlighted: b === c, small: a }, y.value))
|
|
336
336
|
}
|
|
337
337
|
);
|
|
338
338
|
return pe(m, document.body);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Tt({ onClick: e, small: t }) {
|
|
341
341
|
return /* @__PURE__ */ s(
|
|
342
|
-
"
|
|
342
|
+
"span",
|
|
343
343
|
{
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
role: "button",
|
|
345
|
+
tabIndex: 0,
|
|
346
|
+
className: `nc-combo-button nc-combo-clear ${t ? "nc-small" : ""}`,
|
|
347
|
+
onClick: (n) => {
|
|
348
|
+
n.stopPropagation(), e();
|
|
349
|
+
},
|
|
346
350
|
onMouseDown: (n) => n.stopPropagation(),
|
|
351
|
+
onKeyDown: (n) => {
|
|
352
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.stopPropagation(), e());
|
|
353
|
+
},
|
|
347
354
|
"aria-label": "Clear selection",
|
|
348
355
|
children: "✕"
|
|
349
356
|
}
|
|
350
357
|
);
|
|
351
358
|
}
|
|
352
|
-
function
|
|
359
|
+
function Pt({ open: e, small: t }) {
|
|
353
360
|
return /* @__PURE__ */ s(
|
|
354
|
-
"
|
|
361
|
+
"span",
|
|
355
362
|
{
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
onMouseDown: (r) => r.stopPropagation(),
|
|
359
|
-
"aria-label": e ? "Close" : "Open",
|
|
363
|
+
"aria-hidden": !0,
|
|
364
|
+
className: `nc-combo-button nc-combo-toggle ${t ? "nc-small" : ""} ${e ? "nc-open" : ""}`,
|
|
360
365
|
children: "▾"
|
|
361
366
|
}
|
|
362
367
|
);
|
|
363
368
|
}
|
|
364
|
-
function
|
|
369
|
+
function Un({
|
|
365
370
|
value: e,
|
|
366
371
|
onChange: t,
|
|
367
372
|
placeholder: n = "Select…",
|
|
@@ -377,66 +382,66 @@ function Wn({
|
|
|
377
382
|
style: d,
|
|
378
383
|
className: m
|
|
379
384
|
}) {
|
|
380
|
-
const [y,
|
|
381
|
-
const R =
|
|
382
|
-
return c ? r.filter((
|
|
383
|
-
}, [r,
|
|
384
|
-
|
|
385
|
+
const [y, b] = E(!1), [w, k] = E(""), [g, p] = E(-1), h = H(null), A = H(null), C = u === "small", { t: T } = J(), P = we(() => {
|
|
386
|
+
const R = w.toLowerCase();
|
|
387
|
+
return c ? r.filter((B) => B.label.toLowerCase().includes(R)) : r;
|
|
388
|
+
}, [r, w, c]);
|
|
389
|
+
z(() => {
|
|
385
390
|
y && p(-1);
|
|
386
|
-
}, [y,
|
|
391
|
+
}, [y, P]), z(() => {
|
|
387
392
|
if (!a && !e && r.length > 0 && t) {
|
|
388
|
-
const R = r.find((
|
|
393
|
+
const R = r.find((B) => B.default) || r[0];
|
|
389
394
|
t(R.value);
|
|
390
395
|
}
|
|
391
|
-
}, [a, e, r, t]),
|
|
392
|
-
function R(
|
|
396
|
+
}, [a, e, r, t]), z(() => {
|
|
397
|
+
function R(B) {
|
|
393
398
|
var W;
|
|
394
|
-
|
|
399
|
+
B.target instanceof Node && h.current && ((W = h.current.parentElement) != null && W.contains(B.target) || b(!1));
|
|
395
400
|
}
|
|
396
401
|
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
397
402
|
}, []);
|
|
398
|
-
const x = r.find((R) => R.value === e), I = x && a, S = !o && !I, $ = `nc-align-${v}`, L = !(y && c) && !!x,
|
|
403
|
+
const x = r.find((R) => R.value === e), I = x && a, S = !o && !I, $ = `nc-align-${v}`, L = !(y && c) && !!x, O = (R, B = !1) => {
|
|
399
404
|
var W;
|
|
400
|
-
t == null || t(R),
|
|
401
|
-
},
|
|
402
|
-
t == null || t(void 0),
|
|
403
|
-
},
|
|
405
|
+
t == null || t(R), b(!1), k(""), B && ((W = h.current) == null || W.blur());
|
|
406
|
+
}, F = () => {
|
|
407
|
+
t == null || t(void 0), k(""), b(!1);
|
|
408
|
+
}, j = (R) => {
|
|
404
409
|
if (!y) {
|
|
405
|
-
(R.key === "ArrowDown" || R.key === "ArrowUp") && (
|
|
410
|
+
(R.key === "ArrowDown" || R.key === "ArrowUp") && (b(!0), R.preventDefault());
|
|
406
411
|
return;
|
|
407
412
|
}
|
|
408
413
|
switch (R.key) {
|
|
409
414
|
case "ArrowDown":
|
|
410
|
-
R.preventDefault(), p((
|
|
411
|
-
const W =
|
|
412
|
-
return W >=
|
|
415
|
+
R.preventDefault(), p((B) => {
|
|
416
|
+
const W = B + 1;
|
|
417
|
+
return W >= P.length ? 0 : W;
|
|
413
418
|
});
|
|
414
419
|
break;
|
|
415
420
|
case "ArrowUp":
|
|
416
|
-
R.preventDefault(), p((
|
|
417
|
-
const W =
|
|
418
|
-
return W < 0 ?
|
|
421
|
+
R.preventDefault(), p((B) => {
|
|
422
|
+
const W = B - 1;
|
|
423
|
+
return W < 0 ? P.length - 1 : W;
|
|
419
424
|
});
|
|
420
425
|
break;
|
|
421
426
|
case "Enter":
|
|
422
|
-
R.preventDefault(),
|
|
427
|
+
R.preventDefault(), g >= 0 && g < P.length && O(P[g].value, !0);
|
|
423
428
|
break;
|
|
424
429
|
case "Escape":
|
|
425
|
-
R.preventDefault(),
|
|
430
|
+
R.preventDefault(), b(!1), k("");
|
|
426
431
|
break;
|
|
427
432
|
}
|
|
428
433
|
};
|
|
429
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ N("div", { className: `nc-combo-container ${f === "transparent" ? "nc-transparent" : ""} ${f === "plain" ? "nc-plain" : ""} ${y ? "nc-open" : ""} ${$} ${m || ""}`.trim(), style: { position: "relative", ...d }, children: [
|
|
430
435
|
i && /* @__PURE__ */ s("span", { className: `nc-label ${C ? "nc-small" : ""}`, children: i }),
|
|
431
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ N(
|
|
432
437
|
"div",
|
|
433
438
|
{
|
|
434
439
|
ref: A,
|
|
435
440
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
436
441
|
onMouseDown: (R) => {
|
|
437
|
-
o || c && R.target === h.current || (
|
|
438
|
-
var
|
|
439
|
-
(
|
|
442
|
+
o || c && R.target === h.current || (b((B) => (!B && c && x && k(x.label), !B)), c && !y && setTimeout(() => {
|
|
443
|
+
var B, W;
|
|
444
|
+
(B = h.current) == null || B.focus(), (W = h.current) == null || W.select();
|
|
440
445
|
}, 0));
|
|
441
446
|
},
|
|
442
447
|
children: [
|
|
@@ -447,15 +452,14 @@ function Wn({
|
|
|
447
452
|
className: `nc-input ${C ? "nc-small" : ""}`,
|
|
448
453
|
placeholder: n,
|
|
449
454
|
onFocus: () => {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}, 0))), c || (R = h.current) == null || R.blur();
|
|
455
|
+
!o && c && (b(!0), x && (k(x.label), setTimeout(() => {
|
|
456
|
+
var R;
|
|
457
|
+
return (R = h.current) == null ? void 0 : R.select();
|
|
458
|
+
}, 0)));
|
|
455
459
|
},
|
|
456
|
-
onChange: (R) => c &&
|
|
457
|
-
onKeyDown:
|
|
458
|
-
value: y && c ?
|
|
460
|
+
onChange: (R) => c && k(R.target.value),
|
|
461
|
+
onKeyDown: j,
|
|
462
|
+
value: y && c ? w : (x == null ? void 0 : x.label) || "",
|
|
459
463
|
readOnly: o || !c,
|
|
460
464
|
style: {
|
|
461
465
|
width: "100%",
|
|
@@ -467,7 +471,7 @@ function Wn({
|
|
|
467
471
|
}
|
|
468
472
|
}
|
|
469
473
|
),
|
|
470
|
-
L && /* @__PURE__ */
|
|
474
|
+
L && /* @__PURE__ */ N(
|
|
471
475
|
"div",
|
|
472
476
|
{
|
|
473
477
|
"aria-hidden": !0,
|
|
@@ -482,23 +486,23 @@ function Wn({
|
|
|
482
486
|
},
|
|
483
487
|
children: [
|
|
484
488
|
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${C ? "nc-small" : ""}`, children: x == null ? void 0 : x.label }),
|
|
485
|
-
(x == null ? void 0 : x.default) && /* @__PURE__ */
|
|
489
|
+
(x == null ? void 0 : x.default) && /* @__PURE__ */ N("span", { className: `nc-combo-overlay-default ${C ? "nc-small" : ""}`, children: [
|
|
486
490
|
"(",
|
|
487
|
-
|
|
491
|
+
T("common.default"),
|
|
488
492
|
")"
|
|
489
493
|
] })
|
|
490
494
|
]
|
|
491
495
|
}
|
|
492
496
|
),
|
|
493
|
-
I && /* @__PURE__ */ s(
|
|
494
|
-
S && /* @__PURE__ */ s(
|
|
497
|
+
I && /* @__PURE__ */ s(Tt, { onClick: F, small: C }),
|
|
498
|
+
S && /* @__PURE__ */ s(Pt, { open: y, small: C })
|
|
495
499
|
]
|
|
496
500
|
}
|
|
497
501
|
),
|
|
498
|
-
/* @__PURE__ */ s(
|
|
502
|
+
/* @__PURE__ */ s(Et, { isOpen: y, options: P, onSelect: O, selectedValue: e, placement: l, anchorRef: A, small: C, highlightedIndex: g })
|
|
499
503
|
] });
|
|
500
504
|
}
|
|
501
|
-
function
|
|
505
|
+
function qn({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default", title: o, "aria-label": i }) {
|
|
502
506
|
return /* @__PURE__ */ s(
|
|
503
507
|
"button",
|
|
504
508
|
{
|
|
@@ -508,11 +512,11 @@ function Hn({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default"
|
|
|
508
512
|
title: o ?? (t ? "Refreshing..." : "Refresh"),
|
|
509
513
|
"aria-label": i ?? (t ? "Refreshing" : "Refresh"),
|
|
510
514
|
"data-size": r,
|
|
511
|
-
children: /* @__PURE__ */ s(
|
|
515
|
+
children: /* @__PURE__ */ s(ht, { size: r === "small" ? 14 : r === "large" ? 20 : 18, className: t ? "nc-spinning" : "" })
|
|
512
516
|
}
|
|
513
517
|
);
|
|
514
518
|
}
|
|
515
|
-
function
|
|
519
|
+
function Ue({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Close", "aria-label": o = "Close" }) {
|
|
516
520
|
return /* @__PURE__ */ s(
|
|
517
521
|
"button",
|
|
518
522
|
{
|
|
@@ -522,11 +526,11 @@ function Oe({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Clo
|
|
|
522
526
|
title: r,
|
|
523
527
|
"aria-label": o,
|
|
524
528
|
"data-size": n,
|
|
525
|
-
children: /* @__PURE__ */ s(
|
|
529
|
+
children: /* @__PURE__ */ s($e, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
526
530
|
}
|
|
527
531
|
);
|
|
528
532
|
}
|
|
529
|
-
function
|
|
533
|
+
function Xn({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Edit", "aria-label": o = "Edit" }) {
|
|
530
534
|
return /* @__PURE__ */ s(
|
|
531
535
|
"button",
|
|
532
536
|
{
|
|
@@ -536,11 +540,11 @@ function On({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Edi
|
|
|
536
540
|
title: r,
|
|
537
541
|
"aria-label": o,
|
|
538
542
|
"data-size": n,
|
|
539
|
-
children: /* @__PURE__ */ s(
|
|
543
|
+
children: /* @__PURE__ */ s(ft, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
540
544
|
}
|
|
541
545
|
);
|
|
542
546
|
}
|
|
543
|
-
function
|
|
547
|
+
function Jn({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Delete", "aria-label": o = "Delete" }) {
|
|
544
548
|
return /* @__PURE__ */ s(
|
|
545
549
|
"button",
|
|
546
550
|
{
|
|
@@ -550,11 +554,11 @@ function Fn({ onClick: e, disabled: t = !1, size: n = "default", title: r = "Del
|
|
|
550
554
|
title: r,
|
|
551
555
|
"aria-label": o,
|
|
552
556
|
"data-size": n,
|
|
553
|
-
children: /* @__PURE__ */ s(
|
|
557
|
+
children: /* @__PURE__ */ s(mt, { size: n === "small" ? 14 : n === "large" ? 20 : 18 })
|
|
554
558
|
}
|
|
555
559
|
);
|
|
556
560
|
}
|
|
557
|
-
function
|
|
561
|
+
function Zn({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label": o, size: i = "default" }) {
|
|
558
562
|
return /* @__PURE__ */ s(
|
|
559
563
|
"button",
|
|
560
564
|
{
|
|
@@ -568,7 +572,7 @@ function Vn({ onClick: e, disabled: t = !1, children: n, title: r, "aria-label":
|
|
|
568
572
|
}
|
|
569
573
|
);
|
|
570
574
|
}
|
|
571
|
-
function
|
|
575
|
+
function Qn({
|
|
572
576
|
open: e,
|
|
573
577
|
onClose: t,
|
|
574
578
|
options: n,
|
|
@@ -577,21 +581,21 @@ function jn({
|
|
|
577
581
|
preferredDirection: i = "down"
|
|
578
582
|
}) {
|
|
579
583
|
const a = H(null), [c, l] = E({ top: 0, left: 0 }), u = o || (r == null ? void 0 : r.current);
|
|
580
|
-
if (
|
|
584
|
+
if (z(() => {
|
|
581
585
|
if (!e || !u || !a.current) return;
|
|
582
|
-
const d = u.getBoundingClientRect(), m = a.current.getBoundingClientRect(), y = window.innerHeight,
|
|
583
|
-
let
|
|
584
|
-
(!
|
|
586
|
+
const d = u.getBoundingClientRect(), m = a.current.getBoundingClientRect(), y = window.innerHeight, b = window.innerWidth, w = d.bottom + 8, k = w + m.height <= y - 8;
|
|
587
|
+
let g = i;
|
|
588
|
+
(!k && i === "down" || i === "up" && k) && (g = "up");
|
|
585
589
|
let p;
|
|
586
|
-
|
|
590
|
+
g === "down" ? p = w : p = d.top - m.height - 8;
|
|
587
591
|
let h = d.left;
|
|
588
|
-
h + m.width >
|
|
592
|
+
h + m.width > b - 8 && (h = d.right - m.width), l({
|
|
589
593
|
top: Math.max(8, p),
|
|
590
594
|
// Ensure minimum 8px from top
|
|
591
595
|
left: Math.max(8, h)
|
|
592
596
|
// Ensure minimum 8px from left
|
|
593
597
|
});
|
|
594
|
-
}, [e, u, i]),
|
|
598
|
+
}, [e, u, i]), z(() => {
|
|
595
599
|
if (!e) return;
|
|
596
600
|
const d = (y) => {
|
|
597
601
|
a.current && !a.current.contains(y.target) && u && !u.contains(y.target) && t();
|
|
@@ -634,7 +638,7 @@ function jn({
|
|
|
634
638
|
d.disabled ? "nc-disabled" : "",
|
|
635
639
|
v && !d.icon ? "nc-indented" : ""
|
|
636
640
|
].filter(Boolean).join(" ");
|
|
637
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ N(
|
|
638
642
|
"button",
|
|
639
643
|
{
|
|
640
644
|
className: m,
|
|
@@ -654,20 +658,20 @@ function jn({
|
|
|
654
658
|
document.body
|
|
655
659
|
);
|
|
656
660
|
}
|
|
657
|
-
const
|
|
658
|
-
function
|
|
659
|
-
const e =
|
|
661
|
+
const qe = ce(null);
|
|
662
|
+
function Lt() {
|
|
663
|
+
const e = ne(qe);
|
|
660
664
|
if (!e)
|
|
661
665
|
throw new Error("useDialog must be used inside a Dialog component");
|
|
662
666
|
return e;
|
|
663
667
|
}
|
|
664
|
-
function
|
|
665
|
-
const { close: r } =
|
|
666
|
-
return /* @__PURE__ */ s(
|
|
668
|
+
function oe({ children: e, onClick: t, ...n }) {
|
|
669
|
+
const { close: r } = Lt(), { t: o } = J();
|
|
670
|
+
return /* @__PURE__ */ s(q, { onClick: (a) => {
|
|
667
671
|
t == null || t(a), r();
|
|
668
672
|
}, ...n, children: e ?? o("common.close") });
|
|
669
673
|
}
|
|
670
|
-
function
|
|
674
|
+
function er({
|
|
671
675
|
open: e,
|
|
672
676
|
onClose: t,
|
|
673
677
|
title: n,
|
|
@@ -683,55 +687,55 @@ function Gn({
|
|
|
683
687
|
closeOnOverlay: d = !0,
|
|
684
688
|
primaryDisabled: m = !1,
|
|
685
689
|
fullScreen: y = !1,
|
|
686
|
-
hideTitleBar:
|
|
687
|
-
className:
|
|
688
|
-
onContentHeightChange:
|
|
690
|
+
hideTitleBar: b = !1,
|
|
691
|
+
className: w = "",
|
|
692
|
+
onContentHeightChange: k
|
|
689
693
|
}) {
|
|
690
|
-
const
|
|
694
|
+
const g = H(null), p = H(null), { t: h } = J(), A = { close: t }, C = (x) => {
|
|
691
695
|
d && x.target === x.currentTarget && t();
|
|
692
696
|
};
|
|
693
|
-
if (
|
|
694
|
-
e &&
|
|
695
|
-
}, [e]),
|
|
696
|
-
if (!
|
|
697
|
+
if (z(() => {
|
|
698
|
+
e && g.current && g.current.focus();
|
|
699
|
+
}, [e]), z(() => {
|
|
700
|
+
if (!k || !p.current) return;
|
|
697
701
|
const x = new ResizeObserver((I) => {
|
|
698
702
|
for (const S of I) {
|
|
699
703
|
const $ = S.contentRect.height;
|
|
700
|
-
|
|
704
|
+
k($);
|
|
701
705
|
}
|
|
702
706
|
});
|
|
703
707
|
return x.observe(p.current), () => {
|
|
704
708
|
x.disconnect();
|
|
705
709
|
};
|
|
706
|
-
}, [
|
|
707
|
-
const
|
|
710
|
+
}, [k]), !e) return null;
|
|
711
|
+
const T = () => {
|
|
708
712
|
switch (i) {
|
|
709
713
|
case "ok":
|
|
710
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(
|
|
714
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(q, { variant: "primary", onClick: c ?? t, disabled: m, children: h("common.ok") }) });
|
|
711
715
|
case "ok-cancel":
|
|
712
|
-
return /* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */ s(
|
|
714
|
-
/* @__PURE__ */ s(
|
|
716
|
+
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
717
|
+
/* @__PURE__ */ s(oe, { onClick: f, children: h("common.cancel") }),
|
|
718
|
+
/* @__PURE__ */ s(q, { variant: "primary", onClick: c ?? t, disabled: m, children: h("common.ok") })
|
|
715
719
|
] });
|
|
716
720
|
case "save-cancel":
|
|
717
|
-
return /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */ s(
|
|
719
|
-
/* @__PURE__ */ s(
|
|
721
|
+
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
722
|
+
/* @__PURE__ */ s(oe, { onClick: f, children: h("common.cancel") }),
|
|
723
|
+
/* @__PURE__ */ s(q, { variant: "primary", onClick: l, disabled: m, children: h("common.save") })
|
|
720
724
|
] });
|
|
721
725
|
case "delete-cancel":
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */ s(
|
|
724
|
-
/* @__PURE__ */ s(
|
|
726
|
+
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
727
|
+
/* @__PURE__ */ s(oe, { onClick: f, children: h("common.cancel") }),
|
|
728
|
+
/* @__PURE__ */ s(q, { variant: "danger", onClick: u, disabled: m, children: h("common.delete") })
|
|
725
729
|
] });
|
|
726
730
|
case "connect":
|
|
727
|
-
return /* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */ s(
|
|
729
|
-
/* @__PURE__ */ s(
|
|
731
|
+
return /* @__PURE__ */ N("div", { className: "nc-dialog-footer", children: [
|
|
732
|
+
/* @__PURE__ */ s(oe, { onClick: f, children: h("common.cancel") }),
|
|
733
|
+
/* @__PURE__ */ s(q, { variant: "primary", onClick: v, disabled: m, children: h("common.connect") })
|
|
730
734
|
] });
|
|
731
735
|
case "close":
|
|
732
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(
|
|
736
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(oe, { variant: "primary" }) });
|
|
733
737
|
case "gotit":
|
|
734
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(
|
|
738
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(oe, { variant: "primary", children: h("common.gotit") }) });
|
|
735
739
|
case "custom":
|
|
736
740
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: a });
|
|
737
741
|
case "none":
|
|
@@ -739,29 +743,29 @@ function Gn({
|
|
|
739
743
|
default:
|
|
740
744
|
return null;
|
|
741
745
|
}
|
|
742
|
-
},
|
|
746
|
+
}, P = /* @__PURE__ */ s(qe.Provider, { value: A, children: /* @__PURE__ */ s("div", { className: `nc-dialog-overlay${y ? " nc-fullscreen" : ""}`, onClick: C, children: /* @__PURE__ */ N(
|
|
743
747
|
"div",
|
|
744
748
|
{
|
|
745
|
-
ref:
|
|
746
|
-
className: `nc-dialog-container ${
|
|
749
|
+
ref: g,
|
|
750
|
+
className: `nc-dialog-container ${w}`,
|
|
747
751
|
style: o,
|
|
748
752
|
tabIndex: -1,
|
|
749
753
|
role: "dialog",
|
|
750
754
|
"aria-modal": "true",
|
|
751
|
-
"aria-labelledby":
|
|
755
|
+
"aria-labelledby": b ? void 0 : "nc-dialog-title",
|
|
752
756
|
children: [
|
|
753
|
-
!
|
|
757
|
+
!b && /* @__PURE__ */ N("div", { className: "nc-dialog-header", children: [
|
|
754
758
|
/* @__PURE__ */ s("h3", { id: "nc-dialog-title", className: "nc-dialog-title", children: n }),
|
|
755
|
-
/* @__PURE__ */ s(
|
|
759
|
+
/* @__PURE__ */ s(Ue, { onClick: t, "aria-label": "Close dialog" })
|
|
756
760
|
] }),
|
|
757
761
|
/* @__PURE__ */ s("div", { ref: p, className: "nc-dialog-content", children: r }),
|
|
758
|
-
|
|
762
|
+
T()
|
|
759
763
|
]
|
|
760
764
|
}
|
|
761
765
|
) }) });
|
|
762
|
-
return y ? pe(
|
|
766
|
+
return y ? pe(P, document.body) : P;
|
|
763
767
|
}
|
|
764
|
-
function
|
|
768
|
+
function zt({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
765
769
|
const r = t === "small" ? 28 : 34;
|
|
766
770
|
return /* @__PURE__ */ s(
|
|
767
771
|
"button",
|
|
@@ -790,7 +794,7 @@ function St({ onClick: e, size: t = "default", rightOffset: n = 4 }) {
|
|
|
790
794
|
}
|
|
791
795
|
);
|
|
792
796
|
}
|
|
793
|
-
function
|
|
797
|
+
function Bt({ visible: e, onClick: t, size: n = "default" }) {
|
|
794
798
|
const r = n === "small" ? 28 : 34, o = n === "small" ? 16 : 18;
|
|
795
799
|
return /* @__PURE__ */ s(
|
|
796
800
|
"button",
|
|
@@ -814,109 +818,140 @@ function $t({ visible: e, onClick: t, size: n = "default" }) {
|
|
|
814
818
|
alignItems: "center",
|
|
815
819
|
justifyContent: "center"
|
|
816
820
|
},
|
|
817
|
-
children: e ? /* @__PURE__ */ s(
|
|
821
|
+
children: e ? /* @__PURE__ */ s(gt, { size: o }) : /* @__PURE__ */ s(bt, { size: o })
|
|
818
822
|
}
|
|
819
823
|
);
|
|
820
824
|
}
|
|
821
|
-
function
|
|
825
|
+
function tr({
|
|
822
826
|
value: e,
|
|
823
827
|
defaultValue: t = "",
|
|
824
828
|
onChange: n,
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
829
|
+
onChangeConfirmed: r,
|
|
830
|
+
onEnter: o,
|
|
831
|
+
onClear: i,
|
|
832
|
+
placeholder: a,
|
|
833
|
+
disabled: c,
|
|
834
|
+
label: l,
|
|
835
|
+
clearable: u = !0,
|
|
836
|
+
type: f = "text",
|
|
837
|
+
className: v = "",
|
|
838
|
+
size: d = "default",
|
|
839
|
+
appearance: m = "default",
|
|
840
|
+
style: y,
|
|
841
|
+
leadingIcon: b,
|
|
837
842
|
showPasswordToggle: w = !1,
|
|
838
|
-
multiline:
|
|
839
|
-
rows:
|
|
840
|
-
validator:
|
|
841
|
-
showErrorMessage:
|
|
843
|
+
multiline: k = !1,
|
|
844
|
+
rows: g = 3,
|
|
845
|
+
validator: p,
|
|
846
|
+
showErrorMessage: h = !0
|
|
842
847
|
}) {
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
848
|
+
const A = H(null), C = H(null), T = H(!1), [P, x] = E(!1), [I, S] = E(!1), $ = e !== void 0, [L, O] = E(t), F = $ ? e : L, [j, R] = E(F), B = p ? p(F) : null, W = !!B, G = !k && m === "plain", Y = G && I, ye = Y ? j : F;
|
|
849
|
+
z(() => {
|
|
850
|
+
Y || R(F);
|
|
851
|
+
}, [F, Y]);
|
|
852
|
+
const Te = f === "password", fe = Te && w && !c && !k, xe = u && ye && !c && I, ke = d === "small" ? 32 : 44;
|
|
853
|
+
let he = 12;
|
|
854
|
+
xe && fe ? he = ke * 2 : (xe || fe) && (he = ke);
|
|
855
|
+
const me = b ? d === "small" ? 28 : 34 : void 0, Pe = () => {
|
|
856
|
+
if (!G)
|
|
857
|
+
return F;
|
|
858
|
+
const K = j !== F;
|
|
859
|
+
return $ || O(j), K && (n == null || n(j), r == null || r(j)), j;
|
|
860
|
+
}, at = () => {
|
|
861
|
+
R(F);
|
|
862
|
+
}, lt = () => {
|
|
863
|
+
var K, Z, He;
|
|
864
|
+
if (G) {
|
|
865
|
+
R(""), i == null || i(), (K = A.current) == null || K.focus();
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
$ || O(""), n == null || n(""), i == null || i(), k ? (Z = C.current) == null || Z.focus() : (He = A.current) == null || He.focus();
|
|
869
|
+
}, Le = (K) => {
|
|
870
|
+
if (G && K.key === "Escape") {
|
|
871
|
+
K.preventDefault(), T.current = !0, at(), K.currentTarget.blur();
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
if (K.key === "Enter" && !k) {
|
|
875
|
+
const Z = G ? Pe() : F;
|
|
876
|
+
G && (K.preventDefault(), T.current = !0, K.currentTarget.blur()), o == null || o(Z);
|
|
877
|
+
}
|
|
878
|
+
}, ze = (K) => {
|
|
879
|
+
const Z = K.target.value;
|
|
880
|
+
if (G) {
|
|
881
|
+
R(Z);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
$ || O(Z), n == null || n(Z);
|
|
885
|
+
}, Be = () => {
|
|
886
|
+
S(!0), G && R(F);
|
|
887
|
+
}, De = () => {
|
|
888
|
+
if (G && T.current) {
|
|
889
|
+
T.current = !1, S(!1);
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
G && Pe(), S(!1);
|
|
893
|
+
}, We = `nc-input ${d === "small" ? "nc-small " : ""}${!k && m === "plain" ? "nc-plain " : ""}${W ? "nc-error " : ""}${v}`;
|
|
894
|
+
return /* @__PURE__ */ N("div", { className: "nc-col", style: { position: "relative", flex: 1, ...y }, children: [
|
|
895
|
+
l && /* @__PURE__ */ s("span", { className: "nc-label", children: l }),
|
|
896
|
+
/* @__PURE__ */ N("div", { style: { position: "relative", display: "flex", alignItems: k ? "flex-start" : "center" }, children: [
|
|
897
|
+
b && /* @__PURE__ */ s("span", { className: "nc-input-leading-icon", style: { height: k ? void 0 : "100%", top: k ? 10 : void 0 }, children: b }),
|
|
898
|
+
k ? /* @__PURE__ */ s(
|
|
864
899
|
"textarea",
|
|
865
900
|
{
|
|
866
|
-
ref:
|
|
867
|
-
className:
|
|
868
|
-
placeholder:
|
|
869
|
-
value:
|
|
870
|
-
onChange:
|
|
871
|
-
onKeyDown:
|
|
872
|
-
onFocus:
|
|
873
|
-
onBlur:
|
|
874
|
-
readOnly:
|
|
875
|
-
"aria-disabled":
|
|
876
|
-
tabIndex:
|
|
877
|
-
rows:
|
|
901
|
+
ref: C,
|
|
902
|
+
className: We,
|
|
903
|
+
placeholder: a,
|
|
904
|
+
value: ye,
|
|
905
|
+
onChange: ze,
|
|
906
|
+
onKeyDown: Le,
|
|
907
|
+
onFocus: Be,
|
|
908
|
+
onBlur: De,
|
|
909
|
+
readOnly: c,
|
|
910
|
+
"aria-disabled": c,
|
|
911
|
+
tabIndex: c ? -1 : void 0,
|
|
912
|
+
rows: g,
|
|
878
913
|
style: {
|
|
879
914
|
width: "100%",
|
|
880
|
-
paddingRight:
|
|
881
|
-
...
|
|
915
|
+
paddingRight: he,
|
|
916
|
+
...me !== void 0 ? { paddingLeft: me } : {}
|
|
882
917
|
}
|
|
883
918
|
}
|
|
884
919
|
) : /* @__PURE__ */ s(
|
|
885
920
|
"input",
|
|
886
921
|
{
|
|
887
|
-
ref:
|
|
888
|
-
type:
|
|
889
|
-
className:
|
|
890
|
-
placeholder:
|
|
891
|
-
value:
|
|
892
|
-
onChange:
|
|
893
|
-
onKeyDown:
|
|
894
|
-
onFocus:
|
|
895
|
-
onBlur:
|
|
896
|
-
readOnly:
|
|
897
|
-
"aria-disabled":
|
|
898
|
-
tabIndex:
|
|
922
|
+
ref: A,
|
|
923
|
+
type: Te && P ? "text" : f,
|
|
924
|
+
className: We,
|
|
925
|
+
placeholder: a,
|
|
926
|
+
value: ye,
|
|
927
|
+
onChange: ze,
|
|
928
|
+
onKeyDown: Le,
|
|
929
|
+
onFocus: Be,
|
|
930
|
+
onBlur: De,
|
|
931
|
+
readOnly: c,
|
|
932
|
+
"aria-disabled": c,
|
|
933
|
+
tabIndex: c ? -1 : void 0,
|
|
899
934
|
style: {
|
|
900
935
|
width: "100%",
|
|
901
|
-
paddingRight:
|
|
902
|
-
...
|
|
936
|
+
paddingRight: he,
|
|
937
|
+
...me !== void 0 ? { paddingLeft: me } : {}
|
|
903
938
|
}
|
|
904
939
|
}
|
|
905
940
|
),
|
|
906
|
-
|
|
907
|
-
|
|
941
|
+
xe && /* @__PURE__ */ s(zt, { onClick: lt, size: d, rightOffset: fe ? ke + 4 : 4 }),
|
|
942
|
+
fe && /* @__PURE__ */ s(Bt, { visible: P, onClick: () => x(!P), size: d })
|
|
908
943
|
] }),
|
|
909
|
-
|
|
944
|
+
W && h && /* @__PURE__ */ s("span", { className: "nc-error-message", children: B })
|
|
910
945
|
] });
|
|
911
946
|
}
|
|
912
|
-
function
|
|
947
|
+
function nr({
|
|
913
948
|
children: e,
|
|
914
949
|
onClick: t,
|
|
915
950
|
showBorder: n = !0,
|
|
916
951
|
selectable: r = !1,
|
|
917
952
|
style: o
|
|
918
953
|
}) {
|
|
919
|
-
const [i, a] =
|
|
954
|
+
const [i, a] = Me.useState(!1);
|
|
920
955
|
return /* @__PURE__ */ s(
|
|
921
956
|
"div",
|
|
922
957
|
{
|
|
@@ -944,9 +979,9 @@ function Kn({
|
|
|
944
979
|
}
|
|
945
980
|
);
|
|
946
981
|
}
|
|
947
|
-
function
|
|
948
|
-
return /* @__PURE__ */
|
|
949
|
-
(e || t) && /* @__PURE__ */
|
|
982
|
+
function rr({ title: e, titleTools: t, children: n, style: r }) {
|
|
983
|
+
return /* @__PURE__ */ N("div", { className: "nc-list-group", style: r, children: [
|
|
984
|
+
(e || t) && /* @__PURE__ */ N("div", { className: "nc-list-group-title", children: [
|
|
950
985
|
/* @__PURE__ */ s("div", { children: e }),
|
|
951
986
|
t && /* @__PURE__ */ s("div", { className: "nc-list-group-title-tools", children: t })
|
|
952
987
|
] }),
|
|
@@ -959,9 +994,9 @@ function _n({ title: e, titleTools: t, children: n, style: r }) {
|
|
|
959
994
|
)
|
|
960
995
|
] });
|
|
961
996
|
}
|
|
962
|
-
function
|
|
963
|
-
const [i, a] = E(!1), [c, l] = E(""), u = H(null), f =
|
|
964
|
-
|
|
997
|
+
function or({ values: e, onChange: t, options: n, placeholder: r = "Select…", label: o }) {
|
|
998
|
+
const [i, a] = E(!1), [c, l] = E(""), u = H(null), f = we(() => n.filter((d) => d.label.toLowerCase().includes(c.toLowerCase())), [n, c]);
|
|
999
|
+
z(() => {
|
|
965
1000
|
function d(m) {
|
|
966
1001
|
!(m.target instanceof Node) || !u.current || u.current.contains(m.target) || a(!1);
|
|
967
1002
|
}
|
|
@@ -970,13 +1005,13 @@ function Un({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
970
1005
|
const v = (d) => {
|
|
971
1006
|
e.includes(d) ? t(e.filter((m) => m !== d)) : t([...e, d]);
|
|
972
1007
|
};
|
|
973
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ N("div", { ref: u, className: "nc-col", style: { position: "relative" }, children: [
|
|
974
1009
|
o && /* @__PURE__ */ s("span", { className: "nc-label", children: o }),
|
|
975
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ N("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: [
|
|
976
1011
|
e.length === 0 && /* @__PURE__ */ s("span", { className: "nc-label", children: r }),
|
|
977
1012
|
e.map((d) => {
|
|
978
1013
|
const m = n.find((y) => y.value === d);
|
|
979
|
-
return m ? /* @__PURE__ */
|
|
1014
|
+
return m ? /* @__PURE__ */ N("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: [
|
|
980
1015
|
m.label,
|
|
981
1016
|
/* @__PURE__ */ s(
|
|
982
1017
|
"button",
|
|
@@ -1001,10 +1036,10 @@ function Un({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
1001
1036
|
}
|
|
1002
1037
|
)
|
|
1003
1038
|
] }),
|
|
1004
|
-
i && /* @__PURE__ */
|
|
1039
|
+
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: [
|
|
1005
1040
|
f.map((d) => {
|
|
1006
1041
|
const m = e.includes(d.value);
|
|
1007
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ N("div", { className: "nc-section nc-row", style: { justifyContent: "space-between", cursor: "pointer", padding: 12 }, onMouseDown: () => v(d.value), children: [
|
|
1008
1043
|
/* @__PURE__ */ s("span", { children: d.label }),
|
|
1009
1044
|
/* @__PURE__ */ s("span", { children: m ? "✔️" : "" })
|
|
1010
1045
|
] }, d.value);
|
|
@@ -1013,7 +1048,7 @@ function Un({ values: e, onChange: t, options: n, placeholder: r = "Select…",
|
|
|
1013
1048
|
] })
|
|
1014
1049
|
] });
|
|
1015
1050
|
}
|
|
1016
|
-
function
|
|
1051
|
+
function ge(e) {
|
|
1017
1052
|
if (!e) return null;
|
|
1018
1053
|
const t = /^\d{2}-\d{1,2}$/, n = /^\d{4}-\d{1,2}$/;
|
|
1019
1054
|
if (!t.test(e) && !n.test(e))
|
|
@@ -1033,18 +1068,18 @@ function ue(e) {
|
|
|
1033
1068
|
}
|
|
1034
1069
|
return `${n}-${r}`;
|
|
1035
1070
|
}
|
|
1036
|
-
function
|
|
1071
|
+
function Ve(e) {
|
|
1037
1072
|
if (!e) return "";
|
|
1038
1073
|
const t = ue(e);
|
|
1039
1074
|
if (!/^\d{4}-\d{2}$/.test(t)) return e;
|
|
1040
1075
|
const [n, r] = t.split("-");
|
|
1041
1076
|
return `${n}/${r}`;
|
|
1042
1077
|
}
|
|
1043
|
-
function
|
|
1078
|
+
function Oe() {
|
|
1044
1079
|
const e = /* @__PURE__ */ new Date(), t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0");
|
|
1045
1080
|
return `${t}-${n}`;
|
|
1046
1081
|
}
|
|
1047
|
-
function
|
|
1082
|
+
function sr({
|
|
1048
1083
|
startMonth: e,
|
|
1049
1084
|
endMonth: t,
|
|
1050
1085
|
onChange: n,
|
|
@@ -1053,10 +1088,10 @@ function qn({
|
|
|
1053
1088
|
disabled: i = !1,
|
|
1054
1089
|
size: a = "default"
|
|
1055
1090
|
}) {
|
|
1056
|
-
const [c, l] = E(!1), [u, f] = E(""), [v, d] = E(""), [m, y] = E({ top: 0, left: 0, width: 0, right: void 0 }),
|
|
1057
|
-
|
|
1058
|
-
if (c &&
|
|
1059
|
-
const S =
|
|
1091
|
+
const [c, l] = E(!1), [u, f] = E(""), [v, d] = E(""), [m, y] = E({ top: 0, left: 0, width: 0, right: void 0 }), b = H(null), w = H(null);
|
|
1092
|
+
z(() => {
|
|
1093
|
+
if (c && b.current) {
|
|
1094
|
+
const S = b.current.getBoundingClientRect(), L = Math.max(S.width, 400);
|
|
1060
1095
|
window.innerWidth - S.left < L && S.right >= L ? y({
|
|
1061
1096
|
top: S.bottom + 4,
|
|
1062
1097
|
left: 0,
|
|
@@ -1070,28 +1105,28 @@ function qn({
|
|
|
1070
1105
|
width: L
|
|
1071
1106
|
});
|
|
1072
1107
|
}
|
|
1073
|
-
}, [c]),
|
|
1108
|
+
}, [c]), z(() => {
|
|
1074
1109
|
if (!c) return;
|
|
1075
1110
|
const S = ($) => {
|
|
1076
|
-
|
|
1111
|
+
b.current && !b.current.contains($.target) && w.current && !w.current.contains($.target) && l(!1);
|
|
1077
1112
|
};
|
|
1078
1113
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
1079
1114
|
}, [c]);
|
|
1080
|
-
const
|
|
1081
|
-
f(e ||
|
|
1082
|
-
},
|
|
1115
|
+
const k = () => {
|
|
1116
|
+
f(e || Oe()), d(t || Oe()), l(!0);
|
|
1117
|
+
}, g = () => {
|
|
1083
1118
|
l(!1);
|
|
1084
1119
|
}, p = () => {
|
|
1085
|
-
const S =
|
|
1120
|
+
const S = ge(u), $ = ge(v);
|
|
1086
1121
|
if (S || $)
|
|
1087
1122
|
return;
|
|
1088
|
-
const L = ue(u),
|
|
1089
|
-
L &&
|
|
1090
|
-
}, h = e && t ? `${
|
|
1123
|
+
const L = ue(u), O = ue(v);
|
|
1124
|
+
L && O && (n == null || n(L, O)), l(!1);
|
|
1125
|
+
}, h = e && t ? `${Ve(e)} - ${Ve(t)}` : "Select month range", A = ge(u), C = ge(v), T = ue(u), P = ue(v), x = T && P && T > P, I = c ? pe(
|
|
1091
1126
|
/* @__PURE__ */ s(
|
|
1092
1127
|
"div",
|
|
1093
1128
|
{
|
|
1094
|
-
ref:
|
|
1129
|
+
ref: w,
|
|
1095
1130
|
className: "nc-month-range-picker-popup",
|
|
1096
1131
|
style: {
|
|
1097
1132
|
position: "fixed",
|
|
@@ -1100,9 +1135,9 @@ function qn({
|
|
|
1100
1135
|
width: m.width,
|
|
1101
1136
|
zIndex: 1e3
|
|
1102
1137
|
},
|
|
1103
|
-
children: /* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1138
|
+
children: /* @__PURE__ */ N("div", { className: "nc-month-range-picker-content", children: [
|
|
1139
|
+
/* @__PURE__ */ N("div", { className: "nc-month-range-picker-row", children: [
|
|
1140
|
+
/* @__PURE__ */ N("div", { className: "nc-month-range-picker-column", children: [
|
|
1106
1141
|
/* @__PURE__ */ s("label", { className: "nc-label", children: "Start Month" }),
|
|
1107
1142
|
/* @__PURE__ */ s(
|
|
1108
1143
|
"input",
|
|
@@ -1116,7 +1151,7 @@ function qn({
|
|
|
1116
1151
|
),
|
|
1117
1152
|
A && /* @__PURE__ */ s("div", { className: "nc-month-error-text", children: A })
|
|
1118
1153
|
] }),
|
|
1119
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ N("div", { className: "nc-month-range-picker-column", children: [
|
|
1120
1155
|
/* @__PURE__ */ s("label", { className: "nc-label", children: "End Month" }),
|
|
1121
1156
|
/* @__PURE__ */ s(
|
|
1122
1157
|
"input",
|
|
@@ -1132,9 +1167,9 @@ function qn({
|
|
|
1132
1167
|
] })
|
|
1133
1168
|
] }),
|
|
1134
1169
|
x && !A && !C && /* @__PURE__ */ s("div", { className: "nc-month-range-error", children: "End month must be after or equal to start month" }),
|
|
1135
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ N("div", { className: "nc-month-range-picker-footer", children: [
|
|
1136
1171
|
/* @__PURE__ */ s(
|
|
1137
|
-
|
|
1172
|
+
q,
|
|
1138
1173
|
{
|
|
1139
1174
|
variant: "primary",
|
|
1140
1175
|
onClick: p,
|
|
@@ -1142,21 +1177,21 @@ function qn({
|
|
|
1142
1177
|
children: "Apply"
|
|
1143
1178
|
}
|
|
1144
1179
|
),
|
|
1145
|
-
/* @__PURE__ */ s(
|
|
1180
|
+
/* @__PURE__ */ s(q, { variant: "ghost", onClick: g, children: "Cancel" })
|
|
1146
1181
|
] })
|
|
1147
1182
|
] })
|
|
1148
1183
|
}
|
|
1149
1184
|
),
|
|
1150
1185
|
document.body
|
|
1151
1186
|
) : null;
|
|
1152
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ N("div", { className: `nc-month-range-picker ${a === "small" ? "nc-small " : ""}${o}`, children: [
|
|
1153
1188
|
r && /* @__PURE__ */ s("label", { className: `nc-label${a === "small" ? " nc-small" : ""}`, children: r }),
|
|
1154
1189
|
/* @__PURE__ */ s(
|
|
1155
1190
|
"button",
|
|
1156
1191
|
{
|
|
1157
|
-
ref:
|
|
1192
|
+
ref: b,
|
|
1158
1193
|
className: `nc-month-range-picker-input${a === "small" ? " nc-small" : ""}`,
|
|
1159
|
-
onClick:
|
|
1194
|
+
onClick: k,
|
|
1160
1195
|
disabled: i,
|
|
1161
1196
|
children: h
|
|
1162
1197
|
}
|
|
@@ -1164,7 +1199,7 @@ function qn({
|
|
|
1164
1199
|
I
|
|
1165
1200
|
] });
|
|
1166
1201
|
}
|
|
1167
|
-
function
|
|
1202
|
+
function ir({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disabled: a, size: c = "default" }) {
|
|
1168
1203
|
const l = c === "small", u = () => {
|
|
1169
1204
|
const d = e - o;
|
|
1170
1205
|
n !== void 0 && d < n || t(parseFloat(d.toFixed(10)));
|
|
@@ -1172,9 +1207,9 @@ function Xn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1172
1207
|
const d = e + o;
|
|
1173
1208
|
r !== void 0 && d > r || t(parseFloat(d.toFixed(10)));
|
|
1174
1209
|
};
|
|
1175
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ N("div", { className: `nc-col nc-number-input-col ${l ? "nc-small" : ""}`, children: [
|
|
1176
1211
|
i && /* @__PURE__ */ s("span", { className: `nc-label ${l ? "nc-small" : ""}`, children: i }),
|
|
1177
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ N("div", { className: `nc-number-input-container ${l ? "nc-small" : ""}`, children: [
|
|
1178
1213
|
/* @__PURE__ */ s(
|
|
1179
1214
|
"input",
|
|
1180
1215
|
{
|
|
@@ -1212,7 +1247,7 @@ function Xn({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1212
1247
|
] })
|
|
1213
1248
|
] });
|
|
1214
1249
|
}
|
|
1215
|
-
function
|
|
1250
|
+
function cr({
|
|
1216
1251
|
value: e,
|
|
1217
1252
|
onChange: t,
|
|
1218
1253
|
min: n = 0,
|
|
@@ -1228,9 +1263,9 @@ function Jn({
|
|
|
1228
1263
|
const m = parseFloat(d.target.value);
|
|
1229
1264
|
t(m);
|
|
1230
1265
|
}, v = (e - n) / (r - n) * 100;
|
|
1231
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ N("div", { className: "nc-col", style: { gap: 6 }, children: [
|
|
1232
1267
|
i && /* @__PURE__ */ s("span", { className: "nc-label", children: i }),
|
|
1233
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ N("div", { style: { display: "flex", gap: 12, alignItems: "center" }, children: [
|
|
1234
1269
|
/* @__PURE__ */ s(
|
|
1235
1270
|
"input",
|
|
1236
1271
|
{
|
|
@@ -1264,13 +1299,13 @@ function Jn({
|
|
|
1264
1299
|
] })
|
|
1265
1300
|
] });
|
|
1266
1301
|
}
|
|
1267
|
-
const
|
|
1268
|
-
function
|
|
1302
|
+
const Dt = ({ size: e = 24, className: t, style: n }) => /* @__PURE__ */ s("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__ */ s("polyline", { points: "18 15 12 9 6 15" }) });
|
|
1303
|
+
function Wt({ children: e, className: t = "", style: n }) {
|
|
1269
1304
|
return /* @__PURE__ */ s("div", { className: `nc-tab-panel ${t}`, style: n, children: e });
|
|
1270
1305
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const i =
|
|
1273
|
-
(c) =>
|
|
1306
|
+
function ar({ active: e, children: t, keepMounted: n = !1, className: r = "", style: o }) {
|
|
1307
|
+
const i = xt.toArray(t).filter(
|
|
1308
|
+
(c) => kt(c) && (c.type === Wt || c.type.displayName === "TabPanel")
|
|
1274
1309
|
);
|
|
1275
1310
|
if (n)
|
|
1276
1311
|
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: i.map((c) => {
|
|
@@ -1289,12 +1324,12 @@ function Zn({ active: e, children: t, keepMounted: n = !1, className: r = "", st
|
|
|
1289
1324
|
const a = i.find((c) => c.props.tab === e);
|
|
1290
1325
|
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: a });
|
|
1291
1326
|
}
|
|
1292
|
-
function
|
|
1293
|
-
const f = H(null), [v, d] = E(!1), [m, y] = E(!1),
|
|
1294
|
-
|
|
1327
|
+
function lr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, className: i, toolbar: a, multiline: c, orientation: l = "horizontal", style: u }) {
|
|
1328
|
+
const f = H(null), [v, d] = E(!1), [m, y] = E(!1), b = l === "verticalLeft" || l === "verticalRight", w = H(!1), k = H(0), g = H(0), p = H(!1);
|
|
1329
|
+
z(() => {
|
|
1295
1330
|
const x = () => {
|
|
1296
1331
|
if (f.current)
|
|
1297
|
-
if (
|
|
1332
|
+
if (b) {
|
|
1298
1333
|
const { scrollTop: S, scrollHeight: $, clientHeight: L } = f.current;
|
|
1299
1334
|
d(S > 1), y(S < $ - L - 1);
|
|
1300
1335
|
} else {
|
|
@@ -1306,34 +1341,34 @@ function Qn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1306
1341
|
return x(), I.addEventListener("scroll", x), window.addEventListener("resize", x), () => {
|
|
1307
1342
|
I.removeEventListener("scroll", x), window.removeEventListener("resize", x);
|
|
1308
1343
|
};
|
|
1309
|
-
}, [e,
|
|
1344
|
+
}, [e, b]);
|
|
1310
1345
|
const h = (x) => {
|
|
1311
|
-
f.current && (
|
|
1346
|
+
f.current && (w.current = !0, p.current = !1, k.current = b ? x.clientY : x.clientX, g.current = b ? f.current.scrollTop : f.current.scrollLeft, f.current.style.cursor = "grabbing", f.current.style.userSelect = "none");
|
|
1312
1347
|
}, A = (x) => {
|
|
1313
|
-
if (!
|
|
1314
|
-
const I =
|
|
1315
|
-
Math.abs(S) > 3 && (p.current = !0),
|
|
1348
|
+
if (!w.current || !f.current) return;
|
|
1349
|
+
const I = b ? x.clientY : x.clientX, S = k.current - I;
|
|
1350
|
+
Math.abs(S) > 3 && (p.current = !0), b ? f.current.scrollTop = g.current + S : f.current.scrollLeft = g.current + S;
|
|
1316
1351
|
}, C = () => {
|
|
1317
|
-
f.current && (
|
|
1318
|
-
},
|
|
1352
|
+
f.current && (w.current = !1, f.current.style.cursor = "", f.current.style.userSelect = "");
|
|
1353
|
+
}, T = () => {
|
|
1319
1354
|
C();
|
|
1320
1355
|
};
|
|
1321
|
-
|
|
1356
|
+
z(() => {
|
|
1322
1357
|
const x = f.current;
|
|
1323
|
-
if (!x ||
|
|
1358
|
+
if (!x || b) return;
|
|
1324
1359
|
const I = (S) => {
|
|
1325
1360
|
S.deltaY !== 0 && (S.preventDefault(), x.scrollLeft += S.deltaY * 0.3);
|
|
1326
1361
|
};
|
|
1327
1362
|
return x.addEventListener("wheel", I, { passive: !1 }), () => {
|
|
1328
1363
|
x.removeEventListener("wheel", I);
|
|
1329
1364
|
};
|
|
1330
|
-
}, [
|
|
1331
|
-
const
|
|
1365
|
+
}, [b]);
|
|
1366
|
+
const P = (x) => {
|
|
1332
1367
|
p.current || n(x);
|
|
1333
1368
|
};
|
|
1334
|
-
return /* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
v && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${
|
|
1369
|
+
return /* @__PURE__ */ N("div", { className: `nc-tab-container ${b ? `nc-vertical nc-${l}` : ""} ${i || ""}`, style: u, children: [
|
|
1370
|
+
/* @__PURE__ */ N("div", { className: "nc-tab-scroll-wrapper", children: [
|
|
1371
|
+
v && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${b ? "nc-top" : "nc-left"}`, children: b ? /* @__PURE__ */ s(Dt, { size: 16 }) : /* @__PURE__ */ s(vt, { size: 16 }) }),
|
|
1337
1372
|
/* @__PURE__ */ s(
|
|
1338
1373
|
"div",
|
|
1339
1374
|
{
|
|
@@ -1342,22 +1377,22 @@ function Qn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1342
1377
|
onMouseDown: h,
|
|
1343
1378
|
onMouseMove: A,
|
|
1344
1379
|
onMouseUp: C,
|
|
1345
|
-
onMouseLeave:
|
|
1380
|
+
onMouseLeave: T,
|
|
1346
1381
|
style: { cursor: "grab" },
|
|
1347
1382
|
children: e.map((x) => {
|
|
1348
1383
|
const I = typeof x == "string" ? x : x.id, S = typeof x == "string" ? x : x.label, $ = r && !(o != null && o.includes(I));
|
|
1349
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ N(
|
|
1350
1385
|
"div",
|
|
1351
1386
|
{
|
|
1352
1387
|
className: `nc-tab-item ${t === I ? "nc-active" : ""} ${$ ? "nc-closable" : ""}`,
|
|
1353
|
-
onClick: () =>
|
|
1388
|
+
onClick: () => P(I),
|
|
1354
1389
|
role: "button",
|
|
1355
1390
|
tabIndex: 0,
|
|
1356
1391
|
onKeyDown: (L) => {
|
|
1357
1392
|
(L.key === "Enter" || L.key === " ") && n(I);
|
|
1358
1393
|
},
|
|
1359
1394
|
children: [
|
|
1360
|
-
/* @__PURE__ */ s("span", { className: "nc-tab-label", children:
|
|
1395
|
+
/* @__PURE__ */ s("span", { className: "nc-tab-label", children: b ? S : typeof S == "string" ? S.toUpperCase() : S }),
|
|
1361
1396
|
$ && /* @__PURE__ */ s(
|
|
1362
1397
|
"span",
|
|
1363
1398
|
{
|
|
@@ -1371,7 +1406,7 @@ function Qn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1371
1406
|
onKeyDown: (L) => {
|
|
1372
1407
|
(L.key === "Enter" || L.key === " ") && (L.stopPropagation(), r(I));
|
|
1373
1408
|
},
|
|
1374
|
-
children: /* @__PURE__ */
|
|
1409
|
+
children: /* @__PURE__ */ N("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1375
1410
|
/* @__PURE__ */ s("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1376
1411
|
/* @__PURE__ */ s("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1377
1412
|
] })
|
|
@@ -1384,13 +1419,13 @@ function Qn({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1384
1419
|
})
|
|
1385
1420
|
}
|
|
1386
1421
|
),
|
|
1387
|
-
m && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${
|
|
1422
|
+
m && /* @__PURE__ */ s("div", { className: `nc-tab-scroll-indicator ${b ? "nc-bottom" : "nc-right"}`, children: b ? /* @__PURE__ */ s(wt, { size: 16 }) : /* @__PURE__ */ s(yt, { size: 16 }) })
|
|
1388
1423
|
] }),
|
|
1389
1424
|
a && /* @__PURE__ */ s("div", { className: "nc-tab-toolbar", children: a })
|
|
1390
1425
|
] });
|
|
1391
1426
|
}
|
|
1392
|
-
function
|
|
1393
|
-
return /* @__PURE__ */
|
|
1427
|
+
function dr({ checked: e, onChange: t, disabled: n, label: r }) {
|
|
1428
|
+
return /* @__PURE__ */ N(
|
|
1394
1429
|
"label",
|
|
1395
1430
|
{
|
|
1396
1431
|
className: "nc-row",
|
|
@@ -1441,7 +1476,7 @@ function er({ checked: e, onChange: t, disabled: n, label: r }) {
|
|
|
1441
1476
|
}
|
|
1442
1477
|
);
|
|
1443
1478
|
}
|
|
1444
|
-
const
|
|
1479
|
+
const Fe = [
|
|
1445
1480
|
"var(--nc-csv-col-0)",
|
|
1446
1481
|
"var(--nc-csv-col-1)",
|
|
1447
1482
|
"var(--nc-csv-col-2)",
|
|
@@ -1453,12 +1488,12 @@ const ze = [
|
|
|
1453
1488
|
"var(--nc-csv-col-8)",
|
|
1454
1489
|
"var(--nc-csv-col-9)"
|
|
1455
1490
|
];
|
|
1456
|
-
function
|
|
1491
|
+
function Ht(e, t) {
|
|
1457
1492
|
const r = e.slice(0, t).split(`
|
|
1458
1493
|
`), o = r.length, a = r[o - 1].split(" "), c = a.length, l = a[c - 1].length + 1;
|
|
1459
1494
|
return { line: o, column: c, character: l, offset: t };
|
|
1460
1495
|
}
|
|
1461
|
-
function
|
|
1496
|
+
function Vt(e, t, n, r) {
|
|
1462
1497
|
const o = e.split(`
|
|
1463
1498
|
`), i = Math.max(1, Math.min(t, o.length));
|
|
1464
1499
|
let a = 0;
|
|
@@ -1470,7 +1505,7 @@ function Et(e, t, n, r) {
|
|
|
1470
1505
|
const f = Math.max(1, Math.min(r, l[u - 1].length + 1));
|
|
1471
1506
|
return a += f - 1, a;
|
|
1472
1507
|
}
|
|
1473
|
-
function
|
|
1508
|
+
function Ot(e, t) {
|
|
1474
1509
|
const n = e.split(`
|
|
1475
1510
|
`), r = Math.max(1, Math.min(t, n.length));
|
|
1476
1511
|
let o = 0;
|
|
@@ -1478,74 +1513,74 @@ function Lt(e, t) {
|
|
|
1478
1513
|
o += n[i].length + 1;
|
|
1479
1514
|
return o;
|
|
1480
1515
|
}
|
|
1481
|
-
const
|
|
1516
|
+
const ur = Nt(
|
|
1482
1517
|
function({ value: t, onChange: n, placeholder: r, className: o, style: i, showLineNumbers: a = !1, onCursorChange: c, highlightLine: l }, u) {
|
|
1483
1518
|
const f = H(null), v = H(null), d = H(null);
|
|
1484
|
-
|
|
1485
|
-
goToLine(
|
|
1519
|
+
At(u, () => ({
|
|
1520
|
+
goToLine(g) {
|
|
1486
1521
|
const p = f.current;
|
|
1487
1522
|
if (!p) return;
|
|
1488
|
-
const h =
|
|
1523
|
+
const h = Ot(t, g);
|
|
1489
1524
|
p.focus(), p.setSelectionRange(h, h);
|
|
1490
1525
|
const A = parseFloat(getComputedStyle(p).lineHeight) || 18;
|
|
1491
|
-
p.scrollTop = (Math.max(1,
|
|
1526
|
+
p.scrollTop = (Math.max(1, g) - 1) * A, y(), m();
|
|
1492
1527
|
},
|
|
1493
|
-
goToPosition(
|
|
1528
|
+
goToPosition(g, p, h) {
|
|
1494
1529
|
const A = f.current;
|
|
1495
1530
|
if (!A) return;
|
|
1496
|
-
const C =
|
|
1531
|
+
const C = Vt(t, g, p, h);
|
|
1497
1532
|
A.focus(), A.setSelectionRange(C, C);
|
|
1498
|
-
const
|
|
1499
|
-
A.scrollTop = (Math.max(1,
|
|
1533
|
+
const T = parseFloat(getComputedStyle(A).lineHeight) || 18;
|
|
1534
|
+
A.scrollTop = (Math.max(1, g) - 1) * T, y(), m();
|
|
1500
1535
|
}
|
|
1501
1536
|
}), [t]);
|
|
1502
|
-
const m =
|
|
1537
|
+
const m = V(() => {
|
|
1503
1538
|
if (!c || !f.current) return;
|
|
1504
|
-
const
|
|
1505
|
-
c(
|
|
1506
|
-
}, [c, t]), y =
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1539
|
+
const g = Ht(t, f.current.selectionStart);
|
|
1540
|
+
c(g);
|
|
1541
|
+
}, [c, t]), y = V(() => {
|
|
1542
|
+
const g = f.current;
|
|
1543
|
+
g && (v.current && (v.current.scrollTop = g.scrollTop, v.current.scrollLeft = g.scrollLeft), d.current && (d.current.scrollTop = g.scrollTop));
|
|
1509
1544
|
}, []);
|
|
1510
|
-
|
|
1545
|
+
z(() => {
|
|
1511
1546
|
if (l == null || l < 1) return;
|
|
1512
|
-
const
|
|
1513
|
-
if (!
|
|
1514
|
-
const p = parseFloat(getComputedStyle(
|
|
1515
|
-
(h <
|
|
1547
|
+
const g = f.current;
|
|
1548
|
+
if (!g) return;
|
|
1549
|
+
const p = parseFloat(getComputedStyle(g).lineHeight) || 18, h = (l - 1) * p, A = h + p;
|
|
1550
|
+
(h < g.scrollTop || A > g.scrollTop + g.clientHeight) && (g.scrollTop = h - g.clientHeight / 2 + p / 2), y();
|
|
1516
1551
|
}, [l]);
|
|
1517
|
-
const
|
|
1518
|
-
`).length, [t]),
|
|
1519
|
-
const
|
|
1520
|
-
for (let p = 1; p <=
|
|
1521
|
-
|
|
1552
|
+
const b = we(() => t.split(`
|
|
1553
|
+
`).length, [t]), w = () => {
|
|
1554
|
+
const g = [];
|
|
1555
|
+
for (let p = 1; p <= b; p++)
|
|
1556
|
+
g.push(
|
|
1522
1557
|
/* @__PURE__ */ s("div", { className: `nc-csv-line-number ${l === p ? "nc-csv-highlight" : ""}`, children: p }, p)
|
|
1523
1558
|
);
|
|
1524
|
-
return /* @__PURE__ */ s("div", { className: "nc-csv-gutter", ref: d, children:
|
|
1525
|
-
},
|
|
1559
|
+
return /* @__PURE__ */ s("div", { className: "nc-csv-gutter", ref: d, children: g });
|
|
1560
|
+
}, k = (g) => g ? g.split(`
|
|
1526
1561
|
`).map((h, A) => {
|
|
1527
1562
|
const C = h.split(" ");
|
|
1528
|
-
return /* @__PURE__ */
|
|
1529
|
-
C.map((
|
|
1530
|
-
|
|
1531
|
-
/* @__PURE__ */ s("span", { style: { color:
|
|
1532
|
-
] },
|
|
1563
|
+
return /* @__PURE__ */ N("div", { className: `nc-csv-line ${l === A + 1 ? "nc-csv-highlight" : ""}`, children: [
|
|
1564
|
+
C.map((T, P) => /* @__PURE__ */ N("span", { children: [
|
|
1565
|
+
P > 0 && /* @__PURE__ */ s("span", { className: "nc-csv-tab-char", children: " " }),
|
|
1566
|
+
/* @__PURE__ */ s("span", { style: { color: Fe[P % Fe.length] }, children: T })
|
|
1567
|
+
] }, P)),
|
|
1533
1568
|
h === "" && `
|
|
1534
1569
|
`
|
|
1535
1570
|
] }, A);
|
|
1536
1571
|
}) : null;
|
|
1537
|
-
return /* @__PURE__ */
|
|
1538
|
-
a &&
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */ s("div", { className: "nc-csv-textarea-backdrop", ref: v, children: /* @__PURE__ */ s("pre", { className: "nc-csv-textarea-highlights", children:
|
|
1572
|
+
return /* @__PURE__ */ N("div", { className: `nc-csv-textarea-container ${a ? "nc-csv-with-gutter" : ""} ${o ?? ""}`, style: i, children: [
|
|
1573
|
+
a && w(),
|
|
1574
|
+
/* @__PURE__ */ N("div", { className: "nc-csv-textarea-editor", children: [
|
|
1575
|
+
/* @__PURE__ */ s("div", { className: "nc-csv-textarea-backdrop", ref: v, children: /* @__PURE__ */ s("pre", { className: "nc-csv-textarea-highlights", children: k(t) }) }),
|
|
1541
1576
|
/* @__PURE__ */ s(
|
|
1542
1577
|
"textarea",
|
|
1543
1578
|
{
|
|
1544
1579
|
ref: f,
|
|
1545
1580
|
className: "nc-csv-textarea-input",
|
|
1546
1581
|
value: t,
|
|
1547
|
-
onChange: (
|
|
1548
|
-
n(
|
|
1582
|
+
onChange: (g) => {
|
|
1583
|
+
n(g.target.value), requestAnimationFrame(m);
|
|
1549
1584
|
},
|
|
1550
1585
|
onScroll: y,
|
|
1551
1586
|
onSelect: m,
|
|
@@ -1561,27 +1596,27 @@ const tr = ht(
|
|
|
1561
1596
|
] });
|
|
1562
1597
|
}
|
|
1563
1598
|
);
|
|
1564
|
-
let
|
|
1565
|
-
const
|
|
1566
|
-
function
|
|
1567
|
-
const e =
|
|
1568
|
-
for (const t of Array.from(
|
|
1599
|
+
let re = { notifications: [] };
|
|
1600
|
+
const Ae = /* @__PURE__ */ new Set(), je = /* @__PURE__ */ new Map();
|
|
1601
|
+
function Se() {
|
|
1602
|
+
const e = re.notifications.slice();
|
|
1603
|
+
for (const t of Array.from(Ae))
|
|
1569
1604
|
try {
|
|
1570
1605
|
t(e);
|
|
1571
1606
|
} catch {
|
|
1572
1607
|
}
|
|
1573
1608
|
}
|
|
1574
|
-
function
|
|
1575
|
-
|
|
1609
|
+
function Ft(e) {
|
|
1610
|
+
Ae.add(e);
|
|
1576
1611
|
try {
|
|
1577
|
-
e(
|
|
1612
|
+
e(re.notifications.slice());
|
|
1578
1613
|
} catch {
|
|
1579
1614
|
}
|
|
1580
1615
|
return () => {
|
|
1581
|
-
|
|
1616
|
+
Ae.delete(e);
|
|
1582
1617
|
};
|
|
1583
1618
|
}
|
|
1584
|
-
function
|
|
1619
|
+
function jt(e) {
|
|
1585
1620
|
const t = `notification-${Date.now()}-${Math.random()}`, { duration: n, type: r, ...o } = e, i = {
|
|
1586
1621
|
id: t,
|
|
1587
1622
|
dismissible: !0,
|
|
@@ -1589,20 +1624,20 @@ function zt(e) {
|
|
|
1589
1624
|
type: r === "error" ? "danger" : r ?? "info",
|
|
1590
1625
|
duration: n ?? 5e3
|
|
1591
1626
|
};
|
|
1592
|
-
return
|
|
1593
|
-
|
|
1627
|
+
return re.notifications = [i, ...re.notifications], Se(), i.duration && i.duration > 0 && setTimeout(() => {
|
|
1628
|
+
Xe(t);
|
|
1594
1629
|
}, i.duration), t;
|
|
1595
1630
|
}
|
|
1596
|
-
function
|
|
1597
|
-
const t =
|
|
1631
|
+
function Xe(e) {
|
|
1632
|
+
const t = re.notifications.find((r) => r.id === e);
|
|
1598
1633
|
if (!t) return;
|
|
1599
|
-
t.isRemoving = !0,
|
|
1634
|
+
t.isRemoving = !0, Se();
|
|
1600
1635
|
const n = window.setTimeout(() => {
|
|
1601
|
-
|
|
1636
|
+
re.notifications = re.notifications.filter((r) => r.id !== e), Se(), je.delete(e);
|
|
1602
1637
|
}, 300);
|
|
1603
|
-
|
|
1638
|
+
je.set(e, n);
|
|
1604
1639
|
}
|
|
1605
|
-
function
|
|
1640
|
+
function Gt({ type: e }) {
|
|
1606
1641
|
switch (e) {
|
|
1607
1642
|
case "success":
|
|
1608
1643
|
return /* @__PURE__ */ s("svg", { viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ s(
|
|
@@ -1616,13 +1651,13 @@ function Pt({ type: e }) {
|
|
|
1616
1651
|
}
|
|
1617
1652
|
) });
|
|
1618
1653
|
case "danger":
|
|
1619
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ N("svg", { viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1620
1655
|
/* @__PURE__ */ s("circle", { cx: "10", cy: "10", r: "7", stroke: "currentColor", strokeWidth: "2" }),
|
|
1621
1656
|
/* @__PURE__ */ s("path", { d: "M10 6.5v4.25", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
|
|
1622
1657
|
/* @__PURE__ */ s("circle", { cx: "10", cy: "13.75", r: "1", fill: "currentColor" })
|
|
1623
1658
|
] });
|
|
1624
1659
|
case "warning":
|
|
1625
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ N("svg", { viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1626
1661
|
/* @__PURE__ */ s(
|
|
1627
1662
|
"path",
|
|
1628
1663
|
{
|
|
@@ -1636,15 +1671,15 @@ function Pt({ type: e }) {
|
|
|
1636
1671
|
/* @__PURE__ */ s("circle", { cx: "10", cy: "13.25", r: "1", fill: "currentColor" })
|
|
1637
1672
|
] });
|
|
1638
1673
|
default:
|
|
1639
|
-
return /* @__PURE__ */
|
|
1674
|
+
return /* @__PURE__ */ N("svg", { viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1640
1675
|
/* @__PURE__ */ s("circle", { cx: "10", cy: "10", r: "7", stroke: "currentColor", strokeWidth: "2" }),
|
|
1641
1676
|
/* @__PURE__ */ s("path", { d: "M10 9v4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
|
|
1642
1677
|
/* @__PURE__ */ s("circle", { cx: "10", cy: "6.5", r: "1", fill: "currentColor" })
|
|
1643
1678
|
] });
|
|
1644
1679
|
}
|
|
1645
1680
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const { t } =
|
|
1681
|
+
function Yt({ notification: e }) {
|
|
1682
|
+
const { t } = J(), n = e.type || "info", r = () => {
|
|
1648
1683
|
if (e.title) return e.title;
|
|
1649
1684
|
switch (n) {
|
|
1650
1685
|
case "success":
|
|
@@ -1657,15 +1692,15 @@ function Bt({ notification: e }) {
|
|
|
1657
1692
|
return t("common.info");
|
|
1658
1693
|
}
|
|
1659
1694
|
}, o = () => {
|
|
1660
|
-
|
|
1695
|
+
Xe(e.id);
|
|
1661
1696
|
};
|
|
1662
1697
|
return /* @__PURE__ */ s(
|
|
1663
1698
|
"div",
|
|
1664
1699
|
{
|
|
1665
1700
|
className: `nc-notification nc-notification-${n}`,
|
|
1666
|
-
children: /* @__PURE__ */
|
|
1667
|
-
/* @__PURE__ */ s("div", { className: `nc-notification-icon nc-notification-icon-${n}`, children: /* @__PURE__ */ s(
|
|
1668
|
-
/* @__PURE__ */
|
|
1701
|
+
children: /* @__PURE__ */ N("div", { className: "nc-notification-content", children: [
|
|
1702
|
+
/* @__PURE__ */ s("div", { className: `nc-notification-icon nc-notification-icon-${n}`, children: /* @__PURE__ */ s(Gt, { type: n }) }),
|
|
1703
|
+
/* @__PURE__ */ N("div", { className: "nc-notification-body", children: [
|
|
1669
1704
|
/* @__PURE__ */ s("div", { className: "nc-notification-title", children: r() }),
|
|
1670
1705
|
/* @__PURE__ */ s("div", { className: "nc-notification-message", children: e.message })
|
|
1671
1706
|
] }),
|
|
@@ -1675,23 +1710,23 @@ function Bt({ notification: e }) {
|
|
|
1675
1710
|
className: "nc-notification-dismiss",
|
|
1676
1711
|
onClick: o,
|
|
1677
1712
|
"aria-label": t("common.close"),
|
|
1678
|
-
children: /* @__PURE__ */ s(
|
|
1713
|
+
children: /* @__PURE__ */ s($e, { size: 16 })
|
|
1679
1714
|
}
|
|
1680
1715
|
)
|
|
1681
1716
|
] })
|
|
1682
1717
|
}
|
|
1683
1718
|
);
|
|
1684
1719
|
}
|
|
1685
|
-
function
|
|
1720
|
+
function pr() {
|
|
1686
1721
|
const [e, t] = E([]), [n, r] = E(/* @__PURE__ */ new Map()), [o, i] = E(/* @__PURE__ */ new Set()), a = H(null), c = H([]);
|
|
1687
|
-
return
|
|
1722
|
+
return z(() => Ft((u) => {
|
|
1688
1723
|
const f = new Set(c.current.map((d) => d.id)), v = u.filter((d) => !f.has(d.id)).map((d) => d.id);
|
|
1689
1724
|
v.length > 0 ? (t(u), i(new Set(v)), requestAnimationFrame(() => {
|
|
1690
1725
|
requestAnimationFrame(() => {
|
|
1691
1726
|
i(/* @__PURE__ */ new Set());
|
|
1692
1727
|
});
|
|
1693
1728
|
})) : t(u), c.current = u;
|
|
1694
|
-
}), []),
|
|
1729
|
+
}), []), z(() => {
|
|
1695
1730
|
if (!a.current) return;
|
|
1696
1731
|
const l = /* @__PURE__ */ new Map();
|
|
1697
1732
|
let u = 0;
|
|
@@ -1737,7 +1772,7 @@ function nr() {
|
|
|
1737
1772
|
opacity: f ? 0 : 1,
|
|
1738
1773
|
width: "100%"
|
|
1739
1774
|
},
|
|
1740
|
-
children: /* @__PURE__ */ s(
|
|
1775
|
+
children: /* @__PURE__ */ s(Yt, { notification: l })
|
|
1741
1776
|
},
|
|
1742
1777
|
l.id
|
|
1743
1778
|
);
|
|
@@ -1747,14 +1782,14 @@ function nr() {
|
|
|
1747
1782
|
}
|
|
1748
1783
|
);
|
|
1749
1784
|
}
|
|
1750
|
-
function
|
|
1751
|
-
return
|
|
1785
|
+
function Kt(e) {
|
|
1786
|
+
return jt(e);
|
|
1752
1787
|
}
|
|
1753
|
-
const
|
|
1754
|
-
show: (e) =>
|
|
1788
|
+
const fr = {
|
|
1789
|
+
show: (e) => Kt(e)
|
|
1755
1790
|
};
|
|
1756
|
-
function
|
|
1757
|
-
const t =
|
|
1791
|
+
function hr(e) {
|
|
1792
|
+
const t = Ct.createInstance(), n = {};
|
|
1758
1793
|
for (const o in e)
|
|
1759
1794
|
n[o] = { translation: e[o] };
|
|
1760
1795
|
const r = typeof document < "u" && document.documentElement.lang || "en";
|
|
@@ -1774,9 +1809,9 @@ function or(e) {
|
|
|
1774
1809
|
}
|
|
1775
1810
|
}).observe(document.documentElement, { attributes: !0 }), t;
|
|
1776
1811
|
}
|
|
1777
|
-
class
|
|
1812
|
+
class _t {
|
|
1778
1813
|
constructor() {
|
|
1779
|
-
|
|
1814
|
+
Q(this, "apps", /* @__PURE__ */ new Map());
|
|
1780
1815
|
}
|
|
1781
1816
|
/**
|
|
1782
1817
|
* Register an app definition.
|
|
@@ -1814,16 +1849,16 @@ class Wt {
|
|
|
1814
1849
|
return this.apps.has(t);
|
|
1815
1850
|
}
|
|
1816
1851
|
}
|
|
1817
|
-
const
|
|
1818
|
-
class
|
|
1852
|
+
const ie = new _t(), Ge = "nc-ui-app-state";
|
|
1853
|
+
class Ut {
|
|
1819
1854
|
constructor() {
|
|
1820
|
-
|
|
1821
|
-
|
|
1855
|
+
Q(this, "state");
|
|
1856
|
+
Q(this, "listeners", /* @__PURE__ */ new Map());
|
|
1822
1857
|
this.state = this.loadState();
|
|
1823
1858
|
}
|
|
1824
1859
|
loadState() {
|
|
1825
1860
|
try {
|
|
1826
|
-
const t = localStorage.getItem(
|
|
1861
|
+
const t = localStorage.getItem(Ge);
|
|
1827
1862
|
if (t)
|
|
1828
1863
|
return JSON.parse(t);
|
|
1829
1864
|
} catch {
|
|
@@ -1832,7 +1867,7 @@ class Ht {
|
|
|
1832
1867
|
}
|
|
1833
1868
|
saveState() {
|
|
1834
1869
|
try {
|
|
1835
|
-
localStorage.setItem(
|
|
1870
|
+
localStorage.setItem(Ge, JSON.stringify(this.state));
|
|
1836
1871
|
} catch {
|
|
1837
1872
|
}
|
|
1838
1873
|
}
|
|
@@ -1862,13 +1897,13 @@ class Ht {
|
|
|
1862
1897
|
(r = this.listeners.get(t)) == null || r.forEach((o) => o(n));
|
|
1863
1898
|
}
|
|
1864
1899
|
}
|
|
1865
|
-
const
|
|
1866
|
-
class
|
|
1900
|
+
const X = new Ut();
|
|
1901
|
+
class qt {
|
|
1867
1902
|
constructor() {
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1903
|
+
Q(this, "apps", []);
|
|
1904
|
+
Q(this, "activeAppId", null);
|
|
1905
|
+
Q(this, "listeners", /* @__PURE__ */ new Set());
|
|
1906
|
+
Q(this, "refReadyResolvers", /* @__PURE__ */ new Map());
|
|
1872
1907
|
}
|
|
1873
1908
|
/**
|
|
1874
1909
|
* Launch an app and wait for it to be ready (ref populated).
|
|
@@ -1880,16 +1915,16 @@ class Ot {
|
|
|
1880
1915
|
*/
|
|
1881
1916
|
async launchApp(t, n) {
|
|
1882
1917
|
const { launchInBackground: r = !1 } = n || {};
|
|
1883
|
-
if (!
|
|
1918
|
+
if (!ie.has(t))
|
|
1884
1919
|
return console.error(`Cannot launch app "${t}": not registered`), null;
|
|
1885
1920
|
const o = this.apps.find((a) => a.appId === t);
|
|
1886
1921
|
if (o)
|
|
1887
|
-
return r || (this.setActiveApp(t),
|
|
1922
|
+
return r || (this.setActiveApp(t), X._setActiveAppId(t)), o.ref ? o : this.waitForRef(t);
|
|
1888
1923
|
const i = {
|
|
1889
1924
|
appId: t,
|
|
1890
1925
|
launchedAt: Date.now()
|
|
1891
1926
|
};
|
|
1892
|
-
return this.apps.push(i), r || (this.activeAppId = t,
|
|
1927
|
+
return this.apps.push(i), r || (this.activeAppId = t, X._setActiveAppId(t)), this.notify(), this.waitForRef(t);
|
|
1893
1928
|
}
|
|
1894
1929
|
waitForRef(t) {
|
|
1895
1930
|
return new Promise((n) => {
|
|
@@ -1926,7 +1961,7 @@ class Ot {
|
|
|
1926
1961
|
const r = this.apps[n];
|
|
1927
1962
|
if (r.ref && (r.ref = void 0), this.apps.splice(n, 1), this.activeAppId === t) {
|
|
1928
1963
|
const o = window.innerWidth >= 768;
|
|
1929
|
-
this.activeAppId = o && this.apps.length > 0 ? this.apps[this.apps.length - 1].appId : null,
|
|
1964
|
+
this.activeAppId = o && this.apps.length > 0 ? this.apps[this.apps.length - 1].appId : null, X._setActiveAppId(this.activeAppId);
|
|
1930
1965
|
}
|
|
1931
1966
|
this.notify();
|
|
1932
1967
|
}
|
|
@@ -1938,7 +1973,7 @@ class Ot {
|
|
|
1938
1973
|
console.warn(`Cannot activate app "${t}": not running`);
|
|
1939
1974
|
return;
|
|
1940
1975
|
}
|
|
1941
|
-
this.activeAppId !== t && (this.activeAppId = t, this.notify(),
|
|
1976
|
+
this.activeAppId !== t && (this.activeAppId = t, this.notify(), X._setActiveAppId(t));
|
|
1942
1977
|
}
|
|
1943
1978
|
/**
|
|
1944
1979
|
* Toggle an app: if active, deactivate; if inactive, activate.
|
|
@@ -1956,7 +1991,7 @@ class Ot {
|
|
|
1956
1991
|
* Get the currently active app definition.
|
|
1957
1992
|
*/
|
|
1958
1993
|
getActiveApp() {
|
|
1959
|
-
return this.activeAppId ?
|
|
1994
|
+
return this.activeAppId ? ie.get(this.activeAppId) ?? null : null;
|
|
1960
1995
|
}
|
|
1961
1996
|
/**
|
|
1962
1997
|
* Get all running apps.
|
|
@@ -1982,15 +2017,15 @@ class Ot {
|
|
|
1982
2017
|
this.listeners.forEach((t) => t());
|
|
1983
2018
|
}
|
|
1984
2019
|
}
|
|
1985
|
-
const
|
|
1986
|
-
function
|
|
1987
|
-
const e =
|
|
2020
|
+
const _ = new qt(), Je = ce(null);
|
|
2021
|
+
function Xt() {
|
|
2022
|
+
const e = ne(Je);
|
|
1988
2023
|
if (!e)
|
|
1989
2024
|
throw new Error("useApp must be used inside an App");
|
|
1990
2025
|
return e;
|
|
1991
2026
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return /* @__PURE__ */
|
|
2027
|
+
function Jt({ size: e = 16 }) {
|
|
2028
|
+
return /* @__PURE__ */ N(
|
|
1994
2029
|
"svg",
|
|
1995
2030
|
{
|
|
1996
2031
|
width: e,
|
|
@@ -2008,9 +2043,9 @@ function Vt({ size: e = 16 }) {
|
|
|
2008
2043
|
}
|
|
2009
2044
|
);
|
|
2010
2045
|
}
|
|
2011
|
-
function
|
|
2012
|
-
return /* @__PURE__ */
|
|
2013
|
-
/* @__PURE__ */
|
|
2046
|
+
function Zt({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: o }) {
|
|
2047
|
+
return /* @__PURE__ */ N("div", { className: "nc-app-title-bar", children: [
|
|
2048
|
+
/* @__PURE__ */ N("div", { className: "nc-app-title-bar-left", children: [
|
|
2014
2049
|
n && !o && /* @__PURE__ */ s(
|
|
2015
2050
|
"button",
|
|
2016
2051
|
{
|
|
@@ -2018,18 +2053,18 @@ function jt({ title: e, onClose: t, onBack: n, toolbar: r, hideBackButton: o })
|
|
|
2018
2053
|
onClick: n,
|
|
2019
2054
|
title: "Back",
|
|
2020
2055
|
"aria-label": "Go back",
|
|
2021
|
-
children: /* @__PURE__ */ s(
|
|
2056
|
+
children: /* @__PURE__ */ s(Jt, { size: 16 })
|
|
2022
2057
|
}
|
|
2023
2058
|
),
|
|
2024
2059
|
/* @__PURE__ */ s("span", { className: "nc-app-title-bar-title", children: e })
|
|
2025
2060
|
] }),
|
|
2026
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ N("div", { className: "nc-app-title-bar-right", children: [
|
|
2027
2062
|
r && /* @__PURE__ */ s("div", { className: "nc-app-title-bar-toolbar", children: r }),
|
|
2028
|
-
/* @__PURE__ */ s(
|
|
2063
|
+
/* @__PURE__ */ s(Ue, { onClick: t, "aria-label": "Close application" })
|
|
2029
2064
|
] })
|
|
2030
2065
|
] });
|
|
2031
2066
|
}
|
|
2032
|
-
class
|
|
2067
|
+
class Qt extends Me.Component {
|
|
2033
2068
|
constructor(t) {
|
|
2034
2069
|
super(t), this.state = { hasError: !1 };
|
|
2035
2070
|
}
|
|
@@ -2040,7 +2075,7 @@ class Gt extends Ne.Component {
|
|
|
2040
2075
|
console.error(`Error loading app ${this.props.appId}:`, t, n);
|
|
2041
2076
|
}
|
|
2042
2077
|
render() {
|
|
2043
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
2078
|
+
return this.state.hasError ? /* @__PURE__ */ N(
|
|
2044
2079
|
"div",
|
|
2045
2080
|
{
|
|
2046
2081
|
style: {
|
|
@@ -2062,39 +2097,39 @@ class Gt extends Ne.Component {
|
|
|
2062
2097
|
) : this.props.children;
|
|
2063
2098
|
}
|
|
2064
2099
|
}
|
|
2065
|
-
function
|
|
2066
|
-
const { t: r } =
|
|
2067
|
-
|
|
2100
|
+
function Ze({ appId: e, isActive: t, onClose: n }) {
|
|
2101
|
+
const { t: r } = J(), o = ie.get(e), [i, a] = E(""), [c, l] = E(null), [u, f] = E(null), [v, d] = E(!1), [m, y] = E(!1);
|
|
2102
|
+
Me.useEffect(() => {
|
|
2068
2103
|
o != null && o.titleKey && a(r(o.titleKey));
|
|
2069
2104
|
}, [o, r]);
|
|
2070
|
-
const
|
|
2105
|
+
const b = V((x) => {
|
|
2071
2106
|
a(x);
|
|
2072
|
-
}, []),
|
|
2107
|
+
}, []), w = V((x) => {
|
|
2073
2108
|
l(() => x);
|
|
2074
|
-
}, []),
|
|
2109
|
+
}, []), k = V(() => {
|
|
2075
2110
|
l(null);
|
|
2076
|
-
}, []),
|
|
2111
|
+
}, []), g = V((x) => {
|
|
2077
2112
|
f(x);
|
|
2078
|
-
}, []), p =
|
|
2113
|
+
}, []), p = V(() => {
|
|
2079
2114
|
f(null);
|
|
2080
|
-
}, []), h =
|
|
2115
|
+
}, []), h = V((x) => {
|
|
2081
2116
|
d(x);
|
|
2082
|
-
}, []), A =
|
|
2117
|
+
}, []), A = V((x) => {
|
|
2083
2118
|
y(x);
|
|
2084
|
-
}, []), C =
|
|
2085
|
-
setTitle:
|
|
2086
|
-
setBackHandler:
|
|
2087
|
-
clearBackHandler:
|
|
2088
|
-
setToolbar:
|
|
2119
|
+
}, []), C = we(() => ({
|
|
2120
|
+
setTitle: b,
|
|
2121
|
+
setBackHandler: w,
|
|
2122
|
+
clearBackHandler: k,
|
|
2123
|
+
setToolbar: g,
|
|
2089
2124
|
clearToolbar: p,
|
|
2090
2125
|
setHideBackButton: h,
|
|
2091
2126
|
setHideTitleBar: A,
|
|
2092
2127
|
close: n
|
|
2093
|
-
}), [
|
|
2128
|
+
}), [b, w, k, g, p, h, A, n]);
|
|
2094
2129
|
if (!o)
|
|
2095
2130
|
return null;
|
|
2096
|
-
const
|
|
2097
|
-
return /* @__PURE__ */
|
|
2131
|
+
const T = o.component, P = !o.hideTitleBar && !m;
|
|
2132
|
+
return /* @__PURE__ */ N(
|
|
2098
2133
|
"div",
|
|
2099
2134
|
{
|
|
2100
2135
|
style: {
|
|
@@ -2104,8 +2139,8 @@ function Ge({ appId: e, isActive: t, onClose: n }) {
|
|
|
2104
2139
|
minHeight: 0
|
|
2105
2140
|
},
|
|
2106
2141
|
children: [
|
|
2107
|
-
|
|
2108
|
-
|
|
2142
|
+
P && /* @__PURE__ */ s(
|
|
2143
|
+
Zt,
|
|
2109
2144
|
{
|
|
2110
2145
|
title: i,
|
|
2111
2146
|
onClose: n,
|
|
@@ -2117,7 +2152,7 @@ function Ge({ appId: e, isActive: t, onClose: n }) {
|
|
|
2117
2152
|
/* @__PURE__ */ s(
|
|
2118
2153
|
"div",
|
|
2119
2154
|
{
|
|
2120
|
-
className:
|
|
2155
|
+
className: P ? "nc-app-content-wrapper" : "",
|
|
2121
2156
|
style: {
|
|
2122
2157
|
padding: o.padding,
|
|
2123
2158
|
flex: 1,
|
|
@@ -2127,8 +2162,8 @@ function Ge({ appId: e, isActive: t, onClose: n }) {
|
|
|
2127
2162
|
backgroundColor: "var(--nc-bg-tertiary)",
|
|
2128
2163
|
position: "relative"
|
|
2129
2164
|
},
|
|
2130
|
-
children: /* @__PURE__ */ s(
|
|
2131
|
-
|
|
2165
|
+
children: /* @__PURE__ */ s(Je.Provider, { value: C, children: /* @__PURE__ */ s(Qt, { appId: e, children: /* @__PURE__ */ s(
|
|
2166
|
+
St,
|
|
2132
2167
|
{
|
|
2133
2168
|
fallback: /* @__PURE__ */ s(
|
|
2134
2169
|
"div",
|
|
@@ -2139,10 +2174,10 @@ function Ge({ appId: e, isActive: t, onClose: n }) {
|
|
|
2139
2174
|
justifyContent: "center",
|
|
2140
2175
|
flex: 1
|
|
2141
2176
|
},
|
|
2142
|
-
children: /* @__PURE__ */ s(
|
|
2177
|
+
children: /* @__PURE__ */ s(_e, {})
|
|
2143
2178
|
}
|
|
2144
2179
|
),
|
|
2145
|
-
children: /* @__PURE__ */ s(
|
|
2180
|
+
children: /* @__PURE__ */ s(T, {})
|
|
2146
2181
|
}
|
|
2147
2182
|
) }) })
|
|
2148
2183
|
}
|
|
@@ -2151,77 +2186,77 @@ function Ge({ appId: e, isActive: t, onClose: n }) {
|
|
|
2151
2186
|
}
|
|
2152
2187
|
);
|
|
2153
2188
|
}
|
|
2154
|
-
const
|
|
2189
|
+
const be = 768, ve = 1024, Qe = {
|
|
2155
2190
|
isMobile: !1,
|
|
2156
2191
|
isTablet: !1,
|
|
2157
2192
|
isDesktop: !0,
|
|
2158
2193
|
width: typeof window < "u" ? window.innerWidth : 1024,
|
|
2159
2194
|
height: typeof window < "u" ? window.innerHeight : 768
|
|
2160
|
-
},
|
|
2161
|
-
function
|
|
2195
|
+
}, et = ce(Qe);
|
|
2196
|
+
function mr({ children: e }) {
|
|
2162
2197
|
const [t, n] = E(() => {
|
|
2163
|
-
if (typeof window > "u") return
|
|
2198
|
+
if (typeof window > "u") return Qe;
|
|
2164
2199
|
const r = window.innerWidth, o = window.innerHeight;
|
|
2165
2200
|
return {
|
|
2166
|
-
isMobile: r <
|
|
2167
|
-
isTablet: r >=
|
|
2168
|
-
isDesktop: r >=
|
|
2201
|
+
isMobile: r < be,
|
|
2202
|
+
isTablet: r >= be && r < ve,
|
|
2203
|
+
isDesktop: r >= ve,
|
|
2169
2204
|
width: r,
|
|
2170
2205
|
height: o
|
|
2171
2206
|
};
|
|
2172
2207
|
});
|
|
2173
|
-
return
|
|
2208
|
+
return z(() => {
|
|
2174
2209
|
const r = () => {
|
|
2175
2210
|
const o = window.innerWidth, i = window.innerHeight;
|
|
2176
2211
|
n({
|
|
2177
|
-
isMobile: o <
|
|
2178
|
-
isTablet: o >=
|
|
2179
|
-
isDesktop: o >=
|
|
2212
|
+
isMobile: o < be,
|
|
2213
|
+
isTablet: o >= be && o < ve,
|
|
2214
|
+
isDesktop: o >= ve,
|
|
2180
2215
|
width: o,
|
|
2181
2216
|
height: i
|
|
2182
2217
|
});
|
|
2183
2218
|
};
|
|
2184
2219
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
2185
|
-
}, []), /* @__PURE__ */ s(
|
|
2220
|
+
}, []), /* @__PURE__ */ s(et.Provider, { value: t, children: e });
|
|
2186
2221
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2222
|
+
function tt() {
|
|
2223
|
+
return ne(et);
|
|
2189
2224
|
}
|
|
2190
|
-
const
|
|
2191
|
-
const t =
|
|
2225
|
+
const Ie = "-", en = (e) => {
|
|
2226
|
+
const t = nn(e), {
|
|
2192
2227
|
conflictingClassGroups: n,
|
|
2193
2228
|
conflictingClassGroupModifiers: r
|
|
2194
2229
|
} = e;
|
|
2195
2230
|
return {
|
|
2196
2231
|
getClassGroupId: (a) => {
|
|
2197
|
-
const c = a.split(
|
|
2198
|
-
return c[0] === "" && c.length !== 1 && c.shift(),
|
|
2232
|
+
const c = a.split(Ie);
|
|
2233
|
+
return c[0] === "" && c.length !== 1 && c.shift(), nt(c, t) || tn(a);
|
|
2199
2234
|
},
|
|
2200
2235
|
getConflictingClassGroupIds: (a, c) => {
|
|
2201
2236
|
const l = n[a] || [];
|
|
2202
2237
|
return c && r[a] ? [...l, ...r[a]] : l;
|
|
2203
2238
|
}
|
|
2204
2239
|
};
|
|
2205
|
-
},
|
|
2240
|
+
}, nt = (e, t) => {
|
|
2206
2241
|
var a;
|
|
2207
2242
|
if (e.length === 0)
|
|
2208
2243
|
return t.classGroupId;
|
|
2209
|
-
const n = e[0], r = t.nextPart.get(n), o = r ?
|
|
2244
|
+
const n = e[0], r = t.nextPart.get(n), o = r ? nt(e.slice(1), r) : void 0;
|
|
2210
2245
|
if (o)
|
|
2211
2246
|
return o;
|
|
2212
2247
|
if (t.validators.length === 0)
|
|
2213
2248
|
return;
|
|
2214
|
-
const i = e.join(
|
|
2249
|
+
const i = e.join(Ie);
|
|
2215
2250
|
return (a = t.validators.find(({
|
|
2216
2251
|
validator: c
|
|
2217
2252
|
}) => c(i))) == null ? void 0 : a.classGroupId;
|
|
2218
|
-
},
|
|
2219
|
-
if (
|
|
2220
|
-
const t =
|
|
2253
|
+
}, Ye = /^\[(.+)\]$/, tn = (e) => {
|
|
2254
|
+
if (Ye.test(e)) {
|
|
2255
|
+
const t = Ye.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
|
|
2221
2256
|
if (n)
|
|
2222
2257
|
return "arbitrary.." + n;
|
|
2223
2258
|
}
|
|
2224
|
-
},
|
|
2259
|
+
}, nn = (e) => {
|
|
2225
2260
|
const {
|
|
2226
2261
|
theme: t,
|
|
2227
2262
|
prefix: n
|
|
@@ -2229,19 +2264,19 @@ const Ae = "-", Yt = (e) => {
|
|
|
2229
2264
|
nextPart: /* @__PURE__ */ new Map(),
|
|
2230
2265
|
validators: []
|
|
2231
2266
|
};
|
|
2232
|
-
return
|
|
2233
|
-
|
|
2267
|
+
return on(Object.entries(e.classGroups), n).forEach(([i, a]) => {
|
|
2268
|
+
Ce(a, r, i, t);
|
|
2234
2269
|
}), r;
|
|
2235
|
-
},
|
|
2270
|
+
}, Ce = (e, t, n, r) => {
|
|
2236
2271
|
e.forEach((o) => {
|
|
2237
2272
|
if (typeof o == "string") {
|
|
2238
|
-
const i = o === "" ? t :
|
|
2273
|
+
const i = o === "" ? t : Ke(t, o);
|
|
2239
2274
|
i.classGroupId = n;
|
|
2240
2275
|
return;
|
|
2241
2276
|
}
|
|
2242
2277
|
if (typeof o == "function") {
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2278
|
+
if (rn(o)) {
|
|
2279
|
+
Ce(o(r), t, n, r);
|
|
2245
2280
|
return;
|
|
2246
2281
|
}
|
|
2247
2282
|
t.validators.push({
|
|
@@ -2251,21 +2286,21 @@ const Ae = "-", Yt = (e) => {
|
|
|
2251
2286
|
return;
|
|
2252
2287
|
}
|
|
2253
2288
|
Object.entries(o).forEach(([i, a]) => {
|
|
2254
|
-
|
|
2289
|
+
Ce(a, Ke(t, i), n, r);
|
|
2255
2290
|
});
|
|
2256
2291
|
});
|
|
2257
|
-
},
|
|
2292
|
+
}, Ke = (e, t) => {
|
|
2258
2293
|
let n = e;
|
|
2259
|
-
return t.split(
|
|
2294
|
+
return t.split(Ie).forEach((r) => {
|
|
2260
2295
|
n.nextPart.has(r) || n.nextPart.set(r, {
|
|
2261
2296
|
nextPart: /* @__PURE__ */ new Map(),
|
|
2262
2297
|
validators: []
|
|
2263
2298
|
}), n = n.nextPart.get(r);
|
|
2264
2299
|
}), n;
|
|
2265
|
-
},
|
|
2300
|
+
}, rn = (e) => e.isThemeGetter, on = (e, t) => t ? e.map(([n, r]) => {
|
|
2266
2301
|
const o = r.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([a, c]) => [t + a, c])) : i);
|
|
2267
2302
|
return [n, o];
|
|
2268
|
-
}) : e,
|
|
2303
|
+
}) : e, sn = (e) => {
|
|
2269
2304
|
if (e < 1)
|
|
2270
2305
|
return {
|
|
2271
2306
|
get: () => {
|
|
@@ -2289,40 +2324,40 @@ const Ae = "-", Yt = (e) => {
|
|
|
2289
2324
|
n.has(i) ? n.set(i, a) : o(i, a);
|
|
2290
2325
|
}
|
|
2291
2326
|
};
|
|
2292
|
-
},
|
|
2327
|
+
}, rt = "!", cn = (e) => {
|
|
2293
2328
|
const {
|
|
2294
2329
|
separator: t,
|
|
2295
2330
|
experimentalParseClassName: n
|
|
2296
2331
|
} = e, r = t.length === 1, o = t[0], i = t.length, a = (c) => {
|
|
2297
2332
|
const l = [];
|
|
2298
2333
|
let u = 0, f = 0, v;
|
|
2299
|
-
for (let
|
|
2300
|
-
let
|
|
2334
|
+
for (let w = 0; w < c.length; w++) {
|
|
2335
|
+
let k = c[w];
|
|
2301
2336
|
if (u === 0) {
|
|
2302
|
-
if (
|
|
2303
|
-
l.push(c.slice(f,
|
|
2337
|
+
if (k === o && (r || c.slice(w, w + i) === t)) {
|
|
2338
|
+
l.push(c.slice(f, w)), f = w + i;
|
|
2304
2339
|
continue;
|
|
2305
2340
|
}
|
|
2306
|
-
if (
|
|
2307
|
-
v =
|
|
2341
|
+
if (k === "/") {
|
|
2342
|
+
v = w;
|
|
2308
2343
|
continue;
|
|
2309
2344
|
}
|
|
2310
2345
|
}
|
|
2311
|
-
|
|
2346
|
+
k === "[" ? u++ : k === "]" && u--;
|
|
2312
2347
|
}
|
|
2313
|
-
const d = l.length === 0 ? c : c.substring(f), m = d.startsWith(
|
|
2348
|
+
const d = l.length === 0 ? c : c.substring(f), m = d.startsWith(rt), y = m ? d.substring(1) : d, b = v && v > f ? v - f : void 0;
|
|
2314
2349
|
return {
|
|
2315
2350
|
modifiers: l,
|
|
2316
2351
|
hasImportantModifier: m,
|
|
2317
2352
|
baseClassName: y,
|
|
2318
|
-
maybePostfixModifierPosition:
|
|
2353
|
+
maybePostfixModifierPosition: b
|
|
2319
2354
|
};
|
|
2320
2355
|
};
|
|
2321
2356
|
return n ? (c) => n({
|
|
2322
2357
|
className: c,
|
|
2323
2358
|
parseClassName: a
|
|
2324
2359
|
}) : a;
|
|
2325
|
-
},
|
|
2360
|
+
}, an = (e) => {
|
|
2326
2361
|
if (e.length <= 1)
|
|
2327
2362
|
return e;
|
|
2328
2363
|
const t = [];
|
|
@@ -2330,16 +2365,16 @@ const Ae = "-", Yt = (e) => {
|
|
|
2330
2365
|
return e.forEach((r) => {
|
|
2331
2366
|
r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
|
|
2332
2367
|
}), t.push(...n.sort()), t;
|
|
2333
|
-
},
|
|
2334
|
-
cache:
|
|
2335
|
-
parseClassName:
|
|
2336
|
-
...
|
|
2337
|
-
}),
|
|
2368
|
+
}, ln = (e) => ({
|
|
2369
|
+
cache: sn(e.cacheSize),
|
|
2370
|
+
parseClassName: cn(e),
|
|
2371
|
+
...en(e)
|
|
2372
|
+
}), dn = /\s+/, un = (e, t) => {
|
|
2338
2373
|
const {
|
|
2339
2374
|
parseClassName: n,
|
|
2340
2375
|
getClassGroupId: r,
|
|
2341
2376
|
getConflictingClassGroupIds: o
|
|
2342
|
-
} = t, i = [], a = e.trim().split(
|
|
2377
|
+
} = t, i = [], a = e.trim().split(dn);
|
|
2343
2378
|
let c = "";
|
|
2344
2379
|
for (let l = a.length - 1; l >= 0; l -= 1) {
|
|
2345
2380
|
const u = a[l], {
|
|
@@ -2348,102 +2383,102 @@ const Ae = "-", Yt = (e) => {
|
|
|
2348
2383
|
baseClassName: d,
|
|
2349
2384
|
maybePostfixModifierPosition: m
|
|
2350
2385
|
} = n(u);
|
|
2351
|
-
let y = !!m,
|
|
2352
|
-
if (!
|
|
2386
|
+
let y = !!m, b = r(y ? d.substring(0, m) : d);
|
|
2387
|
+
if (!b) {
|
|
2353
2388
|
if (!y) {
|
|
2354
2389
|
c = u + (c.length > 0 ? " " + c : c);
|
|
2355
2390
|
continue;
|
|
2356
2391
|
}
|
|
2357
|
-
if (
|
|
2392
|
+
if (b = r(d), !b) {
|
|
2358
2393
|
c = u + (c.length > 0 ? " " + c : c);
|
|
2359
2394
|
continue;
|
|
2360
2395
|
}
|
|
2361
2396
|
y = !1;
|
|
2362
2397
|
}
|
|
2363
|
-
const
|
|
2364
|
-
if (i.includes(
|
|
2398
|
+
const w = an(f).join(":"), k = v ? w + rt : w, g = k + b;
|
|
2399
|
+
if (i.includes(g))
|
|
2365
2400
|
continue;
|
|
2366
|
-
i.push(
|
|
2367
|
-
const p = o(
|
|
2401
|
+
i.push(g);
|
|
2402
|
+
const p = o(b, y);
|
|
2368
2403
|
for (let h = 0; h < p.length; ++h) {
|
|
2369
2404
|
const A = p[h];
|
|
2370
|
-
i.push(
|
|
2405
|
+
i.push(k + A);
|
|
2371
2406
|
}
|
|
2372
2407
|
c = u + (c.length > 0 ? " " + c : c);
|
|
2373
2408
|
}
|
|
2374
2409
|
return c;
|
|
2375
2410
|
};
|
|
2376
|
-
function
|
|
2411
|
+
function pn() {
|
|
2377
2412
|
let e = 0, t, n, r = "";
|
|
2378
2413
|
for (; e < arguments.length; )
|
|
2379
|
-
(t = arguments[e++]) && (n =
|
|
2414
|
+
(t = arguments[e++]) && (n = ot(t)) && (r && (r += " "), r += n);
|
|
2380
2415
|
return r;
|
|
2381
2416
|
}
|
|
2382
|
-
const
|
|
2417
|
+
const ot = (e) => {
|
|
2383
2418
|
if (typeof e == "string")
|
|
2384
2419
|
return e;
|
|
2385
2420
|
let t, n = "";
|
|
2386
2421
|
for (let r = 0; r < e.length; r++)
|
|
2387
|
-
e[r] && (t =
|
|
2422
|
+
e[r] && (t = ot(e[r])) && (n && (n += " "), n += t);
|
|
2388
2423
|
return n;
|
|
2389
2424
|
};
|
|
2390
|
-
function
|
|
2425
|
+
function fn(e, ...t) {
|
|
2391
2426
|
let n, r, o, i = a;
|
|
2392
2427
|
function a(l) {
|
|
2393
2428
|
const u = t.reduce((f, v) => v(f), e());
|
|
2394
|
-
return n =
|
|
2429
|
+
return n = ln(u), r = n.cache.get, o = n.cache.set, i = c, c(l);
|
|
2395
2430
|
}
|
|
2396
2431
|
function c(l) {
|
|
2397
2432
|
const u = r(l);
|
|
2398
2433
|
if (u)
|
|
2399
2434
|
return u;
|
|
2400
|
-
const f =
|
|
2435
|
+
const f = un(l, n);
|
|
2401
2436
|
return o(l, f), f;
|
|
2402
2437
|
}
|
|
2403
2438
|
return function() {
|
|
2404
|
-
return i(
|
|
2439
|
+
return i(pn.apply(null, arguments));
|
|
2405
2440
|
};
|
|
2406
2441
|
}
|
|
2407
2442
|
const D = (e) => {
|
|
2408
2443
|
const t = (n) => n[e] || [];
|
|
2409
2444
|
return t.isThemeGetter = !0, t;
|
|
2410
|
-
},
|
|
2411
|
-
const r =
|
|
2445
|
+
}, st = /^\[(?:([a-z-]+):)?(.+)\]$/i, hn = /^\d+\/\d+$/, mn = /* @__PURE__ */ new Set(["px", "full", "screen"]), gn = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, bn = /\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$/, vn = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, wn = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, yn = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, U = (e) => se(e) || mn.has(e) || hn.test(e), ee = (e) => ae(e, "length", Mn), se = (e) => !!e && !Number.isNaN(Number(e)), Ne = (e) => ae(e, "number", se), le = (e) => !!e && Number.isInteger(Number(e)), xn = (e) => e.endsWith("%") && se(e.slice(0, -1)), M = (e) => st.test(e), te = (e) => gn.test(e), kn = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Nn = (e) => ae(e, kn, it), An = (e) => ae(e, "position", it), Sn = /* @__PURE__ */ new Set(["image", "url"]), Cn = (e) => ae(e, Sn, Rn), $n = (e) => ae(e, "", In), de = () => !0, ae = (e, t, n) => {
|
|
2446
|
+
const r = st.exec(e);
|
|
2412
2447
|
return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
|
|
2413
|
-
},
|
|
2448
|
+
}, Mn = (e) => (
|
|
2414
2449
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
2415
2450
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
2416
2451
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2417
|
-
|
|
2418
|
-
),
|
|
2419
|
-
const e = D("colors"), t = D("spacing"), n = D("blur"), r = D("brightness"), o = D("borderColor"), i = D("borderRadius"), a = D("borderSpacing"), c = D("borderWidth"), l = D("contrast"), u = D("grayscale"), f = D("hueRotate"), v = D("invert"), d = D("gap"), m = D("gradientColorStops"), y = D("gradientColorStopPositions"),
|
|
2452
|
+
bn.test(e) && !vn.test(e)
|
|
2453
|
+
), it = () => !1, In = (e) => wn.test(e), Rn = (e) => yn.test(e), En = () => {
|
|
2454
|
+
const e = D("colors"), t = D("spacing"), n = D("blur"), r = D("brightness"), o = D("borderColor"), i = D("borderRadius"), a = D("borderSpacing"), c = D("borderWidth"), l = D("contrast"), u = D("grayscale"), f = D("hueRotate"), v = D("invert"), d = D("gap"), m = D("gradientColorStops"), y = D("gradientColorStopPositions"), b = D("inset"), w = D("margin"), k = D("opacity"), g = D("padding"), p = D("saturate"), h = D("scale"), A = D("sepia"), C = D("skew"), T = D("space"), P = D("translate"), x = () => ["auto", "contain", "none"], I = () => ["auto", "hidden", "clip", "visible", "scroll"], S = () => ["auto", M, t], $ = () => [M, t], L = () => ["", U, ee], O = () => ["auto", se, M], F = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], j = () => ["solid", "dashed", "dotted", "double", "none"], R = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], B = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], W = () => ["", "0", M], G = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], Y = () => [se, M];
|
|
2420
2455
|
return {
|
|
2421
2456
|
cacheSize: 500,
|
|
2422
2457
|
separator: ":",
|
|
2423
2458
|
theme: {
|
|
2424
2459
|
colors: [de],
|
|
2425
|
-
spacing: [
|
|
2426
|
-
blur: ["none", "",
|
|
2427
|
-
brightness:
|
|
2460
|
+
spacing: [U, ee],
|
|
2461
|
+
blur: ["none", "", te, M],
|
|
2462
|
+
brightness: Y(),
|
|
2428
2463
|
borderColor: [e],
|
|
2429
|
-
borderRadius: ["none", "", "full",
|
|
2464
|
+
borderRadius: ["none", "", "full", te, M],
|
|
2430
2465
|
borderSpacing: $(),
|
|
2431
2466
|
borderWidth: L(),
|
|
2432
|
-
contrast:
|
|
2467
|
+
contrast: Y(),
|
|
2433
2468
|
grayscale: W(),
|
|
2434
|
-
hueRotate:
|
|
2469
|
+
hueRotate: Y(),
|
|
2435
2470
|
invert: W(),
|
|
2436
2471
|
gap: $(),
|
|
2437
2472
|
gradientColorStops: [e],
|
|
2438
|
-
gradientColorStopPositions: [
|
|
2473
|
+
gradientColorStopPositions: [xn, ee],
|
|
2439
2474
|
inset: S(),
|
|
2440
2475
|
margin: S(),
|
|
2441
|
-
opacity:
|
|
2476
|
+
opacity: Y(),
|
|
2442
2477
|
padding: $(),
|
|
2443
|
-
saturate:
|
|
2444
|
-
scale:
|
|
2478
|
+
saturate: Y(),
|
|
2479
|
+
scale: Y(),
|
|
2445
2480
|
sepia: W(),
|
|
2446
|
-
skew:
|
|
2481
|
+
skew: Y(),
|
|
2447
2482
|
space: $(),
|
|
2448
2483
|
translate: $()
|
|
2449
2484
|
},
|
|
@@ -2466,21 +2501,21 @@ const D = (e) => {
|
|
|
2466
2501
|
* @see https://tailwindcss.com/docs/columns
|
|
2467
2502
|
*/
|
|
2468
2503
|
columns: [{
|
|
2469
|
-
columns: [
|
|
2504
|
+
columns: [te]
|
|
2470
2505
|
}],
|
|
2471
2506
|
/**
|
|
2472
2507
|
* Break After
|
|
2473
2508
|
* @see https://tailwindcss.com/docs/break-after
|
|
2474
2509
|
*/
|
|
2475
2510
|
"break-after": [{
|
|
2476
|
-
"break-after":
|
|
2511
|
+
"break-after": G()
|
|
2477
2512
|
}],
|
|
2478
2513
|
/**
|
|
2479
2514
|
* Break Before
|
|
2480
2515
|
* @see https://tailwindcss.com/docs/break-before
|
|
2481
2516
|
*/
|
|
2482
2517
|
"break-before": [{
|
|
2483
|
-
"break-before":
|
|
2518
|
+
"break-before": G()
|
|
2484
2519
|
}],
|
|
2485
2520
|
/**
|
|
2486
2521
|
* Break Inside
|
|
@@ -2539,7 +2574,7 @@ const D = (e) => {
|
|
|
2539
2574
|
* @see https://tailwindcss.com/docs/object-position
|
|
2540
2575
|
*/
|
|
2541
2576
|
"object-position": [{
|
|
2542
|
-
object: [...
|
|
2577
|
+
object: [...F(), M]
|
|
2543
2578
|
}],
|
|
2544
2579
|
/**
|
|
2545
2580
|
* Overflow
|
|
@@ -2593,63 +2628,63 @@ const D = (e) => {
|
|
|
2593
2628
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2594
2629
|
*/
|
|
2595
2630
|
inset: [{
|
|
2596
|
-
inset: [
|
|
2631
|
+
inset: [b]
|
|
2597
2632
|
}],
|
|
2598
2633
|
/**
|
|
2599
2634
|
* Right / Left
|
|
2600
2635
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2601
2636
|
*/
|
|
2602
2637
|
"inset-x": [{
|
|
2603
|
-
"inset-x": [
|
|
2638
|
+
"inset-x": [b]
|
|
2604
2639
|
}],
|
|
2605
2640
|
/**
|
|
2606
2641
|
* Top / Bottom
|
|
2607
2642
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2608
2643
|
*/
|
|
2609
2644
|
"inset-y": [{
|
|
2610
|
-
"inset-y": [
|
|
2645
|
+
"inset-y": [b]
|
|
2611
2646
|
}],
|
|
2612
2647
|
/**
|
|
2613
2648
|
* Start
|
|
2614
2649
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2615
2650
|
*/
|
|
2616
2651
|
start: [{
|
|
2617
|
-
start: [
|
|
2652
|
+
start: [b]
|
|
2618
2653
|
}],
|
|
2619
2654
|
/**
|
|
2620
2655
|
* End
|
|
2621
2656
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2622
2657
|
*/
|
|
2623
2658
|
end: [{
|
|
2624
|
-
end: [
|
|
2659
|
+
end: [b]
|
|
2625
2660
|
}],
|
|
2626
2661
|
/**
|
|
2627
2662
|
* Top
|
|
2628
2663
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2629
2664
|
*/
|
|
2630
2665
|
top: [{
|
|
2631
|
-
top: [
|
|
2666
|
+
top: [b]
|
|
2632
2667
|
}],
|
|
2633
2668
|
/**
|
|
2634
2669
|
* Right
|
|
2635
2670
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2636
2671
|
*/
|
|
2637
2672
|
right: [{
|
|
2638
|
-
right: [
|
|
2673
|
+
right: [b]
|
|
2639
2674
|
}],
|
|
2640
2675
|
/**
|
|
2641
2676
|
* Bottom
|
|
2642
2677
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2643
2678
|
*/
|
|
2644
2679
|
bottom: [{
|
|
2645
|
-
bottom: [
|
|
2680
|
+
bottom: [b]
|
|
2646
2681
|
}],
|
|
2647
2682
|
/**
|
|
2648
2683
|
* Left
|
|
2649
2684
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2650
2685
|
*/
|
|
2651
2686
|
left: [{
|
|
2652
|
-
left: [
|
|
2687
|
+
left: [b]
|
|
2653
2688
|
}],
|
|
2654
2689
|
/**
|
|
2655
2690
|
* Visibility
|
|
@@ -2734,14 +2769,14 @@ const D = (e) => {
|
|
|
2734
2769
|
* @see https://tailwindcss.com/docs/grid-column
|
|
2735
2770
|
*/
|
|
2736
2771
|
"col-start": [{
|
|
2737
|
-
"col-start":
|
|
2772
|
+
"col-start": O()
|
|
2738
2773
|
}],
|
|
2739
2774
|
/**
|
|
2740
2775
|
* Grid Column End
|
|
2741
2776
|
* @see https://tailwindcss.com/docs/grid-column
|
|
2742
2777
|
*/
|
|
2743
2778
|
"col-end": [{
|
|
2744
|
-
"col-end":
|
|
2779
|
+
"col-end": O()
|
|
2745
2780
|
}],
|
|
2746
2781
|
/**
|
|
2747
2782
|
* Grid Template Rows
|
|
@@ -2764,14 +2799,14 @@ const D = (e) => {
|
|
|
2764
2799
|
* @see https://tailwindcss.com/docs/grid-row
|
|
2765
2800
|
*/
|
|
2766
2801
|
"row-start": [{
|
|
2767
|
-
"row-start":
|
|
2802
|
+
"row-start": O()
|
|
2768
2803
|
}],
|
|
2769
2804
|
/**
|
|
2770
2805
|
* Grid Row End
|
|
2771
2806
|
* @see https://tailwindcss.com/docs/grid-row
|
|
2772
2807
|
*/
|
|
2773
2808
|
"row-end": [{
|
|
2774
|
-
"row-end":
|
|
2809
|
+
"row-end": O()
|
|
2775
2810
|
}],
|
|
2776
2811
|
/**
|
|
2777
2812
|
* Grid Auto Flow
|
|
@@ -2820,7 +2855,7 @@ const D = (e) => {
|
|
|
2820
2855
|
* @see https://tailwindcss.com/docs/justify-content
|
|
2821
2856
|
*/
|
|
2822
2857
|
"justify-content": [{
|
|
2823
|
-
justify: ["normal", ...
|
|
2858
|
+
justify: ["normal", ...B()]
|
|
2824
2859
|
}],
|
|
2825
2860
|
/**
|
|
2826
2861
|
* Justify Items
|
|
@@ -2841,7 +2876,7 @@ const D = (e) => {
|
|
|
2841
2876
|
* @see https://tailwindcss.com/docs/align-content
|
|
2842
2877
|
*/
|
|
2843
2878
|
"align-content": [{
|
|
2844
|
-
content: ["normal", ...
|
|
2879
|
+
content: ["normal", ...B(), "baseline"]
|
|
2845
2880
|
}],
|
|
2846
2881
|
/**
|
|
2847
2882
|
* Align Items
|
|
@@ -2862,7 +2897,7 @@ const D = (e) => {
|
|
|
2862
2897
|
* @see https://tailwindcss.com/docs/place-content
|
|
2863
2898
|
*/
|
|
2864
2899
|
"place-content": [{
|
|
2865
|
-
"place-content": [...
|
|
2900
|
+
"place-content": [...B(), "baseline"]
|
|
2866
2901
|
}],
|
|
2867
2902
|
/**
|
|
2868
2903
|
* Place Items
|
|
@@ -2884,133 +2919,133 @@ const D = (e) => {
|
|
|
2884
2919
|
* @see https://tailwindcss.com/docs/padding
|
|
2885
2920
|
*/
|
|
2886
2921
|
p: [{
|
|
2887
|
-
p: [
|
|
2922
|
+
p: [g]
|
|
2888
2923
|
}],
|
|
2889
2924
|
/**
|
|
2890
2925
|
* Padding X
|
|
2891
2926
|
* @see https://tailwindcss.com/docs/padding
|
|
2892
2927
|
*/
|
|
2893
2928
|
px: [{
|
|
2894
|
-
px: [
|
|
2929
|
+
px: [g]
|
|
2895
2930
|
}],
|
|
2896
2931
|
/**
|
|
2897
2932
|
* Padding Y
|
|
2898
2933
|
* @see https://tailwindcss.com/docs/padding
|
|
2899
2934
|
*/
|
|
2900
2935
|
py: [{
|
|
2901
|
-
py: [
|
|
2936
|
+
py: [g]
|
|
2902
2937
|
}],
|
|
2903
2938
|
/**
|
|
2904
2939
|
* Padding Start
|
|
2905
2940
|
* @see https://tailwindcss.com/docs/padding
|
|
2906
2941
|
*/
|
|
2907
2942
|
ps: [{
|
|
2908
|
-
ps: [
|
|
2943
|
+
ps: [g]
|
|
2909
2944
|
}],
|
|
2910
2945
|
/**
|
|
2911
2946
|
* Padding End
|
|
2912
2947
|
* @see https://tailwindcss.com/docs/padding
|
|
2913
2948
|
*/
|
|
2914
2949
|
pe: [{
|
|
2915
|
-
pe: [
|
|
2950
|
+
pe: [g]
|
|
2916
2951
|
}],
|
|
2917
2952
|
/**
|
|
2918
2953
|
* Padding Top
|
|
2919
2954
|
* @see https://tailwindcss.com/docs/padding
|
|
2920
2955
|
*/
|
|
2921
2956
|
pt: [{
|
|
2922
|
-
pt: [
|
|
2957
|
+
pt: [g]
|
|
2923
2958
|
}],
|
|
2924
2959
|
/**
|
|
2925
2960
|
* Padding Right
|
|
2926
2961
|
* @see https://tailwindcss.com/docs/padding
|
|
2927
2962
|
*/
|
|
2928
2963
|
pr: [{
|
|
2929
|
-
pr: [
|
|
2964
|
+
pr: [g]
|
|
2930
2965
|
}],
|
|
2931
2966
|
/**
|
|
2932
2967
|
* Padding Bottom
|
|
2933
2968
|
* @see https://tailwindcss.com/docs/padding
|
|
2934
2969
|
*/
|
|
2935
2970
|
pb: [{
|
|
2936
|
-
pb: [
|
|
2971
|
+
pb: [g]
|
|
2937
2972
|
}],
|
|
2938
2973
|
/**
|
|
2939
2974
|
* Padding Left
|
|
2940
2975
|
* @see https://tailwindcss.com/docs/padding
|
|
2941
2976
|
*/
|
|
2942
2977
|
pl: [{
|
|
2943
|
-
pl: [
|
|
2978
|
+
pl: [g]
|
|
2944
2979
|
}],
|
|
2945
2980
|
/**
|
|
2946
2981
|
* Margin
|
|
2947
2982
|
* @see https://tailwindcss.com/docs/margin
|
|
2948
2983
|
*/
|
|
2949
2984
|
m: [{
|
|
2950
|
-
m: [
|
|
2985
|
+
m: [w]
|
|
2951
2986
|
}],
|
|
2952
2987
|
/**
|
|
2953
2988
|
* Margin X
|
|
2954
2989
|
* @see https://tailwindcss.com/docs/margin
|
|
2955
2990
|
*/
|
|
2956
2991
|
mx: [{
|
|
2957
|
-
mx: [
|
|
2992
|
+
mx: [w]
|
|
2958
2993
|
}],
|
|
2959
2994
|
/**
|
|
2960
2995
|
* Margin Y
|
|
2961
2996
|
* @see https://tailwindcss.com/docs/margin
|
|
2962
2997
|
*/
|
|
2963
2998
|
my: [{
|
|
2964
|
-
my: [
|
|
2999
|
+
my: [w]
|
|
2965
3000
|
}],
|
|
2966
3001
|
/**
|
|
2967
3002
|
* Margin Start
|
|
2968
3003
|
* @see https://tailwindcss.com/docs/margin
|
|
2969
3004
|
*/
|
|
2970
3005
|
ms: [{
|
|
2971
|
-
ms: [
|
|
3006
|
+
ms: [w]
|
|
2972
3007
|
}],
|
|
2973
3008
|
/**
|
|
2974
3009
|
* Margin End
|
|
2975
3010
|
* @see https://tailwindcss.com/docs/margin
|
|
2976
3011
|
*/
|
|
2977
3012
|
me: [{
|
|
2978
|
-
me: [
|
|
3013
|
+
me: [w]
|
|
2979
3014
|
}],
|
|
2980
3015
|
/**
|
|
2981
3016
|
* Margin Top
|
|
2982
3017
|
* @see https://tailwindcss.com/docs/margin
|
|
2983
3018
|
*/
|
|
2984
3019
|
mt: [{
|
|
2985
|
-
mt: [
|
|
3020
|
+
mt: [w]
|
|
2986
3021
|
}],
|
|
2987
3022
|
/**
|
|
2988
3023
|
* Margin Right
|
|
2989
3024
|
* @see https://tailwindcss.com/docs/margin
|
|
2990
3025
|
*/
|
|
2991
3026
|
mr: [{
|
|
2992
|
-
mr: [
|
|
3027
|
+
mr: [w]
|
|
2993
3028
|
}],
|
|
2994
3029
|
/**
|
|
2995
3030
|
* Margin Bottom
|
|
2996
3031
|
* @see https://tailwindcss.com/docs/margin
|
|
2997
3032
|
*/
|
|
2998
3033
|
mb: [{
|
|
2999
|
-
mb: [
|
|
3034
|
+
mb: [w]
|
|
3000
3035
|
}],
|
|
3001
3036
|
/**
|
|
3002
3037
|
* Margin Left
|
|
3003
3038
|
* @see https://tailwindcss.com/docs/margin
|
|
3004
3039
|
*/
|
|
3005
3040
|
ml: [{
|
|
3006
|
-
ml: [
|
|
3041
|
+
ml: [w]
|
|
3007
3042
|
}],
|
|
3008
3043
|
/**
|
|
3009
3044
|
* Space Between X
|
|
3010
3045
|
* @see https://tailwindcss.com/docs/space
|
|
3011
3046
|
*/
|
|
3012
3047
|
"space-x": [{
|
|
3013
|
-
"space-x": [
|
|
3048
|
+
"space-x": [T]
|
|
3014
3049
|
}],
|
|
3015
3050
|
/**
|
|
3016
3051
|
* Space Between X Reverse
|
|
@@ -3022,7 +3057,7 @@ const D = (e) => {
|
|
|
3022
3057
|
* @see https://tailwindcss.com/docs/space
|
|
3023
3058
|
*/
|
|
3024
3059
|
"space-y": [{
|
|
3025
|
-
"space-y": [
|
|
3060
|
+
"space-y": [T]
|
|
3026
3061
|
}],
|
|
3027
3062
|
/**
|
|
3028
3063
|
* Space Between Y Reverse
|
|
@@ -3050,8 +3085,8 @@ const D = (e) => {
|
|
|
3050
3085
|
*/
|
|
3051
3086
|
"max-w": [{
|
|
3052
3087
|
"max-w": [M, t, "none", "full", "min", "max", "fit", "prose", {
|
|
3053
|
-
screen: [
|
|
3054
|
-
},
|
|
3088
|
+
screen: [te]
|
|
3089
|
+
}, te]
|
|
3055
3090
|
}],
|
|
3056
3091
|
/**
|
|
3057
3092
|
* Height
|
|
@@ -3087,7 +3122,7 @@ const D = (e) => {
|
|
|
3087
3122
|
* @see https://tailwindcss.com/docs/font-size
|
|
3088
3123
|
*/
|
|
3089
3124
|
"font-size": [{
|
|
3090
|
-
text: ["base",
|
|
3125
|
+
text: ["base", te, ee]
|
|
3091
3126
|
}],
|
|
3092
3127
|
/**
|
|
3093
3128
|
* Font Smoothing
|
|
@@ -3104,7 +3139,7 @@ const D = (e) => {
|
|
|
3104
3139
|
* @see https://tailwindcss.com/docs/font-weight
|
|
3105
3140
|
*/
|
|
3106
3141
|
"font-weight": [{
|
|
3107
|
-
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black",
|
|
3142
|
+
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", Ne]
|
|
3108
3143
|
}],
|
|
3109
3144
|
/**
|
|
3110
3145
|
* Font Family
|
|
@@ -3155,14 +3190,14 @@ const D = (e) => {
|
|
|
3155
3190
|
* @see https://tailwindcss.com/docs/line-clamp
|
|
3156
3191
|
*/
|
|
3157
3192
|
"line-clamp": [{
|
|
3158
|
-
"line-clamp": ["none",
|
|
3193
|
+
"line-clamp": ["none", se, Ne]
|
|
3159
3194
|
}],
|
|
3160
3195
|
/**
|
|
3161
3196
|
* Line Height
|
|
3162
3197
|
* @see https://tailwindcss.com/docs/line-height
|
|
3163
3198
|
*/
|
|
3164
3199
|
leading: [{
|
|
3165
|
-
leading: ["none", "tight", "snug", "normal", "relaxed", "loose",
|
|
3200
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", U, M]
|
|
3166
3201
|
}],
|
|
3167
3202
|
/**
|
|
3168
3203
|
* List Style Image
|
|
@@ -3198,7 +3233,7 @@ const D = (e) => {
|
|
|
3198
3233
|
* @see https://tailwindcss.com/docs/placeholder-opacity
|
|
3199
3234
|
*/
|
|
3200
3235
|
"placeholder-opacity": [{
|
|
3201
|
-
"placeholder-opacity": [
|
|
3236
|
+
"placeholder-opacity": [k]
|
|
3202
3237
|
}],
|
|
3203
3238
|
/**
|
|
3204
3239
|
* Text Alignment
|
|
@@ -3219,7 +3254,7 @@ const D = (e) => {
|
|
|
3219
3254
|
* @see https://tailwindcss.com/docs/text-opacity
|
|
3220
3255
|
*/
|
|
3221
3256
|
"text-opacity": [{
|
|
3222
|
-
"text-opacity": [
|
|
3257
|
+
"text-opacity": [k]
|
|
3223
3258
|
}],
|
|
3224
3259
|
/**
|
|
3225
3260
|
* Text Decoration
|
|
@@ -3231,21 +3266,21 @@ const D = (e) => {
|
|
|
3231
3266
|
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
3232
3267
|
*/
|
|
3233
3268
|
"text-decoration-style": [{
|
|
3234
|
-
decoration: [...
|
|
3269
|
+
decoration: [...j(), "wavy"]
|
|
3235
3270
|
}],
|
|
3236
3271
|
/**
|
|
3237
3272
|
* Text Decoration Thickness
|
|
3238
3273
|
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
3239
3274
|
*/
|
|
3240
3275
|
"text-decoration-thickness": [{
|
|
3241
|
-
decoration: ["auto", "from-font",
|
|
3276
|
+
decoration: ["auto", "from-font", U, ee]
|
|
3242
3277
|
}],
|
|
3243
3278
|
/**
|
|
3244
3279
|
* Text Underline Offset
|
|
3245
3280
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
3246
3281
|
*/
|
|
3247
3282
|
"underline-offset": [{
|
|
3248
|
-
"underline-offset": ["auto",
|
|
3283
|
+
"underline-offset": ["auto", U, M]
|
|
3249
3284
|
}],
|
|
3250
3285
|
/**
|
|
3251
3286
|
* Text Decoration Color
|
|
@@ -3334,7 +3369,7 @@ const D = (e) => {
|
|
|
3334
3369
|
* @see https://tailwindcss.com/docs/background-opacity
|
|
3335
3370
|
*/
|
|
3336
3371
|
"bg-opacity": [{
|
|
3337
|
-
"bg-opacity": [
|
|
3372
|
+
"bg-opacity": [k]
|
|
3338
3373
|
}],
|
|
3339
3374
|
/**
|
|
3340
3375
|
* Background Origin
|
|
@@ -3348,7 +3383,7 @@ const D = (e) => {
|
|
|
3348
3383
|
* @see https://tailwindcss.com/docs/background-position
|
|
3349
3384
|
*/
|
|
3350
3385
|
"bg-position": [{
|
|
3351
|
-
bg: [...
|
|
3386
|
+
bg: [...F(), An]
|
|
3352
3387
|
}],
|
|
3353
3388
|
/**
|
|
3354
3389
|
* Background Repeat
|
|
@@ -3364,7 +3399,7 @@ const D = (e) => {
|
|
|
3364
3399
|
* @see https://tailwindcss.com/docs/background-size
|
|
3365
3400
|
*/
|
|
3366
3401
|
"bg-size": [{
|
|
3367
|
-
bg: ["auto", "cover", "contain",
|
|
3402
|
+
bg: ["auto", "cover", "contain", Nn]
|
|
3368
3403
|
}],
|
|
3369
3404
|
/**
|
|
3370
3405
|
* Background Image
|
|
@@ -3373,7 +3408,7 @@ const D = (e) => {
|
|
|
3373
3408
|
"bg-image": [{
|
|
3374
3409
|
bg: ["none", {
|
|
3375
3410
|
"gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
3376
|
-
},
|
|
3411
|
+
}, Cn]
|
|
3377
3412
|
}],
|
|
3378
3413
|
/**
|
|
3379
3414
|
* Background Color
|
|
@@ -3598,14 +3633,14 @@ const D = (e) => {
|
|
|
3598
3633
|
* @see https://tailwindcss.com/docs/border-opacity
|
|
3599
3634
|
*/
|
|
3600
3635
|
"border-opacity": [{
|
|
3601
|
-
"border-opacity": [
|
|
3636
|
+
"border-opacity": [k]
|
|
3602
3637
|
}],
|
|
3603
3638
|
/**
|
|
3604
3639
|
* Border Style
|
|
3605
3640
|
* @see https://tailwindcss.com/docs/border-style
|
|
3606
3641
|
*/
|
|
3607
3642
|
"border-style": [{
|
|
3608
|
-
border: [...
|
|
3643
|
+
border: [...j(), "hidden"]
|
|
3609
3644
|
}],
|
|
3610
3645
|
/**
|
|
3611
3646
|
* Divide Width X
|
|
@@ -3636,14 +3671,14 @@ const D = (e) => {
|
|
|
3636
3671
|
* @see https://tailwindcss.com/docs/divide-opacity
|
|
3637
3672
|
*/
|
|
3638
3673
|
"divide-opacity": [{
|
|
3639
|
-
"divide-opacity": [
|
|
3674
|
+
"divide-opacity": [k]
|
|
3640
3675
|
}],
|
|
3641
3676
|
/**
|
|
3642
3677
|
* Divide Style
|
|
3643
3678
|
* @see https://tailwindcss.com/docs/divide-style
|
|
3644
3679
|
*/
|
|
3645
3680
|
"divide-style": [{
|
|
3646
|
-
divide:
|
|
3681
|
+
divide: j()
|
|
3647
3682
|
}],
|
|
3648
3683
|
/**
|
|
3649
3684
|
* Border Color
|
|
@@ -3720,21 +3755,21 @@ const D = (e) => {
|
|
|
3720
3755
|
* @see https://tailwindcss.com/docs/outline-style
|
|
3721
3756
|
*/
|
|
3722
3757
|
"outline-style": [{
|
|
3723
|
-
outline: ["", ...
|
|
3758
|
+
outline: ["", ...j()]
|
|
3724
3759
|
}],
|
|
3725
3760
|
/**
|
|
3726
3761
|
* Outline Offset
|
|
3727
3762
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
3728
3763
|
*/
|
|
3729
3764
|
"outline-offset": [{
|
|
3730
|
-
"outline-offset": [
|
|
3765
|
+
"outline-offset": [U, M]
|
|
3731
3766
|
}],
|
|
3732
3767
|
/**
|
|
3733
3768
|
* Outline Width
|
|
3734
3769
|
* @see https://tailwindcss.com/docs/outline-width
|
|
3735
3770
|
*/
|
|
3736
3771
|
"outline-w": [{
|
|
3737
|
-
outline: [
|
|
3772
|
+
outline: [U, ee]
|
|
3738
3773
|
}],
|
|
3739
3774
|
/**
|
|
3740
3775
|
* Outline Color
|
|
@@ -3767,14 +3802,14 @@ const D = (e) => {
|
|
|
3767
3802
|
* @see https://tailwindcss.com/docs/ring-opacity
|
|
3768
3803
|
*/
|
|
3769
3804
|
"ring-opacity": [{
|
|
3770
|
-
"ring-opacity": [
|
|
3805
|
+
"ring-opacity": [k]
|
|
3771
3806
|
}],
|
|
3772
3807
|
/**
|
|
3773
3808
|
* Ring Offset Width
|
|
3774
3809
|
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
3775
3810
|
*/
|
|
3776
3811
|
"ring-offset-w": [{
|
|
3777
|
-
"ring-offset": [
|
|
3812
|
+
"ring-offset": [U, ee]
|
|
3778
3813
|
}],
|
|
3779
3814
|
/**
|
|
3780
3815
|
* Ring Offset Color
|
|
@@ -3789,7 +3824,7 @@ const D = (e) => {
|
|
|
3789
3824
|
* @see https://tailwindcss.com/docs/box-shadow
|
|
3790
3825
|
*/
|
|
3791
3826
|
shadow: [{
|
|
3792
|
-
shadow: ["", "inner", "none",
|
|
3827
|
+
shadow: ["", "inner", "none", te, $n]
|
|
3793
3828
|
}],
|
|
3794
3829
|
/**
|
|
3795
3830
|
* Box Shadow Color
|
|
@@ -3803,7 +3838,7 @@ const D = (e) => {
|
|
|
3803
3838
|
* @see https://tailwindcss.com/docs/opacity
|
|
3804
3839
|
*/
|
|
3805
3840
|
opacity: [{
|
|
3806
|
-
opacity: [
|
|
3841
|
+
opacity: [k]
|
|
3807
3842
|
}],
|
|
3808
3843
|
/**
|
|
3809
3844
|
* Mix Blend Mode
|
|
@@ -3854,7 +3889,7 @@ const D = (e) => {
|
|
|
3854
3889
|
* @see https://tailwindcss.com/docs/drop-shadow
|
|
3855
3890
|
*/
|
|
3856
3891
|
"drop-shadow": [{
|
|
3857
|
-
"drop-shadow": ["", "none",
|
|
3892
|
+
"drop-shadow": ["", "none", te, M]
|
|
3858
3893
|
}],
|
|
3859
3894
|
/**
|
|
3860
3895
|
* Grayscale
|
|
@@ -3946,7 +3981,7 @@ const D = (e) => {
|
|
|
3946
3981
|
* @see https://tailwindcss.com/docs/backdrop-opacity
|
|
3947
3982
|
*/
|
|
3948
3983
|
"backdrop-opacity": [{
|
|
3949
|
-
"backdrop-opacity": [
|
|
3984
|
+
"backdrop-opacity": [k]
|
|
3950
3985
|
}],
|
|
3951
3986
|
/**
|
|
3952
3987
|
* Backdrop Saturate
|
|
@@ -4018,7 +4053,7 @@ const D = (e) => {
|
|
|
4018
4053
|
* @see https://tailwindcss.com/docs/transition-duration
|
|
4019
4054
|
*/
|
|
4020
4055
|
duration: [{
|
|
4021
|
-
duration:
|
|
4056
|
+
duration: Y()
|
|
4022
4057
|
}],
|
|
4023
4058
|
/**
|
|
4024
4059
|
* Transition Timing Function
|
|
@@ -4032,7 +4067,7 @@ const D = (e) => {
|
|
|
4032
4067
|
* @see https://tailwindcss.com/docs/transition-delay
|
|
4033
4068
|
*/
|
|
4034
4069
|
delay: [{
|
|
4035
|
-
delay:
|
|
4070
|
+
delay: Y()
|
|
4036
4071
|
}],
|
|
4037
4072
|
/**
|
|
4038
4073
|
* Animation
|
|
@@ -4082,14 +4117,14 @@ const D = (e) => {
|
|
|
4082
4117
|
* @see https://tailwindcss.com/docs/translate
|
|
4083
4118
|
*/
|
|
4084
4119
|
"translate-x": [{
|
|
4085
|
-
"translate-x": [
|
|
4120
|
+
"translate-x": [P]
|
|
4086
4121
|
}],
|
|
4087
4122
|
/**
|
|
4088
4123
|
* Translate Y
|
|
4089
4124
|
* @see https://tailwindcss.com/docs/translate
|
|
4090
4125
|
*/
|
|
4091
4126
|
"translate-y": [{
|
|
4092
|
-
"translate-y": [
|
|
4127
|
+
"translate-y": [P]
|
|
4093
4128
|
}],
|
|
4094
4129
|
/**
|
|
4095
4130
|
* Skew X
|
|
@@ -4369,7 +4404,7 @@ const D = (e) => {
|
|
|
4369
4404
|
* @see https://tailwindcss.com/docs/stroke-width
|
|
4370
4405
|
*/
|
|
4371
4406
|
"stroke-w": [{
|
|
4372
|
-
stroke: [
|
|
4407
|
+
stroke: [U, ee, Ne]
|
|
4373
4408
|
}],
|
|
4374
4409
|
/**
|
|
4375
4410
|
* Stroke
|
|
@@ -4444,30 +4479,30 @@ const D = (e) => {
|
|
|
4444
4479
|
"font-size": ["leading"]
|
|
4445
4480
|
}
|
|
4446
4481
|
};
|
|
4447
|
-
},
|
|
4448
|
-
function
|
|
4449
|
-
return
|
|
4482
|
+
}, Tn = /* @__PURE__ */ fn(En);
|
|
4483
|
+
function Pn(...e) {
|
|
4484
|
+
return Tn($t(e));
|
|
4450
4485
|
}
|
|
4451
|
-
function
|
|
4452
|
-
const [r, o] = E(() =>
|
|
4453
|
-
|
|
4454
|
-
const
|
|
4455
|
-
o(
|
|
4486
|
+
function gr({ autoWidth: e = !0, className: t, style: n }) {
|
|
4487
|
+
const [r, o] = E(() => X.getActiveAppId()), [i, a] = E(() => _.getRunningApps()), { isMobile: c } = tt();
|
|
4488
|
+
z(() => {
|
|
4489
|
+
const w = X.subscribe("activeAppId", (k) => {
|
|
4490
|
+
o(k);
|
|
4456
4491
|
});
|
|
4457
4492
|
return () => {
|
|
4458
|
-
|
|
4493
|
+
w();
|
|
4459
4494
|
};
|
|
4460
|
-
}, []),
|
|
4461
|
-
a(
|
|
4462
|
-
}), []),
|
|
4495
|
+
}, []), z(() => _.subscribe(() => {
|
|
4496
|
+
a(_.getRunningApps());
|
|
4497
|
+
}), []), z(() => {
|
|
4463
4498
|
if (!new URLSearchParams(window.location.search).has("app")) {
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4499
|
+
const g = X.getActiveAppId();
|
|
4500
|
+
g && !_.isRunning(g) && _.launchApp(g);
|
|
4466
4501
|
}
|
|
4467
4502
|
}, []);
|
|
4468
|
-
const l = (
|
|
4469
|
-
|
|
4470
|
-
}, u = r ?
|
|
4503
|
+
const l = (w) => {
|
|
4504
|
+
_.closeApp(w);
|
|
4505
|
+
}, u = r ? ie.get(r) : null, v = (u == null ? void 0 : u.width) ?? 400, d = r !== null, b = { ...{
|
|
4471
4506
|
overflow: "hidden",
|
|
4472
4507
|
display: d ? "flex" : "none",
|
|
4473
4508
|
flexDirection: "column",
|
|
@@ -4475,59 +4510,59 @@ function ir({ autoWidth: e = !0, className: t, style: n }) {
|
|
|
4475
4510
|
// Only set width if autoWidth is enabled
|
|
4476
4511
|
...e && d ? { width: c ? "100%" : v } : {}
|
|
4477
4512
|
}, ...n };
|
|
4478
|
-
return /* @__PURE__ */ s("div", { className:
|
|
4479
|
-
|
|
4513
|
+
return /* @__PURE__ */ s("div", { className: Pn("nc-app-panel", t), style: b, children: i.map((w) => /* @__PURE__ */ s(
|
|
4514
|
+
Ze,
|
|
4480
4515
|
{
|
|
4481
|
-
appId:
|
|
4482
|
-
isActive: r ===
|
|
4483
|
-
onClose: () => l(
|
|
4516
|
+
appId: w.appId,
|
|
4517
|
+
isActive: r === w.appId,
|
|
4518
|
+
onClose: () => l(w.appId)
|
|
4484
4519
|
},
|
|
4485
|
-
|
|
4520
|
+
w.appId
|
|
4486
4521
|
)) });
|
|
4487
4522
|
}
|
|
4488
|
-
function
|
|
4523
|
+
function br({
|
|
4489
4524
|
pinnedAppIds: e,
|
|
4490
4525
|
className: t = "",
|
|
4491
4526
|
showIndicators: n = !0,
|
|
4492
4527
|
side: r = "left",
|
|
4493
4528
|
getBadge: o
|
|
4494
4529
|
}) {
|
|
4495
|
-
const { t: i } =
|
|
4496
|
-
|
|
4497
|
-
const p =
|
|
4530
|
+
const { t: i } = J(), { isMobile: a } = tt(), [c, l] = E(() => X.getActiveAppId()), [u, f] = E(() => _.getRunningApps());
|
|
4531
|
+
z(() => {
|
|
4532
|
+
const p = X.subscribe("activeAppId", (h) => {
|
|
4498
4533
|
l(h);
|
|
4499
4534
|
});
|
|
4500
4535
|
return () => {
|
|
4501
4536
|
p();
|
|
4502
4537
|
};
|
|
4503
|
-
}, []),
|
|
4504
|
-
f(
|
|
4538
|
+
}, []), z(() => _.subscribe(() => {
|
|
4539
|
+
f(_.getRunningApps());
|
|
4505
4540
|
}), []);
|
|
4506
4541
|
const v = (p) => {
|
|
4507
|
-
c === p ?
|
|
4508
|
-
}, d = e.map((p) =>
|
|
4542
|
+
c === p ? _.setActiveApp(null) : _.launchApp(p);
|
|
4543
|
+
}, d = e.map((p) => ie.get(p)).filter((p) => !!p), m = u.filter((p) => !e.includes(p.appId)).map((p) => ({ running: p, def: ie.get(p.appId) })).filter((p) => !!p.def), y = (p) => u.some((h) => h.appId === p), b = (p) => p.titleKey ? String(i(p.titleKey)) : p.id, w = (p) => typeof p == "number" && p > 99 ? "99+" : p, k = (p, h) => {
|
|
4509
4544
|
const A = o == null ? void 0 : o(p, h);
|
|
4510
4545
|
return A ? /* @__PURE__ */ s(
|
|
4511
4546
|
"span",
|
|
4512
4547
|
{
|
|
4513
4548
|
className: `nc-app-taskbar-badge nc-${A.tone ?? "default"}`,
|
|
4514
4549
|
"aria-label": A.ariaLabel,
|
|
4515
|
-
children:
|
|
4550
|
+
children: w(A.content)
|
|
4516
4551
|
}
|
|
4517
4552
|
) : null;
|
|
4518
|
-
},
|
|
4519
|
-
return /* @__PURE__ */
|
|
4553
|
+
}, g = a ? 24 : 28;
|
|
4554
|
+
return /* @__PURE__ */ N("div", { className: `nc-app-taskbar ${a ? "nc-mobile" : "nc-desktop"} nc-${r} ${t}`, children: [
|
|
4520
4555
|
d.map((p) => {
|
|
4521
|
-
const h = p.icon, A = c === p.id, C = y(p.id),
|
|
4522
|
-
return /* @__PURE__ */
|
|
4556
|
+
const h = p.icon, A = c === p.id, C = y(p.id), T = { isActive: A, isRunning: C, isPinned: !0 };
|
|
4557
|
+
return /* @__PURE__ */ N(
|
|
4523
4558
|
"button",
|
|
4524
4559
|
{
|
|
4525
4560
|
className: `nc-app-taskbar-button ${A ? "nc-active" : ""} ${C ? "nc-running" : ""}`,
|
|
4526
4561
|
onClick: () => v(p.id),
|
|
4527
|
-
title:
|
|
4562
|
+
title: b(p),
|
|
4528
4563
|
children: [
|
|
4529
|
-
/* @__PURE__ */ s(h, { size:
|
|
4530
|
-
|
|
4564
|
+
/* @__PURE__ */ s(h, { size: g }),
|
|
4565
|
+
k(p, T),
|
|
4531
4566
|
n && C && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4532
4567
|
]
|
|
4533
4568
|
},
|
|
@@ -4536,16 +4571,16 @@ function cr({
|
|
|
4536
4571
|
}),
|
|
4537
4572
|
m.length > 0 && /* @__PURE__ */ s("div", { className: "nc-app-taskbar-separator" }),
|
|
4538
4573
|
m.map(({ running: p, def: h }) => {
|
|
4539
|
-
const A = h.icon, C = c === p.appId,
|
|
4540
|
-
return /* @__PURE__ */
|
|
4574
|
+
const A = h.icon, C = c === p.appId, T = { isActive: C, isRunning: !0, isPinned: !1 };
|
|
4575
|
+
return /* @__PURE__ */ N(
|
|
4541
4576
|
"button",
|
|
4542
4577
|
{
|
|
4543
4578
|
className: `nc-app-taskbar-button ${C ? "nc-active" : ""} nc-running`,
|
|
4544
4579
|
onClick: () => v(p.appId),
|
|
4545
|
-
title:
|
|
4580
|
+
title: b(h),
|
|
4546
4581
|
children: [
|
|
4547
|
-
/* @__PURE__ */ s(A, { size:
|
|
4548
|
-
|
|
4582
|
+
/* @__PURE__ */ s(A, { size: g }),
|
|
4583
|
+
k(h, T),
|
|
4549
4584
|
n && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4550
4585
|
]
|
|
4551
4586
|
},
|
|
@@ -4554,7 +4589,7 @@ function cr({
|
|
|
4554
4589
|
})
|
|
4555
4590
|
] });
|
|
4556
4591
|
}
|
|
4557
|
-
function
|
|
4592
|
+
function vr({
|
|
4558
4593
|
appId: e,
|
|
4559
4594
|
open: t,
|
|
4560
4595
|
onClose: n,
|
|
@@ -4578,7 +4613,7 @@ function ar({
|
|
|
4578
4613
|
style: i,
|
|
4579
4614
|
onClick: (l) => l.stopPropagation(),
|
|
4580
4615
|
children: /* @__PURE__ */ s(
|
|
4581
|
-
|
|
4616
|
+
Ze,
|
|
4582
4617
|
{
|
|
4583
4618
|
appId: e,
|
|
4584
4619
|
isActive: !0,
|
|
@@ -4591,84 +4626,84 @@ function ar({
|
|
|
4591
4626
|
);
|
|
4592
4627
|
return pe(c, document.body);
|
|
4593
4628
|
}
|
|
4594
|
-
const
|
|
4595
|
-
function
|
|
4596
|
-
const e =
|
|
4629
|
+
const Re = ce(null), ct = ce(null);
|
|
4630
|
+
function wr() {
|
|
4631
|
+
const e = ne(Re);
|
|
4597
4632
|
if (!e)
|
|
4598
4633
|
throw new Error("useNavStack must be used within a NavStackProvider");
|
|
4599
4634
|
return e;
|
|
4600
4635
|
}
|
|
4601
|
-
function
|
|
4602
|
-
const e =
|
|
4636
|
+
function yr() {
|
|
4637
|
+
const e = ne(ct);
|
|
4603
4638
|
if (!e)
|
|
4604
4639
|
throw new Error("useNavView must be used within NavStack");
|
|
4605
4640
|
return e;
|
|
4606
4641
|
}
|
|
4607
|
-
const
|
|
4608
|
-
function
|
|
4609
|
-
const { t: n } =
|
|
4642
|
+
const Ee = ce(null);
|
|
4643
|
+
function xr({ rootView: e, children: t }) {
|
|
4644
|
+
const { t: n } = J(), r = Xt(), [o, i] = E([e]), [a, c] = E([null]), l = V((h, A) => {
|
|
4610
4645
|
c((C) => {
|
|
4611
|
-
const
|
|
4612
|
-
return
|
|
4646
|
+
const T = [...C];
|
|
4647
|
+
return T[h] = A, T;
|
|
4613
4648
|
});
|
|
4614
|
-
}, []), u =
|
|
4649
|
+
}, []), u = V((h) => {
|
|
4615
4650
|
c((A) => {
|
|
4616
4651
|
const C = [...A];
|
|
4617
4652
|
return C[h] = null, C;
|
|
4618
4653
|
});
|
|
4619
|
-
}, []), f =
|
|
4654
|
+
}, []), f = V((h) => {
|
|
4620
4655
|
i((A) => [...A, h]), c((A) => [...A, null]);
|
|
4621
|
-
}, []), v =
|
|
4656
|
+
}, []), v = V(() => {
|
|
4622
4657
|
i((h) => h.length <= 1 ? h : h.slice(0, -1)), c((h) => h.slice(0, -1));
|
|
4623
|
-
}, []), d =
|
|
4658
|
+
}, []), d = V(() => {
|
|
4624
4659
|
i([e]), c([null]);
|
|
4625
|
-
}, [e]), m = o.length, y = m > 1,
|
|
4626
|
-
|
|
4627
|
-
r.setTitle(
|
|
4628
|
-
}, [
|
|
4660
|
+
}, [e]), m = o.length, y = m > 1, b = o.length - 1, w = o[o.length - 1], k = w != null && w.titleKey ? n(w.titleKey) : (w == null ? void 0 : w.title) ?? "";
|
|
4661
|
+
z(() => {
|
|
4662
|
+
r.setTitle(k);
|
|
4663
|
+
}, [k, r]), z(() => {
|
|
4629
4664
|
y ? r.setBackHandler(v) : r.clearBackHandler();
|
|
4630
|
-
}, [y, v, r]),
|
|
4665
|
+
}, [y, v, r]), z(() => {
|
|
4631
4666
|
const h = a[a.length - 1];
|
|
4632
4667
|
h ? r.setToolbar(h) : r.clearToolbar();
|
|
4633
4668
|
}, [a, r]);
|
|
4634
|
-
const
|
|
4669
|
+
const g = {
|
|
4635
4670
|
push: f,
|
|
4636
4671
|
pop: v,
|
|
4637
4672
|
reset: d,
|
|
4638
4673
|
depth: m,
|
|
4639
4674
|
canGoBack: y,
|
|
4640
|
-
currentTitle:
|
|
4675
|
+
currentTitle: k
|
|
4641
4676
|
}, p = {
|
|
4642
4677
|
stack: o,
|
|
4643
4678
|
toolbarStack: a,
|
|
4644
4679
|
updateToolbar: l,
|
|
4645
4680
|
clearToolbarAt: u,
|
|
4646
|
-
topIndex:
|
|
4681
|
+
topIndex: b
|
|
4647
4682
|
};
|
|
4648
|
-
return /* @__PURE__ */ s(
|
|
4683
|
+
return /* @__PURE__ */ s(Re.Provider, { value: g, children: /* @__PURE__ */ s(Ee.Provider, { value: p, children: t }) });
|
|
4649
4684
|
}
|
|
4650
|
-
function
|
|
4651
|
-
const n =
|
|
4685
|
+
function Ln({ index: e, children: t }) {
|
|
4686
|
+
const n = ne(Ee);
|
|
4652
4687
|
if (!n)
|
|
4653
4688
|
throw new Error("NavViewProvider must be used within NavStackProvider");
|
|
4654
|
-
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n, a =
|
|
4689
|
+
const { updateToolbar: r, clearToolbarAt: o, topIndex: i } = n, a = V((u) => {
|
|
4655
4690
|
e === i && r(e, u);
|
|
4656
|
-
}, [e, i, r]), c =
|
|
4691
|
+
}, [e, i, r]), c = V(() => {
|
|
4657
4692
|
e === i && o(e);
|
|
4658
4693
|
}, [e, i, o]), l = {
|
|
4659
4694
|
setToolbar: a,
|
|
4660
4695
|
clearToolbar: c
|
|
4661
4696
|
};
|
|
4662
|
-
return /* @__PURE__ */ s(
|
|
4697
|
+
return /* @__PURE__ */ s(ct.Provider, { value: l, children: t });
|
|
4663
4698
|
}
|
|
4664
|
-
function
|
|
4665
|
-
const e =
|
|
4699
|
+
function kr() {
|
|
4700
|
+
const e = ne(Re), t = ne(Ee);
|
|
4666
4701
|
if (!e || !t)
|
|
4667
4702
|
throw new Error("NavStackContainer must be used within a NavStackProvider");
|
|
4668
4703
|
const { stack: n } = t;
|
|
4669
4704
|
return /* @__PURE__ */ s("div", { className: "nav-stack-container", children: /* @__PURE__ */ s("div", { className: "nav-stack-content", children: n.map((r, o) => {
|
|
4670
4705
|
const i = o === n.length - 1;
|
|
4671
|
-
return /* @__PURE__ */ s(
|
|
4706
|
+
return /* @__PURE__ */ s(Ln, { index: o, children: /* @__PURE__ */ s(
|
|
4672
4707
|
"div",
|
|
4673
4708
|
{
|
|
4674
4709
|
style: { display: i ? "flex" : "none", flexDirection: "column", height: "100%" },
|
|
@@ -4678,55 +4713,55 @@ function pr() {
|
|
|
4678
4713
|
}) }) });
|
|
4679
4714
|
}
|
|
4680
4715
|
export {
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4716
|
+
_e as ActivityIndicator,
|
|
4717
|
+
Gn as Alert,
|
|
4718
|
+
Ze as AppContainer,
|
|
4719
|
+
Je as AppContext,
|
|
4720
|
+
vr as AppDialog,
|
|
4721
|
+
gr as AppPanel,
|
|
4722
|
+
br as AppTaskbar,
|
|
4723
|
+
Zt as AppTitleBar,
|
|
4724
|
+
Yn as Battery,
|
|
4725
|
+
q as Button,
|
|
4726
|
+
Kn as ButtonGroup,
|
|
4727
|
+
_n as Checkbox,
|
|
4728
|
+
Ue as CloseButton,
|
|
4729
|
+
Un as ComboBox,
|
|
4730
|
+
Qn as ContextMenu,
|
|
4731
|
+
ur as CsvTextArea,
|
|
4732
|
+
er as Dialog,
|
|
4733
|
+
oe as DialogClose,
|
|
4734
|
+
Xn as EditButton,
|
|
4735
|
+
Zn as Hyperlink,
|
|
4736
|
+
tr as Input,
|
|
4737
|
+
rr as ListGroup,
|
|
4738
|
+
nr as ListGroupItem,
|
|
4739
|
+
sr as MonthRangePicker,
|
|
4740
|
+
or as MultiSelect,
|
|
4741
|
+
kr as NavStackContainer,
|
|
4742
|
+
xr as NavStackProvider,
|
|
4743
|
+
Yt as Notification,
|
|
4744
|
+
pr as NotificationContainer,
|
|
4745
|
+
ir as NumberInput,
|
|
4746
|
+
qn as RefreshButton,
|
|
4747
|
+
cr as Slider,
|
|
4748
|
+
Wt as TabPanel,
|
|
4749
|
+
ar as TabPanels,
|
|
4750
|
+
lr as Tabs,
|
|
4751
|
+
dr as Toggle,
|
|
4752
|
+
Jn as TrashButton,
|
|
4753
|
+
mr as ViewportProvider,
|
|
4754
|
+
ie as appRegistry,
|
|
4755
|
+
X as appStateStore,
|
|
4756
|
+
Pn as cn,
|
|
4757
|
+
hr as createAppI18nFactory,
|
|
4758
|
+
fr as notificationManager,
|
|
4759
|
+
_ as runningAppsStore,
|
|
4760
|
+
Kt as showNotification,
|
|
4761
|
+
Xt as useApp,
|
|
4762
|
+
Lt as useDialog,
|
|
4763
|
+
wr as useNavStack,
|
|
4764
|
+
yr as useNavView,
|
|
4765
|
+
tt as useViewport
|
|
4731
4766
|
};
|
|
4732
4767
|
//# sourceMappingURL=index.js.map
|