reactive-bulma 5.0.2 → 5.0.3
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,92 +1,114 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsxs as i, Fragment as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l } from "react";
|
|
3
3
|
import d 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
|
|
8
|
-
import
|
|
9
|
-
import { FormFieldType as
|
|
10
|
-
const
|
|
6
|
+
import N from "../../atoms/Checkbox/index.js";
|
|
7
|
+
import g from "../../atoms/RadioButton/index.js";
|
|
8
|
+
import b from "../InputControl/index.js";
|
|
9
|
+
import { FormFieldType as n } from "../../../interfaces/moleculeProps.js";
|
|
10
|
+
const a = ({ testId: c, element: o, isHorizontal: s }) => {
|
|
11
11
|
if (o === null) return null;
|
|
12
|
-
const
|
|
12
|
+
const e = {
|
|
13
13
|
testId: o.config?.testId ?? c ?? `test-form-field-${o.type}`,
|
|
14
14
|
containerTestId: c ?? `test-form-field-container-${o.type}`
|
|
15
|
-
}
|
|
15
|
+
}, r = o.fieldLabel ? /* @__PURE__ */ t(
|
|
16
|
+
"label",
|
|
17
|
+
{
|
|
18
|
+
"data-testid": `test-form-field-${o.type}-label`,
|
|
19
|
+
className: "label",
|
|
20
|
+
children: o.fieldLabel
|
|
21
|
+
}
|
|
22
|
+
) : null;
|
|
16
23
|
switch (o.type) {
|
|
17
|
-
case
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
24
|
+
case n.INPUT:
|
|
25
|
+
return /* @__PURE__ */ t(
|
|
26
|
+
b,
|
|
20
27
|
{
|
|
21
28
|
...o.config,
|
|
22
|
-
...
|
|
23
|
-
isHorizontal:
|
|
29
|
+
...e,
|
|
30
|
+
isHorizontal: s
|
|
24
31
|
}
|
|
25
32
|
);
|
|
26
|
-
case
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
case n.SELECT:
|
|
34
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
35
|
+
r,
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
h,
|
|
38
|
+
{
|
|
39
|
+
...o.config,
|
|
40
|
+
...e
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
case n.CHECKBOX:
|
|
45
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
46
|
+
r,
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
N,
|
|
49
|
+
{
|
|
50
|
+
...o.config,
|
|
51
|
+
...e
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
case n.RADIOBUTTON:
|
|
56
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
57
|
+
r,
|
|
58
|
+
/* @__PURE__ */ t(
|
|
59
|
+
g,
|
|
60
|
+
{
|
|
61
|
+
...o.config,
|
|
62
|
+
...e
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
66
|
+
case n.TEXTAREA:
|
|
67
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
68
|
+
r,
|
|
69
|
+
/* @__PURE__ */ t(
|
|
70
|
+
T,
|
|
71
|
+
{
|
|
72
|
+
...o.config,
|
|
73
|
+
...e
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
77
|
+
case n.BUTTON:
|
|
78
|
+
return /* @__PURE__ */ i("section", { className: "control", children: [
|
|
79
|
+
r,
|
|
80
|
+
/* @__PURE__ */ t(
|
|
81
|
+
d,
|
|
82
|
+
{
|
|
83
|
+
...o.config,
|
|
84
|
+
...e
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
66
88
|
}
|
|
67
|
-
},
|
|
89
|
+
}, R = ({
|
|
68
90
|
testId: c,
|
|
69
91
|
mainInput: o,
|
|
70
|
-
leftInput:
|
|
71
|
-
rightInput:
|
|
72
|
-
isHorizontal:
|
|
92
|
+
leftInput: s = null,
|
|
93
|
+
rightInput: e = null,
|
|
94
|
+
isHorizontal: r = !1
|
|
73
95
|
}) => {
|
|
74
|
-
const f =
|
|
75
|
-
() =>
|
|
76
|
-
[c, o,
|
|
77
|
-
),
|
|
78
|
-
() =>
|
|
79
|
-
[c,
|
|
80
|
-
),
|
|
81
|
-
() =>
|
|
82
|
-
[c,
|
|
96
|
+
const f = l(
|
|
97
|
+
() => a({ testId: c, element: o, isHorizontal: r }),
|
|
98
|
+
[c, o, r]
|
|
99
|
+
), m = l(
|
|
100
|
+
() => a({ testId: c, element: s, isHorizontal: r }),
|
|
101
|
+
[c, s, r]
|
|
102
|
+
), u = l(
|
|
103
|
+
() => a({ testId: c, element: e, isHorizontal: r }),
|
|
104
|
+
[c, e, r]
|
|
83
105
|
);
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
106
|
+
return /* @__PURE__ */ i(p, { children: [
|
|
107
|
+
m,
|
|
86
108
|
f,
|
|
87
|
-
|
|
109
|
+
u
|
|
88
110
|
] });
|
|
89
111
|
};
|
|
90
112
|
export {
|
|
91
|
-
|
|
113
|
+
R as default
|
|
92
114
|
};
|
|
@@ -5,7 +5,11 @@ declare const _default: Meta<typeof FormFieldInput>;
|
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const BasicExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
7
7
|
export declare const SelectCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
8
|
+
export declare const SelectWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
8
9
|
export declare const CheckboxCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
10
|
+
export declare const CheckboxWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
9
11
|
export declare const RadiobuttonCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
12
|
+
export declare const RadiobuttonWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
10
13
|
export declare const TextareaCase: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
14
|
+
export declare const TextareaWithLabel: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
11
15
|
export declare const LeftAddonSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormFieldInputProps>;
|
|
@@ -255,6 +255,7 @@ export declare enum FormFieldType {
|
|
|
255
255
|
export type FormFieldConfig = InputControlProps | SelectProps | CheckBoxProps | RadioButtonProps | TextAreaProps | ButtonProps;
|
|
256
256
|
export interface FormFieldElement {
|
|
257
257
|
type: FormFieldType;
|
|
258
|
+
fieldLabel?: string;
|
|
258
259
|
config: FormFieldConfig;
|
|
259
260
|
}
|
|
260
261
|
export interface FormFieldInputProps extends ElementProps {
|