@westartcom/bread-quasar-fields 0.0.8 → 0.0.9
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/fields/CheckboxField.vue +25 -19
- package/package.json +1 -1
package/fields/CheckboxField.vue
CHANGED
|
@@ -6,29 +6,29 @@
|
|
|
6
6
|
{{ field.label }}<span class="required-asterix" v-if="field.required"> *</span>
|
|
7
7
|
</label>
|
|
8
8
|
</div>
|
|
9
|
-
|
|
10
|
-
<div class="field">
|
|
11
|
-
<label
|
|
12
|
-
v-for="(label, optionValue) in allOptions"
|
|
13
|
-
:key="id + '-' + optionValue + '-radio-input'"
|
|
14
|
-
:for="id + '-' + optionValue + '-radio-input'">
|
|
15
|
-
<input
|
|
16
|
-
:id="id + '-' + optionValue + '-radio-input'"
|
|
17
|
-
type="checkbox"
|
|
18
|
-
hidden="true"
|
|
19
|
-
:value="optionValue"
|
|
20
|
-
v-model="internalValue">
|
|
21
|
-
|
|
22
|
-
<i class="fa-regular fa-square-check fa-fw" v-if="internalValue && internalValue.includes(optionValue)"></i>
|
|
23
|
-
<i class="fa-regular fa-square fa-fw" v-if="!internalValue || !internalValue.includes(optionValue)"></i>
|
|
24
|
-
|
|
25
|
-
{{ label }}
|
|
26
|
-
</label>
|
|
27
|
-
</div>
|
|
28
9
|
</div>
|
|
29
10
|
|
|
30
11
|
<div class="field-description" v-if="field.description">{{ field.description }}</div>
|
|
31
12
|
|
|
13
|
+
<div class="field">
|
|
14
|
+
<label
|
|
15
|
+
v-for="(label, optionValue) in allOptions"
|
|
16
|
+
:key="id + '-' + optionValue + '-radio-input'"
|
|
17
|
+
:for="id + '-' + optionValue + '-radio-input'">
|
|
18
|
+
<input
|
|
19
|
+
:id="id + '-' + optionValue + '-radio-input'"
|
|
20
|
+
type="checkbox"
|
|
21
|
+
hidden="true"
|
|
22
|
+
:value="optionValue"
|
|
23
|
+
v-model="internalValue">
|
|
24
|
+
|
|
25
|
+
<i class="icon fa-solid fa-square-check fa-fw" v-if="internalValue && internalValue.includes(optionValue)"></i>
|
|
26
|
+
<i class="icon fa-solid fa-square fa-fw" v-if="!internalValue || !internalValue.includes(optionValue)"></i>
|
|
27
|
+
|
|
28
|
+
{{ label }}
|
|
29
|
+
</label>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
32
|
<div class="validation-errors" v-if="invalid && internalErrors && internalErrors.length">
|
|
33
33
|
<span class="error danger-txt-color" v-for="(error, index) in internalErrors" :key="index + 'error'">{{ error }}</span>
|
|
34
34
|
</div>
|
|
@@ -160,4 +160,10 @@ export default defineComponent({
|
|
|
160
160
|
margin-right: var(--global-spacing-half);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
+
.field-description {
|
|
164
|
+
margin: 0 0 var(--global-spacing-half) 0;
|
|
165
|
+
}
|
|
166
|
+
.icon {
|
|
167
|
+
font-size: 1.2em;
|
|
168
|
+
}
|
|
163
169
|
</style>
|