@cronocode/react-box 3.0.13 → 3.0.15
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/array.d.ts +13 -0
- package/components/checkbox.mjs +4 -4
- package/components/dataGrid/contracts/dataGridContract.d.ts +36 -0
- package/components/dataGrid/dataGridCell.d.ts +8 -0
- package/components/dataGrid/dataGridGroupRow.d.ts +6 -0
- package/components/dataGrid/dataGridHeaderCell.d.ts +6 -0
- package/components/dataGrid/dataGridPagination.d.ts +6 -0
- package/components/dataGrid/dataGridRow.d.ts +6 -0
- package/components/dataGrid/models/cellModel.d.ts +10 -0
- package/components/dataGrid/models/columnModel.d.ts +36 -0
- package/components/dataGrid/models/gridModel.d.ts +44 -0
- package/components/dataGrid/models/groupRowCellModel.d.ts +10 -0
- package/components/dataGrid/models/groupRowModel.d.ts +23 -0
- package/components/dataGrid/models/rowModel.d.ts +16 -0
- package/components/dataGrid/useGrid.d.ts +3 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +2 -7
- package/components/dataGrid.mjs +656 -18
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.d.ts +2 -2
- package/components/dropdown.mjs +62 -61
- package/components/form.mjs +5 -5
- package/components/semantics.d.ts +25 -25
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.mjs +31 -35
- package/core/boxConstants.d.ts +1 -0
- package/core/boxStyles.d.ts +108 -35
- package/core/boxStylesFormatters.d.ts +1 -1
- package/core/classNames.d.ts +1 -1
- package/core/extends/boxComponents.d.ts +86 -1
- package/core/useStyles.d.ts +2 -2
- package/core/variables.d.ts +1 -0
- package/core.cjs +4 -4
- package/core.mjs +623 -507
- package/hooks/useVisibility.d.ts +9 -1
- package/icons/arrowIcon.d.ts +2 -0
- package/icons/dotsIcon.d.ts +2 -0
- package/icons/groupingIcon.d.ts +2 -0
- package/icons/pinIcon.d.ts +2 -0
- package/package.json +1 -1
- package/types.d.ts +12 -23
- package/utils/fn/fnUtils.d.ts +4 -0
- package/utils/memo.d.ts +5 -0
- package/utils/object/objectUtils.d.ts +1 -1
- package/components/dataGrid/dataGridContract.d.ts +0 -24
- package/components/dataGrid/useGridData.d.ts +0 -7
package/components/dropdown.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),n=require("react"),h=require("../box.cjs"),L=require("./textbox.cjs"),G=require("./flex.cjs"),Q=require("../core.cjs"),X=require("./baseSvg.cjs"),Z=require("./tooltip.cjs"),K=require("./button.cjs");function ee(i,m){const{name:p,defaultValue:g,value:y,multiple:u,isSearchable:w,searchPlaceholder:B,children:
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),n=require("react"),h=require("../box.cjs"),L=require("./textbox.cjs"),G=require("./flex.cjs"),Q=require("../core.cjs"),X=require("./baseSvg.cjs"),Z=require("./tooltip.cjs"),K=require("./button.cjs");function ee(i,m){const{name:p,defaultValue:g,value:y,multiple:u,isSearchable:w,searchPlaceholder:B,children:D,hideIcon:H,onChange:s,...Y}=i,[J,j]=n.useState(Array.isArray(g)?g:g?[g]:[]),c="value"in i?Array.isArray(y)?y:y?[y]:[]:J,[I,U]=n.useState(""),[a,T,b]=Q.useVisibility(),N=n.useRef(null),V=n.useRef(null),[_,F]=n.useState(0),A=n.useMemo(()=>_>window.innerHeight/2,[_]),W=n.useMemo(()=>{var e;return A?((e=b.current)==null?void 0:e.getBoundingClientRect().height)??0:0},[A,b]),l=n.useMemo(()=>(Array.isArray(D)?D:[D]).flatMap(e=>e),[D]),O=n.useMemo(()=>l.filter(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownItem"}),[l]),f=n.useMemo(()=>O.filter(e=>w&&I?R(e).toLowerCase().includes(I.toLowerCase()):!0),[w,I,l]),x=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownUnselect"}),[l]),C=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownSelectAll"}),[l]),k=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownEmptyItem"}),[l]),M=n.useMemo(()=>l.find(e=>{var t;return((t=e.type)==null?void 0:t.displayName)==="DropdownDisplay"}),[l]),$=n.useMemo(()=>{if(M)return typeof M.props.children=="function"?M.props.children(c,a):M.props.children;const e=f.filter(o=>c.includes(o.props.value));if(u&&e.length>1)return e.map(o=>R(o)).join(", ");const t=e.at(0);return(t==null?void 0:t.props.children)??(t==null?void 0:t.props.value)??(u?null:x==null?void 0:x.props.children)},[u,f,c,x,a]),P=n.useCallback((e,...t)=>{if(t.length===0)j([]),s==null||s(void 0,[]);else if(u&&t.length>1){const o=t.map(d=>d.props.value);j(o),s==null||s(void 0,o)}else if(t.length===1){const o=t[0];if(u){const d=c.filter(q=>q!==o.props.value);d.length===c.length&&d.push(o.props.value),j(d),s==null||s(o.props.value,d)}else j([o.props.value]),s==null||s(o.props.value,[o.props.value])}u?(e.stopPropagation(),setTimeout(()=>{var o;return(o=N.current)==null?void 0:o.focus()},0)):(T(!1),setTimeout(()=>{var o;return(o=b.current)==null?void 0:o.focus()},0))},[u,c,j]);n.useEffect(()=>{a?setTimeout(()=>{var e,t,o;(e=N.current)==null||e.focus(),(o=(t=V.current)==null?void 0:t.querySelector('[aria-selected="true"]'))==null||o.scrollIntoView({block:"nearest"})},0):U("")},[a]);const E=C&&u&&f.length>c.length,z=x&&f.length>0&&!E;return r.jsxs(h,{width:"fit-content",children:[c.map(e=>r.jsx(L,{ref:m,name:p,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),r.jsxs(K,{ref:b,type:"button",component:"dropdown",onClick:()=>T(e=>!e),props:{tabIndex:0},...Y,children:[w&&r.jsx(L,{display:a&&w?"block":"none",clean:!0,flex1:!0,width:1,minHeight:5,placeholder:B,value:I,onChange:e=>U(e.target.value),ref:N,props:{onClick:e=>{a&&w&&e.stopPropagation()}}}),r.jsx(G,{component:"dropdown.display",display:a&&w?"none":"flex",children:$??r.jsx(r.Fragment,{children:" "})}),!H&&r.jsx(h,{children:r.jsx(X,{viewBox:"0 0 10 6",width:"0.6rem",rotate:a?180:0,children:r.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})})]}),a&&r.jsx(Z,{ref:V,top:A?void 0:0,bottom:A?2:void 0,style:{transform:`translateY(-${W}px)`},onPositionChange:e=>F(e.top-window.scrollY),children:(f.length>0||k)&&r.jsxs(h,{component:"dropdown.items",children:[z&&r.jsx(h,{component:"dropdown.unselect",selected:c.length===0,...x.props,props:{onClick:e=>P(e)}}),E&&r.jsx(h,{component:"dropdown.selectAll",...C.props,props:{onClick:e=>P(e,...O)}}),f.map(e=>{const{value:t,onClick:o,...d}=e.props;return r.jsx(h,{component:"dropdown.item",variant:u?"multiple":void 0,selected:c.includes(t),...d,props:{onClick:q=>{o==null||o(q),P(q,e)}}},t)}),f.length===0&&k&&r.jsx(h,{component:"dropdown.emptyItem",...k.props})]})})]})}function S(i){const m=p=>null;return m.displayName=i,m}const v=n.forwardRef(ee);v.Item=S("DropdownItem");v.Unselect=S("DropdownUnselect");v.SelectAll=S("DropdownSelectAll");v.EmptyItem=S("DropdownEmptyItem");v.Display=S("DropdownDisplay");function R(i){var m;if(i==null)return"";if(typeof i=="object"){const p=(m=i.props)==null?void 0:m.children;return p==null?"":typeof p=="object"?(Array.isArray(p)?p:[p]).map(y=>R(y)).join(""):p.toString()}return i.toString()}module.exports=v;
|
package/components/dropdown.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface Props<TVal> extends BoxProps<'button'> {
|
|
|
7
7
|
multiple?: boolean;
|
|
8
8
|
isSearchable?: boolean;
|
|
9
9
|
searchPlaceholder?: string;
|
|
10
|
-
|
|
10
|
+
hideIcon?: boolean;
|
|
11
11
|
onChange?: (value: Maybe<TVal>, values: TVal[]) => void;
|
|
12
12
|
}
|
|
13
13
|
interface DropdownItemProps<TVal> extends BoxProps {
|
|
@@ -15,7 +15,7 @@ interface DropdownItemProps<TVal> extends BoxProps {
|
|
|
15
15
|
onClick?(e: React.MouseEvent): void;
|
|
16
16
|
}
|
|
17
17
|
interface DropdownDisplayProps<TVal> extends Omit<BoxProps, 'children'> {
|
|
18
|
-
children: (selectedValues: TVal[], isOpen: boolean) => React.ReactNode;
|
|
18
|
+
children: ((selectedValues: TVal[], isOpen: boolean) => React.ReactNode) | React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
interface DropdownType {
|
|
21
21
|
<TVal>(props: Props<TVal>, ref: Ref<HTMLInputElement>): React.ReactNode;
|
package/components/dropdown.mjs
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as B, jsx as n, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as K, useState as V, useRef as J, useMemo as c, useCallback as ee, useEffect as te } from "react";
|
|
3
3
|
import h from "../box.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { b as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
const { name: p, defaultValue: g, value: y, multiple: a, isSearchable: w, searchPlaceholder:
|
|
4
|
+
import M from "./textbox.mjs";
|
|
5
|
+
import oe from "./flex.mjs";
|
|
6
|
+
import { b as re } from "../core.mjs";
|
|
7
|
+
import ne from "./baseSvg.mjs";
|
|
8
|
+
import le from "./tooltip.mjs";
|
|
9
|
+
import se from "./button.mjs";
|
|
10
|
+
function pe(s, m) {
|
|
11
|
+
const { name: p, defaultValue: g, value: y, multiple: a, isSearchable: w, searchPlaceholder: q, children: S, hideIcon: W, onChange: r, ..._ } = s, [$, x] = V(Array.isArray(g) ? g : g ? [g] : []), i = "value" in s ? Array.isArray(y) ? y : y ? [y] : [] : $, [A, R] = V(""), [d, C, b] = re(), T = J(null), E = J(null), [L, z] = V(0), N = c(() => L > window.innerHeight / 2, [L]), G = c(() => {
|
|
12
12
|
var e;
|
|
13
13
|
return N ? ((e = b.current) == null ? void 0 : e.getBoundingClientRect().height) ?? 0 : 0;
|
|
14
|
-
}, [N, b]),
|
|
14
|
+
}, [N, b]), l = c(
|
|
15
15
|
() => (Array.isArray(S) ? S : [S]).flatMap((e) => e),
|
|
16
16
|
[S]
|
|
17
|
-
),
|
|
17
|
+
), H = c(() => l.filter((e) => {
|
|
18
18
|
var t;
|
|
19
19
|
return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownItem";
|
|
20
|
-
}), [
|
|
20
|
+
}), [l]), f = c(() => H.filter((e) => w && A ? O(e).toLowerCase().includes(A.toLowerCase()) : !0), [w, A, l]), v = c(() => l.find((e) => {
|
|
21
21
|
var t;
|
|
22
22
|
return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownUnselect";
|
|
23
|
-
}), [
|
|
23
|
+
}), [l]), Y = c(() => l.find((e) => {
|
|
24
24
|
var t;
|
|
25
25
|
return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownSelectAll";
|
|
26
|
-
}), [
|
|
26
|
+
}), [l]), j = c(() => l.find((e) => {
|
|
27
27
|
var t;
|
|
28
28
|
return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownEmptyItem";
|
|
29
|
-
}), [
|
|
29
|
+
}), [l]), k = c(() => l.find((e) => {
|
|
30
30
|
var t;
|
|
31
31
|
return ((t = e.type) == null ? void 0 : t.displayName) === "DropdownDisplay";
|
|
32
|
-
}), [
|
|
33
|
-
if (
|
|
32
|
+
}), [l]), Q = c(() => {
|
|
33
|
+
if (k)
|
|
34
|
+
return typeof k.props.children == "function" ? k.props.children(i, d) : k.props.children;
|
|
34
35
|
const e = f.filter((o) => i.includes(o.props.value));
|
|
35
36
|
if (a && e.length > 1)
|
|
36
|
-
return e.map((o) =>
|
|
37
|
+
return e.map((o) => O(o)).join(", ");
|
|
37
38
|
const t = e.at(0);
|
|
38
39
|
return (t == null ? void 0 : t.props.children) ?? (t == null ? void 0 : t.props.value) ?? (a ? null : v == null ? void 0 : v.props.children);
|
|
39
|
-
}, [a, f, i, v, d]),
|
|
40
|
+
}, [a, f, i, v, d]), U = ee(
|
|
40
41
|
(e, ...t) => {
|
|
41
42
|
if (t.length === 0)
|
|
42
43
|
x([]), r == null || r(void 0, []);
|
|
@@ -46,52 +47,52 @@ function se(s, m) {
|
|
|
46
47
|
} else if (t.length === 1) {
|
|
47
48
|
const o = t[0];
|
|
48
49
|
if (a) {
|
|
49
|
-
const u = i.filter((
|
|
50
|
+
const u = i.filter((P) => P !== o.props.value);
|
|
50
51
|
u.length === i.length && u.push(o.props.value), x(u), r == null || r(o.props.value, u);
|
|
51
52
|
} else
|
|
52
53
|
x([o.props.value]), r == null || r(o.props.value, [o.props.value]);
|
|
53
54
|
}
|
|
54
55
|
a ? (e.stopPropagation(), setTimeout(() => {
|
|
55
56
|
var o;
|
|
56
|
-
return (o =
|
|
57
|
-
}, 0)) : (
|
|
57
|
+
return (o = T.current) == null ? void 0 : o.focus();
|
|
58
|
+
}, 0)) : (C(!1), setTimeout(() => {
|
|
58
59
|
var o;
|
|
59
60
|
return (o = b.current) == null ? void 0 : o.focus();
|
|
60
61
|
}, 0));
|
|
61
62
|
},
|
|
62
63
|
[a, i, x]
|
|
63
64
|
);
|
|
64
|
-
|
|
65
|
+
te(() => {
|
|
65
66
|
d ? setTimeout(() => {
|
|
66
67
|
var e, t, o;
|
|
67
|
-
(e =
|
|
68
|
-
}, 0) :
|
|
68
|
+
(e = T.current) == null || e.focus(), (o = (t = E.current) == null ? void 0 : t.querySelector('[aria-selected="true"]')) == null || o.scrollIntoView({ block: "nearest" });
|
|
69
|
+
}, 0) : R("");
|
|
69
70
|
}, [d]);
|
|
70
|
-
const
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
i.map((e) => /* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
71
|
+
const F = Y && a && f.length > i.length, X = v && f.length > 0 && !F;
|
|
72
|
+
return /* @__PURE__ */ B(h, { width: "fit-content", children: [
|
|
73
|
+
i.map((e) => /* @__PURE__ */ n(M, { ref: m, name: p, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
|
|
74
|
+
/* @__PURE__ */ B(
|
|
75
|
+
se,
|
|
75
76
|
{
|
|
76
77
|
ref: b,
|
|
77
78
|
type: "button",
|
|
78
79
|
component: "dropdown",
|
|
79
|
-
onClick: () =>
|
|
80
|
+
onClick: () => C((e) => !e),
|
|
80
81
|
props: { tabIndex: 0 },
|
|
81
82
|
..._,
|
|
82
83
|
children: [
|
|
83
|
-
w && /* @__PURE__ */
|
|
84
|
-
|
|
84
|
+
w && /* @__PURE__ */ n(
|
|
85
|
+
M,
|
|
85
86
|
{
|
|
86
87
|
display: d && w ? "block" : "none",
|
|
87
88
|
clean: !0,
|
|
88
89
|
flex1: !0,
|
|
89
90
|
width: 1,
|
|
90
91
|
minHeight: 5,
|
|
91
|
-
placeholder:
|
|
92
|
-
value:
|
|
93
|
-
onChange: (e) =>
|
|
94
|
-
ref:
|
|
92
|
+
placeholder: q,
|
|
93
|
+
value: A,
|
|
94
|
+
onChange: (e) => R(e.target.value),
|
|
95
|
+
ref: T,
|
|
95
96
|
props: {
|
|
96
97
|
onClick: (e) => {
|
|
97
98
|
d && w && e.stopPropagation();
|
|
@@ -99,33 +100,33 @@ function se(s, m) {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
!W && /* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ n(oe, { component: "dropdown.display", display: d && w ? "none" : "flex", children: Q ?? /* @__PURE__ */ n(Z, { children: " " }) }),
|
|
104
|
+
!W && /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(ne, { viewBox: "0 0 10 6", width: "0.6rem", rotate: d ? 180 : 0, children: /* @__PURE__ */ n("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) })
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
d && /* @__PURE__ */
|
|
108
|
-
|
|
108
|
+
d && /* @__PURE__ */ n(
|
|
109
|
+
le,
|
|
109
110
|
{
|
|
110
|
-
ref:
|
|
111
|
+
ref: E,
|
|
111
112
|
top: N ? void 0 : 0,
|
|
112
113
|
bottom: N ? 2 : void 0,
|
|
113
114
|
style: { transform: `translateY(-${G}px)` },
|
|
114
115
|
onPositionChange: (e) => z(e.top - window.scrollY),
|
|
115
|
-
children: (f.length > 0 ||
|
|
116
|
-
X && /* @__PURE__ */
|
|
116
|
+
children: (f.length > 0 || j) && /* @__PURE__ */ B(h, { component: "dropdown.items", children: [
|
|
117
|
+
X && /* @__PURE__ */ n(
|
|
117
118
|
h,
|
|
118
119
|
{
|
|
119
120
|
component: "dropdown.unselect",
|
|
120
121
|
selected: i.length === 0,
|
|
121
122
|
...v.props,
|
|
122
|
-
props: { onClick: (e) =>
|
|
123
|
+
props: { onClick: (e) => U(e) }
|
|
123
124
|
}
|
|
124
125
|
),
|
|
125
|
-
|
|
126
|
+
F && /* @__PURE__ */ n(h, { component: "dropdown.selectAll", ...Y.props, props: { onClick: (e) => U(e, ...H) } }),
|
|
126
127
|
f.map((e) => {
|
|
127
128
|
const { value: t, onClick: o, ...u } = e.props;
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ n(
|
|
129
130
|
h,
|
|
130
131
|
{
|
|
131
132
|
component: "dropdown.item",
|
|
@@ -133,39 +134,39 @@ function se(s, m) {
|
|
|
133
134
|
selected: i.includes(t),
|
|
134
135
|
...u,
|
|
135
136
|
props: {
|
|
136
|
-
onClick: (
|
|
137
|
-
o == null || o(
|
|
137
|
+
onClick: (P) => {
|
|
138
|
+
o == null || o(P), U(P, e);
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
},
|
|
141
142
|
t
|
|
142
143
|
);
|
|
143
144
|
}),
|
|
144
|
-
f.length === 0 &&
|
|
145
|
+
f.length === 0 && j && /* @__PURE__ */ n(h, { component: "dropdown.emptyItem", ...j.props })
|
|
145
146
|
] })
|
|
146
147
|
}
|
|
147
148
|
)
|
|
148
149
|
] });
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function D(s) {
|
|
151
152
|
const m = (p) => null;
|
|
152
153
|
return m.displayName = s, m;
|
|
153
154
|
}
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
function
|
|
155
|
+
const I = K(pe);
|
|
156
|
+
I.Item = D("DropdownItem");
|
|
157
|
+
I.Unselect = D("DropdownUnselect");
|
|
158
|
+
I.SelectAll = D("DropdownSelectAll");
|
|
159
|
+
I.EmptyItem = D("DropdownEmptyItem");
|
|
160
|
+
I.Display = D("DropdownDisplay");
|
|
161
|
+
function O(s) {
|
|
161
162
|
var m;
|
|
162
163
|
if (s == null) return "";
|
|
163
164
|
if (typeof s == "object") {
|
|
164
165
|
const p = (m = s.props) == null ? void 0 : m.children;
|
|
165
|
-
return p == null ? "" : typeof p == "object" ? (Array.isArray(p) ? p : [p]).map((y) =>
|
|
166
|
+
return p == null ? "" : typeof p == "object" ? (Array.isArray(p) ? p : [p]).map((y) => O(y)).join("") : p.toString();
|
|
166
167
|
}
|
|
167
168
|
return s.toString();
|
|
168
169
|
}
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
I as default
|
|
171
172
|
};
|
package/components/form.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as a, useCallback as i } from "react";
|
|
3
3
|
import p from "../box.mjs";
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
const { onSubmit: r, props:
|
|
4
|
+
import { e as c } from "../core.mjs";
|
|
5
|
+
function F(o) {
|
|
6
|
+
const { onSubmit: r, props: e } = o, t = a(null), n = i(
|
|
7
7
|
(m) => {
|
|
8
8
|
m.preventDefault();
|
|
9
9
|
const f = c.getFormEntries(t.current);
|
|
10
10
|
r(f, m);
|
|
11
11
|
},
|
|
12
12
|
[r]
|
|
13
|
-
), s = { ...
|
|
13
|
+
), s = { ...e, onSubmit: n, ref: t };
|
|
14
14
|
return /* @__PURE__ */ u(p, { tag: "form", ...o, props: s });
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
F as default
|
|
18
18
|
};
|
|
@@ -3,29 +3,29 @@ import { BoxProps } from '../box';
|
|
|
3
3
|
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
4
|
import { ComponentsAndVariants } from '../types';
|
|
5
5
|
type SemanticComponentType<TTag extends keyof React.JSX.IntrinsicElements, TKey extends keyof ComponentsAndVariants = never> = (props: Omit<BoxProps<TTag, TKey>, 'tag'> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
|
|
6
|
-
export declare const Label: SemanticComponentType<"label", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
7
|
-
export declare const Span: SemanticComponentType<"span", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
8
|
-
export declare const Article: SemanticComponentType<"article", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
9
|
-
export declare const Aside: SemanticComponentType<"aside", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
10
|
-
export declare const Details: SemanticComponentType<"details", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
11
|
-
export declare const Figcaption: SemanticComponentType<"figcaption", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
12
|
-
export declare const Figure: SemanticComponentType<"figure", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
13
|
-
export declare const Footer: SemanticComponentType<"footer", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
14
|
-
export declare const Header: SemanticComponentType<"header", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
15
|
-
export declare const Main: SemanticComponentType<"main", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
16
|
-
export declare const Mark: SemanticComponentType<"mark", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
17
|
-
export declare const Nav: SemanticComponentType<"nav", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
18
|
-
export declare const Menu: SemanticComponentType<"menu", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
19
|
-
export declare const Section: SemanticComponentType<"section", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
20
|
-
export declare const Summary: SemanticComponentType<"summary", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
21
|
-
export declare const Time: SemanticComponentType<"time", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
22
|
-
export declare const P: SemanticComponentType<"p", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
23
|
-
export declare const H1: SemanticComponentType<"h1", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
24
|
-
export declare const H2: SemanticComponentType<"h2", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
25
|
-
export declare const H3: SemanticComponentType<"h3", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
26
|
-
export declare const H4: SemanticComponentType<"h4", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
27
|
-
export declare const H5: SemanticComponentType<"h5", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
28
|
-
export declare const H6: SemanticComponentType<"h6", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
29
|
-
export declare const Link: SemanticComponentType<"a", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
30
|
-
export declare const Img: SemanticComponentType<"img", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem">;
|
|
6
|
+
export declare const Label: SemanticComponentType<"label", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
7
|
+
export declare const Span: SemanticComponentType<"span", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
8
|
+
export declare const Article: SemanticComponentType<"article", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
9
|
+
export declare const Aside: SemanticComponentType<"aside", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
10
|
+
export declare const Details: SemanticComponentType<"details", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
11
|
+
export declare const Figcaption: SemanticComponentType<"figcaption", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
12
|
+
export declare const Figure: SemanticComponentType<"figure", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
13
|
+
export declare const Footer: SemanticComponentType<"footer", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
14
|
+
export declare const Header: SemanticComponentType<"header", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
15
|
+
export declare const Main: SemanticComponentType<"main", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
16
|
+
export declare const Mark: SemanticComponentType<"mark", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
17
|
+
export declare const Nav: SemanticComponentType<"nav", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
18
|
+
export declare const Menu: SemanticComponentType<"menu", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
19
|
+
export declare const Section: SemanticComponentType<"section", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
20
|
+
export declare const Summary: SemanticComponentType<"summary", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
21
|
+
export declare const Time: SemanticComponentType<"time", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
22
|
+
export declare const P: SemanticComponentType<"p", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
23
|
+
export declare const H1: SemanticComponentType<"h1", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
24
|
+
export declare const H2: SemanticComponentType<"h2", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
25
|
+
export declare const H3: SemanticComponentType<"h3", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
26
|
+
export declare const H4: SemanticComponentType<"h4", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
27
|
+
export declare const H5: SemanticComponentType<"h5", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
28
|
+
export declare const H6: SemanticComponentType<"h6", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
29
|
+
export declare const Link: SemanticComponentType<"a", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
30
|
+
export declare const Img: SemanticComponentType<"img", "button" | "label" | "textarea" | "checkbox" | "textbox" | "radioButton" | "dropdown" | "datagrid" | "dropdown.display" | "dropdown.items" | "dropdown.item" | "dropdown.unselect" | "dropdown.selectAll" | "dropdown.emptyItem" | "datagrid.header" | "datagrid.header.cell" | "datagrid.cell">;
|
|
31
31
|
export {};
|
package/components/tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),C=require("react-dom"),d=require("../box.cjs"),s=require("react"),R=require("../core.cjs"),l=2;function m(f,w){const{onPositionChange:a}=f,c=s.useRef(null),[t,b]=s.useState(),h=R.usePortalContainer(),x=s.useCallback((r,e)=>{const n=p=>{p.target.contains(r)&&e(r)},o=new AbortController;return document.addEventListener("scroll",n,{signal:o.signal,capture:!0}),()=>o.abort()},[t]),g=s.useCallback((r,e)=>{const n=p=>{e(r)},o=new AbortController;return window.addEventListener("resize",n,{signal:o.signal,capture:!0}),()=>o.abort()},[t]),u=s.useCallback(r=>{const e=r.getBoundingClientRect(),n=Math.round((e.top+window.scrollY)*l)/l,o=Math.round((e.left+window.scrollX)*l)/l;((t==null?void 0:t.top)!==n||(t==null?void 0:t.left)!==o)&&(a==null||a({top:n,left:o}),b({top:n,left:o,width:e.width>0?e.width:void 0}))},[t]);return s.useLayoutEffect(()=>{if(c.current){u(c.current);const r=x(c.current,u),e=g(c.current,u);return()=>{r(),e()}}},[t]),i.jsxs(i.Fragment,{children:[i.jsx(d,{ref:c}),t&&C.createPortal(i.jsx(d,{ref:w,position:"absolute",top:0,left:0,transition:"none",style:{transform:`translate(${t.left}px,${t.top}px)`,width:t.width},children:i.jsx(d,{position:"absolute",width:"fit",...f})}),h)]})}const j=s.forwardRef(m);module.exports=j;
|
package/components/tooltip.mjs
CHANGED
|
@@ -1,65 +1,61 @@
|
|
|
1
|
-
import { jsxs as x, Fragment as
|
|
2
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as x, Fragment as C, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as v } from "react-dom";
|
|
3
3
|
import u from "../box.mjs";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as R, useRef as z, useState as A, useCallback as f, useLayoutEffect as D } from "react";
|
|
5
|
+
import { f as E } from "../core.mjs";
|
|
6
6
|
const i = 2;
|
|
7
|
-
function
|
|
8
|
-
const { onPositionChange:
|
|
9
|
-
(
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
return document.addEventListener("scroll",
|
|
14
|
-
document.removeEventListener("scroll", r, { capture: !0 });
|
|
15
|
-
};
|
|
7
|
+
function H(d, w) {
|
|
8
|
+
const { onPositionChange: l } = d, s = z(null), [t, m] = A(), b = E(), h = f(
|
|
9
|
+
(e, o) => {
|
|
10
|
+
const n = (p) => {
|
|
11
|
+
p.target.contains(e) && o(e);
|
|
12
|
+
}, r = new AbortController();
|
|
13
|
+
return document.addEventListener("scroll", n, { signal: r.signal, capture: !0 }), () => r.abort();
|
|
16
14
|
},
|
|
17
15
|
[t]
|
|
18
|
-
),
|
|
19
|
-
(
|
|
20
|
-
const
|
|
21
|
-
e
|
|
22
|
-
};
|
|
23
|
-
return window.addEventListener("resize",
|
|
24
|
-
window.removeEventListener("resize", r, { capture: !0 });
|
|
25
|
-
};
|
|
16
|
+
), g = f(
|
|
17
|
+
(e, o) => {
|
|
18
|
+
const n = (p) => {
|
|
19
|
+
o(e);
|
|
20
|
+
}, r = new AbortController();
|
|
21
|
+
return window.addEventListener("resize", n, { signal: r.signal, capture: !0 }), () => r.abort();
|
|
26
22
|
},
|
|
27
23
|
[t]
|
|
28
|
-
),
|
|
29
|
-
(
|
|
30
|
-
const
|
|
31
|
-
((t == null ? void 0 : t.top) !==
|
|
24
|
+
), c = f(
|
|
25
|
+
(e) => {
|
|
26
|
+
const o = e.getBoundingClientRect(), n = Math.round((o.top + window.scrollY) * i) / i, r = Math.round((o.left + window.scrollX) * i) / i;
|
|
27
|
+
((t == null ? void 0 : t.top) !== n || (t == null ? void 0 : t.left) !== r) && (l == null || l({ top: n, left: r }), m({ top: n, left: r, width: o.width > 0 ? o.width : void 0 }));
|
|
32
28
|
},
|
|
33
29
|
[t]
|
|
34
30
|
);
|
|
35
|
-
return
|
|
31
|
+
return D(() => {
|
|
36
32
|
if (s.current) {
|
|
37
|
-
|
|
38
|
-
const
|
|
33
|
+
c(s.current);
|
|
34
|
+
const e = h(s.current, c), o = g(s.current, c);
|
|
39
35
|
return () => {
|
|
40
|
-
|
|
36
|
+
e(), o();
|
|
41
37
|
};
|
|
42
38
|
}
|
|
43
|
-
}, [t]), /* @__PURE__ */ x(
|
|
39
|
+
}, [t]), /* @__PURE__ */ x(C, { children: [
|
|
44
40
|
/* @__PURE__ */ a(u, { ref: s }),
|
|
45
|
-
t &&
|
|
41
|
+
t && v(
|
|
46
42
|
/* @__PURE__ */ a(
|
|
47
43
|
u,
|
|
48
44
|
{
|
|
49
|
-
ref:
|
|
45
|
+
ref: w,
|
|
50
46
|
position: "absolute",
|
|
51
47
|
top: 0,
|
|
52
48
|
left: 0,
|
|
53
49
|
transition: "none",
|
|
54
50
|
style: { transform: `translate(${t.left}px,${t.top}px)`, width: t.width },
|
|
55
|
-
children: /* @__PURE__ */ a(u, { position: "absolute", width: "fit", ...
|
|
51
|
+
children: /* @__PURE__ */ a(u, { position: "absolute", width: "fit", ...d })
|
|
56
52
|
}
|
|
57
53
|
),
|
|
58
|
-
|
|
54
|
+
b
|
|
59
55
|
)
|
|
60
56
|
] });
|
|
61
57
|
}
|
|
62
|
-
const M =
|
|
58
|
+
const M = R(H);
|
|
63
59
|
export {
|
|
64
60
|
M as default
|
|
65
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_REM_DIVIDER = 4;
|