reactive-bulma 5.0.5 → 5.0.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.
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as
|
|
1
|
+
import { jsxs as i, Fragment as d, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as l } from "react";
|
|
3
|
-
import
|
|
3
|
+
import p from "../../atoms/Button/index.js";
|
|
4
4
|
import T from "../../atoms/TextArea/index.js";
|
|
5
5
|
import h from "../../atoms/Select/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import g from "../../atoms/Checkbox/index.js";
|
|
7
|
+
import N from "../../atoms/RadioButton/index.js";
|
|
8
8
|
import b from "../InputControl/index.js";
|
|
9
|
-
import { FormFieldType as
|
|
9
|
+
import { FormFieldType as e } from "../../../interfaces/moleculeProps.js";
|
|
10
10
|
const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
11
11
|
if (o === null) return null;
|
|
12
|
-
const
|
|
12
|
+
const n = {
|
|
13
13
|
testId: o.config?.testId ?? c ?? `test-form-field-${o.type}`,
|
|
14
|
-
containerTestId: c ?? `test-form-field-container-${o.type}`
|
|
14
|
+
containerTestId: o.config?.containerTestId ?? c ?? `test-form-field-container-${o.type}`
|
|
15
15
|
}, r = o.fieldLabel ? /* @__PURE__ */ t(
|
|
16
16
|
"label",
|
|
17
17
|
{
|
|
@@ -21,67 +21,67 @@ const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
|
21
21
|
}
|
|
22
22
|
) : null;
|
|
23
23
|
switch (o.type) {
|
|
24
|
-
case
|
|
24
|
+
case e.INPUT:
|
|
25
25
|
return /* @__PURE__ */ t(
|
|
26
26
|
b,
|
|
27
27
|
{
|
|
28
28
|
...o.config,
|
|
29
|
-
...
|
|
29
|
+
...n,
|
|
30
30
|
isHorizontal: s
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
case
|
|
33
|
+
case e.SELECT:
|
|
34
34
|
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
35
35
|
r,
|
|
36
36
|
/* @__PURE__ */ t(
|
|
37
37
|
h,
|
|
38
38
|
{
|
|
39
39
|
...o.config,
|
|
40
|
-
...
|
|
40
|
+
...n
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
] });
|
|
44
|
-
case
|
|
44
|
+
case e.CHECKBOX:
|
|
45
45
|
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
46
46
|
r,
|
|
47
47
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
48
|
+
g,
|
|
49
49
|
{
|
|
50
50
|
...o.config,
|
|
51
|
-
...
|
|
51
|
+
...n
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
] });
|
|
55
|
-
case
|
|
55
|
+
case e.RADIOBUTTON:
|
|
56
56
|
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
57
57
|
r,
|
|
58
58
|
/* @__PURE__ */ t(
|
|
59
|
-
|
|
59
|
+
N,
|
|
60
60
|
{
|
|
61
61
|
...o.config,
|
|
62
|
-
...
|
|
62
|
+
...n
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] });
|
|
66
|
-
case
|
|
66
|
+
case e.TEXTAREA:
|
|
67
67
|
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
68
68
|
r,
|
|
69
69
|
/* @__PURE__ */ t(
|
|
70
70
|
T,
|
|
71
71
|
{
|
|
72
72
|
...o.config,
|
|
73
|
-
...
|
|
73
|
+
...n
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
] });
|
|
77
|
-
case
|
|
77
|
+
case e.BUTTON:
|
|
78
78
|
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
79
79
|
r,
|
|
80
80
|
/* @__PURE__ */ t(
|
|
81
|
-
|
|
81
|
+
p,
|
|
82
82
|
{
|
|
83
83
|
...o.config,
|
|
84
|
-
...
|
|
84
|
+
...n
|
|
85
85
|
}
|
|
86
86
|
)
|
|
87
87
|
] });
|
|
@@ -90,7 +90,7 @@ const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
|
90
90
|
testId: c,
|
|
91
91
|
mainInput: o,
|
|
92
92
|
leftInput: s = null,
|
|
93
|
-
rightInput:
|
|
93
|
+
rightInput: n = null,
|
|
94
94
|
isHorizontal: r = !1
|
|
95
95
|
}) => {
|
|
96
96
|
const f = l(
|
|
@@ -100,10 +100,10 @@ const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
|
100
100
|
() => a({ testId: c, element: s, isHorizontal: r }),
|
|
101
101
|
[c, s, r]
|
|
102
102
|
), u = l(
|
|
103
|
-
() => a({ testId: c, element:
|
|
104
|
-
[c,
|
|
103
|
+
() => a({ testId: c, element: n, isHorizontal: r }),
|
|
104
|
+
[c, n, r]
|
|
105
105
|
);
|
|
106
|
-
return /* @__PURE__ */ i(
|
|
106
|
+
return /* @__PURE__ */ i(d, { children: [
|
|
107
107
|
m,
|
|
108
108
|
f,
|
|
109
109
|
u
|
|
@@ -1,65 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { parseClasses as
|
|
5
|
-
import { generateKey as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F } from "react";
|
|
3
|
+
import s from "../../molecules/FormFieldInput/index.js";
|
|
4
|
+
import { parseClasses as I, parseTestId as h } from "../../../functions/parsers.js";
|
|
5
|
+
import { generateKey as n } from "../../../functions/generators.js";
|
|
6
|
+
const K = ({
|
|
7
7
|
testId: c = null,
|
|
8
|
-
cssClasses:
|
|
9
|
-
style:
|
|
8
|
+
cssClasses: u = null,
|
|
9
|
+
style: i = null,
|
|
10
10
|
inputsConfig: e,
|
|
11
|
-
isHorizontal:
|
|
12
|
-
isGrouped:
|
|
13
|
-
withAddons:
|
|
11
|
+
isHorizontal: l = !1,
|
|
12
|
+
isGrouped: o = !1,
|
|
13
|
+
withAddons: y = !1
|
|
14
14
|
}) => {
|
|
15
|
-
const a =
|
|
15
|
+
const a = I([
|
|
16
16
|
"field",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]),
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return Array.isArray(e) ? e.map((
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
n
|
|
36
|
-
);
|
|
37
|
-
}) : /* @__PURE__ */ o(
|
|
38
|
-
t,
|
|
17
|
+
l ? "is-horizontal" : null,
|
|
18
|
+
o ? "is-grouped" : null,
|
|
19
|
+
y ? "has-addons" : null,
|
|
20
|
+
u
|
|
21
|
+
]), p = c ?? h({ tag: "field", parsedClasses: a }), d = F(() => {
|
|
22
|
+
const m = o ? `grouped-input-control-body-${n()}` : `input-control-body-${n()}`;
|
|
23
|
+
if (o)
|
|
24
|
+
return Array.isArray(e) ? e.map((r, f) => /* @__PURE__ */ t(
|
|
25
|
+
s,
|
|
26
|
+
{
|
|
27
|
+
...r,
|
|
28
|
+
isHorizontal: r.isHorizontal ?? l,
|
|
29
|
+
testId: r.testId ?? `test-grouped-input-control-${f}`
|
|
30
|
+
},
|
|
31
|
+
m
|
|
32
|
+
)) : /* @__PURE__ */ t(
|
|
33
|
+
s,
|
|
39
34
|
{
|
|
40
35
|
...e,
|
|
41
|
-
isHorizontal: e.isHorizontal ??
|
|
36
|
+
isHorizontal: e.isHorizontal ?? l
|
|
42
37
|
},
|
|
43
|
-
|
|
38
|
+
m
|
|
44
39
|
);
|
|
45
40
|
{
|
|
46
|
-
const
|
|
41
|
+
const r = Array.isArray(e) ? null : {
|
|
47
42
|
...e,
|
|
48
|
-
isHorizontal: e.isHorizontal ??
|
|
43
|
+
isHorizontal: e.isHorizontal ?? l
|
|
49
44
|
};
|
|
50
|
-
return
|
|
45
|
+
return r !== null ? /* @__PURE__ */ t(s, { ...r }) : null;
|
|
51
46
|
}
|
|
52
|
-
}, [e,
|
|
53
|
-
return /* @__PURE__ */
|
|
47
|
+
}, [e, o, l]);
|
|
48
|
+
return /* @__PURE__ */ t(
|
|
54
49
|
"section",
|
|
55
50
|
{
|
|
56
|
-
"data-testid":
|
|
51
|
+
"data-testid": p,
|
|
57
52
|
className: a,
|
|
58
|
-
style:
|
|
59
|
-
children:
|
|
53
|
+
style: i ?? void 0,
|
|
54
|
+
children: l ? /* @__PURE__ */ t("section", { className: "field-body", children: d }) : d
|
|
60
55
|
}
|
|
61
56
|
);
|
|
62
57
|
};
|
|
63
58
|
export {
|
|
64
|
-
|
|
59
|
+
K as default
|
|
65
60
|
};
|