@massimo-cassandro/minimo 1.19.10 → 1.19.11
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/package.json
CHANGED
package/src/css/forms/forms.css
CHANGED
package/src/css/layout-base.css
CHANGED
|
@@ -44,7 +44,7 @@ export function buildInputTag({
|
|
|
44
44
|
* @param {Object} args
|
|
45
45
|
* @param {string} args.label - checkbox label.
|
|
46
46
|
* @param {string | null} args.name - checkbox `name` attribute.
|
|
47
|
-
* @param {string | number | null} args.value - checkbox `value` attribute.
|
|
47
|
+
* @param {string | number | null} [args.value=1] - checkbox `value` attribute.
|
|
48
48
|
* @param {boolean} [args.checked=false] - checkbox `checked` attribute.
|
|
49
49
|
* @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper (used only when `addFormGroup` is true).
|
|
50
50
|
* @param {boolean} [args.addFormGroup=true] - When true, wraps the checkbox in a `.form-group` element.
|
|
@@ -54,7 +54,7 @@ export function buildInputTag({
|
|
|
54
54
|
export function buildCheckboxTag({
|
|
55
55
|
label,
|
|
56
56
|
name,
|
|
57
|
-
value,
|
|
57
|
+
value = 1,
|
|
58
58
|
checked = false,
|
|
59
59
|
wrapperClass = null,
|
|
60
60
|
addFormGroup = true,
|
|
@@ -65,15 +65,22 @@ export function buildCheckboxTag({
|
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/*
|
|
69
|
+
<div class="form-group">
|
|
70
|
+
<div class="form-check">
|
|
71
|
+
<input type="checkbox" id="..." name="..." class="form-check-input" value="1">
|
|
72
|
+
<label for="..." class="form-label">...</label>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
*/
|
|
68
76
|
const id = randomId();
|
|
69
77
|
|
|
70
78
|
const tag = {
|
|
71
79
|
className: classnames('form-check', !addFormGroup && wrapperClass),
|
|
72
80
|
children: [
|
|
73
|
-
`label.form-label[for:${id}] ${label}`,
|
|
74
81
|
{
|
|
75
82
|
tag: 'input',
|
|
76
|
-
className: 'form-
|
|
83
|
+
className: 'form-check-input',
|
|
77
84
|
id: id,
|
|
78
85
|
attrs: {
|
|
79
86
|
type: 'checkbox',
|
|
@@ -81,7 +88,8 @@ export function buildCheckboxTag({
|
|
|
81
88
|
name: name,
|
|
82
89
|
checked: checked
|
|
83
90
|
}
|
|
84
|
-
}
|
|
91
|
+
},
|
|
92
|
+
`label.form-label[for:${id}] ${label}`,
|
|
85
93
|
]
|
|
86
94
|
};
|
|
87
95
|
|