@vuetify/nightly 3.2.2-master-20230501.0 → 3.2.3-master-20230503.0

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 (82) hide show
  1. package/CHANGELOG.md +6 -7
  2. package/dist/json/attributes.json +795 -659
  3. package/dist/json/importMap-labs.json +4 -4
  4. package/dist/json/importMap.json +84 -84
  5. package/dist/json/tags.json +35 -1
  6. package/dist/json/web-types.json +1683 -1353
  7. package/dist/vuetify-labs.css +133 -127
  8. package/dist/vuetify-labs.d.ts +404 -71
  9. package/dist/vuetify-labs.esm.js +126 -109
  10. package/dist/vuetify-labs.esm.js.map +1 -1
  11. package/dist/vuetify-labs.js +126 -109
  12. package/dist/vuetify-labs.min.css +2 -2
  13. package/dist/vuetify.css +100 -94
  14. package/dist/vuetify.d.ts +429 -96
  15. package/dist/vuetify.esm.js +126 -109
  16. package/dist/vuetify.esm.js.map +1 -1
  17. package/dist/vuetify.js +126 -109
  18. package/dist/vuetify.js.map +1 -1
  19. package/dist/vuetify.min.css +2 -2
  20. package/dist/vuetify.min.js +158 -159
  21. package/dist/vuetify.min.js.map +1 -1
  22. package/lib/components/VAppBar/VAppBar.mjs +7 -11
  23. package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
  24. package/lib/components/VAppBar/VAppBarNavIcon.mjs +10 -16
  25. package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
  26. package/lib/components/VAppBar/index.d.ts +394 -28
  27. package/lib/components/VAutocomplete/VAutocomplete.css +1 -1
  28. package/lib/components/VAutocomplete/VAutocomplete.mjs +6 -2
  29. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  30. package/lib/components/VAutocomplete/VAutocomplete.sass +1 -1
  31. package/lib/components/VBtn/VBtn.mjs +7 -6
  32. package/lib/components/VBtn/VBtn.mjs.map +1 -1
  33. package/lib/components/VCarousel/index.d.ts +9 -9
  34. package/lib/components/VColorPicker/VColorPicker.mjs +6 -2
  35. package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
  36. package/lib/components/VCombobox/VCombobox.mjs +5 -2
  37. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  38. package/lib/components/VField/VField.mjs +6 -2
  39. package/lib/components/VField/VField.mjs.map +1 -1
  40. package/lib/components/VFileInput/VFileInput.mjs +2 -1
  41. package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
  42. package/lib/components/VGrid/VContainer.mjs +6 -2
  43. package/lib/components/VGrid/VContainer.mjs.map +1 -1
  44. package/lib/components/VIcon/VIcon.mjs +28 -29
  45. package/lib/components/VIcon/VIcon.mjs.map +1 -1
  46. package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +1 -8
  47. package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
  48. package/lib/components/VNavigationDrawer/sticky.mjs +9 -3
  49. package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -1
  50. package/lib/components/VOverlay/locationStrategies.mjs +2 -2
  51. package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
  52. package/lib/components/VProgressLinear/VProgressLinear.mjs +3 -2
  53. package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
  54. package/lib/components/VRangeSlider/VRangeSlider.mjs +6 -2
  55. package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
  56. package/lib/components/VSelect/VSelect.mjs +5 -2
  57. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  58. package/lib/components/VSheet/VSheet.css +6 -0
  59. package/lib/components/VSheet/_variables.scss +1 -1
  60. package/lib/components/VSlider/VSlider.mjs +7 -3
  61. package/lib/components/VSlider/VSlider.mjs.map +1 -1
  62. package/lib/components/VTextField/VTextField.mjs +1 -1
  63. package/lib/components/VTextField/VTextField.mjs.map +1 -1
  64. package/lib/components/VTextarea/VTextarea.mjs +1 -1
  65. package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
  66. package/lib/components/VTimeline/VTimeline.mjs +6 -2
  67. package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
  68. package/lib/components/VToolbar/VToolbar.mjs +6 -2
  69. package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
  70. package/lib/components/VWindow/VWindow.mjs.map +1 -1
  71. package/lib/components/VWindow/index.d.ts +9 -9
  72. package/lib/components/index.d.ts +404 -71
  73. package/lib/composables/icons.mjs +2 -2
  74. package/lib/composables/icons.mjs.map +1 -1
  75. package/lib/composables/scroll.mjs +16 -17
  76. package/lib/composables/scroll.mjs.map +1 -1
  77. package/lib/directives/click-outside/index.mjs +1 -1
  78. package/lib/directives/click-outside/index.mjs.map +1 -1
  79. package/lib/entry-bundler.mjs +1 -1
  80. package/lib/framework.mjs +1 -1
  81. package/lib/index.d.ts +25 -25
  82. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
2
2
  // Icons
3
3
  import { aliases, mdi } from "../iconsets/mdi.mjs"; // Utilities
4
- import { computed, inject, isRef } from 'vue';
4
+ import { computed, inject, unref } from 'vue';
5
5
  import { defineComponent, genericComponent, mergeDeep, propsFactory } from "../util/index.mjs"; // Types
6
6
  export const IconValue = [String, Function, Object, Array];
7
7
  export const IconSymbol = Symbol.for('vuetify:icons');
