@vuetify/nightly 3.0.2-next-20221122.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +2 -11
  2. package/dist/json/importMap.json +84 -84
  3. package/dist/vuetify.css +85 -84
  4. package/dist/vuetify.d.ts +37 -37
  5. package/dist/vuetify.esm.js +42 -37
  6. package/dist/vuetify.esm.js.map +1 -1
  7. package/dist/vuetify.js +41 -36
  8. package/dist/vuetify.js.map +1 -1
  9. package/dist/vuetify.min.css +2 -2
  10. package/dist/vuetify.min.js +328 -325
  11. package/dist/vuetify.min.js.map +1 -1
  12. package/lib/components/VCard/VCardItem.mjs +1 -2
  13. package/lib/components/VCard/VCardItem.mjs.map +1 -1
  14. package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs +1 -1
  15. package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
  16. package/lib/components/VOverlay/scrollStrategies.mjs +4 -0
  17. package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
  18. package/lib/components/VOverlay/useActivator.mjs +4 -0
  19. package/lib/components/VOverlay/useActivator.mjs.map +1 -1
  20. package/lib/components/VRating/VRating.mjs +7 -6
  21. package/lib/components/VRating/VRating.mjs.map +1 -1
  22. package/lib/components/VRating/index.d.ts +14 -14
  23. package/lib/components/VSlideGroup/VSlideGroup.css +1 -0
  24. package/lib/components/VSlideGroup/VSlideGroup.sass +1 -0
  25. package/lib/components/index.d.ts +14 -14
  26. package/lib/composables/toggleScope.mjs +6 -2
  27. package/lib/composables/toggleScope.mjs.map +1 -1
  28. package/lib/entry-bundler.mjs +1 -1
  29. package/lib/entry-bundler.mjs.map +1 -1
  30. package/lib/framework.mjs +1 -1
  31. package/lib/framework.mjs.map +1 -1
  32. package/lib/index.d.ts +23 -23
  33. package/lib/util/defineComponent.mjs +8 -13
  34. package/lib/util/defineComponent.mjs.map +1 -1
  35. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { effectScope, watch } from 'vue';
