@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
@@ -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
  */
@@ -2160,7 +2160,7 @@
2160
2160
  vue.provide(LocaleSymbol, data);
2161
2161
  return data;
2162
2162
  }
2163
- function genDefaults$1() {
2163
+ function genDefaults$2() {
2164
2164
  return {
2165
2165
  af: false,
2166
2166
  ar: true,
@@ -2207,7 +2207,7 @@
2207
2207
  };
2208
2208
  }
2209
2209
  function createRtl(i18n, options) {
2210
- const rtl = vue.ref(options?.rtl ?? genDefaults$1());
2210
+ const rtl = vue.ref(options?.rtl ?? genDefaults$2());
2211
2211
  const isRtl = vue.computed(() => rtl.value[i18n.current.value] ?? false);
2212
2212
  return {
2213
2213
  isRtl,
@@ -2240,7 +2240,7 @@
2240
2240
  const makeThemeProps = propsFactory({
2241
2241
  theme: String
2242
2242
  }, 'theme');
2243
- function genDefaults() {
2243
+ function genDefaults$1() {
2244
2244
  return {
2245
2245
  defaultTheme: 'light',
2246
2246
  variations: {
@@ -2327,8 +2327,8 @@
2327
2327
  };
2328
2328
  }
2329
2329
  function parseThemeOptions() {
2330
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : genDefaults();
2331
- const defaults = genDefaults();
2330
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : genDefaults$1();
2331
+ const defaults = genDefaults$1();
2332
2332
  if (!options) return {
2333
2333
  ...defaults,
2334
2334
  isDisabled: true
@@ -9051,7 +9051,7 @@
9051
9051
  }
9052
9052
 
9053
9053
  /** Get the difference between two points */
9054
- function getOffset$1(a, b) {
9054
+ function getOffset$2(a, b) {
9055
9055
  return {
9056
9056
  x: a.x - b.x,
9057
9057
  y: a.y - b.y
@@ -9298,7 +9298,7 @@
9298
9298
  let {
9299
9299
  x,
9300
9300
  y
9301
- } = getOffset$1(targetPoint, contentPoint);
9301
+ } = getOffset$2(targetPoint, contentPoint);
9302
9302
  switch (_placement.anchor.side) {
9303
9303
  case 'top':
9304
9304
  y -= offset.value[0];
@@ -9833,7 +9833,7 @@
9833
9833
  const target = vue.computed(() => {
9834
9834
  if (props.target === 'cursor' && cursorTarget.value) return cursorTarget.value;
9835
9835
  if (targetRef.value) return refElement(targetRef.value);
9836
- return getTarget(props.target, vm) || activatorEl.value;
9836
+ return getTarget$1(props.target, vm) || activatorEl.value;
9837
9837
  });
9838
9838
  const targetEl = vue.computed(() => {
9839
9839
  return Array.isArray(target.value) ? undefined : target.value;
@@ -9905,14 +9905,14 @@
9905
9905
  }
9906
9906
  function getActivator() {
9907
9907
  let selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.activator;
9908
- const activator = getTarget(selector, vm);
9908
+ const activator = getTarget$1(selector, vm);
9909
9909
 
9910
9910
  // The activator should only be a valid element (Ignore comments and text nodes)
9911
9911
  activatorEl.value = activator?.nodeType === Node.ELEMENT_NODE ? activator : undefined;
9912
9912
  return activatorEl.value;
9913
9913
  }
9914
9914
  }
9915
- function getTarget(selector, vm) {
9915
+ function getTarget$1(selector, vm) {
9916
9916
  if (!selector) return;
9917
9917
  let target;
9918
9918
  if (selector === 'parent') {
@@ -14534,7 +14534,7 @@
14534
14534
  // Types
14535
14535
 
14536
14536
  const VSliderSymbol = Symbol.for('vuetify:v-slider');
14537
- function getOffset(e, el, direction) {
14537
+ function getOffset$1(e, el, direction) {
14538
14538
  const vertical = direction === 'vertical';
14539
14539
  const rect = el.getBoundingClientRect();
14540
14540
  const touch = 'touches' in e ? e.touches[0] : e;
@@ -14693,7 +14693,7 @@
14693
14693
  activeThumbRef.value.focus();
14694
14694
  mousePressed.value = true;
14695
14695
  if (activeThumbRef.value.contains(e.target)) {
14696
- startOffset.value = getOffset(e, activeThumbRef.value, props.direction);
14696
+ startOffset.value = getOffset$1(e, activeThumbRef.value, props.direction);
14697
14697
  } else {
14698
14698
  startOffset.value = 0;
14699
14699
  onSliderMove({
@@ -17538,6 +17538,112 @@
17538
17538
  return Math.floor(diffDays / 7) + 1;
17539
17539
  }
17540
17540
 
17541
+ // Utilities
17542
+
17543
+ // Types
17544
+
17545
+ const GoToSymbol = Symbol.for('vuetify:goto');
17546
+ function genDefaults() {
17547
+ return {
17548
+ container: undefined,
17549
+ duration: 300,
17550
+ layout: false,
17551
+ offset: 0,
17552
+ easing: 'easeInOutCubic',
17553
+ patterns: {
17554
+ linear: t => t,
17555
+ easeInQuad: t => t ** 2,
17556
+ easeOutQuad: t => t * (2 - t),
17557
+ easeInOutQuad: t => t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t,
17558
+ easeInCubic: t => t ** 3,
17559
+ easeOutCubic: t => --t ** 3 + 1,
17560
+ easeInOutCubic: t => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,
17561
+ easeInQuart: t => t ** 4,
17562
+ easeOutQuart: t => 1 - --t ** 4,
17563
+ easeInOutQuart: t => t < 0.5 ? 8 * t ** 4 : 1 - 8 * --t ** 4,
17564
+ easeInQuint: t => t ** 5,
17565
+ easeOutQuint: t => 1 + --t ** 5,
17566
+ easeInOutQuint: t => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5
17567
+ }
17568
+ };
17569
+ }
17570
+ function getContainer(el) {
17571
+ return getTarget(el) ?? (document.scrollingElement || document.body);
17572
+ }
17573
+ function getTarget(el) {
17574
+ return typeof el === 'string' ? document.querySelector(el) : refElement(el);
17575
+ }
17576
+ function getOffset(target, horizontal, rtl) {
17577
+ if (typeof target === 'number') return horizontal && rtl ? -target : target;
17578
+ let el = getTarget(target);
17579
+ let totalOffset = 0;
17580
+ while (el) {
17581
+ totalOffset += horizontal ? el.offsetLeft : el.offsetTop;
17582
+ el = el.offsetParent;
17583
+ }
17584
+ return totalOffset;
17585
+ }
17586
+ function createGoTo(options, locale) {
17587
+ return {
17588
+ rtl: locale.isRtl,
17589
+ options: mergeDeep(genDefaults(), options)
17590
+ };
17591
+ }
17592
+ async function scrollTo(_target, _options, horizontal, goTo) {
17593
+ const options = mergeDeep(goTo?.options, _options);
17594
+ const rtl = goTo?.rtl.value;
17595
+ const target = (typeof _target === 'number' ? _target : getTarget(_target)) ?? 0;
17596
+ const container = options.container === 'parent' && target instanceof HTMLElement ? target.parentElement : getContainer(options.container);
17597
+ const ease = typeof options.easing === 'function' ? options.easing : options.patterns[options.easing];
17598
+ if (!ease) throw new TypeError(`Easing function "${options.easing}" not found.`);
17599
+ let targetLocation;
17600
+ if (typeof target === 'number') {
17601
+ targetLocation = getOffset(target, horizontal, rtl);
17602
+ } else {
17603
+ targetLocation = getOffset(target, horizontal, rtl) - getOffset(container, horizontal, rtl);
17604
+ if (options.layout) {
17605
+ const styles = window.getComputedStyle(target);
17606
+ const layoutOffset = styles.getPropertyValue('--v-layout-top');
17607
+ if (layoutOffset) targetLocation -= parseInt(layoutOffset, 10);
17608
+ }
17609
+ }
17610
+ targetLocation += options.offset;
17611
+ const startLocation = (horizontal ? container.scrollLeft : container.scrollTop) ?? 0;
17612
+ if (targetLocation === startLocation) return Promise.resolve(targetLocation);
17613
+ const startTime = performance.now();
17614
+ return new Promise(resolve => requestAnimationFrame(function step(currentTime) {
17615
+ const timeElapsed = currentTime - startTime;
17616
+ const progress = Math.abs(options.duration ? Math.min(timeElapsed / options.duration, 1) : 1);
17617
+ const location = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress));
17618
+ container[horizontal ? 'scrollLeft' : 'scrollTop'] = location;
17619
+ if (progress === 1) return resolve(targetLocation);
17620
+ let clientSize;
17621
+ let reachEnd;
17622
+ if (!horizontal) {
17623
+ clientSize = container === document.body ? document.documentElement.clientHeight : container.clientHeight;
17624
+ reachEnd = clientSize + container.scrollTop >= container.scrollHeight;
17625
+ if (targetLocation > container.scrollTop && reachEnd) return resolve(targetLocation);
17626
+ } else {
17627
+ clientSize = container === document.body ? document.documentElement.clientWidth : container.clientWidth;
17628
+ reachEnd = clientSize + container.scrollLeft >= container.scrollWidth;
17629
+ if (targetLocation > container.scrollLeft && reachEnd) return resolve(targetLocation);
17630
+ }
17631
+ requestAnimationFrame(step);
17632
+ }));
17633
+ }
17634
+ function useGoTo() {
17635
+ let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17636
+ const goTo = vue.inject(GoToSymbol);
17637
+ if (!goTo) throw new Error('[Vuetify] Could not find injected goto instance');
17638
+ async function go(target, options) {
17639
+ return scrollTo(target, mergeDeep(_options, options), false, goTo);
17640
+ }
17641
+ go.horizontal = async (target, options) => {
17642
+ return scrollTo(target, mergeDeep(_options, options), true, goTo);
17643
+ };
17644
+ return go;
17645
+ }
17646
+
17541
17647
  // Composables
17542
17648
 
17543
17649
  // Types
@@ -23020,8 +23126,8 @@
23020
23126
  } = useRtl();
23021
23127
  function getActiveThumb(e) {
23022
23128
  if (!startThumbRef.value || !stopThumbRef.value) return;
23023
- const startOffset = getOffset(e, startThumbRef.value.$el, props.direction);
23024
- const stopOffset = getOffset(e, stopThumbRef.value.$el, props.direction);
23129
+ const startOffset = getOffset$1(e, startThumbRef.value.$el, props.direction);
23130
+ const stopOffset = getOffset$1(e, stopThumbRef.value.$el, props.direction);
23025
23131
  const a = Math.abs(startOffset);
23026
23132
  const b = Math.abs(stopOffset);
23027
23133
  return a < b || a === b && startOffset < 0 ? startThumbRef.value.$el : stopThumbRef.value.$el;
@@ -24196,6 +24302,10 @@
24196
24302
  isReadonly,
24197
24303
  isValid
24198
24304
  } = _ref2;
24305
+ const slotProps = {
24306
+ model,
24307
+ isValid
24308
+ };
24199
24309
  return vue.createVNode(VSelectionControl, vue.mergeProps({
24200
24310
  "ref": control
24201
24311
  }, controlProps, {
@@ -24220,7 +24330,13 @@
24220
24330
  "class": ['v-switch__track', ...backgroundColorClasses.value],
24221
24331
  "style": backgroundColorStyles.value,
24222
24332
  "onClick": onTrackClick
24223
- }, null);
24333
+ }, [slots['track-true'] && vue.createVNode("div", {
24334
+ "key": "prepend",
24335
+ "class": "v-switch__track-true"
24336
+ }, [slots['track-true'](slotProps)]), slots['track-false'] && vue.createVNode("div", {
24337
+ "key": "append",
24338
+ "class": "v-switch__track-false"
24339
+ }, [slots['track-false'](slotProps)])]);
24224
24340
  },
24225
24341
  input: _ref4 => {
24226
24342
  let {
@@ -24234,9 +24350,21 @@
24234
24350
  'v-switch__thumb--filled': icon || props.loading
24235
24351
  }, props.inset ? undefined : backgroundColorClasses.value],
24236
24352
  "style": props.inset ? undefined : backgroundColorStyles.value
24237
- }, [vue.createVNode(VScaleTransition, null, {
24353
+ }, [slots.thumb ? vue.createVNode(VDefaultsProvider, {
24354
+ "defaults": {
24355
+ VIcon: {
24356
+ icon,
24357
+ size: 'x-small'
24358
+ }
24359
+ }
24360
+ }, {
24361
+ default: () => [slots.thumb({
24362
+ ...slotProps,
24363
+ icon
24364
+ })]
24365
+ }) : vue.createVNode(VScaleTransition, null, {
24238
24366
  default: () => [!props.loading ? icon && vue.createVNode(VIcon, {
24239
- "key": icon,
24367
+ "key": String(icon),
24240
24368
  "icon": icon,
24241
24369
  "size": "x-small"
24242
24370
  }, null) : vue.createVNode(LoaderSlot, {
@@ -26008,6 +26136,7 @@
26008
26136
  const icons = createIcons(options.icons);
26009
26137
  const locale = createLocale(options.locale);
26010
26138
  const date = createDate(options.date, locale);
26139
+ const goTo = createGoTo(options.goTo, locale);
26011
26140
  const install = app => {
26012
26141
  for (const key in directives) {
26013
26142
  app.directive(key, directives[key]);
@@ -26030,6 +26159,7 @@
26030
26159
  app.provide(LocaleSymbol, locale);
26031
26160
  app.provide(DateOptionsSymbol, date.options);
26032
26161
  app.provide(DateAdapterSymbol, date.instance);
26162
+ app.provide(GoToSymbol, goTo);
26033
26163
  if (IN_BROWSER && options.ssr) {
26034
26164
  if (app.$nuxt) {
26035
26165
  app.$nuxt.hook('app:suspense:resolve', () => {
@@ -26072,10 +26202,11 @@
26072
26202
  theme,
26073
26203
  icons,
26074
26204
  locale,
26075
- date
26205
+ date,
26206
+ goTo
26076
26207
  };
26077
26208
  }
26078
- const version$1 = "3.4.11-dev.2024-01-19";
26209
+ const version$1 = "3.5.0-dev.2024-01-20";
26079
26210
  createVuetify$1.version = version$1;
26080
26211
 
26081
26212
  // Vue's inject() can only be used in setup
@@ -26089,7 +26220,7 @@
26089
26220
 
26090
26221
  /* eslint-disable local-rules/sort-imports */
26091
26222
 
26092
- const version = "3.4.11-dev.2024-01-19";
26223
+ const version = "3.5.0-dev.2024-01-20";
26093
26224
 
26094
26225
  /* eslint-disable local-rules/sort-imports */
26095
26226
 
@@ -26108,6 +26239,7 @@
26108
26239
  exports.useDate = useDate;
26109
26240
  exports.useDefaults = useDefaults;
26110
26241
  exports.useDisplay = useDisplay;
26242
+ exports.useGoTo = useGoTo;
26111
26243
  exports.useLayout = useLayout;
26112
26244
  exports.useLocale = useLocale;
26113
26245
  exports.useRtl = useRtl;