@cronocode/react-box 1.1.4 → 1.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/box.d.ts +6 -264
- package/box.mjs +12 -9
- package/components/buttonCore.d.ts +3 -3
- package/components/buttonCore.mjs +9 -8
- package/components/{uncontrolledCheckboxCore.d.ts → checkboxCore.d.ts} +5 -5
- package/components/checkboxCore.mjs +25 -0
- package/components/{uncontrolledRadioButtonCore.d.ts → radioButtonCore.d.ts} +5 -5
- package/components/radioButtonCore.mjs +25 -0
- package/components/{uncontrolledTextareaCore.d.ts → textareaCore.d.ts} +6 -5
- package/components/textareaCore.mjs +29 -0
- package/components/{uncontrolledTextboxCore.d.ts → textboxCore.d.ts} +8 -6
- package/components/textboxCore.mjs +28 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/utils/object/objectUtils.d.ts +4 -0
- package/utils/utils.mjs +46 -34
- package/components/uncontrolledCheckboxCore.mjs +0 -27
- package/components/uncontrolledRadioButtonCore.mjs +0 -27
- package/components/uncontrolledTextareaCore.mjs +0 -44
- package/components/uncontrolledTextboxCore.mjs +0 -40
package/utils/utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p = [
|
|
2
2
|
"shadow",
|
|
3
3
|
"shadowH",
|
|
4
4
|
"shadowA",
|
|
@@ -24,57 +24,69 @@ const g = [
|
|
|
24
24
|
"outlineColorH",
|
|
25
25
|
"outlineColorA"
|
|
26
26
|
];
|
|
27
|
-
var
|
|
28
|
-
((
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
}),
|
|
27
|
+
var g;
|
|
28
|
+
((l) => {
|
|
29
|
+
function i(...u) {
|
|
30
|
+
return u.reduce((s, o) => o ? typeof o == "string" ? (s.push(o), s) : Array.isArray(o) ? (s.push(...i(...o)), s) : (Object.entries(o).forEach(([t, e]) => {
|
|
31
|
+
e && s.push(t);
|
|
32
|
+
}), s) : s, []);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
})(
|
|
36
|
-
const C =
|
|
34
|
+
l.classNames = i;
|
|
35
|
+
})(g || (g = {}));
|
|
36
|
+
const C = g;
|
|
37
|
+
var h;
|
|
38
|
+
((l) => {
|
|
39
|
+
function i(u, ...s) {
|
|
40
|
+
const o = { ...u }, t = {};
|
|
41
|
+
return s.forEach((e) => {
|
|
42
|
+
e in o && (t[e] = o[e], delete o[e]);
|
|
43
|
+
}), [t, o];
|
|
44
|
+
}
|
|
45
|
+
l.moveToTagProps = i;
|
|
46
|
+
})(h || (h = {}));
|
|
47
|
+
const A = h;
|
|
37
48
|
var b;
|
|
38
|
-
((
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
const r =
|
|
42
|
-
return r && (
|
|
49
|
+
((l) => {
|
|
50
|
+
function i(s) {
|
|
51
|
+
const o = Array.from(s.elements).reduce((t, e) => {
|
|
52
|
+
const r = e.name;
|
|
53
|
+
return r && (t[r] || (t[r] = []), t[r].push(e)), t;
|
|
43
54
|
}, {});
|
|
44
|
-
return Object.entries(
|
|
55
|
+
return Object.entries(o).reduce((t, [e, r]) => {
|
|
45
56
|
if (r.length === 1) {
|
|
46
57
|
const c = r[0];
|
|
47
|
-
|
|
58
|
+
u(t, e, c.type === "checkbox" || c.type === "radio" ? c.checked : c.value);
|
|
48
59
|
} else {
|
|
49
|
-
const c = r.reduce((
|
|
50
|
-
|
|
60
|
+
const c = r.reduce((d, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && d.push(n.value) : d.push(n.value), d), []);
|
|
61
|
+
u(t, e, c);
|
|
51
62
|
}
|
|
52
|
-
return
|
|
63
|
+
return t;
|
|
53
64
|
}, {});
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
let r =
|
|
60
|
-
|
|
61
|
-
if (
|
|
66
|
+
l.getFormEntries = i;
|
|
67
|
+
function u(s, o, t) {
|
|
68
|
+
if (o.includes(".")) {
|
|
69
|
+
const e = o.split(".");
|
|
70
|
+
let r = s;
|
|
71
|
+
e.forEach((c, d) => {
|
|
72
|
+
if (e.length > d + 1) {
|
|
62
73
|
const n = c.match(/^(.+)\[(\d)\]$/);
|
|
63
74
|
if (n) {
|
|
64
|
-
const [,
|
|
65
|
-
r[
|
|
75
|
+
const [, a, f] = n;
|
|
76
|
+
r[a] = r[a] || [], r[a][f] = r[a][f] || {}, r = r[a][f];
|
|
66
77
|
} else
|
|
67
78
|
r[c] = r[c] || {}, r = r[c];
|
|
68
79
|
} else
|
|
69
|
-
r[c] =
|
|
80
|
+
r[c] = t;
|
|
70
81
|
});
|
|
71
82
|
} else
|
|
72
|
-
|
|
83
|
+
s[o] = t;
|
|
73
84
|
}
|
|
74
85
|
})(b || (b = {}));
|
|
75
|
-
const
|
|
86
|
+
const H = b;
|
|
76
87
|
export {
|
|
77
88
|
C,
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
H as F,
|
|
90
|
+
A as O,
|
|
91
|
+
p as t
|
|
80
92
|
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as h } from "react";
|
|
3
|
-
import x from "../box.mjs";
|
|
4
|
-
import "../box.module.css.mjs";
|
|
5
|
-
import "../utils/utils.mjs";
|
|
6
|
-
function C(o, e) {
|
|
7
|
-
const { props: r, name: t, disabled: n, placeholder: a, value: p, onInput: c, onChange: l, autoFocus: u, readOnly: d, required: i, defaultChecked: s } = o, m = {
|
|
8
|
-
...r,
|
|
9
|
-
type: "checkbox",
|
|
10
|
-
name: t,
|
|
11
|
-
disabled: n,
|
|
12
|
-
placeholder: a,
|
|
13
|
-
onInput: c,
|
|
14
|
-
onChange: l,
|
|
15
|
-
value: p,
|
|
16
|
-
autoFocus: u,
|
|
17
|
-
readOnly: d,
|
|
18
|
-
required: i,
|
|
19
|
-
defaultChecked: s,
|
|
20
|
-
ref: e
|
|
21
|
-
};
|
|
22
|
-
return /* @__PURE__ */ f(x, { tag: "input", inline: !0, ...o, props: m });
|
|
23
|
-
}
|
|
24
|
-
const P = h(C);
|
|
25
|
-
export {
|
|
26
|
-
P as default
|
|
27
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as g } from "react";
|
|
3
|
-
import C from "../box.mjs";
|
|
4
|
-
import "../box.module.css.mjs";
|
|
5
|
-
import "../utils/utils.mjs";
|
|
6
|
-
function h(o, r) {
|
|
7
|
-
const { props: t, name: e, disabled: n, placeholder: a, value: d, onInput: i, onChange: p, autoFocus: u, readOnly: l, required: s, defaultChecked: c } = o, m = {
|
|
8
|
-
...t,
|
|
9
|
-
type: "radio",
|
|
10
|
-
name: e,
|
|
11
|
-
disabled: n,
|
|
12
|
-
placeholder: a,
|
|
13
|
-
onInput: i,
|
|
14
|
-
onChange: p,
|
|
15
|
-
value: d,
|
|
16
|
-
autoFocus: u,
|
|
17
|
-
readOnly: l,
|
|
18
|
-
required: s,
|
|
19
|
-
defaultChecked: c,
|
|
20
|
-
ref: r
|
|
21
|
-
};
|
|
22
|
-
return /* @__PURE__ */ f(C, { tag: "input", inline: !0, ...o, props: m });
|
|
23
|
-
}
|
|
24
|
-
const P = g(h);
|
|
25
|
-
export {
|
|
26
|
-
P as default
|
|
27
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as w } from "react";
|
|
3
|
-
import C from "../box.mjs";
|
|
4
|
-
import "../box.module.css.mjs";
|
|
5
|
-
import "../utils/utils.mjs";
|
|
6
|
-
function T(o, e) {
|
|
7
|
-
const {
|
|
8
|
-
props: r,
|
|
9
|
-
name: t,
|
|
10
|
-
disabled: n,
|
|
11
|
-
placeholder: a,
|
|
12
|
-
defaultValue: l,
|
|
13
|
-
onInput: p,
|
|
14
|
-
onChange: s,
|
|
15
|
-
rows: i,
|
|
16
|
-
cols: m,
|
|
17
|
-
autoFocus: u,
|
|
18
|
-
maxLength: d,
|
|
19
|
-
minLength: c,
|
|
20
|
-
readOnly: f,
|
|
21
|
-
required: x
|
|
22
|
-
} = o, g = {
|
|
23
|
-
...r,
|
|
24
|
-
name: t,
|
|
25
|
-
disabled: n,
|
|
26
|
-
placeholder: a,
|
|
27
|
-
onInput: p,
|
|
28
|
-
onChange: s,
|
|
29
|
-
defaultValue: l,
|
|
30
|
-
rows: i,
|
|
31
|
-
cols: m,
|
|
32
|
-
autoFocus: u,
|
|
33
|
-
maxLength: d,
|
|
34
|
-
minLength: c,
|
|
35
|
-
readOnly: f,
|
|
36
|
-
required: x,
|
|
37
|
-
ref: e
|
|
38
|
-
};
|
|
39
|
-
return /* @__PURE__ */ h(C, { tag: "textarea", inline: !0, ...o, props: g });
|
|
40
|
-
}
|
|
41
|
-
const y = w(T);
|
|
42
|
-
export {
|
|
43
|
-
y as default
|
|
44
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as g } from "react";
|
|
3
|
-
import b from "../box.mjs";
|
|
4
|
-
import "../box.module.css.mjs";
|
|
5
|
-
import "../utils/utils.mjs";
|
|
6
|
-
function y(o, t) {
|
|
7
|
-
const {
|
|
8
|
-
props: e,
|
|
9
|
-
name: r,
|
|
10
|
-
type: n,
|
|
11
|
-
disabled: p,
|
|
12
|
-
placeholder: a,
|
|
13
|
-
defaultValue: l,
|
|
14
|
-
onInput: u,
|
|
15
|
-
onChange: i,
|
|
16
|
-
autoFocus: s,
|
|
17
|
-
readOnly: d,
|
|
18
|
-
required: m,
|
|
19
|
-
step: c
|
|
20
|
-
} = o, f = {
|
|
21
|
-
...e,
|
|
22
|
-
type: n || "text",
|
|
23
|
-
name: r,
|
|
24
|
-
disabled: p,
|
|
25
|
-
placeholder: a,
|
|
26
|
-
onInput: u,
|
|
27
|
-
onChange: i,
|
|
28
|
-
defaultValue: l,
|
|
29
|
-
autoFocus: s,
|
|
30
|
-
readOnly: d,
|
|
31
|
-
required: m,
|
|
32
|
-
step: c,
|
|
33
|
-
ref: t
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ x(b, { tag: "input", inline: !0, ...o, props: f });
|
|
36
|
-
}
|
|
37
|
-
const j = g(y);
|
|
38
|
-
export {
|
|
39
|
-
j as default
|
|
40
|
-
};
|