1
+ import { effectScope, onScopeDispose, watch } from 'vue';
2
2
  export function useToggleScope(source, cb) {
3
3
  let scope;
4
4
  watch(source, active => {
5
5
  if (active && !scope) {
6
6
  scope = effectScope();
7
7
  scope.run(cb);
8
- } else {
8
+ } else if (!active) {
9
9
  var _scope;
10
10
  (_scope = scope) == null ? void 0 : _scope.stop();
11
11
  scope = undefined;
@@ -13,5 +13,9 @@ export function useToggleScope(source, cb) {
13
13
  }, {
14
14
  immediate: true
15
15
  });
16
+ onScopeDispose(() => {
17
+ var _scope2;
18
+ (_scope2 = scope) == null ? void 0 : _scope2.stop();
19
+ });
16
20
  }
17
21
  //# sourceMappingURL=toggleScope.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggleScope.mjs","names":["effectScope","watch","useToggleScope","source","cb","scope","active","run","stop","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, cb: () => void) {\n let scope: EffectScope | undefined\n watch(source, active => {\n if (active && !scope) {\n scope = effectScope()\n scope.run(cb)\n } else {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,KAAK,QAAQ,KAAK;AAGxC,OAAO,SAASC,cAAc,CAAEC,MAA4B,EAAEC,EAAc,EAAE;EAC5E,IAAIC,KAA8B;EAClCJ,KAAK,CAACE,MAAM,EAAEG,MAAM,IAAI;IACtB,IAAIA,MAAM,IAAI,CAACD,KAAK,EAAE;MACpBA,KAAK,GAAGL,WAAW,EAAE;MACrBK,KAAK,CAACE,GAAG,CAACH,EAAE,CAAC;IACf,CAAC,MAAM;MAAA;MACL,UAAAC,KAAK,qBAAL,OAAOG,IAAI,EAAE;MACbH,KAAK,GAAGI,SAAS;IACnB;EACF,CAAC,EAAE;IAAEC,SAAS,EAAE;EAAK,CAAC,CAAC;AACzB"}
1
+ {"version":3,"file":"toggleScope.mjs","names":["effectScope","onScopeDispose","watch","useToggleScope","source","cb","scope","active","run","stop","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, onScopeDispose, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, cb: () => void) {\n let scope: EffectScope | undefined\n watch(source, active => {\n if (active && !scope) {\n scope = effectScope()\n scope.run(cb)\n } else if (!active) {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n\n onScopeDispose(() => {\n scope?.stop()\n })\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,cAAc,EAAEC,KAAK,QAAQ,KAAK;AAGxD,OAAO,SAASC,cAAc,CAAEC,MAA4B,EAAEC,EAAc,EAAE;EAC5E,IAAIC,KAA8B;EAClCJ,KAAK,CAACE,MAAM,EAAEG,MAAM,IAAI;IACtB,IAAIA,MAAM,IAAI,CAACD,KAAK,EAAE;MACpBA,KAAK,GAAGN,WAAW,EAAE;MACrBM,KAAK,CAACE,GAAG,CAACH,EAAE,CAAC;IACf,CAAC,MAAM,IAAI,CAACE,MAAM,EAAE;MAAA;MAClB,UAAAD,KAAK,qBAAL,OAAOG,IAAI,EAAE;MACbH,KAAK,GAAGI,SAAS;IACnB;EACF,CAAC,EAAE;IAAEC,SAAS,EAAE;EAAK,CAAC,CAAC;EAEvBV,cAAc,CAAC,MAAM;IAAA;IACnB,WAAAK,KAAK,qBAAL,QAAOG,IAAI,EAAE;EACf,CAAC,CAAC;AACJ"}
@@ -10,7 +10,7 @@ export const createVuetify = function () {
10
10
  ...options
11
11
  });
12
12
  };
13
- export const version = "3.0.2-next-20221122.0";
13
+ export const version = "3.0.2";
14
14
  createVuetify.version = version;
15
15
  export { components, directives };
16
16
  export * from "./composables/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["import './styles/main.sass'\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\nimport type { VuetifyOptions } from './framework'\n\nexport const createVuetify = (options: VuetifyOptions = {}) => {\n return _createVuetify({ components, directives, ...options })\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\nexport {\n components,\n directives,\n}\nexport * from './composables'\n"],"mappings":"AAAA;AAA2B,OACpB,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc;AAGxC,OAAO,MAAMD,aAAa,GAAG,YAAkC;EAAA,IAAjCE,OAAuB,uEAAG,CAAC,CAAC;EACxD,OAAOD,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMC,OAAO,0BAAsB;AAC1CH,aAAa,CAACG,OAAO,GAAGA,OAAO;AAE/B,SACEL,UAAU,EACVC,UAAU;AACX"}
1
+ {"version":3,"file":"entry-bundler.mjs","names":["components","directives","createVuetify","_createVuetify","options","version"],"sources":["../src/entry-bundler.ts"],"sourcesContent":["import './styles/main.sass'\nimport * as components from './components'\nimport * as directives from './directives'\nimport { createVuetify as _createVuetify } from './framework'\nimport type { VuetifyOptions } from './framework'\n\nexport const createVuetify = (options: VuetifyOptions = {}) => {\n return _createVuetify({ components, directives, ...options })\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\nexport {\n components,\n directives,\n}\nexport * from './composables'\n"],"mappings":"AAAA;AAA2B,OACpB,KAAKA,UAAU;AAAA,OACf,KAAKC,UAAU;AAAA,SACbC,aAAa,IAAIC,cAAc;AAGxC,OAAO,MAAMD,aAAa,GAAG,YAAkC;EAAA,IAAjCE,OAAuB,uEAAG,CAAC,CAAC;EACxD,OAAOD,cAAc,CAAC;IAAEH,UAAU;IAAEC,UAAU;IAAE,GAAGG;EAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,MAAMC,OAAO,UAAsB;AAC1CH,aAAa,CAACG,OAAO,GAAGA,OAAO;AAE/B,SACEL,UAAU,EACVC,UAAU;AACX"}
package/lib/framework.mjs CHANGED
@@ -87,7 +87,7 @@ export function createVuetify() {
87
87
  locale
88
88
  };
89
89
  }
90
- export const version = "3.0.2-next-20221122.0";
90
+ export const version = "3.0.2";
91
91
  createVuetify.version = version;
92
92
 
93
93
  // Vue's inject() can only be used in setup
@@ -1 +1 @@
1
- {"version":3,"file":"framework.mjs","names":["createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","defineComponent","getUid","IN_BROWSER","mergeDeep","nextTick","reactive","createVuetify","vuetify","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","install","app","key","directive","component","name","aliasName","provide","$nuxt","hook","update","mount","vm","reset","mixin","computed","$vuetify","inject","call","version","$","provides","parent","vnode","appContext"],"sources":["../src/framework.ts"],"sourcesContent":["// Composables\nimport { createDefaults, DefaultsSymbol } from '@/composables/defaults'\nimport { createDisplay, DisplaySymbol } from '@/composables/display'\nimport { createIcons, IconSymbol } from '@/composables/icons'\nimport { createLocale, LocaleSymbol } from '@/composables/locale'\nimport { createTheme, ThemeSymbol } from '@/composables/theme'\n\n// Utilities\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\nimport { nextTick, reactive } from 'vue'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\n\nexport * from './composables'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: boolean\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options = mergeDeep(blueprint, rest)\n const {\n aliases = {},\n components = {},\n directives = {},\n } = options\n\n const defaults = createDefaults(options.defaults)\n const display = createDisplay(options.display, options.ssr)\n const theme = createTheme(options.theme)\n const icons = createIcons(options.icons)\n const locale = createLocale(options.locale)\n\n const install = (app: App) => {\n for (const key in directives) {\n app.directive(key, directives[key])\n }\n\n for (const key in components) {\n app.component(key, components[key])\n }\n\n for (const key in aliases) {\n app.component(key, defineComponent({\n ...aliases[key],\n name: key,\n aliasName: aliases[key].name,\n }))\n }\n\n theme.install(app)\n\n app.provide(DefaultsSymbol, defaults)\n app.provide(DisplaySymbol, display)\n app.provide(ThemeSymbol, theme)\n app.provide(IconSymbol, icons)\n app.provide(LocaleSymbol, locale)\n\n if (IN_BROWSER && options.ssr) {\n if (app.$nuxt) {\n app.$nuxt.hook('app:suspense:resolve', () => {\n display.update()\n })\n } else {\n const { mount } = app\n app.mount = (...args) => {\n const vm = mount(...args)\n nextTick(() => display.update())\n app.mount = mount\n return vm\n }\n }\n }\n\n getUid.reset()\n\n app.mixin({\n computed: {\n $vuetify () {\n return reactive({\n defaults: inject.call(this, DefaultsSymbol),\n display: inject.call(this, DisplaySymbol),\n theme: inject.call(this, ThemeSymbol),\n icons: inject.call(this, IconSymbol),\n locale: inject.call(this, LocaleSymbol),\n })\n },\n },\n })\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n }\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\n// Vue's inject() can only be used in setup\nfunction inject (this: ComponentPublicInstance, key: InjectionKey<any> | string) {\n const vm = this.$\n\n const provides = vm.parent?.provides ?? vm.vnode.appContext?.provides\n\n if (provides && (key as any) in provides) {\n return provides[(key as string)]\n }\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,cAAc;AAAA,SAC9BC,aAAa,EAAEC,aAAa;AAAA,SAC5BC,WAAW,EAAEC,UAAU;AAAA,SACvBC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,WAAW,EAAEC,WAAW,mCAEjC;AAAA,SACSC,eAAe,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS;AACvD,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;;AAExC;AAAA;AAyBA,OAAO,SAASC,aAAa,GAAgC;EAAA,IAA9BC,OAAuB,uEAAG,CAAC,CAAC;EACzD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGF,OAAO;EACtC,MAAMG,OAAO,GAAGP,SAAS,CAACK,SAAS,EAAEC,IAAI,CAAC;EAC1C,MAAM;IACJE,OAAO,GAAG,CAAC,CAAC;IACZC,UAAU,GAAG,CAAC,CAAC;IACfC,UAAU,GAAG,CAAC;EAChB,CAAC,GAAGH,OAAO;EAEX,MAAMI,QAAQ,GAAGxB,cAAc,CAACoB,OAAO,CAACI,QAAQ,CAAC;EACjD,MAAMC,OAAO,GAAGvB,aAAa,CAACkB,OAAO,CAACK,OAAO,EAAEL,OAAO,CAACM,GAAG,CAAC;EAC3D,MAAMC,KAAK,GAAGnB,WAAW,CAACY,OAAO,CAACO,KAAK,CAAC;EACxC,MAAMC,KAAK,GAAGxB,WAAW,CAACgB,OAAO,CAACQ,KAAK,CAAC;EACxC,MAAMC,MAAM,GAAGvB,YAAY,CAACc,OAAO,CAACS,MAAM,CAAC;EAE3C,MAAMC,OAAO,GAAIC,GAAQ,IAAK;IAC5B,KAAK,MAAMC,GAAG,IAAIT,UAAU,EAAE;MAC5BQ,GAAG,CAACE,SAAS,CAACD,GAAG,EAAET,UAAU,CAACS,GAAG,CAAC,CAAC;IACrC;IAEA,KAA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IAEdZ,GAAG,CAACa,KAAK,CAAC;MACRC,QAAQ,EAAE;QACRC,QAAQ,GAAI;UACV,OAAO/B,QAAQ,CAAC;YACdS,QAAQ,EAAEuB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE/C,cAAc,CAAC;YAC3CwB,OAAO,EAAEsB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE7C,aAAa,CAAC;YACzCwB,KAAK,EAAEoB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEvC,WAAW,CAAC;YACrCmB,KAAK,EAAEmB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAE3C,UAAU,CAAC;YACpCwB,MAAM,EAAEkB,MAAM,CAACC,IAAI,CAAC,IAAI,EAAEzC,YAAY;UACxC,CAAC,CAAC;QACJ;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAED,OAAO;IACLuB,OAAO;IACPN,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC;EACF,CAAC;AACH;AAEA,OAAO,MAAMoB,OAAO,0BAAsB;AAC1CjC,aAAa,CAACiC,OAAO,GAAGA,OAAO;;AAE/B;AACA,SAASF,MAAM,CAAiCf,GAA+B,EAAE;EAAA;EAC/E,MAAMU,EAAE,GAAG,IAAI,CAACQ,CAAC;EAEjB,MAAMC,QAAQ,GAAG,eAAAT,EAAE,CAACU,MAAM,qBAAT,WAAWD,QAAQ,8BAAIT,EAAE,CAACW,KAAK,CAACC,UAAU,qBAAnB,qBAAqBH,QAAQ;EAErE,IAAIA,QAAQ,IAAKnB,GAAG,IAAYmB,QAAQ,EAAE;IACxC,OAAOA,QAAQ,CAAEnB,GAAG,CAAY;EAClC;AACF"}
1
+ {"version":3,"file":"framework.mjs","names":["createDefaults","DefaultsSymbol","createDisplay","DisplaySymbol","createIcons","IconSymbol","createLocale","LocaleSymbol","createTheme","ThemeSymbol","defineComponent","getUid","IN_BROWSER","mergeDeep","nextTick","reactive","createVuetify","vuetify","blueprint","rest","options","aliases","components","directives","defaults","display","ssr","theme","icons","locale","install","app","key","directive","component","name","aliasName","provide","$nuxt","hook","update","mount","vm","reset","mixin","computed","$vuetify","inject","call","version","$","provides","parent","vnode","appContext"],"sources":["../src/framework.ts"],"sourcesContent":["// Composables\nimport { createDefaults, DefaultsSymbol } from '@/composables/defaults'\nimport { createDisplay, DisplaySymbol } from '@/composables/display'\nimport { createIcons, IconSymbol } from '@/composables/icons'\nimport { createLocale, LocaleSymbol } from '@/composables/locale'\nimport { createTheme, ThemeSymbol } from '@/composables/theme'\n\n// Utilities\nimport { defineComponent, getUid, IN_BROWSER, mergeDeep } from '@/util'\nimport { nextTick, reactive } from 'vue'\n\n// Types\nimport type { App, ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { DefaultsOptions } from '@/composables/defaults'\nimport type { DisplayOptions } from '@/composables/display'\nimport type { IconOptions } from '@/composables/icons'\nimport type { LocaleOptions, RtlOptions } from '@/composables/locale'\nimport type { ThemeOptions } from '@/composables/theme'\n\nexport * from './composables'\n\nexport interface VuetifyOptions {\n aliases?: Record<string, any>\n blueprint?: Blueprint\n components?: Record<string, any>\n directives?: Record<string, any>\n defaults?: DefaultsOptions\n display?: DisplayOptions\n theme?: ThemeOptions\n icons?: IconOptions\n locale?: LocaleOptions & RtlOptions\n ssr?: boolean\n}\n\nexport interface Blueprint extends Omit<VuetifyOptions, 'blueprint'> {}\n\nexport function createVuetify (vuetify: VuetifyOptions = {}) {\n const { blueprint, ...rest } = vuetify\n const options = mergeDeep(blueprint, rest)\n const {\n aliases = {},\n components = {},\n directives = {},\n } = options\n\n const defaults = createDefaults(options.defaults)\n const display = createDisplay(options.display, options.ssr)\n const theme = createTheme(options.theme)\n const icons = createIcons(options.icons)\n const locale = createLocale(options.locale)\n\n const install = (app: App) => {\n for (const key in directives) {\n app.directive(key, directives[key])\n }\n\n for (const key in components) {\n app.component(key, components[key])\n }\n\n for (const key in aliases) {\n app.component(key, defineComponent({\n ...aliases[key],\n name: key,\n aliasName: aliases[key].name,\n }))\n }\n\n theme.install(app)\n\n app.provide(DefaultsSymbol, defaults)\n app.provide(DisplaySymbol, display)\n app.provide(ThemeSymbol, theme)\n app.provide(IconSymbol, icons)\n app.provide(LocaleSymbol, locale)\n\n if (IN_BROWSER && options.ssr) {\n if (app.$nuxt) {\n app.$nuxt.hook('app:suspense:resolve', () => {\n display.update()\n })\n } else {\n const { mount } = app\n app.mount = (...args) => {\n const vm = mount(...args)\n nextTick(() => display.update())\n app.mount = mount\n return vm\n }\n }\n }\n\n getUid.reset()\n\n app.mixin({\n computed: {\n $vuetify () {\n return reactive({\n defaults: inject.call(this, DefaultsSymbol),\n display: inject.call(this, DisplaySymbol),\n theme: inject.call(this, ThemeSymbol),\n icons: inject.call(this, IconSymbol),\n locale: inject.call(this, LocaleSymbol),\n })\n },\n },\n })\n }\n\n return {\n install,\n defaults,\n display,\n theme,\n icons,\n locale,\n }\n}\n\nexport const version = __VUETIFY_VERSION__\ncreateVuetify.version = version\n\n// Vue's inject() can only be used in setup\nfunction inject (this: ComponentPublicInstance, key: InjectionKey<any> | string) {\n const vm = this.$\n\n const provides = vm.parent?.provides ?? vm.vnode.appContext?.provides\n\n if (provides && (key as any) in provides) {\n return provides[(key as string)]\n }\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,cAAc;AAAA,SAC9BC,aAAa,EAAEC,aAAa;AAAA,SAC5BC,WAAW,EAAEC,UAAU;AAAA,SACvBC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,WAAW,EAAEC,WAAW,mCAEjC;AAAA,SACSC,eAAe,EAAEC,MAAM,EAAEC,UAAU,EAAEC,SAAS;AACvD,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;;AAExC;AAAA;AAyBA,OAAO,SAASC,aAAa,GAAgC;EAAA,IAA9BC,OAAuB,uEAAG,CAAC,CAAC;EACzD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGF,OAAO;EACtC,MAAMG,OAAO,GAAGP,SAA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,QAAQ;IACRC,OAAO;IACPE,KAAK;IACLC,KAAK;IACLC;EACF,CAAC;AACH;AAEA,OAAO,MAAMoB,OAAO,UAAsB;AAC1CjC,aAAa,CAACiC,OAAO,GAAGA,OAAO;;AAE/B;AACA,SAASF,MAAM,CAAiCf,GAA+B,EAAE;EAAA;EAC/E,MAAMU,EAAE,GAAG,IAAI,CAACQ,CAAC;EAEjB,MAAMC,QAAQ,GAAG,eAAAT,EAAE,CAACU,MAAM,qBAAT,WAAWD,QAAQ,8BAAIT,EAAE,CAACW,KAAK,CAACC,UAAU,qBAAnB,qBAAqBH,QAAQ;EAErE,IAAIA,QAAQ,IAAKnB,GAAG,IAAYmB,QAAQ,EAAE;IACxC,OAAOA,QAAQ,CAAEnB,GAAG,CAAY;EAClC;AACF"}
package/lib/index.d.ts CHANGED
@@ -315,23 +315,25 @@ declare module '@vue/runtime-core' {
315
315
  export interface GlobalComponents {
316
316
  VApp: typeof import('vuetify/components')['VApp']
317
317
  VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
318
- VForm: typeof import('vuetify/components')['VForm']
319
318
  VContainer: typeof import('vuetify/components')['VContainer']
320
319
  VCol: typeof import('vuetify/components')['VCol']
321
320
  VRow: typeof import('vuetify/components')['VRow']
322
321
  VSpacer: typeof import('vuetify/components')['VSpacer']
323
322
  VHover: typeof import('vuetify/components')['VHover']
323
+ VForm: typeof import('vuetify/components')['VForm']
324
324
  VLayout: typeof import('vuetify/components')['VLayout']
325
325
  VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
326
326
  VLazy: typeof import('vuetify/components')['VLazy']
327
327
  VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
328
- VNoSsr: typeof import('vuetify/components')['VNoSsr']
329
328
  VParallax: typeof import('vuetify/components')['VParallax']
329
+ VNoSsr: typeof import('vuetify/components')['VNoSsr']
330
330
  VRadio: typeof import('vuetify/components')['VRadio']
331
331
  VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
332
332
  VResponsive: typeof import('vuetify/components')['VResponsive']
333
333
  VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
334
- VValidation: typeof import('vuetify/components')['VValidation']
334
+ VAppBar: typeof import('vuetify/components')['VAppBar']
335
+ VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
336
+ VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
335
337
  VFabTransition: typeof import('vuetify/components')['VFabTransition']
336
338
  VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
337
339
  VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
@@ -348,21 +350,16 @@ declare module '@vue/runtime-core' {
348
350
  VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
349
351
  VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
350
352
  VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
351
- VAppBar: typeof import('vuetify/components')['VAppBar']
352
- VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
353
- VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
354
353
  VAlert: typeof import('vuetify/components')['VAlert']
355
354
  VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
356
- VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
357
355
  VAvatar: typeof import('vuetify/components')['VAvatar']
358
356
  VBadge: typeof import('vuetify/components')['VBadge']
357
+ VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
359
358
  VBanner: typeof import('vuetify/components')['VBanner']
360
359
  VBannerActions: typeof import('vuetify/components')['VBannerActions']
361
360
  VBannerText: typeof import('vuetify/components')['VBannerText']
362
- VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
363
- VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
364
- VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
365
361
  VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
362
+ VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
366
363
  VBtn: typeof import('vuetify/components')['VBtn']
367
364
  VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
368
365
  VCard: typeof import('vuetify/components')['VCard']
@@ -371,12 +368,14 @@ declare module '@vue/runtime-core' {
371
368
  VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
372
369
  VCardText: typeof import('vuetify/components')['VCardText']
373
370
  VCardTitle: typeof import('vuetify/components')['VCardTitle']
374
- VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
375
371
  VCheckbox: typeof import('vuetify/components')['VCheckbox']
376
372
  VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
373
+ VCarousel: typeof import('vuetify/components')['VCarousel']
374
+ VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
377
375
  VChip: typeof import('vuetify/components')['VChip']
378
- VChipGroup: typeof import('vuetify/components')['VChipGroup']
379
376
  VCode: typeof import('vuetify/components')['VCode']
377
+ VChipGroup: typeof import('vuetify/components')['VChipGroup']
378
+ VValidation: typeof import('vuetify/components')['VValidation']
380
379
  VColorPicker: typeof import('vuetify/components')['VColorPicker']
381
380
  VCombobox: typeof import('vuetify/components')['VCombobox']
382
381
  VCounter: typeof import('vuetify/components')['VCounter']
@@ -385,7 +384,6 @@ declare module '@vue/runtime-core' {
385
384
  VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
386
385
  VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
387
386
  VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
388
- VDivider: typeof import('vuetify/components')['VDivider']
389
387
  VField: typeof import('vuetify/components')['VField']
390
388
  VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
391
389
  VFileInput: typeof import('vuetify/components')['VFileInput']
@@ -396,11 +394,12 @@ declare module '@vue/runtime-core' {
396
394
  VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
397
395
  VClassIcon: typeof import('vuetify/components')['VClassIcon']
398
396
  VImg: typeof import('vuetify/components')['VImg']
399
- VInput: typeof import('vuetify/components')['VInput']
400
397
  VItemGroup: typeof import('vuetify/components')['VItemGroup']
401
398
  VItem: typeof import('vuetify/components')['VItem']
399
+ VInput: typeof import('vuetify/components')['VInput']
402
400
  VKbd: typeof import('vuetify/components')['VKbd']
403
401
  VLabel: typeof import('vuetify/components')['VLabel']
402
+ VDivider: typeof import('vuetify/components')['VDivider']
404
403
  VList: typeof import('vuetify/components')['VList']
405
404
  VListGroup: typeof import('vuetify/components')['VListGroup']
406
405
  VListImg: typeof import('vuetify/components')['VListImg']
@@ -412,38 +411,39 @@ declare module '@vue/runtime-core' {
412
411
  VListSubheader: typeof import('vuetify/components')['VListSubheader']
413
412
  VMain: typeof import('vuetify/components')['VMain']
414
413
  VMenu: typeof import('vuetify/components')['VMenu']
415
- VMessages: typeof import('vuetify/components')['VMessages']
416
414
  VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
415
+ VMessages: typeof import('vuetify/components')['VMessages']
417
416
  VOverlay: typeof import('vuetify/components')['VOverlay']
418
417
  VPagination: typeof import('vuetify/components')['VPagination']
419
418
  VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
420
419
  VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
421
420
  VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
422
421
  VRating: typeof import('vuetify/components')['VRating']
423
- VSelect: typeof import('vuetify/components')['VSelect']
424
422
  VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
425
423
  VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
424
+ VSelect: typeof import('vuetify/components')['VSelect']
426
425
  VSheet: typeof import('vuetify/components')['VSheet']
427
- VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
428
- VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
429
426
  VSlider: typeof import('vuetify/components')['VSlider']
430
427
  VSnackbar: typeof import('vuetify/components')['VSnackbar']
431
428
  VSwitch: typeof import('vuetify/components')['VSwitch']
432
- VSystemBar: typeof import('vuetify/components')['VSystemBar']
433
429
  VTabs: typeof import('vuetify/components')['VTabs']
434
430
  VTab: typeof import('vuetify/components')['VTab']
431
+ VSystemBar: typeof import('vuetify/components')['VSystemBar']
435
432
  VTable: typeof import('vuetify/components')['VTable']
433
+ VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
434
+ VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
436
435
  VTextarea: typeof import('vuetify/components')['VTextarea']
437
436
  VTextField: typeof import('vuetify/components')['VTextField']
438
- VTimeline: typeof import('vuetify/components')['VTimeline']
439
- VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
440
437
  VToolbar: typeof import('vuetify/components')['VToolbar']
441
438
  VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
442
439
  VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
440
+ VTimeline: typeof import('vuetify/components')['VTimeline']
441
+ VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
443
442
  VTooltip: typeof import('vuetify/components')['VTooltip']
444
443
  VWindow: typeof import('vuetify/components')['VWindow']
445
444
  VWindowItem: typeof import('vuetify/components')['VWindowItem']
446
- VCarousel: typeof import('vuetify/components')['VCarousel']
447
- VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
445
+ VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
446
+ VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
447
+ VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
448
448
  }
449
449
  }
@@ -1,9 +1,12 @@
1
1
  // Utils
2
- import { defineComponent as _defineComponent, effectScope, getCurrentInstance, shallowReactive, shallowRef, toRaw, watch, watchEffect } from 'vue';
2
+ import { defineComponent as _defineComponent,
3
+ // eslint-disable-line no-restricted-imports
4
+ getCurrentInstance, shallowReactive, shallowRef, toRaw, watchEffect } from 'vue';
3
5
  import { consoleWarn } from "./console.mjs";
4
6
  import { mergeDeep, toKebabCase } from "./helpers.mjs";
5
7
  import { injectSelf } from "./injectSelf.mjs";
6
- import { DefaultsSymbol, provideDefaults, useDefaults } from "../composables/defaults.mjs"; // Types
8
+ import { DefaultsSymbol, provideDefaults, useDefaults } from "../composables/defaults.mjs";
9
+ import { useToggleScope } from "../composables/toggleScope.mjs"; // Types
7
10
  import { propsFactory } from "./propsFactory.mjs";
8
11
  function propIsDefined(vnode, prop) {
9
12
  var _vnode$props, _vnode$props2;
@@ -47,17 +50,9 @@ export const defineComponent = function defineComponent(options) {
47
50
  }
48
51
  });
49
52
  const setupBindings = options._setup(_props, ctx);
50
- let scope;
51
- watch(_subcomponentDefaults, (val, oldVal) => {
52
- if (!val && scope) scope.stop();else if (val && !oldVal) {
53
- scope = effectScope();
54
- scope.run(() => {
55
- var _injectSelf;
56
- provideDefaults(mergeDeep(((_injectSelf = injectSelf(DefaultsSymbol)) == null ? void 0 : _injectSelf.value) ?? {}, val));
57
- });
58
- }
59
- }, {
60
- immediate: true
53
+ useToggleScope(_subcomponentDefaults, () => {
54
+ var _injectSelf;
55
+ provideDefaults(mergeDeep(((_injectSelf = injectSelf(DefaultsSymbol)) == null ? void 0 : _injectSelf.value) ?? {}, _subcomponentDefaults.value));
61
56
  });
62
57
  return setupBindings;
63
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"defineComponent.mjs","names":["defineComponent","_defineComponent","effectScope","getCurrentInstance","shallowReactive","shallowRef","toRaw","watch","watchEffect","consoleWarn","mergeDeep","toKebabCase","injectSelf","DefaultsSymbol","provideDefaults","useDefaults","propsFactory","propIsDefined","vnode","prop","props","hasOwnProperty","options","_setup","setup","name","_as","String","ctx","vm","defaults","_subcomponentDefaults","_props","globalDefaults","value","global","componentDefaults","subComponents","Object","entries","filter","key","startsWith","toUpperCase","length","fromEntries","keys","newVal","setupBindings","scope","val","oldVal","stop","run","immediate","genericComponent","exposeDefaults"],"sources":["../../src/util/defineComponent.tsx"],"sourcesContent":["// Utils\nimport {\n defineComponent as _defineComponent,\n effectScope,\n getCurrentInstance,\n shallowReactive,\n shallowRef,\n toRaw,\n watch,\n watchEffect,\n} from 'vue'\nimport { consoleWarn } from '@/util/console'\nimport { mergeDeep, toKebabCase } from '@/util/helpers'\nimport { injectSelf } from '@/util/injectSelf'\nimport { DefaultsSymbol, provideDefaults, useDefaults } from '@/composables/defaults'\n\n// Types\nimport type {\n ComponentOptions,\n ComponentOptionsMixin,\n ComponentOptionsWithObjectProps,\n ComponentPropsOptions,\n ComputedOptions,\n DefineComponent,\n EffectScope,\n EmitsOptions,\n MethodOptions,\n VNode,\n VNodeChild,\n} from 'vue'\nimport { propsFactory } from '@/util/propsFactory'\n\nfunction propIsDefined (vnode: VNode, prop: string) {\n return vnode.props?.hasOwnProperty(prop) ||\n vnode.props?.hasOwnProperty(toKebabCase(prop))\n}\n\nexport const defineComponent = (function defineComponent (options: ComponentOptions) {\n options._setup = options._setup ?? options.setup\n\n if (!options.name) {\n consoleWarn('The component is missing an explicit name, unable to generate default prop value')\n\n return options\n }\n\n if (options._setup) {\n options.props = options.props ?? {}\n\n options.props = propsFactory(options.props, toKebabCase(options.name))()\n\n options.props._as = String\n options.setup = function setup (props: Record<string, any>, ctx) {\n const vm = getCurrentInstance()!\n const defaults = useDefaults()\n\n const _subcomponentDefaults = shallowRef()\n const _props = shallowReactive({ ...toRaw(props) })\n watchEffect(() => {\n const globalDefaults = defaults.value.global\n const componentDefaults = defaults.value[props._as ?? options.name!]\n\n if (componentDefaults) {\n const subComponents = Object.entries(componentDefaults).filter(([key]) => key.startsWith(key[0].toUpperCase()))\n if (subComponents.length) _subcomponentDefaults.value = Object.fromEntries(subComponents)\n }\n\n for (const prop of Object.keys(props)) {\n let newVal = props[prop]\n if (!propIsDefined(vm.vnode, prop)) {\n newVal = componentDefaults?.[prop] ?? globalDefaults?.[prop] ?? props[prop]\n }\n if (_props[prop] !== newVal) {\n _props[prop] = newVal\n }\n }\n })\n\n const setupBindings = options._setup(_props, ctx)\n\n let scope: EffectScope\n watch(_subcomponentDefaults, (val, oldVal) => {\n if (!val && scope) scope.stop()\n else if (val && !oldVal) {\n scope = effectScope()\n scope.run(() => {\n provideDefaults(mergeDeep(injectSelf(DefaultsSymbol)?.value ?? {}, val))\n })\n }\n }, { immediate: true })\n\n return setupBindings\n }\n }\n\n return options\n}) as unknown as typeof _defineComponent\n\ntype ToListeners<T extends string | number | symbol> = { [K in T]: K extends `on${infer U}` ? Uncapitalize<U> : K }[T]\n\nexport type SlotsToProps<T extends Record<string, any>> = T extends Record<string, Slot> ? ({\n $children?: (\n | VNodeChild\n | (keyof T extends 'default' ? T['default'] : {})\n | { [K in keyof T]?: T[K] }\n )\n 'v-slots'?: { [K in keyof T]?: T[K] | false }\n} & {\n [K in keyof T as `v-slot:${K & string}`]?: T[K] | false\n}) : T extends Record<string, any[]> ? SlotsToProps<MakeSlots<T>> : never\n\ntype Slot<T extends any[] = any[]> = (...args: T) => VNodeChild\nexport type MakeSlots<T extends Record<string, any[]>> = {\n [K in keyof T]?: Slot<T[K]>\n}\n\nexport function genericComponent<T extends (new () => {\n $props?: Record<string, any>\n})> (exposeDefaults = true): <\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I = InstanceType<T>,\n Base = DefineComponent<\n I extends Record<'$props', any>\n ? Omit<PropsOptions, keyof I['$props']>\n : PropsOptions,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E extends any[] ? E : I extends Record<'$props', any> ? Omit<E, ToListeners<keyof I['$props']>> : E,\n EE\n >\n>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>) => Base & T {\n return options => (exposeDefaults ? defineComponent : _defineComponent)(options) as any\n}\n"],"mappings":"AAAA;AACA,SACEA,eAAe,IAAIC,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EAAE,CAACmB,GAAG,EAAEC,MAAM,KAAK;QAC5C,IAAI,CAACD,GAAG,IAAID,KAAK,EAAEA,KAAK,CAACG,IAAI,EAAE,MAC1B,IAAIF,GAAG,IAAI,CAACC,MAAM,EAAE;UACvBF,KAAK,GAAG/C,WAAW,EAAE;UACrB+C,KAAK,CAACI,GAAG,CAAC,MAAM;YAAA;YACdvC,eAAe,CAACJ,SAAS,CAAC,gBAAAE,UAAU,CAACC,cAAc,CAAC,qBAA1B,YAA4BqB,KAAK,KAAI,CAAC,CAAC,EAAEgB,GAAG,CAAC,CAAC;UAC1E,CAAC,CAAC;QACJ;MACF,CAAC,EAAE;QAAEI,SAAS,EAAE;MAAK,CAAC,CAAC;MAEvB,OAAON,aAAa;IACtB,CAAC;EACH;EAEA,OAAO1B,OAAO;AAChB,CAAwC;AAoBxC,OAAO,SAASiC,gBAAgB,GA0BmF;EAAA,IAxB9GC,cAAc,uEAAG,IAAI;EAyBxB,OAAOlC,OAAO,IAAI,CAACkC,cAAc,GAAGxD,eAAe,GAAGC,gBAAgB,EAAEqB,OAAO,CAAQ;AACzF"}
1
+ {"version":3,"file":"defineComponent.mjs","names":["defineComponent","_defineComponent","getCurrentInstance","shallowReactive","shallowRef","toRaw","watchEffect","consoleWarn","mergeDeep","toKebabCase","injectSelf","DefaultsSymbol","provideDefaults","useDefaults","useToggleScope","propsFactory","propIsDefined","vnode","prop","props","hasOwnProperty","options","_setup","setup","name","_as","String","ctx","vm","defaults","_subcomponentDefaults","_props","globalDefaults","value","global","componentDefaults","subComponents","Object","entries","filter","key","startsWith","toUpperCase","length","fromEntries","keys","newVal","setupBindings","genericComponent","exposeDefaults"],"sources":["../../src/util/defineComponent.tsx"],"sourcesContent":["// Utils\nimport {\n defineComponent as _defineComponent, // eslint-disable-line no-restricted-imports\n getCurrentInstance,\n shallowReactive,\n shallowRef,\n toRaw,\n watchEffect,\n} from 'vue'\nimport { consoleWarn } from '@/util/console'\nimport { mergeDeep, toKebabCase } from '@/util/helpers'\nimport { injectSelf } from '@/util/injectSelf'\nimport { DefaultsSymbol, provideDefaults, useDefaults } from '@/composables/defaults'\nimport { useToggleScope } from '@/composables/toggleScope'\n\n// Types\nimport type {\n ComponentOptions,\n ComponentOptionsMixin,\n ComponentOptionsWithObjectProps,\n ComponentPropsOptions,\n ComputedOptions,\n DefineComponent,\n EmitsOptions,\n MethodOptions,\n VNode,\n VNodeChild,\n} from 'vue'\nimport { propsFactory } from '@/util/propsFactory'\n\nfunction propIsDefined (vnode: VNode, prop: string) {\n return vnode.props?.hasOwnProperty(prop) ||\n vnode.props?.hasOwnProperty(toKebabCase(prop))\n}\n\nexport const defineComponent = (function defineComponent (options: ComponentOptions) {\n options._setup = options._setup ?? options.setup\n\n if (!options.name) {\n consoleWarn('The component is missing an explicit name, unable to generate default prop value')\n\n return options\n }\n\n if (options._setup) {\n options.props = options.props ?? {}\n\n options.props = propsFactory(options.props, toKebabCase(options.name))()\n\n options.props._as = String\n options.setup = function setup (props: Record<string, any>, ctx) {\n const vm = getCurrentInstance()!\n const defaults = useDefaults()\n\n const _subcomponentDefaults = shallowRef()\n const _props = shallowReactive({ ...toRaw(props) })\n watchEffect(() => {\n const globalDefaults = defaults.value.global\n const componentDefaults = defaults.value[props._as ?? options.name!]\n\n if (componentDefaults) {\n const subComponents = Object.entries(componentDefaults).filter(([key]) => key.startsWith(key[0].toUpperCase()))\n if (subComponents.length) _subcomponentDefaults.value = Object.fromEntries(subComponents)\n }\n\n for (const prop of Object.keys(props)) {\n let newVal = props[prop]\n if (!propIsDefined(vm.vnode, prop)) {\n newVal = componentDefaults?.[prop] ?? globalDefaults?.[prop] ?? props[prop]\n }\n if (_props[prop] !== newVal) {\n _props[prop] = newVal\n }\n }\n })\n\n const setupBindings = options._setup(_props, ctx)\n\n useToggleScope(_subcomponentDefaults, () => {\n provideDefaults(mergeDeep(injectSelf(DefaultsSymbol)?.value ?? {}, _subcomponentDefaults.value))\n })\n\n return setupBindings\n }\n }\n\n return options\n}) as unknown as typeof _defineComponent\n\ntype ToListeners<T extends string | number | symbol> = { [K in T]: K extends `on${infer U}` ? Uncapitalize<U> : K }[T]\n\nexport type SlotsToProps<T extends Record<string, any>> = T extends Record<string, Slot> ? ({\n $children?: (\n | VNodeChild\n | (keyof T extends 'default' ? T['default'] : {})\n | { [K in keyof T]?: T[K] }\n )\n 'v-slots'?: { [K in keyof T]?: T[K] | false }\n} & {\n [K in keyof T as `v-slot:${K & string}`]?: T[K] | false\n}) : T extends Record<string, any[]> ? SlotsToProps<MakeSlots<T>> : never\n\ntype Slot<T extends any[] = any[]> = (...args: T) => VNodeChild\nexport type MakeSlots<T extends Record<string, any[]>> = {\n [K in keyof T]?: Slot<T[K]>\n}\n\nexport function genericComponent<T extends (new () => {\n $props?: Record<string, any>\n})> (exposeDefaults = true): <\n PropsOptions extends Readonly<ComponentPropsOptions>,\n RawBindings,\n D,\n C extends ComputedOptions = {},\n M extends MethodOptions = {},\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\n E extends EmitsOptions = Record<string, any>,\n EE extends string = string,\n I = InstanceType<T>,\n Base = DefineComponent<\n I extends Record<'$props', any>\n ? Omit<PropsOptions, keyof I['$props']>\n : PropsOptions,\n RawBindings,\n D,\n C,\n M,\n Mixin,\n Extends,\n E extends any[] ? E : I extends Record<'$props', any> ? Omit<E, ToListeners<keyof I['$props']>> : E,\n EE\n >\n>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>) => Base & T {\n return options => (exposeDefaults ? defineComponent : _defineComponent)(options) as any\n}\n"],"mappings":"AAAA;AACA,SACEA,eAAe,IAAIC,gBAAgB;AAAE;AACrCC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVC,KAAK,EACLC,WAAW,QACN,KAAK;AAAA,SACHC,WAAW;AAAA,SACXC,SAAS,EAAEC,WAAW;AAAA,SACtBC,UAAU;AAAA,SACVC,cAAc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Oc,aAAa;IACtB,CAAC;EACH;EAEA,OAAO1B,OAAO;AAChB,CAAwC;AAoBxC,OAAO,SAAS2B,gBAAgB,GA0BmF;EAAA,IAxB9GC,cAAc,uEAAG,IAAI;EAyBxB,OAAO5B,OAAO,IAAI,CAAC4B,cAAc,GAAGjD,eAAe,GAAGC,gBAAgB,EAAEoB,OAAO,CAAQ;AACzF"}
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.0.2-next-20221122.0",
4
+ "version": "3.0.2",
5
5
  "author": {
6
6
  "name": "John Leider",
7
7
  "email": "john@vuetifyjs.com"