vuetify 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json/attributes.json +1860 -1856
- package/dist/json/importMap.json +140 -140
- package/dist/json/tags.json +1 -0
- package/dist/json/web-types.json +3641 -3631
- package/dist/vuetify-labs.css +1393 -1386
- package/dist/vuetify-labs.d.ts +1936 -9147
- package/dist/vuetify-labs.esm.js +91 -79
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +91 -79
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +940 -933
- package/dist/vuetify.d.ts +2081 -9282
- package/dist/vuetify.esm.js +91 -79
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +91 -79
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +67 -66
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.mts +0 -2
- package/lib/blueprints/md1.d.mts +0 -2
- package/lib/blueprints/md2.d.mts +0 -2
- package/lib/blueprints/md3.d.mts +0 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +3 -3
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +74 -98
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.mts +44 -69
- package/lib/components/VBtn/VBtn.mjs +1 -1
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/index.d.mts +11 -11
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.mts +45 -71
- package/lib/components/VCarousel/VCarousel.mjs +1 -1
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/index.d.mts +73 -513
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +100 -482
- package/lib/components/VChip/index.d.mts +15 -18
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +49 -189
- package/lib/components/VCombobox/VCombobox.mjs +3 -3
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +74 -98
- package/lib/components/VDataIterator/index.d.mts +8 -6
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableRow.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableVirtual.mjs +2 -1
- package/lib/components/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/components/VDataTable/composables/items.mjs.map +1 -1
- package/lib/components/VDataTable/composables/paginate.mjs.map +1 -1
- package/lib/components/VDataTable/composables/select.mjs.map +1 -1
- package/lib/components/VDataTable/index.d.mts +411 -4142
- package/lib/components/VDataTable/types.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.css +4 -0
- package/lib/components/VDatePicker/VDatePicker.mjs +29 -22
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.sass +4 -0
- package/lib/components/VDatePicker/VDatePickerMonth.mjs +3 -1
- package/lib/components/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.d.mts +32 -36
- package/lib/components/VDialog/VDialog.css +4 -1
- package/lib/components/VDialog/VDialog.sass +4 -3
- package/lib/components/VField/VField.mjs +1 -1
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/index.d.mts +33 -41
- package/lib/components/VFileInput/index.d.mts +144 -385
- package/lib/components/VImg/VImg.mjs +10 -2
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VInput/VInput.mjs +1 -1
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.mts +72 -154
- package/lib/components/VItemGroup/VItemGroup.mjs +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +49 -189
- package/lib/components/VList/VList.mjs +2 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/index.d.mts +58 -95
- package/lib/components/VOtpInput/index.d.mts +8 -11
- package/lib/components/VRadio/index.d.mts +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +77 -211
- package/lib/components/VRangeSlider/index.d.mts +22 -25
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +67 -91
- package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +9 -18
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/index.d.mts +46 -68
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.mts +47 -101
- package/lib/components/VSlider/index.d.mts +22 -25
- package/lib/components/VSwitch/VSwitch.mjs +7 -5
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.mts +90 -303
- package/lib/components/VTextField/index.d.mts +173 -451
- package/lib/components/VTextarea/index.d.mts +144 -385
- package/lib/components/VValidation/VValidation.mjs +2 -2
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.mts +88 -359
- package/lib/components/VWindow/VWindow.mjs +1 -1
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/index.d.mts +58 -245
- package/lib/components/index.d.mts +1933 -9130
- package/lib/composables/date/DateAdapter.mjs.map +1 -1
- package/lib/composables/date/adapters/vuetify.mjs +1 -13
- package/lib/composables/date/adapters/vuetify.mjs.map +1 -1
- package/lib/composables/date/date.mjs +1 -1
- package/lib/composables/date/date.mjs.map +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/virtual.mjs +11 -13
- package/lib/composables/virtual.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +40 -44
- package/lib/labs/VConfirmEdit/index.d.mts +0 -10
- package/lib/labs/components.d.mts +0 -10
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -7,8 +7,8 @@ import { makeVResponsiveProps, VResponsive } from "../VResponsive/VResponsive.mj
|
|
|
7
7
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
8
8
|
import { makeTransitionProps, MaybeTransition } from "../../composables/transition.mjs"; // Directives
|
|
9
9
|
import intersect from "../../directives/intersect/index.mjs"; // Utilities
|
|
10
|
-
import { computed, nextTick, onBeforeMount, ref, shallowRef, vShow, watch, withDirectives } from 'vue';
|
|
11
|
-
import { convertToUnit, genericComponent, propsFactory, SUPPORTS_INTERSECTION, useRender } from "../../util/index.mjs"; // Types
|
|
10
|
+
import { computed, nextTick, onBeforeMount, onBeforeUnmount, ref, shallowRef, vShow, watch, withDirectives } from 'vue';
|
|
11
|
+
import { convertToUnit, genericComponent, getCurrentInstance, propsFactory, SUPPORTS_INTERSECTION, useRender } from "../../util/index.mjs"; // Types
|
|
12
12
|
export const makeVImgProps = propsFactory({
|
|
13
13
|
alt: String,
|
|
14
14
|
cover: Boolean,
|
|
@@ -58,6 +58,7 @@ export const VImg = genericComponent()({
|
|
|
58
58
|
emit,
|
|
59
59
|
slots
|
|
60
60
|
} = _ref;
|
|
61
|
+
const vm = getCurrentInstance('VImg');
|
|
61
62
|
const currentSrc = shallowRef(''); // Set from srcset
|
|
62
63
|
const image = ref();
|
|
63
64
|
const state = shallowRef(props.eager ? 'loading' : 'idle');
|
|
@@ -104,6 +105,7 @@ export const VImg = genericComponent()({
|
|
|
104
105
|
nextTick(() => {
|
|
105
106
|
emit('loadstart', image.value?.currentSrc || normalisedSrc.value.src);
|
|
106
107
|
setTimeout(() => {
|
|
108
|
+
if (vm.isUnmounted) return;
|
|
107
109
|
if (image.value?.complete) {
|
|
108
110
|
if (!image.value.naturalWidth) {
|
|
109
111
|
onError();
|
|
@@ -119,12 +121,14 @@ export const VImg = genericComponent()({
|
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
123
|
function onLoad() {
|
|
124
|
+
if (vm.isUnmounted) return;
|
|
122
125
|
getSrc();
|
|
123
126
|
pollForSize(image.value);
|
|
124
127
|
state.value = 'loaded';
|
|
125
128
|
emit('load', image.value?.currentSrc || normalisedSrc.value.src);
|
|
126
129
|
}
|
|
127
130
|
function onError() {
|
|
131
|
+
if (vm.isUnmounted) return;
|
|
128
132
|
state.value = 'error';
|
|
129
133
|
emit('error', image.value?.currentSrc || normalisedSrc.value.src);
|
|
130
134
|
}
|
|
@@ -133,10 +137,14 @@ export const VImg = genericComponent()({
|
|
|
133
137
|
if (img) currentSrc.value = img.currentSrc || img.src;
|
|
134
138
|
}
|
|
135
139
|
let timer = -1;
|
|
140
|
+
onBeforeUnmount(() => {
|
|
141
|
+
clearTimeout(timer);
|
|
142
|
+
});
|
|
136
143
|
function pollForSize(img) {
|
|
137
144
|
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
138
145
|
const poll = () => {
|
|
139
146
|
clearTimeout(timer);
|
|
147
|
+
if (vm.isUnmounted) return;
|
|
140
148
|
const {
|
|
141
149
|
naturalHeight: imgHeight,
|
|
142
150
|
naturalWidth: imgWidth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VImg.mjs","names":["makeVResponsiveProps","VResponsive","makeComponentProps","makeTransitionProps","MaybeTransition","intersect","computed","nextTick","onBeforeMount","ref","shallowRef","vShow","watch","withDirectives","convertToUnit","genericComponent","propsFactory","SUPPORTS_INTERSECTION","useRender","makeVImgProps","alt","String","cover","Boolean","draggable","type","default","undefined","eager","gradient","lazySrc","options","Object","root","rootMargin","threshold","sizes","src","crossorigin","referrerpolicy","srcset","position","VImg","name","directives","props","emits","loadstart","value","load","error","setup","_ref","emit","slots","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","Number","aspectRatio","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","setTimeout","complete","onError","onLoad","getSrc","img","timer","timeout","arguments","length","poll","clearTimeout","imgHeight","imgWidth","window","endsWith","startsWith","containClasses","__image","_createVNode","objectPosition","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","responsiveProps","filterProps","_withDirectives","_mergeProps","class","width","style","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["// Styles\nimport './VImg.sass'\n\n// Components\nimport { makeVResponsiveProps, VResponsive } from '@/components/VResponsive/VResponsive'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n ref,\n shallowRef,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n propsFactory,\n SUPPORTS_INTERSECTION,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src?: string\n srcset?: string\n lazySrc?: string\n aspect: number\n}\n\nexport type VImgSlots = {\n default: never\n placeholder: never\n error: never\n sources: never\n}\n\nexport const makeVImgProps = propsFactory({\n alt: String,\n cover: Boolean,\n draggable: {\n type: [Boolean, String] as PropType<boolean | 'true' | 'false'>,\n default: undefined,\n },\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object as PropType<IntersectionObserverInit>,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n },\n sizes: String,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n crossorigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,\n referrerpolicy: String as PropType<\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url'\n >,\n srcset: String,\n position: String,\n\n ...makeVResponsiveProps(),\n ...makeComponentProps(),\n ...makeTransitionProps(),\n}, 'VImg')\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: makeVImgProps(),\n\n emits: {\n loadstart: (value: string | undefined) => true,\n load: (value: string | undefined) => true,\n error: (value: string | undefined) => true,\n },\n\n setup (props, { emit, slots }) {\n const currentSrc = shallowRef('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = shallowRef<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = shallowRef<number>()\n const naturalHeight = shallowRef<number>()\n\n const normalisedSrc = computed<srcObject>(() => {\n return props.src && typeof props.src === 'object'\n ? {\n src: props.src.src,\n srcset: props.srcset || props.src.srcset,\n lazySrc: props.lazySrc || props.src.lazySrc,\n aspect: Number(props.aspectRatio || props.src.aspect || 0),\n } : {\n src: props.src,\n srcset: props.srcset,\n lazySrc: props.lazySrc,\n aspect: Number(props.aspectRatio || 0),\n }\n })\n const aspectRatio = computed(() => {\n return normalisedSrc.value.aspect || naturalWidth.value! / naturalHeight.value! || 0\n })\n\n watch(() => props.src, () => {\n init(state.value !== 'idle')\n })\n watch(aspectRatio, (val, oldVal) => {\n if (!val && oldVal && image.value) {\n pollForSize(image.value)\n }\n })\n\n // TODO: getSrc when window width changes\n\n onBeforeMount(() => init())\n\n function init (isIntersecting?: boolean) {\n if (props.eager && isIntersecting) return\n if (\n SUPPORTS_INTERSECTION &&\n !isIntersecting &&\n !props.eager\n ) return\n\n state.value = 'loading'\n\n if (normalisedSrc.value.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = normalisedSrc.value.lazySrc\n pollForSize(lazyImg, null)\n }\n\n if (!normalisedSrc.value.src) return\n\n nextTick(() => {\n emit('loadstart', image.value?.currentSrc || normalisedSrc.value.src)\n\n setTimeout(() => {\n if (image.value?.complete) {\n if (!image.value.naturalWidth) {\n onError()\n }\n\n if (state.value === 'error') return\n\n if (!aspectRatio.value) pollForSize(image.value, null)\n if (state.value === 'loading') onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n })\n }\n\n function onLoad () {\n getSrc()\n pollForSize(image.value!)\n state.value = 'loaded'\n emit('load', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function onError () {\n state.value = 'error'\n emit('error', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function getSrc () {\n const img = image.value\n if (img) currentSrc.value = img.currentSrc || img.src\n }\n\n let timer = -1\n function pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n clearTimeout(timer)\n const { naturalHeight: imgHeight, naturalWidth: imgWidth } = img\n\n if (imgHeight || imgWidth) {\n naturalWidth.value = imgWidth\n naturalHeight.value = imgHeight\n } else if (!img.complete && state.value === 'loading' && timeout != null) {\n timer = window.setTimeout(poll, timeout)\n } else if (img.currentSrc.endsWith('.svg') || img.currentSrc.startsWith('data:image/svg+xml')) {\n naturalWidth.value = 1\n naturalHeight.value = 1\n }\n }\n\n poll()\n }\n\n const containClasses = computed(() => ({\n 'v-img__img--cover': props.cover,\n 'v-img__img--contain': !props.cover,\n }))\n\n const __image = () => {\n if (!normalisedSrc.value.src || state.value === 'idle') return null\n\n const img = (\n <img\n class={['v-img__img', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n sizes={ props.sizes }\n ref={ image }\n onLoad={ onLoad }\n onError={ onError }\n />\n )\n\n const sources = slots.sources?.()\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n {\n withDirectives(\n sources\n ? <picture class=\"v-img__picture\">{ sources }{ img }</picture>\n : img,\n [[vShow, state.value === 'loaded']]\n )\n }\n </MaybeTransition>\n )\n }\n\n const __preloadImage = () => (\n <MaybeTransition transition={ props.transition }>\n { normalisedSrc.value.lazySrc && state.value !== 'loaded' && (\n <img\n class={['v-img__img', 'v-img__img--preload', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n />\n )}\n </MaybeTransition>\n )\n\n const __placeholder = () => {\n if (!slots.placeholder) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { (state.value === 'loading' || (state.value === 'error' && !slots.error)) &&\n <div class=\"v-img__placeholder\">{ slots.placeholder() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __error = () => {\n if (!slots.error) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { state.value === 'error' &&\n <div class=\"v-img__error\">{ slots.error() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __gradient = () => {\n if (!props.gradient) return null\n\n return <div class=\"v-img__gradient\" style={{ backgroundImage: `linear-gradient(${props.gradient})` }} />\n }\n\n const isBooted = shallowRef(false)\n {\n const stop = watch(aspectRatio, val => {\n if (val) {\n // Doesn't work with nextTick, idk why\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n isBooted.value = true\n })\n })\n stop()\n }\n })\n }\n\n useRender(() => {\n const responsiveProps = VResponsive.filterProps(props)\n return (\n <VResponsive\n class={[\n 'v-img',\n { 'v-img--booting': !isBooted.value },\n props.class,\n ]}\n style={[\n { width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) },\n props.style,\n ]}\n { ...responsiveProps }\n aspectRatio={ aspectRatio.value }\n aria-label={ props.alt }\n role={ props.alt ? 'img' : undefined }\n v-intersect={[{\n handler: init,\n options: props.options,\n }, null, ['once']]}\n >{{\n additional: () => (\n <>\n <__image />\n <__preloadImage />\n <__gradient />\n <__placeholder />\n <__error />\n </>\n ),\n default: slots.default,\n }}</VResponsive>\n )\n })\n\n return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,oBAAoB,EAAEC,WAAW,0CAE1C;AAAA,SACSC,kBAAkB;AAAA,SAClBC,mBAAmB,EAAEC,eAAe,4CAE7C;AAAA,OACOC,SAAS,8CAEhB;AACA,SACEC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,cAAc,QACT,KAAK;AAAA,SAEVC,aAAa,EACbC,gBAAgB,EAChBC,YAAY,EACZC,qBAAqB,EACrBC,SAAS,gCAGX;AAkBA,OAAO,M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AAC,EACrCH,KAAK,CAAC8D,KAAK,CACZ;QAAA,SACM,CACL;UAAEC,KAAK,EAAE9F,aAAa,CAAC+B,KAAK,CAAC+D,KAAK,KAAK,MAAM,GAAGlD,YAAY,CAACV,KAAK,GAAGH,KAAK,CAAC+D,KAAK;QAAE,CAAC,EACnF/D,KAAK,CAACgE,KAAK;MACZ,GACIN,eAAe;QAAA,eACNxC,WAAW,CAACf,KAAK;QAAA,cAClBH,KAAK,CAACzB,GAAG;QAAA,QACfyB,KAAK,CAACzB,GAAG,GAAG,KAAK,GAAGO;MAAS;QAMpCmF,UAAU,EAAEA,CAAA,KAAApB,YAAA,CAAAqB,SAAA,SAAArB,YAAA,CAAAD,OAAA,eAAAC,YAAA,CAAAI,cAAA,eAAAJ,YAAA,CAAAQ,UAAA,eAAAR,YAAA,CAAAK,aAAA,eAAAL,YAAA,CAAAO,OAAA,eAQX;QACDvE,OAAO,EAAE4B,KAAK,CAAC5B;MAAO,MAAAsF,iBAAA,eAdR;QACZC,OAAO,EAAEjD,IAAI;QACbjC,OAAO,EAAEc,KAAK,CAACd;MACjB,CAAC,EAAE,IAAI;QAAAmF,IAAA;MAAA;IAcb,CAAC,CAAC;IAEF,OAAO;MACL3D,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VImg.mjs","names":["makeVResponsiveProps","VResponsive","makeComponentProps","makeTransitionProps","MaybeTransition","intersect","computed","nextTick","onBeforeMount","onBeforeUnmount","ref","shallowRef","vShow","watch","withDirectives","convertToUnit","genericComponent","getCurrentInstance","propsFactory","SUPPORTS_INTERSECTION","useRender","makeVImgProps","alt","String","cover","Boolean","draggable","type","default","undefined","eager","gradient","lazySrc","options","Object","root","rootMargin","threshold","sizes","src","crossorigin","referrerpolicy","srcset","position","VImg","name","directives","props","emits","loadstart","value","load","error","setup","_ref","emit","slots","vm","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","Number","aspectRatio","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","setTimeout","isUnmounted","complete","onError","onLoad","getSrc","img","timer","clearTimeout","timeout","arguments","length","poll","imgHeight","imgWidth","window","endsWith","startsWith","containClasses","__image","_createVNode","objectPosition","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","responsiveProps","filterProps","_withDirectives","_mergeProps","class","width","style","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["// Styles\nimport './VImg.sass'\n\n// Components\nimport { makeVResponsiveProps, VResponsive } from '@/components/VResponsive/VResponsive'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n ref,\n shallowRef,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getCurrentInstance,\n propsFactory,\n SUPPORTS_INTERSECTION,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src?: string\n srcset?: string\n lazySrc?: string\n aspect: number\n}\n\nexport type VImgSlots = {\n default: never\n placeholder: never\n error: never\n sources: never\n}\n\nexport const makeVImgProps = propsFactory({\n alt: String,\n cover: Boolean,\n draggable: {\n type: [Boolean, String] as PropType<boolean | 'true' | 'false'>,\n default: undefined,\n },\n eager: Boolean,\n gradient: String,\n lazySrc: String,\n options: {\n type: Object as PropType<IntersectionObserverInit>,\n // For more information on types, navigate to:\n // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n default: () => ({\n root: undefined,\n rootMargin: undefined,\n threshold: undefined,\n }),\n },\n sizes: String,\n src: {\n type: [String, Object] as PropType<string | srcObject>,\n default: '',\n },\n crossorigin: String as PropType<'' | 'anonymous' | 'use-credentials'>,\n referrerpolicy: String as PropType<\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url'\n >,\n srcset: String,\n position: String,\n\n ...makeVResponsiveProps(),\n ...makeComponentProps(),\n ...makeTransitionProps(),\n}, 'VImg')\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: makeVImgProps(),\n\n emits: {\n loadstart: (value: string | undefined) => true,\n load: (value: string | undefined) => true,\n error: (value: string | undefined) => true,\n },\n\n setup (props, { emit, slots }) {\n const vm = getCurrentInstance('VImg')\n\n const currentSrc = shallowRef('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = shallowRef<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = shallowRef<number>()\n const naturalHeight = shallowRef<number>()\n\n const normalisedSrc = computed<srcObject>(() => {\n return props.src && typeof props.src === 'object'\n ? {\n src: props.src.src,\n srcset: props.srcset || props.src.srcset,\n lazySrc: props.lazySrc || props.src.lazySrc,\n aspect: Number(props.aspectRatio || props.src.aspect || 0),\n } : {\n src: props.src,\n srcset: props.srcset,\n lazySrc: props.lazySrc,\n aspect: Number(props.aspectRatio || 0),\n }\n })\n const aspectRatio = computed(() => {\n return normalisedSrc.value.aspect || naturalWidth.value! / naturalHeight.value! || 0\n })\n\n watch(() => props.src, () => {\n init(state.value !== 'idle')\n })\n watch(aspectRatio, (val, oldVal) => {\n if (!val && oldVal && image.value) {\n pollForSize(image.value)\n }\n })\n\n // TODO: getSrc when window width changes\n\n onBeforeMount(() => init())\n\n function init (isIntersecting?: boolean) {\n if (props.eager && isIntersecting) return\n if (\n SUPPORTS_INTERSECTION &&\n !isIntersecting &&\n !props.eager\n ) return\n\n state.value = 'loading'\n\n if (normalisedSrc.value.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = normalisedSrc.value.lazySrc\n pollForSize(lazyImg, null)\n }\n\n if (!normalisedSrc.value.src) return\n\n nextTick(() => {\n emit('loadstart', image.value?.currentSrc || normalisedSrc.value.src)\n\n setTimeout(() => {\n if (vm.isUnmounted) return\n\n if (image.value?.complete) {\n if (!image.value.naturalWidth) {\n onError()\n }\n\n if (state.value === 'error') return\n\n if (!aspectRatio.value) pollForSize(image.value, null)\n if (state.value === 'loading') onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n })\n }\n\n function onLoad () {\n if (vm.isUnmounted) return\n\n getSrc()\n pollForSize(image.value!)\n state.value = 'loaded'\n emit('load', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function onError () {\n if (vm.isUnmounted) return\n\n state.value = 'error'\n emit('error', image.value?.currentSrc || normalisedSrc.value.src)\n }\n\n function getSrc () {\n const img = image.value\n if (img) currentSrc.value = img.currentSrc || img.src\n }\n\n let timer = -1\n\n onBeforeUnmount(() => {\n clearTimeout(timer)\n })\n\n function pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n clearTimeout(timer)\n if (vm.isUnmounted) return\n\n const { naturalHeight: imgHeight, naturalWidth: imgWidth } = img\n\n if (imgHeight || imgWidth) {\n naturalWidth.value = imgWidth\n naturalHeight.value = imgHeight\n } else if (!img.complete && state.value === 'loading' && timeout != null) {\n timer = window.setTimeout(poll, timeout)\n } else if (img.currentSrc.endsWith('.svg') || img.currentSrc.startsWith('data:image/svg+xml')) {\n naturalWidth.value = 1\n naturalHeight.value = 1\n }\n }\n\n poll()\n }\n\n const containClasses = computed(() => ({\n 'v-img__img--cover': props.cover,\n 'v-img__img--contain': !props.cover,\n }))\n\n const __image = () => {\n if (!normalisedSrc.value.src || state.value === 'idle') return null\n\n const img = (\n <img\n class={['v-img__img', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n sizes={ props.sizes }\n ref={ image }\n onLoad={ onLoad }\n onError={ onError }\n />\n )\n\n const sources = slots.sources?.()\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n {\n withDirectives(\n sources\n ? <picture class=\"v-img__picture\">{ sources }{ img }</picture>\n : img,\n [[vShow, state.value === 'loaded']]\n )\n }\n </MaybeTransition>\n )\n }\n\n const __preloadImage = () => (\n <MaybeTransition transition={ props.transition }>\n { normalisedSrc.value.lazySrc && state.value !== 'loaded' && (\n <img\n class={['v-img__img', 'v-img__img--preload', containClasses.value]}\n style={{ objectPosition: props.position }}\n src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\n crossorigin={ props.crossorigin }\n referrerpolicy={ props.referrerpolicy }\n draggable={ props.draggable }\n />\n )}\n </MaybeTransition>\n )\n\n const __placeholder = () => {\n if (!slots.placeholder) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { (state.value === 'loading' || (state.value === 'error' && !slots.error)) &&\n <div class=\"v-img__placeholder\">{ slots.placeholder() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __error = () => {\n if (!slots.error) return null\n\n return (\n <MaybeTransition transition={ props.transition } appear>\n { state.value === 'error' &&\n <div class=\"v-img__error\">{ slots.error() }</div>\n }\n </MaybeTransition>\n )\n }\n\n const __gradient = () => {\n if (!props.gradient) return null\n\n return <div class=\"v-img__gradient\" style={{ backgroundImage: `linear-gradient(${props.gradient})` }} />\n }\n\n const isBooted = shallowRef(false)\n {\n const stop = watch(aspectRatio, val => {\n if (val) {\n // Doesn't work with nextTick, idk why\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n isBooted.value = true\n })\n })\n stop()\n }\n })\n }\n\n useRender(() => {\n const responsiveProps = VResponsive.filterProps(props)\n return (\n <VResponsive\n class={[\n 'v-img',\n { 'v-img--booting': !isBooted.value },\n props.class,\n ]}\n style={[\n { width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) },\n props.style,\n ]}\n { ...responsiveProps }\n aspectRatio={ aspectRatio.value }\n aria-label={ props.alt }\n role={ props.alt ? 'img' : undefined }\n v-intersect={[{\n handler: init,\n options: props.options,\n }, null, ['once']]}\n >{{\n additional: () => (\n <>\n <__image />\n <__preloadImage />\n <__gradient />\n <__placeholder />\n <__error />\n </>\n ),\n default: slots.default,\n }}</VResponsive>\n )\n })\n\n return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,oBAAoB,EAAEC,WAAW,0CAE1C;AAAA,SACSC,kBAAkB;AAAA,SAClBC,mBAAmB,EAAEC,eAAe,4CAE7C;AAAA,OACOC,SAAS,8CAEhB;AACA,SACEC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,eAAe,EACfC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,cAAc,QACT,KAAK;AAAA,SAEVC,aAAa,EACbC,gBAAgB,EAChBC,kBAAkB,EAClBC,YAAY,EACZC,qBAAqB,EACrBC,SAAS,gCAGX;AAkBA,OAAO,MAAMC,aAAa,GAAGH,YAAY,CAAC;EACxCI,GAAG,EAAEC,MAAM;EACXC,KAAK,EAAEC,OAAO;EACdC,SAAS,EAAE;IACTC,IAAI,EAAE,CAACF,OAAO,EAAEF,MAAM,CAAyC;IAC/DK,OAAO,EAAEC;EACX,CAAC;EACDC,KAAK,EAAEL,OAAO;EACdM,QAAQ,EAAER,MAAM;EAChBS,OAAO,EAAET,MAAM;EACfU,OAAO,EAAE;IACPN,IAAI,EAAEO,MAA4C;IAClD;IACA;IACAN,OAAO,EAAEA,CAAA,MAAO;MACdO,IAAI,EAAEN,SAAS;MACfO,UAAU,EAAEP,SAAS;MACrBQ,SAAS,EAAER;IACb,CAAC;EACH,CAAC;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AK,GAAGH,KAAK,CAACiE,KAAK;QAAE,CAAC,EACnFjE,KAAK,CAACkE,KAAK;MACZ,GACIN,eAAe;QAAA,eACNzC,WAAW,CAAChB,KAAK;QAAA,cAClBH,KAAK,CAACzB,GAAG;QAAA,QACfyB,KAAK,CAACzB,GAAG,GAAG,KAAK,GAAGO;MAAS;QAMpCqF,UAAU,EAAEA,CAAA,KAAApB,YAAA,CAAAqB,SAAA,SAAArB,YAAA,CAAAD,OAAA,eAAAC,YAAA,CAAAI,cAAA,eAAAJ,YAAA,CAAAQ,UAAA,eAAAR,YAAA,CAAAK,aAAA,eAAAL,YAAA,CAAAO,OAAA,eAQX;QACDzE,OAAO,EAAE4B,KAAK,CAAC5B;MAAO,MAAAwF,iBAAA,eAdR;QACZC,OAAO,EAAElD,IAAI;QACblC,OAAO,EAAEc,KAAK,CAACd;MACjB,CAAC,EAAE,IAAI;QAAAqF,IAAA;MAAA;IAcb,CAAC,CAAC;IAEF,OAAO;MACL5D,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VInput.mjs","names":["useInputIcon","VMessages","makeComponentProps","makeDensityProps","useDensity","IconValue","useRtl","makeValidationProps","useValidation","computed","EventProp","genericComponent","getUid","propsFactory","useRender","makeVInputProps","id","String","appendIcon","centerAffix","type","Boolean","default","prependIcon","hideDetails","hideSpinButtons","hint","persistentHint","messages","Array","direction","validator","v","includes","VInput","name","props","emits","val","setup","_ref","attrs","slots","emit","densityClasses","rtlClasses","InputIcon","uid","messagesId","value","errorMessages","isDirty","isDisabled","isReadonly","isPristine","isValid","isValidating","reset","resetValidation","validate","validationClasses","slotProps","length","focused","hasPrepend","prepend","hasAppend","append","hasMessages","hasDetails","details","_createVNode","class","style","message"],"sources":["../../../src/components/VInput/VInput.tsx"],"sourcesContent":["// Styles\nimport './VInput.sass'\n\n// Components\nimport { useInputIcon } from '@/components/VInput/InputIcon'\nimport { VMessages } from '@/components/VMessages/VMessages'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { IconValue } from '@/composables/icons'\nimport { useRtl } from '@/composables/locale'\nimport { makeValidationProps, useValidation } from '@/composables/validation'\n\n// Utilities\nimport { computed } from 'vue'\nimport { EventProp, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { VMessageSlot } from '@/components/VMessages/VMessages'\n\nexport interface VInputSlot {\n id: ComputedRef<string>\n messagesId: ComputedRef<string>\n isDirty: ComputedRef<boolean>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isPristine: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n isValidating: Ref<boolean>\n reset: () => void\n resetValidation: () => void\n validate: () => void\n}\n\nexport const makeVInputProps = propsFactory({\n id: String,\n appendIcon: IconValue,\n centerAffix: {\n type: Boolean,\n default: true,\n },\n prependIcon: IconValue,\n hideDetails: [Boolean, String] as PropType<boolean | 'auto'>,\n hideSpinButtons: Boolean,\n hint: String,\n persistentHint: Boolean,\n messages: {\n type: [Array, String] as PropType<string | readonly string[]>,\n default: () => ([]),\n },\n direction: {\n type: String as PropType<'horizontal' | 'vertical'>,\n default: 'horizontal',\n validator: (v: any) => ['horizontal', 'vertical'].includes(v),\n },\n\n 'onClick:prepend': EventProp<[MouseEvent]>(),\n 'onClick:append': EventProp<[MouseEvent]>(),\n\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeValidationProps(),\n}, 'VInput')\n\nexport type VInputSlots = {\n default: VInputSlot\n prepend: VInputSlot\n append: VInputSlot\n details: VInputSlot\n message: VMessageSlot\n}\n\nexport const VInput = genericComponent<VInputSlots>()({\n name: 'VInput',\n\n props: {\n ...makeVInputProps(),\n },\n\n emits: {\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, slots, emit }) {\n const { densityClasses } = useDensity(props)\n const { rtlClasses } = useRtl()\n const { InputIcon } = useInputIcon(props)\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const messagesId = computed(() => `${id.value}-messages`)\n\n const {\n errorMessages,\n isDirty,\n isDisabled,\n isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n validationClasses,\n } = useValidation(props, 'v-input', id)\n\n const slotProps = computed<VInputSlot>(() => ({\n id,\n messagesId,\n isDirty,\n isDisabled,\n isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n }))\n\n const messages = computed(() => {\n if (props.errorMessages?.length || (!isPristine.value && errorMessages.value.length)) {\n return errorMessages.value\n } else if (props.hint && (props.persistentHint || props.focused)) {\n return props.hint\n } else {\n return props.messages\n }\n })\n\n useRender(() => {\n const hasPrepend = !!(slots.prepend || props.prependIcon)\n const hasAppend = !!(slots.append || props.appendIcon)\n const hasMessages = messages.value.length > 0\n const hasDetails = !props.hideDetails || (\n props.hideDetails === 'auto' &&\n (hasMessages || !!slots.details)\n )\n\n return (\n <div\n class={[\n 'v-input',\n `v-input--${props.direction}`,\n {\n 'v-input--center-affix': props.centerAffix,\n 'v-input--hide-spin-buttons': props.hideSpinButtons,\n },\n densityClasses.value,\n rtlClasses.value,\n validationClasses.value,\n props.class,\n ]}\n style={ props.style }\n >\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-input__prepend\">\n { slots.prepend?.(slotProps.value) }\n\n { props.prependIcon && (\n <InputIcon\n key=\"prepend-icon\"\n name=\"prepend\"\n />\n )}\n </div>\n )}\n\n { slots.default && (\n <div class=\"v-input__control\">\n { slots.default?.(slotProps.value) }\n </div>\n )}\n\n { hasAppend && (\n <div key=\"append\" class=\"v-input__append\">\n { props.appendIcon && (\n <InputIcon\n key=\"append-icon\"\n name=\"append\"\n />\n )}\n\n { slots.append?.(slotProps.value) }\n </div>\n )}\n\n { hasDetails && (\n <div class=\"v-input__details\">\n <VMessages\n id={ messagesId.value }\n active={ hasMessages }\n messages={ messages.value }\n v-slots={{ message: slots.message }}\n />\n\n { slots.details?.(slotProps.value) }\n </div>\n )}\n </div>\n )\n })\n\n return {\n reset,\n resetValidation,\n validate,\n isValid,\n errorMessages,\n }\n },\n})\n\nexport type VInput = InstanceType<typeof VInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,YAAY;AAAA,SACZC,SAAS,sCAElB;AAAA,SACSC,kBAAkB;AAAA,SAClBC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,SAAS;AAAA,SACTC,MAAM;AAAA,SACNC,mBAAmB,EAAEC,aAAa,4CAE3C;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,SAAS,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAErE;AAkBA,OAAO,MAAMC,eAAe,GAAGF,YAAY,CAAC;EAC1CG,EAAE,EAAEC,MAAM;EACVC,UAAU,EAAEb,SAAS;EACrBc,WAAW,EAAE;IACXC,IAAI,EAAEC,OAAO;IACbC,OAAO,EAAE;EACX,CAAC;EACDC,WAAW,EAAElB,SAAS;EACtBmB,WAAW,EAAE,CAACH,OAAO,EAAEJ,MAAM,CAA+B;EAC5DQ,eAAe,EAAEJ,OAAO;EACxBK,IAAI,EAAET,MAAM;EACZU,cAAc,EAAEN,OAAO;EACvBO,QAAQ,EAAE;IACRR,IAAI,EAAE,CAACS,KAAK,EAAEZ,MAAM,CAAyC;IAC7DK,OAAO,EAAEA,CAAA,KAAO;EAClB,CAAC;EACDQ,SAAS,EAAE;IACTV,IAAI,EAAEH,MAA6C;IACnDK,OAAO,EAAE,YAAY;IACrBS,SAAS,EAAGC,CAAM,IAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAACC,QAAQ,CAACD,CAAC;EAC9D,CAAC;EAED,iBAAiB,EAAEtB,SAAS,EAAgB;EAC5C,gBAAgB,EAAEA,SAAS,EAAgB;EA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SAAS;QAAA,SAAO;MAAkB,IACvC7B,KAAK,CAACuB,OAAO,GAAGJ,SAAS,CAACZ,KAAK,CAAC,EAEhCb,KAAK,CAACb,WAAW,IAAAgD,YAAA,CAAAzB,SAAA;QAAA,OAEX,cAAc;QAAA,QACb;MAAS,QAEjB,EAEJ,EAECJ,KAAK,CAACpB,OAAO,IAAAiD,YAAA;QAAA,SACF;MAAkB,IACzB7B,KAAK,CAACpB,OAAO,GAAGuC,SAAS,CAACZ,KAAK,CAAC,EAErC,EAECiB,SAAS,IAAAK,YAAA;QAAA,OACA,QAAQ;QAAA,SAAO;MAAiB,IACrCnC,KAAK,CAAClB,UAAU,IAAAqD,YAAA,CAAAzB,SAAA;QAAA,OAEV,aAAa;QAAA,QACZ;MAAQ,QAEhB,EAECJ,KAAK,CAACyB,MAAM,GAAGN,SAAS,CAACZ,KAAK,CAAC,EAEpC,EAECoB,UAAU,IAAAE,YAAA;QAAA,SACC;MAAkB,IAAAA,YAAA,CAAAtE,SAAA;QAAA,MAEpB+C,UAAU,CAACC,KAAK;QAAA,UACZmB,WAAW;QAAA,YACTxC,QAAQ,CAACqB;MAAK,GAChB;QAAEyB,OAAO,EAAEhC,KAAK,CAACgC;MAAQ,CAAC,GAGnChC,KAAK,CAAC4B,OAAO,GAAGT,SAAS,CAACZ,KAAK,CAAC,EAErC;IAGP,CAAC,CAAC;IAEF,OAAO;MACLQ,KAAK;MACLC,eAAe;MACfC,QAAQ;MACRJ,OAAO;MACPL;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VInput.mjs","names":["useInputIcon","VMessages","makeComponentProps","makeDensityProps","useDensity","IconValue","useRtl","makeValidationProps","useValidation","computed","EventProp","genericComponent","getUid","propsFactory","useRender","makeVInputProps","id","String","appendIcon","centerAffix","type","Boolean","default","prependIcon","hideDetails","hideSpinButtons","hint","persistentHint","messages","Array","direction","validator","v","includes","VInput","name","props","emits","value","setup","_ref","attrs","slots","emit","densityClasses","rtlClasses","InputIcon","uid","messagesId","errorMessages","isDirty","isDisabled","isReadonly","isPristine","isValid","isValidating","reset","resetValidation","validate","validationClasses","slotProps","length","focused","hasPrepend","prepend","hasAppend","append","hasMessages","hasDetails","details","_createVNode","class","style","message"],"sources":["../../../src/components/VInput/VInput.tsx"],"sourcesContent":["// Styles\nimport './VInput.sass'\n\n// Components\nimport { useInputIcon } from '@/components/VInput/InputIcon'\nimport { VMessages } from '@/components/VMessages/VMessages'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { IconValue } from '@/composables/icons'\nimport { useRtl } from '@/composables/locale'\nimport { makeValidationProps, useValidation } from '@/composables/validation'\n\n// Utilities\nimport { computed } from 'vue'\nimport { EventProp, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { VMessageSlot } from '@/components/VMessages/VMessages'\nimport type { GenericProps } from '@/util'\n\nexport interface VInputSlot {\n id: ComputedRef<string>\n messagesId: ComputedRef<string>\n isDirty: ComputedRef<boolean>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isPristine: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n isValidating: Ref<boolean>\n reset: () => void\n resetValidation: () => void\n validate: () => void\n}\n\nexport const makeVInputProps = propsFactory({\n id: String,\n appendIcon: IconValue,\n centerAffix: {\n type: Boolean,\n default: true,\n },\n prependIcon: IconValue,\n hideDetails: [Boolean, String] as PropType<boolean | 'auto'>,\n hideSpinButtons: Boolean,\n hint: String,\n persistentHint: Boolean,\n messages: {\n type: [Array, String] as PropType<string | readonly string[]>,\n default: () => ([]),\n },\n direction: {\n type: String as PropType<'horizontal' | 'vertical'>,\n default: 'horizontal',\n validator: (v: any) => ['horizontal', 'vertical'].includes(v),\n },\n\n 'onClick:prepend': EventProp<[MouseEvent]>(),\n 'onClick:append': EventProp<[MouseEvent]>(),\n\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeValidationProps(),\n}, 'VInput')\n\nexport type VInputSlots = {\n default: VInputSlot\n prepend: VInputSlot\n append: VInputSlot\n details: VInputSlot\n message: VMessageSlot\n}\n\nexport const VInput = genericComponent<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VInputSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VInput',\n\n props: {\n ...makeVInputProps(),\n },\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { attrs, slots, emit }) {\n const { densityClasses } = useDensity(props)\n const { rtlClasses } = useRtl()\n const { InputIcon } = useInputIcon(props)\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const messagesId = computed(() => `${id.value}-messages`)\n\n const {\n errorMessages,\n isDirty,\n isDisabled,\n isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n validationClasses,\n } = useValidation(props, 'v-input', id)\n\n const slotProps = computed<VInputSlot>(() => ({\n id,\n messagesId,\n isDirty,\n isDisabled,\n isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n }))\n\n const messages = computed(() => {\n if (props.errorMessages?.length || (!isPristine.value && errorMessages.value.length)) {\n return errorMessages.value\n } else if (props.hint && (props.persistentHint || props.focused)) {\n return props.hint\n } else {\n return props.messages\n }\n })\n\n useRender(() => {\n const hasPrepend = !!(slots.prepend || props.prependIcon)\n const hasAppend = !!(slots.append || props.appendIcon)\n const hasMessages = messages.value.length > 0\n const hasDetails = !props.hideDetails || (\n props.hideDetails === 'auto' &&\n (hasMessages || !!slots.details)\n )\n\n return (\n <div\n class={[\n 'v-input',\n `v-input--${props.direction}`,\n {\n 'v-input--center-affix': props.centerAffix,\n 'v-input--hide-spin-buttons': props.hideSpinButtons,\n },\n densityClasses.value,\n rtlClasses.value,\n validationClasses.value,\n props.class,\n ]}\n style={ props.style }\n >\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-input__prepend\">\n { slots.prepend?.(slotProps.value) }\n\n { props.prependIcon && (\n <InputIcon\n key=\"prepend-icon\"\n name=\"prepend\"\n />\n )}\n </div>\n )}\n\n { slots.default && (\n <div class=\"v-input__control\">\n { slots.default?.(slotProps.value) }\n </div>\n )}\n\n { hasAppend && (\n <div key=\"append\" class=\"v-input__append\">\n { props.appendIcon && (\n <InputIcon\n key=\"append-icon\"\n name=\"append\"\n />\n )}\n\n { slots.append?.(slotProps.value) }\n </div>\n )}\n\n { hasDetails && (\n <div class=\"v-input__details\">\n <VMessages\n id={ messagesId.value }\n active={ hasMessages }\n messages={ messages.value }\n v-slots={{ message: slots.message }}\n />\n\n { slots.details?.(slotProps.value) }\n </div>\n )}\n </div>\n )\n })\n\n return {\n reset,\n resetValidation,\n validate,\n isValid,\n errorMessages,\n }\n },\n})\n\nexport type VInput = InstanceType<typeof VInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,YAAY;AAAA,SACZC,SAAS,sCAElB;AAAA,SACSC,kBAAkB;AAAA,SAClBC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,SAAS;AAAA,SACTC,MAAM;AAAA,SACNC,mBAAmB,EAAEC,aAAa,4CAE3C;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,SAAS,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAErE;AAmBA,OAAO,MAAMC,eAAe,GAAGF,YAAY,CAAC;EAC1CG,EAAE,EAAEC,MAAM;EACVC,UAAU,EAAEb,SAAS;EACrBc,WAAW,EAAE;IACXC,IAAI,EAAEC,OAAO;IACbC,OAAO,EAAE;EACX,CAAC;EACDC,WAAW,EAAElB,SAAS;EACtBmB,WAAW,EAAE,CAACH,OAAO,EAAEJ,MAAM,CAA+B;EAC5DQ,eAAe,EAAEJ,OAAO;EACxBK,IAAI,EAAET,MAAM;EACZU,cAAc,EAAEN,OAAO;EACvBO,QAAQ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,eAAe;MACfC,QAAQ;MACRJ,OAAO;MACPL;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComponentPropsOptions, ExtractPropTypes,
|
|
2
|
+
import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, JSXComponent, PropType, ComputedRef, Ref } from 'vue';
|
|
3
3
|
|
|
4
|
+
type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
|
|
5
|
+
$children?: (VNodeChild | (T extends {
|
|
6
|
+
default: infer V;
|
|
7
|
+
} ? V : {}) | {
|
|
8
|
+
[K in keyof T]?: T[K];
|
|
9
|
+
});
|
|
10
|
+
'v-slots'?: {
|
|
11
|
+
[K in keyof T]?: T[K] | false;
|
|
12
|
+
};
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as `v-slot:${K & string}`]?: T[K] | false;
|
|
15
|
+
};
|
|
16
|
+
type RawSlots = Record<string, unknown>;
|
|
17
|
+
type Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild;
|
|
18
|
+
type VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[];
|
|
19
|
+
type MakeInternalSlots<T extends RawSlots> = {
|
|
20
|
+
[K in keyof T]: Slot<T[K]>;
|
|
21
|
+
};
|
|
22
|
+
type MakeSlots<T extends RawSlots> = {
|
|
23
|
+
[K in keyof T]: VueSlot<T[K]>;
|
|
24
|
+
};
|
|
25
|
+
type GenericProps<Props, Slots extends Record<string, unknown>> = {
|
|
26
|
+
$props: Props & SlotsToProps<Slots>;
|
|
27
|
+
$slots: MakeSlots<Slots>;
|
|
28
|
+
};
|
|
4
29
|
interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
|
|
5
30
|
filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): Partial<Pick<T, U>>;
|
|
6
31
|
}
|
|
7
32
|
|
|
8
|
-
type EventProp<T extends any[] = any[], F = (...args: T) => any> = F | F[];
|
|
9
|
-
declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T, (...args: T) => any>>;
|
|
10
|
-
|
|
11
33
|
type Density = null | 'default' | 'comfortable' | 'compact';
|
|
12
34
|
|
|
13
35
|
type ValidationResult = string | boolean;
|
|
@@ -33,6 +55,13 @@ interface VInputSlot {
|
|
|
33
55
|
resetValidation: () => void;
|
|
34
56
|
validate: () => void;
|
|
35
57
|
}
|
|
58
|
+
type VInputSlots = {
|
|
59
|
+
default: VInputSlot;
|
|
60
|
+
prepend: VInputSlot;
|
|
61
|
+
append: VInputSlot;
|
|
62
|
+
details: VInputSlot;
|
|
63
|
+
message: VMessageSlot;
|
|
64
|
+
};
|
|
36
65
|
declare const VInput: {
|
|
37
66
|
new (...args: any[]): {
|
|
38
67
|
$: vue.ComponentInternalInstance;
|
|
@@ -71,36 +100,15 @@ declare const VInput: {
|
|
|
71
100
|
name?: string | undefined;
|
|
72
101
|
label?: string | undefined;
|
|
73
102
|
class?: any;
|
|
74
|
-
modelValue?: any;
|
|
75
103
|
prependIcon?: IconValue | undefined;
|
|
76
104
|
appendIcon?: IconValue | undefined;
|
|
77
|
-
'onClick:append'?:
|
|
78
|
-
'onClick:prepend'?:
|
|
79
|
-
'onUpdate:focused'?:
|
|
105
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
106
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
107
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
80
108
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
81
109
|
validationValue?: any;
|
|
82
110
|
hint?: string | undefined;
|
|
83
111
|
hideDetails?: boolean | "auto" | undefined;
|
|
84
|
-
$children?: vue.VNodeChild | {
|
|
85
|
-
default?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
86
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
87
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
88
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
89
|
-
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
90
|
-
} | ((arg: VInputSlot) => vue.VNodeChild);
|
|
91
|
-
'v-slots'?: {
|
|
92
|
-
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
93
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
94
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
95
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
96
|
-
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
97
|
-
} | undefined;
|
|
98
|
-
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
99
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
100
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
101
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
102
|
-
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
103
|
-
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
104
112
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
|
105
113
|
error: boolean;
|
|
106
114
|
direction: "horizontal" | "vertical";
|
|
@@ -121,40 +129,16 @@ declare const VInput: {
|
|
|
121
129
|
name?: string | undefined;
|
|
122
130
|
label?: string | undefined;
|
|
123
131
|
class?: any;
|
|
124
|
-
modelValue?: any;
|
|
125
132
|
prependIcon?: IconValue | undefined;
|
|
126
133
|
appendIcon?: IconValue | undefined;
|
|
127
|
-
'onClick:append'?:
|
|
128
|
-
'onClick:prepend'?:
|
|
129
|
-
'onUpdate:focused'?:
|
|
134
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
135
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
136
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
130
137
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
131
138
|
validationValue?: any;
|
|
132
139
|
hint?: string | undefined;
|
|
133
140
|
hideDetails?: boolean | "auto" | undefined;
|
|
134
|
-
} & {
|
|
135
|
-
$children?: vue.VNodeChild | {
|
|
136
|
-
default?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
137
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
138
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
139
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
140
|
-
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
141
|
-
} | ((arg: VInputSlot) => vue.VNodeChild);
|
|
142
|
-
'v-slots'?: {
|
|
143
|
-
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
144
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
145
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
146
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
147
|
-
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
148
|
-
} | undefined;
|
|
149
|
-
} & {
|
|
150
|
-
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
151
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
152
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
153
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
154
|
-
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
155
|
-
} & {
|
|
156
|
-
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
157
|
-
}, "error" | "direction" | "style" | "disabled" | "readonly" | "messages" | "density" | "focused" | "errorMessages" | "maxErrors" | "rules" | "centerAffix" | "hideSpinButtons" | "persistentHint">;
|
|
141
|
+
} & {}, "error" | "direction" | "style" | "disabled" | "readonly" | "messages" | "density" | "focused" | "errorMessages" | "maxErrors" | "rules" | "centerAffix" | "hideSpinButtons" | "persistentHint">;
|
|
158
142
|
$attrs: {
|
|
159
143
|
[x: string]: unknown;
|
|
160
144
|
};
|
|
@@ -180,7 +164,7 @@ declare const VInput: {
|
|
|
180
164
|
}>;
|
|
181
165
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
182
166
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
183
|
-
$emit: (event:
|
|
167
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
184
168
|
$el: any;
|
|
185
169
|
$options: vue.ComponentOptionsBase<{
|
|
186
170
|
error: boolean;
|
|
@@ -202,48 +186,24 @@ declare const VInput: {
|
|
|
202
186
|
name?: string | undefined;
|
|
203
187
|
label?: string | undefined;
|
|
204
188
|
class?: any;
|
|
205
|
-
modelValue?: any;
|
|
206
189
|
prependIcon?: IconValue | undefined;
|
|
207
190
|
appendIcon?: IconValue | undefined;
|
|
208
|
-
'onClick:append'?:
|
|
209
|
-
'onClick:prepend'?:
|
|
210
|
-
'onUpdate:focused'?:
|
|
191
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
192
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
193
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
211
194
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
212
195
|
validationValue?: any;
|
|
213
196
|
hint?: string | undefined;
|
|
214
197
|
hideDetails?: boolean | "auto" | undefined;
|
|
215
|
-
} & {
|
|
216
|
-
$children?: vue.VNodeChild | {
|
|
217
|
-
default?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
218
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
219
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
220
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
221
|
-
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
222
|
-
} | ((arg: VInputSlot) => vue.VNodeChild);
|
|
223
|
-
'v-slots'?: {
|
|
224
|
-
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
225
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
226
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
227
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
228
|
-
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
229
|
-
} | undefined;
|
|
230
|
-
} & {
|
|
231
|
-
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
232
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
233
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
234
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
235
|
-
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
236
|
-
} & {
|
|
237
|
-
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
238
|
-
}, {
|
|
198
|
+
} & {}, {
|
|
239
199
|
reset: () => void;
|
|
240
200
|
resetValidation: () => void;
|
|
241
201
|
validate: (silent?: boolean) => Promise<string[]>;
|
|
242
202
|
isValid: ComputedRef<boolean | null>;
|
|
243
203
|
errorMessages: ComputedRef<string[]>;
|
|
244
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
245
|
-
'update:modelValue': (
|
|
246
|
-
}, string, {
|
|
204
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
205
|
+
'update:modelValue': (value: any) => true;
|
|
206
|
+
}, "$children" | "v-slot:default" | "v-slots" | "v-slot:append" | "v-slot:prepend" | "modelValue" | "update:modelValue" | "v-slot:message" | "v-slot:details">, string, {
|
|
247
207
|
error: boolean;
|
|
248
208
|
direction: "horizontal" | "vertical";
|
|
249
209
|
style: vue.StyleValue;
|
|
@@ -314,40 +274,16 @@ declare const VInput: {
|
|
|
314
274
|
name?: string | undefined;
|
|
315
275
|
label?: string | undefined;
|
|
316
276
|
class?: any;
|
|
317
|
-
modelValue?: any;
|
|
318
277
|
prependIcon?: IconValue | undefined;
|
|
319
278
|
appendIcon?: IconValue | undefined;
|
|
320
|
-
'onClick:append'?:
|
|
321
|
-
'onClick:prepend'?:
|
|
322
|
-
'onUpdate:focused'?:
|
|
279
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
280
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
281
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
323
282
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
324
283
|
validationValue?: any;
|
|
325
284
|
hint?: string | undefined;
|
|
326
285
|
hideDetails?: boolean | "auto" | undefined;
|
|
327
|
-
} & {
|
|
328
|
-
$children?: vue.VNodeChild | {
|
|
329
|
-
default?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
330
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
331
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
332
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
333
|
-
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
334
|
-
} | ((arg: VInputSlot) => vue.VNodeChild);
|
|
335
|
-
'v-slots'?: {
|
|
336
|
-
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
337
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
338
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
339
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
340
|
-
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
341
|
-
} | undefined;
|
|
342
|
-
} & {
|
|
343
|
-
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
344
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
345
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
346
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
347
|
-
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
348
|
-
} & {
|
|
349
|
-
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
350
|
-
} & vue.ShallowUnwrapRef<{
|
|
286
|
+
} & {} & vue.ShallowUnwrapRef<{
|
|
351
287
|
reset: () => void;
|
|
352
288
|
resetValidation: () => void;
|
|
353
289
|
validate: (silent?: boolean) => Promise<string[]>;
|
|
@@ -377,48 +313,24 @@ declare const VInput: {
|
|
|
377
313
|
name?: string | undefined;
|
|
378
314
|
label?: string | undefined;
|
|
379
315
|
class?: any;
|
|
380
|
-
modelValue?: any;
|
|
381
316
|
prependIcon?: IconValue | undefined;
|
|
382
317
|
appendIcon?: IconValue | undefined;
|
|
383
|
-
'onClick:append'?:
|
|
384
|
-
'onClick:prepend'?:
|
|
385
|
-
'onUpdate:focused'?:
|
|
318
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
319
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
320
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
386
321
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
387
322
|
validationValue?: any;
|
|
388
323
|
hint?: string | undefined;
|
|
389
324
|
hideDetails?: boolean | "auto" | undefined;
|
|
390
|
-
} & {
|
|
391
|
-
$children?: vue.VNodeChild | {
|
|
392
|
-
default?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
393
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
394
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
395
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
396
|
-
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
397
|
-
} | ((arg: VInputSlot) => vue.VNodeChild);
|
|
398
|
-
'v-slots'?: {
|
|
399
|
-
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
400
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
401
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
402
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
403
|
-
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
404
|
-
} | undefined;
|
|
405
|
-
} & {
|
|
406
|
-
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
407
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
408
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
409
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
410
|
-
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
411
|
-
} & {
|
|
412
|
-
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
413
|
-
}, {
|
|
325
|
+
} & {}, {
|
|
414
326
|
reset: () => void;
|
|
415
327
|
resetValidation: () => void;
|
|
416
328
|
validate: (silent?: boolean) => Promise<string[]>;
|
|
417
329
|
isValid: ComputedRef<boolean | null>;
|
|
418
330
|
errorMessages: ComputedRef<string[]>;
|
|
419
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
420
|
-
'update:modelValue': (
|
|
421
|
-
}, string, {
|
|
331
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
332
|
+
'update:modelValue': (value: any) => true;
|
|
333
|
+
}, "$children" | "v-slot:default" | "v-slots" | "v-slot:append" | "v-slot:prepend" | "modelValue" | "update:modelValue" | "v-slot:message" | "v-slot:details">, string, {
|
|
422
334
|
error: boolean;
|
|
423
335
|
direction: "horizontal" | "vertical";
|
|
424
336
|
style: vue.StyleValue;
|
|
@@ -449,9 +361,15 @@ declare const VInput: {
|
|
|
449
361
|
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
450
362
|
[key: string]: any;
|
|
451
363
|
}>[];
|
|
452
|
-
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps &
|
|
364
|
+
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1>(props: {
|
|
365
|
+
modelValue?: T_1 | null | undefined;
|
|
366
|
+
'onUpdate:modelValue'?: ((value: T_1 | null) => void) | undefined;
|
|
367
|
+
}, slots: VInputSlots) => GenericProps<{
|
|
368
|
+
modelValue?: T_1 | null | undefined;
|
|
369
|
+
'onUpdate:modelValue'?: ((value: T_1 | null) => void) | undefined;
|
|
370
|
+
}, VInputSlots>) & FilterPropsOptions<{
|
|
453
371
|
focused: BooleanConstructor;
|
|
454
|
-
'onUpdate:focused': PropType<
|
|
372
|
+
'onUpdate:focused': PropType<(args_0: boolean) => void>;
|
|
455
373
|
disabled: {
|
|
456
374
|
type: PropType<boolean | null>;
|
|
457
375
|
default: null;
|
|
@@ -508,11 +426,11 @@ declare const VInput: {
|
|
|
508
426
|
default: string;
|
|
509
427
|
validator: (v: any) => boolean;
|
|
510
428
|
};
|
|
511
|
-
'onClick:prepend': PropType<
|
|
512
|
-
'onClick:append': PropType<
|
|
429
|
+
'onClick:prepend': PropType<(args_0: MouseEvent) => void>;
|
|
430
|
+
'onClick:append': PropType<(args_0: MouseEvent) => void>;
|
|
513
431
|
}, vue.ExtractPropTypes<{
|
|
514
432
|
focused: BooleanConstructor;
|
|
515
|
-
'onUpdate:focused': PropType<
|
|
433
|
+
'onUpdate:focused': PropType<(args_0: boolean) => void>;
|
|
516
434
|
disabled: {
|
|
517
435
|
type: PropType<boolean | null>;
|
|
518
436
|
default: null;
|
|
@@ -569,8 +487,8 @@ declare const VInput: {
|
|
|
569
487
|
default: string;
|
|
570
488
|
validator: (v: any) => boolean;
|
|
571
489
|
};
|
|
572
|
-
'onClick:prepend': PropType<
|
|
573
|
-
'onClick:append': PropType<
|
|
490
|
+
'onClick:prepend': PropType<(args_0: MouseEvent) => void>;
|
|
491
|
+
'onClick:append': PropType<(args_0: MouseEvent) => void>;
|
|
574
492
|
}>>;
|
|
575
493
|
type VInput = InstanceType<typeof VInput>;
|
|
576
494
|
|
|
@@ -7,7 +7,7 @@ import { makeComponentProps } from "../../composables/component.mjs";
|
|
|
7
7
|
import { makeGroupProps, useGroup } from "../../composables/group.mjs";
|
|
8
8
|
import { makeTagProps } from "../../composables/tag.mjs";
|
|
9
9
|
import { makeThemeProps, provideTheme } from "../../composables/theme.mjs"; // Utilities
|
|
10
|
-
import { genericComponent, propsFactory } from "../../util/index.mjs";
|
|
10
|
+
import { genericComponent, propsFactory } from "../../util/index.mjs"; // Types
|
|
11
11
|
export const VItemGroupSymbol = Symbol.for('vuetify:v-item-group');
|
|
12
12
|
export const makeVItemGroupProps = propsFactory({
|
|
13
13
|
...makeComponentProps(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VItemGroup.mjs","names":["makeComponentProps","makeGroupProps","useGroup","makeTagProps","makeThemeProps","provideTheme","genericComponent","propsFactory","VItemGroupSymbol","Symbol","for","makeVItemGroupProps","selectedClass","VItemGroup","name","props","emits","value","setup","_ref","slots","themeClasses","isSelected","select","next","prev","selected","_createVNode","tag","class","style","default"],"sources":["../../../src/components/VItemGroup/VItemGroup.tsx"],"sourcesContent":["// Styles\nimport './VItemGroup.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeGroupProps, useGroup } from '@/composables/group'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { genericComponent, propsFactory } from '@/util'\n\nexport const VItemGroupSymbol = Symbol.for('vuetify:v-item-group')\n\nexport const makeVItemGroupProps = propsFactory({\n ...makeComponentProps(),\n ...makeGroupProps({\n selectedClass: 'v-item--selected',\n }),\n ...makeTagProps(),\n ...makeThemeProps(),\n}, 'VItemGroup')\n\ntype VItemGroupSlots = {\n default: {\n isSelected: (id: number) => boolean\n select: (id: number, value: boolean) => void\n next: () => void\n prev: () => void\n selected: readonly number[]\n }\n}\n\nexport const VItemGroup = genericComponent<
|
|
1
|
+
{"version":3,"file":"VItemGroup.mjs","names":["makeComponentProps","makeGroupProps","useGroup","makeTagProps","makeThemeProps","provideTheme","genericComponent","propsFactory","VItemGroupSymbol","Symbol","for","makeVItemGroupProps","selectedClass","VItemGroup","name","props","emits","value","setup","_ref","slots","themeClasses","isSelected","select","next","prev","selected","_createVNode","tag","class","style","default"],"sources":["../../../src/components/VItemGroup/VItemGroup.tsx"],"sourcesContent":["// Styles\nimport './VItemGroup.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeGroupProps, useGroup } from '@/composables/group'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { GenericProps } from '@/util'\n\nexport const VItemGroupSymbol = Symbol.for('vuetify:v-item-group')\n\nexport const makeVItemGroupProps = propsFactory({\n ...makeComponentProps(),\n ...makeGroupProps({\n selectedClass: 'v-item--selected',\n }),\n ...makeTagProps(),\n ...makeThemeProps(),\n}, 'VItemGroup')\n\ntype VItemGroupSlots = {\n default: {\n isSelected: (id: number) => boolean\n select: (id: number, value: boolean) => void\n next: () => void\n prev: () => void\n selected: readonly number[]\n }\n}\n\nexport const VItemGroup = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (value: T) => void\n },\n slots: VItemGroupSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VItemGroup',\n\n props: makeVItemGroupProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { slots }) {\n const { themeClasses } = provideTheme(props)\n const { isSelected, select, next, prev, selected } = useGroup(props, VItemGroupSymbol)\n\n return () => (\n <props.tag\n class={[\n 'v-item-group',\n themeClasses.value,\n props.class,\n ]}\n style={ props.style }\n >\n { slots.default?.({\n isSelected,\n select,\n next,\n prev,\n selected: selected.value,\n })}\n </props.tag>\n )\n },\n})\n\nexport type VItemGroup = InstanceType<typeof VItemGroup>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY,uCAErC;AAAA,SACSC,gBAAgB,EAAEC,YAAY,gCAEvC;AAGA,OAAO,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,GAAG,CAAC,sBAAsB,CAAC;AAElE,OAAO,MAAMC,mBAAmB,GAAGJ,YAAY,CAAC;EAC9C,GAAGP,kBAAkB,EAAE;EACvB,GAAGC,cAAc,CAAC;IAChBW,aAAa,EAAE;EACjB,CAAC,CAAC;EACF,GAAGT,YAAY,EAAE;EACjB,GAAGC,cAAc;AACnB,CAAC,EAAE,YAAY,CAAC;AAYhB,OAAO,MAAMS,UAAU,GAAGP,gBAAgB,EAMM,CAAC;EAC/CQ,IAAI,EAAE,YAAY;EAElBC,KAAK,EAAEJ,mBAAmB,EAAE;EAE5BK,KAAK,EAAE;IACL,mBAAmB,EAAGC,KAAU,IAAK;EACvC,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAM;MAAEE;IAAa,CAAC,GAAGhB,YAAY,CAACU,KAAK,CAAC;IAC5C,MAAM;MAAEO,UAAU;MAAEC,MAAM;MAAEC,IAAI;MAAEC,IAAI;MAAEC;IAAS,CAAC,GAAGxB,QAAQ,CAACa,KAAK,EAAEP,gBAAgB,CAAC;IAEtF,OAAO,MAAAmB,YAAA,CAAAZ,KAAA,CAAAa,GAAA;MAAA,SAEI,CACL,cAAc,EACdP,YAAY,CAACJ,KAA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