@vuetify/nightly 3.4.11-dev.2024-01-19 → 3.5.0-dev.2024-01-20

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 (39) hide show
  1. package/CHANGELOG.md +2 -29
  2. package/dist/json/attributes.json +6 -6
  3. package/dist/json/importMap.json +116 -116
  4. package/dist/json/web-types.json +42 -7
  5. package/dist/vuetify-labs.css +2802 -2782
  6. package/dist/vuetify-labs.d.ts +61 -8
  7. package/dist/vuetify-labs.esm.js +153 -22
  8. package/dist/vuetify-labs.esm.js.map +1 -1
  9. package/dist/vuetify-labs.js +153 -21
  10. package/dist/vuetify-labs.min.css +2 -2
  11. package/dist/vuetify.css +757 -737
  12. package/dist/vuetify.d.ts +97 -44
  13. package/dist/vuetify.esm.js +153 -22
  14. package/dist/vuetify.esm.js.map +1 -1
  15. package/dist/vuetify.js +153 -21
  16. package/dist/vuetify.js.map +1 -1
  17. package/dist/vuetify.min.css +2 -2
  18. package/dist/vuetify.min.js +359 -337
  19. package/dist/vuetify.min.js.map +1 -1
  20. package/lib/blueprints/index.d.mts +11 -1
  21. package/lib/blueprints/md1.d.mts +11 -1
  22. package/lib/blueprints/md2.d.mts +11 -1
  23. package/lib/blueprints/md3.d.mts +11 -1
  24. package/lib/components/VSwitch/VSwitch.css +22 -2
  25. package/lib/components/VSwitch/VSwitch.mjs +26 -3
  26. package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
  27. package/lib/components/VSwitch/VSwitch.sass +20 -2
  28. package/lib/components/VSwitch/index.d.mts +37 -6
  29. package/lib/components/index.d.mts +37 -6
  30. package/lib/composables/goto.mjs +105 -0
  31. package/lib/composables/goto.mjs.map +1 -0
  32. package/lib/composables/index.mjs +1 -0
  33. package/lib/composables/index.mjs.map +1 -1
  34. package/lib/entry-bundler.mjs +1 -1
  35. package/lib/entry-bundler.mjs.map +1 -1
  36. package/lib/framework.mjs +6 -2
  37. package/lib/framework.mjs.map +1 -1
  38. package/lib/index.d.mts +60 -38
  39. package/package.json +1 -1
package/dist/vuetify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.4.11-dev.2024-01-19
2
+ * Vuetify v3.5.0-dev.2024-01-20
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -2154,7 +2154,7 @@
2154
2154
  vue.provide(LocaleSymbol, data);
2155
2155
  return data;
2156
2156
  }
