@dimailn/vuetify 2.7.2-alpha56 → 2.7.2-alpha58

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 (57) hide show
  1. package/dist/json/attributes.json +3945 -417
  2. package/dist/json/tags.json +1120 -133
  3. package/dist/json/web-types.json +12516 -2651
  4. package/dist/vuetify.js +93 -102
  5. package/dist/vuetify.js.map +1 -1
  6. package/dist/vuetify.min.css +1 -1
  7. package/dist/vuetify.min.js +2 -2
  8. package/es5/directives/click-outside/index.js +19 -21
  9. package/es5/directives/click-outside/index.js.map +1 -1
  10. package/es5/directives/intersect/index.js +12 -17
  11. package/es5/directives/intersect/index.js.map +1 -1
  12. package/es5/directives/mutate/index.js +9 -11
  13. package/es5/directives/mutate/index.js.map +1 -1
  14. package/es5/directives/resize/index.js +8 -10
  15. package/es5/directives/resize/index.js.map +1 -1
  16. package/es5/directives/scroll/index.js +11 -12
  17. package/es5/directives/scroll/index.js.map +1 -1
  18. package/es5/directives/touch/index.js +6 -5
  19. package/es5/directives/touch/index.js.map +1 -1
  20. package/es5/framework.js +1 -1
  21. package/es5/mixins/overlayable/index.js +27 -26
  22. package/es5/mixins/overlayable/index.js.map +1 -1
  23. package/es5/services/theme/utils.js.map +1 -1
  24. package/lib/directives/click-outside/index.js +17 -19
  25. package/lib/directives/click-outside/index.js.map +1 -1
  26. package/lib/directives/intersect/index.js +12 -16
  27. package/lib/directives/intersect/index.js.map +1 -1
  28. package/lib/directives/mutate/index.js +9 -11
  29. package/lib/directives/mutate/index.js.map +1 -1
  30. package/lib/directives/resize/index.js +8 -8
  31. package/lib/directives/resize/index.js.map +1 -1
  32. package/lib/directives/scroll/index.js +8 -8
  33. package/lib/directives/scroll/index.js.map +1 -1
  34. package/lib/directives/touch/index.js +6 -5
  35. package/lib/directives/touch/index.js.map +1 -1
  36. package/lib/framework.js +1 -1
  37. package/lib/mixins/overlayable/index.js +28 -27
  38. package/lib/mixins/overlayable/index.js.map +1 -1
  39. package/lib/services/theme/utils.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/VMenu/__tests__/VMenuActivatorTest.spec.ts +25 -0
  42. package/src/components/VMenu/__tests__/test-with-directives.spec.ts +50 -0
  43. package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +2 -1
  44. package/src/directives/click-outside/__tests__/click-outside.spec.ts +2 -1
  45. package/src/directives/click-outside/index.ts +25 -18
  46. package/src/directives/intersect/__tests__/intersect.spec.ts +31 -13
  47. package/src/directives/intersect/index.ts +15 -19
  48. package/src/directives/mutate/__tests__/mutate.spec.ts +35 -27
  49. package/src/directives/mutate/index.ts +12 -6
  50. package/src/directives/resize/__tests__/resize.spec.ts +4 -4
  51. package/src/directives/resize/index.ts +11 -18
  52. package/src/directives/scroll/__tests__/scroll.spec.ts +5 -29
  53. package/src/directives/scroll/index.ts +14 -7
  54. package/src/directives/touch/index.ts +6 -5
  55. package/src/mixins/overlayable/__tests__/overlayable.spec.ts +24 -0
  56. package/src/mixins/overlayable/index.ts +25 -23
  57. package/src/services/theme/utils.ts +1 -1
package/dist/vuetify.js CHANGED
@@ -36110,6 +36110,7 @@ __webpack_require__.r(__webpack_exports__);
36110
36110
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
36111
36111
 
36112
36112
 
36113
+ var clickOutsideState = new WeakMap();
36113
36114
 
