hotfix(dataset): enhance radio button and checkbox components and add arrayContainsTypes validation

- Added checkbox support to the `FormCheckRadio` component.
- Updated the styling of the radio button and checkbox components.
- Added the `arrayContainsTypes` validation rule to ensure that arrays contain specific types.
- Updated the `dataset` validators and controllers to use the new validation rule.
- Updated the `FormCheckRadioGroup` component to correctly handle the `input-value` as a number.
- Removed the default value from the `id` column in the `collections` migration.
- Added the `array_contains_types` rule to the `adonisrc.ts` file.
This commit is contained in:
Kaimbacher 2025-03-28 17:34:46 +01:00
parent 9823364670
commit 09f65359f9
8 changed files with 116 additions and 41 deletions

View file

@ -47,7 +47,7 @@ const computedValue = computed({
if (props.modelValue.every((item) => typeof item === 'number')) {
return props.modelValue;
} else if (props.modelValue.every((item) => hasIdAttribute(item))) {
const ids = props.modelValue.map((obj) => obj.id.toString());
const ids = props.modelValue.map((obj) => obj.id);
return ids;
}
return props.modelValue;
@ -109,6 +109,6 @@ const inputElClass = computed(() => {
</svg>
</div>
<FormCheckRadio v-for="(value, key) in options" :key="key" v-model="computedValue" :type="type"
:name="name" :input-value="key" :label="value" :class="componentClass" />
:name="name" :input-value="Number(key)" :label="value" :class="componentClass" />
</div>
</template>