vuetify 3.5.10 → 3.5.11
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/importMap-labs.json +8 -8
- package/dist/json/importMap.json +118 -118
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +2823 -2823
- package/dist/vuetify-labs.esm.js +11 -11
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +11 -11
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +1801 -1801
- package/dist/vuetify.d.ts +35 -35
- package/dist/vuetify.esm.js +5 -5
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +5 -5
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +5 -5
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.mjs +2 -2
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +35 -35
- package/lib/labs/VNumberInput/VNumberInput.mjs +6 -6
- package/lib/labs/VNumberInput/VNumberInput.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -123,7 +123,7 @@ export const VOtpInput = genericComponent()({
|
|
|
123
123
|
e.preventDefault();
|
|
124
124
|
e.stopPropagation();
|
|
125
125
|
const clipboardText = e?.clipboardData?.getData('Text') ?? '';
|
|
126
|
-
if (
|
|
126
|
+
if (isValidNumber(clipboardText)) return;
|
|
127
127
|
model.value = clipboardText.split('');
|
|
128
128
|
inputRef.value?.[index].blur();
|
|
129
129
|
}
|
|
@@ -139,7 +139,7 @@ export const VOtpInput = genericComponent()({
|
|
|
139
139
|
focusIndex.value = -1;
|
|
140
140
|
}
|
|
141
141
|
function isValidNumber(value) {
|
|
142
|
-
return props.type === 'number' &&
|
|
142
|
+
return props.type === 'number' && /[^0-9]/g.test(value);
|
|
143
143
|
}
|
|
144
144
|
provideDefaults({
|
|
145
145
|
VField: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VOtpInput.mjs","names":["makeVFieldProps","VField","VOverlay","VProgressCircular","provideDefaults","makeDimensionProps","useDimension","makeFocusProps","useFocus","useLocale","useProxiedModel","computed","nextTick","ref","watch","filterInputAttrs","focusChild","genericComponent","only","propsFactory","useRender","makeVOtpInputProps","autofocus","Boolean","divider","String","focusAll","label","type","default","length","Number","modelValue","undefined","placeholder","variant","VOtpInput","name","props","emits","finish","val","setup","_ref","attrs","emit","slots","dimensionStyles","isFocused","focus","blur","model","split","join","t","fields","Array","value","fill","focusIndex","contentRef","inputRef","current","onInput","isValidNumber","array","slice","target","onKeydown","e","index","includes","key","preventDefault","requestAnimationFrame","select","onPaste","stopPropagation","clipboardText","clipboardData","getData","reset","onFocus","onBlur","isNaN","color","bgColor","baseColor","disabled","error","scoped","deep","rootAttrs","inputAttrs","_createVNode","_mergeProps","class","style","map","_","i","_Fragment","loader","event","loading","some","input"],"sources":["../../../src/components/VOtpInput/VOtpInput.tsx"],"sourcesContent":["// Styles\nimport './VOtpInput.sass'\n\n// Components\nimport { makeVFieldProps, VField } from '@/components/VField/VField'\nimport { VOverlay } from '@/components/VOverlay/VOverlay'\nimport { VProgressCircular } from '@/components/VProgressCircular/VProgressCircular'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { filterInputAttrs, focusChild, genericComponent, only, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// Types\nexport type VOtpInputSlots = {\n default: never\n loader: never\n}\n\nexport const makeVOtpInputProps = propsFactory({\n autofocus: Boolean,\n divider: String,\n focusAll: Boolean,\n label: {\n type: String,\n default: '$vuetify.input.otp',\n },\n length: {\n type: [Number, String],\n default: 6,\n },\n modelValue: {\n type: [Number, String],\n default: undefined,\n },\n placeholder: String,\n type: {\n type: String as PropType<'text' | 'password' | 'number'>,\n default: 'number',\n },\n\n ...makeDimensionProps(),\n ...makeFocusProps(),\n ...only(makeVFieldProps({\n variant: 'outlined' as const,\n }), [\n 'baseColor',\n 'bgColor',\n 'class',\n 'color',\n 'disabled',\n 'error',\n 'loading',\n 'rounded',\n 'style',\n 'theme',\n 'variant',\n ]),\n}, 'VOtpInput')\n\nexport const VOtpInput = genericComponent<VOtpInputSlots>()({\n name: 'VOtpInput',\n\n props: makeVOtpInputProps(),\n\n emits: {\n finish: (val: string) => true,\n 'update:focused': (val: boolean) => true,\n 'update:modelValue': (val: string) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { dimensionStyles } = useDimension(props)\n const { isFocused, focus, blur } = useFocus(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n '',\n val => String(val).split(''),\n val => val.join('')\n )\n const { t } = useLocale()\n\n const length = computed(() => Number(props.length))\n const fields = computed(() => Array(length.value).fill(0))\n const focusIndex = ref(-1)\n const contentRef = ref<HTMLElement>()\n const inputRef = ref<HTMLInputElement[]>([])\n const current = computed(() => inputRef.value[focusIndex.value])\n\n function onInput () {\n // The maxlength attribute doesn't work for the number type input, so the text type is used.\n // The following logic simulates the behavior of a number input.\n if (isValidNumber(current.value.value)) {\n current.value.value = ''\n return\n }\n\n const array = model.value.slice()\n const value = current.value.value\n\n array[focusIndex.value] = value\n\n let target: any = null\n\n if (focusIndex.value > model.value.length) {\n target = model.value.length + 1\n } else if (focusIndex.value + 1 !== length.value) {\n target = 'next'\n }\n\n model.value = array\n\n if (target) focusChild(contentRef.value!, target)\n }\n\n function onKeydown (e: KeyboardEvent) {\n const array = model.value.slice()\n const index = focusIndex.value\n let target: 'next' | 'prev' | 'first' | 'last' | number | null = null\n\n if (![\n 'ArrowLeft',\n 'ArrowRight',\n 'Backspace',\n 'Delete',\n ].includes(e.key)) return\n\n e.preventDefault()\n\n if (e.key === 'ArrowLeft') {\n target = 'prev'\n } else if (e.key === 'ArrowRight') {\n target = 'next'\n } else if (['Backspace', 'Delete'].includes(e.key)) {\n array[focusIndex.value] = ''\n\n model.value = array\n\n if (focusIndex.value > 0 && e.key === 'Backspace') {\n target = 'prev'\n } else {\n requestAnimationFrame(() => {\n inputRef.value[index]?.select()\n })\n }\n }\n\n requestAnimationFrame(() => {\n if (target != null) {\n focusChild(contentRef.value!, target)\n }\n })\n }\n\n function onPaste (index: number, e: ClipboardEvent) {\n e.preventDefault()\n e.stopPropagation()\n\n const clipboardText = e?.clipboardData?.getData('Text') ?? ''\n\n if (!isValidNumber(clipboardText)) return\n\n model.value = clipboardText.split('')\n\n inputRef.value?.[index].blur()\n }\n\n function reset () {\n model.value = []\n }\n\n function onFocus (e: FocusEvent, index: number) {\n focus()\n\n focusIndex.value = index\n }\n\n function onBlur () {\n blur()\n\n focusIndex.value = -1\n }\n\n function isValidNumber (value: string) {\n return props.type === 'number' && !isNaN(Number(value))\n }\n\n provideDefaults({\n VField: {\n color: computed(() => props.color),\n bgColor: computed(() => props.color),\n baseColor: computed(() => props.baseColor),\n disabled: computed(() => props.disabled),\n error: computed(() => props.error),\n variant: computed(() => props.variant),\n },\n }, { scoped: true })\n\n watch(model, val => {\n if (val.length === length.value) emit('finish', val.join(''))\n }, { deep: true })\n\n watch(focusIndex, val => {\n if (val < 0) return\n\n nextTick(() => {\n inputRef.value[val]?.select()\n })\n })\n\n useRender(() => {\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n return (\n <div\n class={[\n 'v-otp-input',\n {\n 'v-otp-input--divided': !!props.divider,\n },\n props.class,\n ]}\n style={[\n props.style,\n ]}\n { ...rootAttrs }\n >\n <div\n ref={ contentRef }\n class=\"v-otp-input__content\"\n style={[\n dimensionStyles.value,\n ]}\n >\n { fields.value.map((_, i) => (\n <>\n { props.divider && i !== 0 && (\n <span class=\"v-otp-input__divider\">{ props.divider }</span>\n )}\n\n <VField\n focused={ (isFocused.value && props.focusAll) || focusIndex.value === i }\n key={ i }\n >\n {{\n ...slots,\n loader: undefined,\n default: () => {\n return (\n <input\n ref={ val => inputRef.value[i] = val as HTMLInputElement }\n aria-label={ t(props.label, i + 1) }\n autofocus={ i === 0 && props.autofocus }\n autocomplete=\"one-time-code\"\n class={[\n 'v-otp-input__field',\n ]}\n disabled={ props.disabled }\n inputmode={ props.type === 'number' ? 'numeric' : 'text' }\n min={ props.type === 'number' ? 0 : undefined }\n maxlength=\"1\"\n placeholder={ props.placeholder }\n type={ props.type === 'number' ? 'text' : props.type }\n value={ model.value[i] }\n onInput={ onInput }\n onFocus={ e => onFocus(e, i) }\n onBlur={ onBlur }\n onKeydown={ onKeydown }\n onPaste={ event => onPaste(i, event) }\n />\n )\n },\n }}\n </VField>\n </>\n ))}\n\n <input\n class=\"v-otp-input-input\"\n type=\"hidden\"\n { ...inputAttrs }\n value={ model.value.join('') }\n />\n\n <VOverlay\n contained\n content-class=\"v-otp-input__loader\"\n model-value={ !!props.loading }\n persistent\n >\n { slots.loader?.() ?? (\n <VProgressCircular\n color={ typeof props.loading === 'boolean' ? undefined : props.loading }\n indeterminate\n size=\"24\"\n width=\"2\"\n />\n )}\n </VOverlay>\n\n { slots.default?.() }\n </div>\n </div>\n )\n })\n\n return {\n blur: () => {\n inputRef.value?.some(input => input.blur())\n },\n focus: () => {\n inputRef.value?.[0].focus()\n },\n reset,\n isFocused,\n }\n },\n})\n\nexport type VOtpInput = InstanceType<typeof VOtpInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,eAAe,EAAEC,MAAM;AAAA,SACvBC,QAAQ;AAAA,SACRC,iBAAiB,sDAE1B;AAAA,SACSC,eAAe;AAAA,SACfC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,SAAS;AAAA,SACTC,eAAe,8C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","VProgressCircular","provideDefaults","makeDimensionProps","useDimension","makeFocusProps","useFocus","useLocale","useProxiedModel","computed","nextTick","ref","watch","filterInputAttrs","focusChild","genericComponent","only","propsFactory","useRender","makeVOtpInputProps","autofocus","Boolean","divider","String","focusAll","label","type","default","length","Number","modelValue","undefined","placeholder","variant","VOtpInput","name","props","emits","finish","val","setup","_ref","attrs","emit","slots","dimensionStyles","isFocused","focus","blur","model","split","join","t","fields","Array","value","fill","focusIndex","contentRef","inputRef","current","onInput","isValidNumber","array","slice","target","onKeydown","e","index","includes","key","preventDefault","requestAnimationFrame","select","onPaste","stopPropagation","clipboardText","clipboardData","getData","reset","onFocus","onBlur","test","color","bgColor","baseColor","disabled","error","scoped","deep","rootAttrs","inputAttrs","_createVNode","_mergeProps","class","style","map","_","i","_Fragment","loader","event","loading","some","input"],"sources":["../../../src/components/VOtpInput/VOtpInput.tsx"],"sourcesContent":["// Styles\nimport './VOtpInput.sass'\n\n// Components\nimport { makeVFieldProps, VField } from '@/components/VField/VField'\nimport { VOverlay } from '@/components/VOverlay/VOverlay'\nimport { VProgressCircular } from '@/components/VProgressCircular/VProgressCircular'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { filterInputAttrs, focusChild, genericComponent, only, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// Types\nexport type VOtpInputSlots = {\n default: never\n loader: never\n}\n\nexport const makeVOtpInputProps = propsFactory({\n autofocus: Boolean,\n divider: String,\n focusAll: Boolean,\n label: {\n type: String,\n default: '$vuetify.input.otp',\n },\n length: {\n type: [Number, String],\n default: 6,\n },\n modelValue: {\n type: [Number, String],\n default: undefined,\n },\n placeholder: String,\n type: {\n type: String as PropType<'text' | 'password' | 'number'>,\n default: 'number',\n },\n\n ...makeDimensionProps(),\n ...makeFocusProps(),\n ...only(makeVFieldProps({\n variant: 'outlined' as const,\n }), [\n 'baseColor',\n 'bgColor',\n 'class',\n 'color',\n 'disabled',\n 'error',\n 'loading',\n 'rounded',\n 'style',\n 'theme',\n 'variant',\n ]),\n}, 'VOtpInput')\n\nexport const VOtpInput = genericComponent<VOtpInputSlots>()({\n name: 'VOtpInput',\n\n props: makeVOtpInputProps(),\n\n emits: {\n finish: (val: string) => true,\n 'update:focused': (val: boolean) => true,\n 'update:modelValue': (val: string) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { dimensionStyles } = useDimension(props)\n const { isFocused, focus, blur } = useFocus(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n '',\n val => String(val).split(''),\n val => val.join('')\n )\n const { t } = useLocale()\n\n const length = computed(() => Number(props.length))\n const fields = computed(() => Array(length.value).fill(0))\n const focusIndex = ref(-1)\n const contentRef = ref<HTMLElement>()\n const inputRef = ref<HTMLInputElement[]>([])\n const current = computed(() => inputRef.value[focusIndex.value])\n\n function onInput () {\n // The maxlength attribute doesn't work for the number type input, so the text type is used.\n // The following logic simulates the behavior of a number input.\n if (isValidNumber(current.value.value)) {\n current.value.value = ''\n return\n }\n\n const array = model.value.slice()\n const value = current.value.value\n\n array[focusIndex.value] = value\n\n let target: any = null\n\n if (focusIndex.value > model.value.length) {\n target = model.value.length + 1\n } else if (focusIndex.value + 1 !== length.value) {\n target = 'next'\n }\n\n model.value = array\n\n if (target) focusChild(contentRef.value!, target)\n }\n\n function onKeydown (e: KeyboardEvent) {\n const array = model.value.slice()\n const index = focusIndex.value\n let target: 'next' | 'prev' | 'first' | 'last' | number | null = null\n\n if (![\n 'ArrowLeft',\n 'ArrowRight',\n 'Backspace',\n 'Delete',\n ].includes(e.key)) return\n\n e.preventDefault()\n\n if (e.key === 'ArrowLeft') {\n target = 'prev'\n } else if (e.key === 'ArrowRight') {\n target = 'next'\n } else if (['Backspace', 'Delete'].includes(e.key)) {\n array[focusIndex.value] = ''\n\n model.value = array\n\n if (focusIndex.value > 0 && e.key === 'Backspace') {\n target = 'prev'\n } else {\n requestAnimationFrame(() => {\n inputRef.value[index]?.select()\n })\n }\n }\n\n requestAnimationFrame(() => {\n if (target != null) {\n focusChild(contentRef.value!, target)\n }\n })\n }\n\n function onPaste (index: number, e: ClipboardEvent) {\n e.preventDefault()\n e.stopPropagation()\n\n const clipboardText = e?.clipboardData?.getData('Text') ?? ''\n\n if (isValidNumber(clipboardText)) return\n\n model.value = clipboardText.split('')\n\n inputRef.value?.[index].blur()\n }\n\n function reset () {\n model.value = []\n }\n\n function onFocus (e: FocusEvent, index: number) {\n focus()\n\n focusIndex.value = index\n }\n\n function onBlur () {\n blur()\n\n focusIndex.value = -1\n }\n\n function isValidNumber (value: string) {\n return props.type === 'number' && /[^0-9]/g.test(value)\n }\n\n provideDefaults({\n VField: {\n color: computed(() => props.color),\n bgColor: computed(() => props.color),\n baseColor: computed(() => props.baseColor),\n disabled: computed(() => props.disabled),\n error: computed(() => props.error),\n variant: computed(() => props.variant),\n },\n }, { scoped: true })\n\n watch(model, val => {\n if (val.length === length.value) emit('finish', val.join(''))\n }, { deep: true })\n\n watch(focusIndex, val => {\n if (val < 0) return\n\n nextTick(() => {\n inputRef.value[val]?.select()\n })\n })\n\n useRender(() => {\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n return (\n <div\n class={[\n 'v-otp-input',\n {\n 'v-otp-input--divided': !!props.divider,\n },\n props.class,\n ]}\n style={[\n props.style,\n ]}\n { ...rootAttrs }\n >\n <div\n ref={ contentRef }\n class=\"v-otp-input__content\"\n style={[\n dimensionStyles.value,\n ]}\n >\n { fields.value.map((_, i) => (\n <>\n { props.divider && i !== 0 && (\n <span class=\"v-otp-input__divider\">{ props.divider }</span>\n )}\n\n <VField\n focused={ (isFocused.value && props.focusAll) || focusIndex.value === i }\n key={ i }\n >\n {{\n ...slots,\n loader: undefined,\n default: () => {\n return (\n <input\n ref={ val => inputRef.value[i] = val as HTMLInputElement }\n aria-label={ t(props.label, i + 1) }\n autofocus={ i === 0 && props.autofocus }\n autocomplete=\"one-time-code\"\n class={[\n 'v-otp-input__field',\n ]}\n disabled={ props.disabled }\n inputmode={ props.type === 'number' ? 'numeric' : 'text' }\n min={ props.type === 'number' ? 0 : undefined }\n maxlength=\"1\"\n placeholder={ props.placeholder }\n type={ props.type === 'number' ? 'text' : props.type }\n value={ model.value[i] }\n onInput={ onInput }\n onFocus={ e => onFocus(e, i) }\n onBlur={ onBlur }\n onKeydown={ onKeydown }\n onPaste={ event => onPaste(i, event) }\n />\n )\n },\n }}\n </VField>\n </>\n ))}\n\n <input\n class=\"v-otp-input-input\"\n type=\"hidden\"\n { ...inputAttrs }\n value={ model.value.join('') }\n />\n\n <VOverlay\n contained\n content-class=\"v-otp-input__loader\"\n model-value={ !!props.loading }\n persistent\n >\n { slots.loader?.() ?? (\n <VProgressCircular\n color={ typeof props.loading === 'boolean' ? undefined : props.loading }\n indeterminate\n size=\"24\"\n width=\"2\"\n />\n )}\n </VOverlay>\n\n { slots.default?.() }\n </div>\n </div>\n )\n })\n\n return {\n blur: () => {\n inputRef.value?.some(input => input.blur())\n },\n focus: () => {\n inputRef.value?.[0].focus()\n },\n reset,\n isFocused,\n }\n },\n})\n\nexport type VOtpInput = InstanceType<typeof VOtpInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,eAAe,EAAEC,MAAM;AAAA,SACvBC,QAAQ;AAAA,SACRC,iBAAiB,sDAE1B;AAAA,SACSC,eAAe;AAAA,SACfC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC3CC,gBAAgB,EAAEC,UAAU,EAAEC,gBAAgB,EAAE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A,WACPM,CAAC,IAAIa,OAAO,CAACb,CAAC,EAAE+B,CAAC,CAAC;YAAA,UACnBjB,MAAM;YAAA,aACHf,SAAS;YAAA,WACXmC,KAAK,IAAI3B,OAAO,CAACwB,CAAC,EAAEG,KAAK;UAAC;QAG1C;MAAC,IAIR,CAAC,EAAAT,YAAA,UAAAC,WAAA;QAAA;QAAA;MAAA,GAKKF,UAAU;QAAA,SACP1C,KAAK,CAACM,KAAK,CAACJ,IAAI,CAAC,EAAE;MAAC,WAAAyC,YAAA,CAAA5F,QAAA;QAAA;QAAA;QAAA,eAMd,CAAC,CAACoC,KAAK,CAACkE,OAAO;QAAA;MAAA;QAAA3E,OAAA,EAAAA,CAAA,MAG3BiB,KAAK,CAACwD,MAAM,GAAG,CAAC,IAAAR,YAAA,CAAA3F,iBAAA;UAAA,SAEN,OAAOmC,KAAK,CAACkE,OAAO,KAAK,SAAS,GAAGvE,SAAS,GAAGK,KAAK,CAACkE,OAAO;UAAA;UAAA;UAAA;QAAA,QAKzE;MAAA,IAGD1D,KAAK,CAACjB,OAAO,GAAG,CAAC;IAI3B,CAAC,CAAC;IAEF,OAAO;MACLqB,IAAI,EAAEA,CAAA,KAAM;QACVW,QAAQ,CAACJ,KAAK,EAAEgD,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACxD,IAAI,CAAC,CAAC,CAAC;MAC7C,CAAC;MACDD,KAAK,EAAEA,CAAA,KAAM;QACXY,QAAQ,CAACJ,KAAK,GAAG,CAAC,CAAC,CAACR,KAAK,CAAC,CAAC;MAC7B,CAAC;MACDgC,KAAK;MACLjC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
package/lib/entry-bundler.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
|
16
16
|
...options
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
export const version = "3.5.
|
|
19
|
+
export const version = "3.5.11";
|
|
20
20
|
createVuetify.version = version;
|
|
21
21
|
export { blueprints, components, directives };
|
|
22
22
|
export * from "./composables/index.mjs";
|
package/lib/framework.mjs
CHANGED
package/lib/index.d.mts
CHANGED
|
@@ -521,12 +521,11 @@ declare module '@vue/runtime-core' {
|
|
|
521
521
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
522
522
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
523
523
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
524
|
-
VBadge: typeof import('vuetify/components')['VBadge']
|
|
525
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
526
|
-
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
527
524
|
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
528
525
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
529
526
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
527
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
528
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
|
530
529
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
531
530
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
532
531
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
@@ -536,22 +535,24 @@ declare module '@vue/runtime-core' {
|
|
|
536
535
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
537
536
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
538
537
|
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
538
|
+
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
539
539
|
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
540
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
541
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
540
542
|
VCard: typeof import('vuetify/components')['VCard']
|
|
541
543
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
542
544
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
543
545
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
544
546
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
545
547
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
546
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
547
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
548
548
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
549
549
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
550
|
-
VCode: typeof import('vuetify/components')['VCode']
|
|
551
|
-
VChip: typeof import('vuetify/components')['VChip']
|
|
552
550
|
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
553
|
-
|
|
551
|
+
VChip: typeof import('vuetify/components')['VChip']
|
|
554
552
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
553
|
+
VCounter: typeof import('vuetify/components')['VCounter']
|
|
554
|
+
VCode: typeof import('vuetify/components')['VCode']
|
|
555
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
555
556
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
|
556
557
|
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
|
557
558
|
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
|
@@ -559,7 +560,6 @@ declare module '@vue/runtime-core' {
|
|
|
559
560
|
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
|
560
561
|
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
|
561
562
|
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
|
562
|
-
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
563
563
|
VDatePicker: typeof import('vuetify/components')['VDatePicker']
|
|
564
564
|
VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
|
|
565
565
|
VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
|
|
@@ -567,27 +567,27 @@ declare module '@vue/runtime-core' {
|
|
|
567
567
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
|
568
568
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
|
569
569
|
VDialog: typeof import('vuetify/components')['VDialog']
|
|
570
|
+
VDivider: typeof import('vuetify/components')['VDivider']
|
|
571
|
+
VField: typeof import('vuetify/components')['VField']
|
|
572
|
+
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
573
|
+
VFooter: typeof import('vuetify/components')['VFooter']
|
|
570
574
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
571
575
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
572
576
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
573
577
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
574
|
-
VDivider: typeof import('vuetify/components')['VDivider']
|
|
575
|
-
VField: typeof import('vuetify/components')['VField']
|
|
576
|
-
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
577
578
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
578
|
-
VFooter: typeof import('vuetify/components')['VFooter']
|
|
579
579
|
VImg: typeof import('vuetify/components')['VImg']
|
|
580
|
-
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
581
|
-
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
582
|
-
VItem: typeof import('vuetify/components')['VItem']
|
|
583
580
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
584
581
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
585
582
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
586
583
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
|
587
584
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
585
|
+
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
588
586
|
VInput: typeof import('vuetify/components')['VInput']
|
|
589
|
-
|
|
587
|
+
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
588
|
+
VItem: typeof import('vuetify/components')['VItem']
|
|
590
589
|
VLabel: typeof import('vuetify/components')['VLabel']
|
|
590
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
|
591
591
|
VList: typeof import('vuetify/components')['VList']
|
|
592
592
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
593
593
|
VListImg: typeof import('vuetify/components')['VListImg']
|
|
@@ -597,47 +597,47 @@ declare module '@vue/runtime-core' {
|
|
|
597
597
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
|
598
598
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
599
599
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
600
|
-
VMenu: typeof import('vuetify/components')['VMenu']
|
|
601
600
|
VMain: typeof import('vuetify/components')['VMain']
|
|
602
601
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
603
602
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
603
|
+
VMenu: typeof import('vuetify/components')['VMenu']
|
|
604
604
|
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
605
605
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
606
|
-
VPagination: typeof import('vuetify/components')['VPagination']
|
|
607
606
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
607
|
+
VPagination: typeof import('vuetify/components')['VPagination']
|
|
608
608
|
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
609
609
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
610
610
|
VRating: typeof import('vuetify/components')['VRating']
|
|
611
|
-
VSelect: typeof import('vuetify/components')['VSelect']
|
|
612
611
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
613
|
-
|
|
614
|
-
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
612
|
+
VSelect: typeof import('vuetify/components')['VSelect']
|
|
615
613
|
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
614
|
+
VSheet: typeof import('vuetify/components')['VSheet']
|
|
616
615
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
617
616
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
618
|
-
|
|
619
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
620
|
-
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
617
|
+
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
621
618
|
VStepper: typeof import('vuetify/components')['VStepper']
|
|
622
619
|
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
|
623
620
|
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
|
624
621
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
|
625
622
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
|
626
623
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
|
624
|
+
VSlider: typeof import('vuetify/components')['VSlider']
|
|
625
|
+
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
626
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
627
627
|
VTable: typeof import('vuetify/components')['VTable']
|
|
628
628
|
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
629
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
630
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
|
631
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
629
632
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
630
633
|
VTab: typeof import('vuetify/components')['VTab']
|
|
631
|
-
|
|
634
|
+
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
635
|
+
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
632
636
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
633
637
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
634
638
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
635
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
|
636
|
-
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
637
|
-
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
638
639
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
639
640
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
640
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
641
641
|
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
642
642
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
643
643
|
VForm: typeof import('vuetify/components')['VForm']
|
|
@@ -646,17 +646,17 @@ declare module '@vue/runtime-core' {
|
|
|
646
646
|
VRow: typeof import('vuetify/components')['VRow']
|
|
647
647
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
648
648
|
VHover: typeof import('vuetify/components')['VHover']
|
|
649
|
-
VLayout: typeof import('vuetify/components')['VLayout']
|
|
650
|
-
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
651
649
|
VLazy: typeof import('vuetify/components')['VLazy']
|
|
652
650
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
651
|
+
VLayout: typeof import('vuetify/components')['VLayout']
|
|
652
|
+
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
653
653
|
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
654
654
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
655
655
|
VRadio: typeof import('vuetify/components')['VRadio']
|
|
656
656
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
657
657
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
658
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
659
658
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
659
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
660
660
|
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
661
661
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
662
662
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
@@ -682,14 +682,14 @@ declare module '@vue/runtime-core' {
|
|
|
682
682
|
VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
|
|
683
683
|
VEmptyState: typeof import('vuetify/labs/components')['VEmptyState']
|
|
684
684
|
VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
|
|
685
|
-
VFab: typeof import('vuetify/labs/components')['VFab']
|
|
686
685
|
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
|
687
686
|
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
|
687
|
+
VFab: typeof import('vuetify/labs/components')['VFab']
|
|
688
688
|
VConfirmEdit: typeof import('vuetify/labs/components')['VConfirmEdit']
|
|
689
|
+
VSpeedDial: typeof import('vuetify/labs/components')['VSpeedDial']
|
|
689
690
|
VSparkline: typeof import('vuetify/labs/components')['VSparkline']
|
|
690
691
|
VTreeview: typeof import('vuetify/labs/components')['VTreeview']
|
|
691
692
|
VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
|
|
692
693
|
VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
|
|
693
|
-
VSpeedDial: typeof import('vuetify/labs/components')['VSpeedDial']
|
|
694
694
|
}
|
|
695
695
|
}
|
|
@@ -94,7 +94,7 @@ export const VNumberInput = genericComponent()({
|
|
|
94
94
|
"flat": true,
|
|
95
95
|
"key": "decrement-btn",
|
|
96
96
|
"height": defaultHeight,
|
|
97
|
-
"icon": "
|
|
97
|
+
"icon": "$expand",
|
|
98
98
|
"rounded": "0",
|
|
99
99
|
"size": "small",
|
|
100
100
|
"onClick": onClickDown
|
|
@@ -106,7 +106,7 @@ export const VNumberInput = genericComponent()({
|
|
|
106
106
|
rounded: '0',
|
|
107
107
|
height: defaultHeight,
|
|
108
108
|
size: 'small',
|
|
109
|
-
icon: '
|
|
109
|
+
icon: '$expand'
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}, {
|
|
@@ -117,7 +117,7 @@ export const VNumberInput = genericComponent()({
|
|
|
117
117
|
"flat": true,
|
|
118
118
|
"key": "increment-btn",
|
|
119
119
|
"height": defaultHeight,
|
|
120
|
-
"icon": "
|
|
120
|
+
"icon": "$collapse",
|
|
121
121
|
"onClick": onClickUp,
|
|
122
122
|
"rounded": "0",
|
|
123
123
|
"size": "small"
|
|
@@ -129,7 +129,7 @@ export const VNumberInput = genericComponent()({
|
|
|
129
129
|
height: defaultHeight,
|
|
130
130
|
rounded: '0',
|
|
131
131
|
size: 'small',
|
|
132
|
-
icon: '
|
|
132
|
+
icon: '$collapse'
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}, {
|
|
@@ -186,7 +186,7 @@ export const VNumberInput = genericComponent()({
|
|
|
186
186
|
}, null), _createVNode(VBtn, {
|
|
187
187
|
"flat": true,
|
|
188
188
|
"height": "100%",
|
|
189
|
-
"icon": "
|
|
189
|
+
"icon": "$plus",
|
|
190
190
|
"tile": true,
|
|
191
191
|
"onClick": onClickUp
|
|
192
192
|
}, null)]) : !props.reverse ? () => _createVNode(_Fragment, null, [dividerNode(), controlNode()]) : undefined,
|
|
@@ -195,7 +195,7 @@ export const VNumberInput = genericComponent()({
|
|
|
195
195
|
}, [_createVNode(VBtn, {
|
|
196
196
|
"flat": true,
|
|
197
197
|
"height": "100%",
|
|
198
|
-
"icon": "
|
|
198
|
+
"icon": "$minus",
|
|
199
199
|
"tile": true,
|
|
200
200
|
"onClick": onClickDown
|
|
201
201
|
}, null), _createVNode(VDivider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VNumberInput.mjs","names":["VBtn","VDefaultsProvider","VDivider","filterFieldProps","makeVFieldProps","VField","makeVInputProps","VInput","makeFocusProps","useFocus","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","only","propsFactory","useRender","makeVNumberInputProps","controlVariant","type","String","default","inset","Boolean","hideInput","min","Number","max","step","VNumberInput","name","inheritAttrs","props","modelValue","emits","val","setup","_ref","attrs","emit","slots","model","isFocused","focus","blur","inputRef","onFocus","value","toggleUpDown","increment","arguments","length","undefined","stepUp","stepDown","parseInt","onClickUp","onClickDown","incrementSlotProps","click","decrementSlotProps","fieldProps","rootAttrs","inputAttrs","_","inputProps","filterProps","controlNode","defaultHeight","_createVNode","decrement","flat","rounded","height","size","icon","dividerNode","_mergeProps","reverse","class","style","_ref2","fieldClass","slotProps","_Fragment"],"sources":["../../../src/labs/VNumberInput/VNumberInput.tsx"],"sourcesContent":["// Styles\nimport './VNumberInput.sass'\n\n// Components\nimport { VBtn } from '../../components/VBtn'\nimport { VDefaultsProvider } from '../../components/VDefaultsProvider'\nimport { VDivider } from '../../components/VDivider'\nimport { filterFieldProps, makeVFieldProps, VField } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, only, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\ntype ControlSlot = {\n click: () => void\n}\n\ntype VNumberInputSlots = Omit<VInputSlots & VFieldSlots, 'default'> & {\n increment: ControlSlot\n decrement: ControlSlot\n}\n\ntype ControlVariant = 'default' | 'stacked' | 'split'\n\nconst makeVNumberInputProps = propsFactory({\n controlVariant: {\n type: String as PropType<ControlVariant>,\n default: 'default',\n },\n inset: Boolean,\n hideInput: Boolean,\n min: Number,\n max: Number,\n step: Number,\n\n ...only(makeVInputProps(), [\n 'density',\n 'disabled',\n 'focused',\n 'hideDetails',\n 'hint',\n 'label',\n 'persistentHint',\n 'readonly',\n ]),\n ...only(makeVFieldProps(), [\n 'baseColor',\n 'bgColor',\n 'class',\n 'color',\n 'disabled',\n 'error',\n 'loading',\n 'reverse',\n 'rounded',\n 'style',\n 'theme',\n 'variant',\n ]),\n ...makeFocusProps(),\n}, 'VNumberInput')\n\nexport const VNumberInput = genericComponent<VNumberInputSlots>()({\n name: 'VNumberInput',\n\n inheritAttrs: false,\n\n props: {\n ...makeVNumberInputProps(),\n\n modelValue: {\n type: [Number, String],\n default: 0,\n },\n },\n\n emits: {\n 'update:modelValue': (val: number) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const inputRef = ref<HTMLInputElement>()\n\n function onFocus () {\n if (!isFocused.value) focus()\n }\n\n const controlVariant = computed(() => {\n return props.hideInput ? 'stacked' : props.controlVariant\n })\n\n function toggleUpDown (increment = true) {\n if (increment) {\n inputRef.value?.stepUp()\n } else {\n inputRef.value?.stepDown()\n }\n\n if (inputRef.value) model.value = parseInt(inputRef.value.value, 10)\n }\n\n function onClickUp () {\n toggleUpDown()\n }\n\n function onClickDown () {\n toggleUpDown(false)\n }\n\n const incrementSlotProps = computed(() => ({ click: onClickUp }))\n\n const decrementSlotProps = computed(() => ({ click: onClickDown }))\n\n useRender(() => {\n const fieldProps = filterFieldProps(props)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const { modelValue: _, ...inputProps } = VInput.filterProps(props)\n\n function controlNode () {\n const defaultHeight = controlVariant.value === 'stacked' ? 'auto' : '100%'\n return (\n <div class=\"v-number-input__control\">\n {\n !slots.decrement ? (\n <VBtn\n flat\n key=\"decrement-btn\"\n height={ defaultHeight }\n icon=\"mdi-chevron-down\"\n rounded=\"0\"\n size=\"small\"\n onClick={ onClickDown }\n />\n ) : (\n <VDefaultsProvider\n key=\"decrement-defaults\"\n defaults={{\n VBtn: {\n flat: true,\n rounded: '0',\n height: defaultHeight,\n size: 'small',\n icon: 'mdi-chevron-down',\n },\n }}\n >\n { slots.decrement(decrementSlotProps.value) }\n </VDefaultsProvider>\n )\n }\n\n <VDivider\n vertical={ controlVariant.value !== 'stacked' }\n />\n\n {\n !slots.increment ? (\n <VBtn\n flat\n key=\"increment-btn\"\n height={ defaultHeight }\n icon=\"mdi-chevron-up\"\n onClick={ onClickUp }\n rounded=\"0\"\n size=\"small\"\n />\n ) : (\n <VDefaultsProvider\n key=\"increment-defaults\"\n defaults={{\n VBtn: {\n flat: true,\n height: defaultHeight,\n rounded: '0',\n size: 'small',\n icon: 'mdi-chevron-up',\n },\n }}\n >\n { slots.increment(incrementSlotProps.value) }\n </VDefaultsProvider>\n )\n }\n </div>\n )\n }\n\n function dividerNode () {\n return !props.hideInput && !props.inset ? <VDivider vertical /> : undefined\n }\n\n return (\n <VInput\n class={[\n 'v-number-input',\n {\n 'v-number-input--default': controlVariant.value === 'default',\n 'v-number-input--hide-input': props.hideInput,\n 'v-number-input--inset': props.inset,\n 'v-number-input--reverse': props.reverse,\n 'v-number-input--split': controlVariant.value === 'split',\n 'v-number-input--stacked': controlVariant.value === 'stacked',\n },\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: () => (\n <VField\n { ...fieldProps }\n active\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <input\n ref={ inputRef }\n type=\"number\"\n value={ model.value }\n class={ fieldClass }\n max={ props.max }\n min={ props.min }\n step={ props.step }\n onFocus={ onFocus }\n onBlur={ blur }\n { ...inputAttrs }\n />\n ),\n 'append-inner': controlVariant.value === 'split' ? () => (\n <div class=\"v-number-input__control\">\n <VDivider vertical />\n\n <VBtn\n flat\n height=\"100%\"\n icon=\"mdi-plus\"\n tile\n onClick={ onClickUp }\n />\n </div>\n ) : (!props.reverse\n ? () => <>{ dividerNode() }{ controlNode() }</>\n : undefined),\n 'prepend-inner': controlVariant.value === 'split' ? () => (\n <div class=\"v-number-input__control\">\n <VBtn\n flat\n height=\"100%\"\n icon=\"mdi-minus\"\n tile\n onClick={ onClickDown }\n />\n\n <VDivider vertical />\n </div>\n ) : (props.reverse\n ? () => <>{ controlNode() }{ dividerNode() }</>\n : undefined),\n }}\n </VField>\n ),\n }}\n </VInput>\n )\n })\n },\n})\n\nexport type VNumberInput = InstanceType<typeof VNumberInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,IAAI;AAAA,SACJC,iBAAiB;AAAA,SACjBC,QAAQ;AAAA,SACRC,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,eAAe,EAAEC,MAAM,8CAEhC;AAAA,SACSC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAE1E;AAgBA,MAAMC,qBAAqB,GAAGF,YAAY,CAAC;EACzCG,cAAc,EAAE;IACdC,IAAI,EAAEC,MAAkC;IACxCC,OAAO,EAAE;EACX,CAAC;EACDC,KAAK,EAAEC,OAAO;EACdC,SAAS,EAAED,OAAO;EAClBE,GAAG,EAAEC,MAAM;EACXC,GAAG,EAAED,MAAM;EACXE,IAAI,EAAEF,MAAM;EAEZ,GAAGZ,IAAI,CAACT,eAAe,CAAC,CAAC,EAAE,CACzB,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,UAAU,CACX,CAAC;EACF,GAAGS,IAAI,CAACX,eAAe,CAAC,CAAC,EAAE,CACzB,WAAW,EACX,SAAS,EACT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,YAAA,CAAApE,QAAA;YAAA;UAAA,UAK1B,GAAI+B,KAAK,CAAC8C,OAAO,GACd,MAAAT,YAAA,CAAAe,SAAA,SAAUjB,WAAW,CAAC,CAAC,EAAIS,WAAW,CAAC,CAAC,EAAK,GAC7CxB;QAAU;MAGnB;IAIT,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VNumberInput.mjs","names":["VBtn","VDefaultsProvider","VDivider","filterFieldProps","makeVFieldProps","VField","makeVInputProps","VInput","makeFocusProps","useFocus","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","only","propsFactory","useRender","makeVNumberInputProps","controlVariant","type","String","default","inset","Boolean","hideInput","min","Number","max","step","VNumberInput","name","inheritAttrs","props","modelValue","emits","val","setup","_ref","attrs","emit","slots","model","isFocused","focus","blur","inputRef","onFocus","value","toggleUpDown","increment","arguments","length","undefined","stepUp","stepDown","parseInt","onClickUp","onClickDown","incrementSlotProps","click","decrementSlotProps","fieldProps","rootAttrs","inputAttrs","_","inputProps","filterProps","controlNode","defaultHeight","_createVNode","decrement","flat","rounded","height","size","icon","dividerNode","_mergeProps","reverse","class","style","_ref2","fieldClass","slotProps","_Fragment"],"sources":["../../../src/labs/VNumberInput/VNumberInput.tsx"],"sourcesContent":["// Styles\nimport './VNumberInput.sass'\n\n// Components\nimport { VBtn } from '../../components/VBtn'\nimport { VDefaultsProvider } from '../../components/VDefaultsProvider'\nimport { VDivider } from '../../components/VDivider'\nimport { filterFieldProps, makeVFieldProps, VField } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, only, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\ntype ControlSlot = {\n click: () => void\n}\n\ntype VNumberInputSlots = Omit<VInputSlots & VFieldSlots, 'default'> & {\n increment: ControlSlot\n decrement: ControlSlot\n}\n\ntype ControlVariant = 'default' | 'stacked' | 'split'\n\nconst makeVNumberInputProps = propsFactory({\n controlVariant: {\n type: String as PropType<ControlVariant>,\n default: 'default',\n },\n inset: Boolean,\n hideInput: Boolean,\n min: Number,\n max: Number,\n step: Number,\n\n ...only(makeVInputProps(), [\n 'density',\n 'disabled',\n 'focused',\n 'hideDetails',\n 'hint',\n 'label',\n 'persistentHint',\n 'readonly',\n ]),\n ...only(makeVFieldProps(), [\n 'baseColor',\n 'bgColor',\n 'class',\n 'color',\n 'disabled',\n 'error',\n 'loading',\n 'reverse',\n 'rounded',\n 'style',\n 'theme',\n 'variant',\n ]),\n ...makeFocusProps(),\n}, 'VNumberInput')\n\nexport const VNumberInput = genericComponent<VNumberInputSlots>()({\n name: 'VNumberInput',\n\n inheritAttrs: false,\n\n props: {\n ...makeVNumberInputProps(),\n\n modelValue: {\n type: [Number, String],\n default: 0,\n },\n },\n\n emits: {\n 'update:modelValue': (val: number) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const inputRef = ref<HTMLInputElement>()\n\n function onFocus () {\n if (!isFocused.value) focus()\n }\n\n const controlVariant = computed(() => {\n return props.hideInput ? 'stacked' : props.controlVariant\n })\n\n function toggleUpDown (increment = true) {\n if (increment) {\n inputRef.value?.stepUp()\n } else {\n inputRef.value?.stepDown()\n }\n\n if (inputRef.value) model.value = parseInt(inputRef.value.value, 10)\n }\n\n function onClickUp () {\n toggleUpDown()\n }\n\n function onClickDown () {\n toggleUpDown(false)\n }\n\n const incrementSlotProps = computed(() => ({ click: onClickUp }))\n\n const decrementSlotProps = computed(() => ({ click: onClickDown }))\n\n useRender(() => {\n const fieldProps = filterFieldProps(props)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const { modelValue: _, ...inputProps } = VInput.filterProps(props)\n\n function controlNode () {\n const defaultHeight = controlVariant.value === 'stacked' ? 'auto' : '100%'\n return (\n <div class=\"v-number-input__control\">\n {\n !slots.decrement ? (\n <VBtn\n flat\n key=\"decrement-btn\"\n height={ defaultHeight }\n icon=\"$expand\"\n rounded=\"0\"\n size=\"small\"\n onClick={ onClickDown }\n />\n ) : (\n <VDefaultsProvider\n key=\"decrement-defaults\"\n defaults={{\n VBtn: {\n flat: true,\n rounded: '0',\n height: defaultHeight,\n size: 'small',\n icon: '$expand',\n },\n }}\n >\n { slots.decrement(decrementSlotProps.value) }\n </VDefaultsProvider>\n )\n }\n\n <VDivider\n vertical={ controlVariant.value !== 'stacked' }\n />\n\n {\n !slots.increment ? (\n <VBtn\n flat\n key=\"increment-btn\"\n height={ defaultHeight }\n icon=\"$collapse\"\n onClick={ onClickUp }\n rounded=\"0\"\n size=\"small\"\n />\n ) : (\n <VDefaultsProvider\n key=\"increment-defaults\"\n defaults={{\n VBtn: {\n flat: true,\n height: defaultHeight,\n rounded: '0',\n size: 'small',\n icon: '$collapse',\n },\n }}\n >\n { slots.increment(incrementSlotProps.value) }\n </VDefaultsProvider>\n )\n }\n </div>\n )\n }\n\n function dividerNode () {\n return !props.hideInput && !props.inset ? <VDivider vertical /> : undefined\n }\n\n return (\n <VInput\n class={[\n 'v-number-input',\n {\n 'v-number-input--default': controlVariant.value === 'default',\n 'v-number-input--hide-input': props.hideInput,\n 'v-number-input--inset': props.inset,\n 'v-number-input--reverse': props.reverse,\n 'v-number-input--split': controlVariant.value === 'split',\n 'v-number-input--stacked': controlVariant.value === 'stacked',\n },\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: () => (\n <VField\n { ...fieldProps }\n active\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <input\n ref={ inputRef }\n type=\"number\"\n value={ model.value }\n class={ fieldClass }\n max={ props.max }\n min={ props.min }\n step={ props.step }\n onFocus={ onFocus }\n onBlur={ blur }\n { ...inputAttrs }\n />\n ),\n 'append-inner': controlVariant.value === 'split' ? () => (\n <div class=\"v-number-input__control\">\n <VDivider vertical />\n\n <VBtn\n flat\n height=\"100%\"\n icon=\"$plus\"\n tile\n onClick={ onClickUp }\n />\n </div>\n ) : (!props.reverse\n ? () => <>{ dividerNode() }{ controlNode() }</>\n : undefined),\n 'prepend-inner': controlVariant.value === 'split' ? () => (\n <div class=\"v-number-input__control\">\n <VBtn\n flat\n height=\"100%\"\n icon=\"$minus\"\n tile\n onClick={ onClickDown }\n />\n\n <VDivider vertical />\n </div>\n ) : (props.reverse\n ? () => <>{ controlNode() }{ dividerNode() }</>\n : undefined),\n }}\n </VField>\n ),\n }}\n </VInput>\n )\n })\n },\n})\n\nexport type VNumberInput = InstanceType<typeof VNumberInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,IAAI;AAAA,SACJC,iBAAiB;AAAA,SACjBC,QAAQ;AAAA,SACRC,gBAAgB,EAAEC,eAAe,EAAEC,MAAM;AAAA,SACzCC,eAAe,EAAEC,MAAM,8CAEhC;AAAA,SACSC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAE1E;AAgBA,MAAMC,qBAAqB,GAAGF,YAAY,CAAC;EACzCG,cAAc,EAAE;IACdC,IAAI,EAAEC,MAAkC;IACxCC,OAAO,EAAE;EACX,CAAC;EACDC,KAAK,EAAEC,OAAO;EACdC,SAAS,EAAED,OAAO;EAClBE,GAAG,EAAEC,MAAM;EACXC,GAAG,EAAED,MAAM;EACXE,IAAI,EAAEF,MAAM;EAEZ,GAAGZ,IAAI,CAACT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WAAW,CAAC,CAAC,EAAK,GAC7Cf,SAAU;UACd,eAAe,EAAElC,cAAc,CAAC6B,KAAK,KAAK,OAAO,GAAG,MAAAsB,YAAA;YAAA;UAAA,IAAAA,YAAA,CAAAtE,IAAA;YAAA;YAAA;YAAA;YAAA;YAAA,WAOpC0D;UAAW,UAAAY,YAAA,CAAApE,QAAA;YAAA;UAAA,UAK1B,GAAI+B,KAAK,CAAC8C,OAAO,GACd,MAAAT,YAAA,CAAAe,SAAA,SAAUjB,WAAW,CAAC,CAAC,EAAIS,WAAW,CAAC,CAAC,EAAK,GAC7CxB;QAAU;MAGnB;IAIT,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuetify",
|
|
3
3
|
"description": "Vue Material Component Framework",
|
|
4
|
-
"version": "3.5.
|
|
4
|
+
"version": "3.5.11",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "John Leider",
|
|
7
7
|
"email": "john@vuetifyjs.com"
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
},
|
|
174
174
|
"peerDependencies": {
|
|
175
175
|
"typescript": ">=4.7",
|
|
176
|
-
"vite-plugin-vuetify": ">=
|
|
176
|
+
"vite-plugin-vuetify": ">=2.0.3",
|
|
177
177
|
"vue": "^3.3.0",
|
|
178
178
|
"vue-i18n": "^9.0.0",
|
|
179
179
|
"webpack-plugin-vuetify": ">=2.0.0-alpha.11"
|
|
@@ -200,5 +200,5 @@
|
|
|
200
200
|
"attributes": "dist/json/attributes.json"
|
|
201
201
|
},
|
|
202
202
|
"web-types": "dist/json/web-types.json",
|
|
203
|
-
"gitHead": "
|
|
203
|
+
"gitHead": "0e55978c1b2fb94af9e4b07c62a7009fbe69d191"
|
|
204
204
|
}
|