@cronocode/react-box 3.0.20 → 3.1.1
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/box.d.ts +7 -2
- package/box.mjs +4 -4
- package/components/baseSvg.cjs +1 -1
- package/components/baseSvg.d.ts +1 -1
- package/components/button.cjs +1 -1
- package/components/checkbox.cjs +1 -1
- package/components/dataGrid/components/dataGridBody.d.ts +7 -0
- package/components/dataGrid/components/dataGridBottomBar.d.ts +6 -0
- package/components/dataGrid/components/dataGridColumnGroups.d.ts +1 -1
- package/components/dataGrid/components/dataGridContent.d.ts +6 -0
- package/components/dataGrid/components/dataGridHeader.d.ts +6 -0
- package/components/dataGrid/components/dataGridHeaderCellContextMenu.d.ts +6 -0
- package/components/dataGrid/components/dataGridHeaderCellResizer.d.ts +6 -0
- package/components/dataGrid/components/dataGridPagination.d.ts +1 -1
- package/components/dataGrid/components/dataGridTopBar.d.ts +6 -0
- package/components/dataGrid/components/dataGridTopBarContextMenu.d.ts +6 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +16 -0
- package/components/dataGrid/models/columnModel.d.ts +1 -1
- package/components/dataGrid/models/gridModel.d.ts +15 -7
- package/components/dataGrid/models/groupRowModel.d.ts +3 -2
- package/components/dataGrid/models/rowModel.d.ts +8 -7
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +1 -1
- package/components/dataGrid.mjs +511 -576
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.d.ts +1 -1
- package/components/dropdown.mjs +111 -135
- package/components/flex.cjs +1 -1
- package/components/form.cjs +1 -1
- package/components/form.mjs +1 -1
- package/components/grid.cjs +1 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +10 -10
- package/components/semantics.d.ts +25 -25
- package/components/semantics.mjs +1 -1
- package/components/textarea.cjs +1 -1
- package/components/textbox.cjs +1 -1
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +6 -3
- package/components/tooltip.mjs +34 -34
- package/core/boxStyles.d.ts +28 -4
- package/core/boxStylesFormatters.d.ts +1 -1
- package/core/coreTypes.d.ts +1 -1
- package/core/extends/boxComponents.d.ts +194 -18
- package/core.cjs +3 -3
- package/core.mjs +476 -306
- package/icons/expandIcon.d.ts +2 -0
- package/icons/sortIcon.d.ts +2 -0
- package/package.json +22 -14
- package/ssg.cjs +1 -1
- package/ssg.mjs +17 -16
- package/utils/object/objectUtils.d.ts +2 -2
- package/icons/arrowIcon.d.ts +0 -2
package/components/dropdown.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("react"),f=require("../box.cjs"),G=require("./baseSvg.cjs"),Q=require("./button.cjs"),X=require("./flex.cjs"),L=require("./textbox.cjs"),Z=require("./tooltip.cjs"),ee=require("../core.cjs");function te(p,s){const{name:M,defaultValue:h,value:x,multiple:c,isSearchable:y,searchPlaceholder:B,children:j,hideIcon:H,onChange:S,props:K,...Y}=p,[J,w]=t.useState(Array.isArray(h)?h:h?[h]:[]),i="value"in p?Array.isArray(x)?x:x?[x]:[]:J,[b,_]=t.useState(""),[a,T,I]=ee.useVisibility(),k=t.useRef(null),U=t.useRef(null),[O,F]=t.useState(0),D=t.useMemo(()=>O>window.innerHeight/2,[O]),W=t.useMemo(()=>D?I.current?.getBoundingClientRect().height??0:0,[D,I]),l=t.useMemo(()=>(Array.isArray(j)?j:[j]).flatMap(e=>e),[j]),V=t.useMemo(()=>l.filter(e=>e.type?.displayName==="DropdownItem"),[l]),d=t.useMemo(()=>V.filter(e=>y&&b?R(e).toLowerCase().includes(b.toLowerCase()):!0),[y,b,l]),g=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownUnselect"),[l]),q=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownSelectAll"),[l]),N=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownEmptyItem"),[l]),A=t.useMemo(()=>l.find(e=>e.type?.displayName==="DropdownDisplay"),[l]),$=t.useMemo(()=>{if(A)return typeof A.props.children=="function"?A.props.children(i,a):A.props.children;const e=d.filter(n=>i.includes(n.props.value));if(c&&e.length>1)return e.map(n=>R(n)).join(", ");const r=e.at(0);return r?.props.children??r?.props.value??(c?null:g?.props.children)},[c,d,i,g,a]),P=t.useCallback((e,...r)=>{if(r.length===0)w([]),S?.(void 0,[]);else if(c&&r.length>1){const n=r.map(u=>u.props.value);w(n),S?.(void 0,n)}else if(r.length===1){const n=r[0];if(c){const u=i.filter(C=>C!==n.props.value);u.length===i.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(()=>k.current?.focus(),0)):(T(!1),setTimeout(()=>I.current?.focus(),0))},[c,i,w]);t.useEffect(()=>{a?setTimeout(()=>{k.current?.focus(),U.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},0):_("")},[a]);const E=q&&c&&d.length>i.length,z=g&&d.length>0&&!E;return o.jsxs(f.default,{width:"fit-content",children:[i.map(e=>o.jsx(L.default,{ref:s,name:M,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),o.jsxs(Q.default,{ref:I,type:"button",component:"dropdown",onClick:()=>T(e=>!e),props:{tabIndex:0,...K},...Y,children:[y&&o.jsx(L.default,{display:a&&y?"block":"none",clean:!0,flex1:!0,width:1,minHeight:5,placeholder:B,value:b,onChange:e=>_(e.target.value),ref:k,props:{onClick:e=>{a&&y&&e.stopPropagation()}}}),o.jsx(X.default,{component:"dropdown.display",display:a&&y?"none":"flex",children:$??o.jsx(o.Fragment,{children:" "})}),!H&&o.jsx(f.default,{children:o.jsx(G.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"})})})]}),a&&o.jsx(Z.default,{ref:U,position:"absolute",width:"fit",top:D?void 0:0,bottom:D?2:void 0,style:{transform:`translateY(-${W}px)`},onPositionChange:e=>F(e.top-window.scrollY),children:(d.length>0||N)&&o.jsxs(f.default,{component:"dropdown.items",children:[z&&o.jsx(f.default,{component:"dropdown.unselect",selected:i.length===0,...g.props,props:{...g.props.props,onClick:e=>P(e)}}),E&&o.jsx(f.default,{component:"dropdown.selectAll",...q.props,props:{...q.props.props,onClick:e=>P(e,...V)}}),d.map(e=>{const{value:r,onClick:n,...u}=e.props;return o.jsx(f.default,{component:"dropdown.item",variant:c?"multiple":void 0,selected:i.includes(r),...u,props:{...u.props,onClick:C=>{n?.(C),P(C,e)}}},r)}),d.length===0&&N&&o.jsx(f.default,{component:"dropdown.emptyItem",...N.props})]})})]})}function v(p){const s=M=>null;return s.displayName=p,s}const m=t.forwardRef(te);m.Item=v("DropdownItem");m.Unselect=v("DropdownUnselect");m.SelectAll=v("DropdownSelectAll");m.EmptyItem=v("DropdownEmptyItem");m.Display=v("DropdownDisplay");m.displayName="Dropdown";function R(p){if(p==null)return"";if(typeof p=="object"){const s=p.props?.children;return s==null?"":typeof s=="object"?(Array.isArray(s)?s:[s]).map(h=>R(h)).join(""):s.toString()}return p.toString()}exports.default=m;
|
package/components/dropdown.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface DropdownItemProps<TVal> extends BoxProps {
|
|
|
17
17
|
interface DropdownDisplayProps<TVal> extends Omit<BoxProps, 'children'> {
|
|
18
18
|
children: ((selectedValues: TVal[], isOpen: boolean) => React.ReactNode) | React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
interface DropdownType
|
|
20
|
+
interface DropdownType {
|
|
21
21
|
<TVal>(props: Props<TVal> & RefAttributes<HTMLInputElement>): React.ReactNode;
|
|
22
22
|
Item: <TVal>(props: DropdownItemProps<TVal>) => React.ReactNode;
|
|
23
23
|
Unselect: (props: BoxProps) => React.ReactNode;
|
package/components/dropdown.mjs
CHANGED
|
@@ -1,193 +1,169 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as ee, useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import re from "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { jsxs as B, jsx as r, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ee, useState as V, useRef as F, useMemo as i, useCallback as oe, useEffect as te } from "react";
|
|
3
|
+
import m from "../box.mjs";
|
|
4
|
+
import ne from "./baseSvg.mjs";
|
|
5
|
+
import re from "./button.mjs";
|
|
6
|
+
import se from "./flex.mjs";
|
|
7
|
+
import J from "./textbox.mjs";
|
|
8
8
|
import le from "./tooltip.mjs";
|
|
9
|
-
import pe from "
|
|
10
|
-
function ie(l,
|
|
9
|
+
import { b as pe } from "../core.mjs";
|
|
10
|
+
function ie(l, t) {
|
|
11
11
|
const {
|
|
12
|
-
name:
|
|
13
|
-
defaultValue:
|
|
14
|
-
value:
|
|
15
|
-
multiple:
|
|
16
|
-
isSearchable:
|
|
17
|
-
searchPlaceholder:
|
|
18
|
-
children:
|
|
19
|
-
hideIcon:
|
|
20
|
-
onChange:
|
|
21
|
-
props:
|
|
22
|
-
|
|
23
|
-
} = l, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return typeof P.props.children == "function" ? P.props.children(i, d) : P.props.children;
|
|
47
|
-
const e = f.filter((o) => i.includes(o.props.value));
|
|
48
|
-
if (a && e.length > 1)
|
|
49
|
-
return e.map((o) => R(o)).join(", ");
|
|
50
|
-
const t = e.at(0);
|
|
51
|
-
return (t == null ? void 0 : t.props.children) ?? (t == null ? void 0 : t.props.value) ?? (a ? null : h == null ? void 0 : h.props.children);
|
|
52
|
-
}, [a, f, i, h, d]), B = te(
|
|
53
|
-
(e, ...t) => {
|
|
54
|
-
if (t.length === 0)
|
|
55
|
-
x([]), r == null || r(void 0, []);
|
|
56
|
-
else if (a && t.length > 1) {
|
|
57
|
-
const o = t.map((u) => u.props.value);
|
|
58
|
-
x(o), r == null || r(void 0, o);
|
|
59
|
-
} else if (t.length === 1) {
|
|
60
|
-
const o = t[0];
|
|
61
|
-
if (a) {
|
|
62
|
-
const u = i.filter((k) => k !== o.props.value);
|
|
63
|
-
u.length === i.length && u.push(o.props.value), x(u), r == null || r(o.props.value, u);
|
|
12
|
+
name: N,
|
|
13
|
+
defaultValue: f,
|
|
14
|
+
value: I,
|
|
15
|
+
multiple: c,
|
|
16
|
+
isSearchable: h,
|
|
17
|
+
searchPlaceholder: M,
|
|
18
|
+
children: D,
|
|
19
|
+
hideIcon: q,
|
|
20
|
+
onChange: x,
|
|
21
|
+
props: W,
|
|
22
|
+
..._
|
|
23
|
+
} = l, [$, w] = V(Array.isArray(f) ? f : f ? [f] : []), p = "value" in l ? Array.isArray(I) ? I : I ? [I] : [] : $, [S, R] = V(""), [a, E, A] = pe(), P = F(null), L = F(null), [H, z] = V(0), C = i(() => H > window.innerHeight / 2, [H]), G = i(() => C ? A.current?.getBoundingClientRect().height ?? 0 : 0, [C, A]), s = i(
|
|
24
|
+
() => (Array.isArray(D) ? D : [D]).flatMap((e) => e),
|
|
25
|
+
[D]
|
|
26
|
+
), K = i(() => s.filter((e) => e.type?.displayName === "DropdownItem"), [s]), u = i(() => K.filter((e) => h && S ? O(e).toLowerCase().includes(S.toLowerCase()) : !0), [h, S, s]), g = i(() => s.find((e) => e.type?.displayName === "DropdownUnselect"), [s]), T = i(() => s.find((e) => e.type?.displayName === "DropdownSelectAll"), [s]), j = i(() => s.find((e) => e.type?.displayName === "DropdownEmptyItem"), [s]), b = i(() => s.find((e) => e.type?.displayName === "DropdownDisplay"), [s]), Q = i(() => {
|
|
27
|
+
if (b)
|
|
28
|
+
return typeof b.props.children == "function" ? b.props.children(p, a) : b.props.children;
|
|
29
|
+
const e = u.filter((o) => p.includes(o.props.value));
|
|
30
|
+
if (c && e.length > 1)
|
|
31
|
+
return e.map((o) => O(o)).join(", ");
|
|
32
|
+
const n = e.at(0);
|
|
33
|
+
return n?.props.children ?? n?.props.value ?? (c ? null : g?.props.children);
|
|
34
|
+
}, [c, u, p, g, a]), U = oe(
|
|
35
|
+
(e, ...n) => {
|
|
36
|
+
if (n.length === 0)
|
|
37
|
+
w([]), x?.(void 0, []);
|
|
38
|
+
else if (c && n.length > 1) {
|
|
39
|
+
const o = n.map((d) => d.props.value);
|
|
40
|
+
w(o), x?.(void 0, o);
|
|
41
|
+
} else if (n.length === 1) {
|
|
42
|
+
const o = n[0];
|
|
43
|
+
if (c) {
|
|
44
|
+
const d = p.filter((k) => k !== o.props.value);
|
|
45
|
+
d.length === p.length && d.push(o.props.value), w(d), x?.(o.props.value, d);
|
|
64
46
|
} else
|
|
65
|
-
|
|
47
|
+
w([o.props.value]), x?.(o.props.value, [o.props.value]);
|
|
66
48
|
}
|
|
67
|
-
|
|
68
|
-
var o;
|
|
69
|
-
return (o = T.current) == null ? void 0 : o.focus();
|
|
70
|
-
}, 0)) : (E(!1), setTimeout(() => {
|
|
71
|
-
var o;
|
|
72
|
-
return (o = b.current) == null ? void 0 : o.focus();
|
|
73
|
-
}, 0));
|
|
49
|
+
c ? (e.stopPropagation(), setTimeout(() => P.current?.focus(), 0)) : (E(!1), setTimeout(() => A.current?.focus(), 0));
|
|
74
50
|
},
|
|
75
|
-
[
|
|
51
|
+
[c, p, w]
|
|
76
52
|
);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
pe,
|
|
53
|
+
te(() => {
|
|
54
|
+
a ? setTimeout(() => {
|
|
55
|
+
P.current?.focus(), L.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
56
|
+
}, 0) : R("");
|
|
57
|
+
}, [a]);
|
|
58
|
+
const Y = T && c && u.length > p.length, X = g && u.length > 0 && !Y;
|
|
59
|
+
return /* @__PURE__ */ B(m, { width: "fit-content", children: [
|
|
60
|
+
p.map((e) => /* @__PURE__ */ r(J, { ref: t, name: N, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
|
|
61
|
+
/* @__PURE__ */ B(
|
|
62
|
+
re,
|
|
88
63
|
{
|
|
89
|
-
ref:
|
|
64
|
+
ref: A,
|
|
90
65
|
type: "button",
|
|
91
66
|
component: "dropdown",
|
|
92
67
|
onClick: () => E((e) => !e),
|
|
93
|
-
props: { tabIndex: 0, ...
|
|
94
|
-
|
|
68
|
+
props: { tabIndex: 0, ...W },
|
|
69
|
+
..._,
|
|
95
70
|
children: [
|
|
96
|
-
|
|
97
|
-
|
|
71
|
+
h && /* @__PURE__ */ r(
|
|
72
|
+
J,
|
|
98
73
|
{
|
|
99
|
-
display:
|
|
74
|
+
display: a && h ? "block" : "none",
|
|
100
75
|
clean: !0,
|
|
101
76
|
flex1: !0,
|
|
102
77
|
width: 1,
|
|
103
78
|
minHeight: 5,
|
|
104
|
-
placeholder:
|
|
105
|
-
value:
|
|
106
|
-
onChange: (e) =>
|
|
107
|
-
ref:
|
|
79
|
+
placeholder: M,
|
|
80
|
+
value: S,
|
|
81
|
+
onChange: (e) => R(e.target.value),
|
|
82
|
+
ref: P,
|
|
108
83
|
props: {
|
|
109
84
|
onClick: (e) => {
|
|
110
|
-
|
|
85
|
+
a && h && e.stopPropagation();
|
|
111
86
|
}
|
|
112
87
|
}
|
|
113
88
|
}
|
|
114
89
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
!
|
|
90
|
+
/* @__PURE__ */ r(se, { component: "dropdown.display", display: a && h ? "none" : "flex", children: Q ?? /* @__PURE__ */ r(Z, { children: " " }) }),
|
|
91
|
+
!q && /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(ne, { viewBox: "0 0 10 6", width: "0.6rem", rotate: a ? 180 : 0, children: /* @__PURE__ */ r("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) })
|
|
117
92
|
]
|
|
118
93
|
}
|
|
119
94
|
),
|
|
120
|
-
|
|
95
|
+
a && /* @__PURE__ */ r(
|
|
121
96
|
le,
|
|
122
97
|
{
|
|
123
98
|
ref: L,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
99
|
+
position: "absolute",
|
|
100
|
+
width: "fit",
|
|
101
|
+
top: C ? void 0 : 0,
|
|
102
|
+
bottom: C ? 2 : void 0,
|
|
103
|
+
style: { transform: `translateY(-${G}px)` },
|
|
104
|
+
onPositionChange: (e) => z(e.top - window.scrollY),
|
|
105
|
+
children: (u.length > 0 || j) && /* @__PURE__ */ B(m, { component: "dropdown.items", children: [
|
|
106
|
+
X && /* @__PURE__ */ r(
|
|
107
|
+
m,
|
|
131
108
|
{
|
|
132
109
|
component: "dropdown.unselect",
|
|
133
|
-
selected:
|
|
134
|
-
...
|
|
135
|
-
props: { ...
|
|
110
|
+
selected: p.length === 0,
|
|
111
|
+
...g.props,
|
|
112
|
+
props: { ...g.props.props, onClick: (e) => U(e) }
|
|
136
113
|
}
|
|
137
114
|
),
|
|
138
|
-
|
|
139
|
-
|
|
115
|
+
Y && /* @__PURE__ */ r(
|
|
116
|
+
m,
|
|
140
117
|
{
|
|
141
118
|
component: "dropdown.selectAll",
|
|
142
|
-
...
|
|
143
|
-
props: { ...
|
|
119
|
+
...T.props,
|
|
120
|
+
props: { ...T.props.props, onClick: (e) => U(e, ...K) }
|
|
144
121
|
}
|
|
145
122
|
),
|
|
146
|
-
|
|
147
|
-
const { value:
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
123
|
+
u.map((e) => {
|
|
124
|
+
const { value: n, onClick: o, ...d } = e.props;
|
|
125
|
+
return /* @__PURE__ */ r(
|
|
126
|
+
m,
|
|
150
127
|
{
|
|
151
128
|
component: "dropdown.item",
|
|
152
|
-
variant:
|
|
153
|
-
selected:
|
|
154
|
-
...
|
|
129
|
+
variant: c ? "multiple" : void 0,
|
|
130
|
+
selected: p.includes(n),
|
|
131
|
+
...d,
|
|
155
132
|
props: {
|
|
156
|
-
...
|
|
133
|
+
...d.props,
|
|
157
134
|
onClick: (k) => {
|
|
158
|
-
o
|
|
135
|
+
o?.(k), U(k, e);
|
|
159
136
|
}
|
|
160
137
|
}
|
|
161
138
|
},
|
|
162
|
-
|
|
139
|
+
n
|
|
163
140
|
);
|
|
164
141
|
}),
|
|
165
|
-
|
|
142
|
+
u.length === 0 && j && /* @__PURE__ */ r(m, { component: "dropdown.emptyItem", ...j.props })
|
|
166
143
|
] })
|
|
167
144
|
}
|
|
168
145
|
)
|
|
169
146
|
] });
|
|
170
147
|
}
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
return
|
|
148
|
+
function v(l) {
|
|
149
|
+
const t = (N) => null;
|
|
150
|
+
return t.displayName = l, t;
|
|
174
151
|
}
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
function
|
|
183
|
-
var m;
|
|
152
|
+
const y = ee(ie);
|
|
153
|
+
y.Item = v("DropdownItem");
|
|
154
|
+
y.Unselect = v("DropdownUnselect");
|
|
155
|
+
y.SelectAll = v("DropdownSelectAll");
|
|
156
|
+
y.EmptyItem = v("DropdownEmptyItem");
|
|
157
|
+
y.Display = v("DropdownDisplay");
|
|
158
|
+
y.displayName = "Dropdown";
|
|
159
|
+
function O(l) {
|
|
184
160
|
if (l == null) return "";
|
|
185
161
|
if (typeof l == "object") {
|
|
186
|
-
const
|
|
187
|
-
return
|
|
162
|
+
const t = l.props?.children;
|
|
163
|
+
return t == null ? "" : typeof t == "object" ? (Array.isArray(t) ? t : [t]).map((f) => O(f)).join("") : t.toString();
|
|
188
164
|
}
|
|
189
165
|
return l.toString();
|
|
190
166
|
}
|
|
191
167
|
export {
|
|
192
|
-
|
|
168
|
+
y as default
|
|
193
169
|
};
|
package/components/flex.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),s=require("react"),o=require("../box.cjs");function u(t,l){const{inline:r,...i}=t;return n.jsx(o.default,{ref:l,display:r?"inline-flex":"flex",...i})}const e=s.forwardRef(u);e.displayName="Flex";exports.default=e;
|
package/components/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),n=require("react"),m=require("../box.cjs"),f=require("../core.cjs");function s(e){const{onSubmit:t,props:u}=e,r=n.useRef(null),c=n.useCallback(o=>{o.preventDefault();const a=f.FormUtils.getFormEntries(r.current);t(a,o)},[t]),i={...u,onSubmit:c,ref:r};return l.jsx(m.default,{tag:"form",...e,props:i})}s.displayName="Form";exports.default=s;
|
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 { d 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) => {
|
package/components/grid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),o=require("react"),u=require("../box.cjs");function d(r,i){const{inline:t,...n}=r;return s.jsx(u.default,{ref:i,display:t?"inline-grid":"grid",...n})}const e=o.forwardRef(d);e.displayName="Grid";exports.default=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),r=require("react"),a=require("../box.cjs"),i=require("../core.cjs"),s=["name","onInput","onChange","value","autoFocus","readOnly","defaultChecked"];function c(t,o){const n=i.ObjectUtils.buildProps(t,s,{type:"radio"});return u.jsx(a.default,{ref:o,tag:"input",component:"radioButton",...n})}const e=r.forwardRef(c);e.displayName="RadioButton";exports.default=e;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as r } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { O as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */
|
|
3
|
+
import e from "../box.mjs";
|
|
4
|
+
import { O as i } from "../core.mjs";
|
|
5
|
+
const p = ["name", "onInput", "onChange", "value", "autoFocus", "readOnly", "defaultChecked"];
|
|
6
|
+
function u(o, t) {
|
|
7
|
+
const n = i.buildProps(o, p, { type: "radio" });
|
|
8
|
+
return /* @__PURE__ */ a(e, { ref: t, tag: "input", component: "radioButton", ...n });
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const d = r(u);
|
|
11
|
+
d.displayName = "RadioButton";
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
d as default
|
|
14
14
|
};
|