vuetify 3.3.6 → 3.3.7

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.
Files changed (83) hide show
  1. package/dist/json/attributes.json +14 -10
  2. package/dist/json/importMap.json +76 -76
  3. package/dist/json/tags.json +1 -0
  4. package/dist/json/web-types.json +26 -24
  5. package/dist/vuetify-labs.css +127 -111
  6. package/dist/vuetify-labs.d.ts +178 -76
  7. package/dist/vuetify-labs.esm.js +486 -337
  8. package/dist/vuetify-labs.esm.js.map +1 -1
  9. package/dist/vuetify-labs.js +485 -336
  10. package/dist/vuetify-labs.min.css +2 -2
  11. package/dist/vuetify.css +36 -20
  12. package/dist/vuetify.d.ts +157 -93
  13. package/dist/vuetify.esm.js +469 -326
  14. package/dist/vuetify.esm.js.map +1 -1
  15. package/dist/vuetify.js +468 -325
  16. package/dist/vuetify.js.map +1 -1
  17. package/dist/vuetify.min.css +2 -2
  18. package/dist/vuetify.min.js +688 -669
  19. package/dist/vuetify.min.js.map +1 -1
  20. package/lib/components/VAutocomplete/VAutocomplete.mjs +48 -35
  21. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  22. package/lib/components/VBtn/VBtn.mjs +1 -1
  23. package/lib/components/VBtn/VBtn.mjs.map +1 -1
  24. package/lib/components/VCheckbox/index.d.mts +28 -16
  25. package/lib/components/VCombobox/VCombobox.mjs +48 -35
  26. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  27. package/lib/components/VField/VField.css +17 -6
  28. package/lib/components/VField/VField.sass +17 -6
  29. package/lib/components/VField/_variables.scss +2 -2
  30. package/lib/components/VIcon/VIcon.css +1 -0
  31. package/lib/components/VIcon/VIcon.sass +1 -0
  32. package/lib/components/VImg/VImg.css +4 -2
  33. package/lib/components/VImg/VImg.mjs +4 -2
  34. package/lib/components/VImg/VImg.mjs.map +1 -1
  35. package/lib/components/VImg/VImg.sass +3 -4
  36. package/lib/components/VOverlay/VOverlay.css +2 -0
  37. package/lib/components/VOverlay/VOverlay.sass +3 -1
  38. package/lib/components/VOverlay/scrollStrategies.mjs +3 -1
  39. package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
  40. package/lib/components/VRadio/index.d.mts +14 -8
  41. package/lib/components/VRadioGroup/index.d.mts +14 -8
  42. package/lib/components/VResponsive/VResponsive.css +6 -11
  43. package/lib/components/VResponsive/VResponsive.sass +5 -10
  44. package/lib/components/VSelect/VSelect.mjs +43 -31
  45. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  46. package/lib/components/VSelect/useScrolling.mjs +69 -0
  47. package/lib/components/VSelect/useScrolling.mjs.map +1 -0
  48. package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -2
  49. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  50. package/lib/components/VSelectionControl/index.d.mts +14 -8
  51. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +4 -1
  52. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
  53. package/lib/components/VSelectionControlGroup/index.d.mts +14 -8
  54. package/lib/components/VSwitch/index.d.mts +14 -8
  55. package/lib/components/VTextField/VTextField.css +5 -0
  56. package/lib/components/VTextField/VTextField.mjs +6 -2
  57. package/lib/components/VTextField/VTextField.mjs.map +1 -1
  58. package/lib/components/VTextField/VTextField.sass +5 -0
  59. package/lib/components/VTextField/_variables.scss +1 -0
  60. package/lib/components/VVirtualScroll/VVirtualScroll.mjs +50 -24
  61. package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
  62. package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs +13 -23
  63. package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -1
  64. package/lib/components/VVirtualScroll/index.d.mts +37 -15
  65. package/lib/components/index.d.mts +134 -70
  66. package/lib/composables/filter.mjs +9 -7
  67. package/lib/composables/filter.mjs.map +1 -1
  68. package/lib/composables/resizeObserver.mjs +6 -1
  69. package/lib/composables/resizeObserver.mjs.map +1 -1
  70. package/lib/composables/virtual.mjs +17 -17
  71. package/lib/composables/virtual.mjs.map +1 -1
  72. package/lib/entry-bundler.mjs +1 -1
  73. package/lib/framework.mjs +1 -1
  74. package/lib/index.d.mts +23 -23
  75. package/lib/labs/VDataTable/VDataTableVirtual.mjs +12 -10
  76. package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
  77. package/lib/labs/VDataTable/composables/headers.mjs +6 -2
  78. package/lib/labs/VDataTable/composables/headers.mjs.map +1 -1
  79. package/lib/labs/VDataTable/index.d.mts +44 -6
  80. package/lib/labs/components.d.mts +44 -6
  81. package/lib/util/getScrollParent.mjs +7 -1
  82. package/lib/util/getScrollParent.mjs.map +1 -1
  83. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { createVNode as _createVNode } from "vue";
