@cronocode/react-box 3.1.2 → 3.1.6
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/components/dataGrid/components/dataGridCell.d.ts +1 -1
- package/components/dataGrid/components/dataGridColumnFilter.d.ts +11 -0
- package/components/dataGrid/components/dataGridFilterCell.d.ts +8 -0
- package/components/dataGrid/components/dataGridFilterRow.d.ts +6 -0
- package/components/dataGrid/components/dataGridGlobalFilter.d.ts +6 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +57 -0
- package/components/dataGrid/models/columnModel.d.ts +1 -0
- package/components/dataGrid/models/gridModel.d.ts +53 -1
- package/components/dataGrid/models/groupRowModel.d.ts +2 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +694 -284
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.d.ts +4 -1
- package/components/dropdown.mjs +158 -149
- package/components/form.mjs +1 -1
- package/components/semantics.d.ts +25 -25
- package/components/semantics.mjs +5 -5
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +2 -2
- package/components/textbox.mjs +5 -4
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +4 -0
- package/components/tooltip.mjs +45 -41
- package/core/boxStyles.d.ts +66 -31
- package/core/extends/boxComponents.d.ts +812 -153
- package/core/variables.d.ts +25 -1
- package/core.cjs +3 -7
- package/core.mjs +1542 -681
- package/hooks/useVirtualization.d.ts +43 -0
- package/package.json +7 -5
- package/ssg.cjs +1 -1
- package/ssg.mjs +28 -20
- package/types.d.ts +6 -5
- package/utils/string/fuzzySearch.d.ts +27 -0
package/components/dropdown.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("react"),h=require("../box.cjs"),oe=require("../core.cjs"),ne=require("./baseSvg.cjs"),re=require("./button.cjs"),se=require("./checkbox.cjs"),W=require("./flex.cjs"),z=require("./textbox.cjs"),le=require("./tooltip.cjs");function ie(i,r){const{name:k,defaultValue:m,value:x,multiple:c=!1,isSearchable:y,searchPlaceholder:F,children:j,hideIcon:T,showCheckbox:$,onChange:S,props:G,...U}=i,b=U.variant==="compact",[Q,w]=t.useState(Array.isArray(m)?m:m?[m]:[]),p="value"in i?Array.isArray(x)?x:x?[x]:[]:Q,[C,V]=t.useState(""),[a,E,I]=oe.useVisibility(),q=t.useRef(null),L=t.useRef(null),[D,X]=t.useState({top:0,scrollY:0}),N=t.useMemo(()=>D.top-D.scrollY>window.innerHeight/2,[D.top,D.scrollY]),B=t.useMemo(()=>I.current?.getBoundingClientRect(),[I.current]),Z=t.useMemo(()=>N?0:B?.height??0,[N,B]),l=t.useMemo(()=>(Array.isArray(j)?j:[j]).flatMap(e=>e),[j]),K=t.useMemo(()=>l.filter(e=>e.type?.displayName==="DropdownItem"),[l]),d=t.useMemo(()=>K.filter(e=>y&&C?O(e).toLowerCase().includes(C.toLowerCase()):!0),[y,C,l]),v=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownUnselect"),[l]),P=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownSelectAll"),[l]),_=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownEmptyItem"),[l]),A=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownDisplay"),[l]),ee=t.useMemo(()=>{if(a&&y)return null;if(A)return typeof A.props.children=="function"?A.props.children(p,a):A.props.children;const e=d.filter(n=>p.includes(n.props.value));if(c&&e.length>1)return e.map(n=>O(n)).join(", ");const s=e.at(0);return s?.props.children??s?.props.value??(c?null:v?.props.children)},[c,d,p,v,a]),R=t.useCallback((e,...s)=>{if(s.length===0)w([]),S?.(void 0,[]);else if(c&&s.length>1){const n=s.map(u=>u.props.value);w(n),S?.(void 0,n)}else if(s.length===1){const n=s[0];if(c){const u=p.filter(M=>M!==n.props.value);u.length===p.length&&u.push(n.props.value),w(u),S?.(n.props.value,u)}else w([n.props.value]),S?.(n.props.value,[n.props.value])}c?(e.stopPropagation(),setTimeout(()=>q.current?.focus(),0)):(E(!1),setTimeout(()=>I.current?.focus(),0))},[c,p,w]);t.useEffect(()=>{a?setTimeout(()=>{q.current?.focus(),L.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},0):V("")},[a]);const H=P&&c&&d.length>p.length,te=v&&d.length>0&&!H;return o.jsxs(re.default,{ref:I,onClick:()=>E(e=>!e),component:"dropdown",props:{tabIndex:0,...G},position:"relative",pr:T?void 0:4,...U,children:[p.map(e=>o.jsx(z.default,{ref:r,name:k,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),y&&a&&o.jsx(W.default,{ai:"center",position:"absolute",inset:0,p:3,children:o.jsx(z.default,{clean:!0,placeholder:F,value:C,onChange:e=>V(e.target.value),ref:q,color:"currentColor",width:"fit",props:{onClick:e=>{a&&y&&e.stopPropagation()}}})})," ",ee," ",!T&&o.jsx(W.default,{component:"dropdown.icon",children:o.jsx(ne.default,{viewBox:"0 0 10 6",width:"0.6rem",rotate:a?180:0,children:o.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})}),o.jsx(h.default,{position:"absolute",inset:0,children:a&&o.jsx(le.default,{ref:L,minWidth:"fit-content",style:{transform:N?"translateY(calc(-100% - 2px))":`translateY(${Z}px)`},onPositionChange:e=>X({top:e.top,scrollY:e.windowScrollY}),children:(d.length>0||_)&&o.jsxs(h.default,{component:"dropdown.items",children:[te&&o.jsx(h.default,{component:"dropdown.unselect",variant:{compact:b},selected:p.length===0,...v.props,props:{...v.props.props,onClick:e=>R(e)}}),H&&o.jsx(h.default,{component:"dropdown.selectAll",variant:{compact:b},...P.props,props:{...P.props.props,onClick:e=>R(e,...K)}}),d.map(e=>{const{value:s,onClick:n,children:u,...M}=e.props,Y=p.includes(s);return o.jsx(h.default,{component:"dropdown.item",variant:{multiple:c,compact:b},selected:Y,...M,children:$&&c?o.jsxs(o.Fragment,{children:[o.jsx(se.default,{readOnly:!0,checked:Y}),u]}):u,props:{...M.props,"aria-selected":Y,onClick:J=>{n?.(J),R(J,e)}}},s)}),d.length===0&&_&&o.jsx(h.default,{component:"dropdown.emptyItem",variant:{compact:b},..._.props})]})})})]})}function g(i){const r=k=>null;return r.displayName=i,r}const f=t.forwardRef(ie);f.Item=g("DropdownItem");f.Unselect=g("DropdownUnselect");f.SelectAll=g("DropdownSelectAll");f.EmptyItem=g("DropdownEmptyItem");f.Display=g("DropdownDisplay");f.displayName="Dropdown";function O(i){if(i==null)return"";if(typeof i=="object"){const r=i.props?.children;return r==null?"":typeof r=="object"?(Array.isArray(r)?r:[r]).map(m=>O(m)).join(""):r.toString()}return i.toString()}exports.default=f;
|
package/components/dropdown.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { BoxProps } from '../box';
|
|
3
|
-
|
|
3
|
+
import { ComponentsAndVariants } from '../types';
|
|
4
|
+
interface Props<TVal, TKey extends keyof ComponentsAndVariants = 'dropdown'> extends Omit<BoxProps<'button', TKey>, 'ref' | 'tag'> {
|
|
4
5
|
name?: string;
|
|
5
6
|
defaultValue?: TVal | TVal[];
|
|
6
7
|
value?: TVal | TVal[];
|
|
@@ -8,6 +9,8 @@ interface Props<TVal> extends Omit<BoxProps<'button'>, 'ref'> {
|
|
|
8
9
|
isSearchable?: boolean;
|
|
9
10
|
searchPlaceholder?: string;
|
|
10
11
|
hideIcon?: boolean;
|
|
12
|
+
/** Show checkbox for each item in multiple selection mode */
|
|
13
|
+
showCheckbox?: boolean;
|
|
11
14
|
onChange?: (value: TVal | undefined, values: TVal[]) => void;
|
|
12
15
|
}
|
|
13
16
|
interface DropdownItemProps<TVal> extends BoxProps {
|
package/components/dropdown.mjs
CHANGED
|
@@ -1,169 +1,178 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { b as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { jsxs as V, jsx as o, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as le, useState as R, useRef as _, useMemo as l, useCallback as pe, useEffect as ie } from "react";
|
|
3
|
+
import f from "../box.mjs";
|
|
4
|
+
import { b as ce } from "../core.mjs";
|
|
5
|
+
import ae from "./baseSvg.mjs";
|
|
6
|
+
import de from "./button.mjs";
|
|
7
|
+
import ue from "./checkbox.mjs";
|
|
8
|
+
import $ from "./flex.mjs";
|
|
9
|
+
import G from "./textbox.mjs";
|
|
10
|
+
import me from "./tooltip.mjs";
|
|
11
|
+
function fe(p, r) {
|
|
11
12
|
const {
|
|
12
|
-
name:
|
|
13
|
-
defaultValue:
|
|
14
|
-
value:
|
|
15
|
-
multiple:
|
|
16
|
-
isSearchable:
|
|
17
|
-
searchPlaceholder:
|
|
18
|
-
children:
|
|
19
|
-
hideIcon:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
name: P,
|
|
14
|
+
defaultValue: m,
|
|
15
|
+
value: C,
|
|
16
|
+
multiple: i = !1,
|
|
17
|
+
isSearchable: y,
|
|
18
|
+
searchPlaceholder: Q,
|
|
19
|
+
children: S,
|
|
20
|
+
hideIcon: L,
|
|
21
|
+
showCheckbox: X,
|
|
22
|
+
onChange: I,
|
|
23
|
+
props: Z,
|
|
24
|
+
...K
|
|
25
|
+
} = p, x = K.variant === "compact", [ee, w] = R(Array.isArray(m) ? m : m ? [m] : []), c = "value" in p ? Array.isArray(C) ? C : C ? [C] : [] : ee, [D, F] = R(""), [a, H, b] = ce(), T = _(null), J = _(null), [A, te] = R({ top: 0, scrollY: 0 }), Y = l(
|
|
26
|
+
() => A.top - A.scrollY > window.innerHeight / 2,
|
|
27
|
+
[A.top, A.scrollY]
|
|
28
|
+
), M = l(() => b.current?.getBoundingClientRect(), [b.current]), oe = l(() => Y ? 0 : M?.height ?? 0, [Y, M]), s = l(
|
|
29
|
+
() => (Array.isArray(S) ? S : [S]).flatMap((e) => e),
|
|
30
|
+
[S]
|
|
31
|
+
), W = l(() => s.filter((e) => e.type?.displayName === "DropdownItem"), [s]), u = l(() => W.filter((e) => y && D ? E(e).toLowerCase().includes(D.toLowerCase()) : !0), [y, D, s]), v = l(() => s.find((e) => e.type?.displayName === "DropdownUnselect"), [s]), j = l(() => s.find((e) => e.type?.displayName === "DropdownSelectAll"), [s]), U = l(() => s.find((e) => e.type?.displayName === "DropdownEmptyItem"), [s]), k = l(() => s.find((e) => e.type?.displayName === "DropdownDisplay"), [s]), re = l(() => {
|
|
32
|
+
if (a && y) return null;
|
|
33
|
+
if (k)
|
|
34
|
+
return typeof k.props.children == "function" ? k.props.children(c, a) : k.props.children;
|
|
35
|
+
const e = u.filter((t) => c.includes(t.props.value));
|
|
36
|
+
if (i && e.length > 1)
|
|
37
|
+
return e.map((t) => E(t)).join(", ");
|
|
32
38
|
const n = e.at(0);
|
|
33
|
-
return n?.props.children ?? n?.props.value ?? (
|
|
34
|
-
}, [
|
|
39
|
+
return n?.props.children ?? n?.props.value ?? (i ? null : v?.props.children);
|
|
40
|
+
}, [i, u, c, v, a]), B = pe(
|
|
35
41
|
(e, ...n) => {
|
|
36
42
|
if (n.length === 0)
|
|
37
|
-
w([]),
|
|
38
|
-
else if (
|
|
39
|
-
const
|
|
40
|
-
w(
|
|
43
|
+
w([]), I?.(void 0, []);
|
|
44
|
+
else if (i && n.length > 1) {
|
|
45
|
+
const t = n.map((d) => d.props.value);
|
|
46
|
+
w(t), I?.(void 0, t);
|
|
41
47
|
} else if (n.length === 1) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
const d =
|
|
45
|
-
d.length ===
|
|
48
|
+
const t = n[0];
|
|
49
|
+
if (i) {
|
|
50
|
+
const d = c.filter((N) => N !== t.props.value);
|
|
51
|
+
d.length === c.length && d.push(t.props.value), w(d), I?.(t.props.value, d);
|
|
46
52
|
} else
|
|
47
|
-
w([
|
|
53
|
+
w([t.props.value]), I?.(t.props.value, [t.props.value]);
|
|
48
54
|
}
|
|
49
|
-
|
|
55
|
+
i ? (e.stopPropagation(), setTimeout(() => T.current?.focus(), 0)) : (H(!1), setTimeout(() => b.current?.focus(), 0));
|
|
50
56
|
},
|
|
51
|
-
[
|
|
57
|
+
[i, c, w]
|
|
52
58
|
);
|
|
53
|
-
|
|
59
|
+
ie(() => {
|
|
54
60
|
a ? setTimeout(() => {
|
|
55
|
-
|
|
56
|
-
}, 0) :
|
|
61
|
+
T.current?.focus(), J.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
62
|
+
}, 0) : F("");
|
|
57
63
|
}, [a]);
|
|
58
|
-
const
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onClick: (e) => {
|
|
85
|
-
a && h && e.stopPropagation();
|
|
86
|
-
}
|
|
64
|
+
const q = j && i && u.length > c.length, ne = v && u.length > 0 && !q;
|
|
65
|
+
return /* @__PURE__ */ V(
|
|
66
|
+
de,
|
|
67
|
+
{
|
|
68
|
+
ref: b,
|
|
69
|
+
onClick: () => H((e) => !e),
|
|
70
|
+
component: "dropdown",
|
|
71
|
+
props: { tabIndex: 0, ...Z },
|
|
72
|
+
position: "relative",
|
|
73
|
+
pr: L ? void 0 : 4,
|
|
74
|
+
...K,
|
|
75
|
+
children: [
|
|
76
|
+
c.map((e) => /* @__PURE__ */ o(G, { ref: r, name: P, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
|
|
77
|
+
y && a && /* @__PURE__ */ o($, { ai: "center", position: "absolute", inset: 0, p: 3, children: /* @__PURE__ */ o(
|
|
78
|
+
G,
|
|
79
|
+
{
|
|
80
|
+
clean: !0,
|
|
81
|
+
placeholder: Q,
|
|
82
|
+
value: D,
|
|
83
|
+
onChange: (e) => F(e.target.value),
|
|
84
|
+
ref: T,
|
|
85
|
+
color: "currentColor",
|
|
86
|
+
width: "fit",
|
|
87
|
+
props: {
|
|
88
|
+
onClick: (e) => {
|
|
89
|
+
a && y && e.stopPropagation();
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
...g.props,
|
|
112
|
-
props: { ...g.props.props, onClick: (e) => U(e) }
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
Y && /* @__PURE__ */ r(
|
|
116
|
-
m,
|
|
117
|
-
{
|
|
118
|
-
component: "dropdown.selectAll",
|
|
119
|
-
...T.props,
|
|
120
|
-
props: { ...T.props.props, onClick: (e) => U(e, ...K) }
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
u.map((e) => {
|
|
124
|
-
const { value: n, onClick: o, ...d } = e.props;
|
|
125
|
-
return /* @__PURE__ */ r(
|
|
126
|
-
m,
|
|
127
|
-
{
|
|
128
|
-
component: "dropdown.item",
|
|
129
|
-
variant: c ? "multiple" : void 0,
|
|
130
|
-
selected: p.includes(n),
|
|
131
|
-
...d,
|
|
132
|
-
props: {
|
|
133
|
-
...d.props,
|
|
134
|
-
onClick: (k) => {
|
|
135
|
-
o?.(k), U(k, e);
|
|
136
|
-
}
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
" ",
|
|
95
|
+
re,
|
|
96
|
+
" ",
|
|
97
|
+
!L && /* @__PURE__ */ o($, { component: "dropdown.icon", children: /* @__PURE__ */ o(ae, { viewBox: "0 0 10 6", width: "0.6rem", rotate: a ? 180 : 0, children: /* @__PURE__ */ o("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) }),
|
|
98
|
+
/* @__PURE__ */ o(f, { position: "absolute", inset: 0, children: a && /* @__PURE__ */ o(
|
|
99
|
+
me,
|
|
100
|
+
{
|
|
101
|
+
ref: J,
|
|
102
|
+
minWidth: "fit-content",
|
|
103
|
+
style: { transform: Y ? "translateY(calc(-100% - 2px))" : `translateY(${oe}px)` },
|
|
104
|
+
onPositionChange: (e) => te({ top: e.top, scrollY: e.windowScrollY }),
|
|
105
|
+
children: (u.length > 0 || U) && /* @__PURE__ */ V(f, { component: "dropdown.items", children: [
|
|
106
|
+
ne && /* @__PURE__ */ o(
|
|
107
|
+
f,
|
|
108
|
+
{
|
|
109
|
+
component: "dropdown.unselect",
|
|
110
|
+
variant: { compact: x },
|
|
111
|
+
selected: c.length === 0,
|
|
112
|
+
...v.props,
|
|
113
|
+
props: { ...v.props.props, onClick: (e) => B(e) }
|
|
137
114
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
115
|
+
),
|
|
116
|
+
q && /* @__PURE__ */ o(
|
|
117
|
+
f,
|
|
118
|
+
{
|
|
119
|
+
component: "dropdown.selectAll",
|
|
120
|
+
variant: { compact: x },
|
|
121
|
+
...j.props,
|
|
122
|
+
props: { ...j.props.props, onClick: (e) => B(e, ...W) }
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
u.map((e) => {
|
|
126
|
+
const { value: n, onClick: t, children: d, ...N } = e.props, O = c.includes(n);
|
|
127
|
+
return /* @__PURE__ */ o(
|
|
128
|
+
f,
|
|
129
|
+
{
|
|
130
|
+
component: "dropdown.item",
|
|
131
|
+
variant: { multiple: i, compact: x },
|
|
132
|
+
selected: O,
|
|
133
|
+
...N,
|
|
134
|
+
children: X && i ? /* @__PURE__ */ V(se, { children: [
|
|
135
|
+
/* @__PURE__ */ o(ue, { readOnly: !0, checked: O }),
|
|
136
|
+
d
|
|
137
|
+
] }) : d,
|
|
138
|
+
props: {
|
|
139
|
+
...N.props,
|
|
140
|
+
"aria-selected": O,
|
|
141
|
+
onClick: (z) => {
|
|
142
|
+
t?.(z), B(z, e);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
n
|
|
147
|
+
);
|
|
148
|
+
}),
|
|
149
|
+
u.length === 0 && U && /* @__PURE__ */ o(f, { component: "dropdown.emptyItem", variant: { compact: x }, ...U.props })
|
|
150
|
+
] })
|
|
151
|
+
}
|
|
152
|
+
) })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
147
156
|
}
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
return
|
|
157
|
+
function g(p) {
|
|
158
|
+
const r = (P) => null;
|
|
159
|
+
return r.displayName = p, r;
|
|
151
160
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
function
|
|
160
|
-
if (
|
|
161
|
-
if (typeof
|
|
162
|
-
const
|
|
163
|
-
return
|
|
161
|
+
const h = le(fe);
|
|
162
|
+
h.Item = g("DropdownItem");
|
|
163
|
+
h.Unselect = g("DropdownUnselect");
|
|
164
|
+
h.SelectAll = g("DropdownSelectAll");
|
|
165
|
+
h.EmptyItem = g("DropdownEmptyItem");
|
|
166
|
+
h.Display = g("DropdownDisplay");
|
|
167
|
+
h.displayName = "Dropdown";
|
|
168
|
+
function E(p) {
|
|
169
|
+
if (p == null) return "";
|
|
170
|
+
if (typeof p == "object") {
|
|
171
|
+
const r = p.props?.children;
|
|
172
|
+
return r == null ? "" : typeof r == "object" ? (Array.isArray(r) ? r : [r]).map((m) => E(m)).join("") : r.toString();
|
|
164
173
|
}
|
|
165
|
-
return
|
|
174
|
+
return p.toString();
|
|
166
175
|
}
|
|
167
176
|
export {
|
|
168
|
-
|
|
177
|
+
h as default
|
|
169
178
|
};
|
package/components/form.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as i, useCallback as p } from "react";
|
|
3
3
|
import u from "../box.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { e as l } from "../core.mjs";
|
|
5
5
|
function c(o) {
|
|
6
6
|
const { onSubmit: r, props: e } = o, t = i(null), n = p(
|
|
7
7
|
(m) => {
|