@vuetify/nightly 3.11.8-dev.2026-02-17 → 3.11.8-dev.2026-02-18
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/CHANGELOG.md +7 -3
- package/dist/json/attributes.json +1800 -1796
- package/dist/json/importMap-labs.json +20 -20
- package/dist/json/importMap.json +170 -170
- package/dist/json/tags.json +1 -0
- package/dist/json/web-types.json +3410 -3400
- package/dist/vuetify-labs.cjs +12 -5
- package/dist/vuetify-labs.css +5723 -5723
- package/dist/vuetify-labs.d.ts +72 -64
- package/dist/vuetify-labs.esm.js +12 -5
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +12 -5
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +12 -5
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +5605 -5605
- package/dist/vuetify.d.ts +72 -64
- package/dist/vuetify.esm.js +12 -5
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +12 -5
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +6 -6
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.d.ts +13 -0
- package/lib/components/VOtpInput/VOtpInput.js +2 -1
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/composables/color.js +7 -1
- package/lib/composables/color.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +64 -64
- package/lib/framework.js +1 -1
- package/lib/iconsets/mdi-unocss.d.ts +5 -0
- package/lib/iconsets/mdi-unocss.js +83 -0
- package/lib/iconsets/mdi-unocss.js.map +1 -0
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@ export declare const makeVOtpInputProps: <Defaults extends {
|
|
|
33
33
|
focusAll?: unknown;
|
|
34
34
|
label?: unknown;
|
|
35
35
|
length?: unknown;
|
|
36
|
+
masked?: unknown;
|
|
36
37
|
modelValue?: unknown;
|
|
37
38
|
placeholder?: unknown;
|
|
38
39
|
type?: unknown;
|
|
@@ -189,6 +190,10 @@ export declare const makeVOtpInputProps: <Defaults extends {
|
|
|
189
190
|
type: PropType<unknown extends Defaults["length"] ? string | number : string | number | Defaults["length"]>;
|
|
190
191
|
default: unknown extends Defaults["length"] ? string | number : Defaults["length"] | NonNullable<string | number>;
|
|
191
192
|
};
|
|
193
|
+
masked: unknown extends Defaults["masked"] ? BooleanConstructor : {
|
|
194
|
+
type: PropType<unknown extends Defaults["masked"] ? boolean : boolean | Defaults["masked"]>;
|
|
195
|
+
default: unknown extends Defaults["masked"] ? boolean : boolean | Defaults["masked"];
|
|
196
|
+
};
|
|
192
197
|
modelValue: unknown extends Defaults["modelValue"] ? {
|
|
193
198
|
type: (NumberConstructor | StringConstructor)[];
|
|
194
199
|
default: undefined;
|
|
@@ -226,6 +231,7 @@ export declare const VOtpInput: {
|
|
|
226
231
|
focusAll: boolean;
|
|
227
232
|
label: string;
|
|
228
233
|
length: string | number;
|
|
234
|
+
masked: boolean;
|
|
229
235
|
type: "number" | "password" | "text";
|
|
230
236
|
} & {
|
|
231
237
|
theme?: string | undefined;
|
|
@@ -286,6 +292,7 @@ export declare const VOtpInput: {
|
|
|
286
292
|
focusAll: boolean;
|
|
287
293
|
label: string;
|
|
288
294
|
length: string | number;
|
|
295
|
+
masked: boolean;
|
|
289
296
|
modelValue: string | number;
|
|
290
297
|
type: "number" | "password" | "text";
|
|
291
298
|
}, true, {}, import("vue").SlotsType<Partial<{
|
|
@@ -313,6 +320,7 @@ export declare const VOtpInput: {
|
|
|
313
320
|
focusAll: boolean;
|
|
314
321
|
label: string;
|
|
315
322
|
length: string | number;
|
|
323
|
+
masked: boolean;
|
|
316
324
|
type: "number" | "password" | "text";
|
|
317
325
|
} & {
|
|
318
326
|
theme?: string | undefined;
|
|
@@ -369,6 +377,7 @@ export declare const VOtpInput: {
|
|
|
369
377
|
focusAll: boolean;
|
|
370
378
|
label: string;
|
|
371
379
|
length: string | number;
|
|
380
|
+
masked: boolean;
|
|
372
381
|
modelValue: string | number;
|
|
373
382
|
type: "number" | "password" | "text";
|
|
374
383
|
}>;
|
|
@@ -386,6 +395,7 @@ export declare const VOtpInput: {
|
|
|
386
395
|
focusAll: boolean;
|
|
387
396
|
label: string;
|
|
388
397
|
length: string | number;
|
|
398
|
+
masked: boolean;
|
|
389
399
|
type: "number" | "password" | "text";
|
|
390
400
|
} & {
|
|
391
401
|
theme?: string | undefined;
|
|
@@ -446,6 +456,7 @@ export declare const VOtpInput: {
|
|
|
446
456
|
focusAll: boolean;
|
|
447
457
|
label: string;
|
|
448
458
|
length: string | number;
|
|
459
|
+
masked: boolean;
|
|
449
460
|
modelValue: string | number;
|
|
450
461
|
type: "number" | "password" | "text";
|
|
451
462
|
}, {}, string, import("vue").SlotsType<Partial<{
|
|
@@ -507,6 +518,7 @@ export declare const VOtpInput: {
|
|
|
507
518
|
type: (NumberConstructor | StringConstructor)[];
|
|
508
519
|
default: number;
|
|
509
520
|
};
|
|
521
|
+
masked: BooleanConstructor;
|
|
510
522
|
modelValue: {
|
|
511
523
|
type: (NumberConstructor | StringConstructor)[];
|
|
512
524
|
default: undefined;
|
|
@@ -568,6 +580,7 @@ export declare const VOtpInput: {
|
|
|
568
580
|
type: (NumberConstructor | StringConstructor)[];
|
|
569
581
|
default: number;
|
|
570
582
|
};
|
|
583
|
+
masked: BooleanConstructor;
|
|
571
584
|
modelValue: {
|
|
572
585
|
type: (NumberConstructor | StringConstructor)[];
|
|
573
586
|
default: undefined;
|
|
@@ -29,6 +29,7 @@ export const makeVOtpInputProps = propsFactory({
|
|
|
29
29
|
type: [Number, String],
|
|
30
30
|
default: 6
|
|
31
31
|
},
|
|
32
|
+
masked: Boolean,
|
|
32
33
|
modelValue: {
|
|
33
34
|
type: [Number, String],
|
|
34
35
|
default: undefined
|
|
@@ -229,7 +230,7 @@ export const VOtpInput = genericComponent()({
|
|
|
229
230
|
"min": props.type === 'number' ? 0 : undefined,
|
|
230
231
|
"maxlength": i === 0 ? length.value : '1',
|
|
231
232
|
"placeholder": props.placeholder,
|
|
232
|
-
"type": props.type === 'number' ? 'text' : props.type,
|
|
233
|
+
"type": props.masked ? 'password' : props.type === 'number' ? 'text' : props.type,
|
|
233
234
|
"value": model.value[i],
|
|
234
235
|
"onInput": onInput,
|
|
235
236
|
"onFocus": e => onFocus(e, i),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VOtpInput.js","names":["makeVFieldProps","VField","VOverlay","VProgressCircular","provideDefaults","makeDensityProps","useDensity","makeDimensionProps","useDimension","makeFocusProps","useFocus","useIntersectionObserver","useLocale","useProxiedModel","useToggleScope","computed","effectScope","nextTick","ref","toRef","watch","watchEffect","filterInputAttrs","focusChild","genericComponent","pick","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","densityClasses","dimensionStyles","isFocused","focus","blur","model","split","join","t","fields","Array","value","fill","focusIndex","contentRef","inputRef","current","_isComposing","intersectScope","run","intersectionRef","isIntersecting","v","stop","onInput","isValidNumber","array","slice","target","onCompositionend","onKeydown","e","index","includes","key","preventDefault","requestAnimationFrame","select","onPaste","stopPropagation","clipboardText","clipboardData","getData","trim","finalIndex","reset","onFocus","onBlur","test","color","bgColor","baseColor","disabled","error","rounded","scoped","deep","rootAttrs","inputAttrs","_createElementVNode","_mergeProps","class","style","_normalizeStyle","map","_","i","_Fragment","_createVNode","loader","_normalizeClass","onCompositionstart","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 { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useIntersectionObserver } from '@/composables/intersectionObserver'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useToggleScope } from '@/composables/toggleScope'\n\n// Utilities\nimport { computed, effectScope, nextTick, ref, toRef, watch, watchEffect } from 'vue'\nimport { filterInputAttrs, focusChild, genericComponent, pick, 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 ...makeDensityProps(),\n ...makeDimensionProps(),\n ...makeFocusProps(),\n ...pick(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 { densityClasses } = useDensity(props)\n const { dimensionStyles } = useDimension(props)\n const { isFocused, focus, blur } = useFocus(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n '',\n val => val == null ? [] : 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 let _isComposing = false\n\n useToggleScope(() => props.autofocus, () => {\n const intersectScope = effectScope()\n intersectScope.run(() => {\n const { intersectionRef, isIntersecting } = useIntersectionObserver()\n watchEffect(() => {\n intersectionRef.value = inputRef.value[0]\n })\n watch(isIntersecting, v => {\n if (!v) return\n intersectionRef.value?.focus()\n intersectScope.stop()\n })\n })\n })\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 if (_isComposing) return\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 onCompositionend () {\n _isComposing = false\n onInput()\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').trim().slice(0, length.value) ?? ''\n const finalIndex = clipboardText.length - 1 === -1 ? index : clipboardText.length - 1\n\n if (isValidNumber(clipboardText)) return\n\n model.value = clipboardText.split('')\n\n focusIndex.value = finalIndex\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: toRef(() => props.color),\n bgColor: toRef(() => props.color),\n baseColor: toRef(() => props.baseColor),\n disabled: toRef(() => props.disabled),\n error: toRef(() => props.error),\n variant: toRef(() => props.variant),\n rounded: toRef(() => props.rounded),\n },\n }, { scoped: true })\n\n watch(model, val => {\n if (val.length === length.value) {\n emit('finish', val.join(''))\n }\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 densityClasses.value,\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={ i === 0 ? length.value : '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 onCompositionstart={ () => _isComposing = true }\n onCompositionend={ onCompositionend }\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 contentClass=\"v-otp-input__loader\"\n modelValue={ !!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,qDAE1B;AAAA,SACSC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,uBAAuB;AAAA,SACvBC,SAAS;AAAA,SACTC,eAAe;AAAA,SACfC,cAAc,4CAEvB;AACA,SAASC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;AAAA,SAC5EC,gBAAgB,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,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1C,OAAO;YAAA,WACPO,CAAC,IAAIe,OAAO,CAACf,CAAC,EAAEmC,CAAC,CAAC;YAAA,UACnBnB,MAAM;YAAA,aACHjB,SAAS;YAAA,sBACAyC,CAAA,KAAMtD,YAAY,GAAG,IAAI;YAAA,oBAC3BY,gBAAgB;YAAA,WACzB2C,KAAK,IAAIlC,OAAO,CAAC4B,CAAC,EAAEM,KAAK;UAAC;QAG1C;MAAC,IAIR,CAAC,EAAAb,mBAAA,UAAAC,WAAA;QAAA;QAAA;MAAA,GAKKF,UAAU;QAAA,SACPrD,KAAK,CAACM,KAAK,CAACJ,IAAI,CAAC,EAAE;MAAC,WAAA6D,YAAA,CAAAxH,QAAA;QAAA;QAAA;QAAA,cAMf,CAAC,CAAC2C,KAAK,CAACkF,OAAO;QAAA;MAAA;QAAA3F,OAAA,EAAAA,CAAA,MAG1BiB,KAAK,CAACsE,MAAM,GAAG,CAAC,IAAAD,YAAA,CAAAvH,iBAAA;UAAA,SAEN,OAAO0C,KAAK,CAACkF,OAAO,KAAK,SAAS,GAAGvF,SAAS,GAAGK,KAAK,CAACkF,OAAO;UAAA;UAAA;UAAA;QAAA,QAKzE;MAAA,IAGD1E,KAAK,CAACjB,OAAO,GAAG,CAAC;IAI3B,CAAC,CAAC;IAEF,OAAO;MACLsB,IAAI,EAAEA,CAAA,KAAM;QACVW,QAAQ,CAACJ,KAAK,EAAE+D,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACvE,IAAI,CAAC,CAAC,CAAC;MAC7C,CAAC;MACDD,KAAK,EAAEA,CAAA,KAAM;QACXY,QAAQ,CAACJ,KAAK,GAAG,CAAC,CAAC,CAACR,KAAK,CAAC,CAAC;MAC7B,CAAC;MACD0C,KAAK;MACL3C;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VOtpInput.js","names":["makeVFieldProps","VField","VOverlay","VProgressCircular","provideDefaults","makeDensityProps","useDensity","makeDimensionProps","useDimension","makeFocusProps","useFocus","useIntersectionObserver","useLocale","useProxiedModel","useToggleScope","computed","effectScope","nextTick","ref","toRef","watch","watchEffect","filterInputAttrs","focusChild","genericComponent","pick","propsFactory","useRender","makeVOtpInputProps","autofocus","Boolean","divider","String","focusAll","label","type","default","length","Number","masked","modelValue","undefined","placeholder","variant","VOtpInput","name","props","emits","finish","val","setup","_ref","attrs","emit","slots","densityClasses","dimensionStyles","isFocused","focus","blur","model","split","join","t","fields","Array","value","fill","focusIndex","contentRef","inputRef","current","_isComposing","intersectScope","run","intersectionRef","isIntersecting","v","stop","onInput","isValidNumber","array","slice","target","onCompositionend","onKeydown","e","index","includes","key","preventDefault","requestAnimationFrame","select","onPaste","stopPropagation","clipboardText","clipboardData","getData","trim","finalIndex","reset","onFocus","onBlur","test","color","bgColor","baseColor","disabled","error","rounded","scoped","deep","rootAttrs","inputAttrs","_createElementVNode","_mergeProps","class","style","_normalizeStyle","map","_","i","_Fragment","_createVNode","loader","_normalizeClass","onCompositionstart","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 { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { useIntersectionObserver } from '@/composables/intersectionObserver'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useToggleScope } from '@/composables/toggleScope'\n\n// Utilities\nimport { computed, effectScope, nextTick, ref, toRef, watch, watchEffect } from 'vue'\nimport { filterInputAttrs, focusChild, genericComponent, pick, 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 masked: Boolean,\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 ...makeDensityProps(),\n ...makeDimensionProps(),\n ...makeFocusProps(),\n ...pick(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 { densityClasses } = useDensity(props)\n const { dimensionStyles } = useDimension(props)\n const { isFocused, focus, blur } = useFocus(props)\n const model = useProxiedModel(\n props,\n 'modelValue',\n '',\n val => val == null ? [] : 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 let _isComposing = false\n\n useToggleScope(() => props.autofocus, () => {\n const intersectScope = effectScope()\n intersectScope.run(() => {\n const { intersectionRef, isIntersecting } = useIntersectionObserver()\n watchEffect(() => {\n intersectionRef.value = inputRef.value[0]\n })\n watch(isIntersecting, v => {\n if (!v) return\n intersectionRef.value?.focus()\n intersectScope.stop()\n })\n })\n })\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 if (_isComposing) return\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 onCompositionend () {\n _isComposing = false\n onInput()\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').trim().slice(0, length.value) ?? ''\n const finalIndex = clipboardText.length - 1 === -1 ? index : clipboardText.length - 1\n\n if (isValidNumber(clipboardText)) return\n\n model.value = clipboardText.split('')\n\n focusIndex.value = finalIndex\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: toRef(() => props.color),\n bgColor: toRef(() => props.color),\n baseColor: toRef(() => props.baseColor),\n disabled: toRef(() => props.disabled),\n error: toRef(() => props.error),\n variant: toRef(() => props.variant),\n rounded: toRef(() => props.rounded),\n },\n }, { scoped: true })\n\n watch(model, val => {\n if (val.length === length.value) {\n emit('finish', val.join(''))\n }\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 densityClasses.value,\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={ i === 0 ? length.value : '1' }\n placeholder={ props.placeholder }\n type={ props.masked ? 'password' : 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 onCompositionstart={ () => _isComposing = true }\n onCompositionend={ onCompositionend }\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 contentClass=\"v-otp-input__loader\"\n modelValue={ !!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,qDAE1B;AAAA,SACSC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,uBAAuB;AAAA,SACvBC,SAAS;AAAA,SACTC,eAAe;AAAA,SACfC,cAAc,4CAEvB;AACA,SAASC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,QAAQ,KAAK;AAAA,SAC5EC,gBAAgB,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,+BAEtF;AAGA;AAMA,OAAO,MAAMC,kBAAkB,GAAGF,YAAY,CAAC;EAC7CG,SAAS,EAAEC,OAAO;EAClBC,OAAO,EAAEC,MAAM;EACfC,QAAQ,EAAEH,OAAO;EACjBI,KAAK,EAAE;IACLC,IAAI,EAAEH,MAAM;IACZI,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACNF,IAAI,EAAE,CAACG,MAAM,EAAEN,MAAM,CAAC;IACtBI,OAAO,EAAE;EACX,CAAC;EACDG,MAAM,EAAET,OAAO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AAA;QAAA;MAAA,GAKKF,UAAU;QAAA,SACPrD,KAAK,CAACM,KAAK,CAACJ,IAAI,CAAC,EAAE;MAAC,WAAA6D,YAAA,CAAAzH,QAAA;QAAA;QAAA;QAAA,cAMf,CAAC,CAAC4C,KAAK,CAACkF,OAAO;QAAA;MAAA;QAAA5F,OAAA,EAAAA,CAAA,MAG1BkB,KAAK,CAACsE,MAAM,GAAG,CAAC,IAAAD,YAAA,CAAAxH,iBAAA;UAAA,SAEN,OAAO2C,KAAK,CAACkF,OAAO,KAAK,SAAS,GAAGvF,SAAS,GAAGK,KAAK,CAACkF,OAAO;UAAA;UAAA;UAAA;QAAA,QAKzE;MAAA,IAGD1E,KAAK,CAAClB,OAAO,GAAG,CAAC;IAI3B,CAAC,CAAC;IAEF,OAAO;MACLuB,IAAI,EAAEA,CAAA,KAAM;QACVW,QAAQ,CAACJ,KAAK,EAAE+D,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACvE,IAAI,CAAC,CAAC,CAAC;MAC7C,CAAC;MACDD,KAAK,EAAEA,CAAA,KAAM;QACXY,QAAQ,CAACJ,KAAK,GAAG,CAAC,CAAC,CAACR,KAAK,CAAC,CAAC;MAC7B,CAAC;MACD0C,KAAK;MACL3C;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/composables/color.js
CHANGED
|
@@ -38,8 +38,14 @@ export function useBackgroundColor(color) {
|
|
|
38
38
|
backgroundColorStyles
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
+
function normalizeColors(colors) {
|
|
42
|
+
return {
|
|
43
|
+
text: typeof colors.text === 'string' ? colors.text.replace(/^text-/, '') : colors.text,
|
|
44
|
+
background: typeof colors.background === 'string' ? colors.background.replace(/^bg-/, '') : colors.background
|
|
45
|
+
};
|
|
46
|
+
}
|
|
41
47
|
export function computeColor(colors) {
|
|
42
|
-
const _colors = toValue(colors);
|
|
48
|
+
const _colors = normalizeColors(toValue(colors));
|
|
43
49
|
const classes = [];
|
|
44
50
|
const styles = {};
|
|
45
51
|
if (_colors.background) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","names":["toValue","destructComputed","getForeground","isCssColor","isParsableColor","parseColor","useColor","colors","class","colorClasses","style","colorStyles","computeColor","useTextColor","color","textColorClasses","textColorStyles","text","useBackgroundColor","backgroundColorClasses","backgroundColorStyles","background","_colors","classes","styles","backgroundColor","a","textColor","caretColor","push"],"sources":["../../src/composables/color.ts"],"sourcesContent":["// Utilities\nimport { toValue } from 'vue'\nimport { destructComputed, getForeground, isCssColor, isParsableColor, parseColor } from '@/util'\n\n// Types\nimport type { CSSProperties, MaybeRefOrGetter, Ref } from 'vue'\n\nexport type ColorValue = string | false | null | undefined\n\nexport interface TextColorData {\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n}\n\nexport interface BackgroundColorData {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n}\n\n// Composables\nexport function useColor (colors: MaybeRefOrGetter<{ background?: ColorValue, text?: ColorValue }>) {\n return destructComputed(() => {\n const {\n class: colorClasses,\n style: colorStyles,\n } = computeColor(colors)\n\n return { colorClasses, colorStyles }\n })\n}\n\nexport function useTextColor (color: MaybeRefOrGetter<ColorValue>): TextColorData {\n const {\n colorClasses: textColorClasses,\n colorStyles: textColorStyles,\n } = useColor(() => ({\n text: toValue(color),\n }))\n\n return { textColorClasses, textColorStyles }\n}\n\nexport function useBackgroundColor (color: MaybeRefOrGetter<ColorValue>): BackgroundColorData {\n const {\n colorClasses: backgroundColorClasses,\n colorStyles: backgroundColorStyles,\n } = useColor(() => ({\n background: toValue(color),\n }))\n\n return { backgroundColorClasses, backgroundColorStyles }\n}\n\nexport function computeColor (colors: MaybeRefOrGetter<{ background?: ColorValue, text?: ColorValue }>) {\n const _colors = toValue(colors)\n const classes: string[] = []\n const styles: CSSProperties = {}\n\n if (_colors.background) {\n if (isCssColor(_colors.background)) {\n styles.backgroundColor = _colors.background\n\n if (!_colors.text && isParsableColor(_colors.background)) {\n const backgroundColor = parseColor(_colors.background)\n if (backgroundColor.a == null || backgroundColor.a === 1) {\n const textColor = getForeground(backgroundColor)\n\n styles.color = textColor\n styles.caretColor = textColor\n }\n }\n } else {\n classes.push(`bg-${_colors.background}`)\n }\n }\n\n if (_colors.text) {\n if (isCssColor(_colors.text)) {\n styles.color = _colors.text\n styles.caretColor = _colors.text\n } else {\n classes.push(`text-${_colors.text}`)\n }\n }\n\n return { class: classes, style: styles }\n}\n"],"mappings":"AAAA;AACA,SAASA,OAAO,QAAQ,KAAK;AAAA,SACpBC,gBAAgB,EAAEC,aAAa,EAAEC,UAAU,EAAEC,eAAe,EAAEC,UAAU,4BAEjF;AAeA;AACA,OAAO,SAASC,QAAQA,CAAEC,MAAwE,EAAE;EAClG,OAAON,gBAAgB,CAAC,MAAM;IAC5B,MAAM;MACJO,KAAK,EAAEC,YAAY;MACnBC,KAAK,EAAEC;IACT,CAAC,GAAGC,YAAY,CAACL,MAAM,CAAC;IAExB,OAAO;MAAEE,YAAY;MAAEE;IAAY,CAAC;EACtC,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,YAAYA,CAAEC,KAAmC,EAAiB;EAChF,MAAM;IACJL,YAAY,EAAEM,gBAAgB;IAC9BJ,WAAW,EAAEK;EACf,CAAC,GAAGV,QAAQ,CAAC,OAAO;IAClBW,IAAI,EAAEjB,OAAO,CAACc,KAAK;EACrB,CAAC,CAAC,CAAC;EAEH,OAAO;IAAEC,gBAAgB;IAAEC;EAAgB,CAAC;AAC9C;AAEA,OAAO,SAASE,kBAAkBA,CAAEJ,KAAmC,EAAuB;EAC5F,MAAM;IACJL,YAAY,EAAEU,sBAAsB;IACpCR,WAAW,EAAES;EACf,CAAC,GAAGd,QAAQ,CAAC,OAAO;IAClBe,UAAU,EAAErB,OAAO,CAACc,KAAK;EAC3B,CAAC,CAAC,CAAC;EAEH,OAAO;IAAEK,sBAAsB;IAAEC;EAAsB,CAAC;AAC1D;AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"color.js","names":["toValue","destructComputed","getForeground","isCssColor","isParsableColor","parseColor","useColor","colors","class","colorClasses","style","colorStyles","computeColor","useTextColor","color","textColorClasses","textColorStyles","text","useBackgroundColor","backgroundColorClasses","backgroundColorStyles","background","normalizeColors","replace","_colors","classes","styles","backgroundColor","a","textColor","caretColor","push"],"sources":["../../src/composables/color.ts"],"sourcesContent":["// Utilities\nimport { toValue } from 'vue'\nimport { destructComputed, getForeground, isCssColor, isParsableColor, parseColor } from '@/util'\n\n// Types\nimport type { CSSProperties, MaybeRefOrGetter, Ref } from 'vue'\n\nexport type ColorValue = string | false | null | undefined\n\nexport interface TextColorData {\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n}\n\nexport interface BackgroundColorData {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n}\n\n// Composables\nexport function useColor (colors: MaybeRefOrGetter<{ background?: ColorValue, text?: ColorValue }>) {\n return destructComputed(() => {\n const {\n class: colorClasses,\n style: colorStyles,\n } = computeColor(colors)\n\n return { colorClasses, colorStyles }\n })\n}\n\nexport function useTextColor (color: MaybeRefOrGetter<ColorValue>): TextColorData {\n const {\n colorClasses: textColorClasses,\n colorStyles: textColorStyles,\n } = useColor(() => ({\n text: toValue(color),\n }))\n\n return { textColorClasses, textColorStyles }\n}\n\nexport function useBackgroundColor (color: MaybeRefOrGetter<ColorValue>): BackgroundColorData {\n const {\n colorClasses: backgroundColorClasses,\n colorStyles: backgroundColorStyles,\n } = useColor(() => ({\n background: toValue(color),\n }))\n\n return { backgroundColorClasses, backgroundColorStyles }\n}\n\nfunction normalizeColors (colors: { background?: ColorValue, text?: ColorValue }) {\n return {\n text: typeof colors.text === 'string'\n ? colors.text.replace(/^text-/, '')\n : colors.text,\n background: typeof colors.background === 'string'\n ? colors.background.replace(/^bg-/, '')\n : colors.background,\n }\n}\n\nexport function computeColor (colors: MaybeRefOrGetter<{ background?: ColorValue, text?: ColorValue }>) {\n const _colors = normalizeColors(toValue(colors))\n\n const classes: string[] = []\n const styles: CSSProperties = {}\n\n if (_colors.background) {\n if (isCssColor(_colors.background)) {\n styles.backgroundColor = _colors.background\n\n if (!_colors.text && isParsableColor(_colors.background)) {\n const backgroundColor = parseColor(_colors.background)\n if (backgroundColor.a == null || backgroundColor.a === 1) {\n const textColor = getForeground(backgroundColor)\n\n styles.color = textColor\n styles.caretColor = textColor\n }\n }\n } else {\n classes.push(`bg-${_colors.background}`)\n }\n }\n\n if (_colors.text) {\n if (isCssColor(_colors.text)) {\n styles.color = _colors.text\n styles.caretColor = _colors.text\n } else {\n classes.push(`text-${_colors.text}`)\n }\n }\n\n return { class: classes, style: styles }\n}\n"],"mappings":"AAAA;AACA,SAASA,OAAO,QAAQ,KAAK;AAAA,SACpBC,gBAAgB,EAAEC,aAAa,EAAEC,UAAU,EAAEC,eAAe,EAAEC,UAAU,4BAEjF;AAeA;AACA,OAAO,SAASC,QAAQA,CAAEC,MAAwE,EAAE;EAClG,OAAON,gBAAgB,CAAC,MAAM;IAC5B,MAAM;MACJO,KAAK,EAAEC,YAAY;MACnBC,KAAK,EAAEC;IACT,CAAC,GAAGC,YAAY,CAACL,MAAM,CAAC;IAExB,OAAO;MAAEE,YAAY;MAAEE;IAAY,CAAC;EACtC,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,YAAYA,CAAEC,KAAmC,EAAiB;EAChF,MAAM;IACJL,YAAY,EAAEM,gBAAgB;IAC9BJ,WAAW,EAAEK;EACf,CAAC,GAAGV,QAAQ,CAAC,OAAO;IAClBW,IAAI,EAAEjB,OAAO,CAACc,KAAK;EACrB,CAAC,CAAC,CAAC;EAEH,OAAO;IAAEC,gBAAgB;IAAEC;EAAgB,CAAC;AAC9C;AAEA,OAAO,SAASE,kBAAkBA,CAAEJ,KAAmC,EAAuB;EAC5F,MAAM;IACJL,YAAY,EAAEU,sBAAsB;IACpCR,WAAW,EAAES;EACf,CAAC,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F,CAAC,MAAM;MACLJ,OAAO,CAACM,IAAI,CAAC,MAAMP,OAAO,CAACH,UAAU,EAAE,CAAC;IAC1C;EACF;EAEA,IAAIG,OAAO,CAACP,IAAI,EAAE;IAChB,IAAId,UAAU,CAACqB,OAAO,CAACP,IAAI,CAAC,EAAE;MAC5BS,MAAM,CAACZ,KAAK,GAAGU,OAAO,CAACP,IAAI;MAC3BS,MAAM,CAACI,UAAU,GAAGN,OAAO,CAACP,IAAI;IAClC,CAAC,MAAM;MACLQ,OAAO,CAACM,IAAI,CAAC,QAAQP,OAAO,CAACP,IAAI,EAAE,CAAC;IACtC;EACF;EAEA,OAAO;IAAET,KAAK,EAAEiB,OAAO;IAAEf,KAAK,EAAEgB;EAAO,CAAC;AAC1C","ignoreList":[]}
|
package/lib/entry-bundler.js
CHANGED
|
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
|
16
16
|
...options
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
export const version = "3.11.8-dev.2026-02-
|
|
19
|
+
export const version = "3.11.8-dev.2026-02-18";
|
|
20
20
|
createVuetify.version = version;
|
|
21
21
|
export { blueprints, components, directives };
|
|
22
22
|
export * from "./composables/index.js";
|
package/lib/framework.d.ts
CHANGED
|
@@ -2779,7 +2779,7 @@ declare module 'vue' {
|
|
|
2779
2779
|
$children?: VNodeChild
|
|
2780
2780
|
}
|
|
2781
2781
|
export interface GlobalComponents {
|
|
2782
|
-
|
|
2782
|
+
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
2783
2783
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
2784
2784
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
2785
2785
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
@@ -2787,33 +2787,31 @@ declare module 'vue' {
|
|
|
2787
2787
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
2788
2788
|
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
2789
2789
|
VBadge: typeof import('vuetify/components')['VBadge']
|
|
2790
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
2791
|
-
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
2792
|
-
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
2793
2790
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
2794
2791
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
2795
2792
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
2800
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
2801
|
-
VCalendar: typeof import('vuetify/components')['VCalendar']
|
|
2802
|
-
VBanner: typeof import('vuetify/components')['VBanner']
|
|
2803
|
-
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
2804
|
-
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
2805
|
-
VCounter: typeof import('vuetify/components')['VCounter']
|
|
2806
|
-
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
2807
|
-
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
2793
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
2794
|
+
VApp: typeof import('vuetify/components')['VApp']
|
|
2795
|
+
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
2808
2796
|
VCard: typeof import('vuetify/components')['VCard']
|
|
2809
2797
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
2810
2798
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
2811
2799
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
2812
2800
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
2813
2801
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
2814
|
-
|
|
2802
|
+
VCalendar: typeof import('vuetify/components')['VCalendar']
|
|
2803
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
2804
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
2805
|
+
VBtn: typeof import('vuetify/components')['VBtn']
|
|
2806
|
+
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
2807
|
+
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
2808
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
2809
|
+
VBanner: typeof import('vuetify/components')['VBanner']
|
|
2810
|
+
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
2811
|
+
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
2812
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
2815
2813
|
VCode: typeof import('vuetify/components')['VCode']
|
|
2816
|
-
|
|
2814
|
+
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
2817
2815
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
|
2818
2816
|
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
|
2819
2817
|
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
|
@@ -2821,40 +2819,40 @@ declare module 'vue' {
|
|
|
2821
2819
|
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
|
2822
2820
|
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
|
2823
2821
|
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
|
2824
|
-
|
|
2822
|
+
VChip: typeof import('vuetify/components')['VChip']
|
|
2823
|
+
VCounter: typeof import('vuetify/components')['VCounter']
|
|
2825
2824
|
VDivider: typeof import('vuetify/components')['VDivider']
|
|
2826
|
-
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
|
2827
2825
|
VDatePicker: typeof import('vuetify/components')['VDatePicker']
|
|
2828
2826
|
VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
|
|
2829
2827
|
VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
|
|
2830
2828
|
VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
|
|
2831
2829
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
|
2832
2830
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
|
2833
|
-
|
|
2831
|
+
VDialog: typeof import('vuetify/components')['VDialog']
|
|
2832
|
+
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
|
2833
|
+
VFab: typeof import('vuetify/components')['VFab']
|
|
2834
|
+
VFooter: typeof import('vuetify/components')['VFooter']
|
|
2834
2835
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
2835
2836
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
2836
2837
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
2837
2838
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
2838
|
-
VFooter: typeof import('vuetify/components')['VFooter']
|
|
2839
|
-
VHotkey: typeof import('vuetify/components')['VHotkey']
|
|
2840
|
-
VDialog: typeof import('vuetify/components')['VDialog']
|
|
2841
2839
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
2842
|
-
VFab: typeof import('vuetify/components')['VFab']
|
|
2843
2840
|
VField: typeof import('vuetify/components')['VField']
|
|
2844
2841
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
2845
|
-
|
|
2846
|
-
|
|
2842
|
+
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
2843
|
+
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
2847
2844
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
2848
2845
|
VItem: typeof import('vuetify/components')['VItem']
|
|
2849
2846
|
VInput: typeof import('vuetify/components')['VInput']
|
|
2850
|
-
|
|
2851
|
-
VMenu: typeof import('vuetify/components')['VMenu']
|
|
2847
|
+
VImg: typeof import('vuetify/components')['VImg']
|
|
2852
2848
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
2853
2849
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
2854
2850
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
2855
2851
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
|
2856
2852
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
2857
|
-
|
|
2853
|
+
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
2854
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
|
2855
|
+
VMessages: typeof import('vuetify/components')['VMessages']
|
|
2858
2856
|
VList: typeof import('vuetify/components')['VList']
|
|
2859
2857
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
2860
2858
|
VListImg: typeof import('vuetify/components')['VListImg']
|
|
@@ -2864,57 +2862,59 @@ declare module 'vue' {
|
|
|
2864
2862
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
|
2865
2863
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
2866
2864
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
2865
|
+
VHotkey: typeof import('vuetify/components')['VHotkey']
|
|
2867
2866
|
VLabel: typeof import('vuetify/components')['VLabel']
|
|
2867
|
+
VMain: typeof import('vuetify/components')['VMain']
|
|
2868
2868
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
2869
|
-
|
|
2869
|
+
VMenu: typeof import('vuetify/components')['VMenu']
|
|
2870
2870
|
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
2871
|
-
|
|
2872
|
-
|
|
2871
|
+
VNumberInput: typeof import('vuetify/components')['VNumberInput']
|
|
2872
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
2873
2873
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
2874
|
+
VPagination: typeof import('vuetify/components')['VPagination']
|
|
2874
2875
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
2875
|
-
|
|
2876
|
-
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
2877
|
-
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
2878
|
-
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
2876
|
+
VSelect: typeof import('vuetify/components')['VSelect']
|
|
2879
2877
|
VRating: typeof import('vuetify/components')['VRating']
|
|
2878
|
+
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
2880
2879
|
VSlider: typeof import('vuetify/components')['VSlider']
|
|
2881
|
-
VSelect: typeof import('vuetify/components')['VSelect']
|
|
2882
2880
|
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
2883
|
-
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
2884
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
2885
|
-
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
2886
2881
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
2882
|
+
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
2883
|
+
VSheet: typeof import('vuetify/components')['VSheet']
|
|
2884
|
+
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
2885
|
+
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
2886
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
2887
2887
|
VStepper: typeof import('vuetify/components')['VStepper']
|
|
2888
2888
|
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
|
2889
2889
|
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
|
2890
2890
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
|
2891
2891
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
|
2892
2892
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
|
2893
|
-
|
|
2894
|
-
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
2893
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
2895
2894
|
VTab: typeof import('vuetify/components')['VTab']
|
|
2896
2895
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
2897
2896
|
VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
|
|
2898
2897
|
VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
|
|
2899
|
-
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
2900
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
2901
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
|
2902
2898
|
VTable: typeof import('vuetify/components')['VTable']
|
|
2899
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
|
2900
|
+
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
2901
|
+
VTimePicker: typeof import('vuetify/components')['VTimePicker']
|
|
2902
|
+
VTimePickerClock: typeof import('vuetify/components')['VTimePickerClock']
|
|
2903
|
+
VTimePickerControls: typeof import('vuetify/components')['VTimePickerControls']
|
|
2904
|
+
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
2905
|
+
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
2903
2906
|
VTreeview: typeof import('vuetify/components')['VTreeview']
|
|
2904
2907
|
VTreeviewItem: typeof import('vuetify/components')['VTreeviewItem']
|
|
2905
2908
|
VTreeviewGroup: typeof import('vuetify/components')['VTreeviewGroup']
|
|
2906
2909
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
2907
2910
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
2908
2911
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
2909
|
-
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
2910
|
-
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
2911
|
-
VTimePicker: typeof import('vuetify/components')['VTimePicker']
|
|
2912
|
-
VTimePickerClock: typeof import('vuetify/components')['VTimePickerClock']
|
|
2913
|
-
VTimePickerControls: typeof import('vuetify/components')['VTimePickerControls']
|
|
2914
2912
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
2915
2913
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
2916
|
-
|
|
2914
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
2915
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
2917
2916
|
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
2917
|
+
VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
|
|
2918
2918
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
2919
2919
|
VForm: typeof import('vuetify/components')['VForm']
|
|
2920
2920
|
VHover: typeof import('vuetify/components')['VHover']
|
|
@@ -2922,21 +2922,21 @@ declare module 'vue' {
|
|
|
2922
2922
|
VCol: typeof import('vuetify/components')['VCol']
|
|
2923
2923
|
VRow: typeof import('vuetify/components')['VRow']
|
|
2924
2924
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
2925
|
+
VLazy: typeof import('vuetify/components')['VLazy']
|
|
2925
2926
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
2926
2927
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
2927
|
-
|
|
2928
|
+
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
2928
2929
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
2929
2930
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
2930
|
-
VRadio: typeof import('vuetify/components')['VRadio']
|
|
2931
|
-
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
2932
2931
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
2933
|
-
|
|
2934
|
-
|
|
2932
|
+
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
2933
|
+
VRadio: typeof import('vuetify/components')['VRadio']
|
|
2935
2934
|
VSnackbarQueue: typeof import('vuetify/components')['VSnackbarQueue']
|
|
2936
|
-
|
|
2935
|
+
VSparkline: typeof import('vuetify/components')['VSparkline']
|
|
2937
2936
|
VSpeedDial: typeof import('vuetify/components')['VSpeedDial']
|
|
2938
2937
|
VValidation: typeof import('vuetify/components')['VValidation']
|
|
2939
2938
|
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
2939
|
+
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
2940
2940
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
2941
2941
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
2942
2942
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -2955,23 +2955,23 @@ declare module 'vue' {
|
|
|
2955
2955
|
VExpandBothTransition: typeof import('vuetify/components')['VExpandBothTransition']
|
|
2956
2956
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
2957
2957
|
VAvatarGroup: typeof import('vuetify/labs/components')['VAvatarGroup']
|
|
2958
|
-
|
|
2958
|
+
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
|
2959
|
+
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
|
2960
|
+
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
|
2959
2961
|
VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
|
|
2960
2962
|
VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
|
|
2961
|
-
|
|
2962
|
-
VCommandPaletteItemComponent: typeof import('vuetify/labs/components')['VCommandPaletteItemComponent']
|
|
2963
|
+
VColorInput: typeof import('vuetify/labs/components')['VColorInput']
|
|
2963
2964
|
VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
|
|
2964
2965
|
VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
|
|
2965
2966
|
VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
|
|
2967
|
+
VCommandPalette: typeof import('vuetify/labs/components')['VCommandPalette']
|
|
2968
|
+
VCommandPaletteItemComponent: typeof import('vuetify/labs/components')['VCommandPaletteItemComponent']
|
|
2966
2969
|
VPie: typeof import('vuetify/labs/components')['VPie']
|
|
2967
2970
|
VPieSegment: typeof import('vuetify/labs/components')['VPieSegment']
|
|
2968
2971
|
VPieTooltip: typeof import('vuetify/labs/components')['VPieTooltip']
|
|
2969
|
-
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
|
2970
2972
|
VVideo: typeof import('vuetify/labs/components')['VVideo']
|
|
2971
2973
|
VVideoControls: typeof import('vuetify/labs/components')['VVideoControls']
|
|
2972
2974
|
VVideoVolume: typeof import('vuetify/labs/components')['VVideoVolume']
|
|
2973
|
-
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
|
2974
|
-
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
|
2975
2975
|
VDateInput: typeof import('vuetify/labs/components')['VDateInput']
|
|
2976
2976
|
VMaskInput: typeof import('vuetify/labs/components')['VMaskInput']
|
|
2977
2977
|
VPullToRefresh: typeof import('vuetify/labs/components')['VPullToRefresh']
|
package/lib/framework.js
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// @unocss-include
|
|
2
|
+
// Composables
|
|
3
|
+
import { VClassIcon } from "../composables/icons.js"; // Utilities
|
|
4
|
+
import { h } from 'vue';
|
|
5
|
+
|
|
6
|
+
// Types
|
|
7
|
+
|
|
8
|
+
const aliases = {
|
|
9
|
+
collapse: 'i-mdi:chevron-up',
|
|
10
|
+
complete: 'i-mdi:check',
|
|
11
|
+
cancel: 'i-mdi:close-circle',
|
|
12
|
+
close: 'i-mdi:close',
|
|
13
|
+
// delete (e.g. v-chip close)
|
|
14
|
+
delete: 'i-mdi:close-circle',
|
|
15
|
+
clear: 'i-mdi:close-circle',
|
|
16
|
+
success: 'i-mdi:check-circle',
|
|
17
|
+
info: 'i-mdi:information',
|
|
18
|
+
warning: 'i-mdi:alert-circle',
|
|
19
|
+
error: 'i-mdi:close-circle',
|
|
20
|
+
prev: 'i-mdi:chevron-left',
|
|
21
|
+
next: 'i-mdi:chevron-right',
|
|
22
|
+
checkboxOn: 'i-mdi:checkbox-marked',
|
|
23
|
+
checkboxOff: 'i-mdi:checkbox-blank-outline',
|
|
24
|
+
checkboxIndeterminate: 'i-mdi:minus-box',
|
|
25
|
+
delimiter: 'i-mdi:circle',
|
|
26
|
+
// for carousel
|
|
27
|
+
sortAsc: 'i-mdi:arrow-up',
|
|
28
|
+
sortDesc: 'i-mdi:arrow-down',
|
|
29
|
+
expand: 'i-mdi:chevron-down',
|
|
30
|
+
menu: 'i-mdi:menu',
|
|
31
|
+
subgroup: 'i-mdi:menu-down',
|
|
32
|
+
dropdown: 'i-mdi:menu-down',
|
|
33
|
+
radioOn: 'i-mdi:radiobox-marked',
|
|
34
|
+
radioOff: 'i-mdi:radiobox-blank',
|
|
35
|
+
edit: 'i-mdi:pencil',
|
|
36
|
+
ratingEmpty: 'i-mdi:star-outline',
|
|
37
|
+
ratingFull: 'i-mdi:star',
|
|
38
|
+
ratingHalf: 'i-mdi:star-half-full',
|
|
39
|
+
loading: 'i-mdi:cached',
|
|
40
|
+
first: 'i-mdi:page-first',
|
|
41
|
+
last: 'i-mdi:page-last',
|
|
42
|
+
unfold: 'i-mdi:unfold-more-horizontal',
|
|
43
|
+
file: 'i-mdi:paperclip',
|
|
44
|
+
plus: 'i-mdi:plus',
|
|
45
|
+
minus: 'i-mdi:minus',
|
|
46
|
+
calendar: 'i-mdi:calendar',
|
|
47
|
+
treeviewCollapse: 'i-mdi:menu-down',
|
|
48
|
+
treeviewExpand: 'i-mdi:menu-right',
|
|
49
|
+
tableGroupCollapse: 'i-mdi:chevron-down',
|
|
50
|
+
tableGroupExpand: 'i-mdi:chevron-right',
|
|
51
|
+
eyeDropper: 'i-mdi:eyedropper',
|
|
52
|
+
upload: 'i-mdi:cloud-upload',
|
|
53
|
+
color: 'i-mdi:palette',
|
|
54
|
+
command: 'i-mdi:apple-keyboard-command',
|
|
55
|
+
ctrl: 'i-mdi:apple-keyboard-control',
|
|
56
|
+
space: 'i-mdi:keyboard-space',
|
|
57
|
+
shift: 'i-mdi:apple-keyboard-shift',
|
|
58
|
+
alt: 'i-mdi:apple-keyboard-option',
|
|
59
|
+
enter: 'i-mdi:keyboard-return',
|
|
60
|
+
arrowup: 'i-mdi:arrow-up',
|
|
61
|
+
arrowdown: 'i-mdi:arrow-down',
|
|
62
|
+
arrowleft: 'i-mdi:arrow-left',
|
|
63
|
+
arrowright: 'i-mdi:arrow-right',
|
|
64
|
+
backspace: 'i-mdi:backspace',
|
|
65
|
+
play: 'i-mdi:play',
|
|
66
|
+
pause: 'i-mdi:pause',
|
|
67
|
+
fullscreen: 'i-mdi:fullscreen',
|
|
68
|
+
fullscreenExit: 'i-mdi:fullscreen-exit',
|
|
69
|
+
volumeHigh: 'i-mdi:volume-high',
|
|
70
|
+
volumeMedium: 'i-mdi:volume-medium',
|
|
71
|
+
volumeLow: 'i-mdi:volume-low',
|
|
72
|
+
volumeOff: 'i-mdi:volume-variant-off',
|
|
73
|
+
search: 'i-mdi:magnify'
|
|
74
|
+
};
|
|
75
|
+
const mdi = {
|
|
76
|
+
// Not using mergeProps here, functional components merge props by default (?)
|
|
77
|
+
component: props => h(VClassIcon, {
|
|
78
|
+
...props,
|
|
79
|
+
class: 'mdi'
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
export { aliases, mdi };
|
|
83
|
+
//# sourceMappingURL=mdi-unocss.js.map
|