import { defineComponent, h, PropType } from 'vue' import { CFormControlWrapper } from './CFormControlWrapper' type Option = { disabled?: boolean label?: string selected?: boolean value?: string } const CFormSelect = defineComponent({ name: 'CFormSelect', props: { /** * Provide valuable, actionable feedback. * * @since 4.3.0 */ feedback: String, /** * Provide valuable, actionable feedback. * * @since 4.3.0 */ feedbackInvalid: String, /** * Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. * * @since 4.3.0 */ feedbackValid: String, /** * Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. * * @since 4.3.0 */ floatingLabel: String, /** * Specifies the number of visible options in a drop-down list. */ htmlSize: Number, /** * The id global attribute defines an identifier (ID) that must be unique in the whole document. */ id: String, /** * Set component validation state to invalid. */ invalid: Boolean, /** * Add a caption for a component. * * @since 4.3.0 */ label: String, /** * The default name for a value passed using v-model. */ modelValue: { type: [String, Array] as PropType, }, multiple: Boolean, /** * Options list of the select component. Available keys: `label`, `value`, `disabled`. * Examples: * - `:options="[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]"` * - `:options="['js', 'html']"` */ options: Array as PropType, /** * Size the component small or large. * * @values 'sm' | 'lg' */ size: { type: String, validator: (value: string) => { return ['sm', 'lg'].includes(value) }, }, /** * Add helper text to the component. * * @since 4.3.0 */ text: String, /** * Display validation feedback in a styled tooltip. * * @since 4.3.0 */ tooltipFeedback: Boolean, /** * Set component validation state to valid. */ valid: Boolean, }, emits: [ /** * Event occurs when when a user changes the selected option of a `