36114
36115
  function defaultConditional() {
36115
36116
  return true;
@@ -36151,7 +36152,9 @@ function checkIsActive(e, binding) {
36151
36152
 
36152
36153
  function directive(e, el, binding) {
36153
36154
  var handler = typeof binding.value === 'function' ? binding.value : binding.value.handler;
36154
- el._clickOutside.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(function () {
36155
+ var state = clickOutsideState.get(el);
36156
+ if (!state) return;
36157
+ state.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(function () {
36155
36158
  checkIsActive(e, binding) && handler && handler(e);
36156
36159
  }, 0);
36157
36160
  }
@@ -36177,38 +36180,32 @@ var ClickOutside = {
36177
36180
  };
36178
36181
 
36179
36182
  var onMousedown = function onMousedown(e) {
36180
- el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);
36183
+ var state = clickOutsideState.get(el);
36184
+ if (!state) return;
36185
+ state.lastMousedownWasOutside = checkEvent(e, el, binding);
36181
36186
  };
36182
36187
 
36188
+ clickOutsideState.set(el, {
36189
+ onClick: onClick,
36190
+ onMousedown: onMousedown,
36191
+ lastMousedownWasOutside: true
36192
+ });
36183
36193
  handleShadow(el, function (app) {
36184
36194
  app.addEventListener('click', onClick, true);
36185
36195
  app.addEventListener('mousedown', onMousedown, true);
36186
36196
  });
36187
-
36188
- if (!el._clickOutside) {
36189
- el._clickOutside = {
36190
- lastMousedownWasOutside: true
36191
- };
36192
- }
36193
-
36194
- el._clickOutside[vnode.ctx.uid] = {
36195
- onClick: onClick,
36196
- onMousedown: onMousedown
36197
- };
36198
36197
  },
36199
36198
  unmounted: function unmounted(el, binding, vnode) {
36200
- if (!el._clickOutside) return;
36199
+ var state = clickOutsideState.get(el);
36200
+ if (!state) return;
36201
36201
  handleShadow(el, function (app) {
36202
- var _a;
36203
-
36204
- if (!app || !((_a = el._clickOutside) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid])) return;
36205
- var _b = el._clickOutside[vnode.ctx.uid],
36206
- onClick = _b.onClick,
36207
- onMousedown = _b.onMousedown;
36202
+ if (!app) return;
36203
+ var onClick = state.onClick,
36204
+ onMousedown = state.onMousedown;
36208
36205
  app.removeEventListener('click', onClick, true);
36209
36206
  app.removeEventListener('mousedown', onMousedown, true);
36210
36207
  });
36211
- delete el._clickOutside[vnode.ctx.uid];
36208
+ clickOutsideState.delete(el);
36212
36209
  }
36213
36210
  };
36214
36211
  /* harmony default export */ __webpack_exports__["default"] = (ClickOutside);
@@ -36267,6 +36264,8 @@ __webpack_require__.r(__webpack_exports__);
36267
36264
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Intersect", function() { return Intersect; });
36268
36265
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
36269
36266
 
36267
+ var intersectState = new WeakMap();
36268
+
36270
36269
  function mounted(el, binding, vnode) {
36271
36270
  if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
36272
36271
  return;
@@ -36284,32 +36283,28 @@ function mounted(el, binding, vnode) {
36284
36283
 
36285
36284
  if (!handler) return;
36286
36285
  var observer = new IntersectionObserver(function (entries, observer) {
36287
- var _a;
36288
-
36289
36286
  if (entries === void 0) {
36290
36287
  entries = [];
36291
36288
  }
36292
36289
 
36293
- var _observe = (_a = el._observe) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid];
36294
-
36295
- if (!_observe) return; // Just in case, should never fire
36290
+ var state = intersectState.get(el);
36291
+ if (!state) return; // Just in case, should never fire
36296
36292
 
36297
36293
  var isIntersecting = entries.some(function (entry) {
36298
36294
  return entry.isIntersecting;
36299
36295
  }); // If is not quiet or has already been
36300
36296
  // initted, invoke the user callback
36301
36297
 
36302
- if (handler && typeof handler === 'function' && (!modifiers.quiet || _observe.init) && (!modifiers.once || isIntersecting || _observe.init)) {
36298
+ if (handler && typeof handler === 'function' && (!modifiers.quiet || state.init) && (!modifiers.once || isIntersecting || state.init)) {
36303
36299
  handler(entries, observer, isIntersecting);
36304
36300
  }
36305
36301
 
36306
- if (isIntersecting && modifiers.once) unmounted(el, binding, vnode);else _observe.init = true;
36302
+ if (isIntersecting && modifiers.once) unmounted(el, binding, vnode);else state.init = true;
36307
36303
  }, options);
36308
- el._observe = Object(el._observe);
36309
- el._observe[vnode.ctx.uid] = {
36304
+ intersectState.set(el, {
36310
36305
  init: false,
36311
36306
  observer: observer
36312
- };
36307
+ });
36313
36308
  observer.observe(el);
36314
36309
  }
36315
36310
 
@@ -36322,12 +36317,10 @@ function updated(el, binding, vnode) {
36322
36317
  }
36323
36318
 
36324
36319
  function unmounted(el, binding, vnode) {
36325
- var _a;
36326
-
36327
- var observe = (_a = el._observe) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid];
36328
- if (!observe) return;
36329
- observe.observer.unobserve(el);
36330
- delete el._observe[vnode.ctx.uid];
36320
+ var state = intersectState.get(el);
36321
+ if (!state) return;
36322
+ state.observer.unobserve(el);
36323
+ intersectState.delete(el);
36331
36324
  }