1
+ import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
2
2
  // Styles
3
3
  import "./VVirtualScroll.css";
4
4
 
@@ -6,14 +6,16 @@ import "./VVirtualScroll.css";
6
6
  import { VVirtualScrollItem } from "./VVirtualScrollItem.mjs"; // Composables
7
7
  import { makeComponentProps } from "../../composables/component.mjs";
8
8
  import { makeDimensionProps, useDimension } from "../../composables/dimensions.mjs";
9
+ import { useToggleScope } from "../../composables/toggleScope.mjs";
9
10
  import { makeVirtualProps, useVirtual } from "../../composables/virtual.mjs"; // Utilities
10
- import { toRef } from 'vue';
11
- import { convertToUnit, genericComponent, propsFactory, useRender } from "../../util/index.mjs"; // Types
11
+ import { onMounted, onScopeDispose, toRef } from 'vue';
12
+ import { convertToUnit, genericComponent, getCurrentInstance, getScrollParent, propsFactory, useRender } from "../../util/index.mjs"; // Types
12
13
  export const makeVVirtualScrollProps = propsFactory({
13
14
  items: {
14
15
  type: Array,
15
16
  default: () => []
16
17
  },
18
+ renderless: Boolean,
17
19
  ...makeVirtualProps(),
18
20
  ...makeComponentProps(),
19
21
  ...makeDimensionProps()
@@ -25,6 +27,7 @@ export const VVirtualScroll = genericComponent()({
25
27
  let {
26
28
  slots
27
29
  } = _ref;
30
+ const vm = getCurrentInstance('VVirtualScroll');
28
31
  const {
29
32
  dimensionStyles
30
33
  } = useDimension(props);
@@ -37,27 +40,50 @@ export const VVirtualScroll = genericComponent()({
37
40
  paddingBottom,
38
41
  computedItems
39
42
  } = useVirtual(props, toRef(props, 'items'));
40
- useRender(() => _createVNode("div", {
41
- "ref": containerRef,
42
- "class": ['v-virtual-scroll', props.class],
43
- "onScroll": handleScroll,
44
- "style": [dimensionStyles.value, props.style]
45
- }, [_createVNode("div", {
46
- "class": "v-virtual-scroll__container",
47
- "style": {
48
- paddingTop: convertToUnit(paddingTop.value),
49
- paddingBottom: convertToUnit(paddingBottom.value)
50
- }
51
- }, [computedItems.value.map(item => _createVNode(VVirtualScrollItem, {
52
- "key": item.index,
53
- "dynamicHeight": !props.itemHeight,
54
- "onUpdate:height": height => handleItemResize(item.index, height)
55
- }, {
56
- default: () => [slots.default?.({
57
- item: item.raw,
58
- index: item.index
59
- })]
60
- }))])]));
43
+ useToggleScope(() => props.renderless, () => {
44
+ onMounted(() => {
45
+ containerRef.value = getScrollParent(vm.vnode.el, true);
46
+ containerRef.value?.addEventListener('scroll', handleScroll);
47
+ });
48
+ onScopeDispose(() => {
49
+ containerRef.value?.removeEventListener('scroll', handleScroll);
50
+ });
51
+ });
52
+ useRender(() => {
53
+ const children = computedItems.value.map(item => _createVNode(VVirtualScrollItem, {
54
+ "key": item.index,
55
+ "renderless": props.renderless,
56
+ "onUpdate:height": height => handleItemResize(item.index, height)
57
+ }, {
58
+ default: slotProps => slots.default?.({
59
+ item: item.raw,
60
+ index: item.index,
61
+ ...slotProps
62
+ })
63
+ }));
64
+ return props.renderless ? _createVNode(_Fragment, null, [_createVNode("div", {
65
+ "class": "v-virtual-scroll__spacer",
66
+ "style": {
67
+ paddingTop: convertToUnit(paddingTop.value)
68
+ }
69
+ }, null), children, _createVNode("div", {
70
+ "class": "v-virtual-scroll__spacer",
71
+ "style": {
72
+ paddingBottom: convertToUnit(paddingBottom.value)
73
+ }
74
+ }, null)]) : _createVNode("div", {
75
+ "ref": containerRef,
76
+ "class": ['v-virtual-scroll', props.class],
77
+ "onScroll": handleScroll,
78
+ "style": [dimensionStyles.value, props.style]
79
+ }, [_createVNode("div", {
80
+ "class": "v-virtual-scroll__container",
81
+ "style": {
82
+ paddingTop: convertToUnit(paddingTop.value),
83
+ paddingBottom: convertToUnit(paddingBottom.value)
84
+ }
85
+ }, [children])]);
86
+ });
61
87
  return {
62
88
  scrollToIndex
63
89
  };
@@ -1 +1 @@
1
- {"version":3,"file":"VVirtualScroll.mjs","names":["VVirtualScrollItem","makeComponentProps","makeDimensionProps","useDimension","makeVirtualProps","useVirtual","toRef","convertToUnit","genericComponent","propsFactory","useRender","makeVVirtualScrollProps","items","type","Array","default","VVirtualScroll","name","props","setup","_ref","slots","dimensionStyles","containerRef","handleScroll","handleItemResize","scrollToIndex","paddingTop","paddingBottom","computedItems","_createVNode","class","value","style","map","item","index","itemHeight","height","raw"],"sources":["../../../src/components/VVirtualScroll/VVirtualScroll.tsx"],"sourcesContent":["// Styles\nimport './VVirtualScroll.sass'\n\n// Components\nimport { VVirtualScrollItem } from './VVirtualScrollItem'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeVirtualProps, useVirtual } from '@/composables/virtual'\n\n// Utilities\nimport { toRef } from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n propsFactory,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { GenericProps } from '@/util'\n\nexport interface VVirtualScrollSlot<T> {\n item: T\n index: number\n}\n\nexport const makeVVirtualScrollProps = propsFactory({\n items: {\n type: Array as PropType<readonly unknown[]>,\n default: () => ([]),\n },\n\n ...makeVirtualProps(),\n ...makeComponentProps(),\n ...makeDimensionProps(),\n}, 'VVirtualScroll')\n\nexport const VVirtualScroll = genericComponent<new <T>(\n props: {\n items?: readonly T[]\n },\n slots: {\n default: VVirtualScrollSlot<T>\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VVirtualScroll',\n\n props: makeVVirtualScrollProps(),\n\n setup (props, { slots }) {\n const { dimensionStyles } = useDimension(props)\n const {\n containerRef,\n handleScroll,\n handleItemResize,\n scrollToIndex,\n paddingTop,\n paddingBottom,\n computedItems,\n } = useVirtual(props, toRef(props, 'items'))\n\n useRender(() => (\n <div\n ref={ containerRef }\n class={[\n 'v-virtual-scroll',\n props.class,\n ]}\n onScroll={ handleScroll }\n style={[\n dimensionStyles.value,\n props.style,\n ]}\n >\n <div\n class=\"v-virtual-scroll__container\"\n style={{\n paddingTop: convertToUnit(paddingTop.value),\n paddingBottom: convertToUnit(paddingBottom.value),\n }}\n >\n { computedItems.value.map(item => (\n <VVirtualScrollItem\n key={ item.index }\n dynamicHeight={ !props.itemHeight }\n onUpdate:height={ height => handleItemResize(item.index, height) }\n >\n { slots.default?.({ item: item.raw, index: item.index }) }\n </VVirtualScrollItem>\n ))}\n </div>\n </div>\n ))\n\n return {\n scrollToIndex,\n }\n },\n})\n\nexport type VVirtualScroll = InstanceType<typeof VVirtualScroll>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,oCAE3B;AAAA,SACSC,kBAAkB;AAAA,SAClBC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,gBAAgB,EAAEC,UAAU,yCAErC;AACA,SAASC,KAAK,QAAQ,KAAK;AAAA,SAEzBC,aAAa,EACbC,gBAAgB,EAChBC,YAAY,EACZC,SAAS,gCAGX;AASA,OAAO,MAAMC,uBAAuB,GAAGF,YAAY,CAAC;EAClDG,KAAK,EAAE;IACLC,IAAI,EAAEC,KAAqC;IAC3CC,OAAO,EAAEA,CAAA,KAAO;EAClB,CAAC;EAED,GAAGX,gBAAgB,EAAE;EACrB,GAAGH,kBAAkB,EAAE;EACvB,GAAGC,kBAAkB;AACvB,CAAC,EAAE,gBAAgB,CAAC;AAEp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F,OAAO;MACLV;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"VVirtualScroll.mjs","names":["VVirtualScrollItem","makeComponentProps","makeDimensionProps","useDimension","useToggleScope","makeVirtualProps","useVirtual","onMounted","onScopeDispose","toRef","convertToUnit","genericComponent","getCurrentInstance","getScrollParent","propsFactory","useRender","makeVVirtualScrollProps","items","type","Array","default","renderless","Boolean","VVirtualScroll","name","props","setup","_ref","slots","vm","dimensionStyles","containerRef","handleScroll","handleItemResize","scrollToIndex","paddingTop","paddingBottom","computedItems","value","vnode","el","addEventListener","removeEventListener","children","map","item","_createVNode","index","height","slotProps","raw","_Fragment","class","style"],"sources":["../../../src/components/VVirtualScroll/VVirtualScroll.tsx"],"sourcesContent":["// Styles\nimport './VVirtualScroll.sass'\n\n// Components\nimport { VVirtualScrollItem } from './VVirtualScrollItem'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { useToggleScope } from '@/composables/toggleScope'\nimport { makeVirtualProps, useVirtual } from '@/composables/virtual'\n\n// Utilities\nimport { onMounted, onScopeDispose, toRef } from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getCurrentInstance,\n getScrollParent,\n propsFactory,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { GenericProps } from '@/util'\n\nexport interface VVirtualScrollSlot<T> {\n item: T\n index: number\n}\n\nexport const makeVVirtualScrollProps = propsFactory({\n items: {\n type: Array as PropType<readonly unknown[]>,\n default: () => ([]),\n },\n renderless: Boolean,\n\n ...makeVirtualProps(),\n ...makeComponentProps(),\n ...makeDimensionProps(),\n}, 'VVirtualScroll')\n\nexport const VVirtualScroll = genericComponent<new <T, Renderless extends boolean = false>(\n props: {\n items?: readonly T[]\n renderless?: Renderless\n },\n slots: {\n default: VVirtualScrollSlot<T> & (Renderless extends true ? {\n itemRef: Ref<HTMLElement | undefined>\n } : {})\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VVirtualScroll',\n\n props: makeVVirtualScrollProps(),\n\n setup (props, { slots }) {\n const vm = getCurrentInstance('VVirtualScroll')\n const { dimensionStyles } = useDimension(props)\n const {\n containerRef,\n handleScroll,\n handleItemResize,\n scrollToIndex,\n paddingTop,\n paddingBottom,\n computedItems,\n } = useVirtual(props, toRef(props, 'items'))\n\n useToggleScope(() => props.renderless, () => {\n onMounted(() => {\n containerRef.value = getScrollParent(vm.vnode.el as HTMLElement, true)\n containerRef.value?.addEventListener('scroll', handleScroll)\n })\n onScopeDispose(() => {\n containerRef.value?.removeEventListener('scroll', handleScroll)\n })\n })\n\n useRender(() => {\n const children = computedItems.value.map(item => (\n <VVirtualScrollItem\n key={ item.index }\n renderless={ props.renderless }\n onUpdate:height={ height => handleItemResize(item.index, height) }\n >\n { slotProps => slots.default?.({ item: item.raw, index: item.index, ...slotProps }) }\n </VVirtualScrollItem>\n ))\n\n return props.renderless ? (\n <>\n <div class=\"v-virtual-scroll__spacer\" style={{ paddingTop: convertToUnit(paddingTop.value) }} />\n { children }\n <div class=\"v-virtual-scroll__spacer\" style={{ paddingBottom: convertToUnit(paddingBottom.value) }} />\n </>\n ) : (\n <div\n ref={ containerRef }\n class={[\n 'v-virtual-scroll',\n props.class,\n ]}\n onScroll={ handleScroll }\n style={[\n dimensionStyles.value,\n props.style,\n ]}\n >\n <div\n class=\"v-virtual-scroll__container\"\n style={{\n paddingTop: convertToUnit(paddingTop.value),\n paddingBottom: convertToUnit(paddingBottom.value),\n }}\n >\n { children }\n </div>\n </div>\n )\n })\n\n return {\n scrollToIndex,\n }\n },\n})\n\nexport type VVirtualScroll = InstanceType<typeof VVirtualScroll>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,oCAE3B;AAAA,SACSC,kBAAkB;AAAA,SAClBC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc;AAAA,SACdC,gBAAgB,EAAEC,UAAU,yCAErC;AACA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AAC,IAECK,QAAQ,IAGf;IACH,CAAC,CAAC;IAEF,OAAO;MACLT;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
@@ -1,50 +1,40 @@
1
- import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
1
+ import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
2
  // Composables
3
3
  import { makeComponentProps } from "../../composables/component.mjs";
4
- import { useResizeObserver } from "../../composables/resizeObserver.mjs";
5
- import { useToggleScope } from "../../composables/toggleScope.mjs"; // Utilities
6
- import { onUpdated, watch } from 'vue';
7
- import { genericComponent, propsFactory, useRender } from "../../util/index.mjs";
4
+ import { useResizeObserver } from "../../composables/resizeObserver.mjs"; // Utilities
5
+ import { watch } from 'vue';
6
+ import { genericComponent, propsFactory, useRender } from "../../util/index.mjs"; // Types
8
7
  export const makeVVirtualScrollItemProps = propsFactory({
9
- dynamicHeight: Boolean,
10
8
  renderless: Boolean,
11
9
  ...makeComponentProps()
12
10
  }, 'VVirtualScrollItem');
13
11
  export const VVirtualScrollItem = genericComponent()({
14
12
  name: 'VVirtualScrollItem',
13
+ inheritAttrs: false,
15
14
  props: makeVVirtualScrollItemProps(),
16
15
  emits: {
17
16
  'update:height': height => true
18
17
  },
19
18
  setup(props, _ref) {
20
19
  let {
20
+ attrs,
21
21
  emit,
22
22
  slots
23
23
  } = _ref;
24
24
  const {
25
25
  resizeRef,
26
26
  contentRect
27
- } = useResizeObserver();
28
- useToggleScope(() => props.dynamicHeight, () => {
29
- watch(() => contentRect.value?.height, height => {
30
- if (height != null) emit('update:height', height);
31
- });
27
+ } = useResizeObserver(undefined, 'border');
28
+ watch(() => contentRect.value?.height, height => {
29
+ if (height != null) emit('update:height', height);
32
30
  });
33
- function updateHeight() {
34
- if (props.dynamicHeight && contentRect.value) {
35
- emit('update:height', contentRect.value.height);
36
- }
37
- }
38
- onUpdated(updateHeight);
39
31
  useRender(() => props.renderless ? _createVNode(_Fragment, null, [slots.default?.({
40
- props: {
41
- ref: props.dynamicHeight ? resizeRef : undefined
42
- }
43
- })]) : _createVNode("div", {
44
- "ref": props.dynamicHeight ? resizeRef : undefined,
32
+ itemRef: resizeRef
33
+ })]) : _createVNode("div", _mergeProps({
34
+ "ref": resizeRef,
45
35
  "class": ['v-virtual-scroll__item', props.class],
46
36
  "style": props.style
47
- }, [slots.default?.()]));
37
+ }, attrs), [slots.default?.()]));
48
38
  }
49
39
  });
50
40
  //# sourceMappingURL=VVirtualScrollItem.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"VVirtualScrollItem.mjs","names":["makeComponentProps","useResizeObserver","useToggleScope","onUpdated","watch","genericComponent","propsFactory","useRender","makeVVirtualScrollItemProps","dynamicHeight","Boolean","renderless","VVirtualScrollItem","name","props","emits","height","setup","_ref","emit","slots","resizeRef","contentRect","value","updateHeight","_createVNode","_Fragment","default","ref","undefined","class","style"],"sources":["../../../src/components/VVirtualScroll/VVirtualScrollItem.tsx"],"sourcesContent":["// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useResizeObserver } from '@/composables/resizeObserver'\nimport { useToggleScope } from '@/composables/toggleScope'\n\n// Utilities\nimport { onUpdated, watch } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVVirtualScrollItemProps = propsFactory({\n dynamicHeight: Boolean,\n renderless: Boolean,\n\n ...makeComponentProps(),\n}, 'VVirtualScrollItem')\n\nexport const VVirtualScrollItem = genericComponent<{ default: { props: Record<string, any> } | void }>()({\n name: 'VVirtualScrollItem',\n\n props: makeVVirtualScrollItemProps(),\n\n emits: {\n 'update:height': (height: number) => true,\n },\n\n setup (props, { emit, slots }) {\n const { resizeRef, contentRect } = useResizeObserver()\n\n useToggleScope(() => props.dynamicHeight, () => {\n watch(() => contentRect.value?.height, height => {\n if (height != null) emit('update:height', height)\n })\n })\n\n function updateHeight () {\n if (props.dynamicHeight && contentRect.value) {\n emit('update:height', contentRect.value.height)\n }\n }\n\n onUpdated(updateHeight)\n\n useRender(() => props.renderless ? (\n <>\n { slots.default?.({ props: { ref: props.dynamicHeight ? resizeRef : undefined } }) }\n </>\n ) : (\n <div\n ref={ props.dynamicHeight ? resizeRef : undefined }\n class={[\n 'v-virtual-scroll__item',\n props.class,\n ]}\n style={ props.style }\n >\n { slots.default?.() }\n </div>\n ))\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,iBAAiB;AAAA,SACjBC,cAAc,6CAEvB;AACA,SAASC,SAAS,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC7BC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAElD,OAAO,MAAMC,2BAA2B,GAAGF,YAAY,CAAC;EACtDG,aAAa,EAAEC,OAAO;EACtBC,UAAU,EAAED,OAAO;EAEnB,GAAGV,kBAAkB;AACvB,CAAC,EAAE,oBAAoB,CAAC;AAExB,OAAO,MAAMY,kBAAkB,GAAGP,gBAAgB,EAAsD,CAAC;EACvGQ,IAAI,EAAE,oBAAoB;EAE1BC,KAAK,EAAEN,2BAA2B,EAAE;EAEpCO,KAAK,EAAE;IACL,eAAe,EAAGC,MAAc,IAAK;EACvC,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAAmB;IAAA,IAAjB;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAAF,IAAA;IAC3B,MAAM;MAAEG,SAAS;MAAEC;IAAY,CAAC,GAAGrB,iBAAiB,EAAE;IAEtDC,cAAc,CAAC,MAAMY,KAAK,CAACL,aAAa,EAAE,MAAM;MAC9CL,KAAK,CAAC,MAAMkB,WAAW,CAACC,KAAK,EAAEP,MAAM,EAAEA,MAAM,IAAI;QAC/C,IAAIA,MAAM,IAAI,IAAI,EAAEG,IAAI,CAAC,eAAe,EAAEH,MAAM,CAAC;MACnD,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,SAASQ,YAAYA,CAAA,EAAI;MACvB,IAAIV,KAAK,CAACL,aAAa,IAAIa,WAAW,CAACC,KAAK,EAAE;QAC5CJ,IAAI,CAAC,eAAe,EAAEG,WAAW,CAACC,KAAK,CAACP,MAAM,CAAC;MACjD;IACF;IAEAb,SAAS,CAACqB,YAAY,CAAC;IAEvBjB,SAAS,CAAC,MAAMO,KAAK,CAACH,UAAU,GAAAc,YAAA,CAAAC,SAAA,SAE1BN,KAAK,CAACO,OAAO,GAAG;MAAEb,KAAK,EAAE;QAAEc,GAAG,EAAEd,KAAK,CAACL,aAAa,GAAGY,SAAS,GAAGQ;MAAU;IAAE,CAAC,CAAC,KAAAJ,YAAA;MAAA,OAI5EX,KAAK,CAACL,aAAa,GAAGY,SAAS,GAAGQ,SAAS;MAAA,SAC1C,CACL,wBAAwB,EACxBf,KAAK,CAACgB,KAAK,CACZ;MAAA,SACOhB,KAAK,CAACiB;IAAK,IAEjBX,KAAK,CAACO,OAAO,IAAI,EAEtB,CAAC;EACJ;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"VVirtualScrollItem.mjs","names":["makeComponentProps","useResizeObserver","watch","genericComponent","propsFactory","useRender","makeVVirtualScrollItemProps","renderless","Boolean","VVirtualScrollItem","name","inheritAttrs","props","emits","height","setup","_ref","attrs","emit","slots","resizeRef","contentRect","undefined","value","_createVNode","_Fragment","default","itemRef","_mergeProps","class","style"],"sources":["../../../src/components/VVirtualScroll/VVirtualScrollItem.tsx"],"sourcesContent":["// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { watch } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\nimport type { GenericProps } from '@/util'\n\nexport const makeVVirtualScrollItemProps = propsFactory({\n renderless: Boolean,\n\n ...makeComponentProps(),\n}, 'VVirtualScrollItem')\n\nexport const VVirtualScrollItem = genericComponent<new <Renderless extends boolean = false>(\n props: {\n renderless?: Renderless\n },\n slots: {\n default: Renderless extends true ? {\n itemRef: Ref<HTMLElement | undefined>\n } : never\n }\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VVirtualScrollItem',\n\n inheritAttrs: false,\n\n props: makeVVirtualScrollItemProps(),\n\n emits: {\n 'update:height': (height: number) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { resizeRef, contentRect } = useResizeObserver(undefined, 'border')\n\n watch(() => contentRect.value?.height, height => {\n if (height != null) emit('update:height', height)\n })\n\n useRender(() => props.renderless ? (\n <>\n { slots.default?.({ itemRef: resizeRef }) }\n </>\n ) : (\n <div\n ref={ resizeRef }\n class={[\n 'v-virtual-scroll__item',\n props.class,\n ]}\n style={ props.style }\n { ...attrs }\n >\n { (slots.default as any)?.() }\n </div>\n ))\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,iBAAiB,gDAE1B;AACA,SAASC,KAAK,QAAQ,KAAK;AAAA,SAClBC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAElD;AAIA,OAAO,MAAMC,2BAA2B,GAAGF,YAAY,CAAC;EACtDG,UAAU,EAAEC,OAAO;EAEnB,GAAGR,kBAAkB;AACvB,CAAC,EAAE,oBAAoB,CAAC;AAExB,OAAO,MAAMS,kBAAkB,GAAGN,gBAAgB,EASF,CAAC;EAC/CO,IAAI,EAAE,oBAAoB;EAE1BC,YAAY,EAAE,KAAK;EAEnBC,KAAK,EAAEN,2BAA2B,EAAE;EAEpCO,KAAK,EAAE;IACL,eAAe,EAAGC,MAAc,IAAK;EACvC,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAA0B;IAAA,IAAxB;MAAEC,KAAK;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAAH,IAAA;IAClC,MAAM;MAAEI,SAAS;MAAEC;IAAY,CAAC,GAAGpB,iBAAiB,CAACqB,SAAS,EAAE,QAAQ,CAAC;IAEzEpB,KAAK,CAAC,MAAMmB,WAAW,CAACE,KAAK,EAAET,MAAM,EAAEA,MAAM,IAAI;MAC/C,IAAIA,MAAM,IAAI,IAAI,EAAEI,IAAI,CAAC,eAAe,EAAEJ,MAAM,CAAC;IACnD,CAAC,CAAC;IAEFT,SAAS,CAAC,MAAMO,KAAK,CAACL,UAAU,GAAAiB,YAAA,CAAAC,SAAA,SAE1BN,KAAK,CAACO,OAAO,GAAG;MAAEC,OAAO,EAAEP;IAAU,CAAC,CAAC,KAAAI,YAAA,QAAAI,WAAA;MAAA,OAInCR,SAAS;MAAA,SACR,CACL,wBAAwB,EACxBR,KAAK,CAACiB,KAAK,CACZ;MAAA,SACOjB,KAAK,CAACkB;IAAK,GACdb,KAAK,IAEPE,KAAK,CAACO,OAAO,IAAY,EAE/B,CAAC;EACJ;AACF,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, PropType } from 'vue';
2
+ import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, Ref, PropType } from 'vue';
3
3
 
4
4
  type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
5
5
  $children?: (VNodeChild | (T extends {
@@ -40,6 +40,7 @@ declare const VVirtualScroll: {
40
40
  $data: {};
41
41
  $props: {
42
42
  style?: vue.StyleValue | undefined;
43
+ itemHeight?: string | number | undefined;
43
44
  key?: string | number | symbol | undefined;
44
45
  height?: string | number | undefined;
45
46
  width?: string | number | undefined;
@@ -89,7 +90,6 @@ declare const VVirtualScroll: {
89
90
  }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
90
91
  [key: string]: any;
91
92
  }>) => void)[] | undefined;
92
- itemHeight?: string | number | undefined;
93
93
  };
94
94
  $attrs: {
95
95
  [x: string]: unknown;
@@ -98,7 +98,9 @@ declare const VVirtualScroll: {
98
98
  [x: string]: unknown;
99
99
  };
100
100
  $slots: Readonly<{
101
- default?: ((arg: VVirtualScrollSlot<unknown>) => vue.VNode<vue.RendererNode, vue.RendererElement, {
101
+ default?: ((arg: VVirtualScrollSlot<unknown> | (VVirtualScrollSlot<unknown> & {
102
+ itemRef: Ref<HTMLElement | undefined>;
103
+ })) => vue.VNode<vue.RendererNode, vue.RendererElement, {
102
104
  [key: string]: any;
103
105
  }>[]) | undefined;
104
106
  }>;
@@ -108,6 +110,7 @@ declare const VVirtualScroll: {
108
110
  $el: any;
109
111
  $options: vue.ComponentOptionsBase<{
110
112
  style: vue.StyleValue;
113
+ itemHeight: string | number;
111
114
  } & {
112
115
  height?: string | number | undefined;
113
116
  width?: string | number | undefined;
@@ -116,13 +119,15 @@ declare const VVirtualScroll: {
116
119
  minHeight?: string | number | undefined;
117
120
  minWidth?: string | number | undefined;
118
121
  class?: any;
119
- itemHeight?: string | number | undefined;
120
122
  }, {
121
123
  scrollToIndex: (index: number) => void;
122
- }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slot:default" | "items" | "v-slots">, string, {
124
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slot:default" | "items" | "v-slots" | "renderless">, string, {
123
125
  style: vue.StyleValue;
126
+ itemHeight: string | number;
124
127
  }, {}, string, vue.SlotsType<Partial<{
125
- default: (arg: VVirtualScrollSlot<unknown>) => vue.VNode<vue.RendererNode, vue.RendererElement, {
128
+ default: (arg: VVirtualScrollSlot<unknown> | (VVirtualScrollSlot<unknown> & {
129
+ itemRef: Ref<HTMLElement | undefined>;
130
+ })) => vue.VNode<vue.RendererNode, vue.RendererElement, {
126
131
  [key: string]: any;
127
132
  }>[];
128
133
  }>>> & {
@@ -147,6 +152,7 @@ declare const VVirtualScroll: {
147
152
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: vue.WatchOptions<boolean> | undefined): vue.WatchStopHandle;
148
153
  } & {
149
154
  style: vue.StyleValue;
155
+ itemHeight: string | number;
150
156
  } & {
151
157
  height?: string | number | undefined;
152
158
  width?: string | number | undefined;
@@ -155,7 +161,6 @@ declare const VVirtualScroll: {
155
161
  minHeight?: string | number | undefined;
156
162
  minWidth?: string | number | undefined;
157
163
  class?: any;
158
- itemHeight?: string | number | undefined;
159
164
  } & vue.ShallowUnwrapRef<{
160
165
  scrollToIndex: (index: number) => void;
161
166
  }> & {} & vue.ComponentCustomProperties & {};
@@ -164,6 +169,7 @@ declare const VVirtualScroll: {
164
169
  __isSuspense?: undefined;
165
170
  } & vue.ComponentOptionsBase<{
166
171
  style: vue.StyleValue;
172
+ itemHeight: string | number;
167
173
  } & {
168
174
  height?: string | number | undefined;
169
175
  width?: string | number | undefined;
@@ -172,23 +178,31 @@ declare const VVirtualScroll: {
172
178
  minHeight?: string | number | undefined;
173
179
  minWidth?: string | number | undefined;
174
180
  class?: any;
175
- itemHeight?: string | number | undefined;
176
181
  }, {
177
182
  scrollToIndex: (index: number) => void;
178
- }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slot:default" | "items" | "v-slots">, string, {
183
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slot:default" | "items" | "v-slots" | "renderless">, string, {
179
184
  style: vue.StyleValue;
185
+ itemHeight: string | number;
180
186
  }, {}, string, vue.SlotsType<Partial<{
181
- default: (arg: VVirtualScrollSlot<unknown>) => vue.VNode<vue.RendererNode, vue.RendererElement, {
187
+ default: (arg: VVirtualScrollSlot<unknown> | (VVirtualScrollSlot<unknown> & {
188
+ itemRef: Ref<HTMLElement | undefined>;
189
+ })) => vue.VNode<vue.RendererNode, vue.RendererElement, {
182
190
  [key: string]: any;
183
191
  }>[];
184
- }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1>(props: {
192
+ }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1, Renderless extends boolean = false>(props: {
185
193
  items?: readonly T_1[] | undefined;
194
+ renderless?: Renderless | undefined;
186
195
  }, slots: {
187
- default: VVirtualScrollSlot<T_1>;
196
+ default: VVirtualScrollSlot<T_1> & (Renderless extends true ? {
197
+ itemRef: Ref<HTMLElement | undefined>;
198
+ } : {});
188
199
  }) => GenericProps<{
189
200
  items?: readonly T_1[] | undefined;
201
+ renderless?: Renderless | undefined;
190
202
  }, {
191
- default: VVirtualScrollSlot<T_1>;
203
+ default: VVirtualScrollSlot<T_1> & (Renderless extends true ? {
204
+ itemRef: Ref<HTMLElement | undefined>;
205
+ } : {});
192
206
  }>) & FilterPropsOptions<{
193
207
  height: (StringConstructor | NumberConstructor)[];
194
208
  maxHeight: (StringConstructor | NumberConstructor)[];
@@ -201,11 +215,15 @@ declare const VVirtualScroll: {
201
215
  type: PropType<vue.StyleValue>;
202
216
  default: null;
203
217
  };
204
- itemHeight: (StringConstructor | NumberConstructor)[];
218
+ itemHeight: {
219
+ type: (StringConstructor | NumberConstructor)[];
220
+ default: number;
221
+ };
205
222
  items: {
206
223
  type: PropType<readonly unknown[]>;
207
224
  default: () => never[];
208
225
  };
226
+ renderless: BooleanConstructor;
209
227
  }, vue.ExtractPropTypes<{
210
228
  height: (StringConstructor | NumberConstructor)[];
211
229
  maxHeight: (StringConstructor | NumberConstructor)[];
@@ -218,11 +236,15 @@ declare const VVirtualScroll: {
218
236
  type: PropType<vue.StyleValue>;
219
237
  default: null;
220
238
  };
221
- itemHeight: (StringConstructor | NumberConstructor)[];
239
+ itemHeight: {
240
+ type: (StringConstructor | NumberConstructor)[];
241
+ default: number;
242
+ };
222
243
  items: {
223
244
  type: PropType<readonly unknown[]>;
224
245
  default: () => never[];
225
246
  };
247
+ renderless: BooleanConstructor;
226
248
  }>>;
227
249
  type VVirtualScroll = InstanceType<typeof VVirtualScroll>;
228
250