asterui 0.12.21 → 0.12.23
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/components/VirtualList.d.ts +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +46 -44
- package/dist/index.js.map +1 -1
- package/dist/index10.js +1 -1
- package/dist/index100.js +32 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +5 -13
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +11 -43
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +44 -11
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +10 -12
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +14 -7
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +7 -12
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +11 -29
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +29 -16
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +21 -0
- package/dist/index109.js.map +1 -0
- package/dist/index11.js +14 -14
- package/dist/index110.js +36 -0
- package/dist/index110.js.map +1 -0
- package/dist/index111.js +523 -0
- package/dist/index111.js.map +1 -0
- package/dist/index112.js +53 -0
- package/dist/index112.js.map +1 -0
- package/dist/index20.js +8 -8
- package/dist/index23.js +13 -13
- package/dist/index28.js +2 -2
- package/dist/index36.js +5 -5
- package/dist/index40.js +6 -6
- package/dist/index41.js +30 -30
- package/dist/index45.js +5 -5
- package/dist/index47.js +15 -15
- package/dist/index51.js +18 -18
- package/dist/index51.js.map +1 -1
- package/dist/index55.js +4 -4
- package/dist/index55.js.map +1 -1
- package/dist/index58.js +22 -22
- package/dist/index62.js +12 -12
- package/dist/index64.js +13 -13
- package/dist/index68.js +12 -12
- package/dist/index71.js +19 -19
- package/dist/index76.js +2 -2
- package/dist/index77.js +21 -21
- package/dist/index8.js +18 -18
- package/dist/index80.js +13 -13
- package/dist/index82.js +23 -23
- package/dist/index88.js +2 -2
- package/dist/index97.js +61 -121
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +126 -14
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +12 -31
- package/dist/index99.js.map +1 -1
- package/package.json +6 -1
package/dist/index112.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function T(n, l, e) {
|
|
2
|
+
let i = e.initialDeps ?? [], t, c = !0;
|
|
3
|
+
function h() {
|
|
4
|
+
var d, m, f;
|
|
5
|
+
let g;
|
|
6
|
+
e.key && ((d = e.debug) != null && d.call(e)) && (g = Date.now());
|
|
7
|
+
const o = n();
|
|
8
|
+
if (!(o.length !== i.length || o.some((r, a) => i[a] !== r)))
|
|
9
|
+
return t;
|
|
10
|
+
i = o;
|
|
11
|
+
let s;
|
|
12
|
+
if (e.key && ((m = e.debug) != null && m.call(e)) && (s = Date.now()), t = l(...o), e.key && ((f = e.debug) != null && f.call(e))) {
|
|
13
|
+
const r = Math.round((Date.now() - g) * 100) / 100, a = Math.round((Date.now() - s) * 100) / 100, b = a / 16, w = (u, D) => {
|
|
14
|
+
for (u = String(u); u.length < D; )
|
|
15
|
+
u = " " + u;
|
|
16
|
+
return u;
|
|
17
|
+
};
|
|
18
|
+
console.info(
|
|
19
|
+
`%c⏱ ${w(a, 5)} /${w(r, 5)} ms`,
|
|
20
|
+
`
|
|
21
|
+
font-size: .6rem;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
color: hsl(${Math.max(
|
|
24
|
+
0,
|
|
25
|
+
Math.min(120 - 120 * b, 120)
|
|
26
|
+
)}deg 100% 31%);`,
|
|
27
|
+
e?.key
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return e?.onChange && !(c && e.skipInitialOnChange) && e.onChange(t), c = !1, t;
|
|
31
|
+
}
|
|
32
|
+
return h.updateDeps = (d) => {
|
|
33
|
+
i = d;
|
|
34
|
+
}, h;
|
|
35
|
+
}
|
|
36
|
+
function k(n, l) {
|
|
37
|
+
if (n === void 0)
|
|
38
|
+
throw new Error("Unexpected undefined");
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
const y = (n, l) => Math.abs(n - l) < 1.01, C = (n, l, e) => {
|
|
42
|
+
let i;
|
|
43
|
+
return function(...t) {
|
|
44
|
+
n.clearTimeout(i), i = n.setTimeout(() => l.apply(this, t), e);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
y as approxEqual,
|
|
49
|
+
C as debounce,
|
|
50
|
+
T as memo,
|
|
51
|
+
k as notUndefined
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=index112.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index112.js","sources":["../../../node_modules/.pnpm/@tanstack+virtual-core@3.13.13/node_modules/@tanstack/virtual-core/dist/esm/utils.js"],"sourcesContent":["function memo(getDeps, fn, opts) {\n let deps = opts.initialDeps ?? [];\n let result;\n let isInitial = true;\n function memoizedFunction() {\n var _a, _b, _c;\n let depTime;\n if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();\n const newDeps = getDeps();\n const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n let resultTime;\n if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();\n result = fn(...newDeps);\n if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n const resultFpsPercentage = resultEndTime / 16;\n const pad = (str, num) => {\n str = String(str);\n while (str.length < num) {\n str = \" \" + str;\n }\n return str;\n };\n console.info(\n `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(\n 0,\n Math.min(120 - 120 * resultFpsPercentage, 120)\n )}deg 100% 31%);`,\n opts == null ? void 0 : opts.key\n );\n }\n if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {\n opts.onChange(result);\n }\n isInitial = false;\n return result;\n }\n memoizedFunction.updateDeps = (newDeps) => {\n deps = newDeps;\n };\n return memoizedFunction;\n}\nfunction notUndefined(value, msg) {\n if (value === void 0) {\n throw new Error(`Unexpected undefined${msg ? `: ${msg}` : \"\"}`);\n } else {\n return value;\n }\n}\nconst approxEqual = (a, b) => Math.abs(a - b) < 1.01;\nconst debounce = (targetWindow, fn, ms) => {\n let timeoutId;\n return function(...args) {\n targetWindow.clearTimeout(timeoutId);\n timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);\n };\n};\nexport {\n approxEqual,\n debounce,\n memo,\n notUndefined\n};\n//# sourceMappingURL=utils.js.map\n"],"names":["memo","getDeps","fn","opts","deps","result","isInitial","memoizedFunction","_a","_b","_c","depTime","newDeps","dep","index","resultTime","depEndTime","resultEndTime","resultFpsPercentage","pad","str","num","notUndefined","value","msg","approxEqual","a","b","debounce","targetWindow","ms","timeoutId","args"],"mappings":"AAAA,SAASA,EAAKC,GAASC,GAAIC,GAAM;AAC/B,MAAIC,IAAOD,EAAK,eAAe,CAAA,GAC3BE,GACAC,IAAY;AAChB,WAASC,IAAmB;AAC1B,QAAIC,GAAIC,GAAIC;AACZ,QAAIC;AACJ,IAAIR,EAAK,SAASK,IAAKL,EAAK,UAAU,QAAgBK,EAAG,KAAKL,CAAI,OAAIQ,IAAU,KAAK,IAAG;AACxF,UAAMC,IAAUX,EAAO;AAEvB,QAAI,EADgBW,EAAQ,WAAWR,EAAK,UAAUQ,EAAQ,KAAK,CAACC,GAAKC,MAAUV,EAAKU,CAAK,MAAMD,CAAG;AAEpG,aAAOR;AAET,IAAAD,IAAOQ;AACP,QAAIG;AAGJ,QAFIZ,EAAK,SAASM,IAAKN,EAAK,UAAU,QAAgBM,EAAG,KAAKN,CAAI,OAAIY,IAAa,KAAK,IAAG,IAC3FV,IAASH,EAAG,GAAGU,CAAO,GAClBT,EAAK,SAASO,IAAKP,EAAK,UAAU,QAAgBO,EAAG,KAAKP,CAAI,IAAI;AACpE,YAAMa,IAAa,KAAK,OAAO,KAAK,QAAQL,KAAW,GAAG,IAAI,KACxDM,IAAgB,KAAK,OAAO,KAAK,QAAQF,KAAc,GAAG,IAAI,KAC9DG,IAAsBD,IAAgB,IACtCE,IAAM,CAACC,GAAKC,MAAQ;AAExB,aADAD,IAAM,OAAOA,CAAG,GACTA,EAAI,SAASC;AAClB,UAAAD,IAAM,MAAMA;AAEd,eAAOA;AAAA,MACT;AACA,cAAQ;AAAA,QACN,OAAOD,EAAIF,GAAe,CAAC,CAAC,KAAKE,EAAIH,GAAY,CAAC,CAAC;AAAA,QACnD;AAAA;AAAA;AAAA,yBAGiB,KAAK;AAAA,UACpB;AAAA,UACA,KAAK,IAAI,MAAM,MAAME,GAAqB,GAAG;AAAA,QACvD,CAAS;AAAA,QACuBf,GAAK;AAAA,MACrC;AAAA,IACI;AACA,WAA6BA,GAAK,YAAa,EAAEG,KAAaH,EAAK,wBACjEA,EAAK,SAASE,CAAM,GAEtBC,IAAY,IACLD;AAAA,EACT;AACA,SAAAE,EAAiB,aAAa,CAACK,MAAY;AACzC,IAAAR,IAAOQ;AAAA,EACT,GACOL;AACT;AACA,SAASe,EAAaC,GAAOC,GAAK;AAChC,MAAID,MAAU;AACZ,UAAM,IAAI,MAAM,sBAA8C;AAE9D,SAAOA;AAEX;AACK,MAACE,IAAc,CAACC,GAAGC,MAAM,KAAK,IAAID,IAAIC,CAAC,IAAI,MAC1CC,IAAW,CAACC,GAAc3B,GAAI4B,MAAO;AACzC,MAAIC;AACJ,SAAO,YAAYC,GAAM;AACvB,IAAAH,EAAa,aAAaE,CAAS,GACnCA,IAAYF,EAAa,WAAW,MAAM3B,EAAG,MAAM,MAAM8B,CAAI,GAAGF,CAAE;AAAA,EACpE;AACF;","x_google_ignoreList":[0]}
|
package/dist/index20.js
CHANGED
|
@@ -6,7 +6,7 @@ const E = W(null), I = () => {
|
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error("ContextMenu compound components must be used within a ContextMenu");
|
|
8
8
|
return e;
|
|
9
|
-
},
|
|
9
|
+
}, _ = ({
|
|
10
10
|
itemKey: e,
|
|
11
11
|
children: u,
|
|
12
12
|
icon: l,
|
|
@@ -33,7 +33,7 @@ const E = W(null), I = () => {
|
|
|
33
33
|
]
|
|
34
34
|
}
|
|
35
35
|
) });
|
|
36
|
-
},
|
|
36
|
+
}, A = ({ className: e = "" }) => /* @__PURE__ */ n("li", { className: `divider my-1 ${e}` }), H = ({
|
|
37
37
|
itemKey: e,
|
|
38
38
|
label: u,
|
|
39
39
|
icon: l,
|
|
@@ -127,7 +127,7 @@ const E = W(null), I = () => {
|
|
|
127
127
|
]
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
|
-
},
|
|
130
|
+
}, K = ({
|
|
131
131
|
children: e,
|
|
132
132
|
items: u,
|
|
133
133
|
onSelect: l,
|
|
@@ -188,12 +188,12 @@ const E = W(null), I = () => {
|
|
|
188
188
|
document.body
|
|
189
189
|
)
|
|
190
190
|
] });
|
|
191
|
-
},
|
|
192
|
-
Item:
|
|
193
|
-
Divider:
|
|
194
|
-
SubMenu:
|
|
191
|
+
}, X = Object.assign(K, {
|
|
192
|
+
Item: _,
|
|
193
|
+
Divider: A,
|
|
194
|
+
SubMenu: H
|
|
195
195
|
});
|
|
196
196
|
export {
|
|
197
|
-
|
|
197
|
+
X as ContextMenu
|
|
198
198
|
};
|
|
199
199
|
//# sourceMappingURL=index20.js.map
|
package/dist/index23.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as h, jsx as s, Fragment as
|
|
1
|
+
import { jsxs as h, jsx as s, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
function
|
|
3
|
+
function L(d) {
|
|
4
4
|
return null;
|
|
5
5
|
}
|
|
6
6
|
function B({
|
|
@@ -15,15 +15,15 @@ function B({
|
|
|
15
15
|
className: j = "",
|
|
16
16
|
style: F,
|
|
17
17
|
children: M,
|
|
18
|
-
...
|
|
18
|
+
..._
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
20
|
+
const D = {
|
|
21
21
|
small: "text-sm",
|
|
22
22
|
default: "text-base",
|
|
23
23
|
large: "text-lg"
|
|
24
24
|
}, y = m.Children.toArray(M).filter(
|
|
25
25
|
(p) => m.isValidElement(p)
|
|
26
|
-
), e = typeof l == "number" ? l : l.md || l.sm || l.xs || 3,
|
|
26
|
+
), e = typeof l == "number" ? l : l.md || l.sm || l.xs || 3, R = () => {
|
|
27
27
|
if (w === "vertical")
|
|
28
28
|
return y.map((r, t) => {
|
|
29
29
|
const o = r.props.span || 1, b = Math.min(o, e), f = r.props.labelStyle || N;
|
|
@@ -40,7 +40,7 @@ function B({
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
t % e === e - 1 && /* @__PURE__ */ s(
|
|
43
|
+
t % e === e - 1 && /* @__PURE__ */ s(E, { children: Array.from({ length: e - ((t + 1) % e || e) }).map((n, i) => /* @__PURE__ */ s("th", { className: `${a ? "border border-base-content/10" : ""}` }, `empty-${i}`)) }),
|
|
44
44
|
(t + 1) % e === 0 && /* @__PURE__ */ s("tr", { children: y.slice(t - e + 1, t + 1).map((n, i) => {
|
|
45
45
|
const g = n.props.span || 1, u = Math.min(g, e), C = n.props.contentStyle || $;
|
|
46
46
|
return /* @__PURE__ */ s(
|
|
@@ -64,7 +64,7 @@ function B({
|
|
|
64
64
|
}), c.length > 0 && p.push(c), p.map((r, t) => {
|
|
65
65
|
let o = 0;
|
|
66
66
|
const b = r.map((n, i) => {
|
|
67
|
-
const g = n.props.span || 1, u = Math.min(g, e), C = n.props.labelStyle || N,
|
|
67
|
+
const g = n.props.span || 1, u = Math.min(g, e), C = n.props.labelStyle || N, A = n.props.contentStyle || $;
|
|
68
68
|
return o += u, /* @__PURE__ */ h(m.Fragment, { children: [
|
|
69
69
|
/* @__PURE__ */ h(
|
|
70
70
|
"th",
|
|
@@ -81,7 +81,7 @@ function B({
|
|
|
81
81
|
"td",
|
|
82
82
|
{
|
|
83
83
|
className: `${a ? "border border-base-content/10" : ""} px-4 py-2`,
|
|
84
|
-
style:
|
|
84
|
+
style: A,
|
|
85
85
|
colSpan: u * 2 - 1,
|
|
86
86
|
children: n.props.children
|
|
87
87
|
}
|
|
@@ -92,19 +92,19 @@ function B({
|
|
|
92
92
|
/* @__PURE__ */ s(m.Fragment, { children: /* @__PURE__ */ s("th", { className: `${a ? "border border-base-content/10" : ""}`, colSpan: f * 2 }) }, "empty")
|
|
93
93
|
), /* @__PURE__ */ s("tr", { children: b }, t);
|
|
94
94
|
});
|
|
95
|
-
},
|
|
95
|
+
}, z = [
|
|
96
96
|
"w-full",
|
|
97
97
|
a && "border-collapse",
|
|
98
|
-
|
|
98
|
+
D[v],
|
|
99
99
|
j
|
|
100
100
|
].filter(Boolean).join(" ");
|
|
101
|
-
return /* @__PURE__ */ h("div", { style: F, ...
|
|
101
|
+
return /* @__PURE__ */ h("div", { style: F, ..._, children: [
|
|
102
102
|
d && /* @__PURE__ */ s("div", { className: "text-lg font-semibold mb-4", children: d }),
|
|
103
|
-
/* @__PURE__ */ s("table", { className:
|
|
103
|
+
/* @__PURE__ */ s("table", { className: z, children: /* @__PURE__ */ s("tbody", { children: R() }) })
|
|
104
104
|
] });
|
|
105
105
|
}
|
|
106
106
|
const k = Object.assign(B, {
|
|
107
|
-
Item:
|
|
107
|
+
Item: L
|
|
108
108
|
});
|
|
109
109
|
export {
|
|
110
110
|
k as Descriptions,
|
package/dist/index28.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
|
-
const
|
|
3
|
+
const u = ({
|
|
4
4
|
children: l,
|
|
5
5
|
sidebar: d,
|
|
6
6
|
open: a = !1,
|
|
@@ -39,6 +39,6 @@ const N = ({
|
|
|
39
39
|
] });
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
u as SidebarDrawer
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=index28.js.map
|
package/dist/index36.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import P from "react";
|
|
3
3
|
const R = P.createContext({ cols: 24, gutter: [0, 0] }), X = {
|
|
4
4
|
1: "col-span-1",
|
|
@@ -1067,16 +1067,16 @@ function z({ children: g, cols: x = 24, gutter: c = 16, justify: n, align: r, cl
|
|
|
1067
1067
|
...a && { rowGap: `${a}px` },
|
|
1068
1068
|
...t
|
|
1069
1069
|
};
|
|
1070
|
-
return /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ C(R.Provider, { value: { cols: x, gutter: [o, a] }, children: /* @__PURE__ */ C("div", { className: l, style: S, ...m, children: g }) });
|
|
1071
1071
|
}
|
|
1072
1072
|
function F({ children: g, span: x, offset: c, order: n, xs: r, sm: p, md: t, lg: m, xl: o, xxl: a, className: d = "", style: e, ...L }) {
|
|
1073
|
-
const { cols: l, gutter: S } = P.useContext(R), [i] = S, s = [], A = l === 120 ? M : X, u = l === 120 ? T : G, f = l === 120 ? I : v, E = l === 120 ? B : b, O = l === 120 ? Y : w, h = l === 120 ? k : D, y = l === 120 ? q : $,
|
|
1074
|
-
|
|
1073
|
+
const { cols: l, gutter: S } = P.useContext(R), [i] = S, s = [], A = l === 120 ? M : X, u = l === 120 ? T : G, f = l === 120 ? I : v, E = l === 120 ? B : b, O = l === 120 ? Y : w, h = l === 120 ? k : D, y = l === 120 ? q : $, _ = x ?? r ?? l;
|
|
1074
|
+
_ && A[_] && s.push(A[_]), p && u[p] && s.push(u[p]), t && f[t] && s.push(f[t]), m && E[m] && s.push(E[m]), o && O[o] && s.push(O[o]), a && h[a] && s.push(h[a]), c && y[c + 1] && s.push(y[c + 1]), n && N[n] && s.push(N[n]), d && s.push(d);
|
|
1075
1075
|
const j = {
|
|
1076
1076
|
...i && { paddingLeft: `${i / 2}px`, paddingRight: `${i / 2}px` },
|
|
1077
1077
|
...e
|
|
1078
1078
|
};
|
|
1079
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ C("div", { className: s.join(" "), style: j, ...L, children: g });
|
|
1080
1080
|
}
|
|
1081
1081
|
const K = {
|
|
1082
1082
|
Row: z,
|
package/dist/index40.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as p, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import b from "react";
|
|
3
|
-
const
|
|
3
|
+
const f = ({
|
|
4
4
|
position: r = "top-end",
|
|
5
5
|
children: s,
|
|
6
6
|
className: c = "",
|
|
7
7
|
...o
|
|
8
8
|
}) => {
|
|
9
|
-
const
|
|
9
|
+
const a = (d) => {
|
|
10
10
|
const [l, h] = d.split("-"), t = [];
|
|
11
11
|
switch (l) {
|
|
12
12
|
case "top":
|
|
@@ -31,13 +31,13 @@ const j = ({
|
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
return t.join(" ");
|
|
34
|
-
}, e = b.Children.toArray(s),
|
|
34
|
+
}, e = b.Children.toArray(s), n = e[0], i = e[1];
|
|
35
35
|
return /* @__PURE__ */ p("div", { className: `indicator inline-block ${c}`, ...o, children: [
|
|
36
|
-
i && /* @__PURE__ */ m("div", { className: `indicator-item ${
|
|
37
|
-
|
|
36
|
+
i && /* @__PURE__ */ m("div", { className: `indicator-item ${a(r)}`, children: i }),
|
|
37
|
+
n
|
|
38
38
|
] });
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
f as Indicator
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=index40.js.map
|
package/dist/index41.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as B, Fragment as ie, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import D, { useId as q, useState as j, useRef as N, useCallback as R, useEffect as L, createContext as ue, useContext as de } from "react";
|
|
3
|
-
const
|
|
3
|
+
const W = ue(void 0);
|
|
4
4
|
function V() {
|
|
5
|
-
const l = de(
|
|
5
|
+
const l = de(W);
|
|
6
6
|
if (!l)
|
|
7
7
|
throw new Error("Dropdown compound components must be used within Dropdown");
|
|
8
8
|
return l;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function fe({
|
|
11
11
|
children: l,
|
|
12
12
|
items: d,
|
|
13
13
|
hover: b = !1,
|
|
@@ -16,8 +16,8 @@ function pe({
|
|
|
16
16
|
align: u = "start",
|
|
17
17
|
open: n,
|
|
18
18
|
onOpenChange: r,
|
|
19
|
-
disabled:
|
|
20
|
-
arrow:
|
|
19
|
+
disabled: f = !1,
|
|
20
|
+
arrow: p = !1,
|
|
21
21
|
mouseEnterDelay: m = 0.15,
|
|
22
22
|
mouseLeaveDelay: c = 0.1,
|
|
23
23
|
getPopupContainer: y,
|
|
@@ -25,16 +25,16 @@ function pe({
|
|
|
25
25
|
className: k = "",
|
|
26
26
|
...S
|
|
27
27
|
}) {
|
|
28
|
-
const U = q(), v = q(), [e, I] = j(!1), [w, x] = j(-1), [T, P] = j(0), [Y,
|
|
29
|
-
|
|
30
|
-
}, [
|
|
28
|
+
const U = q(), v = q(), [e, I] = j(!1), [w, x] = j(-1), [T, P] = j(0), [Y, _] = j(!o), z = N(/* @__PURE__ */ new Map()), $ = N(null), C = N(null), M = b ? ["hover"] : h, F = n !== void 0, A = F ? n : e, g = R((t, E = "trigger") => {
|
|
29
|
+
f || (F || I(t), t && _(!0), r?.(t, { source: E }));
|
|
30
|
+
}, [f, F, r]), Z = R(() => {
|
|
31
31
|
g(!1, "menu"), x(-1), document.getElementById(v)?.focus();
|
|
32
32
|
}, [g, v]), H = R((t, E, a) => {
|
|
33
|
-
E ?
|
|
33
|
+
E ? z.current.set(t, { ref: E, disabled: a }) : z.current.delete(t);
|
|
34
34
|
}, []);
|
|
35
35
|
L(() => {
|
|
36
36
|
if (o && !A) {
|
|
37
|
-
const t = setTimeout(() =>
|
|
37
|
+
const t = setTimeout(() => _(!1), 300);
|
|
38
38
|
return () => clearTimeout(t);
|
|
39
39
|
}
|
|
40
40
|
}, [A, o]), L(() => {
|
|
@@ -67,7 +67,7 @@ function pe({
|
|
|
67
67
|
start: "",
|
|
68
68
|
center: "dropdown-center",
|
|
69
69
|
end: "dropdown-end"
|
|
70
|
-
}, se = typeof
|
|
70
|
+
}, se = typeof p == "boolean" ? p : !!p, ae = [
|
|
71
71
|
"dropdown",
|
|
72
72
|
re[s],
|
|
73
73
|
oe[u],
|
|
@@ -118,7 +118,7 @@ function pe({
|
|
|
118
118
|
(Y || !o) && /* @__PURE__ */ i(J, { children: le() })
|
|
119
119
|
] }) : l;
|
|
120
120
|
return /* @__PURE__ */ i(
|
|
121
|
-
|
|
121
|
+
W.Provider,
|
|
122
122
|
{
|
|
123
123
|
value: {
|
|
124
124
|
position: s,
|
|
@@ -132,7 +132,7 @@ function pe({
|
|
|
132
132
|
registerItem: H,
|
|
133
133
|
itemCount: T,
|
|
134
134
|
setItemCount: P,
|
|
135
|
-
disabled:
|
|
135
|
+
disabled: f,
|
|
136
136
|
arrow: se,
|
|
137
137
|
closeDropdown: Z
|
|
138
138
|
},
|
|
@@ -142,7 +142,7 @@ function pe({
|
|
|
142
142
|
ref: $,
|
|
143
143
|
className: ae,
|
|
144
144
|
"data-state": A ? "open" : "closed",
|
|
145
|
-
"aria-disabled":
|
|
145
|
+
"aria-disabled": f || void 0,
|
|
146
146
|
onMouseEnter: ee,
|
|
147
147
|
onMouseLeave: ne,
|
|
148
148
|
onContextMenu: te,
|
|
@@ -154,7 +154,7 @@ function pe({
|
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
156
|
function G({ children: l, className: d = "" }) {
|
|
157
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, setFocusedIndex: n, itemCount: r, disabled:
|
|
157
|
+
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, setFocusedIndex: n, itemCount: r, disabled: f } = V(), p = (o) => {
|
|
158
158
|
switch (o.key) {
|
|
159
159
|
case "Enter":
|
|
160
160
|
case " ":
|
|
@@ -173,7 +173,7 @@ function G({ children: l, className: d = "" }) {
|
|
|
173
173
|
}, c = D.Children.only(l), y = c.props;
|
|
174
174
|
return D.cloneElement(c, {
|
|
175
175
|
id: h,
|
|
176
|
-
tabIndex:
|
|
176
|
+
tabIndex: f ? -1 : 0,
|
|
177
177
|
"aria-haspopup": "menu",
|
|
178
178
|
"aria-expanded": s,
|
|
179
179
|
"aria-controls": b,
|
|
@@ -181,18 +181,18 @@ function G({ children: l, className: d = "" }) {
|
|
|
181
181
|
m(), y.onClick?.(o);
|
|
182
182
|
},
|
|
183
183
|
onKeyDown: (o) => {
|
|
184
|
-
|
|
184
|
+
p(o), y.onKeyDown?.(o);
|
|
185
185
|
},
|
|
186
186
|
className: `${y.className || ""} ${d}`.trim()
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
function J({ children: l, className: d = "" }) {
|
|
190
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, focusedIndex: n, setFocusedIndex: r, setItemCount:
|
|
190
|
+
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, focusedIndex: n, setFocusedIndex: r, setItemCount: f, arrow: p, position: m } = V(), c = N(null), y = D.Children.toArray(l).filter(
|
|
191
191
|
(e) => D.isValidElement(e) && e.type === O
|
|
192
192
|
);
|
|
193
193
|
L(() => {
|
|
194
|
-
|
|
195
|
-
}, [y.length,
|
|
194
|
+
f(y.length);
|
|
195
|
+
}, [y.length, f]), L(() => {
|
|
196
196
|
s && n >= 0 && c.current && c.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')[n]?.focus();
|
|
197
197
|
}, [s, n]);
|
|
198
198
|
const o = (e) => {
|
|
@@ -227,7 +227,7 @@ function J({ children: l, className: d = "" }) {
|
|
|
227
227
|
"z-50",
|
|
228
228
|
"shadow",
|
|
229
229
|
d
|
|
230
|
-
].filter(Boolean).join(" "), S = D.Children.map(l, (e, I) => D.isValidElement(e) && e.type === O ? D.cloneElement(e, { _index: I }) : e), v =
|
|
230
|
+
].filter(Boolean).join(" "), S = D.Children.map(l, (e, I) => D.isValidElement(e) && e.type === O ? D.cloneElement(e, { _index: I }) : e), v = p ? /* @__PURE__ */ i(
|
|
231
231
|
"span",
|
|
232
232
|
{
|
|
233
233
|
className: `absolute w-0 h-0 border-8 border-solid ${{
|
|
@@ -247,7 +247,7 @@ function J({ children: l, className: d = "" }) {
|
|
|
247
247
|
role: "menu",
|
|
248
248
|
"aria-labelledby": h,
|
|
249
249
|
tabIndex: -1,
|
|
250
|
-
className: `${k} ${
|
|
250
|
+
className: `${k} ${p ? "relative" : ""}`,
|
|
251
251
|
onKeyDown: o,
|
|
252
252
|
children: [
|
|
253
253
|
v,
|
|
@@ -265,10 +265,10 @@ function O({
|
|
|
265
265
|
active: u = !1,
|
|
266
266
|
disabled: n = !1,
|
|
267
267
|
danger: r = !1,
|
|
268
|
-
className:
|
|
268
|
+
className: f = ""
|
|
269
269
|
}) {
|
|
270
|
-
const { closeDropdown:
|
|
271
|
-
n || (s?.(),
|
|
270
|
+
const { closeDropdown: p } = V(), m = [u && "active", n && "disabled", f].filter(Boolean).join(" "), c = () => {
|
|
271
|
+
n || (s?.(), p());
|
|
272
272
|
};
|
|
273
273
|
return /* @__PURE__ */ i("li", { className: m, role: "none", "data-key": d, children: /* @__PURE__ */ B(
|
|
274
274
|
"a",
|
|
@@ -296,7 +296,7 @@ function Q({
|
|
|
296
296
|
disabled: s = !1,
|
|
297
297
|
className: u = ""
|
|
298
298
|
}) {
|
|
299
|
-
const [n, r] = j(!1),
|
|
299
|
+
const [n, r] = j(!1), f = N(null), p = N(null), m = N(null), c = q(), y = () => {
|
|
300
300
|
s || r(!0);
|
|
301
301
|
}, o = () => {
|
|
302
302
|
r(!1);
|
|
@@ -321,7 +321,7 @@ function Q({
|
|
|
321
321
|
switch (e.key) {
|
|
322
322
|
case "ArrowLeft":
|
|
323
323
|
case "Escape":
|
|
324
|
-
e.preventDefault(), e.stopPropagation(), r(!1),
|
|
324
|
+
e.preventDefault(), e.stopPropagation(), r(!1), p.current?.focus();
|
|
325
325
|
break;
|
|
326
326
|
case "ArrowDown":
|
|
327
327
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -344,7 +344,7 @@ function Q({
|
|
|
344
344
|
return /* @__PURE__ */ i(
|
|
345
345
|
"li",
|
|
346
346
|
{
|
|
347
|
-
ref:
|
|
347
|
+
ref: f,
|
|
348
348
|
className: v,
|
|
349
349
|
role: "none",
|
|
350
350
|
"data-key": d,
|
|
@@ -354,7 +354,7 @@ function Q({
|
|
|
354
354
|
/* @__PURE__ */ B(
|
|
355
355
|
"summary",
|
|
356
356
|
{
|
|
357
|
-
ref:
|
|
357
|
+
ref: p,
|
|
358
358
|
role: "menuitem",
|
|
359
359
|
tabIndex: s ? -1 : 0,
|
|
360
360
|
"aria-disabled": s || void 0,
|
|
@@ -388,7 +388,7 @@ function X({ className: l = "" }) {
|
|
|
388
388
|
const d = ["border-base-content/10", l].filter(Boolean).join(" ");
|
|
389
389
|
return /* @__PURE__ */ i("li", { role: "separator", className: "my-1", children: /* @__PURE__ */ i("hr", { className: d }) });
|
|
390
390
|
}
|
|
391
|
-
const be = Object.assign(
|
|
391
|
+
const be = Object.assign(fe, {
|
|
392
392
|
Trigger: G,
|
|
393
393
|
Menu: J,
|
|
394
394
|
Item: O,
|
package/dist/index45.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
|
-
function
|
|
4
|
-
const
|
|
3
|
+
function p({ children: i, direction: o = "horizontal", className: s = "", ...a }) {
|
|
4
|
+
const r = ["join", o === "vertical" && "join-vertical", s].filter(Boolean).join(" "), l = n.Children.map(i, (e) => {
|
|
5
5
|
if (n.isValidElement(e)) {
|
|
6
|
-
const
|
|
6
|
+
const t = e.props.className || "", m = t ? `join-item ${t}` : "join-item";
|
|
7
7
|
return n.cloneElement(e, {
|
|
8
8
|
className: m
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
return e;
|
|
12
12
|
});
|
|
13
|
-
return /* @__PURE__ */ c("div", { className:
|
|
13
|
+
return /* @__PURE__ */ c("div", { className: r, ...a, children: l });
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
p as Join
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=index45.js.map
|
package/dist/index47.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as A } from "react/jsx-runtime";
|
|
2
|
-
import d, { useContext as M, createContext as P, useState as C, useEffect as
|
|
2
|
+
import d, { useContext as M, createContext as P, useState as C, useEffect as _, useCallback as $ } from "react";
|
|
3
3
|
const L = P(null);
|
|
4
|
-
function
|
|
4
|
+
function K() {
|
|
5
5
|
return M(L);
|
|
6
6
|
}
|
|
7
7
|
function h({ children: n, className: s = "", style: a }) {
|
|
@@ -25,7 +25,7 @@ function h({ children: n, className: s = "", style: a }) {
|
|
|
25
25
|
return /* @__PURE__ */ o("div", { className: m, style: a, children: r });
|
|
26
26
|
}
|
|
27
27
|
h.displayName = "LayoutRoot";
|
|
28
|
-
function
|
|
28
|
+
function F({ children: n, className: s = "", style: a }) {
|
|
29
29
|
const e = [
|
|
30
30
|
"flex",
|
|
31
31
|
"items-center",
|
|
@@ -37,7 +37,7 @@ function H({ children: n, className: s = "", style: a }) {
|
|
|
37
37
|
].filter(Boolean).join(" ");
|
|
38
38
|
return /* @__PURE__ */ o("header", { className: e, style: a, children: n });
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function H({ children: n, className: s = "", style: a }) {
|
|
41
41
|
const e = [
|
|
42
42
|
"px-6",
|
|
43
43
|
"py-4",
|
|
@@ -48,11 +48,11 @@ function I({ children: n, className: s = "", style: a }) {
|
|
|
48
48
|
].filter(Boolean).join(" ");
|
|
49
49
|
return /* @__PURE__ */ o("footer", { className: e, style: a, children: n });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function I({ children: n, className: s = "", style: a }) {
|
|
52
52
|
const e = ["flex-1", "min-h-0", "overflow-auto", s].filter(Boolean).join(" ");
|
|
53
53
|
return /* @__PURE__ */ o("main", { className: e, style: a, children: n });
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const O = {
|
|
56
56
|
sm: "(max-width: 639px)",
|
|
57
57
|
md: "(max-width: 767px)",
|
|
58
58
|
lg: "(max-width: 1023px)",
|
|
@@ -74,15 +74,15 @@ function v({
|
|
|
74
74
|
style: g
|
|
75
75
|
}) {
|
|
76
76
|
const [j, N] = C(f), [b, k] = C(!1), l = e ?? j;
|
|
77
|
-
|
|
77
|
+
_(() => {
|
|
78
78
|
if (!i) return;
|
|
79
|
-
const c = window.matchMedia(
|
|
79
|
+
const c = window.matchMedia(O[i]), y = (R) => {
|
|
80
80
|
const u = R.matches;
|
|
81
81
|
k(u), p?.(u), e === void 0 && N(u), u !== b && r?.(u);
|
|
82
82
|
};
|
|
83
83
|
return y(c), c.addEventListener("change", y), () => c.removeEventListener("change", y);
|
|
84
84
|
}, [i, p, e, r, b]);
|
|
85
|
-
const S =
|
|
85
|
+
const S = $(() => {
|
|
86
86
|
const c = !l;
|
|
87
87
|
e === void 0 && N(c), r?.(c);
|
|
88
88
|
}, [l, e, r]), x = l ? a : s, B = [
|
|
@@ -127,14 +127,14 @@ function v({
|
|
|
127
127
|
) });
|
|
128
128
|
}
|
|
129
129
|
v.displayName = "LayoutSider";
|
|
130
|
-
const
|
|
131
|
-
Header:
|
|
132
|
-
Footer:
|
|
133
|
-
Content:
|
|
130
|
+
const Q = Object.assign(h, {
|
|
131
|
+
Header: F,
|
|
132
|
+
Footer: H,
|
|
133
|
+
Content: I,
|
|
134
134
|
Sider: v
|
|
135
135
|
});
|
|
136
136
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
Q as Layout,
|
|
138
|
+
K as useSiderContext
|
|
139
139
|
};
|
|
140
140
|
//# sourceMappingURL=index47.js.map
|
package/dist/index51.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import F, { useRef as R, useState as b, useCallback as I, useLayoutEffect as A } from "react";
|
|
3
3
|
const d = {
|
|
4
4
|
sm: 640,
|
|
5
5
|
md: 768,
|
|
@@ -10,7 +10,7 @@ const d = {
|
|
|
10
10
|
function L(t, e) {
|
|
11
11
|
return typeof t == "number" ? t : t ? t["2xl"] !== void 0 && e >= d["2xl"] ? t["2xl"] : t.xl !== void 0 && e >= d.xl ? t.xl : t.lg !== void 0 && e >= d.lg ? t.lg : t.md !== void 0 && e >= d.md ? t.md : t.sm !== void 0 && e >= d.sm ? t.sm : t.xs !== void 0 ? t.xs : 3 : 3;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const K = ({
|
|
14
14
|
children: t,
|
|
15
15
|
columns: e = 3,
|
|
16
16
|
gap: r = 16,
|
|
@@ -18,21 +18,21 @@ const O = ({
|
|
|
18
18
|
style: M,
|
|
19
19
|
...P
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
const i =
|
|
21
|
+
const h = R(null), [l, T] = b([]), [y, _] = b(0), w = R([]), c = F.Children.toArray(t), s = I(() => {
|
|
22
|
+
const i = h.current;
|
|
23
23
|
if (!i || c.length === 0) return;
|
|
24
|
-
const n = i.offsetWidth, m = typeof window < "u" ? window.innerWidth : n, a = L(e, m),
|
|
25
|
-
c.forEach((
|
|
24
|
+
const n = i.offsetWidth, m = typeof window < "u" ? window.innerWidth : n, a = L(e, m), S = (n - r * (a - 1)) / a, o = new Array(a).fill(0), W = [];
|
|
25
|
+
c.forEach((O, x) => {
|
|
26
26
|
const C = w.current[x];
|
|
27
27
|
if (!C) return;
|
|
28
|
-
let
|
|
28
|
+
let u = 0, E = o[0];
|
|
29
29
|
for (let f = 1; f < a; f++)
|
|
30
|
-
o[f] < E && (E = o[f],
|
|
31
|
-
const
|
|
32
|
-
W[x] = { left:
|
|
33
|
-
const
|
|
34
|
-
o[
|
|
35
|
-
}), T(W),
|
|
30
|
+
o[f] < E && (E = o[f], u = f);
|
|
31
|
+
const j = u * (S + r), k = o[u];
|
|
32
|
+
W[x] = { left: j, top: k };
|
|
33
|
+
const B = C.offsetHeight;
|
|
34
|
+
o[u] += B + r;
|
|
35
|
+
}), T(W), _(Math.max(...o) - r);
|
|
36
36
|
}, [t, e, r, c.length]);
|
|
37
37
|
A(() => {
|
|
38
38
|
s();
|
|
@@ -44,11 +44,11 @@ const O = ({
|
|
|
44
44
|
const i = setTimeout(s, 0);
|
|
45
45
|
return () => clearTimeout(i);
|
|
46
46
|
}, [t, s]);
|
|
47
|
-
const v =
|
|
47
|
+
const v = h.current?.offsetWidth ?? 0, N = typeof window < "u" ? window.innerWidth : v, g = L(e, N), p = v > 0 ? (v - r * (g - 1)) / g : 0;
|
|
48
48
|
return /* @__PURE__ */ H(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
|
-
ref:
|
|
51
|
+
ref: h,
|
|
52
52
|
className: z,
|
|
53
53
|
style: {
|
|
54
54
|
position: "relative",
|
|
@@ -76,9 +76,9 @@ const O = ({
|
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
K.displayName = "Masonry";
|
|
80
80
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
K as Masonry,
|
|
82
|
+
K as default
|
|
83
83
|
};
|
|
84
84
|
//# sourceMappingURL=index51.js.map
|