36332
36325
 
36333
36326
  var Intersect = {
@@ -36364,6 +36357,8 @@ var __rest = undefined && undefined.__rest || function (s, e) {
36364
36357
  return t;
36365
36358
  };
36366
36359
 
36360
+ var mutateState = new WeakMap();
36361
+
36367
36362
  function mounted(el, binding, vnode) {
36368
36363
  var modifiers = binding.modifiers || {};
36369
36364
  var value = binding.value;
@@ -36389,27 +36384,23 @@ function mounted(el, binding, vnode) {
36389
36384
  };
36390
36385
  var observer = new MutationObserver(function (mutationsList, observer) {
36391
36386
  /* istanbul ignore if */
36392
- if (!el._mutate) return; // Just in case, should never fire
36387
+ if (!mutateState.has(el)) return; // Just in case, should never fire
36393
36388
 
36394
36389
  callback(mutationsList, observer); // If has the once modifier, unbind
36395
36390
 
36396
36391
  once && unmounted(el, binding, vnode);
36397
36392
  });
36398
36393
  observer.observe(el, options);
36399
- el._mutate = Object(el._mutate);
36400
- el._mutate[vnode.ctx.uid] = {
36394
+ mutateState.set(el, {
36401
36395
  observer: observer
36402
- };
36396
+ });
36403
36397
  }
36404
36398
 
36405
36399
  function unmounted(el, binding, vnode) {
36406
- var _a;
36407
-
36408
- if (!((_a = el._mutate) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid])) return;
36409
-
36410
- el._mutate[vnode.ctx.uid].observer.disconnect();
36411
-
36412
- delete el._mutate[vnode.ctx.uid];
36400
+ var state = mutateState.get(el);
36401
+ if (!state) return;
36402
+ state.observer.disconnect();
36403
+ mutateState.delete(el);
36413
36404
  }
36414
36405
 
36415
36406
  var Mutate = {
@@ -36430,17 +36421,18 @@ var Mutate = {
36430
36421
  "use strict";
36431
36422
  __webpack_require__.r(__webpack_exports__);
36432
36423
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return Resize; });
36424
+ var resizeState = new WeakMap();
36425
+
36433
36426
  function mounted(el, binding, vnode) {
36434
36427
  var callback = binding.value;
36435
36428
  var options = binding.options || {
36436
36429
  passive: true
36437
36430
  };
36438
36431
  window.addEventListener('resize', callback, options);
36439
- el._onResize = Object(el._onResize);
36440
- el._onResize[vnode.ctx.uid] = {
36432
+ resizeState.set(el, {
36441
36433
  callback: callback,
36442
36434
  options: options
36443
- };
36435
+ });
36444
36436
 
36445
36437
  if (!binding.modifiers || !binding.modifiers.quiet) {
36446
36438
  callback();
@@ -36448,14 +36440,12 @@ function mounted(el, binding, vnode) {
36448
36440
  }
36449
36441
 
36450
36442
  function unmounted(el, binding, vnode) {
36451
- var _a;
36452
-
36453
- if (!((_a = el._onResize) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid])) return;
36454
- var _b = el._onResize[vnode.ctx.uid],
36455
- callback = _b.callback,
36456
- options = _b.options;
36443
+ var state = resizeState.get(el);
36444
+ if (!state) return;
36445
+ var callback = state.callback,
36446
+ options = state.options;
36457
36447
  window.removeEventListener('resize', callback, options);
36458
- delete el._onResize[vnode.ctx.uid];
36448
+ resizeState.delete(el);
36459
36449
  }
36460
36450
 
36461
36451
  var Resize = {
@@ -36890,6 +36880,8 @@ __webpack_require__.r(__webpack_exports__);
36890
36880
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return Scroll; });
36891
36881
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
36892
36882
 
