bootstrap-vue-next 1.2.0 → 1.2.1
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/dist/{BFormCheckbox-BMhyR-J5.js → BFormCheckbox-BYNGQgr2.js} +12 -3
- package/dist/BFormCheckbox-BYNGQgr2.js.map +1 -0
- package/dist/{BFormRadio-DRViMh6V.js → BFormRadio-DAddcnfE.js} +12 -3
- package/dist/BFormRadio-DAddcnfE.js.map +1 -0
- package/dist/{BFormSelect-QXCaxgWx.js → BFormSelect-CSS-_kul.js} +13 -3
- package/dist/BFormSelect-CSS-_kul.js.map +1 -0
- package/dist/bootstrap-vue-next.mjs +3 -3
- package/dist/components/BFormCheckbox/BFormCheckboxGroup.vue.d.mts +4 -1
- package/dist/components/BFormCheckbox/BFormCheckboxGroup.vue.d.ts +4 -1
- package/dist/components/BFormRadio/BFormRadioGroup.vue.d.mts +4 -1
- package/dist/components/BFormRadio/BFormRadioGroup.vue.d.ts +4 -1
- package/dist/components/BFormSelect/BFormSelect.vue.d.mts +5 -1
- package/dist/components/BFormSelect/BFormSelect.vue.d.ts +5 -1
- package/dist/src/components/BFormCheckbox/index.mjs +1 -1
- package/dist/src/components/BFormRadio/index.mjs +1 -1
- package/dist/src/components/BFormSelect/index.mjs +1 -1
- package/dist/src/components/index.mjs +3 -3
- package/dist/src/types/index.mjs.map +1 -1
- package/dist/types/ComponentExposes.d.mts +10 -0
- package/dist/types/ComponentExposes.d.ts +10 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/BFormCheckbox-BMhyR-J5.js.map +0 -1
- package/dist/BFormRadio-DRViMh6V.js.map +0 -1
- package/dist/BFormSelect-QXCaxgWx.js.map +0 -1
|
@@ -426,7 +426,7 @@ var BFormCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
426
426
|
"modelModifiers": {}
|
|
427
427
|
}),
|
|
428
428
|
emits: ["update:modelValue"],
|
|
429
|
-
setup(__props) {
|
|
429
|
+
setup(__props, { expose: __expose }) {
|
|
430
430
|
const props = __props;
|
|
431
431
|
const modelValue = useModel(__props, "modelValue");
|
|
432
432
|
const normalizedOptions = computed(() => (props.options ?? []).map((el) => typeof el === "string" || typeof el === "number" || typeof el === "boolean" ? {
|
|
@@ -456,8 +456,17 @@ var BFormCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
456
456
|
reverse: props.reverse,
|
|
457
457
|
switches: props.switches
|
|
458
458
|
}));
|
|
459
|
+
const base = useTemplateRef("_base");
|
|
460
|
+
__expose({
|
|
461
|
+
blur: () => {
|
|
462
|
+
base?.value?.blur();
|
|
463
|
+
},
|
|
464
|
+
focus: () => {
|
|
465
|
+
base?.value?.focus();
|
|
466
|
+
}
|
|
467
|
+
});
|
|
459
468
|
return (_ctx, _cache) => {
|
|
460
|
-
return openBlock(), createBlock(BFormCheckboxGroupBase_default, mergeProps(forwardedProps.value, {
|
|
469
|
+
return openBlock(), createBlock(BFormCheckboxGroupBase_default, mergeProps({ ref: "_base" }, forwardedProps.value, {
|
|
461
470
|
modelValue: modelValue.value,
|
|
462
471
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
463
472
|
options: normalizedOptions.value
|
|
@@ -473,4 +482,4 @@ var BFormCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
473
482
|
//#endregion
|
|
474
483
|
export { BFormCheckbox_default as n, BFormCheckboxGroup_default as t };
|
|
475
484
|
|
|
476
|
-
//# sourceMappingURL=BFormCheckbox-
|
|
485
|
+
//# sourceMappingURL=BFormCheckbox-BYNGQgr2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormCheckbox-BYNGQgr2.js","names":[],"sources":["../src/components/BFormCheckbox/BFormCheckbox.vue","../src/components/BFormCheckbox/BFormCheckbox.vue","../src/components/BFormCheckbox/BFormCheckboxGroupBase.vue","../src/components/BFormCheckbox/BFormCheckboxGroupBase.vue","../src/components/BFormCheckbox/BFormCheckboxGroup.vue","../src/components/BFormCheckbox/BFormCheckboxGroup.vue"],"sourcesContent":["<template>\n <ConditionalWrapper\n :skip=\"isButtonGroup\"\n v-bind=\"props.wrapperAttrs\"\n :class=\"computedWrapperClasses\"\n >\n <input\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedInputClasses\"\n type=\"checkbox\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :aria-required=\"computedRequired || undefined\"\n :value=\"props.value\"\n :true-value=\"props.value\"\n :false-value=\"props.uncheckedValue\"\n :indeterminate=\"indeterminate || undefined\"\n v-bind=\"processedAttrs.inputAttrs\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useAttrs, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {checkboxGroupKey, formGroupKey} from '../../utils/keys'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormCheckboxProps, BFormCheckboxSlots, CheckboxValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(\n defineProps<Omit<BFormCheckboxProps, 'modelValue' | 'indeterminate'>>(),\n {\n wrapperAttrs: undefined,\n inputClass: undefined,\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n switch: undefined,\n uncheckedValue: undefined,\n value: true,\n }\n)\nconst props = useDefaults(_props, 'BFormCheckbox')\nconst slots = defineSlots<BFormCheckboxSlots>()\nconst attrs = useAttrs()\n\nconst modelValue = defineModel<BFormCheckboxProps['modelValue']>({\n default: undefined,\n})\nconst indeterminate = defineModel<Exclude<BFormCheckboxProps['indeterminate'], undefined>>(\n 'indeterminate',\n {\n default: false,\n }\n)\n\nconst processedAttrs = computed(() => {\n const {class: wrapperClass, ...inputAttrs} = attrs\n return {wrapperClass, inputAttrs}\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(checkboxGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n switch: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n switch: props.switch ?? parentData?.switch.value ?? propDefaults.switch,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newVal) => {\n // Indeterminate is implicitly cleared when the checked state is changed to any value\n // by the user. We reflect that here by setting our indetermiate model to false\n // which will emit the indeterminate event to the parent\n indeterminate.value = false\n if (parentData !== null && Array.isArray(newVal)) {\n // The type cast isn't perfect. Array.isArray detects CheckboxValue.unknown[],\n // but since it's parentData, it should always be CheckboxValue[]\n // It doesn't quite work when props.value is an [], but this is more of a Vue issue\n parentData.modelValue.value = newVal as CheckboxValue[]\n return\n }\n modelValue.value = newVal as CheckboxValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst wrapperClasses = getClasses(classesObject)\nconst computedWrapperClasses = computed(() => [\n wrapperClasses.value,\n processedAttrs.value.wrapperClass,\n])\nconst inputClasses = getInputClasses(classesObject)\nconst computedInputClasses = computed(() => [inputClasses.value, props.inputClass])\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <ConditionalWrapper\n :skip=\"isButtonGroup\"\n v-bind=\"props.wrapperAttrs\"\n :class=\"computedWrapperClasses\"\n >\n <input\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedInputClasses\"\n type=\"checkbox\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :aria-required=\"computedRequired || undefined\"\n :value=\"props.value\"\n :true-value=\"props.value\"\n :false-value=\"props.uncheckedValue\"\n :indeterminate=\"indeterminate || undefined\"\n v-bind=\"processedAttrs.inputAttrs\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useAttrs, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {checkboxGroupKey, formGroupKey} from '../../utils/keys'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormCheckboxProps, BFormCheckboxSlots, CheckboxValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(\n defineProps<Omit<BFormCheckboxProps, 'modelValue' | 'indeterminate'>>(),\n {\n wrapperAttrs: undefined,\n inputClass: undefined,\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n switch: undefined,\n uncheckedValue: undefined,\n value: true,\n }\n)\nconst props = useDefaults(_props, 'BFormCheckbox')\nconst slots = defineSlots<BFormCheckboxSlots>()\nconst attrs = useAttrs()\n\nconst modelValue = defineModel<BFormCheckboxProps['modelValue']>({\n default: undefined,\n})\nconst indeterminate = defineModel<Exclude<BFormCheckboxProps['indeterminate'], undefined>>(\n 'indeterminate',\n {\n default: false,\n }\n)\n\nconst processedAttrs = computed(() => {\n const {class: wrapperClass, ...inputAttrs} = attrs\n return {wrapperClass, inputAttrs}\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(checkboxGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n switch: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n switch: props.switch ?? parentData?.switch.value ?? propDefaults.switch,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newVal) => {\n // Indeterminate is implicitly cleared when the checked state is changed to any value\n // by the user. We reflect that here by setting our indetermiate model to false\n // which will emit the indeterminate event to the parent\n indeterminate.value = false\n if (parentData !== null && Array.isArray(newVal)) {\n // The type cast isn't perfect. Array.isArray detects CheckboxValue.unknown[],\n // but since it's parentData, it should always be CheckboxValue[]\n // It doesn't quite work when props.value is an [], but this is more of a Vue issue\n parentData.modelValue.value = newVal as CheckboxValue[]\n return\n }\n modelValue.value = newVal as CheckboxValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst wrapperClasses = getClasses(classesObject)\nconst computedWrapperClasses = computed(() => [\n wrapperClasses.value,\n processedAttrs.value.wrapperClass,\n])\nconst inputClasses = getInputClasses(classesObject)\nconst computedInputClasses = computed(() => [inputClasses.value, props.inputClass])\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"attrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"group\"\n :class=\"classes\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormCheckbox v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormCheckbox>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport type {\n BFormCheckboxGroupExposes,\n BFormCheckboxGroupBaseProps,\n CheckboxValue,\n} from '../../types'\nimport BFormCheckbox from './BFormCheckbox.vue'\nimport {checkboxGroupKey} from '../../utils/keys'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useId} from '../../composables/useId'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BFormCheckboxGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormCheckboxGroup')\n\nconst modelValue = defineModel<CheckboxValue[]>({\n default: () => [],\n})\n\nconst computedId = useId(() => props.id, 'checkbox')\nconst computedName = useId(() => props.name, 'checkbox')\nconst _element = useTemplateRef('_element')\n\nconst {focused} = useFocus(_element, {\n initialValue: props.autofocus,\n})\n\n// Provide context to child checkboxes\nprovide(checkboxGroupKey, {\n modelValue: modelValue as import('vue').Ref<\n readonly import('../../types/CheckboxTypes').CheckboxValue[]\n >,\n switch: toRef(() => props.switches),\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n buttons: toRef(() => props.buttons),\n disabled: toRef(() => props.disabled),\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed<Array<{text: string; value: CheckboxValue; disabled: boolean}>>(\n () =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure text and disabled are defined, with group disabled taking precedence\n return {\n ...option,\n text: option.text ?? String(option.value ?? ''),\n value: option.value ?? null,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst attrs = getGroupAttr(classesObject)\nconst classes = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n} satisfies BFormCheckboxGroupExposes)\n</script>\n","<template>\n <div\n v-bind=\"attrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"group\"\n :class=\"classes\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormCheckbox v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormCheckbox>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport type {\n BFormCheckboxGroupExposes,\n BFormCheckboxGroupBaseProps,\n CheckboxValue,\n} from '../../types'\nimport BFormCheckbox from './BFormCheckbox.vue'\nimport {checkboxGroupKey} from '../../utils/keys'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useId} from '../../composables/useId'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BFormCheckboxGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormCheckboxGroup')\n\nconst modelValue = defineModel<CheckboxValue[]>({\n default: () => [],\n})\n\nconst computedId = useId(() => props.id, 'checkbox')\nconst computedName = useId(() => props.name, 'checkbox')\nconst _element = useTemplateRef('_element')\n\nconst {focused} = useFocus(_element, {\n initialValue: props.autofocus,\n})\n\n// Provide context to child checkboxes\nprovide(checkboxGroupKey, {\n modelValue: modelValue as import('vue').Ref<\n readonly import('../../types/CheckboxTypes').CheckboxValue[]\n >,\n switch: toRef(() => props.switches),\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n buttons: toRef(() => props.buttons),\n disabled: toRef(() => props.disabled),\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed<Array<{text: string; value: CheckboxValue; disabled: boolean}>>(\n () =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure text and disabled are defined, with group disabled taking precedence\n return {\n ...option,\n text: option.text ?? String(option.value ?? ''),\n value: option.value ?? null,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst attrs = getGroupAttr(classesObject)\nconst classes = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n} satisfies BFormCheckboxGroupExposes)\n</script>\n","<template>\n <BFormCheckboxGroupBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as unknown as CheckboxValue[]\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormCheckboxGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport type {\n BFormCheckboxGroupExposes,\n BFormCheckboxGroupProps,\n BFormCheckboxGroupSlots,\n CheckboxValue,\n OptionsValues,\n} from '../../types'\nimport {computed, useTemplateRef} from 'vue'\nimport BFormCheckboxGroupBase from './BFormCheckboxGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormCheckboxGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is array of those value types\n * - Object arrays with 'value' field: modelValue is array of value field types\n * - Use 'as const' on options for literal type inference\n */\n\n// Generic props - type safety happens here\nconst props = withDefaults(defineProps<Omit<BFormCheckboxGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\ndefineSlots<BFormCheckboxGroupSlots>()\n\n// Type-safe model value - extracts union from options, wraps in array.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options>[] | undefined>({\n default: () => [],\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(() =>\n (props.options ?? []).map(\n (el) =>\n (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n boolean | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n String((el as Record<string, unknown>)[props.valueField as string]),\n }) as {text: string; value: CheckboxValue; disabled: boolean}\n )\n)\n\n// Forward all non-option-related props\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n switches: props.switches,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormCheckboxGroupExposes)\n</script>\n","<template>\n <BFormCheckboxGroupBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as unknown as CheckboxValue[]\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormCheckboxGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport type {\n BFormCheckboxGroupExposes,\n BFormCheckboxGroupProps,\n BFormCheckboxGroupSlots,\n CheckboxValue,\n OptionsValues,\n} from '../../types'\nimport {computed, useTemplateRef} from 'vue'\nimport BFormCheckboxGroupBase from './BFormCheckboxGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormCheckboxGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is array of those value types\n * - Object arrays with 'value' field: modelValue is array of value field types\n * - Use 'as const' on options for literal type inference\n */\n\n// Generic props - type safety happens here\nconst props = withDefaults(defineProps<Omit<BFormCheckboxGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\ndefineSlots<BFormCheckboxGroupSlots>()\n\n// Type-safe model value - extracts union from options, wraps in array.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options>[] | undefined>({\n default: () => [],\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(() =>\n (props.options ?? []).map(\n (el) =>\n (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n boolean | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n String((el as Record<string, unknown>)[props.valueField as string]),\n }) as {text: string; value: CheckboxValue; disabled: boolean}\n )\n)\n\n// Forward all non-option-related props\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n switches: props.switches,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormCheckboxGroupExposes)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEA,MAAM,QAAQ,YAAY,SAAQ,eAAe;EACjD,MAAM,QAAQ,SAAA;EACd,MAAM,QAAQ,SAAS;EAEv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B,gCAhBzB,WAgByB,EAfvB,KAAI,QAAO,GACH,eAAA,OAAc;IACb,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAA,QAAU;IAClB,SAAS,kBAAA;;IAGC,OAAK,cACO,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;IAGZ,QAAM,SAAE,cAAS,CAC1B,WAAyC,KAAA,QAAA,UAAA,eAAA,mBAAb,SAAS,CAAA,CAAA,CAAA,CAAA;IAGvC,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -382,7 +382,7 @@ var BFormRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
382
382
|
"modelModifiers": {}
|
|
383
383
|
}),
|
|
384
384
|
emits: ["update:modelValue"],
|
|
385
|
-
setup(__props) {
|
|
385
|
+
setup(__props, { expose: __expose }) {
|
|
386
386
|
const props = __props;
|
|
387
387
|
const modelValue = useModel(__props, "modelValue");
|
|
388
388
|
const normalizedOptions = computed(() => (props.options ?? []).map((el) => typeof el === "string" || typeof el === "number" || typeof el === "boolean" ? {
|
|
@@ -411,8 +411,17 @@ var BFormRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
411
411
|
plain: props.plain,
|
|
412
412
|
reverse: props.reverse
|
|
413
413
|
}));
|
|
414
|
+
const base = useTemplateRef("_base");
|
|
415
|
+
__expose({
|
|
416
|
+
blur: () => {
|
|
417
|
+
base?.value?.blur();
|
|
418
|
+
},
|
|
419
|
+
focus: () => {
|
|
420
|
+
base?.value?.focus();
|
|
421
|
+
}
|
|
422
|
+
});
|
|
414
423
|
return (_ctx, _cache) => {
|
|
415
|
-
return openBlock(), createBlock(BFormRadioGroupBase_default, mergeProps(forwardedProps.value, {
|
|
424
|
+
return openBlock(), createBlock(BFormRadioGroupBase_default, mergeProps({ ref: "_base" }, forwardedProps.value, {
|
|
416
425
|
modelValue: modelValue.value,
|
|
417
426
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
418
427
|
options: normalizedOptions.value
|
|
@@ -428,4 +437,4 @@ var BFormRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
428
437
|
//#endregion
|
|
429
438
|
export { BFormRadio_default as n, BFormRadioGroup_default as t };
|
|
430
439
|
|
|
431
|
-
//# sourceMappingURL=BFormRadio-
|
|
440
|
+
//# sourceMappingURL=BFormRadio-DAddcnfE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormRadio-DAddcnfE.js","names":["$attrs"],"sources":["../src/components/BFormRadio/BFormRadio.vue","../src/components/BFormRadio/BFormRadio.vue","../src/components/BFormRadio/BFormRadioGroupBase.vue","../src/components/BFormRadio/BFormRadioGroupBase.vue","../src/components/BFormRadio/BFormRadioGroup.vue","../src/components/BFormRadio/BFormRadioGroup.vue"],"sourcesContent":["<template>\n <ConditionalWrapper :skip=\"isButtonGroup\" :class=\"computedClasses\">\n <input\n :id=\"computedId\"\n v-bind=\"$attrs\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"inputClasses\"\n type=\"radio\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :value=\"props.value\"\n :aria-required=\"computedRequired || undefined\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {isEmptySlot} from '../../utils/dom'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {formGroupKey, radioGroupKey} from '../../utils/keys'\nimport type {BFormRadioProps, BFormRadioSlots, RadioValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BFormRadioProps, 'modelValue'>>(), {\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n value: true,\n})\nconst props = useDefaults(_props, 'BFormRadio')\nconst slots = defineSlots<BFormRadioSlots>()\n\nconst modelValue = defineModel<BFormRadioProps['modelValue']>({\n default: undefined,\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(radioGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newValue) => {\n if (newValue === undefined) return\n if (parentData !== null) {\n parentData.modelValue.value = newValue as RadioValue\n return\n }\n modelValue.value = newValue as RadioValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst computedClasses = getClasses(classesObject)\nconst inputClasses = getInputClasses(classesObject)\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <ConditionalWrapper :skip=\"isButtonGroup\" :class=\"computedClasses\">\n <input\n :id=\"computedId\"\n v-bind=\"$attrs\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"inputClasses\"\n type=\"radio\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :value=\"props.value\"\n :aria-required=\"computedRequired || undefined\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {isEmptySlot} from '../../utils/dom'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {formGroupKey, radioGroupKey} from '../../utils/keys'\nimport type {BFormRadioProps, BFormRadioSlots, RadioValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BFormRadioProps, 'modelValue'>>(), {\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n value: true,\n})\nconst props = useDefaults(_props, 'BFormRadio')\nconst slots = defineSlots<BFormRadioSlots>()\n\nconst modelValue = defineModel<BFormRadioProps['modelValue']>({\n default: undefined,\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(radioGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newValue) => {\n if (newValue === undefined) return\n if (parentData !== null) {\n parentData.modelValue.value = newValue as RadioValue\n return\n }\n modelValue.value = newValue as RadioValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst computedClasses = getClasses(classesObject)\nconst inputClasses = getInputClasses(classesObject)\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"computedAttrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"radiogroup\"\n :class=\"computedClasses\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormRadio v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormRadio>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport {radioGroupKey} from '../../utils/keys'\nimport BFormRadio from './BFormRadio.vue'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {\n BFormRadioGroupExposes,\n BFormRadioGroupBaseProps,\n BFormRadioGroupSlots,\n} from '../../types'\n\n/**\n * Internal base component for BFormRadioGroup.\n * This component is non-generic and uses useDefaults for complete default support.\n * Users should use BFormRadioGroup (the type-safe wrapper) instead.\n * @internal\n */\nconst _props = withDefaults(defineProps<Omit<BFormRadioGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormRadioGroup')\ndefineSlots<BFormRadioGroupSlots>()\n\nconst modelValue = defineModel<BFormRadioGroupBaseProps['modelValue']>({\n default: null,\n})\n\nconst computedId = useId(() => props.id, 'radio')\nconst computedName = useId(() => props.name, 'radio')\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element, {\n initialValue: props.autofocus,\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed(() =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure disabled respects group-level disabled taking precedence\n return {\n ...option,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nprovide(radioGroupKey, {\n modelValue: modelValue as import('vue').Ref<import('../../types/RadioTypes').RadioValue>,\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n buttons: toRef(() => props.buttons),\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n disabled: toRef(() => props.disabled),\n})\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst computedAttrs = getGroupAttr(classesObject)\nconst computedClasses = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n} satisfies BFormRadioGroupExposes)\n</script>\n","<template>\n <div\n v-bind=\"computedAttrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"radiogroup\"\n :class=\"computedClasses\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormRadio v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormRadio>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport {radioGroupKey} from '../../utils/keys'\nimport BFormRadio from './BFormRadio.vue'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {\n BFormRadioGroupExposes,\n BFormRadioGroupBaseProps,\n BFormRadioGroupSlots,\n} from '../../types'\n\n/**\n * Internal base component for BFormRadioGroup.\n * This component is non-generic and uses useDefaults for complete default support.\n * Users should use BFormRadioGroup (the type-safe wrapper) instead.\n * @internal\n */\nconst _props = withDefaults(defineProps<Omit<BFormRadioGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormRadioGroup')\ndefineSlots<BFormRadioGroupSlots>()\n\nconst modelValue = defineModel<BFormRadioGroupBaseProps['modelValue']>({\n default: null,\n})\n\nconst computedId = useId(() => props.id, 'radio')\nconst computedName = useId(() => props.name, 'radio')\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element, {\n initialValue: props.autofocus,\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed(() =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure disabled respects group-level disabled taking precedence\n return {\n ...option,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nprovide(radioGroupKey, {\n modelValue: modelValue as import('vue').Ref<import('../../types/RadioTypes').RadioValue>,\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n buttons: toRef(() => props.buttons),\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n disabled: toRef(() => props.disabled),\n})\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst computedAttrs = getGroupAttr(classesObject)\nconst computedClasses = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n} satisfies BFormRadioGroupExposes)\n</script>\n","<template>\n <BFormRadioGroupBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormRadioGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport type {\n BFormRadioGroupExposes,\n BFormRadioGroupProps,\n OptionsValues,\n RadioOption,\n} from '../../types'\nimport {computed, useTemplateRef} from 'vue'\nimport BFormRadioGroupBase from './BFormRadioGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormRadioGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormRadioGroupBase for rendering.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormRadioGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\n\n// Type-safe model value - extracts union from options.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | undefined>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: undefined as any,\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(\n () =>\n (props.options ?? []).map((el) =>\n typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n boolean | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n '',\n }\n ) as RadioOption[]\n)\n\n// Forward all non-option-related props to base component\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormRadioGroupExposes)\n</script>\n","<template>\n <BFormRadioGroupBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormRadioGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport type {\n BFormRadioGroupExposes,\n BFormRadioGroupProps,\n OptionsValues,\n RadioOption,\n} from '../../types'\nimport {computed, useTemplateRef} from 'vue'\nimport BFormRadioGroupBase from './BFormRadioGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormRadioGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormRadioGroupBase for rendering.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormRadioGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\n\n// Type-safe model value - extracts union from options.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | undefined>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: undefined as any,\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(\n () =>\n (props.options ?? []).map((el) =>\n typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n boolean | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n '',\n }\n ) as RadioOption[]\n)\n\n// Forward all non-option-related props to base component\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormRadioGroupExposes)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DA,MAAM,QAAQ,YAAY,SAAQ,YAAY;EAC9C,MAAM,QAAQ,SAAA;EAEd,MAAM,aAAa,SAA0C,SAAA,YAE5D;EAED,MAAM,aAAa,cAAY,MAAM,IAAI,YAAY;EAErD,MAAM,aAAa,OAAO,eAAe,IAAI;EAE7C,MAAM,QAAQ,eAAe,QAAQ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,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,eAAe,MAAM;GACrB,SAAS,MAAM;GACf,SAAS,MAAM;GACf,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,WAAW,MAAM;GACjB,WAAW,MAAM;GACjB,MAAM,MAAM;GACZ,aAAa,MAAM;GACnB,OAAO,MAAM;GACb,SAAS,MAAM;EACjB,EAAE;EAEF,MAAM,OAAO,eAAe,OAAO;EACnC,SAAa;GACX,YAAY;IACV,MAAM,OAAO,KAAK;GACpB;GACA,aAAa;IACX,MAAM,OAAO,MAAM;GACrB;EACF,CAAkC;;GAlIhC,OAAA,UAAA,GAAA,YAgBsB,6BAhBtB,WAgBsB,EAfpB,KAAI,QAAO,GACH,eAAA,OAAc;IACb,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAA,QAAU;IAClB,SAAS,kBAAA;;IAGC,OAAK,cACO,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;IAGZ,QAAM,SAAE,cAAS,CAC1B,WAAyC,KAAA,QAAA,UAAA,eAAA,mBAAb,SAAS,CAAA,CAAA,CAAA,CAAA;IAGvC,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -242,7 +242,7 @@ var BFormSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
242
242
|
"modelModifiers": {}
|
|
243
243
|
}),
|
|
244
244
|
emits: ["update:modelValue"],
|
|
245
|
-
setup(__props) {
|
|
245
|
+
setup(__props, { expose: __expose }) {
|
|
246
246
|
const props = __props;
|
|
247
247
|
const modelValue = useModel(__props, "modelValue");
|
|
248
248
|
const normalizeSimpleOption = (el) => ({
|
|
@@ -289,8 +289,18 @@ var BFormSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
289
289
|
size: props.size,
|
|
290
290
|
state: props.state
|
|
291
291
|
}));
|
|
292
|
+
const base = useTemplateRef("_base");
|
|
293
|
+
__expose({
|
|
294
|
+
blur: () => {
|
|
295
|
+
base?.value?.blur();
|
|
296
|
+
},
|
|
297
|
+
element: computed(() => base?.value?.element ?? null),
|
|
298
|
+
focus: () => {
|
|
299
|
+
base?.value?.focus();
|
|
300
|
+
}
|
|
301
|
+
});
|
|
292
302
|
return (_ctx, _cache) => {
|
|
293
|
-
return openBlock(), createBlock(BFormSelectBase_default, mergeProps(forwardedProps.value, {
|
|
303
|
+
return openBlock(), createBlock(BFormSelectBase_default, mergeProps({ ref: "_base" }, forwardedProps.value, {
|
|
294
304
|
modelValue: modelValue.value,
|
|
295
305
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
296
306
|
options: normalizedOptions.value
|
|
@@ -306,4 +316,4 @@ var BFormSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
306
316
|
//#endregion
|
|
307
317
|
export { BFormSelectOptionGroup_default as n, BFormSelect_default as t };
|
|
308
318
|
|
|
309
|
-
//# sourceMappingURL=BFormSelect-
|
|
319
|
+
//# sourceMappingURL=BFormSelect-CSS-_kul.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormSelect-CSS-_kul.js","names":["$attrs"],"sources":["../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelect.vue","../src/components/BFormSelect/BFormSelect.vue"],"sourcesContent":["<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {\n BFormSelectOptionGroupProps,\n BFormSelectOptionGroupSlots,\n SelectOption,\n} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {\n BFormSelectOptionGroupProps,\n BFormSelectOptionGroupSlots,\n SelectOption,\n} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectExposes, BFormSelectBaseProps} from '../../types'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<BFormSelectBaseProps['modelValue']>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== undefined && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== undefined && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n} satisfies BFormSelectExposes)\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectExposes, BFormSelectBaseProps} from '../../types'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<BFormSelectBaseProps['modelValue']>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== undefined && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== undefined && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n} satisfies BFormSelectExposes)\n</script>\n","<template>\n <BFormSelectBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions as any\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport {computed, useTemplateRef} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {\n BFormSelectExposes,\n BFormSelectProps,\n BFormSelectSlots,\n ComplexSelectOptionRaw,\n OptionsValues,\n SelectOption,\n} from '../../types'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n element: computed(() => base?.value?.element ?? null),\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormSelectExposes)\n</script>\n","<template>\n <BFormSelectBase\n ref=\"_base\"\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions as any\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n object | string | number | boolean\n )[]\n \"\n>\nimport {computed, useTemplateRef} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {\n BFormSelectExposes,\n BFormSelectProps,\n BFormSelectSlots,\n ComplexSelectOptionRaw,\n OptionsValues,\n SelectOption,\n} from '../../types'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n\nconst base = useTemplateRef('_base')\ndefineExpose({\n blur: () => {\n base?.value?.blur()\n },\n element: computed(() => base?.value?.element ?? null),\n focus: () => {\n base?.value?.focus()\n },\n} satisfies BFormSelectExposes)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,QAAQ,YAAY,SAAQ,wBAAwB;EAU1D,MAAM,EAAC,sBAAqB,oBAAoB,MAAM,SAAS,KAAK;;GA3ClE,OAAA,UAAA,GAAA,mBAYW,YAAA,EAZA,OAAO,MAAA,KAAA,CAAK,CAAC,MAAA,GAAA;IACtB,WAAqB,KAAA,QAAA,OAAA;KACrB,UAAA,IAAA,GAAA,mBAQoB,UAAA,MAAA,WAPQ,MAAA,iBAAA,IAAlB,QAAQ,UAAK;KADvB,OAAA,UAAA,GAAA,YAQoB,2BARpB,WAQoB,EANjB,KAAK,MAAK,GAAA,EAAA,SAAA,KAAA,GAAA;MAAA,GACCA,KAAAA;MAAM,GAAK;KAAM,CAAA,GAAA;MAE7B,SAAA,cAEO,CAFP,WAEO,KAAA,QAAA,UAFP,WAEO,EAAA,SAAA,KAAA,GAFqB,MAAM,SAE3B,CADF,gBAAA,gBAAA,OAAO,IAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;IAGlB,WAAQ,KAAA,QAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EE6DZ,MAAM,QAAQ,YAAY,SAAQ,aAAa;EAE/C,MAAM,aAAa,SAA+C,SAAA,YAEjE;EAED,MAAM,aAAa,cAAY,MAA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O,eAAe,OAAO;EACnC,SAAa;GACX,YAAY;IACV,MAAM,OAAO,KAAK;GACpB;GACA,SAAS,eAAe,MAAM,OAAO,WAAW,IAAI;GACpD,aAAa;IACX,MAAM,OAAO,MAAM;GACrB;EACF,CAA8B;;GA/K5B,OAAA,UAAA,GAAA,YAgBkB,yBAhBlB,WAgBkB,EAfhB,KAAI,QAAO,GACH,eAAA,OAAc;IACb,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAA,QAAU;IAClB,SAAS,kBAAA;;IAGC,OAAK,cACO,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;IAGZ,QAAM,SAAE,cAAS,CAC1B,WAAgD,KAAA,QAAA,UAAA,eAAA,mBAApB,SAAS,CAAA,CAAA,CAAA,CAAA;IAGvC,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -42,12 +42,12 @@ import { t as BForm_default } from "./BForm-BOoX6AAr.js";
|
|
|
42
42
|
import { t as BFormSelectOption_default } from "./BFormSelectOption-C8orMj24.js";
|
|
43
43
|
import { n as BFormDatalist_default, t as BFormFloatingLabel_default } from "./BForm-CcbrqF35.js";
|
|
44
44
|
import { i as BFormInvalidFeedback_default, n as BFormText_default, r as BFormRow_default, t as BFormValidFeedback_default } from "./BFormValidFeedback-BTNOXbQ6.js";
|
|
45
|
-
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "./BFormCheckbox-
|
|
45
|
+
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "./BFormCheckbox-BYNGQgr2.js";
|
|
46
46
|
import { t as BFormFile_default } from "./BFormFile-C2DnrbK7.js";
|
|
47
47
|
import { t as BFormGroup_default } from "./BFormGroup-D3R7DxxF.js";
|
|
48
|
-
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "./BFormRadio-
|
|
48
|
+
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "./BFormRadio-DAddcnfE.js";
|
|
49
49
|
import { t as BFormRating_default } from "./BFormRating-iKFgSFet.js";
|
|
50
|
-
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "./BFormSelect-
|
|
50
|
+
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "./BFormSelect-CSS-_kul.js";
|
|
51
51
|
import { t as BFormSpinbutton_default } from "./BFormSpinbutton-fkVMbQC3.js";
|
|
52
52
|
import { t as BFormTags_default } from "./BFormTags-CUcyRTCK.js";
|
|
53
53
|
import { t as BFormTextarea_default } from "./BFormTextarea-CBBlEcrV.js";
|
|
@@ -7,7 +7,10 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
focus: () => void;
|
|
13
|
+
}>) => void;
|
|
11
14
|
attrs: any;
|
|
12
15
|
slots: BFormCheckboxGroupSlots;
|
|
13
16
|
emit: (event: "update:modelValue", value: OptionsValues<Options>[] | undefined) => void;
|
|
@@ -7,7 +7,10 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
focus: () => void;
|
|
13
|
+
}>) => void;
|
|
11
14
|
attrs: any;
|
|
12
15
|
slots: BFormCheckboxGroupSlots;
|
|
13
16
|
emit: (event: "update:modelValue", value: OptionsValues<Options>[] | undefined) => void;
|
|
@@ -7,7 +7,10 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
focus: () => void;
|
|
13
|
+
}>) => void;
|
|
11
14
|
attrs: any;
|
|
12
15
|
slots: {
|
|
13
16
|
first?: (props: {}) => any;
|
|
@@ -7,7 +7,10 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
focus: () => void;
|
|
13
|
+
}>) => void;
|
|
11
14
|
attrs: any;
|
|
12
15
|
slots: {
|
|
13
16
|
first?: (props: {}) => any;
|
|
@@ -7,7 +7,11 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
element: import('vue').ComputedRef<HTMLSelectElement | null>;
|
|
13
|
+
focus: () => void;
|
|
14
|
+
}>) => void;
|
|
11
15
|
attrs: any;
|
|
12
16
|
slots: BFormSelectSlots<OptionsValues<Options>>;
|
|
13
17
|
emit: (event: "update:modelValue", value: OptionsValues<Options> | OptionsValues<Options>[] | null) => void;
|
|
@@ -7,7 +7,11 @@ declare const __VLS_export: <Options extends readonly (object | string | number
|
|
|
7
7
|
}> & (typeof globalThis extends {
|
|
8
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
9
9
|
} ? P : {});
|
|
10
|
-
expose: (exposed: {
|
|
10
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
11
|
+
blur: () => void;
|
|
12
|
+
element: import('vue').ComputedRef<HTMLSelectElement | null>;
|
|
13
|
+
focus: () => void;
|
|
14
|
+
}>) => void;
|
|
11
15
|
attrs: any;
|
|
12
16
|
slots: BFormSelectSlots<OptionsValues<Options>>;
|
|
13
17
|
emit: (event: "update:modelValue", value: OptionsValues<Options> | OptionsValues<Options>[] | null) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "../../../BFormCheckbox-
|
|
1
|
+
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "../../../BFormCheckbox-BYNGQgr2.js";
|
|
2
2
|
export { BFormCheckbox_default as BFormCheckbox, BFormCheckboxGroup_default as BFormCheckboxGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "../../../BFormRadio-
|
|
1
|
+
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "../../../BFormRadio-DAddcnfE.js";
|
|
2
2
|
export { BFormRadio_default as BFormRadio, BFormRadioGroup_default as BFormRadioGroup };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as BFormSelectOption_default } from "../../../BFormSelectOption-C8orMj24.js";
|
|
2
|
-
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "../../../BFormSelect-
|
|
2
|
+
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "../../../BFormSelect-CSS-_kul.js";
|
|
3
3
|
export { BFormSelect_default as BFormSelect, BFormSelectOption_default as BFormSelectOption, BFormSelectOptionGroup_default as BFormSelectOptionGroup };
|
|
@@ -36,12 +36,12 @@ import { t as BForm_default } from "../../BForm-BOoX6AAr.js";
|
|
|
36
36
|
import { t as BFormSelectOption_default } from "../../BFormSelectOption-C8orMj24.js";
|
|
37
37
|
import { n as BFormDatalist_default, t as BFormFloatingLabel_default } from "../../BForm-CcbrqF35.js";
|
|
38
38
|
import { i as BFormInvalidFeedback_default, n as BFormText_default, r as BFormRow_default, t as BFormValidFeedback_default } from "../../BFormValidFeedback-BTNOXbQ6.js";
|
|
39
|
-
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "../../BFormCheckbox-
|
|
39
|
+
import { n as BFormCheckbox_default, t as BFormCheckboxGroup_default } from "../../BFormCheckbox-BYNGQgr2.js";
|
|
40
40
|
import { t as BFormFile_default } from "../../BFormFile-C2DnrbK7.js";
|
|
41
41
|
import { t as BFormGroup_default } from "../../BFormGroup-D3R7DxxF.js";
|
|
42
|
-
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "../../BFormRadio-
|
|
42
|
+
import { n as BFormRadio_default, t as BFormRadioGroup_default } from "../../BFormRadio-DAddcnfE.js";
|
|
43
43
|
import { t as BFormRating_default } from "../../BFormRating-iKFgSFet.js";
|
|
44
|
-
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "../../BFormSelect-
|
|
44
|
+
import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "../../BFormSelect-CSS-_kul.js";
|
|
45
45
|
import { t as BFormSpinbutton_default } from "../../BFormSpinbutton-fkVMbQC3.js";
|
|
46
46
|
import { t as BFormTags_default } from "../../BFormTags-CUcyRTCK.js";
|
|
47
47
|
import { t as BFormTextarea_default } from "../../BFormTextarea-CBBlEcrV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/types/index.ts"],"sourcesContent":["export type {\n AlignmentCommon,\n AlignmentContent,\n AlignmentHorizontal,\n AlignmentJustifyContent,\n AlignmentTextHorizontal,\n AlignmentVertical,\n CombinedPlacement,\n ContainerHorizontalAlign,\n ContainerPosition,\n ContainerVerticalAlign,\n Placement,\n VerticalAlign,\n} from './Alignment'\nexport type {Animation} from './Animation'\nexport type {AriaInvalid} from './AriaInvalid'\nexport type {\n BTableInitialSortDirection,\n TableHeadClickedEventObject,\n TableRowEventObject,\n BTableSortByOrder,\n BTableSelectMode,\n BTableFilterFunction,\n isTableField,\n isTableFieldRaw,\n NoProviderTypes,\n TableThScope,\n TableDetailsReturn,\n TableSelectedReturn,\n TablePrimaryKey,\n BTableProvider,\n BTableProviderContext,\n BTableSortBy,\n TableField,\n TableFieldFormatter,\n TableFieldFormatterObject,\n TableFieldRaw,\n TableItem,\n TableRowThead,\n TableRowType,\n TableStrictClassValue,\n} from './TableTypes'\nexport type {\n BaseButtonVariant,\n BaseColorVariant,\n BaseTextColorVariant,\n ButtonVariant,\n ColorExtendables,\n ColorVariant,\n TextColorVariant,\n} from './ColorTypes'\nexport type {BaseSize, Size} from './Size'\nexport type {BootstrapVueOptions, showHide} from './BootstrapVueOptions'\nexport type * from './ComponentEmits'\nexport type {BreadcrumbItem, BreadcrumbItemRaw} from './BreadcrumbTypes'\nexport type * from './BreakpointProps'\nexport type {ButtonType} from './ButtonType'\nexport type {CheckboxOption, CheckboxOptionRaw, CheckboxValue} from './CheckboxTypes'\nexport type {\n ComplexSelectOption,\n ComplexSelectOptionRaw,\n SelectValue,\n SelectOption,\n SelectOptionRaw,\n} from './SelectTypes'\nexport type {InputType} from './InputType'\nexport type {LinkTarget} from './LinkTarget'\nexport type {LinkOpacity, UnderlineOffset, UnderlineOpacity} from './LinkDecorators'\nexport type {LiteralUnion} from './LiteralUnion'\nexport type {PaginationPage} from './PaginationPage'\nexport type {PlaceholderAnimation, PlaceholderSize} from './PlaceholderTypes'\nexport type {PopoverPlacement} from './PopoverPlacement'\nexport type {Position} from './Position'\nexport type {RadioOption, RadioOptionRaw, RadioValue} from './RadioTypes'\nexport type {RadiusElement, RadiusElementExtendables} from './RadiusElement'\nexport type {SpinnerType} from './SpinnerType'\nexport type {TabType} from './Tab'\nexport type {TransitionMode} from './TransitionMode'\nexport type * from './ComponentProps'\nexport type * from './ComponentSlots'\nexport type {\n TooltipOrchestratorCreateParam as OrchestratedTooltip,\n ToastOrchestratorCreateParam as OrchestratedToast,\n PopoverOrchestratorCreateParam as OrchestratedPopover,\n ModalOrchestratorCreateParam as OrchestratedModal,\n} from './ComponentOrchestratorTypes'\nexport type * from './ComponentOrchestratorTypes'\n\nexport {\n // Real\n composableNames,\n // Real\n directiveNames,\n // Real\n componentNames,\n componentsWithExternalPath,\n composablesWithExternalPath,\n directivesWithExternalPath,\n type ComponentType,\n type ComposableType,\n type DirectiveType,\n} from './BootstrapVueOptions'\nexport type {ValidationState} from './CommonTypes'\nexport type {MaybePromise} from './MaybePromise'\nexport type {ExtractItemValue, OptionsValues} from './OptionsTypes'\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/types/index.ts"],"sourcesContent":["export type {\n AlignmentCommon,\n AlignmentContent,\n AlignmentHorizontal,\n AlignmentJustifyContent,\n AlignmentTextHorizontal,\n AlignmentVertical,\n CombinedPlacement,\n ContainerHorizontalAlign,\n ContainerPosition,\n ContainerVerticalAlign,\n Placement,\n VerticalAlign,\n} from './Alignment'\nexport type {Animation} from './Animation'\nexport type {AriaInvalid} from './AriaInvalid'\nexport type {\n BTableInitialSortDirection,\n TableHeadClickedEventObject,\n TableRowEventObject,\n BTableSortByOrder,\n BTableSelectMode,\n BTableFilterFunction,\n isTableField,\n isTableFieldRaw,\n NoProviderTypes,\n TableThScope,\n TableDetailsReturn,\n TableSelectedReturn,\n TablePrimaryKey,\n BTableProvider,\n BTableProviderContext,\n BTableSortBy,\n TableField,\n TableFieldFormatter,\n TableFieldFormatterObject,\n TableFieldRaw,\n TableItem,\n TableRowThead,\n TableRowType,\n TableStrictClassValue,\n} from './TableTypes'\nexport type {\n BaseButtonVariant,\n BaseColorVariant,\n BaseTextColorVariant,\n ButtonVariant,\n ColorExtendables,\n ColorVariant,\n TextColorVariant,\n} from './ColorTypes'\nexport type {BaseSize, Size} from './Size'\nexport type {BootstrapVueOptions, showHide} from './BootstrapVueOptions'\nexport type * from './ComponentEmits'\nexport type {BreadcrumbItem, BreadcrumbItemRaw} from './BreadcrumbTypes'\nexport type * from './BreakpointProps'\nexport type {ButtonType} from './ButtonType'\nexport type {CheckboxOption, CheckboxOptionRaw, CheckboxValue} from './CheckboxTypes'\nexport type {\n ComplexSelectOption,\n ComplexSelectOptionRaw,\n SelectValue,\n SelectOption,\n SelectOptionRaw,\n} from './SelectTypes'\nexport type {InputType} from './InputType'\nexport type {LinkTarget} from './LinkTarget'\nexport type {LinkOpacity, UnderlineOffset, UnderlineOpacity} from './LinkDecorators'\nexport type {LiteralUnion} from './LiteralUnion'\nexport type {PaginationPage} from './PaginationPage'\nexport type {PlaceholderAnimation, PlaceholderSize} from './PlaceholderTypes'\nexport type {PopoverPlacement} from './PopoverPlacement'\nexport type {Position} from './Position'\nexport type {RadioOption, RadioOptionRaw, RadioValue} from './RadioTypes'\nexport type {RadiusElement, RadiusElementExtendables} from './RadiusElement'\nexport type {SpinnerType} from './SpinnerType'\nexport type {TabType} from './Tab'\nexport type {TransitionMode} from './TransitionMode'\nexport type * from './ComponentExposes'\nexport type * from './ComponentProps'\nexport type * from './ComponentSlots'\nexport type {\n TooltipOrchestratorCreateParam as OrchestratedTooltip,\n ToastOrchestratorCreateParam as OrchestratedToast,\n PopoverOrchestratorCreateParam as OrchestratedPopover,\n ModalOrchestratorCreateParam as OrchestratedModal,\n} from './ComponentOrchestratorTypes'\nexport type * from './ComponentOrchestratorTypes'\n\nexport {\n // Real\n composableNames,\n // Real\n directiveNames,\n // Real\n componentNames,\n componentsWithExternalPath,\n composablesWithExternalPath,\n directivesWithExternalPath,\n type ComponentType,\n type ComposableType,\n type DirectiveType,\n} from './BootstrapVueOptions'\nexport type {ValidationState} from './CommonTypes'\nexport type {MaybePromise} from './MaybePromise'\nexport type {ExtractItemValue, OptionsValues} from './OptionsTypes'\n"],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComputedRef, ShallowRef } from 'vue';
|
|
2
|
+
export interface blurFocusExposes {
|
|
3
|
+
blur: () => void;
|
|
4
|
+
focus: () => void;
|
|
5
|
+
}
|
|
6
|
+
export type BFormCheckboxGroupExposes = blurFocusExposes;
|
|
7
|
+
export type BFormRadioGroupExposes = blurFocusExposes;
|
|
8
|
+
export interface BFormSelectExposes extends blurFocusExposes {
|
|
9
|
+
element: Readonly<ShallowRef<HTMLSelectElement | null, HTMLSelectElement | null> | ComputedRef<HTMLSelectElement | null>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComputedRef, ShallowRef } from 'vue';
|
|
2
|
+
export interface blurFocusExposes {
|
|
3
|
+
blur: () => void;
|
|
4
|
+
focus: () => void;
|
|
5
|
+
}
|
|
6
|
+
export type BFormCheckboxGroupExposes = blurFocusExposes;
|
|
7
|
+
export type BFormRadioGroupExposes = blurFocusExposes;
|
|
8
|
+
export interface BFormSelectExposes extends blurFocusExposes {
|
|
9
|
+
element: Readonly<ShallowRef<HTMLSelectElement | null, HTMLSelectElement | null> | ComputedRef<HTMLSelectElement | null>>;
|
|
10
|
+
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -24,6 +24,7 @@ export type { RadiusElement, RadiusElementExtendables } from './RadiusElement';
|
|
|
24
24
|
export type { SpinnerType } from './SpinnerType';
|
|
25
25
|
export type { TabType } from './Tab';
|
|
26
26
|
export type { TransitionMode } from './TransitionMode';
|
|
27
|
+
export type * from './ComponentExposes';
|
|
27
28
|
export type * from './ComponentProps';
|
|
28
29
|
export type * from './ComponentSlots';
|
|
29
30
|
export type { TooltipOrchestratorCreateParam as OrchestratedTooltip, ToastOrchestratorCreateParam as OrchestratedToast, PopoverOrchestratorCreateParam as OrchestratedPopover, ModalOrchestratorCreateParam as OrchestratedModal, } from './ComponentOrchestratorTypes';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export type { RadiusElement, RadiusElementExtendables } from './RadiusElement';
|
|
|
24
24
|
export type { SpinnerType } from './SpinnerType';
|
|
25
25
|
export type { TabType } from './Tab';
|
|
26
26
|
export type { TransitionMode } from './TransitionMode';
|
|
27
|
+
export type * from './ComponentExposes';
|
|
27
28
|
export type * from './ComponentProps';
|
|
28
29
|
export type * from './ComponentSlots';
|
|
29
30
|
export type { TooltipOrchestratorCreateParam as OrchestratedTooltip, ToastOrchestratorCreateParam as OrchestratedToast, PopoverOrchestratorCreateParam as OrchestratedPopover, ModalOrchestratorCreateParam as OrchestratedModal, } from './ComponentOrchestratorTypes';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "bootstrap-vue-next",
|
|
3
3
|
"displayName": "BootstrapVueNext",
|
|
4
4
|
"description": "Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/bootstrap-vue-next.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BFormCheckbox-BMhyR-J5.js","names":[],"sources":["../src/components/BFormCheckbox/BFormCheckbox.vue","../src/components/BFormCheckbox/BFormCheckbox.vue","../src/components/BFormCheckbox/BFormCheckboxGroupBase.vue","../src/components/BFormCheckbox/BFormCheckboxGroupBase.vue","../src/components/BFormCheckbox/BFormCheckboxGroup.vue","../src/components/BFormCheckbox/BFormCheckboxGroup.vue"],"sourcesContent":["<template>\n <ConditionalWrapper\n :skip=\"isButtonGroup\"\n v-bind=\"props.wrapperAttrs\"\n :class=\"computedWrapperClasses\"\n >\n <input\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedInputClasses\"\n type=\"checkbox\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :aria-required=\"computedRequired || undefined\"\n :value=\"props.value\"\n :true-value=\"props.value\"\n :false-value=\"props.uncheckedValue\"\n :indeterminate=\"indeterminate || undefined\"\n v-bind=\"processedAttrs.inputAttrs\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useAttrs, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {checkboxGroupKey, formGroupKey} from '../../utils/keys'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormCheckboxProps, BFormCheckboxSlots, CheckboxValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(\n defineProps<Omit<BFormCheckboxProps, 'modelValue' | 'indeterminate'>>(),\n {\n wrapperAttrs: undefined,\n inputClass: undefined,\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n switch: undefined,\n uncheckedValue: undefined,\n value: true,\n }\n)\nconst props = useDefaults(_props, 'BFormCheckbox')\nconst slots = defineSlots<BFormCheckboxSlots>()\nconst attrs = useAttrs()\n\nconst modelValue = defineModel<BFormCheckboxProps['modelValue']>({\n default: undefined,\n})\nconst indeterminate = defineModel<Exclude<BFormCheckboxProps['indeterminate'], undefined>>(\n 'indeterminate',\n {\n default: false,\n }\n)\n\nconst processedAttrs = computed(() => {\n const {class: wrapperClass, ...inputAttrs} = attrs\n return {wrapperClass, inputAttrs}\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(checkboxGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n switch: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n switch: props.switch ?? parentData?.switch.value ?? propDefaults.switch,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newVal) => {\n // Indeterminate is implicitly cleared when the checked state is changed to any value\n // by the user. We reflect that here by setting our indetermiate model to false\n // which will emit the indeterminate event to the parent\n indeterminate.value = false\n if (parentData !== null && Array.isArray(newVal)) {\n // The type cast isn't perfect. Array.isArray detects CheckboxValue.unknown[],\n // but since it's parentData, it should always be CheckboxValue[]\n // It doesn't quite work when props.value is an [], but this is more of a Vue issue\n parentData.modelValue.value = newVal as CheckboxValue[]\n return\n }\n modelValue.value = newVal as CheckboxValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst wrapperClasses = getClasses(classesObject)\nconst computedWrapperClasses = computed(() => [\n wrapperClasses.value,\n processedAttrs.value.wrapperClass,\n])\nconst inputClasses = getInputClasses(classesObject)\nconst computedInputClasses = computed(() => [inputClasses.value, props.inputClass])\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <ConditionalWrapper\n :skip=\"isButtonGroup\"\n v-bind=\"props.wrapperAttrs\"\n :class=\"computedWrapperClasses\"\n >\n <input\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedInputClasses\"\n type=\"checkbox\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :aria-required=\"computedRequired || undefined\"\n :value=\"props.value\"\n :true-value=\"props.value\"\n :false-value=\"props.uncheckedValue\"\n :indeterminate=\"indeterminate || undefined\"\n v-bind=\"processedAttrs.inputAttrs\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useAttrs, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {checkboxGroupKey, formGroupKey} from '../../utils/keys'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormCheckboxProps, BFormCheckboxSlots, CheckboxValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(\n defineProps<Omit<BFormCheckboxProps, 'modelValue' | 'indeterminate'>>(),\n {\n wrapperAttrs: undefined,\n inputClass: undefined,\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n switch: undefined,\n uncheckedValue: undefined,\n value: true,\n }\n)\nconst props = useDefaults(_props, 'BFormCheckbox')\nconst slots = defineSlots<BFormCheckboxSlots>()\nconst attrs = useAttrs()\n\nconst modelValue = defineModel<BFormCheckboxProps['modelValue']>({\n default: undefined,\n})\nconst indeterminate = defineModel<Exclude<BFormCheckboxProps['indeterminate'], undefined>>(\n 'indeterminate',\n {\n default: false,\n }\n)\n\nconst processedAttrs = computed(() => {\n const {class: wrapperClass, ...inputAttrs} = attrs\n return {wrapperClass, inputAttrs}\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(checkboxGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n switch: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n switch: props.switch ?? parentData?.switch.value ?? propDefaults.switch,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newVal) => {\n // Indeterminate is implicitly cleared when the checked state is changed to any value\n // by the user. We reflect that here by setting our indetermiate model to false\n // which will emit the indeterminate event to the parent\n indeterminate.value = false\n if (parentData !== null && Array.isArray(newVal)) {\n // The type cast isn't perfect. Array.isArray detects CheckboxValue.unknown[],\n // but since it's parentData, it should always be CheckboxValue[]\n // It doesn't quite work when props.value is an [], but this is more of a Vue issue\n parentData.modelValue.value = newVal as CheckboxValue[]\n return\n }\n modelValue.value = newVal as CheckboxValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst wrapperClasses = getClasses(classesObject)\nconst computedWrapperClasses = computed(() => [\n wrapperClasses.value,\n processedAttrs.value.wrapperClass,\n])\nconst inputClasses = getInputClasses(classesObject)\nconst computedInputClasses = computed(() => [inputClasses.value, props.inputClass])\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"attrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"group\"\n :class=\"classes\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormCheckbox v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormCheckbox>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport type {BFormCheckboxGroupBaseProps, CheckboxValue} from '../../types'\nimport BFormCheckbox from './BFormCheckbox.vue'\nimport {checkboxGroupKey} from '../../utils/keys'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useId} from '../../composables/useId'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BFormCheckboxGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormCheckboxGroup')\n\nconst modelValue = defineModel<CheckboxValue[]>({\n default: () => [],\n})\n\nconst computedId = useId(() => props.id, 'checkbox')\nconst computedName = useId(() => props.name, 'checkbox')\nconst _element = useTemplateRef('_element')\n\nconst {focused} = useFocus(_element, {\n initialValue: props.autofocus,\n})\n\n// Provide context to child checkboxes\nprovide(checkboxGroupKey, {\n modelValue: modelValue as import('vue').Ref<\n readonly import('../../types/CheckboxTypes').CheckboxValue[]\n >,\n switch: toRef(() => props.switches),\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n buttons: toRef(() => props.buttons),\n disabled: toRef(() => props.disabled),\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed<Array<{text: string; value: CheckboxValue; disabled: boolean}>>(\n () =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure text and disabled are defined, with group disabled taking precedence\n return {\n ...option,\n text: option.text ?? String(option.value ?? ''),\n value: option.value ?? null,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst attrs = getGroupAttr(classesObject)\nconst classes = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"attrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"group\"\n :class=\"classes\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormCheckbox v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormCheckbox>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport type {BFormCheckboxGroupBaseProps, CheckboxValue} from '../../types'\nimport BFormCheckbox from './BFormCheckbox.vue'\nimport {checkboxGroupKey} from '../../utils/keys'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useId} from '../../composables/useId'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<Omit<BFormCheckboxGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormCheckboxGroup')\n\nconst modelValue = defineModel<CheckboxValue[]>({\n default: () => [],\n})\n\nconst computedId = useId(() => props.id, 'checkbox')\nconst computedName = useId(() => props.name, 'checkbox')\nconst _element = useTemplateRef('_element')\n\nconst {focused} = useFocus(_element, {\n initialValue: props.autofocus,\n})\n\n// Provide context to child checkboxes\nprovide(checkboxGroupKey, {\n modelValue: modelValue as import('vue').Ref<\n readonly import('../../types/CheckboxTypes').CheckboxValue[]\n >,\n switch: toRef(() => props.switches),\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n buttons: toRef(() => props.buttons),\n disabled: toRef(() => props.disabled),\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed<Array<{text: string; value: CheckboxValue; disabled: boolean}>>(\n () =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure text and disabled are defined, with group disabled taking precedence\n return {\n ...option,\n text: option.text ?? String(option.value ?? ''),\n value: option.value ?? null,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst attrs = getGroupAttr(classesObject)\nconst classes = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <BFormCheckboxGroupBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as unknown as CheckboxValue[]\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormCheckboxGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {\n BFormCheckboxGroupProps,\n BFormCheckboxGroupSlots,\n CheckboxValue,\n OptionsValues,\n} from '../../types'\nimport {computed} from 'vue'\nimport BFormCheckboxGroupBase from './BFormCheckboxGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormCheckboxGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is array of those value types\n * - Object arrays with 'value' field: modelValue is array of value field types\n * - Use 'as const' on options for literal type inference\n */\n\n// Generic props - type safety happens here\nconst props = withDefaults(defineProps<Omit<BFormCheckboxGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\ndefineSlots<BFormCheckboxGroupSlots>()\n\n// Type-safe model value - extracts union from options, wraps in array.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options>[] | undefined>({\n default: () => [],\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(() =>\n (props.options ?? []).map(\n (el) =>\n (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n | boolean\n | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n String((el as Record<string, unknown>)[props.valueField as string]),\n }) as {text: string; value: CheckboxValue; disabled: boolean}\n )\n)\n\n// Forward all non-option-related props\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n switches: props.switches,\n}))\n</script>\n","<template>\n <BFormCheckboxGroupBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as unknown as CheckboxValue[]\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormCheckboxGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {\n BFormCheckboxGroupProps,\n BFormCheckboxGroupSlots,\n CheckboxValue,\n OptionsValues,\n} from '../../types'\nimport {computed} from 'vue'\nimport BFormCheckboxGroupBase from './BFormCheckboxGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormCheckboxGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is array of those value types\n * - Object arrays with 'value' field: modelValue is array of value field types\n * - Use 'as const' on options for literal type inference\n */\n\n// Generic props - type safety happens here\nconst props = withDefaults(defineProps<Omit<BFormCheckboxGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n switches: false,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\ndefineSlots<BFormCheckboxGroupSlots>()\n\n// Type-safe model value - extracts union from options, wraps in array.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options>[] | undefined>({\n default: () => [],\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(() =>\n (props.options ?? []).map(\n (el) =>\n (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n | boolean\n | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n String((el as Record<string, unknown>)[props.valueField as string]),\n }) as {text: string; value: CheckboxValue; disabled: boolean}\n )\n)\n\n// Forward all non-option-related props\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n switches: props.switches,\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEA,MAAM,QAAQ,YAAY,SAAQ,eAAe;EACjD,MAAM,QAAQ,SAAA;EACd,MAAM,QAAQ,SAAS;EAEvB,MAAM,aAAa,SAA6C,SAAA,YAE/D;EACD,MAAM,gBAAgB,SACrB,SAAC,eAIF;EAEA,MAAM,iBAAiB,eAAe;GACpC,MAAM,EAAC,OAAO,cAAc,GAAG,eAAc;GAC7C,OAAO;IAAC;IAAc;GAAU;EAClC,CAAC;EAED,MAAM,aAAa,cAAY,MAAM,IAAI,YAAY;EAErD,MAAM,aAAa,OAAO,kBAAkB,IAAI;EAEhD,MAAM,QAAQ,eAAe,QAAQ;EAErC,MAAM,EAAC,YAAW,SAAS,OAAO,EAChC,cAAc,MAAM,UACtB,CAAC;EAED,MAAM,iBAAiB,eAAe,CAAC,YAAY,MAAM,OAAO,CAAC;EAGjE,MAAM,eAAe;GACnB,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,MAAM,KAAA;GACN,eAAe;GACf,OAAO;EACT;EAGA,MAAM,gBAAgB,gBAAgB;GACpC,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,aAAa;GAC9D,QAAQ,MAAM,UAAU,YAAY,QAAQ,SAAS,aAAa;GAClE,QAAQ,MAAM,UAAU,YAAY,OAAO,SAAS,aAAa;GACjE,SAAS,MAAM,WAAW,YAAY,QAAQ,SAAS,aAAa;GACpE,QAAQ,MAAM,UAAU,YAAY,OAAO,SAAS,aAAa;GACjE,OAAO,MAAM,SAAS,YAAY,M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Ae,MAAM;GACrB,SAAS,MAAM;GACf,SAAS,MAAM;GACf,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,WAAW,MAAM;GACjB,WAAW,MAAM;GACjB,MAAM,MAAM;GACZ,aAAa,MAAM;GACnB,OAAO,MAAM;GACb,SAAS,MAAM;GACf,UAAU,MAAM;EAClB,EAAE;;GA9HA,OAAA,UAAA,GAAA,YAeyB,gCAfzB,WACU,eAce,OAdD;IACb,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAA,QAAU;IAClB,SAAS,kBAAA;;IAGC,OAAK,cACO,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;IAGZ,QAAM,SAAE,cAAS,CAC1B,WAAyC,KAAA,QAAA,UAAA,eAAA,mBAAb,SAAS,CAAA,CAAA,CAAA,CAAA;IAGvC,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BFormRadio-DRViMh6V.js","names":["$attrs"],"sources":["../src/components/BFormRadio/BFormRadio.vue","../src/components/BFormRadio/BFormRadio.vue","../src/components/BFormRadio/BFormRadioGroupBase.vue","../src/components/BFormRadio/BFormRadioGroupBase.vue","../src/components/BFormRadio/BFormRadioGroup.vue","../src/components/BFormRadio/BFormRadioGroup.vue"],"sourcesContent":["<template>\n <ConditionalWrapper :skip=\"isButtonGroup\" :class=\"computedClasses\">\n <input\n :id=\"computedId\"\n v-bind=\"$attrs\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"inputClasses\"\n type=\"radio\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :value=\"props.value\"\n :aria-required=\"computedRequired || undefined\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {isEmptySlot} from '../../utils/dom'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {formGroupKey, radioGroupKey} from '../../utils/keys'\nimport type {BFormRadioProps, BFormRadioSlots, RadioValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BFormRadioProps, 'modelValue'>>(), {\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n value: true,\n})\nconst props = useDefaults(_props, 'BFormRadio')\nconst slots = defineSlots<BFormRadioSlots>()\n\nconst modelValue = defineModel<BFormRadioProps['modelValue']>({\n default: undefined,\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(radioGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newValue) => {\n if (newValue === undefined) return\n if (parentData !== null) {\n parentData.modelValue.value = newValue as RadioValue\n return\n }\n modelValue.value = newValue as RadioValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst computedClasses = getClasses(classesObject)\nconst inputClasses = getInputClasses(classesObject)\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <ConditionalWrapper :skip=\"isButtonGroup\" :class=\"computedClasses\">\n <input\n :id=\"computedId\"\n v-bind=\"$attrs\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"inputClasses\"\n type=\"radio\"\n :disabled=\"props.disabled || parentData?.disabled.value || formGroupData?.disabled.value\"\n :required=\"computedRequired || undefined\"\n :name=\"props.name || parentData?.name.value\"\n :form=\"props.form || parentData?.form.value\"\n :aria-label=\"props.ariaLabel\"\n :aria-labelledby=\"props.ariaLabelledby\"\n :value=\"props.value\"\n :aria-required=\"computedRequired || undefined\"\n />\n <label v-if=\"hasOwnLabel\" :for=\"computedId\" :class=\"labelClasses\">\n <slot />\n </label>\n </ConditionalWrapper>\n</template>\n\n<script setup lang=\"ts\">\nimport {useFocus} from '@vueuse/core'\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {getClasses, getInputClasses, getLabelClasses} from '../../composables/useFormCheck'\nimport {isEmptySlot} from '../../utils/dom'\nimport ConditionalWrapper from '../ConditionalWrapper.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {formGroupKey, radioGroupKey} from '../../utils/keys'\nimport type {BFormRadioProps, BFormRadioSlots, RadioValue} from '../../types'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BFormRadioProps, 'modelValue'>>(), {\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n autofocus: false,\n button: undefined,\n buttonGroup: false,\n buttonVariant: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n inline: undefined,\n name: undefined,\n plain: undefined,\n required: false,\n reverse: undefined,\n size: undefined,\n state: undefined,\n value: true,\n})\nconst props = useDefaults(_props, 'BFormRadio')\nconst slots = defineSlots<BFormRadioSlots>()\n\nconst modelValue = defineModel<BFormRadioProps['modelValue']>({\n default: undefined,\n})\n\nconst computedId = useId(() => props.id, 'form-check')\n\nconst parentData = inject(radioGroupKey, null)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\n\n// True default values for props that are undefined to support inheritance\nconst propDefaults = {\n plain: false,\n button: false,\n inline: false,\n reverse: false,\n size: undefined,\n buttonVariant: 'secondary' as const,\n state: null,\n}\n\n// Single source of truth for resolved prop values with parent inheritance and defaults\nconst resolvedProps = computed(() => ({\n plain: props.plain ?? parentData?.plain.value ?? propDefaults.plain,\n button: props.button ?? parentData?.buttons.value ?? propDefaults.button,\n inline: props.inline ?? parentData?.inline.value ?? propDefaults.inline,\n reverse: props.reverse ?? parentData?.reverse.value ?? propDefaults.reverse,\n state: props.state ?? parentData?.state.value ?? propDefaults.state,\n size: props.size ?? parentData?.size.value ?? propDefaults.size,\n buttonVariant:\n props.buttonVariant ?? parentData?.buttonVariant.value ?? propDefaults.buttonVariant,\n}))\n\n// Shorthand for template usage\nconst resolvedPlain = computed(() => resolvedProps.value.plain)\nconst hasOwnLabel = computed(() => hasDefaultSlot.value || !resolvedPlain.value)\n\nconst labelTargetId = computed(() => (hasOwnLabel.value ? null : computedId.value))\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(labelTargetId)\n\nconst localValue = computed({\n get: () => (parentData ? parentData.modelValue.value : modelValue.value),\n set: (newValue) => {\n if (newValue === undefined) return\n if (parentData !== null) {\n parentData.modelValue.value = newValue as RadioValue\n return\n }\n modelValue.value = newValue as RadioValue\n },\n})\n\nconst computedRequired = computed(\n () => !!(props.name ?? parentData?.name.value) && (props.required || parentData?.required.value)\n)\n\nconst isButtonGroup = computed(() => props.buttonGroup || (parentData?.buttons.value ?? false))\n\nconst classesObject = computed(() => ({\n ...resolvedProps.value,\n hasDefaultSlot: hasDefaultSlot.value,\n}))\nconst computedClasses = getClasses(classesObject)\nconst inputClasses = getInputClasses(classesObject)\nconst labelClasses = getLabelClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"computedAttrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"radiogroup\"\n :class=\"computedClasses\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormRadio v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormRadio>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport {radioGroupKey} from '../../utils/keys'\nimport BFormRadio from './BFormRadio.vue'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormRadioGroupBaseProps, BFormRadioGroupSlots} from '../../types'\n\n/**\n * Internal base component for BFormRadioGroup.\n * This component is non-generic and uses useDefaults for complete default support.\n * Users should use BFormRadioGroup (the type-safe wrapper) instead.\n * @internal\n */\nconst _props = withDefaults(defineProps<Omit<BFormRadioGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormRadioGroup')\ndefineSlots<BFormRadioGroupSlots>()\n\nconst modelValue = defineModel<BFormRadioGroupBaseProps['modelValue']>({\n default: null,\n})\n\nconst computedId = useId(() => props.id, 'radio')\nconst computedName = useId(() => props.name, 'radio')\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element, {\n initialValue: props.autofocus,\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed(() =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure disabled respects group-level disabled taking precedence\n return {\n ...option,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nprovide(radioGroupKey, {\n modelValue: modelValue as import('vue').Ref<import('../../types/RadioTypes').RadioValue>,\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n buttons: toRef(() => props.buttons),\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n disabled: toRef(() => props.disabled),\n})\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst computedAttrs = getGroupAttr(classesObject)\nconst computedClasses = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <div\n v-bind=\"computedAttrs\"\n :id=\"computedId\"\n ref=\"_element\"\n role=\"radiogroup\"\n :class=\"computedClasses\"\n class=\"bv-no-focus-ring\"\n tabindex=\"-1\"\n >\n <slot name=\"first\" />\n <BFormRadio v-for=\"(item, index) in normalizedOptions\" :key=\"index\" v-bind=\"item\">\n <slot name=\"option\" v-bind=\"item\">\n {{ item.text }}\n </slot>\n </BFormRadio>\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef, useTemplateRef} from 'vue'\nimport {radioGroupKey} from '../../utils/keys'\nimport BFormRadio from './BFormRadio.vue'\nimport {getGroupAttr, getGroupClasses} from '../../composables/useFormCheck'\nimport {useFocus} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport type {BFormRadioGroupBaseProps, BFormRadioGroupSlots} from '../../types'\n\n/**\n * Internal base component for BFormRadioGroup.\n * This component is non-generic and uses useDefaults for complete default support.\n * Users should use BFormRadioGroup (the type-safe wrapper) instead.\n * @internal\n */\nconst _props = withDefaults(defineProps<Omit<BFormRadioGroupBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [],\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n validated: false,\n})\nconst props = useDefaults(_props, 'BFormRadioGroup')\ndefineSlots<BFormRadioGroupSlots>()\n\nconst modelValue = defineModel<BFormRadioGroupBaseProps['modelValue']>({\n default: null,\n})\n\nconst computedId = useId(() => props.id, 'radio')\nconst computedName = useId(() => props.name, 'radio')\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element, {\n initialValue: props.autofocus,\n})\n\n// Normalize options to always be objects with text/value fields\nconst normalizedOptions = computed(() =>\n props.options.map((option) => {\n if (typeof option === 'object' && option !== null) {\n // Ensure disabled respects group-level disabled taking precedence\n return {\n ...option,\n disabled: props.disabled ? true : (option.disabled ?? false),\n }\n }\n // Primitive value - normalize to {text, value}, with group disabled taking precedence\n return {\n text: String(option),\n value: option,\n disabled: props.disabled,\n }\n })\n)\n\nprovide(radioGroupKey, {\n modelValue: modelValue as import('vue').Ref<import('../../types/RadioTypes').RadioValue>,\n buttonVariant: toRef(() => props.buttonVariant),\n form: toRef(() => props.form),\n name: computedName,\n buttons: toRef(() => props.buttons),\n state: toRef(() => props.state),\n plain: toRef(() => props.plain),\n size: toRef(() => props.size),\n inline: toRef(() => !props.stacked),\n reverse: toRef(() => props.reverse),\n required: toRef(() => props.required),\n disabled: toRef(() => props.disabled),\n})\n\nconst classesObject = computed(() => ({\n required: props.required,\n ariaInvalid: props.ariaInvalid,\n state: props.state,\n validated: props.validated,\n buttons: props.buttons,\n stacked: props.stacked,\n size: props.size,\n}))\nconst computedAttrs = getGroupAttr(classesObject)\nconst computedClasses = getGroupClasses(classesObject)\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <BFormRadioGroupBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormRadioGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormRadioGroupProps, OptionsValues, RadioOption} from '../../types'\nimport {computed} from 'vue'\nimport BFormRadioGroupBase from './BFormRadioGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormRadioGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormRadioGroupBase for rendering.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormRadioGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\n\n// Type-safe model value - extracts union from options.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | undefined>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: undefined as any,\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(\n () =>\n (props.options ?? []).map((el) =>\n typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n | boolean\n | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n '',\n }\n ) as RadioOption[]\n)\n\n// Forward all non-option-related props to base component\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n}))\n</script>\n","<template>\n <BFormRadioGroupBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps\" />\n </template>\n\n <slot />\n </BFormRadioGroupBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormRadioGroupProps, OptionsValues, RadioOption} from '../../types'\nimport {computed} from 'vue'\nimport BFormRadioGroupBase from './BFormRadioGroupBase.vue'\n\n/**\n * Type-safe wrapper component for BFormRadioGroup.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormRadioGroupBase for rendering.\n * Supports both complex objects and simple scalar types (string, number, boolean).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormRadioGroupProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n buttonVariant: 'secondary',\n buttons: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n name: undefined,\n options: () => [] as unknown as Options,\n plain: false,\n required: false,\n reverse: false,\n size: undefined,\n stacked: false,\n state: null,\n textField: 'text',\n validated: false,\n valueField: 'value',\n})\n\n// Type-safe model value - extracts union from options.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | undefined>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: undefined as any,\n})\n\n// Type-safe normalization of options\nconst normalizedOptions = computed(\n () =>\n (props.options ?? []).map((el) =>\n typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean'\n ? {\n value: el,\n disabled: props.disabled,\n text: el.toString(),\n }\n : {\n value: (el as Record<string, unknown>)[props.valueField as string],\n disabled:\n props.disabled ||\n (((el as Record<string, unknown>)[props.disabledField as string] as\n | boolean\n | undefined) ??\n false),\n text:\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n '',\n }\n ) as RadioOption[]\n)\n\n// Forward all non-option-related props to base component\nconst forwardedProps = computed(() => ({\n id: props.id,\n name: props.name,\n size: props.size,\n state: props.state,\n buttonVariant: props.buttonVariant,\n buttons: props.buttons,\n stacked: props.stacked,\n disabled: props.disabled,\n required: props.required,\n validated: props.validated,\n autofocus: props.autofocus,\n form: props.form,\n ariaInvalid: props.ariaInvalid,\n plain: props.plain,\n reverse: props.reverse,\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DA,MAAM,QAAQ,YAAY,SAAQ,YAAY;EAC9C,MAAM,QAAQ,SAAA;EAEd,MAAM,aAAa,SAA0C,SAAA,YAE5D;EAED,MAAM,aAAa,cAAY,MAAM,IAAI,YAAY;EAErD,MAAM,aAAa,OAAO,eAAe,IAAI;EAE7C,MAAM,QAAQ,eAAe,QAAQ;EAErC,MAAM,EAAC,YAAW,SAAS,OAAO,EAChC,cAAc,MAAM,UACtB,CAAC;EAED,MAAM,iBAAiB,eAA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U,MAAM;GAChB,UAAU,MAAM;GAChB,WAAW,MAAM;GACjB,WAAW,MAAM;GACjB,MAAM,MAAM;GACZ,aAAa,MAAM;GACnB,OAAO,MAAM;GACb,SAAS,MAAM;EACjB,EAAE;;GAtHA,OAAA,UAAA,GAAA,YAesB,6BAftB,WACU,eAcY,OAdE;IACb,YAAA,WAAA;IAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,WAAA,QAAU;IAClB,SAAS,kBAAA;;IAGC,OAAK,cACO,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;IAGZ,QAAM,SAAE,cAAS,CAC1B,WAAyC,KAAA,QAAA,UAAA,eAAA,mBAAb,SAAS,CAAA,CAAA,CAAA,CAAA;IAGvC,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BFormSelect-QXCaxgWx.js","names":["$attrs"],"sources":["../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelect.vue","../src/components/BFormSelect/BFormSelect.vue"],"sourcesContent":["<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {\n BFormSelectOptionGroupProps,\n BFormSelectOptionGroupSlots,\n SelectOption,\n} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {\n BFormSelectOptionGroupProps,\n BFormSelectOptionGroupSlots,\n SelectOption,\n} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<BFormSelectBaseProps['modelValue']>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== undefined && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== undefined && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<BFormSelectBaseProps['modelValue']>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.()\nformGroupData?.track(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== undefined && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== undefined && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <BFormSelectBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions as any\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {\n BFormSelectProps,\n BFormSelectSlots,\n ComplexSelectOptionRaw,\n OptionsValues,\n SelectOption,\n} from '../../types'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n","<template>\n <BFormSelectBase\n v-bind=\"forwardedProps\"\n v-model=\"modelValue as any\"\n :options=\"normalizedOptions as any\"\n >\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {\n BFormSelectProps,\n BFormSelectSlots,\n ComplexSelectOptionRaw,\n OptionsValues,\n SelectOption,\n} from '../../types'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: undefined,\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,QAAQ,YAAY,SAAQ,wBAAwB;EAU1D,MAAM,EAAC,sBAAqB,oBAAoB,MAAM,SAAS,KAAK;;GA3ClE,OAAA,UAAA,GAAA,mBA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