vuetify 3.1.13 → 3.1.15
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 +173 -105
- package/dist/json/importMap.json +68 -68
- package/dist/json/tags.json +18 -1
- package/dist/json/web-types.json +518 -251
- package/dist/vuetify-labs.css +448 -420
- package/dist/vuetify-labs.d.ts +1066 -658
- package/dist/vuetify-labs.esm.js +261 -159
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +261 -159
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +63 -35
- package/dist/vuetify.d.ts +911 -562
- package/dist/vuetify.esm.js +189 -98
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +189 -98
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +745 -724
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +9 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +55 -8
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +10 -0
- package/lib/components/VAutocomplete/index.d.ts +67 -49
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/index.d.ts +21 -16
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +36 -15
- package/lib/components/VChip/VChip.mjs +2 -2
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/index.d.ts +14 -14
- package/lib/components/VCombobox/VCombobox.css +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +12 -7
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +1 -1
- package/lib/components/VCombobox/index.d.ts +67 -49
- package/lib/components/VField/VField.mjs +3 -3
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/index.d.ts +26 -20
- package/lib/components/VFileInput/VFileInput.mjs +13 -18
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/index.d.ts +118 -79
- package/lib/components/VImg/VImg.mjs +3 -3
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +19 -19
- package/lib/components/VInput/VInput.mjs +16 -9
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.ts +36 -15
- package/lib/components/VList/VList.mjs +2 -1
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +12 -0
- package/lib/components/VList/VListItem.mjs +2 -2
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +5 -0
- package/lib/components/VList/index.d.ts +14 -14
- package/lib/components/VOverlay/locationStrategies.mjs +9 -4
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +1 -0
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.css +3 -1
- package/lib/components/VProgressCircular/VProgressCircular.sass +3 -1
- package/lib/components/VProgressCircular/_variables.scss +1 -0
- package/lib/components/VProgressLinear/VProgressLinear.css +5 -2
- package/lib/components/VProgressLinear/VProgressLinear.sass +3 -0
- package/lib/components/VProgressLinear/_variables.scss +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.ts +36 -15
- package/lib/components/VRangeSlider/VRangeSlider.mjs +2 -2
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.ts +36 -15
- package/lib/components/VSelect/VSelect.mjs +37 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +70 -49
- package/lib/components/VSlider/VSlider.mjs +2 -2
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/index.d.ts +36 -15
- package/lib/components/VSwitch/VSwitch.mjs +5 -3
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.ts +57 -15
- package/lib/components/VTextField/VTextField.mjs +6 -14
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/index.d.ts +153 -99
- package/lib/components/VTextarea/VTextarea.mjs +12 -17
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +117 -72
- package/lib/components/VToolbar/VToolbar.css +2 -0
- package/lib/components/VToolbar/VToolbar.sass +2 -0
- package/lib/components/VTreeview/_mixins.sass +0 -0
- package/lib/components/VTreeview/util/filterTreeItems.mjs +0 -0
- package/lib/components/VValidation/index.d.ts +10 -1
- package/lib/components/index.d.ts +891 -542
- package/lib/composables/focus.mjs +3 -2
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/items.mjs +7 -2
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +2 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/theme.mjs +1 -1
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/iconsets/mdi-svg.mjs +2 -2
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/index.d.ts +20 -20
- package/lib/labs/VDataTable/VDataTable.mjs +5 -5
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableFooter.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableHeaders.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +54 -48
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +6 -4
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +5 -4
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/options.mjs +2 -1
- package/lib/labs/VDataTable/composables/options.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +166 -107
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs +1 -0
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.ts +9 -9
- package/lib/labs/components.d.ts +175 -116
- package/lib/locale/el.mjs +0 -0
- package/lib/locale/index.mjs +0 -0
- package/lib/util/helpers.mjs +1 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -39,9 +39,9 @@ export const VImg = genericComponent()({
|
|
|
39
39
|
...makeTransitionProps()
|
|
40
40
|
},
|
|
41
41
|
emits: {
|
|
42
|
-
loadstart:
|
|
43
|
-
load:
|
|
44
|
-
error:
|
|
42
|
+
loadstart: value => true,
|
|
43
|
+
load: value => true,
|
|
44
|
+
error: value => true
|
|
45
45
|
},
|
|
46
46
|
setup(props, _ref) {
|
|
47
47
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VImg.mjs","names":["VResponsive","intersect","makeTransitionProps","MaybeTransition","computed","nextTick","onBeforeMount","ref","vShow","watch","withDirectives","convertToUnit","genericComponent","SUPPORTS_INTERSECTION","useRender","VImg","name","directives","props","aspectRatio","String","Number","alt","cover","Boolean","eager","gradient","lazySrc","options","type","Object","default","root","undefined","rootMargin","threshold","sizes","src","srcset","width","emits","loadstart","event","load","error","setup","_ref","emit","slots","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","value","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","complete","onError","onLoad","getSrc","img","timer","timeout","arguments","length","poll","clearTimeout","imgHeight","imgWidth","window","setTimeout","endsWith","startsWith","containClasses","__image","_createVNode","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","_withDirectives","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["import './VImg.sass'\n\n// Components\nimport { VResponsive } from '@/components/VResponsive'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Composables\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n ref,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\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: []\n placeholder: []\n error: []\n sources: []\n}\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: {\n aspectRatio: [String, Number],\n alt: String,\n cover: Boolean,\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 srcset: String,\n width: [String, Number],\n\n ...makeTransitionProps(),\n },\n\n emits: {\n loadstart: (event: string | undefined) => true,\n load: (event: string | undefined) => true,\n error: (event: string | undefined) => true,\n },\n\n setup (props, { emit, slots }) {\n const currentSrc = ref('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = ref<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = ref<number>()\n const naturalHeight = ref<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 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 onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n }\n\n function onLoad () {\n getSrc()\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 src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\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 src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\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 = ref(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 <VResponsive\n class={[\n 'v-img',\n { 'v-img--booting': !isBooted.value },\n ]}\n style={{ width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) }}\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 return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;;AAEA;AAAA,SACSA,WAAW,oCAEpB;AAAA,OACOC,SAAS,8CAEhB;AAAA,SACSC,mBAAmB,EAAEC,eAAe,4CAE7C;AACA,SACEC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,GAAG,EACHC,KAAK,EACLC,KAAK,EACLC,cAAc,QACT,KAAK;AAAA,SAEVC,aAAa,EACbC,gBAAgB,EAChBC,qBAAqB,EACrBC,SAAS,gCAGX;AAkBA,OAAO,MAAMC,IAAI,GAAGH,gBAAgB,EAAa,CAAC;EAChDI,IAAI,EAAE,MAAM;EAEZC,UAAU,EAAE;IAAEhB;EAAU,CAAC;EAEzBiB,KAAK,EAAE;IACLC,WAAW,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;IAC7BC,GAAG,EAAEF,MAAM;IACXG,KAAK,EAAEC,OAAO;IACdC,KAAK,EAAED,OAAO;IACdE,QAAQ,EAAEN,MAAM;IAChBO,OAAO,EAAEP,MAAM;IACfQ,OAAO,EAAE;MACPC,IAAI,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AAS,CAAC,MAAAiF,eAAA,CAAAZ,YAAA,CAAAnF,WAAA;MAAA,SAEC,CACL,OAAO,EACP;QAAE,gBAAgB,EAAE,CAAC4F,QAAQ,CAACpC;MAAM,CAAC,CACtC;MAAA,SACM;QAAEjB,KAAK,EAAE5B,aAAa,CAACO,KAAK,CAACqB,KAAK,KAAK,MAAM,GAAGa,YAAY,CAACI,KAAK,GAAGtC,KAAK,CAACqB,KAAK;MAAE,CAAC;MAAA,eAC5EpB,WAAW,CAACqC,KAAK;MAAA,cAClBtC,KAAK,CAACI,GAAG;MAAA,QACfJ,KAAK,CAACI,GAAG,GAAG,KAAK,GAAGW;IAAS;MAMpC+D,UAAU,EAAEA,CAAA,KAAAb,YAAA,CAAAc,SAAA,SAAAd,YAAA,CAAAD,OAAA,eAAAC,YAAA,CAAAG,cAAA,eAAAH,YAAA,CAAAO,UAAA,eAAAP,YAAA,CAAAI,aAAA,eAAAJ,YAAA,CAAAM,OAAA,eAQX;MACD1D,OAAO,EAAEiB,KAAK,CAACjB;IAAO,MAAAmE,iBAAA,eAdR;MACZC,OAAO,EAAE1C,IAAI;MACb7B,OAAO,EAAEV,KAAK,CAACU;IACjB,CAAC,EAAE,IAAI;MAAAwE,IAAA;IAAA,IAaV,CAAC;IAEF,OAAO;MACLnD,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VImg.mjs","names":["VResponsive","intersect","makeTransitionProps","MaybeTransition","computed","nextTick","onBeforeMount","ref","vShow","watch","withDirectives","convertToUnit","genericComponent","SUPPORTS_INTERSECTION","useRender","VImg","name","directives","props","aspectRatio","String","Number","alt","cover","Boolean","eager","gradient","lazySrc","options","type","Object","default","root","undefined","rootMargin","threshold","sizes","src","srcset","width","emits","loadstart","value","load","error","setup","_ref","emit","slots","currentSrc","image","state","naturalWidth","naturalHeight","normalisedSrc","aspect","init","val","oldVal","pollForSize","isIntersecting","lazyImg","Image","complete","onError","onLoad","getSrc","img","timer","timeout","arguments","length","poll","clearTimeout","imgHeight","imgWidth","window","setTimeout","endsWith","startsWith","containClasses","__image","_createVNode","sources","transition","__preloadImage","__placeholder","placeholder","__error","__gradient","backgroundImage","isBooted","stop","requestAnimationFrame","_withDirectives","additional","_Fragment","_resolveDirective","handler","once"],"sources":["../../../src/components/VImg/VImg.tsx"],"sourcesContent":["import './VImg.sass'\n\n// Components\nimport { VResponsive } from '@/components/VResponsive'\n\n// Directives\nimport intersect from '@/directives/intersect'\n\n// Composables\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Utilities\nimport {\n computed,\n nextTick,\n onBeforeMount,\n ref,\n vShow,\n watch,\n withDirectives,\n} from 'vue'\nimport {\n convertToUnit,\n genericComponent,\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: []\n placeholder: []\n error: []\n sources: []\n}\n\nexport const VImg = genericComponent<VImgSlots>()({\n name: 'VImg',\n\n directives: { intersect },\n\n props: {\n aspectRatio: [String, Number],\n alt: String,\n cover: Boolean,\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 srcset: String,\n width: [String, Number],\n\n ...makeTransitionProps(),\n },\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 = ref('') // Set from srcset\n const image = ref<HTMLImageElement>()\n const state = ref<'idle' | 'loading' | 'loaded' | 'error'>(props.eager ? 'loading' : 'idle')\n const naturalWidth = ref<number>()\n const naturalHeight = ref<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 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 onLoad()\n } else {\n if (!aspectRatio.value) pollForSize(image.value!)\n getSrc()\n }\n })\n }\n\n function onLoad () {\n getSrc()\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 src={ normalisedSrc.value.src }\n srcset={ normalisedSrc.value.srcset }\n alt={ props.alt }\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 src={ normalisedSrc.value.lazySrc }\n alt={ props.alt }\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 = ref(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 <VResponsive\n class={[\n 'v-img',\n { 'v-img--booting': !isBooted.value },\n ]}\n style={{ width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width) }}\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 return {\n currentSrc,\n image,\n state,\n naturalWidth,\n naturalHeight,\n }\n },\n})\n\nexport type VImg = InstanceType<typeof VImg>\n"],"mappings":";AAAA;;AAEA;AAAA,SACSA,WAAW,oCAEpB;AAAA,OACOC,SAAS,8CAEhB;AAAA,SACSC,mBAAmB,EAAEC,eAAe,4CAE7C;AACA,SACEC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,GAAG,EACHC,KAAK,EACLC,KAAK,EACLC,cAAc,QACT,KAAK;AAAA,SAEVC,aAAa,EACbC,gBAAgB,EAChBC,qBAAqB,EACrBC,SAAS,gCAGX;AAkBA,OAAO,MAAMC,IAAI,GAAGH,gBAAgB,EAAa,CAAC;EAChDI,IAAI,EAAE,MAAM;EAEZC,UAAU,EAAE;IAAEhB;EAAU,CAAC;EAEzBiB,KAAK,EAAE;IACLC,WAAW,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;IAC7BC,GAAG,EAAEF,MAAM;IACXG,KAAK,EAAEC,OAAO;IACdC,KAAK,EAAED,OAAO;IAC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C;UACJ,CAAC,CAAC;UACFkD,IAAI,EAAE;QACR;MACF,CAAC,CAAC;IACJ;IAEA9E,SAAS,CAAC,MAAAgF,eAAA,CAAAZ,YAAA,CAAAlF,WAAA;MAAA,SAEC,CACL,OAAO,EACP;QAAE,gBAAgB,EAAE,CAAC2F,QAAQ,CAACjD;MAAM,CAAC,CACtC;MAAA,SACM;QAAEH,KAAK,EAAE5B,aAAa,CAACO,KAAK,CAACqB,KAAK,KAAK,MAAM,GAAGa,YAAY,CAACV,KAAK,GAAGxB,KAAK,CAACqB,KAAK;MAAE,CAAC;MAAA,eAC5EpB,WAAW,CAACuB,KAAK;MAAA,cAClBxB,KAAK,CAACI,GAAG;MAAA,QACfJ,KAAK,CAACI,GAAG,GAAG,KAAK,GAAGW;IAAS;MAMpC8D,UAAU,EAAEA,CAAA,KAAAb,YAAA,CAAAc,SAAA,SAAAd,YAAA,CAAAD,OAAA,eAAAC,YAAA,CAAAG,cAAA,eAAAH,YAAA,CAAAO,UAAA,eAAAP,YAAA,CAAAI,aAAA,eAAAJ,YAAA,CAAAM,OAAA,eAQX;MACDzD,OAAO,EAAEiB,KAAK,CAACjB;IAAO,MAAAkE,iBAAA,eAdR;MACZC,OAAO,EAAE1C,IAAI;MACb5B,OAAO,EAAEV,KAAK,CAACU;IACjB,CAAC,EAAE,IAAI;MAAAuE,IAAA;IAAA,IAaV,CAAC;IAEF,OAAO;MACLlD,UAAU;MACVC,KAAK;MACLC,KAAK;MACLC,YAAY;MACZC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -64,9 +64,9 @@ declare const VImg: {
|
|
|
64
64
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
65
65
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
66
66
|
} & {
|
|
67
|
-
onError?: ((
|
|
68
|
-
onLoad?: ((
|
|
69
|
-
onLoadstart?: ((
|
|
67
|
+
onError?: ((value: string | undefined) => any) | undefined;
|
|
68
|
+
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
69
|
+
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
70
70
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "transition" | "eager" | "options" | "cover" | "src">;
|
|
71
71
|
$attrs: {
|
|
72
72
|
[x: string]: unknown;
|
|
@@ -79,7 +79,7 @@ declare const VImg: {
|
|
|
79
79
|
}>;
|
|
80
80
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
81
81
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
82
|
-
$emit: ((event: "error",
|
|
82
|
+
$emit: ((event: "error", value: string | undefined) => void) & ((event: "load", value: string | undefined) => void) & ((event: "loadstart", value: string | undefined) => void);
|
|
83
83
|
$el: any;
|
|
84
84
|
$options: vue.ComponentOptionsBase<{
|
|
85
85
|
transition: string | boolean | (vue.TransitionProps & {
|
|
@@ -122,9 +122,9 @@ declare const VImg: {
|
|
|
122
122
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
123
123
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
124
124
|
} & {
|
|
125
|
-
onError?: ((
|
|
126
|
-
onLoad?: ((
|
|
127
|
-
onLoadstart?: ((
|
|
125
|
+
onError?: ((value: string | undefined) => any) | undefined;
|
|
126
|
+
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
127
|
+
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
128
128
|
}, {
|
|
129
129
|
currentSrc: vue.Ref<string>;
|
|
130
130
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
@@ -132,9 +132,9 @@ declare const VImg: {
|
|
|
132
132
|
naturalWidth: vue.Ref<number | undefined>;
|
|
133
133
|
naturalHeight: vue.Ref<number | undefined>;
|
|
134
134
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
135
|
-
loadstart: (
|
|
136
|
-
load: (
|
|
137
|
-
error: (
|
|
135
|
+
loadstart: (value: string | undefined) => true;
|
|
136
|
+
load: (value: string | undefined) => true;
|
|
137
|
+
error: (value: string | undefined) => true;
|
|
138
138
|
}, string, {
|
|
139
139
|
transition: string | boolean | (vue.TransitionProps & {
|
|
140
140
|
component?: vue.Component | undefined;
|
|
@@ -204,9 +204,9 @@ declare const VImg: {
|
|
|
204
204
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
205
205
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
206
206
|
} & {
|
|
207
|
-
onError?: ((
|
|
208
|
-
onLoad?: ((
|
|
209
|
-
onLoadstart?: ((
|
|
207
|
+
onError?: ((value: string | undefined) => any) | undefined;
|
|
208
|
+
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
209
|
+
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
210
210
|
} & vue.ShallowUnwrapRef<{
|
|
211
211
|
currentSrc: vue.Ref<string>;
|
|
212
212
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
@@ -258,9 +258,9 @@ declare const VImg: {
|
|
|
258
258
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
259
259
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
260
260
|
} & {
|
|
261
|
-
onError?: ((
|
|
262
|
-
onLoad?: ((
|
|
263
|
-
onLoadstart?: ((
|
|
261
|
+
onError?: ((value: string | undefined) => any) | undefined;
|
|
262
|
+
onLoad?: ((value: string | undefined) => any) | undefined;
|
|
263
|
+
onLoadstart?: ((value: string | undefined) => any) | undefined;
|
|
264
264
|
}, {
|
|
265
265
|
currentSrc: vue.Ref<string>;
|
|
266
266
|
image: vue.Ref<HTMLImageElement | undefined>;
|
|
@@ -268,9 +268,9 @@ declare const VImg: {
|
|
|
268
268
|
naturalWidth: vue.Ref<number | undefined>;
|
|
269
269
|
naturalHeight: vue.Ref<number | undefined>;
|
|
270
270
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
271
|
-
loadstart: (
|
|
272
|
-
load: (
|
|
273
|
-
error: (
|
|
271
|
+
loadstart: (value: string | undefined) => true;
|
|
272
|
+
load: (value: string | undefined) => true;
|
|
273
|
+
error: (value: string | undefined) => true;
|
|
274
274
|
}, string, {
|
|
275
275
|
transition: string | boolean | (vue.TransitionProps & {
|
|
276
276
|
component?: vue.Component | undefined;
|
|
@@ -8,13 +8,15 @@ import { IconValue } from "../../composables/icons.mjs";
|
|
|
8
8
|
import { makeDensityProps, useDensity } from "../../composables/density.mjs";
|
|
9
9
|
import { makeValidationProps, useValidation } from "../../composables/validation.mjs"; // Utilities
|
|
10
10
|
import { computed } from 'vue';
|
|
11
|
-
import { EventProp, genericComponent, getUid,
|
|
11
|
+
import { EventProp, genericComponent, getUid, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
|
12
12
|
import { useInputIcon } from "./InputIcon.mjs";
|
|
13
13
|
export const makeVInputProps = propsFactory({
|
|
14
14
|
id: String,
|
|
15
15
|
appendIcon: IconValue,
|
|
16
16
|
prependIcon: IconValue,
|
|
17
17
|
hideDetails: [Boolean, String],
|
|
18
|
+
hint: String,
|
|
19
|
+
persistentHint: Boolean,
|
|
18
20
|
messages: {
|
|
19
21
|
type: [Array, String],
|
|
20
22
|
default: () => []
|
|
@@ -24,8 +26,8 @@ export const makeVInputProps = propsFactory({
|
|
|
24
26
|
default: 'horizontal',
|
|
25
27
|
validator: v => ['horizontal', 'vertical'].includes(v)
|
|
26
28
|
},
|
|
27
|
-
'onClick:prepend': EventProp,
|
|
28
|
-
'onClick:append': EventProp,
|
|
29
|
+
'onClick:prepend': EventProp(),
|
|
30
|
+
'onClick:append': EventProp(),
|
|
29
31
|
...makeDensityProps(),
|
|
30
32
|
...makeValidationProps()
|
|
31
33
|
}, 'v-input');
|
|
@@ -78,10 +80,19 @@ export const VInput = genericComponent()({
|
|
|
78
80
|
resetValidation,
|
|
79
81
|
validate
|
|
80
82
|
}));
|
|
83
|
+
const messages = computed(() => {
|
|
84
|
+
if (errorMessages.value.length > 0) {
|
|
85
|
+
return errorMessages.value;
|
|
86
|
+
} else if (props.hint && (props.persistentHint || props.focused)) {
|
|
87
|
+
return props.hint;
|
|
88
|
+
} else {
|
|
89
|
+
return props.messages;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
81
92
|
useRender(() => {
|
|
82
93
|
const hasPrepend = !!(slots.prepend || props.prependIcon);
|
|
83
94
|
const hasAppend = !!(slots.append || props.appendIcon);
|
|
84
|
-
const hasMessages =
|
|
95
|
+
const hasMessages = messages.value.length > 0;
|
|
85
96
|
const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
|
|
86
97
|
return _createVNode("div", {
|
|
87
98
|
"class": ['v-input', `v-input--${props.direction}`, densityClasses.value, validationClasses.value]
|
|
@@ -104,7 +115,7 @@ export const VInput = genericComponent()({
|
|
|
104
115
|
}, [_createVNode(VMessages, {
|
|
105
116
|
"id": messagesId.value,
|
|
106
117
|
"active": hasMessages,
|
|
107
|
-
"messages":
|
|
118
|
+
"messages": messages.value
|
|
108
119
|
}, {
|
|
109
120
|
message: slots.message
|
|
110
121
|
}), slots.details?.(slotProps.value)])]);
|
|
@@ -116,8 +127,4 @@ export const VInput = genericComponent()({
|
|
|
116
127
|
};
|
|
117
128
|
}
|
|
118
129
|
});
|
|
119
|
-
export function filterInputProps(props) {
|
|
120
|
-
const keys = Object.keys(VInput.props).filter(k => !isOn(k));
|
|
121
|
-
return pick(props, keys);
|
|
122
|
-
}
|
|
123
130
|
//# sourceMappingURL=VInput.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VInput.mjs","names":["VMessages","IconValue","makeDensityProps","useDensity","makeValidationProps","useValidation","computed","EventProp","genericComponent","getUid","
|
|
1
|
+
{"version":3,"file":"VInput.mjs","names":["VMessages","IconValue","makeDensityProps","useDensity","makeValidationProps","useValidation","computed","EventProp","genericComponent","getUid","propsFactory","useRender","useInputIcon","makeVInputProps","id","String","appendIcon","prependIcon","hideDetails","Boolean","hint","persistentHint","messages","type","Array","default","direction","validator","v","includes","VInput","name","props","emits","val","setup","_ref","attrs","slots","emit","densityClasses","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","message"],"sources":["../../../src/components/VInput/VInput.tsx"],"sourcesContent":["// Styles\nimport './VInput.sass'\n\n// Components\nimport { VMessages } from '@/components/VMessages'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { makeDensityProps, useDensity } from '@/composables/density'\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 { MakeSlots } from '@/util'\nimport { useInputIcon } from '@/components/VInput/InputIcon'\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 prependIcon: IconValue,\n hideDetails: [Boolean, String] as PropType<boolean | 'auto'>,\n hint: String,\n persistentHint: Boolean,\n messages: {\n type: [Array, String] as PropType<string | 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 ...makeDensityProps(),\n ...makeValidationProps(),\n}, 'v-input')\n\nexport type VInputSlots = MakeSlots<{\n default: [VInputSlot]\n prepend: [VInputSlot]\n append: [VInputSlot]\n details: [VInputSlot]\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 { 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 (errorMessages.value.length > 0) {\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 class={[\n 'v-input',\n `v-input--${props.direction}`,\n densityClasses.value,\n validationClasses.value,\n ]}\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 }\n },\n})\n\nexport type VInput = InstanceType<typeof VInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,SAAS,kCAElB;AAAA,SACSC,SAAS;AAAA,SACTC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,mBAAmB,EAAEC,aAAa,4CAE3C;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,SAAS,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAErE;AAAA,SAGSC,YAAY;AAgBrB,OAAO,MAAMC,eAAe,GAAGH,YAAY,CAAC;EAC1CI,EAAE,EAAEC,MAAM;EACVC,UAAU,EAAEf,SAAS;EACrBgB,WAAW,EAAEhB,SAAS;EACtBiB,WAAW,EAAE,CAACC,OAAO,EAAEJ,MAAM,CAA+B;EAC5DK,IAAI,EAAEL,MAAM;EACZM,cAAc,EAAEF,OAAO;EACvBG,QAAQ,EAAE;IACRC,IAAI,EAAE,CAACC,KAAK,EAAET,MAAM,CAAgC;IACpDU,OAAO,EAAEA,CAAA,KAAO;EAClB,CAAC;EACDC,SAAS,EAAE;IACTH,IAAI,EAAER,MAA6C;IACnDU,OAAO,EAAE,YAAY;IACrBE,SAAS,EAAGC,CAAM,IAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAACC,QAAQ,CAACD,CAAC;EAC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SACF;MAAkB,IACzB5B,KAAK,CAACb,OAAO,GAAG+B,SAAS,CAACZ,KAAK,CAAC,EAErC,EAECiB,SAAS,IAAAK,YAAA;QAAA,OACA,QAAQ;QAAA,SAAO;MAAiB,IACrClC,KAAK,CAAChB,UAAU,IAAAkD,YAAA,CAAAzB,SAAA;QAAA,OAEV,aAAa;QAAA,QACZ;MAAQ,QAEhB,EAECH,KAAK,CAACwB,MAAM,GAAGN,SAAS,CAACZ,KAAK,CAAC,EAEpC,EAECoB,UAAU,IAAAE,YAAA;QAAA,SACC;MAAkB,IAAAA,YAAA,CAAAlE,SAAA;QAAA,MAEpB2C,UAAU,CAACC,KAAK;QAAA,UACZmB,WAAW;QAAA,YACTzC,QAAQ,CAACsB;MAAK,GAChB;QAAEuB,OAAO,EAAE7B,KAAK,CAAC6B;MAAQ,CAAC,GAGnC7B,KAAK,CAAC2B,OAAO,GAAGT,SAAS,CAACZ,KAAK,CAAC,EAErC;IAGP,CAAC,CAAC;IAEF,OAAO;MACLQ,KAAK;MACLC,eAAe;MACfC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -5,8 +5,8 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
|
|
|
5
5
|
filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): [yes: Partial<Pick<T, U>>, no: Omit<T, U>];
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
type EventProp<T = (...args:
|
|
9
|
-
declare const EventProp: PropType<EventProp<(...args:
|
|
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
10
|
|
|
11
11
|
type Density = null | 'default' | 'comfortable' | 'compact';
|
|
12
12
|
|
|
@@ -44,6 +44,7 @@ declare const VInput: {
|
|
|
44
44
|
errorMessages: string | string[];
|
|
45
45
|
maxErrors: string | number;
|
|
46
46
|
rules: ValidationRule[];
|
|
47
|
+
persistentHint: boolean;
|
|
47
48
|
}> & Omit<{
|
|
48
49
|
error: boolean;
|
|
49
50
|
direction: "horizontal" | "vertical";
|
|
@@ -55,6 +56,7 @@ declare const VInput: {
|
|
|
55
56
|
errorMessages: string | string[];
|
|
56
57
|
maxErrors: string | number;
|
|
57
58
|
rules: ValidationRule[];
|
|
59
|
+
persistentHint: boolean;
|
|
58
60
|
} & {
|
|
59
61
|
id?: string | undefined;
|
|
60
62
|
name?: string | undefined;
|
|
@@ -62,10 +64,12 @@ declare const VInput: {
|
|
|
62
64
|
modelValue?: any;
|
|
63
65
|
prependIcon?: IconValue | undefined;
|
|
64
66
|
appendIcon?: IconValue | undefined;
|
|
65
|
-
'onClick:append'?: EventProp<(
|
|
66
|
-
'onClick:prepend'?: EventProp<(
|
|
67
|
+
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
68
|
+
'onClick:prepend'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
69
|
+
'onUpdate:focused'?: EventProp<[FocusEvent], (args_0: FocusEvent) => any> | undefined;
|
|
67
70
|
validateOn?: "input" | "blur" | "submit" | undefined;
|
|
68
71
|
validationValue?: any;
|
|
72
|
+
hint?: string | undefined;
|
|
69
73
|
hideDetails?: boolean | "auto" | undefined;
|
|
70
74
|
} & {
|
|
71
75
|
$children?: {} | vue.VNodeChild | {
|
|
@@ -93,7 +97,7 @@ declare const VInput: {
|
|
|
93
97
|
"v-slot:details"?: false | ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
94
98
|
} & {
|
|
95
99
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
96
|
-
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "error" | "direction" | "disabled" | "readonly" | "messages" | "density" | "focused" | "errorMessages" | "maxErrors" | "rules">;
|
|
100
|
+
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "error" | "direction" | "disabled" | "readonly" | "messages" | "density" | "focused" | "errorMessages" | "maxErrors" | "rules" | "persistentHint">;
|
|
97
101
|
$attrs: {
|
|
98
102
|
[x: string]: unknown;
|
|
99
103
|
};
|
|
@@ -118,6 +122,7 @@ declare const VInput: {
|
|
|
118
122
|
errorMessages: string | string[];
|
|
119
123
|
maxErrors: string | number;
|
|
120
124
|
rules: ValidationRule[];
|
|
125
|
+
persistentHint: boolean;
|
|
121
126
|
} & {
|
|
122
127
|
id?: string | undefined;
|
|
123
128
|
name?: string | undefined;
|
|
@@ -125,10 +130,12 @@ declare const VInput: {
|
|
|
125
130
|
modelValue?: any;
|
|
126
131
|
prependIcon?: IconValue | undefined;
|
|
127
132
|
appendIcon?: IconValue | undefined;
|
|
128
|
-
'onClick:append'?: EventProp<(
|
|
129
|
-
'onClick:prepend'?: EventProp<(
|
|
133
|
+
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
134
|
+
'onClick:prepend'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
135
|
+
'onUpdate:focused'?: EventProp<[FocusEvent], (args_0: FocusEvent) => any> | undefined;
|
|
130
136
|
validateOn?: "input" | "blur" | "submit" | undefined;
|
|
131
137
|
validationValue?: any;
|
|
138
|
+
hint?: string | undefined;
|
|
132
139
|
hideDetails?: boolean | "auto" | undefined;
|
|
133
140
|
} & {
|
|
134
141
|
$children?: {} | vue.VNodeChild | {
|
|
@@ -173,6 +180,7 @@ declare const VInput: {
|
|
|
173
180
|
errorMessages: string | string[];
|
|
174
181
|
maxErrors: string | number;
|
|
175
182
|
rules: ValidationRule[];
|
|
183
|
+
persistentHint: boolean;
|
|
176
184
|
}, {}, string> & {
|
|
177
185
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
178
186
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -204,6 +212,7 @@ declare const VInput: {
|
|
|
204
212
|
errorMessages: string | string[];
|
|
205
213
|
maxErrors: string | number;
|
|
206
214
|
rules: ValidationRule[];
|
|
215
|
+
persistentHint: boolean;
|
|
207
216
|
} & {
|
|
208
217
|
id?: string | undefined;
|
|
209
218
|
name?: string | undefined;
|
|
@@ -211,10 +220,12 @@ declare const VInput: {
|
|
|
211
220
|
modelValue?: any;
|
|
212
221
|
prependIcon?: IconValue | undefined;
|
|
213
222
|
appendIcon?: IconValue | undefined;
|
|
214
|
-
'onClick:append'?: EventProp<(
|
|
215
|
-
'onClick:prepend'?: EventProp<(
|
|
223
|
+
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
224
|
+
'onClick:prepend'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
225
|
+
'onUpdate:focused'?: EventProp<[FocusEvent], (args_0: FocusEvent) => any> | undefined;
|
|
216
226
|
validateOn?: "input" | "blur" | "submit" | undefined;
|
|
217
227
|
validationValue?: any;
|
|
228
|
+
hint?: string | undefined;
|
|
218
229
|
hideDetails?: boolean | "auto" | undefined;
|
|
219
230
|
} & {
|
|
220
231
|
$children?: {} | vue.VNodeChild | {
|
|
@@ -261,6 +272,7 @@ declare const VInput: {
|
|
|
261
272
|
errorMessages: string | string[];
|
|
262
273
|
maxErrors: string | number;
|
|
263
274
|
rules: ValidationRule[];
|
|
275
|
+
persistentHint: boolean;
|
|
264
276
|
} & {
|
|
265
277
|
id?: string | undefined;
|
|
266
278
|
name?: string | undefined;
|
|
@@ -268,10 +280,12 @@ declare const VInput: {
|
|
|
268
280
|
modelValue?: any;
|
|
269
281
|
prependIcon?: IconValue | undefined;
|
|
270
282
|
appendIcon?: IconValue | undefined;
|
|
271
|
-
'onClick:append'?: EventProp<(
|
|
272
|
-
'onClick:prepend'?: EventProp<(
|
|
283
|
+
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
284
|
+
'onClick:prepend'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
285
|
+
'onUpdate:focused'?: EventProp<[FocusEvent], (args_0: FocusEvent) => any> | undefined;
|
|
273
286
|
validateOn?: "input" | "blur" | "submit" | undefined;
|
|
274
287
|
validationValue?: any;
|
|
288
|
+
hint?: string | undefined;
|
|
275
289
|
hideDetails?: boolean | "auto" | undefined;
|
|
276
290
|
} & {
|
|
277
291
|
$children?: {} | vue.VNodeChild | {
|
|
@@ -316,8 +330,10 @@ declare const VInput: {
|
|
|
316
330
|
errorMessages: string | string[];
|
|
317
331
|
maxErrors: string | number;
|
|
318
332
|
rules: ValidationRule[];
|
|
333
|
+
persistentHint: boolean;
|
|
319
334
|
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
|
|
320
335
|
focused: BooleanConstructor;
|
|
336
|
+
'onUpdate:focused': PropType<EventProp<[FocusEvent], (args_0: FocusEvent) => any>>;
|
|
321
337
|
disabled: BooleanConstructor;
|
|
322
338
|
error: BooleanConstructor;
|
|
323
339
|
errorMessages: {
|
|
@@ -347,6 +363,8 @@ declare const VInput: {
|
|
|
347
363
|
appendIcon: PropType<IconValue>;
|
|
348
364
|
prependIcon: PropType<IconValue>;
|
|
349
365
|
hideDetails: PropType<boolean | "auto">;
|
|
366
|
+
hint: StringConstructor;
|
|
367
|
+
persistentHint: BooleanConstructor;
|
|
350
368
|
messages: {
|
|
351
369
|
type: PropType<string | string[]>;
|
|
352
370
|
default: () => never[];
|
|
@@ -356,10 +374,11 @@ declare const VInput: {
|
|
|
356
374
|
default: string;
|
|
357
375
|
validator: (v: any) => boolean;
|
|
358
376
|
};
|
|
359
|
-
'onClick:prepend': PropType<EventProp<(
|
|
360
|
-
'onClick:append': PropType<EventProp<(
|
|
377
|
+
'onClick:prepend': PropType<EventProp<[MouseEvent], (args_0: MouseEvent) => any>>;
|
|
378
|
+
'onClick:append': PropType<EventProp<[MouseEvent], (args_0: MouseEvent) => any>>;
|
|
361
379
|
}, vue.ExtractPropTypes<{
|
|
362
380
|
focused: BooleanConstructor;
|
|
381
|
+
'onUpdate:focused': PropType<EventProp<[FocusEvent], (args_0: FocusEvent) => any>>;
|
|
363
382
|
disabled: BooleanConstructor;
|
|
364
383
|
error: BooleanConstructor;
|
|
365
384
|
errorMessages: {
|
|
@@ -389,6 +408,8 @@ declare const VInput: {
|
|
|
389
408
|
appendIcon: PropType<IconValue>;
|
|
390
409
|
prependIcon: PropType<IconValue>;
|
|
391
410
|
hideDetails: PropType<boolean | "auto">;
|
|
411
|
+
hint: StringConstructor;
|
|
412
|
+
persistentHint: BooleanConstructor;
|
|
392
413
|
messages: {
|
|
393
414
|
type: PropType<string | string[]>;
|
|
394
415
|
default: () => never[];
|
|
@@ -398,8 +419,8 @@ declare const VInput: {
|
|
|
398
419
|
default: string;
|
|
399
420
|
validator: (v: any) => boolean;
|
|
400
421
|
};
|
|
401
|
-
'onClick:prepend': PropType<EventProp<(
|
|
402
|
-
'onClick:append': PropType<EventProp<(
|
|
422
|
+
'onClick:prepend': PropType<EventProp<[MouseEvent], (args_0: MouseEvent) => any>>;
|
|
423
|
+
'onClick:append': PropType<EventProp<[MouseEvent], (args_0: MouseEvent) => any>>;
|
|
403
424
|
}>>;
|
|
404
425
|
type VInput = InstanceType<typeof VInput>;
|
|
405
426
|
|
|
@@ -174,7 +174,8 @@ export const VList = genericComponent()({
|
|
|
174
174
|
}
|
|
175
175
|
function focus(location) {
|
|
176
176
|
if (!contentRef.value) return;
|
|
177
|
-
const
|
|
177
|
+
const targets = ['button', '[href]', 'input', 'select', 'textarea', '[tabindex]'].map(s => `${s}:not([tabindex="-1"])`).join(', ');
|
|
178
|
+
const focusable = [...contentRef.value.querySelectorAll(targets)].filter(el => !el.hasAttribute('disabled'));
|
|
178
179
|
const idx = focusable.indexOf(document.activeElement);
|
|
179
180
|
if (!location) {
|
|
180
181
|
if (!contentRef.value.contains(document.activeElement)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VList.mjs","names":["VListChildren","createList","makeBorderProps","useBorder","makeDensityProps","useDensity","makeDimensionProps","useDimension","makeElevationProps","useElevation","makeItemsProps","makeNestedProps","useNested","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","makeVariantProps","provideDefaults","useBackgroundColor","computed","ref","toRef","genericComponent","getPropertyFromItem","pick","useRender","isPrimitive","value","transformItem","props","item","type","itemType","title","itemTitle","itemValue","undefined","children","itemChildren","itemProps","_props","transformItems","raw","items","array","push","useListItems","VList","name","activeColor","String","activeClass","bgColor","disabled","Boolean","lines","default","nav","selectStrategy","openStrategy","variant","emits","val","setup","_ref","slots","themeClasses","backgroundColorClasses","backgroundColorStyles","borderClasses","densityClasses","dimensionStyles","elevationClasses","roundedClasses","open","select","lineClasses","color","VListGroup","VListItem","density","isFocused","contentRef","onFocusin","e","onFocusout","onFocus","relatedTarget","contains","focus","onKeydown","key","preventDefault","location","focusable","querySelectorAll","filter","el","hasAttribute","idx","indexOf","document","activeElement","at","idxx","inc","offsetParent","length","_createVNode","tag"],"sources":["../../../src/components/VList/VList.tsx"],"sourcesContent":["// Styles\nimport './VList.sass'\n\n// Components\nimport { VListChildren } from './VListChildren'\n\n// Composables\nimport { createList } from './list'\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { makeItemsProps } from '@/composables/items'\nimport { makeNestedProps, useNested } from '@/composables/nested/nested'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { makeVariantProps } from '@/composables/variant'\nimport { provideDefaults } from '@/composables/defaults'\nimport { useBackgroundColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, toRef } from 'vue'\nimport { genericComponent, getPropertyFromItem, pick, useRender } from '@/util'\n\n// Types\nimport type { InternalItem, ItemProps } from '@/composables/items'\nimport type { SlotsToProps } from '@/util'\nimport type { PropType } from 'vue'\n\nexport interface InternalListItem extends InternalItem {\n type?: 'item' | 'subheader' | 'divider'\n}\n\nfunction isPrimitive (value: unknown): value is string | number | boolean {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean'\n}\n\nfunction transformItem (props: ItemProps & { itemType: string }, item: any): InternalListItem {\n const type = getPropertyFromItem(item, props.itemType, 'item')\n const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle)\n const value = getPropertyFromItem(item, props.itemValue, undefined)\n const children = getPropertyFromItem(item, props.itemChildren)\n const itemProps = props.itemProps === true ? pick(item, ['children'])[1] : getPropertyFromItem(item, props.itemProps)\n\n const _props = {\n title,\n value,\n ...itemProps,\n }\n\n return {\n type,\n title: _props.title,\n value: _props.value,\n props: _props,\n children: type === 'item' && children ? transformItems(props, children) : undefined,\n raw: item,\n }\n}\n\nfunction transformItems (props: ItemProps & { itemType: string }, items: (string | object)[]) {\n const array: InternalListItem[] = []\n\n for (const item of items) {\n array.push(transformItem(props, item))\n }\n\n return array\n}\n\nfunction useListItems (props: ItemProps & { itemType: string }) {\n const items = computed(() => transformItems(props, props.items))\n\n return { items }\n}\n\nexport const VList = genericComponent<new <T>() => {\n $props: {\n items?: T[]\n } & SlotsToProps<{\n subheader: []\n header: [{ props: Record<string, unknown> }]\n item: [T]\n }>\n}>()({\n name: 'VList',\n\n props: {\n activeColor: String,\n activeClass: String,\n bgColor: String,\n disabled: Boolean,\n lines: {\n type: [Boolean, String] as PropType<'one' | 'two' | 'three' | false>,\n default: 'one',\n },\n nav: Boolean,\n\n ...makeNestedProps({\n selectStrategy: 'single-leaf' as const,\n openStrategy: 'list' as const,\n }),\n ...makeBorderProps(),\n ...makeDensityProps(),\n ...makeDimensionProps(),\n ...makeElevationProps(),\n itemType: {\n type: String,\n default: 'type',\n },\n ...makeItemsProps(),\n ...makeRoundedProps(),\n ...makeTagProps(),\n ...makeThemeProps(),\n ...makeVariantProps({ variant: 'text' } as const),\n },\n\n emits: {\n 'update:selected': (val: unknown[]) => true,\n 'update:opened': (val: unknown[]) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const { themeClasses } = provideTheme(props)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { borderClasses } = useBorder(props)\n const { densityClasses } = useDensity(props)\n const { dimensionStyles } = useDimension(props)\n const { elevationClasses } = useElevation(props)\n const { roundedClasses } = useRounded(props)\n const { open, select } = useNested(props)\n const lineClasses = computed(() => props.lines ? `v-list--${props.lines}-line` : undefined)\n const activeColor = toRef(props, 'activeColor')\n const color = toRef(props, 'color')\n\n createList()\n\n provideDefaults({\n VListGroup: {\n activeColor,\n color,\n },\n VListItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n nav: toRef(props, 'nav'),\n variant: toRef(props, 'variant'),\n },\n })\n\n const isFocused = ref(false)\n const contentRef = ref<HTMLElement>()\n function onFocusin (e: FocusEvent) {\n isFocused.value = true\n }\n\n function onFocusout (e: FocusEvent) {\n isFocused.value = false\n }\n\n function onFocus (e: FocusEvent) {\n if (\n !isFocused.value &&\n !(e.relatedTarget && contentRef.value?.contains(e.relatedTarget as Node))\n ) focus()\n }\n\n function onKeydown (e: KeyboardEvent) {\n if (!contentRef.value) return\n\n if (e.key === 'ArrowDown') {\n focus('next')\n } else if (e.key === 'ArrowUp') {\n focus('prev')\n } else if (e.key === 'Home') {\n focus('first')\n } else if (e.key === 'End') {\n focus('last')\n } else {\n return\n }\n\n e.preventDefault()\n }\n\n function focus (location?: 'next' | 'prev' | 'first' | 'last') {\n if (!contentRef.value) return\n\n const focusable = [...contentRef.value.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )].filter(el => !el.hasAttribute('disabled')) as HTMLElement[]\n const idx = focusable.indexOf(document.activeElement as HTMLElement)\n\n if (!location) {\n if (!contentRef.value.contains(document.activeElement)) {\n focusable[0]?.focus()\n }\n } else if (location === 'first') {\n focusable[0]?.focus()\n } else if (location === 'last') {\n focusable.at(-1)?.focus()\n } else {\n let el\n let idxx = idx\n const inc = location === 'next' ? 1 : -1\n do {\n idxx += inc\n el = focusable[idxx]\n } while ((!el || el.offsetParent == null) && idxx < focusable.length && idxx >= 0)\n if (el) el.focus()\n else focus(location === 'next' ? 'first' : 'last')\n }\n }\n\n useRender(() => {\n return (\n <props.tag\n ref={ contentRef }\n class={[\n 'v-list',\n {\n 'v-list--disabled': props.disabled,\n 'v-list--nav': props.nav,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n borderClasses.value,\n densityClasses.value,\n elevationClasses.value,\n lineClasses.value,\n roundedClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n dimensionStyles.value,\n ]}\n role=\"listbox\"\n aria-activedescendant={ undefined }\n onFocusin={ onFocusin }\n onFocusout={ onFocusout }\n onFocus={ onFocus }\n onKeydown={ onKeydown }\n >\n <VListChildren items={ items.value } v-slots={ slots }></VListChildren>\n </props.tag>\n )\n })\n\n return {\n open,\n select,\n focus,\n }\n },\n})\n\nexport type VList = InstanceType<typeof VList>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,aAAa,+BAEtB;AAAA,SACSC,UAAU;AAAA,SACVC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc;AAAA,SACdC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY;A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AAIC,GAAG;UACXR,EAAE,GAAGH,SAAS,CAACU,IAAI,CAAC;QACtB,CAAC,QAAQ,CAAC,CAACP,EAAE,IAAIA,EAAE,CAACS,YAAY,IAAI,IAAI,KAAKF,IAAI,GAAGV,SAAS,CAACa,MAAM,IAAIH,IAAI,IAAI,CAAC;QACjF,IAAIP,EAAE,EAAEA,EAAE,CAACR,KAAK,EAAE,MACbA,KAAK,CAACI,QAAQ,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;MACpD;IACF;IAEApE,SAAS,CAAC,MAAM;MACd,OAAAmF,YAAA,CAAA/E,KAAA,CAAAgF,GAAA;QAAA,OAEU3B,UAAU;QAAA,SACT,CACL,QAAQ,EACR;UACE,kBAAkB,EAAErD,KAAK,CAACwB,QAAQ;UAClC,aAAa,EAAExB,KAAK,CAAC4B;QACvB,CAAC,EACDS,YAAY,CAACvC,KAAK,EAClBwC,sBAAsB,CAACxC,KAAK,EAC5B0C,aAAa,CAAC1C,KAAK,EACnB2C,cAAc,CAAC3C,KAAK,EACpB6C,gBAAgB,CAAC7C,KAAK,EACtBiD,WAAW,CAACjD,KAAK,EACjB8C,cAAc,CAAC9C,KAAK,CACrB;QAAA,SACM,CACLyC,qBAAqB,CAACzC,KAAK,EAC3B4C,eAAe,CAAC5C,KAAK,CACtB;QAAA,QACI,SAAS;QAAA,yBACUS,SAAS;QAAA,aACrB+C,SAAS;QAAA,cACRE,UAAU;QAAA,WACbC,OAAO;QAAA,aACLI;MAAS;QAAAlC,OAAA,EAAAA,CAAA,MAAAoD,YAAA,CAAA9G,aAAA;UAAA,SAEE6C,KAAK,CAAChB;QAAK,GAAasC,KAAK;MAAA;IAG1D,CAAC,CAAC;IAEF,OAAO;MACLS,IAAI;MACJC,MAAM;MACNc;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VList.mjs","names":["VListChildren","createList","makeBorderProps","useBorder","makeDensityProps","useDensity","makeDimensionProps","useDimension","makeElevationProps","useElevation","makeItemsProps","makeNestedProps","useNested","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","makeVariantProps","provideDefaults","useBackgroundColor","computed","ref","toRef","genericComponent","getPropertyFromItem","pick","useRender","isPrimitive","value","transformItem","props","item","type","itemType","title","itemTitle","itemValue","undefined","children","itemChildren","itemProps","_props","transformItems","raw","items","array","push","useListItems","VList","name","activeColor","String","activeClass","bgColor","disabled","Boolean","lines","default","nav","selectStrategy","openStrategy","variant","emits","val","setup","_ref","slots","themeClasses","backgroundColorClasses","backgroundColorStyles","borderClasses","densityClasses","dimensionStyles","elevationClasses","roundedClasses","open","select","lineClasses","color","VListGroup","VListItem","density","isFocused","contentRef","onFocusin","e","onFocusout","onFocus","relatedTarget","contains","focus","onKeydown","key","preventDefault","location","targets","map","s","join","focusable","querySelectorAll","filter","el","hasAttribute","idx","indexOf","document","activeElement","at","idxx","inc","offsetParent","length","_createVNode","tag"],"sources":["../../../src/components/VList/VList.tsx"],"sourcesContent":["// Styles\nimport './VList.sass'\n\n// Components\nimport { VListChildren } from './VListChildren'\n\n// Composables\nimport { createList } from './list'\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { makeItemsProps } from '@/composables/items'\nimport { makeNestedProps, useNested } from '@/composables/nested/nested'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { makeVariantProps } from '@/composables/variant'\nimport { provideDefaults } from '@/composables/defaults'\nimport { useBackgroundColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, toRef } from 'vue'\nimport { genericComponent, getPropertyFromItem, pick, useRender } from '@/util'\n\n// Types\nimport type { InternalItem, ItemProps } from '@/composables/items'\nimport type { SlotsToProps } from '@/util'\nimport type { PropType } from 'vue'\n\nexport interface InternalListItem extends InternalItem {\n type?: 'item' | 'subheader' | 'divider'\n}\n\nfunction isPrimitive (value: unknown): value is string | number | boolean {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean'\n}\n\nfunction transformItem (props: ItemProps & { itemType: string }, item: any): InternalListItem {\n const type = getPropertyFromItem(item, props.itemType, 'item')\n const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle)\n const value = getPropertyFromItem(item, props.itemValue, undefined)\n const children = getPropertyFromItem(item, props.itemChildren)\n const itemProps = props.itemProps === true ? pick(item, ['children'])[1] : getPropertyFromItem(item, props.itemProps)\n\n const _props = {\n title,\n value,\n ...itemProps,\n }\n\n return {\n type,\n title: _props.title,\n value: _props.value,\n props: _props,\n children: type === 'item' && children ? transformItems(props, children) : undefined,\n raw: item,\n }\n}\n\nfunction transformItems (props: ItemProps & { itemType: string }, items: (string | object)[]) {\n const array: InternalListItem[] = []\n\n for (const item of items) {\n array.push(transformItem(props, item))\n }\n\n return array\n}\n\nfunction useListItems (props: ItemProps & { itemType: string }) {\n const items = computed(() => transformItems(props, props.items))\n\n return { items }\n}\n\nexport const VList = genericComponent<new <T>() => {\n $props: {\n items?: T[]\n } & SlotsToProps<{\n subheader: []\n header: [{ props: Record<string, unknown> }]\n item: [T]\n }>\n}>()({\n name: 'VList',\n\n props: {\n activeColor: String,\n activeClass: String,\n bgColor: String,\n disabled: Boolean,\n lines: {\n type: [Boolean, String] as PropType<'one' | 'two' | 'three' | false>,\n default: 'one',\n },\n nav: Boolean,\n\n ...makeNestedProps({\n selectStrategy: 'single-leaf' as const,\n openStrategy: 'list' as const,\n }),\n ...makeBorderProps(),\n ...makeDensityProps(),\n ...makeDimensionProps(),\n ...makeElevationProps(),\n itemType: {\n type: String,\n default: 'type',\n },\n ...makeItemsProps(),\n ...makeRoundedProps(),\n ...makeTagProps(),\n ...makeThemeProps(),\n ...makeVariantProps({ variant: 'text' } as const),\n },\n\n emits: {\n 'update:selected': (val: unknown[]) => true,\n 'update:opened': (val: unknown[]) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const { themeClasses } = provideTheme(props)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { borderClasses } = useBorder(props)\n const { densityClasses } = useDensity(props)\n const { dimensionStyles } = useDimension(props)\n const { elevationClasses } = useElevation(props)\n const { roundedClasses } = useRounded(props)\n const { open, select } = useNested(props)\n const lineClasses = computed(() => props.lines ? `v-list--${props.lines}-line` : undefined)\n const activeColor = toRef(props, 'activeColor')\n const color = toRef(props, 'color')\n\n createList()\n\n provideDefaults({\n VListGroup: {\n activeColor,\n color,\n },\n VListItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n nav: toRef(props, 'nav'),\n variant: toRef(props, 'variant'),\n },\n })\n\n const isFocused = ref(false)\n const contentRef = ref<HTMLElement>()\n function onFocusin (e: FocusEvent) {\n isFocused.value = true\n }\n\n function onFocusout (e: FocusEvent) {\n isFocused.value = false\n }\n\n function onFocus (e: FocusEvent) {\n if (\n !isFocused.value &&\n !(e.relatedTarget && contentRef.value?.contains(e.relatedTarget as Node))\n ) focus()\n }\n\n function onKeydown (e: KeyboardEvent) {\n if (!contentRef.value) return\n\n if (e.key === 'ArrowDown') {\n focus('next')\n } else if (e.key === 'ArrowUp') {\n focus('prev')\n } else if (e.key === 'Home') {\n focus('first')\n } else if (e.key === 'End') {\n focus('last')\n } else {\n return\n }\n\n e.preventDefault()\n }\n\n function focus (location?: 'next' | 'prev' | 'first' | 'last') {\n if (!contentRef.value) return\n\n const targets = ['button', '[href]', 'input', 'select', 'textarea', '[tabindex]'].map(s => `${s}:not([tabindex=\"-1\"])`).join(', ')\n const focusable = [...contentRef.value.querySelectorAll(targets)].filter(el => !el.hasAttribute('disabled')) as HTMLElement[]\n const idx = focusable.indexOf(document.activeElement as HTMLElement)\n\n if (!location) {\n if (!contentRef.value.contains(document.activeElement)) {\n focusable[0]?.focus()\n }\n } else if (location === 'first') {\n focusable[0]?.focus()\n } else if (location === 'last') {\n focusable.at(-1)?.focus()\n } else {\n let el\n let idxx = idx\n const inc = location === 'next' ? 1 : -1\n do {\n idxx += inc\n el = focusable[idxx]\n } while ((!el || el.offsetParent == null) && idxx < focusable.length && idxx >= 0)\n if (el) el.focus()\n else focus(location === 'next' ? 'first' : 'last')\n }\n }\n\n useRender(() => {\n return (\n <props.tag\n ref={ contentRef }\n class={[\n 'v-list',\n {\n 'v-list--disabled': props.disabled,\n 'v-list--nav': props.nav,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n borderClasses.value,\n densityClasses.value,\n elevationClasses.value,\n lineClasses.value,\n roundedClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n dimensionStyles.value,\n ]}\n role=\"listbox\"\n aria-activedescendant={ undefined }\n onFocusin={ onFocusin }\n onFocusout={ onFocusout }\n onFocus={ onFocus }\n onKeydown={ onKeydown }\n >\n <VListChildren items={ items.value } v-slots={ slots }></VListChildren>\n </props.tag>\n )\n })\n\n return {\n open,\n select,\n focus,\n }\n },\n})\n\nexport type VList = InstanceType<typeof VList>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,aAAa,+BAEtB;AAAA,SACSC,UAAU;AAAA,SACVC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc;AAAA,SACdC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY;AAAA,SAC5BC,gBAAgB;AAAA,SA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