@@ -106,7 +106,7 @@ export const useIcon = props => {
106
106
  const icons = inject(IconSymbol);
107
107
  if (!icons) throw new Error('Missing Vuetify Icons provide!');
108
108
  const iconData = computed(() => {
109
- const iconAlias = isRef(props) ? props.value : props.icon;
109
+ const iconAlias = unref(props);
110
110
  if (!iconAlias) return {
111
111
  component: VComponentIcon
112
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"icons.mjs","names":["aliases","mdi","computed","inject","isRef","defineComponent","genericComponent","mergeDeep","propsFactory","IconValue","String","Function","Object","Array","IconSymbol","Symbol","for","makeIconProps","icon","type","tag","required","VComponentIcon","name","props","setup","_ref","slots","Icon","_createVNode","default","VSvgIcon","inheritAttrs","_ref2","attrs","_mergeProps","isArray","map","path","VLigatureIcon","VClassIcon","defaultSets","svg","component","class","createIcons","options","defaultSet","sets","useIcon","icons","Error","iconData","iconAlias","value","trim","startsWith","slice","iconSetName","keys","find","setName","iconName","length","iconSet"],"sources":["../../src/composables/icons.tsx"],"sourcesContent":["// Icons\nimport { aliases, mdi } from '@/iconsets/mdi'\n\n// Utilities\nimport { computed, inject, isRef } from 'vue'\nimport { defineComponent, genericComponent, mergeDeep, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, JSXComponent, PropType, Ref } from 'vue'\n\nexport type IconValue =\n | string\n | (string | [path: string, opacity: number])[]\n | JSXComponent\nexport const IconValue = [String, Function, Object, Array] as PropType<IconValue>\n\nexport interface IconAliases {\n [name: string]: IconValue\n complete: IconValue\n cancel: IconValue\n close: IconValue\n delete: IconValue\n clear: IconValue\n success: IconValue\n info: IconValue\n warning: IconValue\n error: IconValue\n prev: IconValue\n next: IconValue\n checkboxOn: IconValue\n checkboxOff: IconValue\n checkboxIndeterminate: IconValue\n delimiter: IconValue\n sortAsc: IconValue\n sortDesc: IconValue\n expand: IconValue\n menu: IconValue\n subgroup: IconValue\n dropdown: IconValue\n radioOn: IconValue\n radioOff: IconValue\n edit: IconValue\n ratingEmpty: IconValue\n ratingFull: IconValue\n ratingHalf: IconValue\n loading: IconValue\n first: IconValue\n last: IconValue\n unfold: IconValue\n file: IconValue\n plus: IconValue\n minus: IconValue\n}\n\nexport interface IconProps {\n tag: string\n icon?: IconValue\n disabled?: Boolean\n}\n\ntype IconComponent = JSXComponent<IconProps>\n\nexport interface IconSet {\n component: IconComponent\n}\n\nexport type IconOptions = {\n defaultSet: string\n aliases?: Partial<IconAliases>\n sets: Record<string, IconSet>\n}\n\ntype IconInstance = {\n component: IconComponent\n icon?: IconValue\n}\n\nexport const IconSymbol: InjectionKey<IconOptions> = Symbol.for('vuetify:icons')\n\nexport const makeIconProps = propsFactory({\n icon: {\n type: IconValue,\n },\n // Could not remove this and use makeTagProps, types complained because it is not required\n tag: {\n type: String,\n required: true,\n },\n}, 'icon')\n\nexport const VComponentIcon = genericComponent()({\n name: 'VComponentIcon',\n\n props: makeIconProps(),\n\n setup (props, { slots }) {\n return () => {\n const Icon = props.icon as JSXComponent\n return (\n <props.tag>\n { props.icon ? <Icon /> : slots.default?.() }\n </props.tag>\n )\n }\n },\n})\nexport type VComponentIcon = InstanceType<typeof VComponentIcon>\n\nexport const VSvgIcon = defineComponent({\n name: 'VSvgIcon',\n\n inheritAttrs: false,\n\n props: makeIconProps(),\n\n setup (props, { attrs }) {\n return () => {\n return (\n <props.tag { ...attrs } style={ null }>\n <svg\n class=\"v-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n { Array.isArray(props.icon)\n ? props.icon.map(path => (\n Array.isArray(path)\n ? <path d={ path[0] as string } fill-opacity={ path[1] }></path>\n : <path d={ path as string }></path>\n ))\n : <path d={ props.icon as string }></path>\n }\n </svg>\n </props.tag>\n )\n }\n },\n})\nexport type VSvgIcon = InstanceType<typeof VSvgIcon>\n\nexport const VLigatureIcon = defineComponent({\n name: 'VLigatureIcon',\n\n props: makeIconProps(),\n\n setup (props) {\n return () => {\n return <props.tag>{ props.icon }</props.tag>\n }\n },\n})\nexport type VLigatureIcon = InstanceType<typeof VLigatureIcon>\n\nexport const VClassIcon = defineComponent({\n name: 'VClassIcon',\n\n props: makeIconProps(),\n\n setup (props) {\n return () => {\n return <props.tag class={ props.icon }></props.tag>\n }\n },\n})\nexport type VClassIcon = InstanceType<typeof VClassIcon>\n\nexport const defaultSets: Record<string, IconSet> = {\n svg: {\n component: VSvgIcon,\n },\n class: {\n component: VClassIcon,\n },\n}\n\n// Composables\nexport function createIcons (options?: IconOptions) {\n return mergeDeep({\n defaultSet: 'mdi',\n sets: {\n ...defaultSets,\n mdi,\n },\n aliases,\n }, options)\n}\n\nexport const useIcon = (props: Ref<string | undefined> | { icon?: IconValue }) => {\n const icons = inject(IconSymbol)\n\n if (!icons) throw new Error('Missing Vuetify Icons provide!')\n\n const iconData: Ref<IconInstance> = computed(() => {\n const iconAlias = isRef(props) ? props.value : props.icon\n\n if (!iconAlias) return { component: VComponentIcon }\n\n let icon: IconValue | undefined = iconAlias\n\n if (typeof icon === 'string') {\n icon = icon.trim()\n\n if (icon.startsWith('$')) {\n icon = icons.aliases?.[icon.slice(1)]\n }\n }\n\n if (!icon) throw new Error(`Could not find aliased icon \"${iconAlias}\"`)\n\n if (Array.isArray(icon)) {\n return {\n component: VSvgIcon,\n icon,\n }\n } else if (typeof icon !== 'string') {\n return {\n component: VComponentIcon,\n icon,\n }\n }\n\n const iconSetName = Object.keys(icons.sets).find(\n setName => typeof icon === 'string' && icon.startsWith(`${setName}:`)\n )\n\n const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon\n const iconSet = icons.sets[iconSetName ?? icons.defaultSet]\n\n return {\n component: iconSet.component,\n icon: iconName,\n }\n })\n\n return { iconData }\n}\n"],"mappings":";AAAA;AAAA,SACSA,OAAO,EAAEC,GAAG,+BAErB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACpCC,eAAe,EAAEC,gBAAgB,EAAEC,SAAS,EAAEC,YAAY,6BAEnE;AAOA,OAAO,MAAMC,SAAS,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,CAAwB;AA+DjF,OAAO,MAAMC,UAAqC,GAAGC,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC;AAEhF,OAAO,MAAMC,aAAa,GAAGT,YAAY,CAAC;EACxCU,IAAI,EAAE;IACJC,IAAI,EAAEV;EACR,CAAC;EACD;EACAW,GAAG,EAAE;IACHD,IAAI,EAAET,MAAM;IACZW,QAAQ,EAAE;EACZ;AACF,CAAC,EAAE,MAAM,CAAC;AAEV,OAAO,MAAMC,cAAc,GAAGhB,gBAAgB,EAAE,CAAC;EAC/CiB,I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;EAEF,OAAO;IAAEV;EAAS,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"icons.mjs","names":["aliases","mdi","computed","inject","unref","defineComponent","genericComponent","mergeDeep","propsFactory","IconValue","String","Function","Object","Array","IconSymbol","Symbol","for","makeIconProps","icon","type","tag","required","VComponentIcon","name","props","setup","_ref","slots","Icon","_createVNode","default","VSvgIcon","inheritAttrs","_ref2","attrs","_mergeProps","isArray","map","path","VLigatureIcon","VClassIcon","defaultSets","svg","component","class","createIcons","options","defaultSet","sets","useIcon","icons","Error","iconData","iconAlias","trim","startsWith","slice","iconSetName","keys","find","setName","iconName","length","iconSet"],"sources":["../../src/composables/icons.tsx"],"sourcesContent":["// Icons\nimport { aliases, mdi } from '@/iconsets/mdi'\n\n// Utilities\nimport { computed, inject, unref } from 'vue'\nimport { defineComponent, genericComponent, mergeDeep, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, JSXComponent, PropType, Ref } from 'vue'\n\nexport type IconValue =\n | string\n | (string | [path: string, opacity: number])[]\n | JSXComponent\nexport const IconValue = [String, Function, Object, Array] as PropType<IconValue>\n\nexport interface IconAliases {\n [name: string]: IconValue\n complete: IconValue\n cancel: IconValue\n close: IconValue\n delete: IconValue\n clear: IconValue\n success: IconValue\n info: IconValue\n warning: IconValue\n error: IconValue\n prev: IconValue\n next: IconValue\n checkboxOn: IconValue\n checkboxOff: IconValue\n checkboxIndeterminate: IconValue\n delimiter: IconValue\n sortAsc: IconValue\n sortDesc: IconValue\n expand: IconValue\n menu: IconValue\n subgroup: IconValue\n dropdown: IconValue\n radioOn: IconValue\n radioOff: IconValue\n edit: IconValue\n ratingEmpty: IconValue\n ratingFull: IconValue\n ratingHalf: IconValue\n loading: IconValue\n first: IconValue\n last: IconValue\n unfold: IconValue\n file: IconValue\n plus: IconValue\n minus: IconValue\n}\n\nexport interface IconProps {\n tag: string\n icon?: IconValue\n disabled?: Boolean\n}\n\ntype IconComponent = JSXComponent<IconProps>\n\nexport interface IconSet {\n component: IconComponent\n}\n\nexport type IconOptions = {\n defaultSet: string\n aliases?: Partial<IconAliases>\n sets: Record<string, IconSet>\n}\n\ntype IconInstance = {\n component: IconComponent\n icon?: IconValue\n}\n\nexport const IconSymbol: InjectionKey<IconOptions> = Symbol.for('vuetify:icons')\n\nexport const makeIconProps = propsFactory({\n icon: {\n type: IconValue,\n },\n // Could not remove this and use makeTagProps, types complained because it is not required\n tag: {\n type: String,\n required: true,\n },\n}, 'icon')\n\nexport const VComponentIcon = genericComponent()({\n name: 'VComponentIcon',\n\n props: makeIconProps(),\n\n setup (props, { slots }) {\n return () => {\n const Icon = props.icon as JSXComponent\n return (\n <props.tag>\n { props.icon ? <Icon /> : slots.default?.() }\n </props.tag>\n )\n }\n },\n})\nexport type VComponentIcon = InstanceType<typeof VComponentIcon>\n\nexport const VSvgIcon = defineComponent({\n name: 'VSvgIcon',\n\n inheritAttrs: false,\n\n props: makeIconProps(),\n\n setup (props, { attrs }) {\n return () => {\n return (\n <props.tag { ...attrs } style={ null }>\n <svg\n class=\"v-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n { Array.isArray(props.icon)\n ? props.icon.map(path => (\n Array.isArray(path)\n ? <path d={ path[0] as string } fill-opacity={ path[1] }></path>\n : <path d={ path as string }></path>\n ))\n : <path d={ props.icon as string }></path>\n }\n </svg>\n </props.tag>\n )\n }\n },\n})\nexport type VSvgIcon = InstanceType<typeof VSvgIcon>\n\nexport const VLigatureIcon = defineComponent({\n name: 'VLigatureIcon',\n\n props: makeIconProps(),\n\n setup (props) {\n return () => {\n return <props.tag>{ props.icon }</props.tag>\n }\n },\n})\nexport type VLigatureIcon = InstanceType<typeof VLigatureIcon>\n\nexport const VClassIcon = defineComponent({\n name: 'VClassIcon',\n\n props: makeIconProps(),\n\n setup (props) {\n return () => {\n return <props.tag class={ props.icon }></props.tag>\n }\n },\n})\nexport type VClassIcon = InstanceType<typeof VClassIcon>\n\nexport const defaultSets: Record<string, IconSet> = {\n svg: {\n component: VSvgIcon,\n },\n class: {\n component: VClassIcon,\n },\n}\n\n// Composables\nexport function createIcons (options?: IconOptions) {\n return mergeDeep({\n defaultSet: 'mdi',\n sets: {\n ...defaultSets,\n mdi,\n },\n aliases,\n }, options)\n}\n\nexport const useIcon = (props: Ref<IconValue | undefined>) => {\n const icons = inject(IconSymbol)\n\n if (!icons) throw new Error('Missing Vuetify Icons provide!')\n\n const iconData: Ref<IconInstance> = computed(() => {\n const iconAlias = unref(props)\n\n if (!iconAlias) return { component: VComponentIcon }\n\n let icon: IconValue | undefined = iconAlias\n\n if (typeof icon === 'string') {\n icon = icon.trim()\n\n if (icon.startsWith('$')) {\n icon = icons.aliases?.[icon.slice(1)]\n }\n }\n\n if (!icon) throw new Error(`Could not find aliased icon \"${iconAlias}\"`)\n\n if (Array.isArray(icon)) {\n return {\n component: VSvgIcon,\n icon,\n }\n } else if (typeof icon !== 'string') {\n return {\n component: VComponentIcon,\n icon,\n }\n }\n\n const iconSetName = Object.keys(icons.sets).find(\n setName => typeof icon === 'string' && icon.startsWith(`${setName}:`)\n )\n\n const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon\n const iconSet = icons.sets[iconSetName ?? icons.defaultSet]\n\n return {\n component: iconSet.component,\n icon: iconName,\n }\n })\n\n return { iconData }\n}\n"],"mappings":";AAAA;AAAA,SACSA,OAAO,EAAEC,GAAG,+BAErB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACpCC,eAAe,EAAEC,gBAAgB,EAAEC,SAAS,EAAEC,YAAY,6BAEnE;AAOA,OAAO,MAAMC,SAAS,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,CAAwB;AA+DjF,OAAO,MAAMC,UAAqC,GAAGC,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC;AAEhF,OAAO,MAAMC,aAAa,GAAGT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AO,GAAGb,KAAK,CAACF,IAAI,CAACS,WAAW,IAAIP,KAAK,CAACH,UAAU,CAAC;IAE3D,OAAO;MACLJ,SAAS,EAAEoB,OAAO,CAACpB,SAAS;MAC5BzB,IAAI,EAAE2C;IACR,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IAAET;EAAS,CAAC;AACrB,CAAC"}
@@ -1,20 +1,19 @@
1
1
  // Utilities
2
2
  import { computed, getCurrentInstance, onBeforeUnmount, onMounted, ref, watch } from 'vue';
3
- import { consoleWarn, propsFactory } from "../util/index.mjs"; // Types
3
+ import { clamp, consoleWarn, propsFactory } from "../util/index.mjs"; // Types
4
4
  // Composables
5
5
  export const makeScrollProps = propsFactory({
6
6
  scrollTarget: {
7
7
  type: String
8
8
  },
9
9
  scrollThreshold: {
10
- type: [String, Number]
10
+ type: [String, Number],
11
+ default: 300
11
12
  }
12
13
  }, 'scroll');
13
14
  export function useScroll(props) {
14
15
  let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15
16
  const {
16
- thresholdMetCallback,
17
- scrollThreshold,
18
17
  canScroll
19
18
  } = args;
20
19
  let previousScroll = 0;
@@ -24,8 +23,16 @@ export function useScroll(props) {
24
23
  const currentThreshold = ref(0);
25
24
  const isScrollActive = ref(false);
26
25
  const isScrollingUp = ref(false);
27
- const computedScrollThreshold = computed(() => {
28
- return Number(props.scrollThreshold ?? scrollThreshold ?? 300);
26
+ const scrollThreshold = computed(() => {
27
+ return Number(props.scrollThreshold);
28
+ });
29
+
30
+ /**
31
+ * 1: at top
32
+ * 0: at threshold
33
+ */
34
+ const scrollRatio = computed(() => {
35
+ return clamp((scrollThreshold.value - currentScroll.value) / scrollThreshold.value || 0);
29
36
  });
30
37
  const onScroll = () => {
31
38
  const targetEl = target.value;
@@ -33,7 +40,7 @@ export function useScroll(props) {
33
40
  previousScroll = currentScroll.value;
34
41
  currentScroll.value = 'window' in targetEl ? targetEl.pageYOffset : targetEl.scrollTop;
35
42
  isScrollingUp.value = currentScroll.value < previousScroll;
36
- currentThreshold.value = Math.abs(currentScroll.value - computedScrollThreshold.value);
43
+ currentThreshold.value = Math.abs(currentScroll.value - scrollThreshold.value);
37
44
  };
38
45
  watch(isScrollingUp, () => {
39
46
  savedScroll.value = savedScroll.value || currentScroll.value;
@@ -61,15 +68,6 @@ export function useScroll(props) {
61
68
  onBeforeUnmount(() => {
62
69
  target.value?.removeEventListener('scroll', onScroll);
63
70
  });
64
- thresholdMetCallback && watch(() => Math.abs(currentScroll.value - savedScroll.value) > computedScrollThreshold.value, thresholdMet => {
65
- thresholdMet && thresholdMetCallback({
66
- currentThreshold: currentThreshold.value,
67
- isScrollingUp: isScrollingUp.value,
68
- savedScroll
69
- });
70
- }, {
71
- immediate: true
72
- });
73
71
 
74
72
  // Do we need this? If yes - seems that
75
73
  // there's no need to expose onScroll
@@ -77,10 +75,11 @@ export function useScroll(props) {
77
75
  immediate: true
78
76
  });
79
77
  return {
80
- computedScrollThreshold,
78
+ scrollThreshold,
81
79
  currentScroll,
82
80
  currentThreshold,
83
81
  isScrollActive,
82
+ scrollRatio,
84
83
  // required only for testing
85
84
  // probably can be removed
86
85
  // later (2 chars chlng)
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.mjs","names":["computed","getCurrentInstance","onBeforeUnmount","onMounted","ref","watch","consoleWarn","propsFactory","makeScrollProps","scrollTarget","type","String","scrollThreshold","Number","useScroll","props","args","arguments","length","undefined","thresholdMetCallback","canScroll","previousScroll","target","currentScroll","savedScroll","currentThreshold","isScrollActive","isScrollingUp","computedScrollThreshold","onScroll","targetEl","value","pageYOffset","scrollTop","Math","abs","newTarget","document","querySelector","window","removeEventListener","addEventListener","passive","immediate","thresholdMet"],"sources":["../../src/composables/scroll.ts"],"sourcesContent":["// Utilities\nimport {\n computed,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from 'vue'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nexport interface ScrollProps {\n scrollTarget?: string\n scrollThreshold?: string | number\n}\n\nexport interface ThresholdMetCallbackData {\n isScrollingUp: boolean\n currentThreshold: number\n savedScroll: Ref<number>\n}\n\n// Composables\nexport const makeScrollProps = propsFactory({\n scrollTarget: {\n type: String,\n },\n scrollThreshold: {\n type: [String, Number],\n },\n}, 'scroll')\n\nexport interface ScrollArguments {\n thresholdMetCallback?: (data: ThresholdMetCallbackData) => void\n scrollThreshold?: Readonly<Ref<number>>\n canScroll?: Readonly<Ref<boolean>>\n}\n\nexport function useScroll (\n props: ScrollProps,\n args: ScrollArguments = {},\n) {\n const { thresholdMetCallback, scrollThreshold, canScroll } = args\n let previousScroll = 0\n const target = ref<Element | Window | null>(null)\n const currentScroll = ref(0)\n const savedScroll = ref(0)\n const currentThreshold = ref(0)\n const isScrollActive = ref(false)\n const isScrollingUp = ref(false)\n\n const computedScrollThreshold = computed(() => {\n return Number(props.scrollThreshold ?? scrollThreshold ?? 300)\n })\n\n const onScroll = () => {\n const targetEl = target.value\n\n if (!targetEl || (canScroll && !canScroll.value)) return\n\n previousScroll = currentScroll.value\n currentScroll.value = ('window' in targetEl) ? targetEl.pageYOffset : targetEl.scrollTop\n\n isScrollingUp.value = currentScroll.value < previousScroll\n currentThreshold.value = Math.abs(currentScroll.value - computedScrollThreshold.value)\n }\n\n watch(isScrollingUp, () => {\n savedScroll.value = savedScroll.value || currentScroll.value\n })\n\n watch(isScrollActive, () => {\n savedScroll.value = 0\n })\n\n onMounted(() => {\n watch(() => props.scrollTarget, scrollTarget => {\n const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window\n\n if (!newTarget) {\n consoleWarn(`Unable to locate element with identifier ${scrollTarget}`, getCurrentInstance())\n return\n }\n\n if (newTarget === target.value) return\n\n target.value?.removeEventListener('scroll', onScroll)\n target.value = newTarget\n target.value.addEventListener('scroll', onScroll, { passive: true })\n }, { immediate: true })\n })\n\n onBeforeUnmount(() => {\n target.value?.removeEventListener('scroll', onScroll)\n })\n\n thresholdMetCallback && watch(() => (\n Math.abs(currentScroll.value - savedScroll.value) > computedScrollThreshold.value\n ), thresholdMet => {\n thresholdMet && thresholdMetCallback({\n currentThreshold: currentThreshold.value,\n isScrollingUp: isScrollingUp.value,\n savedScroll,\n })\n }, { immediate: true })\n\n // Do we need this? If yes - seems that\n // there's no need to expose onScroll\n canScroll && watch(canScroll, onScroll, { immediate: true })\n\n return {\n computedScrollThreshold,\n currentScroll,\n currentThreshold,\n isScrollActive,\n\n // required only for testing\n // probably can be removed\n // later (2 chars chlng)\n isScrollingUp,\n savedScroll,\n }\n}\n"],"mappings":"AAAA;AACA,SACEA,QAAQ,EACRC,kBAAkB,EAClBC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,KAAK,QACA,KAAK;AAAA,SACHC,WAAW,EAAEC,YAAY,6BAElC;AAcA;AACA,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,YAAY,EAAE;IACZC,IAAI,EAAEC;EACR,CAAC;EACDC,eAAe,EAAE;IACfF,IAAI,EAAE,CAACC,MAAM,EAAEE,MAAM;EACvB;AACF,CAAC,EAAE,QAAQ,CAAC;AAQZ,OAAO,SAASC,SAASA,CACvBC,KAAkB,EAElB;EAAA,IADAC,IAAqB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE1B,MAAM;IAAEG,oBAAoB;IAAER,eAAe;IAAES;EAAU,CAAC,GAAGL,IAAI;EACjE,IAAIM,cAAc,GAAG,CAAC;EACtB,MAAMC,MAAM,GAAGnB,GAAG,CAA0B,IAAI,CAAC;EACjD,MAAMoB,aAAa,GAAGpB,GAAG,CAAC,CAAC,CAAC;EAC5B,MAAMqB,WAAW,GAAGrB,GAAG,CAAC,CAAC,CAAC;EAC1B,MAAMsB,gBAAgB,GAAGtB,GAAG,CAAC,CAAC,CAAC;EAC/B,MAAMuB,cAAc,GAAGvB,GAAG,CAAC,KAAK,CA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AEA,IAAIoC,SAAS,KAAKd,MAAM,CAACS,KAAK,EAAE;MAEhCT,MAAM,CAACS,KAAK,EAAES,mBAAmB,CAAC,QAAQ,EAAEX,QAAQ,CAAC;MACrDP,MAAM,CAACS,KAAK,GAAGK,SAAS;MACxBd,MAAM,CAACS,KAAK,CAACU,gBAAgB,CAAC,QAAQ,EAAEZ,QAAQ,EAAE;QAAEa,OAAO,EAAE;MAAK,CAAC,CAAC;IACtE,CAAC,EAAE;MAAEC,SAAS,EAAE;IAAK,CAAC,CAAC;EACzB,CAAC,CAAC;EAEF1C,eAAe,CAAC,MAAM;IACpBqB,MAAM,CAACS,KAAK,EAAES,mBAAmB,CAAC,QAAQ,EAAEX,QAAQ,CAAC;EACvD,CAAC,CAAC;EAEFV,oBAAoB,IAAIf,KAAK,CAAC,MAC5B8B,IAAI,CAACC,GAAG,CAACZ,aAAa,CAACQ,KAAK,GAAGP,WAAW,CAACO,KAAK,CAAC,GAAGH,uBAAuB,CAACG,KAC7E,EAAEa,YAAY,IAAI;IACjBA,YAAY,IAAIzB,oBAAoB,CAAC;MACnCM,gBAAgB,EAAEA,gBAAgB,CAACM,KAAK;MACxCJ,aAAa,EAAEA,aAAa,CAACI,KAAK;MAClCP;IACF,CAAC,CAAC;EACJ,CAAC,EAAE;IAAEmB,SAAS,EAAE;EAAK,CAAC,CAAC;;EAEvB;EACA;EACAvB,SAAS,IAAIhB,KAAK,CAACgB,SAAS,EAAES,QAAQ,EAAE;IAAEc,SAAS,EAAE;EAAK,CAAC,CAAC;EAE5D,OAAO;IACLf,uBAAuB;IACvBL,aAAa;IACbE,gBAAgB;IAChBC,cAAc;IAEd;IACA;IACA;IACAC,aAAa;IACbH;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"scroll.mjs","names":["computed","getCurrentInstance","onBeforeUnmount","onMounted","ref","watch","clamp","consoleWarn","propsFactory","makeScrollProps","scrollTarget","type","String","scrollThreshold","Number","default","useScroll","props","args","arguments","length","undefined","canScroll","previousScroll","target","currentScroll","savedScroll","currentThreshold","isScrollActive","isScrollingUp","scrollRatio","value","onScroll","targetEl","pageYOffset","scrollTop","Math","abs","newTarget","document","querySelector","window","removeEventListener","addEventListener","passive","immediate"],"sources":["../../src/composables/scroll.ts"],"sourcesContent":["// Utilities\nimport {\n computed,\n getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from 'vue'\nimport { clamp, consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nexport interface ScrollProps {\n scrollTarget?: string\n scrollThreshold?: string | number\n}\n\nexport interface ThresholdMetCallbackData {\n isScrollingUp: boolean\n currentThreshold: number\n savedScroll: Ref<number>\n}\n\n// Composables\nexport const makeScrollProps = propsFactory({\n scrollTarget: {\n type: String,\n },\n scrollThreshold: {\n type: [String, Number],\n default: 300,\n },\n}, 'scroll')\n\nexport interface ScrollArguments {\n canScroll?: Readonly<Ref<boolean>>\n}\n\nexport function useScroll (\n props: ScrollProps,\n args: ScrollArguments = {},\n) {\n const { canScroll } = args\n let previousScroll = 0\n const target = ref<Element | Window | null>(null)\n const currentScroll = ref(0)\n const savedScroll = ref(0)\n const currentThreshold = ref(0)\n const isScrollActive = ref(false)\n const isScrollingUp = ref(false)\n\n const scrollThreshold = computed(() => {\n return Number(props.scrollThreshold)\n })\n\n /**\n * 1: at top\n * 0: at threshold\n */\n const scrollRatio = computed(() => {\n return clamp(((scrollThreshold.value - currentScroll.value) / scrollThreshold.value) || 0)\n })\n\n const onScroll = () => {\n const targetEl = target.value\n\n if (!targetEl || (canScroll && !canScroll.value)) return\n\n previousScroll = currentScroll.value\n currentScroll.value = ('window' in targetEl) ? targetEl.pageYOffset : targetEl.scrollTop\n\n isScrollingUp.value = currentScroll.value < previousScroll\n currentThreshold.value = Math.abs(currentScroll.value - scrollThreshold.value)\n }\n\n watch(isScrollingUp, () => {\n savedScroll.value = savedScroll.value || currentScroll.value\n })\n\n watch(isScrollActive, () => {\n savedScroll.value = 0\n })\n\n onMounted(() => {\n watch(() => props.scrollTarget, scrollTarget => {\n const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window\n\n if (!newTarget) {\n consoleWarn(`Unable to locate element with identifier ${scrollTarget}`, getCurrentInstance())\n return\n }\n\n if (newTarget === target.value) return\n\n target.value?.removeEventListener('scroll', onScroll)\n target.value = newTarget\n target.value.addEventListener('scroll', onScroll, { passive: true })\n }, { immediate: true })\n })\n\n onBeforeUnmount(() => {\n target.value?.removeEventListener('scroll', onScroll)\n })\n\n // Do we need this? If yes - seems that\n // there's no need to expose onScroll\n canScroll && watch(canScroll, onScroll, { immediate: true })\n\n return {\n scrollThreshold,\n currentScroll,\n currentThreshold,\n isScrollActive,\n scrollRatio,\n\n // required only for testing\n // probably can be removed\n // later (2 chars chlng)\n isScrollingUp,\n savedScroll,\n }\n}\n"],"mappings":"AAAA;AACA,SACEA,QAAQ,EACRC,kBAAkB,EAClBC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,KAAK,QACA,KAAK;AAAA,SACHC,KAAK,EAAEC,WAAW,EAAEC,YAAY,6BAEzC;AAcA;AACA,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,YAAY,EAAE;IACZC,IAAI,EAAEC;EACR,CAAC;EACDC,eAAe,EAAE;IACfF,IAAI,EAAE,CAACC,MAAM,EAAEE,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX;AACF,CAAC,EAAE,QAAQ,CAAC;AAMZ,OAAO,SAASC,SAASA,CACvBC,KAAkB,EAElB;EAAA,IADAC,IAAqB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE1B,MAAM;IAAEG;EAAU,CAAC,GAAGJ,IAAI;EAC1B,IAAIK,cAAc,GAAG,CAAC;EACtB,MAAMC,MAAM,GAAGpB,GAAG,CAA0B,IAAI,CAAC;EACjD,MAAMqB,aAAa,GAAGrB,GAAG,CAAC,CAAC,CAAC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KAAK,GAAG,CAAC;EACvB,CAAC,CAAC;EAEF5B,SAAS,CAAC,MAAM;IACdE,KAAK,CAAC,MAAMY,KAAK,CAACP,YAAY,EAAEA,YAAY,IAAI;MAC9C,MAAM4B,SAAS,GAAG5B,YAAY,GAAG6B,QAAQ,CAACC,aAAa,CAAC9B,YAAY,CAAC,GAAG+B,MAAM;MAE9E,IAAI,CAACH,SAAS,EAAE;QACd/B,WAAW,CAAE,4CAA2CG,YAAa,EAAC,EAAET,kBAAkB,EAAE,CAAC;QAC7F;MACF;MAEA,IAAIqC,SAAS,KAAKd,MAAM,CAACO,KAAK,EAAE;MAEhCP,MAAM,CAACO,KAAK,EAAEW,mBAAmB,CAAC,QAAQ,EAAEV,QAAQ,CAAC;MACrDR,MAAM,CAACO,KAAK,GAAGO,SAAS;MACxBd,MAAM,CAACO,KAAK,CAACY,gBAAgB,CAAC,QAAQ,EAAEX,QAAQ,EAAE;QAAEY,OAAO,EAAE;MAAK,CAAC,CAAC;IACtE,CAAC,EAAE;MAAEC,SAAS,EAAE;IAAK,CAAC,CAAC;EACzB,CAAC,CAAC;EAEF3C,eAAe,CAAC,MAAM;IACpBsB,MAAM,CAACO,KAAK,EAAEW,mBAAmB,CAAC,QAAQ,EAAEV,QAAQ,CAAC;EACvD,CAAC,CAAC;;EAEF;EACA;EACAV,SAAS,IAAIjB,KAAK,CAACiB,SAAS,EAAEU,QAAQ,EAAE;IAAEa,SAAS,EAAE;EAAK,CAAC,CAAC;EAE5D,OAAO;IACLhC,eAAe;IACfY,aAAa;IACbE,gBAAgB;IAChBC,cAAc;IACdE,WAAW;IAEX;IACA;IACA;IACAD,aAAa;IACbH;EACF,CAAC;AACH"}
@@ -62,7 +62,7 @@ export const ClickOutside = {
62
62
  });
63
63
  if (!el._clickOutside) {
64
64
  el._clickOutside = {
65
- lastMousedownWasOutside: true
65
+ lastMousedownWasOutside: false
66
66
  };
67
67
  }
68
68
  el._clickOutside[binding.instance.$.uid] = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["attachedRoot","defaultConditional","checkEvent","e","el","binding","checkIsActive","root","ShadowRoot","host","target","elements","value","include","push","some","contains","isActive","closeConditional","directive","handler","_clickOutside","lastMousedownWasOutside","setTimeout","handleShadow","callback","document","ClickOutside","mounted","onClick","onMousedown","app","addEventListener","instance","$","uid","unmounted","removeEventListener"],"sources":["../../../src/directives/click-outside/index.ts"],"sourcesContent":["import { attachedRoot } from '@/util'\nimport type { DirectiveBinding } from 'vue'\n\ninterface ClickOutsideBindingArgs {\n handler: (e: MouseEvent) => void\n closeConditional?: (e: Event) => boolean\n include?: () => HTMLElement[]\n}\n\ninterface ClickOutsideDirectiveBinding extends DirectiveBinding {\n value: ((e: MouseEvent) => void) | ClickOutsideBindingArgs\n}\n\nfunction defaultConditional () {\n return true\n}\n\nfunction checkEvent (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding): boolean {\n // The include element callbacks below can be expensive\n // so we should avoid calling them when we're not active.\n // Explicitly check for false to allow fallback compatibility\n // with non-toggleable components\n if (!e || checkIsActive(e, binding) === false) return false\n\n // If we're clicking inside the shadowroot, then the app root doesn't get the same\n // level of introspection as to _what_ we're clicking. We want to check to see if\n // our target is the shadowroot parent container, and if it is, ignore.\n const root = attachedRoot(el)\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === e.target\n ) return false\n\n // Check if additional elements were passed to be included in check\n // (click must be outside all included elements, if any)\n const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()\n // Add the root element for the component this directive was defined on\n elements.push(el)\n\n // Check if it's a click outside our elements, and then if our callback returns true.\n // Non-toggleable components should take action in their callback and return falsy.\n // Toggleable can return true if it wants to deactivate.\n // Note that, because we're in the capture phase, this callback will occur before\n // the bubbling click event on any outside elements.\n return !elements.some(el => el?.contains(e.target as Node))\n}\n\nfunction checkIsActive (e: MouseEvent, binding: ClickOutsideDirectiveBinding): boolean | void {\n const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional\n\n return isActive(e)\n}\n\nfunction directive (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler\n\n el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {\n checkIsActive(e, binding) && handler && handler(e)\n }, 0)\n}\n\nfunction handleShadow (el: HTMLElement, callback: Function): void {\n const root = attachedRoot(el)\n\n callback(document)\n\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {\n callback(root)\n }\n}\n\nexport const ClickOutside = {\n // [data-app] may not be found\n // if using bind, inserted makes\n // sure that the root element is\n // available, iOS does not support\n // clicks on body\n mounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const onClick = (e: Event) => directive(e as MouseEvent, el, binding)\n const onMousedown = (e: Event) => {\n el._clickOutside!.lastMousedownWasOutside = checkEvent(e as MouseEvent, el, binding)\n }\n\n handleShadow(el, (app: HTMLElement) => {\n app.addEventListener('click', onClick, true)\n app.addEventListener('mousedown', onMousedown, true)\n })\n\n if (!el._clickOutside) {\n el._clickOutside = {\n lastMousedownWasOutside: true,\n }\n }\n\n el._clickOutside[binding.instance!.$.uid] = {\n onClick,\n onMousedown,\n }\n },\n\n unmounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n if (!el._clickOutside) return\n\n handleShadow(el, (app: HTMLElement) => {\n if (!app || !el._clickOutside?.[binding.instance!.$.uid]) return\n\n const { onClick, onMousedown } = el._clickOutside[binding.instance!.$.uid]!\n\n app.removeEventListener('click', onClick, true)\n app.removeEventListener('mousedown', onMousedown, true)\n })\n\n delete el._clickOutside[binding.instance!.$.uid]\n },\n}\n\nexport default ClickOutside\n"],"mappings":"SAASA,YAAY;AAarB,SAASC,kBAAkBA,CAAA,EAAI;EAC7B,OAAO,IAAI;AACb;AAEA,SAASC,UAAUA,CAAEC,CAAa,EAAEC,EAAe,EAAEC,OAAqC,EAAW;E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AqC,EAAE;IACjE,IAAI,CAACD,EAAE,CAACiB,aAAa,EAAE;IAEvBG,YAAY,CAACpB,EAAE,EAAG2B,GAAgB,IAAK;MACrC,IAAI,CAACA,GAAG,IAAI,CAAC3B,EAAE,CAACiB,aAAa,GAAGhB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAC,EAAE;MAE1D,MAAM;QAAEN,OAAO;QAAEC;MAAY,CAAC,GAAG1B,EAAE,CAACiB,aAAa,CAAChB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAE;MAE3EJ,GAAG,CAACM,mBAAmB,CAAC,OAAO,EAAER,OAAO,EAAE,IAAI,CAAC;MAC/CE,GAAG,CAACM,mBAAmB,CAAC,WAAW,EAAEP,WAAW,EAAE,IAAI,CAAC;IACzD,CAAC,CAAC;IAEF,OAAO1B,EAAE,CAACiB,aAAa,CAAChB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAC;EAClD;AACF,CAAC;AAED,eAAeR,YAAY"}
1
+ {"version":3,"file":"index.mjs","names":["attachedRoot","defaultConditional","checkEvent","e","el","binding","checkIsActive","root","ShadowRoot","host","target","elements","value","include","push","some","contains","isActive","closeConditional","directive","handler","_clickOutside","lastMousedownWasOutside","setTimeout","handleShadow","callback","document","ClickOutside","mounted","onClick","onMousedown","app","addEventListener","instance","$","uid","unmounted","removeEventListener"],"sources":["../../../src/directives/click-outside/index.ts"],"sourcesContent":["import { attachedRoot } from '@/util'\nimport type { DirectiveBinding } from 'vue'\n\ninterface ClickOutsideBindingArgs {\n handler: (e: MouseEvent) => void\n closeConditional?: (e: Event) => boolean\n include?: () => HTMLElement[]\n}\n\ninterface ClickOutsideDirectiveBinding extends DirectiveBinding {\n value: ((e: MouseEvent) => void) | ClickOutsideBindingArgs\n}\n\nfunction defaultConditional () {\n return true\n}\n\nfunction checkEvent (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding): boolean {\n // The include element callbacks below can be expensive\n // so we should avoid calling them when we're not active.\n // Explicitly check for false to allow fallback compatibility\n // with non-toggleable components\n if (!e || checkIsActive(e, binding) === false) return false\n\n // If we're clicking inside the shadowroot, then the app root doesn't get the same\n // level of introspection as to _what_ we're clicking. We want to check to see if\n // our target is the shadowroot parent container, and if it is, ignore.\n const root = attachedRoot(el)\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === e.target\n ) return false\n\n // Check if additional elements were passed to be included in check\n // (click must be outside all included elements, if any)\n const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()\n // Add the root element for the component this directive was defined on\n elements.push(el)\n\n // Check if it's a click outside our elements, and then if our callback returns true.\n // Non-toggleable components should take action in their callback and return falsy.\n // Toggleable can return true if it wants to deactivate.\n // Note that, because we're in the capture phase, this callback will occur before\n // the bubbling click event on any outside elements.\n return !elements.some(el => el?.contains(e.target as Node))\n}\n\nfunction checkIsActive (e: MouseEvent, binding: ClickOutsideDirectiveBinding): boolean | void {\n const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional\n\n return isActive(e)\n}\n\nfunction directive (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler\n\n el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {\n checkIsActive(e, binding) && handler && handler(e)\n }, 0)\n}\n\nfunction handleShadow (el: HTMLElement, callback: Function): void {\n const root = attachedRoot(el)\n\n callback(document)\n\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {\n callback(root)\n }\n}\n\nexport const ClickOutside = {\n // [data-app] may not be found\n // if using bind, inserted makes\n // sure that the root element is\n // available, iOS does not support\n // clicks on body\n mounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const onClick = (e: Event) => directive(e as MouseEvent, el, binding)\n const onMousedown = (e: Event) => {\n el._clickOutside!.lastMousedownWasOutside = checkEvent(e as MouseEvent, el, binding)\n }\n\n handleShadow(el, (app: HTMLElement) => {\n app.addEventListener('click', onClick, true)\n app.addEventListener('mousedown', onMousedown, true)\n })\n\n if (!el._clickOutside) {\n el._clickOutside = {\n lastMousedownWasOutside: false,\n }\n }\n\n el._clickOutside[binding.instance!.$.uid] = {\n onClick,\n onMousedown,\n }\n },\n\n unmounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n if (!el._clickOutside) return\n\n handleShadow(el, (app: HTMLElement) => {\n if (!app || !el._clickOutside?.[binding.instance!.$.uid]) return\n\n const { onClick, onMousedown } = el._clickOutside[binding.instance!.$.uid]!\n\n app.removeEventListener('click', onClick, true)\n app.removeEventListener('mousedown', onMousedown, true)\n })\n\n delete el._clickOutside[binding.instance!.$.uid]\n },\n}\n\nexport default ClickOutside\n"],"mappings":"SAASA,YAAY;AAarB,SAASC,kBAAkBA,CAAA,EAAI;EAC7B,OAAO,IAAI;AACb;AAEA,SAASC,UAAUA,CAAEC,CAAa,EAAEC,EAAe,EAAEC,OAAqC,EAAW;EACnG;EACA;EACA;EACA;EACA,IAAI,CAACF,CAAC,IAAIG,aAAa,CAACH,CAAC,EAAEE,OAAO,CAAC,KAAK,KAAK,EAAE,OAAO,KAAK;;EAE3D;EACA;EACA;EACA,MAAME,IAAI,GAAGP,YAAY,CAACI,EAAE,CAAC;EAC7B,IACE,OAAOI,UAAU,KAAK,WAAW,IACjCD,IAAI,YAAYC,UAAU,IAC1BD,IAAI,CAACE,IAAI,KAAKN,CAAC,CAACO,MAAM,EACtB,OAAO,KAAK;;EAEd;EACA;EACA,MAAMC,QAAQ,GAAG,CAAE,OAAON,OAAO,CAACO,KAAK,KAAK,QAAQ,IAAIP,OAAO,CAACO,KAAK,CAACC,OAAO,KAAM,MAAM,EAAE,CAAC,GAAG;EAC/F;EACAF,QAAQ,CAACG,IAAI,CAACV,EAAE,CAAC;;EAEjB;EACA;EACA;EACA;EACA;EACA,OAAO,CAACO,QAAQ,CAACI,I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AC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAC;EAClD;AACF,CAAC;AAED,eAAeR,YAAY"}
@@ -10,7 +10,7 @@ export const createVuetify = function () {
10
10
  ...options
11
11
  });
12
12
  };
13
- export const version = "3.2.2-master-20230501.0";
13
+ export const version = "3.2.3-master-20230503.0";
14
14
  createVuetify.version = version;
15
15
  export { components, directives };
16
16
  export * from "./composables/index.mjs";
package/lib/framework.mjs CHANGED
@@ -94,7 +94,7 @@ export function createVuetify() {
94
94
  date
95
95
  };
96
96
  }
97
- export const version = "3.2.2-master-20230501.0";
97
+ export const version = "3.2.3-master-20230503.0";
98
98
  createVuetify.version = version;
99
99
 
100
100
  // Vue's inject() can only be used in setup
package/lib/index.d.ts CHANGED
@@ -354,20 +354,20 @@ declare module '@vue/runtime-core' {
354
354
  VAppBar: typeof import('vuetify/components')['VAppBar']
355
355
  VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
356
356
  VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
357
+ VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
357
358
  VAlert: typeof import('vuetify/components')['VAlert']
358
359
  VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
359
- VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
360
+ VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
360
361
  VAvatar: typeof import('vuetify/components')['VAvatar']
361
362
  VBadge: typeof import('vuetify/components')['VBadge']
362
- VBanner: typeof import('vuetify/components')['VBanner']
363
- VBannerActions: typeof import('vuetify/components')['VBannerActions']
364
- VBannerText: typeof import('vuetify/components')['VBannerText']
365
- VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
366
363
  VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
367
364
  VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
368
365
  VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
369
- VBtn: typeof import('vuetify/components')['VBtn']
370
366
  VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
367
+ VBanner: typeof import('vuetify/components')['VBanner']
368
+ VBannerActions: typeof import('vuetify/components')['VBannerActions']
369
+ VBannerText: typeof import('vuetify/components')['VBannerText']
370
+ VBtn: typeof import('vuetify/components')['VBtn']
371
371
  VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
372
372
  VCard: typeof import('vuetify/components')['VCard']
373
373
  VCardActions: typeof import('vuetify/components')['VCardActions']
@@ -375,26 +375,25 @@ declare module '@vue/runtime-core' {
375
375
  VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
376
376
  VCardText: typeof import('vuetify/components')['VCardText']
377
377
  VCardTitle: typeof import('vuetify/components')['VCardTitle']
378
+ VCode: typeof import('vuetify/components')['VCode']
378
379
  VCarousel: typeof import('vuetify/components')['VCarousel']
379
380
  VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
380
381
  VCheckbox: typeof import('vuetify/components')['VCheckbox']
381
382
  VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
382
- VChip: typeof import('vuetify/components')['VChip']
383
- VChipGroup: typeof import('vuetify/components')['VChipGroup']
384
- VCode: typeof import('vuetify/components')['VCode']
385
383
  VColorPicker: typeof import('vuetify/components')['VColorPicker']
386
- VCombobox: typeof import('vuetify/components')['VCombobox']
387
384
  VCounter: typeof import('vuetify/components')['VCounter']
388
- VDialog: typeof import('vuetify/components')['VDialog']
389
- VDivider: typeof import('vuetify/components')['VDivider']
385
+ VChipGroup: typeof import('vuetify/components')['VChipGroup']
386
+ VCombobox: typeof import('vuetify/components')['VCombobox']
390
387
  VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
391
388
  VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
392
389
  VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
393
390
  VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
391
+ VDialog: typeof import('vuetify/components')['VDialog']
392
+ VDivider: typeof import('vuetify/components')['VDivider']
393
+ VFooter: typeof import('vuetify/components')['VFooter']
394
+ VFileInput: typeof import('vuetify/components')['VFileInput']
394
395
  VField: typeof import('vuetify/components')['VField']
395
396
  VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
396
- VFileInput: typeof import('vuetify/components')['VFileInput']
397
- VFooter: typeof import('vuetify/components')['VFooter']
398
397
  VIcon: typeof import('vuetify/components')['VIcon']
399
398
  VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
400
399
  VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
@@ -402,9 +401,9 @@ declare module '@vue/runtime-core' {
402
401
  VClassIcon: typeof import('vuetify/components')['VClassIcon']
403
402
  VImg: typeof import('vuetify/components')['VImg']
404
403
  VInput: typeof import('vuetify/components')['VInput']
404
+ VKbd: typeof import('vuetify/components')['VKbd']
405
405
  VItemGroup: typeof import('vuetify/components')['VItemGroup']
406
406
  VItem: typeof import('vuetify/components')['VItem']
407
- VKbd: typeof import('vuetify/components')['VKbd']
408
407
  VLabel: typeof import('vuetify/components')['VLabel']
409
408
  VList: typeof import('vuetify/components')['VList']
410
409
  VListGroup: typeof import('vuetify/components')['VListGroup']
@@ -416,6 +415,7 @@ declare module '@vue/runtime-core' {
416
415
  VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
417
416
  VListSubheader: typeof import('vuetify/components')['VListSubheader']
418
417
  VMain: typeof import('vuetify/components')['VMain']
418
+ VMenu: typeof import('vuetify/components')['VMenu']
419
419
  VMessages: typeof import('vuetify/components')['VMessages']
420
420
  VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
421
421
  VOverlay: typeof import('vuetify/components')['VOverlay']
@@ -426,37 +426,38 @@ declare module '@vue/runtime-core' {
426
426
  VRating: typeof import('vuetify/components')['VRating']
427
427
  VSelect: typeof import('vuetify/components')['VSelect']
428
428
  VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
429
- VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
430
429
  VSheet: typeof import('vuetify/components')['VSheet']
430
+ VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
431
431
  VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
432
432
  VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
433
- VSlider: typeof import('vuetify/components')['VSlider']
434
- VSnackbar: typeof import('vuetify/components')['VSnackbar']
435
433
  VSwitch: typeof import('vuetify/components')['VSwitch']
436
- VSystemBar: typeof import('vuetify/components')['VSystemBar']
437
434
  VTabs: typeof import('vuetify/components')['VTabs']
438
435
  VTab: typeof import('vuetify/components')['VTab']
439
- VTable: typeof import('vuetify/components')['VTable']
436
+ VSnackbar: typeof import('vuetify/components')['VSnackbar']
437
+ VSlider: typeof import('vuetify/components')['VSlider']
440
438
  VTextarea: typeof import('vuetify/components')['VTextarea']
441
- VTextField: typeof import('vuetify/components')['VTextField']
439
+ VSystemBar: typeof import('vuetify/components')['VSystemBar']
442
440
  VTimeline: typeof import('vuetify/components')['VTimeline']
443
441
  VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
442
+ VTable: typeof import('vuetify/components')['VTable']
443
+ VTextField: typeof import('vuetify/components')['VTextField']
444
+ VTooltip: typeof import('vuetify/components')['VTooltip']
444
445
  VToolbar: typeof import('vuetify/components')['VToolbar']
445
446
  VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
446
447
  VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
447
- VTooltip: typeof import('vuetify/components')['VTooltip']
448
448
  VWindow: typeof import('vuetify/components')['VWindow']
449
449
  VWindowItem: typeof import('vuetify/components')['VWindowItem']
450
+ VChip: typeof import('vuetify/components')['VChip']
450
451
  VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
451
452
  VForm: typeof import('vuetify/components')['VForm']
453
+ VHover: typeof import('vuetify/components')['VHover']
452
454
  VContainer: typeof import('vuetify/components')['VContainer']
453
455
  VCol: typeof import('vuetify/components')['VCol']
454
456
  VRow: typeof import('vuetify/components')['VRow']
455
457
  VSpacer: typeof import('vuetify/components')['VSpacer']
456
- VHover: typeof import('vuetify/components')['VHover']
458
+ VLazy: typeof import('vuetify/components')['VLazy']
457
459
  VLayout: typeof import('vuetify/components')['VLayout']
458
460
  VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
459
- VLazy: typeof import('vuetify/components')['VLazy']
460
461
  VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
461
462
  VNoSsr: typeof import('vuetify/components')['VNoSsr']
462
463
  VParallax: typeof import('vuetify/components')['VParallax']
@@ -482,6 +483,5 @@ declare module '@vue/runtime-core' {
482
483
  VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
483
484
  VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
484
485
  VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
485
- VMenu: typeof import('vuetify/components')['VMenu']
486
486
  }
487
487
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vuetify/nightly",
3
3
  "description": "Vue Material Component Framework",
4
- "version": "3.2.2-master-20230501.0",
4
+ "version": "3.2.3-master-20230503.0",
5
5
  "author": {
6
6
  "name": "John Leider",
7
7
  "email": "john@vuetifyjs.com"