@vuetify/nightly 3.6.1-master.2024-05-01 → 3.6.3-master.2024-05-02
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 +2 -7
- package/dist/json/attributes.json +3 -3
- package/dist/json/importMap-labs.json +24 -24
- package/dist/json/importMap.json +108 -108
- package/dist/json/web-types.json +18 -17
- package/dist/vuetify-labs.css +3322 -3322
- package/dist/vuetify-labs.d.ts +275 -233
- package/dist/vuetify-labs.esm.js +17 -13
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +17 -13
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +397 -397
- package/dist/vuetify.d.ts +318 -276
- package/dist/vuetify.esm.js +17 -13
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +17 -13
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +18 -19
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +18 -18
- package/lib/components/VBottomSheet/index.d.mts +15 -9
- package/lib/components/VCombobox/index.d.mts +18 -18
- package/lib/components/VDataTable/VDataTableHeaders.mjs +2 -0
- package/lib/components/VDataTable/VDataTableHeaders.mjs.map +1 -1
- package/lib/components/VDataTable/composables/select.mjs +7 -8
- package/lib/components/VDataTable/composables/select.mjs.map +1 -1
- package/lib/components/VDialog/index.d.mts +33 -27
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/index.d.mts +6 -6
- package/lib/components/VHover/VHover.mjs +1 -1
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.d.mts +24 -24
- package/lib/components/VMenu/index.d.mts +33 -27
- package/lib/components/VOverlay/VOverlay.mjs +5 -2
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.mts +15 -9
- package/lib/components/VSelect/index.d.mts +18 -18
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.mts +47 -41
- package/lib/components/VSpeedDial/index.d.mts +15 -9
- package/lib/components/VTooltip/index.d.mts +33 -27
- package/lib/components/index.d.mts +275 -233
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +43 -43
- package/lib/labs/VSnackbarQueue/index.d.mts +47 -41
- package/lib/labs/components.d.mts +47 -41
- package/package.json +1 -1
@@ -95,7 +95,7 @@ declare const VDialog: {
|
|
95
95
|
component: Component;
|
96
96
|
};
|
97
97
|
zIndex: NonNullable<string | number>;
|
98
|
-
modelValue: boolean;
|
98
|
+
modelValue: boolean | null;
|
99
99
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
100
100
|
eager: boolean;
|
101
101
|
location: Anchor;
|
@@ -180,7 +180,7 @@ declare const VDialog: {
|
|
180
180
|
component?: Component | undefined;
|
181
181
|
});
|
182
182
|
zIndex: string | number;
|
183
|
-
modelValue: boolean;
|
183
|
+
modelValue: boolean | null;
|
184
184
|
origin: Anchor | "auto" | "overlap";
|
185
185
|
eager: boolean;
|
186
186
|
location: Anchor;
|
@@ -207,7 +207,7 @@ declare const VDialog: {
|
|
207
207
|
component?: Component | undefined;
|
208
208
|
});
|
209
209
|
zIndex: string | number;
|
210
|
-
modelValue: boolean;
|
210
|
+
modelValue: boolean | null;
|
211
211
|
origin: Anchor | "auto" | "overlap";
|
212
212
|
eager: boolean;
|
213
213
|
location: Anchor;
|
@@ -285,7 +285,7 @@ declare const VDialog: {
|
|
285
285
|
component?: Component | undefined;
|
286
286
|
});
|
287
287
|
zIndex: string | number;
|
288
|
-
modelValue: boolean;
|
288
|
+
modelValue: boolean | null;
|
289
289
|
origin: Anchor | "auto" | "overlap";
|
290
290
|
eager: boolean;
|
291
291
|
location: Anchor;
|
@@ -392,7 +392,7 @@ declare const VDialog: {
|
|
392
392
|
component?: Component | undefined;
|
393
393
|
});
|
394
394
|
zIndex: string | number;
|
395
|
-
modelValue: boolean;
|
395
|
+
modelValue: boolean | null;
|
396
396
|
origin: Anchor | "auto" | "overlap";
|
397
397
|
eager: boolean;
|
398
398
|
location: Anchor;
|
@@ -488,7 +488,7 @@ declare const VDialog: {
|
|
488
488
|
component?: Component | undefined;
|
489
489
|
});
|
490
490
|
zIndex: string | number;
|
491
|
-
modelValue: boolean;
|
491
|
+
modelValue: boolean | null;
|
492
492
|
origin: Anchor | "auto" | "overlap";
|
493
493
|
eager: boolean;
|
494
494
|
location: Anchor;
|
@@ -548,7 +548,7 @@ declare const VDialog: {
|
|
548
548
|
component?: Component | undefined;
|
549
549
|
});
|
550
550
|
zIndex: string | number;
|
551
|
-
modelValue: boolean;
|
551
|
+
modelValue: boolean | null;
|
552
552
|
origin: Anchor | "auto" | "overlap";
|
553
553
|
eager: boolean;
|
554
554
|
location: Anchor;
|
@@ -644,7 +644,7 @@ declare const VDialog: {
|
|
644
644
|
component: Component;
|
645
645
|
};
|
646
646
|
zIndex: NonNullable<string | number>;
|
647
|
-
modelValue: boolean;
|
647
|
+
modelValue: boolean | null;
|
648
648
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
649
649
|
eager: boolean;
|
650
650
|
location: Anchor;
|
@@ -728,7 +728,7 @@ declare const VDialog: {
|
|
728
728
|
component: Component;
|
729
729
|
};
|
730
730
|
zIndex: NonNullable<string | number>;
|
731
|
-
modelValue: boolean;
|
731
|
+
modelValue: boolean | null;
|
732
732
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
733
733
|
eager: boolean;
|
734
734
|
location: Anchor;
|
@@ -779,7 +779,7 @@ declare const VDialog: {
|
|
779
779
|
component: Component;
|
780
780
|
};
|
781
781
|
zIndex: NonNullable<string | number>;
|
782
|
-
modelValue: boolean;
|
782
|
+
modelValue: boolean | null;
|
783
783
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
784
784
|
eager: boolean;
|
785
785
|
location: Anchor;
|
@@ -864,7 +864,7 @@ declare const VDialog: {
|
|
864
864
|
component?: Component | undefined;
|
865
865
|
});
|
866
866
|
zIndex: string | number;
|
867
|
-
modelValue: boolean;
|
867
|
+
modelValue: boolean | null;
|
868
868
|
origin: Anchor | "auto" | "overlap";
|
869
869
|
eager: boolean;
|
870
870
|
location: Anchor;
|
@@ -891,7 +891,7 @@ declare const VDialog: {
|
|
891
891
|
component?: Component | undefined;
|
892
892
|
});
|
893
893
|
zIndex: string | number;
|
894
|
-
modelValue: boolean;
|
894
|
+
modelValue: boolean | null;
|
895
895
|
origin: Anchor | "auto" | "overlap";
|
896
896
|
eager: boolean;
|
897
897
|
location: Anchor;
|
@@ -969,7 +969,7 @@ declare const VDialog: {
|
|
969
969
|
component?: Component | undefined;
|
970
970
|
});
|
971
971
|
zIndex: string | number;
|
972
|
-
modelValue: boolean;
|
972
|
+
modelValue: boolean | null;
|
973
973
|
origin: Anchor | "auto" | "overlap";
|
974
974
|
eager: boolean;
|
975
975
|
location: Anchor;
|
@@ -1076,7 +1076,7 @@ declare const VDialog: {
|
|
1076
1076
|
component?: Component | undefined;
|
1077
1077
|
});
|
1078
1078
|
zIndex: string | number;
|
1079
|
-
modelValue: boolean;
|
1079
|
+
modelValue: boolean | null;
|
1080
1080
|
origin: Anchor | "auto" | "overlap";
|
1081
1081
|
eager: boolean;
|
1082
1082
|
location: Anchor;
|
@@ -1172,7 +1172,7 @@ declare const VDialog: {
|
|
1172
1172
|
component?: Component | undefined;
|
1173
1173
|
});
|
1174
1174
|
zIndex: string | number;
|
1175
|
-
modelValue: boolean;
|
1175
|
+
modelValue: boolean | null;
|
1176
1176
|
origin: Anchor | "auto" | "overlap";
|
1177
1177
|
eager: boolean;
|
1178
1178
|
location: Anchor;
|
@@ -1232,7 +1232,7 @@ declare const VDialog: {
|
|
1232
1232
|
component?: Component | undefined;
|
1233
1233
|
});
|
1234
1234
|
zIndex: string | number;
|
1235
|
-
modelValue: boolean;
|
1235
|
+
modelValue: boolean | null;
|
1236
1236
|
origin: Anchor | "auto" | "overlap";
|
1237
1237
|
eager: boolean;
|
1238
1238
|
location: Anchor;
|
@@ -1325,7 +1325,7 @@ declare const VDialog: {
|
|
1325
1325
|
component: Component;
|
1326
1326
|
};
|
1327
1327
|
zIndex: NonNullable<string | number>;
|
1328
|
-
modelValue: boolean;
|
1328
|
+
modelValue: boolean | null;
|
1329
1329
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
1330
1330
|
eager: boolean;
|
1331
1331
|
location: Anchor;
|
@@ -1360,7 +1360,7 @@ declare const VDialog: {
|
|
1360
1360
|
component: Component;
|
1361
1361
|
};
|
1362
1362
|
zIndex: NonNullable<string | number>;
|
1363
|
-
modelValue: boolean;
|
1363
|
+
modelValue: boolean | null;
|
1364
1364
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
1365
1365
|
eager: boolean;
|
1366
1366
|
location: Anchor;
|
@@ -1445,7 +1445,7 @@ declare const VDialog: {
|
|
1445
1445
|
component?: Component | undefined;
|
1446
1446
|
});
|
1447
1447
|
zIndex: string | number;
|
1448
|
-
modelValue: boolean;
|
1448
|
+
modelValue: boolean | null;
|
1449
1449
|
origin: Anchor | "auto" | "overlap";
|
1450
1450
|
eager: boolean;
|
1451
1451
|
location: Anchor;
|
@@ -1472,7 +1472,7 @@ declare const VDialog: {
|
|
1472
1472
|
component?: Component | undefined;
|
1473
1473
|
});
|
1474
1474
|
zIndex: string | number;
|
1475
|
-
modelValue: boolean;
|
1475
|
+
modelValue: boolean | null;
|
1476
1476
|
origin: Anchor | "auto" | "overlap";
|
1477
1477
|
eager: boolean;
|
1478
1478
|
location: Anchor;
|
@@ -1550,7 +1550,7 @@ declare const VDialog: {
|
|
1550
1550
|
component?: Component | undefined;
|
1551
1551
|
});
|
1552
1552
|
zIndex: string | number;
|
1553
|
-
modelValue: boolean;
|
1553
|
+
modelValue: boolean | null;
|
1554
1554
|
origin: Anchor | "auto" | "overlap";
|
1555
1555
|
eager: boolean;
|
1556
1556
|
location: Anchor;
|
@@ -1657,7 +1657,7 @@ declare const VDialog: {
|
|
1657
1657
|
component?: Component | undefined;
|
1658
1658
|
});
|
1659
1659
|
zIndex: string | number;
|
1660
|
-
modelValue: boolean;
|
1660
|
+
modelValue: boolean | null;
|
1661
1661
|
origin: Anchor | "auto" | "overlap";
|
1662
1662
|
eager: boolean;
|
1663
1663
|
location: Anchor;
|
@@ -1753,7 +1753,7 @@ declare const VDialog: {
|
|
1753
1753
|
component?: Component | undefined;
|
1754
1754
|
});
|
1755
1755
|
zIndex: string | number;
|
1756
|
-
modelValue: boolean;
|
1756
|
+
modelValue: boolean | null;
|
1757
1757
|
origin: Anchor | "auto" | "overlap";
|
1758
1758
|
eager: boolean;
|
1759
1759
|
location: Anchor;
|
@@ -1813,7 +1813,7 @@ declare const VDialog: {
|
|
1813
1813
|
component?: Component | undefined;
|
1814
1814
|
});
|
1815
1815
|
zIndex: string | number;
|
1816
|
-
modelValue: boolean;
|
1816
|
+
modelValue: boolean | null;
|
1817
1817
|
origin: Anchor | "auto" | "overlap";
|
1818
1818
|
eager: boolean;
|
1819
1819
|
location: Anchor;
|
@@ -1909,7 +1909,7 @@ declare const VDialog: {
|
|
1909
1909
|
component: Component;
|
1910
1910
|
};
|
1911
1911
|
zIndex: NonNullable<string | number>;
|
1912
|
-
modelValue: boolean;
|
1912
|
+
modelValue: boolean | null;
|
1913
1913
|
origin: NonNullable<Anchor | "auto" | "overlap">;
|
1914
1914
|
eager: boolean;
|
1915
1915
|
location: Anchor;
|
@@ -2032,7 +2032,10 @@ declare const VDialog: {
|
|
2032
2032
|
disabled: BooleanConstructor;
|
2033
2033
|
opacity: (StringConstructor | NumberConstructor)[];
|
2034
2034
|
noClickAnimation: BooleanConstructor;
|
2035
|
-
modelValue:
|
2035
|
+
modelValue: {
|
2036
|
+
type: vue.PropType<boolean | null>;
|
2037
|
+
default: null;
|
2038
|
+
};
|
2036
2039
|
persistent: BooleanConstructor;
|
2037
2040
|
scrim: {
|
2038
2041
|
type: (StringConstructor | BooleanConstructor)[];
|
@@ -2140,7 +2143,10 @@ declare const VDialog: {
|
|
2140
2143
|
disabled: BooleanConstructor;
|
2141
2144
|
opacity: (StringConstructor | NumberConstructor)[];
|
2142
2145
|
noClickAnimation: BooleanConstructor;
|
2143
|
-
modelValue:
|
2146
|
+
modelValue: {
|
2147
|
+
type: vue.PropType<boolean | null>;
|
2148
|
+
default: null;
|
2149
|
+
};
|
2144
2150
|
persistent: BooleanConstructor;
|
2145
2151
|
scrim: {
|
2146
2152
|
type: (StringConstructor | BooleanConstructor)[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VFileInput.mjs","names":["VChip","VCounter","VField","filterFieldProps","makeVFieldProps","makeVInputProps","VInput","useFocus","forwardRefs","useLocale","useProxiedModel","computed","nextTick","ref","watch","callEvent","filterInputAttrs","genericComponent","humanReadableFileSize","propsFactory","useRender","wrapInArray","makeVFileInputProps","chips","Boolean","counter","counterSizeString","type","String","default","counterString","hideInput","multiple","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","Object","props","val","every","clearable","VFileInput","name","inheritAttrs","emits","e","focused","files","setup","_ref","attrs","emit","slots","t","model","isArray","isFocused","focus","blur","base","undefined","totalBytes","value","reduce","bytes","_ref2","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","inputRef","isActive","active","isPlainOrUnderlined","variant","onFocus","document","activeElement","onClickPrepend","click","onControlMousedown","onControlClick","onClear","stopPropagation","newValue","hasModelReset","hasCounter","hasDetails","details","rootAttrs","inputAttrs","_","inputProps","filterProps","fieldProps","_createVNode","_mergeProps","$event","class","style","_ref3","id","isDisabled","isDirty","isReadonly","isValid","_ref4","fieldClass","slotProps","_Fragment","preventDefault","target","selection","text","join","disabled"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport {\n callEvent,\n filterInputAttrs,\n genericComponent,\n humanReadableFileSize,\n propsFactory,\n useRender,\n wrapInArray,\n} 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\nexport type VFileInputSlots = VInputSlots & VFieldSlots & {\n counter: never\n selection: {\n fileNames: string[]\n totalBytes: number\n totalBytesReadable: string\n }\n}\n\nexport const makeVFileInputProps = propsFactory({\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n hideInput: Boolean,\n multiple: Boolean,\n showSize: {\n type: [Boolean, Number, String] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(Number(v))\n )\n },\n },\n\n ...makeVInputProps({ prependIcon: '$file' }),\n\n modelValue: {\n type: [Array, Object] as PropType<File[] | File>,\n default: (props: any) => props.multiple ? [] : null,\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n}, 'VFileInput')\n\nexport const VFileInput = genericComponent<VFileInputSlots>()({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: makeVFileInputProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (files: File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(\n props,\n 'modelValue',\n props.modelValue,\n val => wrapInArray(val),\n val => (props.multiple || Array.isArray(props.modelValue)) ? val : val[0],\n )\n const { isFocused, focus, blur } = useFocus(props)\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n isFocused.value ||\n props.active\n ))\n const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant))\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onClickPrepend (e: MouseEvent) {\n inputRef.value?.click()\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n callEvent(props['onClick:clear'], e)\n })\n }\n\n watch(model, newValue => {\n const hasModelReset = !Array.isArray(newValue) || !newValue.length\n\n if (hasModelReset && inputRef.value) {\n inputRef.value.value = ''\n }\n })\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const { modelValue: _, ...inputProps } = VInput.filterProps(props)\n const fieldProps = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-file-input',\n {\n 'v-file-input--chips': !!props.chips,\n 'v-file-input--hide': props.hideInput,\n 'v-input--plain-underlined': isPlainOrUnderlined.value,\n },\n props.class,\n ]}\n style={ props.style }\n onClick:prepend={ onClickPrepend }\n { ...rootAttrs }\n { ...inputProps }\n centerAffix={ !isPlainOrUnderlined.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n if (isReadonly.value) e.preventDefault()\n\n onFocus()\n }}\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n }}\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n <div class={ fieldClass }>\n { !!model.value?.length && !props.hideInput && (\n slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n text={ text }\n />\n ))\n : fileNames.value.join(', ')\n )}\n </div>\n </>\n ),\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ !!model.value?.length }\n value={ counterValue.value }\n disabled={ props.disabled }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,QAAQ;AAAA,SACRC,MAAM;AAAA,SACNC,gBAAgB,EAAEC,eAAe;AAAA,SACjCC,eAAe,EAAEC,MAAM,gCAEhC;AAAA,SACSC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAElDC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AAcA,OAAO,MAAMC,mBAAmB,GAAGH,YAAY,CAAC;EAC9CI,KAAK,EAAEC,OAAO;EACdC,OAAO,EAAED,OAAO;EAChBE,iBAAiB,EAAE;IACjBC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,aAAa,EAAE;IACbH,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDE,SAAS,EAAEP,OAAO;EAClBQ,QAAQ,EAAER,OAAO;EACjBS,QAAQ,EAAE;IACRN,IAAI,EAAE,CAACH,OAAO,EAAEU,MAAM,EAAEN,MAAM,CAAoC;IAClEC,OAAO,EAAE,KAAK;IACdM,SAAS,EAAGC,CAAmB,IAAK;MAClC,OACE,OAAOA,CAAC,KAAK,SAAS,IACtB,CAAC,IAAI,EAAE,IA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QAAA;UAAA,UAKG,CAAC,CAAC0D,KAAK,CAACQ,KAAK,EAAEW,MAAM;UAAA,SACtBF,YAAY,CAACT,KAAK;UAAA,YACfzB,KAAK,CAACoF;QAAQ,GACPrE,KAAK,CAAChC,OAAO,GAGpC,EAEJ,GAAGwC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOzD,WAAW,CAAC,CAAC,CAAC,EAAEuE,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VFileInput.mjs","names":["VChip","VCounter","VField","filterFieldProps","makeVFieldProps","makeVInputProps","VInput","useFocus","forwardRefs","useLocale","useProxiedModel","computed","nextTick","ref","watch","callEvent","filterInputAttrs","genericComponent","humanReadableFileSize","propsFactory","useRender","wrapInArray","makeVFileInputProps","chips","Boolean","counter","counterSizeString","type","String","default","counterString","hideInput","multiple","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","Object","props","val","every","clearable","VFileInput","name","inheritAttrs","emits","e","focused","files","setup","_ref","attrs","emit","slots","t","model","isArray","isFocused","focus","blur","base","undefined","totalBytes","value","reduce","bytes","_ref2","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","inputRef","isActive","active","isPlainOrUnderlined","variant","onFocus","document","activeElement","onClickPrepend","click","onControlMousedown","onControlClick","onClear","stopPropagation","newValue","hasModelReset","hasCounter","hasDetails","details","rootAttrs","inputAttrs","_","inputProps","filterProps","fieldProps","_createVNode","_mergeProps","$event","class","style","_ref3","id","isDisabled","isDirty","isReadonly","isValid","_ref4","fieldClass","slotProps","_Fragment","preventDefault","target","selection","text","join","disabled"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport {\n callEvent,\n filterInputAttrs,\n genericComponent,\n humanReadableFileSize,\n propsFactory,\n useRender,\n wrapInArray,\n} 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\nexport type VFileInputSlots = VInputSlots & VFieldSlots & {\n counter: never\n selection: {\n fileNames: string[]\n totalBytes: number\n totalBytesReadable: string\n }\n}\n\nexport const makeVFileInputProps = propsFactory({\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n hideInput: Boolean,\n multiple: Boolean,\n showSize: {\n type: [Boolean, Number, String] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(Number(v))\n )\n },\n },\n\n ...makeVInputProps({ prependIcon: '$file' }),\n\n modelValue: {\n type: [Array, Object] as PropType<File[] | File>,\n default: (props: any) => props.multiple ? [] : null,\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n}, 'VFileInput')\n\nexport const VFileInput = genericComponent<VFileInputSlots>()({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: makeVFileInputProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (files: File | File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(\n props,\n 'modelValue',\n props.modelValue,\n val => wrapInArray(val),\n val => (props.multiple || Array.isArray(props.modelValue)) ? val : val[0],\n )\n const { isFocused, focus, blur } = useFocus(props)\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n isFocused.value ||\n props.active\n ))\n const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant))\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onClickPrepend (e: MouseEvent) {\n inputRef.value?.click()\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n callEvent(props['onClick:clear'], e)\n })\n }\n\n watch(model, newValue => {\n const hasModelReset = !Array.isArray(newValue) || !newValue.length\n\n if (hasModelReset && inputRef.value) {\n inputRef.value.value = ''\n }\n })\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const { modelValue: _, ...inputProps } = VInput.filterProps(props)\n const fieldProps = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-file-input',\n {\n 'v-file-input--chips': !!props.chips,\n 'v-file-input--hide': props.hideInput,\n 'v-input--plain-underlined': isPlainOrUnderlined.value,\n },\n props.class,\n ]}\n style={ props.style }\n onClick:prepend={ onClickPrepend }\n { ...rootAttrs }\n { ...inputProps }\n centerAffix={ !isPlainOrUnderlined.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n if (isReadonly.value) e.preventDefault()\n\n onFocus()\n }}\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n }}\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n <div class={ fieldClass }>\n { !!model.value?.length && !props.hideInput && (\n slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n text={ text }\n />\n ))\n : fileNames.value.join(', ')\n )}\n </div>\n </>\n ),\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ !!model.value?.length }\n value={ counterValue.value }\n disabled={ props.disabled }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,QAAQ;AAAA,SACRC,MAAM;AAAA,SACNC,gBAAgB,EAAEC,eAAe;AAAA,SACjCC,eAAe,EAAEC,MAAM,gCAEhC;AAAA,SACSC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAElDC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AAcA,OAAO,MAAMC,mBAAmB,GAAGH,YAAY,CAAC;EAC9CI,KAAK,EAAEC,OAAO;EACdC,OAAO,EAAED,OAAO;EAChBE,iBAAiB,EAAE;IACjBC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,aAAa,EAAE;IACbH,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDE,SAAS,EAAEP,OAAO;EAClBQ,QAAQ,EAAER,OAAO;EACjBS,QAAQ,EAAE;IACRN,IAAI,EAAE,CAACH,OAAO,EAAEU,MAAM,EAAEN,MAAM,CAAoC;IAClEC,OAAO,EAAE,KAAK;IACdM,SAAS,EAAGC,CAAmB,IAAK;MAClC,OACE,OAAOA,CAAC,KAAK,SAAS,IACtB,CAAC,IAAI,EAAE,IAAI,CAAC,CAACC,QAAQ,CAACH,MAAM,CAACE,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ACQ,KAAK,EAAEW,MAAM;UAAA,SACtBF,YAAY,CAACT,KAAK;UAAA,YACfzB,KAAK,CAACoF;QAAQ,GACPrE,KAAK,CAAChC,OAAO,GAGpC,EAEJ,GAAGwC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOzD,WAAW,CAAC,CAAC,CAAC,EAAEuE,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -212,7 +212,7 @@ declare const VFileInput: {
|
|
212
212
|
}) => vue.VNodeChild) | undefined;
|
213
213
|
} & {
|
214
214
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
215
|
-
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
215
|
+
"onUpdate:modelValue"?: ((files: File | File[]) => any) | undefined;
|
216
216
|
"onClick:control"?: ((e: MouseEvent) => any) | undefined;
|
217
217
|
"onMousedown:control"?: ((e: MouseEvent) => any) | undefined;
|
218
218
|
}, HTMLInputElement & Omit<Omit<{
|
@@ -464,7 +464,7 @@ declare const VFileInput: {
|
|
464
464
|
'click:control': (e: MouseEvent) => true;
|
465
465
|
'mousedown:control': (e: MouseEvent) => true;
|
466
466
|
'update:focused': (focused: boolean) => true;
|
467
|
-
'update:modelValue': (files: File[]) => true;
|
467
|
+
'update:modelValue': (files: File | File[]) => true;
|
468
468
|
}, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
469
469
|
reverse: boolean;
|
470
470
|
flat: boolean;
|
@@ -597,7 +597,7 @@ declare const VFileInput: {
|
|
597
597
|
}) => vue.VNodeChild) | undefined;
|
598
598
|
} & {
|
599
599
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
600
|
-
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
600
|
+
"onUpdate:modelValue"?: ((files: File | File[]) => any) | undefined;
|
601
601
|
"onClick:control"?: ((e: MouseEvent) => any) | undefined;
|
602
602
|
"onMousedown:control"?: ((e: MouseEvent) => any) | undefined;
|
603
603
|
}, {
|
@@ -820,7 +820,7 @@ declare const VFileInput: {
|
|
820
820
|
}) => vue.VNodeChild) | undefined;
|
821
821
|
} & {
|
822
822
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
823
|
-
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
823
|
+
"onUpdate:modelValue"?: ((files: File | File[]) => any) | undefined;
|
824
824
|
"onClick:control"?: ((e: MouseEvent) => any) | undefined;
|
825
825
|
"onMousedown:control"?: ((e: MouseEvent) => any) | undefined;
|
826
826
|
}, HTMLInputElement & Omit<Omit<{
|
@@ -1239,7 +1239,7 @@ declare const VFileInput: {
|
|
1239
1239
|
}) => vue.VNodeChild) | undefined;
|
1240
1240
|
} & {
|
1241
1241
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
1242
|
-
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
1242
|
+
"onUpdate:modelValue"?: ((files: File | File[]) => any) | undefined;
|
1243
1243
|
"onClick:control"?: ((e: MouseEvent) => any) | undefined;
|
1244
1244
|
"onMousedown:control"?: ((e: MouseEvent) => any) | undefined;
|
1245
1245
|
}, HTMLInputElement & Omit<Omit<{
|
@@ -1491,7 +1491,7 @@ declare const VFileInput: {
|
|
1491
1491
|
'click:control': (e: MouseEvent) => true;
|
1492
1492
|
'mousedown:control': (e: MouseEvent) => true;
|
1493
1493
|
'update:focused': (focused: boolean) => true;
|
1494
|
-
'update:modelValue': (files: File[]) => true;
|
1494
|
+
'update:modelValue': (files: File | File[]) => true;
|
1495
1495
|
}, string, {
|
1496
1496
|
reverse: boolean;
|
1497
1497
|
flat: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VHover.mjs","names":["makeDelayProps","useDelay","useProxiedModel","genericComponent","propsFactory","makeVHoverProps","disabled","Boolean","modelValue","type","default","
|
1
|
+
{"version":3,"file":"VHover.mjs","names":["makeDelayProps","useDelay","useProxiedModel","genericComponent","propsFactory","makeVHoverProps","disabled","Boolean","modelValue","type","default","VHover","name","props","emits","value","setup","_ref","slots","isHovering","runOpenDelay","runCloseDelay","onMouseenter","onMouseleave"],"sources":["../../../src/components/VHover/VHover.tsx"],"sourcesContent":["// Composables\nimport { makeDelayProps, useDelay } from '@/composables/delay'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { genericComponent, propsFactory } from '@/util'\n\ntype VHoverSlots = {\n default: {\n isHovering: boolean | null\n props: Record<string, unknown>\n }\n}\n\nexport const makeVHoverProps = propsFactory({\n disabled: Boolean,\n modelValue: {\n type: Boolean,\n default: null,\n },\n\n ...makeDelayProps(),\n}, 'VHover')\n\nexport const VHover = genericComponent<VHoverSlots>()({\n name: 'VHover',\n\n props: makeVHoverProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isHovering = useProxiedModel(props, 'modelValue')\n const { runOpenDelay, runCloseDelay } = useDelay(props, value => !props.disabled && (isHovering.value = value))\n\n return () => slots.default?.({\n isHovering: isHovering.value,\n props: {\n onMouseenter: runOpenDelay,\n onMouseleave: runCloseDelay,\n },\n })\n },\n})\n\nexport type VHover = InstanceType<typeof VHover>\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,QAAQ;AAAA,SACxBC,eAAe,8CAExB;AAAA,SACSC,gBAAgB,EAAEC,YAAY;AASvC,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,QAAQ,EAAEC,OAAO;EACjBC,UAAU,EAAE;IACVC,IAAI,EAAEF,OAAO;IACbG,OAAO,EAAE;EACX,CAAC;EAED,GAAGV,cAAc,CAAC;AACpB,CAAC,EAAE,QAAQ,CAAC;AAEZ,OAAO,MAAMW,MAAM,GAAGR,gBAAgB,CAAc,CAAC,CAAC;EACpDS,IAAI,EAAE,QAAQ;EAEdC,KAAK,EAAER,eAAe,CAAC,CAAC;EAExBS,KAAK,EAAE;IACL,mBAAmB,EAAGC,KAAc,IAAK;EAC3C,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAME,UAAU,GAAGjB,eAAe,CAACW,KAAK,EAAE,YAAY,CAAC;IACvD,MAAM;MAAEO,YAAY;MAAEC;IAAc,CAAC,GAAGpB,QAAQ,CAACY,KAAK,EAAEE,KAAK,IAAI,CAACF,KAAK,CAACP,QAAQ,KAAKa,UAAU,CAACJ,KAAK,GAAGA,KAAK,CAAC,CAAC;IAE/G,OAAO,MAAMG,KAAK,CAACR,OAAO,GAAG;MAC3BS,UAAU,EAAEA,UAAU,CAACJ,KAAK;MAC5BF,KAAK,EAAE;QACLS,YAAY,EAAEF,YAAY;QAC1BG,YAAY,EAAEF;MAChB;IACF,CAAC,CAAC;EACJ;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -8,29 +8,29 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
|
|
8
8
|
declare const VHover: {
|
9
9
|
new (...args: any[]): vue.CreateComponentPublicInstance<{
|
10
10
|
disabled: boolean;
|
11
|
+
modelValue: boolean;
|
11
12
|
} & {
|
12
|
-
modelValue?: boolean | undefined;
|
13
13
|
closeDelay?: string | number | undefined;
|
14
14
|
openDelay?: string | number | undefined;
|
15
15
|
} & {
|
16
16
|
$children?: vue.VNodeChild | {
|
17
17
|
default?: ((arg: {
|
18
|
-
isHovering: boolean |
|
18
|
+
isHovering: boolean | null;
|
19
19
|
props: Record<string, unknown>;
|
20
20
|
}) => vue.VNodeChild) | undefined;
|
21
21
|
} | ((arg: {
|
22
|
-
isHovering: boolean |
|
22
|
+
isHovering: boolean | null;
|
23
23
|
props: Record<string, unknown>;
|
24
24
|
}) => vue.VNodeChild);
|
25
25
|
'v-slots'?: {
|
26
26
|
default?: false | ((arg: {
|
27
|
-
isHovering: boolean |
|
27
|
+
isHovering: boolean | null;
|
28
28
|
props: Record<string, unknown>;
|
29
29
|
}) => vue.VNodeChild) | undefined;
|
30
30
|
} | undefined;
|
31
31
|
} & {
|
32
32
|
"v-slot:default"?: false | ((arg: {
|
33
|
-
isHovering: boolean |
|
33
|
+
isHovering: boolean | null;
|
34
34
|
props: Record<string, unknown>;
|
35
35
|
}) => vue.VNodeChild) | undefined;
|
36
36
|
} & {
|
@@ -41,29 +41,29 @@ declare const VHover: {
|
|
41
41
|
'update:modelValue': (value: boolean) => true;
|
42
42
|
}, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
43
43
|
disabled: boolean;
|
44
|
+
modelValue: boolean;
|
44
45
|
} & {
|
45
|
-
modelValue?: boolean | undefined;
|
46
46
|
closeDelay?: string | number | undefined;
|
47
47
|
openDelay?: string | number | undefined;
|
48
48
|
} & {
|
49
49
|
$children?: vue.VNodeChild | {
|
50
50
|
default?: ((arg: {
|
51
|
-
isHovering: boolean |
|
51
|
+
isHovering: boolean | null;
|
52
52
|
props: Record<string, unknown>;
|
53
53
|
}) => vue.VNodeChild) | undefined;
|
54
54
|
} | ((arg: {
|
55
|
-
isHovering: boolean |
|
55
|
+
isHovering: boolean | null;
|
56
56
|
props: Record<string, unknown>;
|
57
57
|
}) => vue.VNodeChild);
|
58
58
|
'v-slots'?: {
|
59
59
|
default?: false | ((arg: {
|
60
|
-
isHovering: boolean |
|
60
|
+
isHovering: boolean | null;
|
61
61
|
props: Record<string, unknown>;
|
62
62
|
}) => vue.VNodeChild) | undefined;
|
63
63
|
} | undefined;
|
64
64
|
} & {
|
65
65
|
"v-slot:default"?: false | ((arg: {
|
66
|
-
isHovering: boolean |
|
66
|
+
isHovering: boolean | null;
|
67
67
|
props: Record<string, unknown>;
|
68
68
|
}) => vue.VNodeChild) | undefined;
|
69
69
|
} & {
|
@@ -73,7 +73,7 @@ declare const VHover: {
|
|
73
73
|
modelValue: boolean;
|
74
74
|
}, true, {}, vue.SlotsType<Partial<{
|
75
75
|
default: (arg: {
|
76
|
-
isHovering: boolean |
|
76
|
+
isHovering: boolean | null;
|
77
77
|
props: Record<string, unknown>;
|
78
78
|
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
79
79
|
[key: string]: any;
|
@@ -87,29 +87,29 @@ declare const VHover: {
|
|
87
87
|
Defaults: {};
|
88
88
|
}, {
|
89
89
|
disabled: boolean;
|
90
|
+
modelValue: boolean;
|
90
91
|
} & {
|
91
|
-
modelValue?: boolean | undefined;
|
92
92
|
closeDelay?: string | number | undefined;
|
93
93
|
openDelay?: string | number | undefined;
|
94
94
|
} & {
|
95
95
|
$children?: vue.VNodeChild | {
|
96
96
|
default?: ((arg: {
|
97
|
-
isHovering: boolean |
|
97
|
+
isHovering: boolean | null;
|
98
98
|
props: Record<string, unknown>;
|
99
99
|
}) => vue.VNodeChild) | undefined;
|
100
100
|
} | ((arg: {
|
101
|
-
isHovering: boolean |
|
101
|
+
isHovering: boolean | null;
|
102
102
|
props: Record<string, unknown>;
|
103
103
|
}) => vue.VNodeChild);
|
104
104
|
'v-slots'?: {
|
105
105
|
default?: false | ((arg: {
|
106
|
-
isHovering: boolean |
|
106
|
+
isHovering: boolean | null;
|
107
107
|
props: Record<string, unknown>;
|
108
108
|
}) => vue.VNodeChild) | undefined;
|
109
109
|
} | undefined;
|
110
110
|
} & {
|
111
111
|
"v-slot:default"?: false | ((arg: {
|
112
|
-
isHovering: boolean |
|
112
|
+
isHovering: boolean | null;
|
113
113
|
props: Record<string, unknown>;
|
114
114
|
}) => vue.VNodeChild) | undefined;
|
115
115
|
} & {
|
@@ -125,29 +125,29 @@ declare const VHover: {
|
|
125
125
|
__isSuspense?: undefined;
|
126
126
|
} & vue.ComponentOptionsBase<{
|
127
127
|
disabled: boolean;
|
128
|
+
modelValue: boolean;
|
128
129
|
} & {
|
129
|
-
modelValue?: boolean | undefined;
|
130
130
|
closeDelay?: string | number | undefined;
|
131
131
|
openDelay?: string | number | undefined;
|
132
132
|
} & {
|
133
133
|
$children?: vue.VNodeChild | {
|
134
134
|
default?: ((arg: {
|
135
|
-
isHovering: boolean |
|
135
|
+
isHovering: boolean | null;
|
136
136
|
props: Record<string, unknown>;
|
137
137
|
}) => vue.VNodeChild) | undefined;
|
138
138
|
} | ((arg: {
|
139
|
-
isHovering: boolean |
|
139
|
+
isHovering: boolean | null;
|
140
140
|
props: Record<string, unknown>;
|
141
141
|
}) => vue.VNodeChild);
|
142
142
|
'v-slots'?: {
|
143
143
|
default?: false | ((arg: {
|
144
|
-
isHovering: boolean |
|
144
|
+
isHovering: boolean | null;
|
145
145
|
props: Record<string, unknown>;
|
146
146
|
}) => vue.VNodeChild) | undefined;
|
147
147
|
} | undefined;
|
148
148
|
} & {
|
149
149
|
"v-slot:default"?: false | ((arg: {
|
150
|
-
isHovering: boolean |
|
150
|
+
isHovering: boolean | null;
|
151
151
|
props: Record<string, unknown>;
|
152
152
|
}) => vue.VNodeChild) | undefined;
|
153
153
|
} & {
|
@@ -161,7 +161,7 @@ declare const VHover: {
|
|
161
161
|
modelValue: boolean;
|
162
162
|
}, {}, string, vue.SlotsType<Partial<{
|
163
163
|
default: (arg: {
|
164
|
-
isHovering: boolean |
|
164
|
+
isHovering: boolean | null;
|
165
165
|
props: Record<string, unknown>;
|
166
166
|
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
167
167
|
[key: string]: any;
|
@@ -172,7 +172,7 @@ declare const VHover: {
|
|
172
172
|
disabled: BooleanConstructor;
|
173
173
|
modelValue: {
|
174
174
|
type: BooleanConstructor;
|
175
|
-
default:
|
175
|
+
default: null;
|
176
176
|
};
|
177
177
|
}, vue.ExtractPropTypes<{
|
178
178
|
closeDelay: (StringConstructor | NumberConstructor)[];
|
@@ -180,7 +180,7 @@ declare const VHover: {
|
|
180
180
|
disabled: BooleanConstructor;
|
181
181
|
modelValue: {
|
182
182
|
type: BooleanConstructor;
|
183
|
-
default:
|
183
|
+
default: null;
|
184
184
|
};
|
185
185
|
}>>;
|
186
186
|
type VHover = InstanceType<typeof VHover>;
|