vuetify 3.1.11 → 3.1.12
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/json/attributes.json +8 -12
- package/dist/json/importMap.json +84 -84
- package/dist/json/tags.json +0 -1
- package/dist/json/web-types.json +19 -25
- package/dist/vuetify-labs.css +129 -135
- package/dist/vuetify-labs.d.ts +73 -66
- package/dist/vuetify-labs.esm.js +65 -36
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +64 -35
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +53 -59
- package/dist/vuetify.d.ts +66 -75
- package/dist/vuetify.esm.js +44 -30
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +44 -30
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +326 -325
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VBadge/VBadge.css +1 -0
- package/lib/components/VBadge/VBadge.sass +1 -0
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +41 -50
- package/lib/components/VCombobox/VCombobox.mjs +9 -1
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.css +11 -18
- package/lib/components/VDialog/VDialog.mjs +2 -2
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +8 -15
- package/lib/components/VField/VField.mjs +5 -1
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +2 -2
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +2 -2
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.css +1 -1
- package/lib/components/VOverlay/VOverlay.sass +1 -1
- package/lib/components/VTextField/VTextField.mjs +11 -6
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/index.d.ts +41 -50
- package/lib/composables/forwardRefs.mjs +12 -15
- package/lib/composables/forwardRefs.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +25 -25
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRow.mjs +5 -4
- package/lib/labs/VDataTable/VDataTableRow.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +3 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/items.mjs +14 -1
- package/lib/labs/VDataTable/composables/items.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +32 -16
- package/lib/labs/components.d.ts +32 -16
- package/lib/util/globals.mjs +1 -1
- package/lib/util/globals.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VField.mjs","names":["VExpandXTransition","useInputIcon","VFieldLabel","IconValue","LoaderSlot","makeLoaderProps","useLoader","makeFocusProps","useFocus","makeThemeProps","provideTheme","useBackgroundColor","useTextColor","computed","ref","toRef","watch","animate","convertToUnit","EventProp","genericComponent","getUid","isOn","nullifyTransforms","pick","propsFactory","standardEasing","useRender","allowedVariants","makeVFieldProps","appendInnerIcon","bgColor","String","clearable","Boolean","clearIcon","type","default","active","color","dirty","disabled","error","label","persistentClear","prependInnerIcon","reverse","singleLine","variant","validator","v","includes","VField","name","inheritAttrs","props","id","emits","focused","val","setup","attrs","emit","slots","themeClasses","loaderClasses","focusClasses","isFocused","focus","blur","InputIcon","isActive","hasLabel","uid","messagesId","value","labelRef","floatingLabelRef","controlRef","backgroundColorClasses","backgroundColorStyles","textColorClasses","textColorStyles","undefined","el","$el","targetEl","requestAnimationFrame","rect","targetRect","getBoundingClientRect","x","y","height","targetWidth","width","Math","abs","maxWidth","style","getComputedStyle","targetStyle","duration","parseFloat","transitionDuration","scale","getPropertyValue","visibility","transform","easing","direction","finished","then","removeProperty","flush","slotProps","onClick","e","target","document","activeElement","preventDefault","isOutlined","hasPrepend","hasClear","clear","hasAppend","for","loading","loader","class","filterFieldProps","keys","Object","filter","k"],"sources":["../../../src/components/VField/VField.tsx"],"sourcesContent":["// Styles\nimport './VField.sass'\n\n// Components\nimport { VExpandXTransition } from '@/components/transitions'\nimport { useInputIcon } from '@/components/VInput/InputIcon'\nimport { VFieldLabel } from './VFieldLabel'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { LoaderSlot, makeLoaderProps, useLoader } from '@/composables/loader'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, toRef, watch } from 'vue'\nimport {\n animate,\n convertToUnit,\n EventProp,\n genericComponent,\n getUid,\n isOn,\n nullifyTransforms,\n pick,\n propsFactory,\n standardEasing,\n useRender,\n} from '@/util'\n\n// Types\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { MakeSlots, SlotsToProps } from '@/util'\nimport type { PropType, Ref } from 'vue'\nimport type { VInputSlot } from '@/components/VInput/VInput'\n\nconst allowedVariants = ['underlined', 'outlined', 'filled', 'solo', 'plain'] as const\ntype Variant = typeof allowedVariants[number]\n\nexport interface DefaultInputSlot {\n isActive: Ref<boolean>\n isFocused: Ref<boolean>\n controlRef: Ref<HTMLElement | undefined>\n focus: () => void\n blur: () => void\n}\n\nexport interface VFieldSlot extends DefaultInputSlot {\n props: Record<string, unknown>\n}\n\nexport const makeVFieldProps = propsFactory({\n appendInnerIcon: IconValue,\n bgColor: String,\n clearable: Boolean,\n clearIcon: {\n type: IconValue,\n default: '$clear',\n },\n active: Boolean,\n color: String,\n dirty: Boolean,\n disabled: Boolean,\n error: Boolean,\n label: String,\n persistentClear: Boolean,\n prependInnerIcon: IconValue,\n reverse: Boolean,\n singleLine: Boolean,\n variant: {\n type: String as PropType<Variant>,\n default: 'filled',\n validator: (v: any) => allowedVariants.includes(v),\n },\n\n 'onClick:clear': EventProp,\n 'onClick:appendInner': EventProp,\n 'onClick:prependInner': EventProp,\n\n ...makeThemeProps(),\n ...makeLoaderProps(),\n}, 'v-field')\n\nexport type VFieldSlots = MakeSlots<{\n clear: []\n 'prepend-inner': [DefaultInputSlot & VInputSlot]\n 'append-inner': [DefaultInputSlot & VInputSlot]\n label: [DefaultInputSlot & VInputSlot]\n loader: [LoaderSlotProps]\n default: [VFieldSlot]\n}>\n\nexport const VField = genericComponent<new <T>() => {\n $props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n } & SlotsToProps<VFieldSlots>\n}>()({\n name: 'VField',\n\n inheritAttrs: false,\n\n props: {\n id: String,\n\n ...makeFocusProps(),\n ...makeVFieldProps(),\n },\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { themeClasses } = provideTheme(props)\n const { loaderClasses } = useLoader(props)\n const { focusClasses, isFocused, focus, blur } = useFocus(props)\n const { InputIcon } = useInputIcon(props)\n\n const isActive = computed(() => props.dirty || props.active)\n const hasLabel = computed(() => !props.singleLine && !!(props.label || slots.label))\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const messagesId = computed(() => `${id.value}-messages`)\n\n const labelRef = ref<VFieldLabel>()\n const floatingLabelRef = ref<VFieldLabel>()\n const controlRef = ref<HTMLElement>()\n\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n isActive.value &&\n isFocused.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n\n watch(isActive, val => {\n if (hasLabel.value) {\n const el: HTMLElement = labelRef.value!.$el\n const targetEl: HTMLElement = floatingLabelRef.value!.$el\n\n requestAnimationFrame(() => {\n const rect = nullifyTransforms(el)\n const targetRect = targetEl.getBoundingClientRect()\n\n const x = targetRect.x - rect.x\n const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2)\n\n const targetWidth = targetRect.width / 0.75\n const width = Math.abs(targetWidth - rect.width) > 1\n ? { maxWidth: convertToUnit(targetWidth) }\n : undefined\n\n const style = getComputedStyle(el)\n const targetStyle = getComputedStyle(targetEl)\n const duration = parseFloat(style.transitionDuration) * 1000 || 150\n const scale = parseFloat(targetStyle.getPropertyValue('--v-field-label-scale'))\n const color = targetStyle.getPropertyValue('color')\n\n el.style.visibility = 'visible'\n targetEl.style.visibility = 'hidden'\n\n animate(el, {\n transform: `translate(${x}px, ${y}px) scale(${scale})`,\n color,\n ...width,\n }, {\n duration,\n easing: standardEasing,\n direction: val ? 'normal' : 'reverse',\n }).finished.then(() => {\n el.style.removeProperty('visibility')\n targetEl.style.removeProperty('visibility')\n })\n })\n }\n }, { flush: 'post' })\n\n const slotProps = computed<DefaultInputSlot>(() => ({\n isActive,\n isFocused,\n controlRef,\n blur,\n focus,\n }))\n\n function onClick (e: MouseEvent) {\n if (e.target !== document.activeElement) {\n e.preventDefault()\n }\n }\n\n useRender(() => {\n const isOutlined = props.variant === 'outlined'\n const hasPrepend = (slots['prepend-inner'] || props.prependInnerIcon)\n const hasClear = !!(props.clearable || slots.clear)\n const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <div\n class={[\n 'v-field',\n {\n 'v-field--active': isActive.value,\n 'v-field--appended': hasAppend,\n 'v-field--disabled': props.disabled,\n 'v-field--dirty': props.dirty,\n 'v-field--error': props.error,\n 'v-field--has-background': !!props.bgColor,\n 'v-field--persistent-clear': props.persistentClear,\n 'v-field--prepended': hasPrepend,\n 'v-field--reverse': props.reverse,\n 'v-field--single-line': props.singleLine,\n 'v-field--no-label': !label,\n [`v-field--variant-${props.variant}`]: true,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n focusClasses.value,\n loaderClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n textColorStyles.value,\n ]}\n onClick={ onClick }\n { ...attrs }\n >\n <div class=\"v-field__overlay\" />\n\n <LoaderSlot\n name=\"v-field\"\n active={ !!props.loading }\n color={ props.error ? 'error' : props.color }\n v-slots={{ default: slots.loader }}\n />\n\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-field__prepend-inner\">\n { props.prependInnerIcon && (\n <InputIcon key=\"prepend-icon\" name=\"prependInner\" />\n )}\n\n { slots['prepend-inner']?.(slotProps.value) }\n </div>\n )}\n\n <div class=\"v-field__field\" data-no-activator=\"\">\n {['solo', 'filled'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel\n key=\"floating-label\"\n ref={ floatingLabelRef }\n class={[textColorClasses.value]}\n floating\n for={ id.value }\n >\n { label }\n </VFieldLabel>\n )}\n\n <VFieldLabel ref={ labelRef } for={ id.value }>\n { label }\n </VFieldLabel>\n\n { slots.default?.({\n ...slotProps.value,\n props: {\n id: id.value,\n class: 'v-field__input',\n 'aria-describedby': messagesId.value,\n },\n focus,\n blur,\n } as VFieldSlot)}\n </div>\n\n { hasClear && (\n <VExpandXTransition key=\"clear\">\n <div\n class=\"v-field__clearable\"\n v-show={ props.dirty }\n >\n { slots.clear\n ? slots.clear()\n : <InputIcon name=\"clear\" />\n }\n </div>\n </VExpandXTransition>\n )}\n\n { hasAppend && (\n <div key=\"append\" class=\"v-field__append-inner\">\n { slots['append-inner']?.(slotProps.value) }\n\n { props.appendInnerIcon && (\n <InputIcon key=\"append-icon\" name=\"appendInner\" />\n )}\n </div>\n )}\n\n <div\n class={[\n 'v-field__outline',\n textColorClasses.value,\n ]}\n >\n { isOutlined && (\n <>\n <div class=\"v-field__outline__start\" />\n\n { hasLabel.value && (\n <div class=\"v-field__outline__notch\">\n <VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>\n { label }\n </VFieldLabel>\n </div>\n )}\n\n <div class=\"v-field__outline__end\" />\n </>\n )}\n\n {['plain', 'underlined'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>\n { label }\n </VFieldLabel>\n )}\n </div>\n </div>\n )\n })\n\n return {\n controlRef,\n }\n },\n})\n\nexport type VField = InstanceType<typeof VField>\n\n// TODO: this is kinda slow, might be better to implicitly inherit props instead\nexport function filterFieldProps (attrs: Record<string, unknown>) {\n const keys = Object.keys(VField.props).filter(k => !isOn(k))\n return pick(attrs, keys)\n}\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,YAAY;AAAA,SACZC,WAAW,6BAEpB;AAAA,SACSC,SAAS;AAAA,SACTC,UAAU,EAAEC,eAAe,EAAEC,SAAS;AAAA,SACtCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,cAAc,EAAEC,YAAY;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY,uCAEzC;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAE/CC,OAAO,EACPC,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,IAAI,EACJC,YAAY,EACZC,cAAc,EACdC,SAAS,gCAGX;AAMA,MAAMC,eAAe,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU;AAetF,OAAO,MAAMC,eAAe,GAAGJ,YAAY,CAAC;EAC1CK,eAAe,EAAE3B,SAAS;EAC1B4B,OAAO,EAAEC,MAAM;EACfC,SAAS,EAAEC,OAAO;EAClBC,SAAS,EAAE;IACTC,IAAI,EAAEjC,SAAS;IACfkC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAEJ,OAAO;EACfK,KAAK,EAAEP,MAAM;EACbQ,KAAK,EAAEN,OA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,CAACG,KAAK;QAAA,OAC7CE,gBAAgB;QAAA;QAAA,OAAkBrB,EAAE,CAACmB;MAAK;QAAA,gBACzDhC,KAAK;MAAA,EAEV;IAIT,CAAC,CAAC;IAEF,OAAO;MACLmC;IACF,CAAC;EACH;AACF,CAAC,CAAC;AAIF;AACA,OAAO,SAASqD,gBAAgB,CAAEtE,KAA8B,EAAE;EAChE,MAAMuE,IAAI,GAAGC,MAAM,CAACD,IAAI,CAAChF,MAAM,CAACG,KAAK,CAAC,CAAC+E,MAAM,CAACC,CAAC,IAAI,CAACjH,IAAI,CAACiH,CAAC,CAAC,CAAC;EAC5D,OAAO/G,IAAI,CAACqC,KAAK,EAAEuE,IAAI,CAAC;AAC1B"}
|
|
1
|
+
{"version":3,"file":"VField.mjs","names":["VExpandXTransition","useInputIcon","VFieldLabel","IconValue","LoaderSlot","makeLoaderProps","useLoader","makeFocusProps","useFocus","makeThemeProps","provideTheme","useBackgroundColor","useTextColor","computed","ref","toRef","watch","animate","convertToUnit","EventProp","genericComponent","getUid","isOn","nullifyTransforms","pick","propsFactory","standardEasing","useRender","allowedVariants","makeVFieldProps","appendInnerIcon","bgColor","String","clearable","Boolean","clearIcon","type","default","active","color","dirty","disabled","error","label","persistentClear","prependInnerIcon","reverse","singleLine","variant","validator","v","includes","VField","name","inheritAttrs","props","id","emits","focused","val","setup","attrs","emit","slots","themeClasses","loaderClasses","focusClasses","isFocused","focus","blur","InputIcon","isActive","hasLabel","uid","messagesId","value","labelRef","floatingLabelRef","controlRef","backgroundColorClasses","backgroundColorStyles","textColorClasses","textColorStyles","undefined","el","$el","targetEl","requestAnimationFrame","rect","targetRect","getBoundingClientRect","x","y","height","targetWidth","width","Math","abs","maxWidth","style","getComputedStyle","targetStyle","duration","parseFloat","transitionDuration","scale","getPropertyValue","visibility","transform","easing","direction","finished","then","removeProperty","flush","slotProps","onClick","e","target","document","activeElement","preventDefault","isOutlined","hasPrepend","hasClear","clear","hasAppend","for","loading","loader","class","stopPropagation","filterFieldProps","keys","Object","filter","k"],"sources":["../../../src/components/VField/VField.tsx"],"sourcesContent":["// Styles\nimport './VField.sass'\n\n// Components\nimport { VExpandXTransition } from '@/components/transitions'\nimport { useInputIcon } from '@/components/VInput/InputIcon'\nimport { VFieldLabel } from './VFieldLabel'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { LoaderSlot, makeLoaderProps, useLoader } from '@/composables/loader'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, toRef, watch } from 'vue'\nimport {\n animate,\n convertToUnit,\n EventProp,\n genericComponent,\n getUid,\n isOn,\n nullifyTransforms,\n pick,\n propsFactory,\n standardEasing,\n useRender,\n} from '@/util'\n\n// Types\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { MakeSlots, SlotsToProps } from '@/util'\nimport type { PropType, Ref } from 'vue'\nimport type { VInputSlot } from '@/components/VInput/VInput'\n\nconst allowedVariants = ['underlined', 'outlined', 'filled', 'solo', 'plain'] as const\ntype Variant = typeof allowedVariants[number]\n\nexport interface DefaultInputSlot {\n isActive: Ref<boolean>\n isFocused: Ref<boolean>\n controlRef: Ref<HTMLElement | undefined>\n focus: () => void\n blur: () => void\n}\n\nexport interface VFieldSlot extends DefaultInputSlot {\n props: Record<string, unknown>\n}\n\nexport const makeVFieldProps = propsFactory({\n appendInnerIcon: IconValue,\n bgColor: String,\n clearable: Boolean,\n clearIcon: {\n type: IconValue,\n default: '$clear',\n },\n active: Boolean,\n color: String,\n dirty: Boolean,\n disabled: Boolean,\n error: Boolean,\n label: String,\n persistentClear: Boolean,\n prependInnerIcon: IconValue,\n reverse: Boolean,\n singleLine: Boolean,\n variant: {\n type: String as PropType<Variant>,\n default: 'filled',\n validator: (v: any) => allowedVariants.includes(v),\n },\n\n 'onClick:clear': EventProp,\n 'onClick:appendInner': EventProp,\n 'onClick:prependInner': EventProp,\n\n ...makeThemeProps(),\n ...makeLoaderProps(),\n}, 'v-field')\n\nexport type VFieldSlots = MakeSlots<{\n clear: []\n 'prepend-inner': [DefaultInputSlot & VInputSlot]\n 'append-inner': [DefaultInputSlot & VInputSlot]\n label: [DefaultInputSlot & VInputSlot]\n loader: [LoaderSlotProps]\n default: [VFieldSlot]\n}>\n\nexport const VField = genericComponent<new <T>() => {\n $props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n } & SlotsToProps<VFieldSlots>\n}>()({\n name: 'VField',\n\n inheritAttrs: false,\n\n props: {\n id: String,\n\n ...makeFocusProps(),\n ...makeVFieldProps(),\n },\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { themeClasses } = provideTheme(props)\n const { loaderClasses } = useLoader(props)\n const { focusClasses, isFocused, focus, blur } = useFocus(props)\n const { InputIcon } = useInputIcon(props)\n\n const isActive = computed(() => props.dirty || props.active)\n const hasLabel = computed(() => !props.singleLine && !!(props.label || slots.label))\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const messagesId = computed(() => `${id.value}-messages`)\n\n const labelRef = ref<VFieldLabel>()\n const floatingLabelRef = ref<VFieldLabel>()\n const controlRef = ref<HTMLElement>()\n\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n isActive.value &&\n isFocused.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n\n watch(isActive, val => {\n if (hasLabel.value) {\n const el: HTMLElement = labelRef.value!.$el\n const targetEl: HTMLElement = floatingLabelRef.value!.$el\n\n requestAnimationFrame(() => {\n const rect = nullifyTransforms(el)\n const targetRect = targetEl.getBoundingClientRect()\n\n const x = targetRect.x - rect.x\n const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2)\n\n const targetWidth = targetRect.width / 0.75\n const width = Math.abs(targetWidth - rect.width) > 1\n ? { maxWidth: convertToUnit(targetWidth) }\n : undefined\n\n const style = getComputedStyle(el)\n const targetStyle = getComputedStyle(targetEl)\n const duration = parseFloat(style.transitionDuration) * 1000 || 150\n const scale = parseFloat(targetStyle.getPropertyValue('--v-field-label-scale'))\n const color = targetStyle.getPropertyValue('color')\n\n el.style.visibility = 'visible'\n targetEl.style.visibility = 'hidden'\n\n animate(el, {\n transform: `translate(${x}px, ${y}px) scale(${scale})`,\n color,\n ...width,\n }, {\n duration,\n easing: standardEasing,\n direction: val ? 'normal' : 'reverse',\n }).finished.then(() => {\n el.style.removeProperty('visibility')\n targetEl.style.removeProperty('visibility')\n })\n })\n }\n }, { flush: 'post' })\n\n const slotProps = computed<DefaultInputSlot>(() => ({\n isActive,\n isFocused,\n controlRef,\n blur,\n focus,\n }))\n\n function onClick (e: MouseEvent) {\n if (e.target !== document.activeElement) {\n e.preventDefault()\n }\n }\n\n useRender(() => {\n const isOutlined = props.variant === 'outlined'\n const hasPrepend = (slots['prepend-inner'] || props.prependInnerIcon)\n const hasClear = !!(props.clearable || slots.clear)\n const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <div\n class={[\n 'v-field',\n {\n 'v-field--active': isActive.value,\n 'v-field--appended': hasAppend,\n 'v-field--disabled': props.disabled,\n 'v-field--dirty': props.dirty,\n 'v-field--error': props.error,\n 'v-field--has-background': !!props.bgColor,\n 'v-field--persistent-clear': props.persistentClear,\n 'v-field--prepended': hasPrepend,\n 'v-field--reverse': props.reverse,\n 'v-field--single-line': props.singleLine,\n 'v-field--no-label': !label,\n [`v-field--variant-${props.variant}`]: true,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n focusClasses.value,\n loaderClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n textColorStyles.value,\n ]}\n onClick={ onClick }\n { ...attrs }\n >\n <div class=\"v-field__overlay\" />\n\n <LoaderSlot\n name=\"v-field\"\n active={ !!props.loading }\n color={ props.error ? 'error' : props.color }\n v-slots={{ default: slots.loader }}\n />\n\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-field__prepend-inner\">\n { props.prependInnerIcon && (\n <InputIcon key=\"prepend-icon\" name=\"prependInner\" />\n )}\n\n { slots['prepend-inner']?.(slotProps.value) }\n </div>\n )}\n\n <div class=\"v-field__field\" data-no-activator=\"\">\n {['solo', 'filled'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel\n key=\"floating-label\"\n ref={ floatingLabelRef }\n class={[textColorClasses.value]}\n floating\n for={ id.value }\n >\n { label }\n </VFieldLabel>\n )}\n\n <VFieldLabel ref={ labelRef } for={ id.value }>\n { label }\n </VFieldLabel>\n\n { slots.default?.({\n ...slotProps.value,\n props: {\n id: id.value,\n class: 'v-field__input',\n 'aria-describedby': messagesId.value,\n },\n focus,\n blur,\n } as VFieldSlot)}\n </div>\n\n { hasClear && (\n <VExpandXTransition key=\"clear\">\n <div\n class=\"v-field__clearable\"\n v-show={ props.dirty }\n onMousedown={ (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }}\n >\n { slots.clear\n ? slots.clear()\n : <InputIcon name=\"clear\" />\n }\n </div>\n </VExpandXTransition>\n )}\n\n { hasAppend && (\n <div key=\"append\" class=\"v-field__append-inner\">\n { slots['append-inner']?.(slotProps.value) }\n\n { props.appendInnerIcon && (\n <InputIcon key=\"append-icon\" name=\"appendInner\" />\n )}\n </div>\n )}\n\n <div\n class={[\n 'v-field__outline',\n textColorClasses.value,\n ]}\n >\n { isOutlined && (\n <>\n <div class=\"v-field__outline__start\" />\n\n { hasLabel.value && (\n <div class=\"v-field__outline__notch\">\n <VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>\n { label }\n </VFieldLabel>\n </div>\n )}\n\n <div class=\"v-field__outline__end\" />\n </>\n )}\n\n {['plain', 'underlined'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>\n { label }\n </VFieldLabel>\n )}\n </div>\n </div>\n )\n })\n\n return {\n controlRef,\n }\n },\n})\n\nexport type VField = InstanceType<typeof VField>\n\n// TODO: this is kinda slow, might be better to implicitly inherit props instead\nexport function filterFieldProps (attrs: Record<string, unknown>) {\n const keys = Object.keys(VField.props).filter(k => !isOn(k))\n return pick(attrs, keys)\n}\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,YAAY;AAAA,SACZC,WAAW,6BAEpB;AAAA,SACSC,SAAS;AAAA,SACTC,UAAU,EAAEC,eAAe,EAAEC,SAAS;AAAA,SACtCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,cAAc,EAAEC,YAAY;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY,uCAEzC;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAE/CC,OAAO,EACPC,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,IAAI,EACJC,YAAY,EACZC,cAAc,EACdC,SAAS,gCAGX;AAMA,MAAMC,eAAe,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU;AAetF,OAAO,MAAMC,eAAe,GAAGJ,YAAY,CAAC;EAC1CK,eAAe,EAAE3B,SAAS;EAC1B4B,OAAO,EAAEC,MAAM;EACfC,SAAS,EAAEC,OAAO;EAClBC,SAAS,EAAE;IACTC,IAAI,EAAEjC,SAAS;IACfkC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAEJ,OAAO;EACfK,KAAK,EAAEP,MAAM;EACbQ,KAAK,EAAEN,OAAO;EACdO,QAAQ,EAAEP,OAAO;EACjBQ,KAAK,EAAER,OAAO;EACdS,KAAK,EAAEX,MAAM;EACbY,eAAe,EAAEV,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CAACG,KAAK;QAAA,OAC7CE,gBAAgB;QAAA;QAAA,OAAkBrB,EAAE,CAACmB;MAAK;QAAA,gBACzDhC,KAAK;MAAA,EAEV;IAIT,CAAC,CAAC;IAEF,OAAO;MACLmC;IACF,CAAC;EACH;AACF,CAAC,CAAC;AAIF;AACA,OAAO,SAASsD,gBAAgB,CAAEvE,KAA8B,EAAE;EAChE,MAAMwE,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACjF,MAAM,CAACG,KAAK,CAAC,CAACgF,MAAM,CAACC,CAAC,IAAI,CAAClH,IAAI,CAACkH,CAAC,CAAC,CAAC;EAC5D,OAAOhH,IAAI,CAACqC,KAAK,EAAEwE,IAAI,CAAC;AAC1B"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import "./VGrid.css";
|
|
3
3
|
|
|
4
4
|
// Composables
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { breakpoints } from "../../composables/display.mjs";
|
|
6
|
+
import { makeTagProps } from "../../composables/tag.mjs"; // Utilities
|
|
7
7
|
import { capitalize, computed, h } from 'vue';
|
|
8
8
|
import { genericComponent } from "../../util/index.mjs"; // Types
|
|
9
9
|
const breakpointProps = (() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VCol.mjs","names":["
|
|
1
|
+
{"version":3,"file":"VCol.mjs","names":["breakpoints","makeTagProps","capitalize","computed","h","genericComponent","breakpointProps","reduce","props","val","type","Boolean","String","Number","default","offsetProps","offsetKey","orderProps","orderKey","propMap","col","Object","keys","offset","order","breakpointClass","prop","className","undefined","breakpoint","replace","toLowerCase","ALIGN_SELF_VALUES","VCol","name","cols","alignSelf","validator","str","includes","setup","slots","classes","classList","forEach","value","push","hasColClasses","some","startsWith","tag","class"],"sources":["../../../src/components/VGrid/VCol.ts"],"sourcesContent":["// Styles\nimport './VGrid.sass'\n\n// Composables\nimport { breakpoints } from '@/composables/display'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { capitalize, computed, h } from 'vue'\nimport { genericComponent } from '@/util'\n\n// Types\nimport type { Breakpoint } from '@/composables/display'\nimport type { Prop, PropType } from 'vue'\n\ntype BreakpointOffset = `offset${Capitalize<Breakpoint>}`\ntype BreakpointOrder = `order${Capitalize<Breakpoint>}`\n\nconst breakpointProps = (() => {\n return breakpoints.reduce((props, val) => {\n props[val] = {\n type: [Boolean, String, Number],\n default: false,\n }\n return props\n }, {} as Record<Breakpoint, Prop<boolean | string | number, false>>)\n})()\n\nconst offsetProps = (() => {\n return breakpoints.reduce((props, val) => {\n const offsetKey = ('offset' + capitalize(val)) as BreakpointOffset\n props[offsetKey] = {\n type: [String, Number],\n default: null,\n }\n return props\n }, {} as Record<BreakpointOffset, Prop<string | number, null>>)\n})()\n\nconst orderProps = (() => {\n return breakpoints.reduce((props, val) => {\n const orderKey = ('order' + capitalize(val)) as BreakpointOrder\n props[orderKey] = {\n type: [String, Number],\n default: null,\n }\n return props\n }, {} as Record<BreakpointOrder, Prop<string | number, null>>)\n})()\n\nconst propMap = {\n col: Object.keys(breakpointProps),\n offset: Object.keys(offsetProps),\n order: Object.keys(orderProps),\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: boolean | string | number) {\n let className: string = type\n if (val == null || val === false) {\n return undefined\n }\n if (prop) {\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n if (type === 'col') {\n className = 'v-' + className\n }\n // Handling the boolean style prop when accepting [Boolean, String, Number]\n // means Vue will not convert <v-col sm></v-col> to sm: true for us.\n // Since the default is false, an empty string indicates the prop's presence.\n if (type === 'col' && (val === '' || val === true)) {\n // .v-col-md\n return className.toLowerCase()\n }\n // .order-md-6\n className += `-${val}`\n return className.toLowerCase()\n}\n\nconst ALIGN_SELF_VALUES = ['auto', 'start', 'end', 'center', 'baseline', 'stretch'] as const\n\nexport const VCol = genericComponent()({\n name: 'VCol',\n\n props: {\n cols: {\n type: [Boolean, String, Number],\n default: false,\n },\n ...breakpointProps,\n offset: {\n type: [String, Number],\n default: null,\n },\n ...offsetProps,\n order: {\n type: [String, Number],\n default: null,\n },\n ...orderProps,\n alignSelf: {\n type: String as PropType<typeof ALIGN_SELF_VALUES[number]>,\n default: null,\n validator: (str: any) => ALIGN_SELF_VALUES.includes(str),\n },\n\n ...makeTagProps(),\n },\n\n setup (props, { slots }) {\n const classes = computed(() => {\n const classList: any[] = []\n\n // Loop through `col`, `offset`, `order` breakpoint props\n let type: keyof typeof propMap\n for (type in propMap) {\n propMap[type].forEach(prop => {\n const value: string | number | boolean = (props as any)[prop]\n const className = breakpointClass(type, prop, value)\n if (className) classList!.push(className)\n })\n }\n\n const hasColClasses = classList.some(className => className.startsWith('v-col-'))\n\n classList.push({\n // Default to .v-col if no other col-{bp}-* classes generated nor `cols` specified.\n 'v-col': !hasColClasses || !props.cols,\n [`v-col-${props.cols}`]: props.cols,\n [`offset-${props.offset}`]: props.offset,\n [`order-${props.order}`]: props.order,\n [`align-self-${props.alignSelf}`]: props.alignSelf,\n })\n\n return classList\n })\n\n return () => h(props.tag, {\n class: classes.value,\n }, slots.default?.())\n },\n})\n\nexport type VCol = InstanceType<typeof VCol>\n"],"mappings":"AAAA;AACA;;AAEA;AAAA,SACSA,WAAW;AAAA,SACXC,YAAY,qCAErB;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,CAAC,QAAQ,KAAK;AAAA,SACpCC,gBAAgB,gCAEzB;AAOA,MAAMC,eAAe,GAAG,CAAC,MAAM;EAC7B,OAAON,WAAW,CAACO,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;IACxCD,KAAK,CAACC,GAAG,CAAC,GAAG;MACXC,IAAI,EAAE,CAACC,OAAO,EAAEC,MAAM,EAAEC,MAAM,CAAC;MAC/BC,OAAO,EAAE;IACX,CAAC;IACD,OAAON,KAAK;EACd,CAAC,EAAE,CAAC,CAAC,CAA+D;AACtE,CAAC,GAAG;AAEJ,MAAMO,WAAW,GAAG,CAAC,MAAM;EACzB,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display.mjs";
|
|
6
|
+
import { makeTagProps } from "../../composables/tag.mjs"; // Utilities
|
|
7
7
|
import { capitalize, computed, h } from 'vue';
|
|
8
8
|
import { genericComponent } from "../../util/index.mjs"; // Types
|
|
9
9
|
const ALIGNMENT = ['start', 'end', 'center'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VRow.mjs","names":["
|
|
1
|
+
{"version":3,"file":"VRow.mjs","names":["breakpoints","makeTagProps","capitalize","computed","h","genericComponent","ALIGNMENT","SPACE","makeRowProps","prefix","def","reduce","props","val","prefixKey","ALIGN_VALUES","alignValidator","str","includes","alignProps","type","String","default","validator","JUSTIFY_VALUES","justifyValidator","justifyProps","ALIGN_CONTENT_VALUES","alignContentValidator","alignContentProps","propMap","align","Object","keys","justify","alignContent","classMap","breakpointClass","prop","className","undefined","breakpoint","replace","toLowerCase","VRow","name","dense","Boolean","noGutters","setup","slots","classes","classList","forEach","value","push","tag","class"],"sources":["../../../src/components/VGrid/VRow.ts"],"sourcesContent":["// Styles\nimport './VGrid.sass'\n\n// Composables\nimport { breakpoints } from '@/composables/display'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { capitalize, computed, h } from 'vue'\nimport { genericComponent } from '@/util'\n\n// Types\nimport type { Breakpoint } from '@/composables/display'\nimport type { Prop, PropType } from 'vue'\n\nconst ALIGNMENT = ['start', 'end', 'center'] as const\n\ntype BreakpointAlign = `align${Capitalize<Breakpoint>}`\ntype BreakpointJustify = `justify${Capitalize<Breakpoint>}`\ntype BreakpointAlignContent = `alignContent${Capitalize<Breakpoint>}`\n\nconst SPACE = ['space-between', 'space-around', 'space-evenly'] as const\n\nfunction makeRowProps <\n Name extends BreakpointAlign | BreakpointJustify | BreakpointAlignContent,\n Type,\n> (prefix: string, def: () => Prop<Type, null>) {\n return breakpoints.reduce((props, val) => {\n const prefixKey = prefix + capitalize(val) as Name\n props[prefixKey] = def()\n return props\n }, {} as Record<Name, Prop<Type, null>>)\n}\n\nconst ALIGN_VALUES = [...ALIGNMENT, 'baseline', 'stretch'] as const\ntype AlignValue = typeof ALIGN_VALUES[number]\nconst alignValidator = (str: any) => ALIGN_VALUES.includes(str)\nconst alignProps = makeRowProps<BreakpointAlign, AlignValue>('align', () => ({\n type: String as PropType<AlignValue>,\n default: null,\n validator: alignValidator,\n}))\n\nconst JUSTIFY_VALUES = [...ALIGNMENT, ...SPACE] as const\ntype JustifyValue = typeof JUSTIFY_VALUES[number]\nconst justifyValidator = (str: any) => JUSTIFY_VALUES.includes(str)\nconst justifyProps = makeRowProps<BreakpointJustify, JustifyValue>('justify', () => ({\n type: String as PropType<JustifyValue>,\n default: null,\n validator: justifyValidator,\n}))\n\nconst ALIGN_CONTENT_VALUES = [...ALIGNMENT, ...SPACE, 'stretch'] as const\ntype AlignContentValue = typeof ALIGN_CONTENT_VALUES[number]\nconst alignContentValidator = (str: any) => ALIGN_CONTENT_VALUES.includes(str)\nconst alignContentProps = makeRowProps<BreakpointAlignContent, AlignContentValue>('alignContent', () => ({\n type: String as PropType<AlignContentValue>,\n default: null,\n validator: alignContentValidator,\n}))\n\nconst propMap = {\n align: Object.keys(alignProps),\n justify: Object.keys(justifyProps),\n alignContent: Object.keys(alignContentProps),\n}\n\nconst classMap = {\n align: 'align',\n justify: 'justify',\n alignContent: 'align-content',\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: string) {\n let className = classMap[type]\n if (val == null) {\n return undefined\n }\n if (prop) {\n // alignSm -> Sm\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n // .align-items-sm-center\n className += `-${val}`\n return className.toLowerCase()\n}\n\nexport const VRow = genericComponent()({\n name: 'VRow',\n\n props: {\n dense: Boolean,\n noGutters: Boolean,\n align: {\n type: String as PropType<typeof ALIGN_VALUES[number]>,\n default: null,\n validator: alignValidator,\n },\n ...alignProps,\n justify: {\n type: String as PropType<typeof ALIGN_CONTENT_VALUES[number]>,\n default: null,\n validator: justifyValidator,\n },\n ...justifyProps,\n alignContent: {\n type: String as PropType<typeof ALIGN_CONTENT_VALUES[number]>,\n default: null,\n validator: alignContentValidator,\n },\n\n ...alignContentProps,\n ...makeTagProps(),\n },\n\n setup (props, { slots }) {\n const classes = computed(() => {\n const classList: any[] = []\n\n // Loop through `align`, `justify`, `alignContent` breakpoint props\n let type: keyof typeof propMap\n for (type in propMap) {\n propMap[type].forEach(prop => {\n const value: string = (props as any)[prop]\n const className = breakpointClass(type, prop, value)\n if (className) classList!.push(className)\n })\n }\n\n classList.push({\n 'v-row--no-gutters': props.noGutters,\n 'v-row--dense': props.dense,\n [`align-${props.align}`]: props.align,\n [`justify-${props.justify}`]: props.justify,\n [`align-content-${props.alignContent}`]: props.alignContent,\n })\n\n return classList\n })\n\n return () => h(props.tag, {\n class: ['v-row', classes.value],\n }, slots.default?.())\n },\n})\n\nexport type VRow = InstanceType<typeof VRow>\n"],"mappings":"AAAA;AACA;;AAEA;AAAA,SACSA,WAAW;AAAA,SACXC,YAAY,qCAErB;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,CAAC,QAAQ,KAAK;AAAA,SACpCC,gBAAgB,gCAEzB;AAIA,MAAMC,SAAS,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAU;AAMrD,MAAMC,KAAK,GAAG,CAAC,eAAe,EAAE,cAAc,EAAE,cAAc,CAAU;AAExE,SAASC,YAAY,CAGlBC,MAAc,EAAEC,GAA2B,EAAE;EAC9C,OAAOV,WAAW,CAACW,MAAM,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;IACxC,MAAMC,SAAS,GAAGL,MAAM,GAAGP,UAAU,CAACW,GAAG,CAAS;IAClDD,KAAK,CAACE,SAAS,CAAC,GAAGJ,GAAG,EAAE;IACxB,OAAOE,KAAK;EACd,CAAC,EAAE,CAAC,CAAC,CAAmC;AAC1C;AAEA,MAAMG,YAAY,GAAG,CAAC,GAAGT,SAAS,EAAE,UAAU,EAAE,SAAS,CAAU;AAEnE,MAAM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I,CAAC;UAC1C,MAAMC,SAAS,GAAGF,eAAe,CAACjB,IAAI,EAAEkB,IAAI,EAAEgB,KAAK,CAAC;UACpD,IAAIf,SAAS,EAAEa,SAAS,CAAEG,IAAI,CAAChB,SAAS,CAAC;QAC3C,CAAC,CAAC;MACJ;MAEAa,SAAS,CAACG,IAAI,CAAC;QACb,mBAAmB,EAAE3C,KAAK,CAACoC,SAAS;QACpC,cAAc,EAAEpC,KAAK,CAACkC,KAAK;QAC3B,CAAE,SAAQlC,KAAK,CAACmB,KAAM,EAAC,GAAGnB,KAAK,CAACmB,KAAK;QACrC,CAAE,WAAUnB,KAAK,CAACsB,OAAQ,EAAC,GAAGtB,KAAK,CAACsB,OAAO;QAC3C,CAAE,iBAAgBtB,KAAK,CAACuB,YAAa,EAAC,GAAGvB,KAAK,CAACuB;MACjD,CAAC,CAAC;MAEF,OAAOiB,SAAS;IAClB,CAAC,CAAC;IAEF,OAAO,MAAMhD,CAAC,CAACQ,KAAK,CAAC4C,GAAG,EAAE;MACxBC,KAAK,EAAE,CAAC,OAAO,EAAEN,OAAO,CAACG,KAAK;IAChC,CAAC,EAAEJ,KAAK,CAAC5B,OAAO,IAAI,CAAC;EACvB;AACF,CAAC,CAAC"}
|
|
@@ -102,12 +102,14 @@ export const VTextField = genericComponent()({
|
|
|
102
102
|
}
|
|
103
103
|
function onInput(e) {
|
|
104
104
|
const el = e.target;
|
|
105
|
-
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
106
105
|
model.value = el.value;
|
|
107
|
-
|
|
108
|
-
el.selectionStart
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
if (['text', 'search', 'password', 'tel', 'url'].includes(props.type)) {
|
|
107
|
+
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
108
|
+
nextTick(() => {
|
|
109
|
+
el.selectionStart = caretPosition[0];
|
|
110
|
+
el.selectionEnd = caretPosition[1];
|
|
111
|
+
});
|
|
112
|
+
}
|
|
111
113
|
}
|
|
112
114
|
useRender(() => {
|
|
113
115
|
const hasCounter = !!(slots.counter || props.counter || props.counterValue);
|
|
@@ -166,6 +168,9 @@ export const VTextField = genericComponent()({
|
|
|
166
168
|
...slotProps
|
|
167
169
|
}
|
|
168
170
|
} = _ref3;
|
|
171
|
+
const placeholder = computed(() => {
|
|
172
|
+
return (props.persistentPlaceholder || isFocused.value) && !isDirty.value ? props.placeholder : '';
|
|
173
|
+
});
|
|
169
174
|
const inputNode = _withDirectives(_createVNode("input", _mergeProps({
|
|
170
175
|
"ref": inputRef,
|
|
171
176
|
"value": model.value,
|
|
@@ -174,7 +179,7 @@ export const VTextField = genericComponent()({
|
|
|
174
179
|
"readonly": isReadonly.value,
|
|
175
180
|
"disabled": isDisabled.value,
|
|
176
181
|
"name": props.name,
|
|
177
|
-
"placeholder":
|
|
182
|
+
"placeholder": placeholder.value,
|
|
178
183
|
"size": 1,
|
|
179
184
|
"type": props.type,
|
|
180
185
|
"onFocus": onFocus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VTextField.mjs","names":["filterFieldProps","makeVFieldProps","VField","filterInputProps","makeVInputProps","VInput","VCounter","Intersect","forwardRefs","useFocus","useProxiedModel","cloneVNode","computed","nextTick","ref","callEvent","filterInputAttrs","genericComponent","propsFactory","useRender","activeTypes","EventProp","Function","Array","makeVTextFieldProps","autofocus","Boolean","counter","Number","String","counterValue","hint","persistentHint","prefix","placeholder","persistentPlaceholder","persistentCounter","suffix","type","default","VTextField","name","directives","inheritAttrs","props","emits","e","focused","val","setup","attrs","emit","slots","model","isFocused","focus","blur","value","toString","length","max","maxlength","undefined","onIntersect","isIntersecting","entries","target","vInputRef","vFieldRef","inputRef","isActive","includes","messages","onFocus","document","activeElement","onControlMousedown","preventDefault","onControlClick","onClear","stopPropagation","onInput","el","caretPosition","selectionStart","selectionEnd","hasCounter","hasDetails","details","rootAttrs","inputAttrs","modelValue","_","inputProps","fieldProps","variant","id","isDisabled","isDirty","isReadonly","isValid","dirty","class","fieldClass","slotProps","inputNode","handler"],"sources":["../../../src/components/VTextField/VTextField.tsx"],"sourcesContent":["// Styles\nimport './VTextField.sass'\n\n// Components\nimport { filterFieldProps, makeVFieldProps, VField } from '@/components/VField/VField'\nimport { filterInputProps, makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VCounter } from '@/components/VCounter'\n\n// Directives\nimport Intersect from '@/directives/intersect'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { cloneVNode, computed, nextTick, ref } from 'vue'\nimport { callEvent, filterInputAttrs, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { MakeSlots } from '@/util'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\nconst activeTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month']\n\ntype EventProp<T = (...args: any[]) => any> = T | T[]\nconst EventProp = [Function, Array] as PropType<EventProp>\n\nexport const makeVTextFieldProps = propsFactory({\n autofocus: Boolean,\n counter: [Boolean, Number, String] as PropType<true | number | string>,\n counterValue: Function as PropType<(value: any) => number>,\n hint: String,\n persistentHint: Boolean,\n prefix: String,\n placeholder: String,\n persistentPlaceholder: Boolean,\n persistentCounter: Boolean,\n suffix: String,\n type: {\n type: String,\n default: 'text',\n },\n\n ...makeVInputProps(),\n ...makeVFieldProps(),\n}, 'v-text-field')\n\nexport const VTextField = genericComponent<Omit<VInputSlots & VFieldSlots, 'default'> & MakeSlots<{\n default: []\n}>>()({\n name: 'VTextField',\n\n directives: { Intersect },\n\n inheritAttrs: false,\n\n props: makeVTextFieldProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: string) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const counterValue = computed(() => {\n return typeof props.counterValue === 'function'\n ? props.counterValue(model.value)\n : (model.value ?? '').toString().length\n })\n const max = computed(() => {\n if (attrs.maxlength) return attrs.maxlength as unknown as undefined\n\n if (\n !props.counter ||\n (typeof props.counter !== 'number' &&\n typeof props.counter !== 'string')\n ) return undefined\n\n return props.counter\n })\n\n function onIntersect (\n isIntersecting: boolean,\n entries: IntersectionObserverEntry[]\n ) {\n if (!props.autofocus || !isIntersecting) return\n\n (entries[0].target as HTMLInputElement)?.focus?.()\n }\n\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VField>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n activeTypes.includes(props.type) ||\n props.persistentPlaceholder ||\n isFocused.value\n ))\n const messages = computed(() => {\n return props.messages.length\n ? props.messages\n : (isFocused.value || props.persistentHint) ? props.hint : ''\n })\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n\n if (e.target === inputRef.value) return\n\n onFocus()\n e.preventDefault()\n }\n function onControlClick (e: MouseEvent) {\n onFocus()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = null\n\n callEvent(props['onClick:clear'], e)\n })\n }\n function onInput (e: Event) {\n const el = e.target as HTMLInputElement\n const caretPosition = [el.selectionStart, el.selectionEnd]\n model.value = el.value\n nextTick(() => {\n el.selectionStart = caretPosition[0]\n el.selectionEnd = caretPosition[1]\n })\n }\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter || props.counterValue)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = filterInputProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-text-field',\n {\n 'v-text-field--prefixed': props.prefix,\n 'v-text-field--suffixed': props.suffix,\n 'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant),\n },\n ]}\n onClick:prepend={ props['onClick:prepend'] }\n onClick:append={ props['onClick:append'] }\n { ...rootAttrs }\n { ...inputProps }\n focused={ isFocused.value }\n messages={ messages.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n role=\"textbox\"\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value || props.dirty }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => {\n const inputNode = (\n <input\n ref={ inputRef }\n value={ model.value }\n onInput={ onInput }\n v-intersect={[{\n handler: onIntersect,\n }, null, ['once']]}\n autofocus={ props.autofocus }\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n name={ props.name }\n placeholder={ props.placeholder }\n size={ 1 }\n type={ props.type }\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n )\n\n return (\n <>\n { props.prefix && (\n <span class=\"v-text-field__prefix\">\n { props.prefix }\n </span>\n )}\n\n { slots.default ? (\n <div\n class={ fieldClass }\n data-no-activator=\"\"\n >\n { slots.default() }\n { inputNode }\n </div>\n ) : cloneVNode(inputNode, { class: fieldClass })}\n\n { props.suffix && (\n <span class=\"v-text-field__suffix\">\n { props.suffix }\n </span>\n )}\n </>\n )\n },\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ props.persistentCounter || isFocused.value }\n value={ counterValue.value }\n max={ max.value }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VTextField = InstanceType<typeof VTextField>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,QAAQ,iCAEjB;AAAA,OACOC,SAAS,8CAEhB;AAAA,SACSC,WAAW;AAAA,SACXC,QAAQ;AAAA,SACRC,eAAe,8CAExB;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAChDC,SAAS,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAE/E;AAMA,MAAMC,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC;AAGxF,MAAMC,SAAS,GAAG,CAACC,QAAQ,EAAEC,KAAK,CAAwB;AAE1D,OAAO,MAAMC,mBAAmB,GAAGN,YAAY,CAAC;EAC9CO,SAAS,EAAEC,OAAO;EAClBC,OAAO,EAAE,CAACD,OAAO,EAAEE,MAAM,EAAEC,MAAM,CAAqC;EACtEC,YAAY,EAAER,QAA4C;EAC1DS,IAAI,EAAEF,MAAM;EACZG,cAAc,EAAEN,OAAO;EACvBO,MAAM,EAAEJ,MAAM;EACdK,WAAW,EAAEL,MAAM;EACnBM,qBAAqB,EAAET,OAAO;EAC9BU,iBAAiB,EAAEV,OAAO;EAC1BW,MAAM,EAAER,MAAM;EACdS,IAAI,EAAE;IACJA,IAAI,EAAET,MAAM;IACZU,OAAO,EAAE;EACX,CAA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A,aAILrC,KAAK,CAACnB,SAAS;gBAAA,YAChB0E,UAAU,CAAC1C,KAAK;gBAAA,YAChBwC,UAAU,CAACxC,KAAK;gBAAA,QACpBb,KAAK,CAACH,IAAI;gBAAA,eACHG,KAAK,CAACV,WAAW;gBAAA,QACxB,CAAC;gBAAA,QACDU,KAAK,CAACN,IAAI;gBAAA,WACPmC,OAAO;gBAAA,UACRjB;cAAI,GACRgD,SAAS,EACTd,UAAU,4CAbD;gBACZgB,OAAO,EAAE3C;cACX,CAAC,EAAE,IAAI;gBAAA;cAAA,IAaV;cAED,sCAEMnB,KAAK,CAACX,MAAM;gBAAA,SACA;cAAsB,IAC9BW,KAAK,CAACX,MAAM,EAEjB,EAECmB,KAAK,CAACb,OAAO;gBAAA,SAEHgE,UAAU;gBAAA,qBACA;cAAE,IAElBnD,KAAK,CAACb,OAAO,EAAE,EACfkE,SAAS,KAEX9F,UAAU,CAAC8F,SAAS,EAAE;gBAAEH,KAAK,EAAEC;cAAW,CAAC,CAAC,EAE9C3D,KAAK,CAACP,MAAM;gBAAA,SACA;cAAsB,IAC9BO,KAAK,CAACP,MAAM,EAEjB;YAGP;UAAC;QAAA,CAGN;QACDmD,OAAO,EAAED,UAAU,GAAGiB,SAAS,mCAEzBpD,KAAK,CAACoC,OAAO,GAAGgB,SAAS,CAAC,EAE1BlB,UAAU;UAAA,UAKG1C,KAAK,CAACR,iBAAiB,IAAIkB,SAAS,CAACG,KAAK;UAAA,SAC3C3B,YAAY,CAAC2B,KAAK;UAAA,OACpBG,GAAG,CAACH;QAAK,GACGL,KAAK,CAACzB,OAAO,GAGpC,EAEJ,GAAGmC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOtD,WAAW,CAAC,CAAC,CAAC,EAAE2D,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VTextField.mjs","names":["filterFieldProps","makeVFieldProps","VField","filterInputProps","makeVInputProps","VInput","VCounter","Intersect","forwardRefs","useFocus","useProxiedModel","cloneVNode","computed","nextTick","ref","callEvent","filterInputAttrs","genericComponent","propsFactory","useRender","activeTypes","EventProp","Function","Array","makeVTextFieldProps","autofocus","Boolean","counter","Number","String","counterValue","hint","persistentHint","prefix","placeholder","persistentPlaceholder","persistentCounter","suffix","type","default","VTextField","name","directives","inheritAttrs","props","emits","e","focused","val","setup","attrs","emit","slots","model","isFocused","focus","blur","value","toString","length","max","maxlength","undefined","onIntersect","isIntersecting","entries","target","vInputRef","vFieldRef","inputRef","isActive","includes","messages","onFocus","document","activeElement","onControlMousedown","preventDefault","onControlClick","onClear","stopPropagation","onInput","el","caretPosition","selectionStart","selectionEnd","hasCounter","hasDetails","details","rootAttrs","inputAttrs","modelValue","_","inputProps","fieldProps","variant","id","isDisabled","isDirty","isReadonly","isValid","dirty","class","fieldClass","slotProps","inputNode","handler"],"sources":["../../../src/components/VTextField/VTextField.tsx"],"sourcesContent":["// Styles\nimport './VTextField.sass'\n\n// Components\nimport { filterFieldProps, makeVFieldProps, VField } from '@/components/VField/VField'\nimport { filterInputProps, makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VCounter } from '@/components/VCounter'\n\n// Directives\nimport Intersect from '@/directives/intersect'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { cloneVNode, computed, nextTick, ref } from 'vue'\nimport { callEvent, filterInputAttrs, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { MakeSlots } from '@/util'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\nconst activeTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month']\n\ntype EventProp<T = (...args: any[]) => any> = T | T[]\nconst EventProp = [Function, Array] as PropType<EventProp>\n\nexport const makeVTextFieldProps = propsFactory({\n autofocus: Boolean,\n counter: [Boolean, Number, String] as PropType<true | number | string>,\n counterValue: Function as PropType<(value: any) => number>,\n hint: String,\n persistentHint: Boolean,\n prefix: String,\n placeholder: String,\n persistentPlaceholder: Boolean,\n persistentCounter: Boolean,\n suffix: String,\n type: {\n type: String,\n default: 'text',\n },\n\n ...makeVInputProps(),\n ...makeVFieldProps(),\n}, 'v-text-field')\n\nexport const VTextField = genericComponent<Omit<VInputSlots & VFieldSlots, 'default'> & MakeSlots<{\n default: []\n}>>()({\n name: 'VTextField',\n\n directives: { Intersect },\n\n inheritAttrs: false,\n\n props: makeVTextFieldProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: string) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const counterValue = computed(() => {\n return typeof props.counterValue === 'function'\n ? props.counterValue(model.value)\n : (model.value ?? '').toString().length\n })\n const max = computed(() => {\n if (attrs.maxlength) return attrs.maxlength as unknown as undefined\n\n if (\n !props.counter ||\n (typeof props.counter !== 'number' &&\n typeof props.counter !== 'string')\n ) return undefined\n\n return props.counter\n })\n\n function onIntersect (\n isIntersecting: boolean,\n entries: IntersectionObserverEntry[]\n ) {\n if (!props.autofocus || !isIntersecting) return\n\n (entries[0].target as HTMLInputElement)?.focus?.()\n }\n\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VField>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n activeTypes.includes(props.type) ||\n props.persistentPlaceholder ||\n isFocused.value\n ))\n const messages = computed(() => {\n return props.messages.length\n ? props.messages\n : (isFocused.value || props.persistentHint) ? props.hint : ''\n })\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n\n if (e.target === inputRef.value) return\n\n onFocus()\n e.preventDefault()\n }\n function onControlClick (e: MouseEvent) {\n onFocus()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = null\n\n callEvent(props['onClick:clear'], e)\n })\n }\n function onInput (e: Event) {\n const el = e.target as HTMLInputElement\n model.value = el.value\n if (['text', 'search', 'password', 'tel', 'url'].includes(props.type)) {\n const caretPosition = [el.selectionStart, el.selectionEnd]\n nextTick(() => {\n el.selectionStart = caretPosition[0]\n el.selectionEnd = caretPosition[1]\n })\n }\n }\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter || props.counterValue)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = filterInputProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-text-field',\n {\n 'v-text-field--prefixed': props.prefix,\n 'v-text-field--suffixed': props.suffix,\n 'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant),\n },\n ]}\n onClick:prepend={ props['onClick:prepend'] }\n onClick:append={ props['onClick:append'] }\n { ...rootAttrs }\n { ...inputProps }\n focused={ isFocused.value }\n messages={ messages.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n role=\"textbox\"\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value || props.dirty }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => {\n const placeholder = computed(() => {\n return ((props.persistentPlaceholder || isFocused.value) && !isDirty.value) ? props.placeholder : ''\n })\n\n const inputNode = (\n <input\n ref={ inputRef }\n value={ model.value }\n onInput={ onInput }\n v-intersect={[{\n handler: onIntersect,\n }, null, ['once']]}\n autofocus={ props.autofocus }\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n name={ props.name }\n placeholder={ placeholder.value }\n size={ 1 }\n type={ props.type }\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n )\n\n return (\n <>\n { props.prefix && (\n <span class=\"v-text-field__prefix\">\n { props.prefix }\n </span>\n )}\n\n { slots.default ? (\n <div\n class={ fieldClass }\n data-no-activator=\"\"\n >\n { slots.default() }\n { inputNode }\n </div>\n ) : cloneVNode(inputNode, { class: fieldClass })}\n\n { props.suffix && (\n <span class=\"v-text-field__suffix\">\n { props.suffix }\n </span>\n )}\n </>\n )\n },\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ props.persistentCounter || isFocused.value }\n value={ counterValue.value }\n max={ max.value }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VTextField = InstanceType<typeof VTextField>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,QAAQ,iCAEjB;AAAA,OACOC,SAAS,8CAEhB;AAAA,SACSC,WAAW;AAAA,SACXC,QAAQ;AAAA,SACRC,eAAe,8CAExB;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAChDC,SAAS,EAAEC,gBAAgB,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AAA,UACRjB;cAAI,GACRgD,SAAS,EACTd,UAAU,4CAbD;gBACZgB,OAAO,EAAE3C;cACX,CAAC,EAAE,IAAI;gBAAA;cAAA,IAaV;cAED,sCAEMnB,KAAK,CAACX,MAAM;gBAAA,SACA;cAAsB,IAC9BW,KAAK,CAACX,MAAM,EAEjB,EAECmB,KAAK,CAACb,OAAO;gBAAA,SAEHgE,UAAU;gBAAA,qBACA;cAAE,IAElBnD,KAAK,CAACb,OAAO,EAAE,EACfkE,SAAS,KAEX9F,UAAU,CAAC8F,SAAS,EAAE;gBAAEH,KAAK,EAAEC;cAAW,CAAC,CAAC,EAE9C3D,KAAK,CAACP,MAAM;gBAAA,SACA;cAAsB,IAC9BO,KAAK,CAACP,MAAM,EAEjB;YAGP;UAAC;QAAA,CAGN;QACDmD,OAAO,EAAED,UAAU,GAAGiB,SAAS,mCAEzBpD,KAAK,CAACoC,OAAO,GAAGgB,SAAS,CAAC,EAE1BlB,UAAU;UAAA,UAKG1C,KAAK,CAACR,iBAAiB,IAAIkB,SAAS,CAACG,KAAK;UAAA,SAC3C3B,YAAY,CAAC2B,KAAK;UAAA,OACpBG,GAAG,CAACH;QAAK,GACGL,KAAK,CAACzB,OAAO,GAGpC,EAEJ,GAAGmC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOtD,WAAW,CAAC,CAAC,CAAC,EAAE2D,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC"}
|
|
@@ -11933,7 +11933,6 @@ declare const VCheckbox: {
|
|
|
11933
11933
|
$: vue.ComponentInternalInstance;
|
|
11934
11934
|
$data: {};
|
|
11935
11935
|
$props: Partial<{
|
|
11936
|
-
inline: boolean;
|
|
11937
11936
|
error: boolean;
|
|
11938
11937
|
direction: "horizontal" | "vertical";
|
|
11939
11938
|
disabled: boolean;
|
|
@@ -11952,7 +11951,6 @@ declare const VCheckbox: {
|
|
|
11952
11951
|
valueComparator: typeof deepEqual;
|
|
11953
11952
|
indeterminateIcon: IconValue;
|
|
11954
11953
|
}> & Omit<{
|
|
11955
|
-
inline: boolean;
|
|
11956
11954
|
error: boolean;
|
|
11957
11955
|
direction: "horizontal" | "vertical";
|
|
11958
11956
|
disabled: boolean;
|
|
@@ -12034,7 +12032,7 @@ declare const VCheckbox: {
|
|
|
12034
12032
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
12035
12033
|
} & {
|
|
12036
12034
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
|
12037
|
-
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "
|
|
12035
|
+
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "error" | "direction" | "disabled" | "multiple" | "readonly" | "indeterminate" | "messages" | "density" | "ripple" | "focused" | "errorMessages" | "maxErrors" | "rules" | "falseIcon" | "trueIcon" | "valueComparator" | "indeterminateIcon">;
|
|
12038
12036
|
$attrs: {
|
|
12039
12037
|
[x: string]: unknown;
|
|
12040
12038
|
};
|
|
@@ -12049,7 +12047,6 @@ declare const VCheckbox: {
|
|
|
12049
12047
|
$emit: (event: "update:focused", focused: boolean) => void;
|
|
12050
12048
|
$el: any;
|
|
12051
12049
|
$options: vue.ComponentOptionsBase<{
|
|
12052
|
-
inline: boolean;
|
|
12053
12050
|
error: boolean;
|
|
12054
12051
|
direction: "horizontal" | "vertical";
|
|
12055
12052
|
disabled: boolean;
|
|
@@ -12134,7 +12131,6 @@ declare const VCheckbox: {
|
|
|
12134
12131
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12135
12132
|
'update:focused': (focused: boolean) => boolean;
|
|
12136
12133
|
}, string, {
|
|
12137
|
-
inline: boolean;
|
|
12138
12134
|
error: boolean;
|
|
12139
12135
|
direction: "horizontal" | "vertical";
|
|
12140
12136
|
disabled: boolean;
|
|
@@ -12173,7 +12169,6 @@ declare const VCheckbox: {
|
|
|
12173
12169
|
$nextTick: typeof vue.nextTick;
|
|
12174
12170
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: vue.WatchOptions<boolean> | undefined): vue.WatchStopHandle;
|
|
12175
12171
|
} & {
|
|
12176
|
-
inline: boolean;
|
|
12177
12172
|
error: boolean;
|
|
12178
12173
|
direction: "horizontal" | "vertical";
|
|
12179
12174
|
disabled: boolean;
|
|
@@ -12260,7 +12255,6 @@ declare const VCheckbox: {
|
|
|
12260
12255
|
__isTeleport?: undefined;
|
|
12261
12256
|
__isSuspense?: undefined;
|
|
12262
12257
|
} & vue.ComponentOptionsBase<{
|
|
12263
|
-
inline: boolean;
|
|
12264
12258
|
error: boolean;
|
|
12265
12259
|
direction: "horizontal" | "vertical";
|
|
12266
12260
|
disabled: boolean;
|
|
@@ -12345,7 +12339,6 @@ declare const VCheckbox: {
|
|
|
12345
12339
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12346
12340
|
'update:focused': (focused: boolean) => boolean;
|
|
12347
12341
|
}, string, {
|
|
12348
|
-
inline: boolean;
|
|
12349
12342
|
error: boolean;
|
|
12350
12343
|
direction: "horizontal" | "vertical";
|
|
12351
12344
|
disabled: boolean;
|
|
@@ -12364,17 +12357,31 @@ declare const VCheckbox: {
|
|
|
12364
12357
|
valueComparator: typeof deepEqual;
|
|
12365
12358
|
indeterminateIcon: IconValue;
|
|
12366
12359
|
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
|
|
12360
|
+
type: StringConstructor;
|
|
12361
|
+
error: BooleanConstructor;
|
|
12362
|
+
id: StringConstructor;
|
|
12363
|
+
name: StringConstructor;
|
|
12364
|
+
color: StringConstructor;
|
|
12365
|
+
value: null;
|
|
12366
|
+
label: StringConstructor;
|
|
12367
|
+
disabled: BooleanConstructor;
|
|
12368
|
+
multiple: {
|
|
12369
|
+
type: vue.PropType<boolean | null>;
|
|
12370
|
+
default: null;
|
|
12371
|
+
};
|
|
12372
|
+
readonly: BooleanConstructor;
|
|
12373
|
+
indeterminate: BooleanConstructor;
|
|
12374
|
+
theme: StringConstructor;
|
|
12367
12375
|
density: {
|
|
12368
12376
|
type: vue.PropType<Density>;
|
|
12369
12377
|
default: string;
|
|
12370
12378
|
validator: (v: any) => boolean;
|
|
12371
12379
|
};
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
inline: BooleanConstructor;
|
|
12380
|
+
modelValue: null;
|
|
12381
|
+
ripple: {
|
|
12382
|
+
type: BooleanConstructor;
|
|
12383
|
+
default: boolean;
|
|
12384
|
+
};
|
|
12378
12385
|
falseIcon: {
|
|
12379
12386
|
type: vue.PropType<NonNullable<IconValue>>;
|
|
12380
12387
|
default: NonNullable<IconValue>;
|
|
@@ -12383,27 +12390,12 @@ declare const VCheckbox: {
|
|
|
12383
12390
|
type: vue.PropType<NonNullable<IconValue>>;
|
|
12384
12391
|
default: NonNullable<IconValue>;
|
|
12385
12392
|
};
|
|
12386
|
-
ripple: {
|
|
12387
|
-
type: BooleanConstructor;
|
|
12388
|
-
default: boolean;
|
|
12389
|
-
};
|
|
12390
|
-
multiple: {
|
|
12391
|
-
type: vue.PropType<boolean | null>;
|
|
12392
|
-
default: null;
|
|
12393
|
-
};
|
|
12394
|
-
name: StringConstructor;
|
|
12395
|
-
readonly: BooleanConstructor;
|
|
12396
|
-
modelValue: null;
|
|
12397
|
-
type: StringConstructor;
|
|
12398
12393
|
valueComparator: {
|
|
12399
12394
|
type: vue.PropType<typeof deepEqual>;
|
|
12400
12395
|
default: typeof deepEqual;
|
|
12401
12396
|
};
|
|
12402
|
-
label: StringConstructor;
|
|
12403
12397
|
trueValue: null;
|
|
12404
12398
|
falseValue: null;
|
|
12405
|
-
value: null;
|
|
12406
|
-
indeterminate: BooleanConstructor;
|
|
12407
12399
|
indeterminateIcon: {
|
|
12408
12400
|
type: vue.PropType<IconValue>;
|
|
12409
12401
|
default: string;
|
|
@@ -12438,17 +12430,31 @@ declare const VCheckbox: {
|
|
|
12438
12430
|
'onClick:prepend': vue.PropType<EventProp<(...args: any[]) => any>>;
|
|
12439
12431
|
'onClick:append': vue.PropType<EventProp<(...args: any[]) => any>>;
|
|
12440
12432
|
}, vue.ExtractPropTypes<{
|
|
12433
|
+
type: StringConstructor;
|
|
12434
|
+
error: BooleanConstructor;
|
|
12435
|
+
id: StringConstructor;
|
|
12436
|
+
name: StringConstructor;
|
|
12437
|
+
color: StringConstructor;
|
|
12438
|
+
value: null;
|
|
12439
|
+
label: StringConstructor;
|
|
12440
|
+
disabled: BooleanConstructor;
|
|
12441
|
+
multiple: {
|
|
12442
|
+
type: vue.PropType<boolean | null>;
|
|
12443
|
+
default: null;
|
|
12444
|
+
};
|
|
12445
|
+
readonly: BooleanConstructor;
|
|
12446
|
+
indeterminate: BooleanConstructor;
|
|
12447
|
+
theme: StringConstructor;
|
|
12441
12448
|
density: {
|
|
12442
12449
|
type: vue.PropType<Density>;
|
|
12443
12450
|
default: string;
|
|
12444
12451
|
validator: (v: any) => boolean;
|
|
12445
12452
|
};
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
inline: BooleanConstructor;
|
|
12453
|
+
modelValue: null;
|
|
12454
|
+
ripple: {
|
|
12455
|
+
type: BooleanConstructor;
|
|
12456
|
+
default: boolean;
|
|
12457
|
+
};
|
|
12452
12458
|
falseIcon: {
|
|
12453
12459
|
type: vue.PropType<NonNullable<IconValue>>;
|
|
12454
12460
|
default: NonNullable<IconValue>;
|
|
@@ -12457,27 +12463,12 @@ declare const VCheckbox: {
|
|
|
12457
12463
|
type: vue.PropType<NonNullable<IconValue>>;
|
|
12458
12464
|
default: NonNullable<IconValue>;
|
|
12459
12465
|
};
|
|
12460
|
-
ripple: {
|
|
12461
|
-
type: BooleanConstructor;
|
|
12462
|
-
default: boolean;
|
|
12463
|
-
};
|
|
12464
|
-
multiple: {
|
|
12465
|
-
type: vue.PropType<boolean | null>;
|
|
12466
|
-
default: null;
|
|
12467
|
-
};
|
|
12468
|
-
name: StringConstructor;
|
|
12469
|
-
readonly: BooleanConstructor;
|
|
12470
|
-
modelValue: null;
|
|
12471
|
-
type: StringConstructor;
|
|
12472
12466
|
valueComparator: {
|
|
12473
12467
|
type: vue.PropType<typeof deepEqual>;
|
|
12474
12468
|
default: typeof deepEqual;
|
|
12475
12469
|
};
|
|
12476
|
-
label: StringConstructor;
|
|
12477
12470
|
trueValue: null;
|
|
12478
12471
|
falseValue: null;
|
|
12479
|
-
value: null;
|
|
12480
|
-
indeterminate: BooleanConstructor;
|
|
12481
12472
|
indeterminateIcon: {
|
|
12482
12473
|
type: vue.PropType<IconValue>;
|
|
12483
12474
|
default: string;
|
|
@@ -2,6 +2,15 @@ const Refs = Symbol('Forwarded refs');
|
|
|
2
2
|
|
|
3
3
|
/** Omit properties starting with P */
|
|
4
4
|
|
|
5
|
+
function getDescriptor(obj, key) {
|
|
6
|
+
let currentObj = obj;
|
|
7
|
+
while (currentObj) {
|
|
8
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
|
|
9
|
+
if (descriptor) return descriptor;
|
|
10
|
+
currentObj = Object.getPrototypeOf(currentObj);
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
5
14
|
export function forwardRefs(target) {
|
|
6
15
|
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
7
16
|
refs[_key - 1] = arguments[_key];
|
|
@@ -29,30 +38,18 @@ export function forwardRefs(target) {
|
|
|
29
38
|
// Check each ref's own properties
|
|
30
39
|
for (const ref of refs) {
|
|
31
40
|
if (!ref.value) continue;
|
|
32
|
-
const descriptor =
|
|
41
|
+
const descriptor = getDescriptor(ref.value, key) ?? ('_' in ref.value ? getDescriptor(ref.value._?.setupState, key) : undefined);
|
|
33
42
|
if (descriptor) return descriptor;
|
|
34
|
-
if ('_' in ref.value && 'setupState' in ref.value._) {
|
|
35
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
|
|
36
|
-
if (descriptor) return descriptor;
|
|
37
|
-
}
|
|
38
43
|
}
|
|
44
|
+
|
|
39
45
|
// Recursive search up each ref's prototype
|
|
40
|
-
for (const ref of refs) {
|
|
41
|
-
let obj = ref.value && Object.getPrototypeOf(ref.value);
|
|
42
|
-
while (obj) {
|
|
43
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
|
|
44
|
-
if (descriptor) return descriptor;
|
|
45
|
-
obj = Object.getPrototypeOf(obj);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
// Call forwarded refs' proxies
|
|
49
46
|
for (const ref of refs) {
|
|
50
47
|
const childRefs = ref.value && ref.value[Refs];
|
|
51
48
|
if (!childRefs) continue;
|
|
52
49
|
const queue = childRefs.slice();
|
|
53
50
|
while (queue.length) {
|
|
54
51
|
const ref = queue.shift();
|
|
55
|
-
const descriptor =
|
|
52
|
+
const descriptor = getDescriptor(ref.value, key);
|
|
56
53
|
if (descriptor) return descriptor;
|
|
57
54
|
const childRefs = ref.value && ref.value[Refs];
|
|
58
55
|
if (childRefs) queue.push(...childRefs);
|