36883
+ var scrollState = new WeakMap();
36884
+
36893
36885
  function mounted(el, binding, vnode) {
36894
36886
  var _a = (binding.modifiers || {}).self,
36895
36887
  self = _a === void 0 ? false : _a;
@@ -36901,26 +36893,23 @@ function mounted(el, binding, vnode) {
36901
36893
  var target = self ? el : binding.arg ? document.querySelector(binding.arg) : window;
36902
36894
  if (!target) return;
36903
36895
  target.addEventListener('scroll', handler, options);
36904
- el._onScroll = Object(el._onScroll);
36905
- el._onScroll[vnode.ctx.uid] = {
36896
+ scrollState.set(el, {
36906
36897
  handler: handler,
36907
36898
  options: options,
36908
36899
  // Don't reference self
36909
36900
  target: self ? undefined : target
36910
- };
36901
+ });
36911
36902
  }
36912
36903
 
36913
36904
  function unmounted(el, binding, vnode) {
36914
- var _a;
36915
-
36916
- if (!((_a = el._onScroll) === null || _a === void 0 ? void 0 : _a[vnode.ctx.uid])) return;
36917
- var _b = el._onScroll[vnode.ctx.uid],
36918
- handler = _b.handler,
36919
- options = _b.options,
36920
- _c = _b.target,
36921
- target = _c === void 0 ? el : _c;
36905
+ var state = scrollState.get(el);
36906
+ if (!state) return;
36907
+ var handler = state.handler,
36908
+ options = state.options,
36909
+ _a = state.target,
36910
+ target = _a === void 0 ? el : _a;
36922
36911
  target.removeEventListener('scroll', handler, options);
36923
- delete el._onScroll[vnode.ctx.uid];
36912
+ scrollState.delete(el);
36924
36913
  }
36925
36914
 
36926
36915
  var Scroll = {
@@ -37020,6 +37009,8 @@ function createHandlers(value) {
37020
37009
  };
37021
37010
  }
37022
37011
 
37012
+ var touchState = new WeakMap();
37013
+
37023
37014
  function mounted(el, binding, vnode) {
37024
37015
  var value = binding.value;
37025
37016
  var target = value.parent ? el.parentElement : el;
@@ -37029,8 +37020,7 @@ function mounted(el, binding, vnode) {
37029
37020
 
37030
37021
  if (!target) return;
37031
37022
  var handlers = createHandlers(binding.value);
37032
- target._touchHandlers = Object(target._touchHandlers);
37033
- target._touchHandlers[vnode.ctx.uid] = handlers;
37023
+ touchState.set(target, handlers);
37034
37024
  Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
37035
37025
  target.addEventListener(eventName, handlers[eventName], options);
37036
37026
  });
@@ -37038,14 +37028,14 @@ function mounted(el, binding, vnode) {
37038
37028
 
37039
37029
  function unmounted(el, binding, vnode) {
37040
37030
  var target = binding.value.parent ? el.parentElement : el;
37041
- if (!target || !target._touchHandlers) return;
37042
- var handlers = target._touchHandlers[vnode.ctx.uid];
37031
+ if (!target) return;
37032
+ var handlers = touchState.get(target);
37043
37033
 
37044
37034
  if (handlers) {
37045
37035
  Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
37046
37036
  target.removeEventListener(eventName, handlers[eventName]);
37047
37037
  });
37048
- delete target._touchHandlers[vnode.ctx.uid];
37038
+ touchState.delete(target);
37049
37039
  }
37050
37040
  }
37051
37041
 
@@ -37124,7 +37114,7 @@ function () {
37124
37114
 
37125
37115
  Vuetify.install = _install__WEBPACK_IMPORTED_MODULE_0__["install"];
37126
37116
  Vuetify.installed = false;
37127
- Vuetify.version = "2.7.2-alpha56";
37117
+ Vuetify.version = "2.7.2-alpha58";
37128
37118
  Vuetify.config = {
37129
37119
  silent: false
37130
37120
  };
@@ -43220,7 +43210,7 @@ var __assign = undefined && undefined.__assign || function () {
43220
43210
  }
43221
43211
  },
43222
43212
  beforeUnmount: function beforeUnmount() {
43223
- this.removeOverlay();
43213
+ this.destroyOverlay();
43224
43214
  },