2157
- function genDefaults$1() {
2157
+ function genDefaults$2() {
2158
2158
  return {
2159
2159
  af: false,
2160
2160
  ar: true,
@@ -2201,7 +2201,7 @@
2201
2201
  };
2202
2202
  }
2203
2203
  function createRtl(i18n, options) {
2204
- const rtl = vue.ref(options?.rtl ?? genDefaults$1());
2204
+ const rtl = vue.ref(options?.rtl ?? genDefaults$2());
2205
2205
  const isRtl = vue.computed(() => rtl.value[i18n.current.value] ?? false);
2206
2206
  return {
2207
2207
  isRtl,
@@ -2234,7 +2234,7 @@
2234
2234
  const makeThemeProps = propsFactory({
2235
2235
  theme: String
2236
2236
  }, 'theme');
2237
- function genDefaults() {
2237
+ function genDefaults$1() {
2238
2238
  return {
2239
2239
  defaultTheme: 'light',
2240
2240
  variations: {
@@ -2321,8 +2321,8 @@
2321
2321
  };
2322
2322
  }
2323
2323
  function parseThemeOptions() {
2324
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : genDefaults();
2325
- const defaults = genDefaults();
2324
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : genDefaults$1();
2325
+ const defaults = genDefaults$1();
2326
2326
  if (!options) return {
2327
2327
  ...defaults,
2328
2328
  isDisabled: true
@@ -9045,7 +9045,7 @@
9045
9045
  }
9046
9046
 
9047
9047
  /** Get the difference between two points */
9048
- function getOffset$1(a, b) {
9048
+ function getOffset$2(a, b) {
9049
9049
  return {
9050
9050
  x: a.x - b.x,
9051
9051
  y: a.y - b.y
@@ -9292,7 +9292,7 @@
9292
9292
  let {
9293
9293
  x,
9294
9294
  y
9295
- } = getOffset$1(targetPoint, contentPoint);
9295
+ } = getOffset$2(targetPoint, contentPoint);
9296
9296
  switch (_placement.anchor.side) {
9297
9297
  case 'top':
9298
9298
  y -= offset.value[0];
@@ -9827,7 +9827,7 @@
9827
9827
  const target = vue.computed(() => {
9828
9828
  if (props.target === 'cursor' && cursorTarget.value) return cursorTarget.value;
9829
9829
  if (targetRef.value) return refElement(targetRef.value);
9830
- return getTarget(props.target, vm) || activatorEl.value;
9830
+ return getTarget$1(props.target, vm) || activatorEl.value;
9831
9831
  });
9832
9832
  const targetEl = vue.computed(() => {
9833
9833
  return Array.isArray(target.value) ? undefined : target.value;
@@ -9899,14 +9899,14 @@
9899
9899
  }
9900
9900
  function getActivator() {
9901
9901
  let selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.activator;
9902
- const activator = getTarget(selector, vm);
9902
+ const activator = getTarget$1(selector, vm);
9903
9903
 
9904
9904
  // The activator should only be a valid element (Ignore comments and text nodes)
9905
9905
  activatorEl.value = activator?.nodeType === Node.ELEMENT_NODE ? activator : undefined;
9906
9906
  return activatorEl.value;
9907
9907
  }
9908
9908
  }
9909
- function getTarget(selector, vm) {
9909
+ function getTarget$1(selector, vm) {
9910
9910
  if (!selector) return;
9911
9911
  let target;
9912
9912
  if (selector === 'parent') {
@@ -14528,7 +14528,7 @@
14528
14528
  // Types
14529
14529
 
14530
14530
  const VSliderSymbol = Symbol.for('vuetify:v-slider');
14531
- function getOffset(e, el, direction) {
14531
+ function getOffset$1(e, el, direction) {
14532
14532
  const vertical = direction === 'vertical';
14533
14533
  const rect = el.getBoundingClientRect();
14534
14534
  const touch = 'touches' in e ? e.touches[0] : e;
@@ -14687,7 +14687,7 @@
14687
14687
  activeThumbRef.value.focus();
14688
14688
  mousePressed.value = true;
14689
14689
  if (activeThumbRef.value.contains(e.target)) {
14690
- startOffset.value = getOffset(e, activeThumbRef.value, props.direction);
14690
+ startOffset.value = getOffset$1(e, activeThumbRef.value, props.direction);
14691
14691
  } else {
14692
14692
  startOffset.value = 0;
14693
14693
  onSliderMove({
@@ -17532,6 +17532,112 @@
17532
17532
  return Math.floor(diffDays / 7) + 1;
17533
17533
  }
17534
17534
 
17535
+ // Utilities
17536
+
17537
+ // Types
17538
+
17539
+ const GoToSymbol = Symbol.for('vuetify:goto');
17540
+ function genDefaults() {
17541
+ return {
17542
+ container: undefined,
17543
+ duration: 300,
17544
+ layout: false,
17545
+ offset: 0,
17546
+ easing: 'easeInOutCubic',
17547
+ patterns: {
17548
+ linear: t => t,
17549
+ easeInQuad: t => t ** 2,
17550
+ easeOutQuad: t => t * (2 - t),
17551
+ easeInOutQuad: t => t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t,
17552
+ easeInCubic: t => t ** 3,
17553
+ easeOutCubic: t => --t ** 3 + 1,
17554
+ easeInOutCubic: t => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,
17555
+ easeInQuart: t => t ** 4,
17556
+ easeOutQuart: t => 1 - --t ** 4,
17557
+ easeInOutQuart: t => t < 0.5 ? 8 * t ** 4 : 1 - 8 * --t ** 4,
17558
+ easeInQuint: t => t ** 5,
17559
+ easeOutQuint: t => 1 + --t ** 5,
17560
+ easeInOutQuint: t => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5
17561
+ }
17562
+ };
17563
+ }
17564
+ function getContainer(el) {
17565
+ return getTarget(el) ?? (document.scrollingElement || document.body);
17566
+ }
17567
+ function getTarget(el) {
17568
+ return typeof el === 'string' ? document.querySelector(el) : refElement(el);
17569
+ }
17570
+ function getOffset(target, horizontal, rtl) {
17571
+ if (typeof target === 'number') return horizontal && rtl ? -target : target;
17572
+ let el = getTarget(target);
17573
+ let totalOffset = 0;
17574
+ while (el) {
17575
+ totalOffset += horizontal ? el.offsetLeft : el.offsetTop;
17576
+ el = el.offsetParent;
17577
+ }
17578
+ return totalOffset;
17579
+ }
17580
+ function createGoTo(options, locale) {
17581
+ return {
17582
+ rtl: locale.isRtl,
17583
+ options: mergeDeep(genDefaults(), options)
17584
+ };
17585
+ }
17586
+ async function scrollTo(_target, _options, horizontal, goTo) {
17587
+ const options = mergeDeep(goTo?.options, _options);
17588
+ const rtl = goTo?.rtl.value;
17589
+ const target = (typeof _target === 'number' ? _target : getTarget(_target)) ?? 0;
17590
+ const container = options.container === 'parent' && target instanceof HTMLElement ? target.parentElement : getContainer(options.container);
17591
+ const ease = typeof options.easing === 'function' ? options.easing : options.patterns[options.easing];
17592
+ if (!ease) throw new TypeError(`Easing function "${options.easing}" not found.`);
17593
+ let targetLocation;
17594
+ if (typeof target === 'number') {
17595
+ targetLocation = getOffset(target, horizontal, rtl);
17596
+ } else {
17597
+ targetLocation = getOffset(target, horizontal, rtl) - getOffset(container, horizontal, rtl);
17598
+ if (options.layout) {
17599
+ const styles = window.getComputedStyle(target);
17600
+ const layoutOffset = styles.getPropertyValue('--v-layout-top');
17601
+ if (layoutOffset) targetLocation -= parseInt(layoutOffset, 10);
17602
+ }
17603
+ }
17604
+ targetLocation += options.offset;
17605
+ const startLocation = (horizontal ? container.scrollLeft : container.scrollTop) ?? 0;
17606
+ if (targetLocation === startLocation) return Promise.resolve(targetLocation);
17607
+ const startTime = performance.now();
17608
+ return new Promise(resolve => requestAnimationFrame(function step(currentTime) {
17609
+ const timeElapsed = currentTime - startTime;
17610
+ const progress = Math.abs(options.duration ? Math.min(timeElapsed / options.duration, 1) : 1);
17611
+ const location = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress));
17612
+ container[horizontal ? 'scrollLeft' : 'scrollTop'] = location;
17613
+ if (progress === 1) return resolve(targetLocation);
17614
+ let clientSize;
17615
+ let reachEnd;
17616
+ if (!horizontal) {
17617
+ clientSize = container === document.body ? document.documentElement.clientHeight : container.clientHeight;
17618
+ reachEnd = clientSize + container.scrollTop >= container.scrollHeight;
17619
+ if (targetLocation > container.scrollTop && reachEnd) return resolve(targetLocation);
17620
+ } else {
17621
+ clientSize = container === document.body ? document.documentElement.clientWidth : container.clientWidth;
17622
+ reachEnd = clientSize + container.scrollLeft >= container.scrollWidth;
17623
+ if (targetLocation > container.scrollLeft && reachEnd) return resolve(targetLocation);
17624
+ }
17625
+ requestAnimationFrame(step);
17626
+ }));
17627
+ }
17628
+ function useGoTo() {
17629
+ let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17630
+ const goTo = vue.inject(GoToSymbol);
17631
+ if (!goTo) throw new Error('[Vuetify] Could not find injected goto instance');
17632
+ async function go(target, options) {
17633
+ return scrollTo(target, mergeDeep(_options, options), false, goTo);
17634
+ }
17635
+ go.horizontal = async (target, options) => {
17636
+ return scrollTo(target, mergeDeep(_options, options), true, goTo);
17637
+ };
17638
+ return go;
17639
+ }
17640
+
17535
17641
  // Composables
17536
17642
 
17537
17643
  // Types
@@ -23014,8 +23120,8 @@
23014
23120
  } = useRtl();
23015
23121
  function getActiveThumb(e) {
23016
23122
  if (!startThumbRef.value || !stopThumbRef.value) return;
23017
- const startOffset = getOffset(e, startThumbRef.value.$el, props.direction);
23018
- const stopOffset = getOffset(e, stopThumbRef.value.$el, props.direction);
23123
+ const startOffset = getOffset$1(e, startThumbRef.value.$el, props.direction);
23124
+ const stopOffset = getOffset$1(e, stopThumbRef.value.$el, props.direction);
23019
23125
  const a = Math.abs(startOffset);
23020
23126
  const b = Math.abs(stopOffset);
23021
23127
  return a < b || a === b && startOffset < 0 ? startThumbRef.value.$el : stopThumbRef.value.$el;
@@ -24190,6 +24296,10 @@
24190
24296
  isReadonly,
24191
24297
  isValid
24192
24298
  } = _ref2;
24299
+ const slotProps = {
24300
+ model,
24301
+ isValid
24302
+ };
24193
24303
  return vue.createVNode(VSelectionControl, vue.mergeProps({
24194
24304
  "ref": control
24195
24305
  }, controlProps, {
@@ -24214,7 +24324,13 @@
24214
24324
  "class": ['v-switch__track', ...backgroundColorClasses.value],
24215
24325
  "style": backgroundColorStyles.value,
24216
24326
  "onClick": onTrackClick
24217
- }, null);
24327
+ }, [slots['track-true'] && vue.createVNode("div", {
24328
+ "key": "prepend",
24329
+ "class": "v-switch__track-true"
24330
+ }, [slots['track-true'](slotProps)]), slots['track-false'] && vue.createVNode("div", {
24331
+ "key": "append",
24332
+ "class": "v-switch__track-false"
24333
+ }, [slots['track-false'](slotProps)])]);
24218
24334
  },
24219
24335
  input: _ref4 => {
24220
24336
  let {
@@ -24228,9 +24344,21 @@
24228
24344
  'v-switch__thumb--filled': icon || props.loading
24229
24345
  }, props.inset ? undefined : backgroundColorClasses.value],
24230
24346
  "style": props.inset ? undefined : backgroundColorStyles.value
24231
- }, [vue.createVNode(VScaleTransition, null, {
24347
+ }, [slots.thumb ? vue.createVNode(VDefaultsProvider, {
24348
+ "defaults": {
24349
+ VIcon: {
24350
+ icon,
24351
+ size: 'x-small'
24352
+ }
24353
+ }
24354
+ }, {
24355
+ default: () => [slots.thumb({
24356
+ ...slotProps,
24357
+ icon
24358
+ })]
24359
+ }) : vue.createVNode(VScaleTransition, null, {
24232
24360
  default: () => [!props.loading ? icon && vue.createVNode(VIcon, {
24233
- "key": icon,
24361
+ "key": String(icon),
24234
24362
  "icon": icon,
24235
24363
  "size": "x-small"
24236
24364
  }, null) : vue.createVNode(LoaderSlot, {
@@ -25450,6 +25578,7 @@
25450
25578
  const icons = createIcons(options.icons);
25451
25579
  const locale = createLocale(options.locale);
25452
25580
  const date = createDate(options.date, locale);
25581
+ const goTo = createGoTo(options.goTo, locale);
25453
25582
  const install = app => {
25454
25583
  for (const key in directives) {
25455
25584
  app.directive(key, directives[key]);
@@ -25472,6 +25601,7 @@
25472
25601
  app.provide(LocaleSymbol, locale);
25473
25602
  app.provide(DateOptionsSymbol, date.options);
25474
25603
  app.provide(DateAdapterSymbol, date.instance);
25604
+ app.provide(GoToSymbol, goTo);
25475
25605
  if (IN_BROWSER && options.ssr) {
25476
25606
  if (app.$nuxt) {
25477
25607
  app.$nuxt.hook('app:suspense:resolve', () => {
@@ -25514,10 +25644,11 @@
25514
25644
  theme,
25515
25645
  icons,
25516
25646
  locale,
25517
- date
25647
+ date,
25648
+ goTo
25518
25649
  };
25519
25650
  }
25520
- const version$1 = "3.4.11-dev.2024-01-19";
25651
+ const version$1 = "3.5.0-dev.2024-01-20";
25521
25652
  createVuetify$1.version = version$1;
25522
25653
 
25523
25654
  // Vue's inject() can only be used in setup
@@ -25542,7 +25673,7 @@
25542
25673
  ...options
25543
25674
  });
25544
25675
  };
25545
- const version = "3.4.11-dev.2024-01-19";
25676
+ const version = "3.5.0-dev.2024-01-20";
25546
25677
  createVuetify.version = version;
25547
25678
 
25548
25679
  exports.components = components;
@@ -25551,6 +25682,7 @@
25551
25682
  exports.useDate = useDate;
25552
25683
  exports.useDefaults = useDefaults;
25553
25684
  exports.useDisplay = useDisplay;
25685
+ exports.useGoTo = useGoTo;
25554
25686
  exports.useLayout = useLayout;
25555
25687
  exports.useLocale = useLocale;
25556
25688
  exports.useRtl = useRtl;