asterui 0.12.9 → 0.12.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Hero.d.ts +6 -13
- package/dist/components/Space.d.ts +1 -0
- package/dist/components/Splitter.d.ts +2 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +63 -65
- package/dist/index.js.map +1 -1
- package/dist/index100.js +11 -44
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +12 -10
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +7 -14
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +12 -7
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +29 -11
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +16 -29
- package/dist/index105.js.map +1 -1
- package/dist/index35.js +13 -26
- package/dist/index35.js.map +1 -1
- package/dist/index74.js +37 -25
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +223 -103
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +21 -51
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +31 -22
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +22 -31
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +327 -20
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +50 -323
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +40 -56
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +23 -40
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +93 -21
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +148 -87
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +152 -147
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +63 -159
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +35 -65
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +234 -35
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +31 -231
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +210 -34
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +198 -195
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +241 -159
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +166 -283
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +253 -173
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +14 -258
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +31 -12
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +5 -32
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +13 -5
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +43 -11
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Stack.d.ts +0 -10
- package/dist/index106.js +0 -21
- package/dist/index106.js.map +0 -1
package/dist/index35.js
CHANGED
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function s({
|
|
3
|
-
children: o,
|
|
4
|
-
className: e = "",
|
|
5
|
-
...n
|
|
6
|
-
}) {
|
|
7
|
-
const t = ["hero", e].filter(Boolean).join(" ");
|
|
8
|
-
return /* @__PURE__ */ r("div", { className: t, ...n, children: o });
|
|
9
|
-
}
|
|
10
|
-
function a({
|
|
11
|
-
children: o,
|
|
12
|
-
className: e = "",
|
|
13
|
-
...n
|
|
14
|
-
}) {
|
|
15
|
-
const t = ["hero-content", e].filter(Boolean).join(" ");
|
|
16
|
-
return /* @__PURE__ */ r("div", { className: t, ...n, children: o });
|
|
17
|
-
}
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
18
2
|
function c({
|
|
19
3
|
children: o,
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
overlay: s = !1,
|
|
5
|
+
contentClassName: a = "",
|
|
6
|
+
className: r = "",
|
|
7
|
+
...l
|
|
22
8
|
}) {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
9
|
+
const n = ["hero", r].filter(Boolean).join(" "), t = ["hero-content", a].filter(Boolean).join(" ");
|
|
10
|
+
return /* @__PURE__ */ i("div", { className: n, ...l, children: [
|
|
11
|
+
s && /* @__PURE__ */ e("div", { className: "hero-overlay bg-opacity-60" }),
|
|
12
|
+
/* @__PURE__ */ e("div", { className: t, children: o })
|
|
13
|
+
] });
|
|
25
14
|
}
|
|
26
|
-
|
|
27
|
-
Content: a,
|
|
28
|
-
Overlay: c
|
|
29
|
-
});
|
|
15
|
+
c.displayName = "Hero";
|
|
30
16
|
export {
|
|
31
|
-
|
|
17
|
+
c as Hero,
|
|
18
|
+
c as default
|
|
32
19
|
};
|
|
33
20
|
//# sourceMappingURL=index35.js.map
|
package/dist/index35.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index35.js","sources":["../src/components/Hero.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface HeroProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n
|
|
1
|
+
{"version":3,"file":"index35.js","sources":["../src/components/Hero.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface HeroProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n overlay?: boolean\n contentClassName?: string\n}\n\nexport function Hero({\n children,\n overlay = false,\n contentClassName = '',\n className = '',\n ...rest\n}: HeroProps) {\n const heroClasses = ['hero', className].filter(Boolean).join(' ')\n const contentClasses = ['hero-content', contentClassName].filter(Boolean).join(' ')\n\n return (\n <div className={heroClasses} {...rest}>\n {overlay && <div className=\"hero-overlay bg-opacity-60\" />}\n <div className={contentClasses}>{children}</div>\n </div>\n )\n}\n\nHero.displayName = 'Hero'\n\nexport default Hero\n"],"names":["Hero","children","overlay","contentClassName","className","rest","heroClasses","contentClasses","jsxs","jsx"],"mappings":";AAQO,SAASA,EAAK;AAAA,EACnB,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,kBAAAC,IAAmB;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAc;AACZ,QAAMC,IAAc,CAAC,QAAQF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAC1DG,IAAiB,CAAC,gBAAgBJ,CAAgB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAElF,SACE,gBAAAK,EAAC,OAAA,EAAI,WAAWF,GAAc,GAAGD,GAC9B,UAAA;AAAA,IAAAH,KAAW,gBAAAO,EAAC,OAAA,EAAI,WAAU,6BAAA,CAA6B;AAAA,IACxD,gBAAAA,EAAC,OAAA,EAAI,WAAWF,GAAiB,UAAAN,EAAA,CAAS;AAAA,EAAA,GAC5C;AAEJ;AAEAD,EAAK,cAAc;"}
|
package/dist/index74.js
CHANGED
|
@@ -1,49 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
|
+
const w = {
|
|
3
4
|
xs: "gap-1",
|
|
4
5
|
sm: "gap-2",
|
|
5
6
|
md: "gap-4",
|
|
6
7
|
lg: "gap-6",
|
|
7
8
|
xl: "gap-8"
|
|
8
|
-
},
|
|
9
|
+
}, v = {
|
|
9
10
|
start: "items-start",
|
|
10
11
|
end: "items-end",
|
|
11
12
|
center: "items-center",
|
|
12
13
|
baseline: "items-baseline",
|
|
13
14
|
stretch: "items-stretch"
|
|
14
|
-
},
|
|
15
|
+
}, N = {
|
|
15
16
|
start: "justify-start",
|
|
16
17
|
end: "justify-end",
|
|
17
18
|
center: "justify-center",
|
|
18
19
|
between: "justify-between",
|
|
19
20
|
around: "justify-around",
|
|
20
21
|
evenly: "justify-evenly"
|
|
21
|
-
},
|
|
22
|
-
direction:
|
|
22
|
+
}, z = ({
|
|
23
|
+
direction: f = "horizontal",
|
|
23
24
|
size: s = "md",
|
|
24
|
-
align:
|
|
25
|
-
justify:
|
|
26
|
-
wrap:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
align: r,
|
|
26
|
+
justify: a,
|
|
27
|
+
wrap: p = !1,
|
|
28
|
+
split: l,
|
|
29
|
+
className: u = "",
|
|
30
|
+
style: d,
|
|
31
|
+
children: e,
|
|
32
|
+
...m
|
|
31
33
|
}) => {
|
|
32
|
-
const
|
|
34
|
+
const o = typeof s == "number", h = o ? "" : w[s], y = r ? v[r] : "", C = a ? N[a] : "", g = [
|
|
33
35
|
"flex",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
].filter(Boolean).join(" "),
|
|
41
|
-
...
|
|
42
|
-
...
|
|
36
|
+
f === "horizontal" ? "flex-row" : "flex-col",
|
|
37
|
+
h,
|
|
38
|
+
y,
|
|
39
|
+
C,
|
|
40
|
+
p ? "flex-wrap" : "",
|
|
41
|
+
u
|
|
42
|
+
].filter(Boolean).join(" "), j = {
|
|
43
|
+
...d,
|
|
44
|
+
...o ? { gap: `${s}px` } : {}
|
|
43
45
|
};
|
|
44
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ c("div", { className: g, style: j, ...m, children: (() => {
|
|
47
|
+
if (!l) return e;
|
|
48
|
+
const t = b.Children.toArray(e).filter(Boolean);
|
|
49
|
+
if (t.length <= 1) return e;
|
|
50
|
+
const n = [];
|
|
51
|
+
return t.forEach((x, i) => {
|
|
52
|
+
n.push(x), i < t.length - 1 && n.push(
|
|
53
|
+
/* @__PURE__ */ c("span", { className: "flex-shrink-0", children: l }, `split-${i}`)
|
|
54
|
+
);
|
|
55
|
+
}), n;
|
|
56
|
+
})() });
|
|
45
57
|
};
|
|
46
58
|
export {
|
|
47
|
-
|
|
59
|
+
z as Space
|
|
48
60
|
};
|
|
49
61
|
//# sourceMappingURL=index74.js.map
|
package/dist/index74.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index74.js","sources":["../src/components/Space.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'horizontal' | 'vertical'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n wrap?: boolean\n children: React.ReactNode\n}\n\nconst gapClasses = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n} as const\n\nconst alignClasses = {\n start: 'items-start',\n end: 'items-end',\n center: 'items-center',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n} as const\n\nconst justifyClasses = {\n start: 'justify-start',\n end: 'justify-end',\n center: 'justify-center',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n} as const\n\nexport const Space: React.FC<SpaceProps> = ({\n direction = 'horizontal',\n size = 'md',\n align,\n justify,\n wrap = false,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericSize = typeof size === 'number'\n const gapClass = isNumericSize ? '' : gapClasses[size]\n const alignClass = align ? alignClasses[align] : ''\n const justifyClass = justify ? justifyClasses[justify] : ''\n const wrapClass = wrap ? 'flex-wrap' : ''\n const directionClass = direction === 'horizontal' ? 'flex-row' : 'flex-col'\n\n const classes = [\n 'flex',\n directionClass,\n gapClass,\n alignClass,\n justifyClass,\n wrapClass,\n className\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericSize ? { gap: `${size}px` } : {}),\n }\n\n return <div className={classes} style={combinedStyle} {...rest}>{
|
|
1
|
+
{"version":3,"file":"index74.js","sources":["../src/components/Space.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'horizontal' | 'vertical'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n wrap?: boolean\n split?: React.ReactNode\n children: React.ReactNode\n}\n\nconst gapClasses = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n} as const\n\nconst alignClasses = {\n start: 'items-start',\n end: 'items-end',\n center: 'items-center',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n} as const\n\nconst justifyClasses = {\n start: 'justify-start',\n end: 'justify-end',\n center: 'justify-center',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n} as const\n\nexport const Space: React.FC<SpaceProps> = ({\n direction = 'horizontal',\n size = 'md',\n align,\n justify,\n wrap = false,\n split,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericSize = typeof size === 'number'\n const gapClass = isNumericSize ? '' : gapClasses[size]\n const alignClass = align ? alignClasses[align] : ''\n const justifyClass = justify ? justifyClasses[justify] : ''\n const wrapClass = wrap ? 'flex-wrap' : ''\n const directionClass = direction === 'horizontal' ? 'flex-row' : 'flex-col'\n\n const classes = [\n 'flex',\n directionClass,\n gapClass,\n alignClass,\n justifyClass,\n wrapClass,\n className\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericSize ? { gap: `${size}px` } : {}),\n }\n\n // If split is provided, interleave separator between children\n const renderChildren = () => {\n if (!split) return children\n\n const childArray = React.Children.toArray(children).filter(Boolean)\n if (childArray.length <= 1) return children\n\n const result: React.ReactNode[] = []\n childArray.forEach((child, index) => {\n result.push(child)\n if (index < childArray.length - 1) {\n result.push(\n <span key={`split-${index}`} className=\"flex-shrink-0\">\n {split}\n </span>\n )\n }\n })\n return result\n }\n\n return <div className={classes} style={combinedStyle} {...rest}>{renderChildren()}</div>\n}\n"],"names":["gapClasses","alignClasses","justifyClasses","Space","direction","size","align","justify","wrap","split","className","style","children","rest","isNumericSize","gapClass","alignClass","justifyClass","classes","combinedStyle","jsx","childArray","React","result","child","index"],"mappings":";;AAYA,MAAMA,IAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAe;AAAA,EACnB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AACX,GAEMC,IAAiB;AAAA,EACrB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV,GAEaC,IAA8B,CAAC;AAAA,EAC1C,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgB,OAAOT,KAAS,UAChCU,IAAWD,IAAgB,KAAKd,EAAWK,CAAI,GAC/CW,IAAaV,IAAQL,EAAaK,CAAK,IAAI,IAC3CW,IAAeV,IAAUL,EAAeK,CAAO,IAAI,IAInDW,IAAU;AAAA,IACd;AAAA,IAHqBd,MAAc,eAAe,aAAa;AAAA,IAK/DW;AAAA,IACAC;AAAA,IACAC;AAAA,IARgBT,IAAO,cAAc;AAAA,IAUrCE;AAAA,EAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG,GAEpBS,IAAqC;AAAA,IACzC,GAAGR;AAAA,IACH,GAAIG,IAAgB,EAAE,KAAK,GAAGT,CAAI,SAAS,CAAA;AAAA,EAAC;AAwB9C,SAAO,gBAAAe,EAAC,SAAI,WAAWF,GAAS,OAAOC,GAAgB,GAAGN,GAAO,WApB1C,MAAM;AAC3B,QAAI,CAACJ,EAAO,QAAOG;AAEnB,UAAMS,IAAaC,EAAM,SAAS,QAAQV,CAAQ,EAAE,OAAO,OAAO;AAClE,QAAIS,EAAW,UAAU,EAAG,QAAOT;AAEnC,UAAMW,IAA4B,CAAA;AAClC,WAAAF,EAAW,QAAQ,CAACG,GAAOC,MAAU;AACnC,MAAAF,EAAO,KAAKC,CAAK,GACbC,IAAQJ,EAAW,SAAS,KAC9BE,EAAO;AAAA,0BACJ,QAAA,EAA4B,WAAU,iBACpC,UAAAd,KADQ,SAASgB,CAAK,EAEzB;AAAA,MAAA;AAAA,IAGN,CAAC,GACMF;AAAA,EACT,GAEiE,EAAe,CAAE;AACpF;"}
|
package/dist/index75.js
CHANGED
|
@@ -1,137 +1,257 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
children:
|
|
5
|
-
direction:
|
|
6
|
-
sizes:
|
|
7
|
-
defaultSizes:
|
|
8
|
-
onSizesChange:
|
|
9
|
-
gutterSize:
|
|
10
|
-
minSize:
|
|
11
|
-
className:
|
|
1
|
+
import { jsx as h, jsxs as K, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import T, { useRef as L, useState as J, useCallback as y, useEffect as Q } from "react";
|
|
3
|
+
const pe = ({ children: M }) => /* @__PURE__ */ h(ie, { children: M }), ue = ({
|
|
4
|
+
children: M,
|
|
5
|
+
direction: z = "horizontal",
|
|
6
|
+
sizes: P,
|
|
7
|
+
defaultSizes: $,
|
|
8
|
+
onSizesChange: F,
|
|
9
|
+
gutterSize: R = 8,
|
|
10
|
+
minSize: E = 50,
|
|
11
|
+
className: Z = ""
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
const D = L(null), I = L([]), x = L(null), u = T.Children.toArray(M).filter(
|
|
14
|
+
(e) => T.isValidElement(e)
|
|
15
|
+
), m = u.length, [f, W] = J(
|
|
16
|
+
() => u.map((e) => e.props.defaultCollapsed ?? e.props.collapsed ?? !1)
|
|
17
|
+
), X = L([]), j = y(() => {
|
|
18
|
+
const e = u.map((s) => s.props.defaultSize), o = e.some((s) => s !== void 0);
|
|
19
|
+
if ($ && $.length === m)
|
|
20
|
+
return $;
|
|
21
|
+
if (o) {
|
|
22
|
+
const s = e.reduce((l, n) => l + (n ?? 0), 0), r = e.filter((l) => l === void 0).length, a = Math.max(0, 100 - s), t = r > 0 ? a / r : 0;
|
|
23
|
+
return e.map((l) => l ?? t);
|
|
24
|
+
}
|
|
25
|
+
const i = 100 / m;
|
|
26
|
+
return Array(m).fill(i);
|
|
27
|
+
}, [$, m, u]), [k, Y] = J(j), ee = y(() => {
|
|
28
|
+
const e = u.map((t) => t.props.size);
|
|
29
|
+
if (!e.some((t) => t !== void 0)) return null;
|
|
30
|
+
const i = e.reduce((t, l) => t + (l ?? 0), 0), s = e.filter((t) => t === void 0).length, r = Math.max(0, 100 - i), a = s > 0 ? r / s : 0;
|
|
31
|
+
return e.map((t, l) => t ?? k[l] ?? a);
|
|
32
|
+
}, [u, k]), d = P || ee() || k;
|
|
33
|
+
Q(() => {
|
|
34
|
+
!P && k.length !== m && Y(j());
|
|
35
|
+
}, [m, P, k.length, j]), Q(() => {
|
|
36
|
+
const e = u.map(
|
|
37
|
+
(i, s) => i.props.collapsed ?? f[s] ?? !1
|
|
38
|
+
);
|
|
39
|
+
e.some((i, s) => i !== f[s]) && W(e);
|
|
40
|
+
}, [u.map((e) => e.props.collapsed).join(",")]);
|
|
41
|
+
const b = y(
|
|
42
|
+
(e) => {
|
|
43
|
+
P || Y(e), F?.(e);
|
|
44
|
+
},
|
|
45
|
+
[P, F]
|
|
46
|
+
), _ = y(
|
|
47
|
+
(e) => {
|
|
48
|
+
const o = u[e];
|
|
49
|
+
if (!o?.props.collapsible) return;
|
|
50
|
+
const s = !f[e], r = [...f];
|
|
51
|
+
if (r[e] = s, W(r), o.props.onCollapse?.(s), s) {
|
|
52
|
+
X.current = [...d];
|
|
53
|
+
const a = 0, t = d[e] - a, l = d.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]);
|
|
54
|
+
if (l.length > 0) {
|
|
55
|
+
const n = t / l.length, c = d.map((p, w) => w === e ? a : r[w] ? p : p + n);
|
|
56
|
+
b(c);
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
const a = X.current[e] || 100 / m, l = d.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]).reduce((n, c) => n + c.size, 0);
|
|
60
|
+
if (l > 0) {
|
|
61
|
+
const n = d.map((c, p) => {
|
|
62
|
+
if (p === e) return a;
|
|
63
|
+
if (!r[p]) {
|
|
64
|
+
const w = c / l;
|
|
65
|
+
return c - a * w;
|
|
66
|
+
}
|
|
67
|
+
return c;
|
|
68
|
+
});
|
|
69
|
+
b(n);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
27
72
|
},
|
|
28
|
-
[
|
|
29
|
-
),
|
|
30
|
-
(
|
|
31
|
-
e
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
[u, f, d, m, b]
|
|
74
|
+
), te = y(
|
|
75
|
+
(e, o) => {
|
|
76
|
+
const i = u[e]?.props || {}, s = u[e + 1]?.props || {};
|
|
77
|
+
if (i.resizable === !1 || s.resizable === !1 || f[e] || f[e + 1])
|
|
78
|
+
return;
|
|
79
|
+
o.preventDefault();
|
|
80
|
+
const r = z === "horizontal" ? o.clientX : o.clientY;
|
|
81
|
+
x.current = {
|
|
82
|
+
index: e,
|
|
83
|
+
startPos: r,
|
|
84
|
+
startSizes: [...d]
|
|
37
85
|
};
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
const { index:
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
|
|
86
|
+
const a = (l) => {
|
|
87
|
+
if (!x.current || !D.current) return;
|
|
88
|
+
const { index: n, startPos: c, startSizes: p } = x.current, w = D.current.getBoundingClientRect(), se = z === "horizontal" ? w.width : w.height, re = z === "horizontal" ? l.clientX : l.clientY, le = (m - 1) * R, N = se - le, q = (re - c) / N * 100, G = u[n]?.props || {}, H = u[n + 1]?.props || {}, ae = G.minSize ?? E, ce = H.minSize ?? E, A = ae / N * 100, B = ce / N * 100;
|
|
89
|
+
let v = p[n] + q, C = p[n + 1] - q;
|
|
90
|
+
v < A && (v = A, C = p[n] + p[n + 1] - A), C < B && (C = B, v = p[n] + p[n + 1] - B);
|
|
91
|
+
const O = G.maxSize, V = H.maxSize;
|
|
92
|
+
if (O) {
|
|
93
|
+
const S = O / N * 100;
|
|
94
|
+
v > S && (v = S, C = p[n] + p[n + 1] - S);
|
|
47
95
|
}
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
|
|
96
|
+
if (V) {
|
|
97
|
+
const S = V / N * 100;
|
|
98
|
+
C > S && (C = S, v = p[n] + p[n + 1] - S);
|
|
51
99
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
100
|
+
const U = [...p];
|
|
101
|
+
U[n] = v, U[n + 1] = C, b(U);
|
|
102
|
+
}, t = () => {
|
|
103
|
+
x.current = null, document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", t), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
56
104
|
};
|
|
57
|
-
document.addEventListener("mousemove",
|
|
105
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", t), document.body.style.cursor = z === "horizontal" ? "col-resize" : "row-resize", document.body.style.userSelect = "none";
|
|
58
106
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
107
|
+
[z, d, m, R, u, E, b, f]
|
|
108
|
+
), oe = y(
|
|
109
|
+
(e, o) => {
|
|
110
|
+
if (f[e] || f[e + 1])
|
|
111
|
+
return;
|
|
112
|
+
const i = o.shiftKey ? 10 : 1;
|
|
113
|
+
let s = 0;
|
|
114
|
+
if (z === "horizontal" ? o.key === "ArrowLeft" ? s = -i : o.key === "ArrowRight" && (s = i) : o.key === "ArrowUp" ? s = -i : o.key === "ArrowDown" && (s = i), s !== 0) {
|
|
115
|
+
o.preventDefault();
|
|
116
|
+
const r = [...d], a = 5;
|
|
117
|
+
let t = r[e] + s, l = r[e + 1] - s;
|
|
118
|
+
t >= a && l >= a && (r[e] = t, r[e + 1] = l, b(r));
|
|
69
119
|
}
|
|
70
120
|
},
|
|
71
|
-
[
|
|
72
|
-
),
|
|
73
|
-
|
|
121
|
+
[z, d, b, f]
|
|
122
|
+
), g = z === "horizontal", ne = (e) => {
|
|
123
|
+
const o = u[e], i = u[e + 1], s = o?.props.collapsible, r = i?.props.collapsible, a = f[e], t = f[e + 1];
|
|
124
|
+
return {
|
|
125
|
+
showStart: s && !t,
|
|
126
|
+
showEnd: r && !a,
|
|
127
|
+
panel1Collapsed: a,
|
|
128
|
+
panel2Collapsed: t
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ h(
|
|
74
132
|
"div",
|
|
75
133
|
{
|
|
76
|
-
ref:
|
|
77
|
-
className: `flex ${
|
|
78
|
-
children:
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
134
|
+
ref: D,
|
|
135
|
+
className: `flex ${g ? "flex-row" : "flex-col"} h-full w-full ${Z}`,
|
|
136
|
+
children: u.map((e, o) => {
|
|
137
|
+
const i = e.props, s = o === u.length - 1, r = f[o], a = i.resizable !== !1 && !r;
|
|
138
|
+
return /* @__PURE__ */ K(T.Fragment, { children: [
|
|
139
|
+
/* @__PURE__ */ h(
|
|
82
140
|
"div",
|
|
83
141
|
{
|
|
84
|
-
ref: (
|
|
85
|
-
|
|
142
|
+
ref: (t) => {
|
|
143
|
+
I.current[o] = t;
|
|
86
144
|
},
|
|
87
|
-
className: `overflow-auto ${
|
|
145
|
+
className: `overflow-auto ${i.className || ""}`,
|
|
88
146
|
style: {
|
|
89
|
-
[
|
|
90
|
-
flexShrink: 0
|
|
147
|
+
[g ? "width" : "height"]: r ? "0px" : `calc(${d[o]}% - ${(m - 1) * R / m}px)`,
|
|
148
|
+
flexShrink: 0,
|
|
149
|
+
overflow: r ? "hidden" : "auto"
|
|
91
150
|
},
|
|
92
|
-
|
|
151
|
+
"data-collapsed": r,
|
|
152
|
+
children: i.children
|
|
93
153
|
}
|
|
94
154
|
),
|
|
95
|
-
!
|
|
155
|
+
!s && /* @__PURE__ */ h(
|
|
96
156
|
"div",
|
|
97
157
|
{
|
|
98
158
|
role: "separator",
|
|
99
|
-
"aria-orientation":
|
|
100
|
-
"aria-valuenow": Math.round(
|
|
101
|
-
tabIndex: 0,
|
|
159
|
+
"aria-orientation": g ? "vertical" : "horizontal",
|
|
160
|
+
"aria-valuenow": Math.round(d[o]),
|
|
161
|
+
tabIndex: a ? 0 : -1,
|
|
102
162
|
className: `
|
|
103
|
-
flex-shrink-0 bg-base-300
|
|
104
|
-
|
|
105
|
-
${
|
|
163
|
+
flex-shrink-0 bg-base-300 transition-colors duration-150 relative group
|
|
164
|
+
${a ? "hover:bg-primary/30 active:bg-primary/50" : ""}
|
|
165
|
+
${a ? g ? "cursor-col-resize" : "cursor-row-resize" : "cursor-default"}
|
|
106
166
|
`,
|
|
107
167
|
style: {
|
|
108
|
-
[
|
|
168
|
+
[g ? "width" : "height"]: `${R}px`
|
|
109
169
|
},
|
|
110
|
-
onMouseDown: (
|
|
111
|
-
onKeyDown: (
|
|
112
|
-
children:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
170
|
+
onMouseDown: (t) => te(o, t),
|
|
171
|
+
onKeyDown: (t) => oe(o, t),
|
|
172
|
+
children: (() => {
|
|
173
|
+
const { showStart: t, showEnd: l, panel1Collapsed: n, panel2Collapsed: c } = ne(o);
|
|
174
|
+
return !t && !l ? /* @__PURE__ */ K(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: `
|
|
178
|
+
absolute inset-0 flex items-center justify-center
|
|
179
|
+
${g ? "flex-col gap-0.5" : "flex-row gap-0.5"}
|
|
180
|
+
`,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" }),
|
|
183
|
+
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" }),
|
|
184
|
+
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
) : /* @__PURE__ */ K(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
className: `
|
|
191
|
+
absolute inset-0 flex items-center justify-center
|
|
192
|
+
${g ? "flex-col" : "flex-row"}
|
|
193
|
+
`,
|
|
194
|
+
children: [
|
|
195
|
+
t && /* @__PURE__ */ h(
|
|
196
|
+
"button",
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
onClick: (p) => {
|
|
200
|
+
p.stopPropagation(), _(o);
|
|
201
|
+
},
|
|
202
|
+
className: `
|
|
203
|
+
p-0.5 rounded hover:bg-base-content/20 transition-colors
|
|
204
|
+
|
|
205
|
+
`,
|
|
206
|
+
"aria-label": n ? "Expand panel" : "Collapse panel",
|
|
207
|
+
children: /* @__PURE__ */ h(
|
|
208
|
+
"svg",
|
|
209
|
+
{
|
|
210
|
+
className: `w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${n ? g ? "rotate-180" : "-rotate-90" : g ? "rotate-0" : "rotate-90"}`,
|
|
211
|
+
fill: "none",
|
|
212
|
+
viewBox: "0 0 24 24",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
l && /* @__PURE__ */ h(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
type: "button",
|
|
223
|
+
onClick: (p) => {
|
|
224
|
+
p.stopPropagation(), _(o + 1);
|
|
225
|
+
},
|
|
226
|
+
className: `
|
|
227
|
+
p-0.5 rounded hover:bg-base-content/20 transition-colors
|
|
228
|
+
`,
|
|
229
|
+
"aria-label": c ? "Expand panel" : "Collapse panel",
|
|
230
|
+
children: /* @__PURE__ */ h(
|
|
231
|
+
"svg",
|
|
232
|
+
{
|
|
233
|
+
className: `w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${c ? g ? "rotate-0" : "rotate-90" : g ? "rotate-180" : "-rotate-90"}`,
|
|
234
|
+
fill: "none",
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
})()
|
|
126
246
|
}
|
|
127
247
|
)
|
|
128
|
-
] },
|
|
248
|
+
] }, o);
|
|
129
249
|
})
|
|
130
250
|
}
|
|
131
251
|
);
|
|
132
252
|
};
|
|
133
|
-
|
|
253
|
+
ue.Panel = pe;
|
|
134
254
|
export {
|
|
135
|
-
|
|
255
|
+
ue as Splitter
|
|
136
256
|
};
|
|
137
257
|
//# sourceMappingURL=index75.js.map
|