43225
43215
  methods: {
43226
43216
  createOverlay: function createOverlay() {
@@ -43268,21 +43258,13 @@ var __assign = undefined && undefined.__assign || function () {
43268
43258
  genOverlay: function genOverlay() {
43269
43259
  var _this = this;
43270
43260
 
43271
- var _a, _b, _c, _d;
43261
+ var _a, _b;
43272
43262
 
43273
43263
  this.hideScroll();
43274
43264
  if (this.hideOverlay) return;
43275
43265
 
43276
43266
  if (!((_b = (_a = this.overlay) === null || _a === void 0 ? void 0 : _a.$el) === null || _b === void 0 ? void 0 : _b.isConnected)) {
43277
- if (this.overlay) {
43278
- cancelAnimationFrame(this.animationFrame);
43279
- var container = (_c = this.overlay.$el) === null || _c === void 0 ? void 0 : _c.parentNode;
43280
- (_d = this.overlayApp) === null || _d === void 0 ? void 0 : _d.unmount();
43281
- this.overlayApp = null;
43282
- if (container === null || container === void 0 ? void 0 : container.parentNode) container.parentNode.removeChild(container);
43283
- this.overlay = null;
43284
- }
43285
-
43267
+ this.teardownOverlay();
43286
43268
  this.createOverlay();
43287
43269
  }
43288
43270
 
@@ -43304,7 +43286,7 @@ var __assign = undefined && undefined.__assign || function () {
43304
43286
  removeOverlay: function removeOverlay(showScroll) {
43305
43287
  var _this = this;
43306
43288
 
43307
- var _a, _b;
43289
+ var _a;
43308
43290
 
43309
43291
  if (showScroll === void 0) {
43310
43292
  showScroll = true;
@@ -43312,27 +43294,15 @@ var __assign = undefined && undefined.__assign || function () {
43312
43294
 
43313
43295
  if (this.overlay) {
43314
43296
  if (!((_a = this.overlay.$el) === null || _a === void 0 ? void 0 : _a.isConnected)) {
43315
- cancelAnimationFrame(this.animationFrame);
43316
- (_b = this.overlayApp) === null || _b === void 0 ? void 0 : _b.unmount();
43317
- this.overlayApp = null;
43318
- this.overlay = null;
43297
+ this.teardownOverlay();
43319
43298
  showScroll && this.showScroll();
43320
43299
  return;
43321
43300
  }
43322
43301
 
43323
43302
  Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["addOnceEventListener"])(this.overlay.$el, 'transitionend', function () {
43324
- var _a;
43325
-
43326
43303
  if (!_this.overlay || !_this.overlay.$el || !_this.overlay.$el.parentNode || _this.overlay.value || _this.isActive) return;
43327
- var overlayContainer = _this.overlay.$el.parentNode;
43328
- (_a = _this.overlayApp) === null || _a === void 0 ? void 0 : _a.unmount();
43329
- _this.overlayApp = null;
43330
43304
 
43331
- if (overlayContainer === null || overlayContainer === void 0 ? void 0 : overlayContainer.parentNode) {
43332
- overlayContainer.parentNode.removeChild(overlayContainer);
43333
- }
43334
-
43335
- _this.overlay = null;
43305
+ _this.teardownOverlay();
43336
43306
  }); // Cancel animation frame in case
43337
43307
  // overlay is removed before it
43338
43308
  // has finished its animation
@@ -43343,6 +43313,27 @@ var __assign = undefined && undefined.__assign || function () {
43343
43313
 
43344
43314
  showScroll && this.showScroll();
43345
43315
  },
43316
+ teardownOverlay: function teardownOverlay() {
43317
+ var _a, _b;
43318
+
43319
+ cancelAnimationFrame(this.animationFrame);
43320
+ if (!this.overlay) return;
43321
+ var container = (_a = this.overlay.$el) === null || _a === void 0 ? void 0 : _a.parentNode;
43322
+ (_b = this.overlayApp) === null || _b === void 0 ? void 0 : _b.unmount();
43323
+ this.overlayApp = null;
43324
+
43325
+ if (container === null || container === void 0 ? void 0 : container.parentNode) {
43326
+ container.parentNode.removeChild(container);
43327
+ }
43328
+
43329
+ this.overlay = null;
43330
+ },
43331
+
43332
+ /** Синхронно уничтожает оверлей независимо от isActive/анимации. Для unmount. */
43333
+ destroyOverlay: function destroyOverlay() {
43334
+ this.teardownOverlay();
43335
+ this.showScroll();
43336
+ },
43346
43337
  scrollListener: function scrollListener(e) {
43347
43338
  if ('key' in e) {
43348
43339
  if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName) || // https://github.com/vuetifyjs/vuetify/issues/4715