quasar 2.11.2 → 2.11.4

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 (150) hide show
  1. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  2. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  3. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  4. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  5. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  6. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  7. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  8. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  9. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  10. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  13. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  14. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  15. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  16. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  17. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  19. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  21. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  22. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  23. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  24. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-mdi-v7.umd.prod.js +2 -2
  38. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  39. package/dist/icon-set/themify.umd.prod.js +1 -1
  40. package/dist/lang/ar-TN.umd.prod.js +1 -1
  41. package/dist/lang/ar.umd.prod.js +1 -1
  42. package/dist/lang/az-Latn.umd.prod.js +1 -1
  43. package/dist/lang/bg.umd.prod.js +1 -1
  44. package/dist/lang/bn.umd.prod.js +1 -1
  45. package/dist/lang/ca.umd.prod.js +1 -1
  46. package/dist/lang/cs.umd.prod.js +1 -1
  47. package/dist/lang/da.umd.prod.js +1 -1
  48. package/dist/lang/de.umd.prod.js +1 -1
  49. package/dist/lang/el.umd.prod.js +1 -1
  50. package/dist/lang/en-GB.umd.prod.js +1 -1
  51. package/dist/lang/en-US.umd.prod.js +1 -1
  52. package/dist/lang/eo.umd.prod.js +1 -1
  53. package/dist/lang/es.umd.prod.js +1 -1
  54. package/dist/lang/et.umd.prod.js +1 -1
  55. package/dist/lang/eu.umd.prod.js +1 -1
  56. package/dist/lang/fa-IR.umd.prod.js +1 -1
  57. package/dist/lang/fa.umd.prod.js +1 -1
  58. package/dist/lang/fi.umd.prod.js +1 -1
  59. package/dist/lang/fr.umd.prod.js +1 -1
  60. package/dist/lang/gn.umd.prod.js +1 -1
  61. package/dist/lang/he.umd.prod.js +1 -1
  62. package/dist/lang/hr.umd.prod.js +1 -1
  63. package/dist/lang/hu.umd.prod.js +1 -1
  64. package/dist/lang/id.umd.prod.js +1 -1
  65. package/dist/lang/is.umd.prod.js +1 -1
  66. package/dist/lang/it.umd.prod.js +1 -1
  67. package/dist/lang/ja.umd.prod.js +1 -1
  68. package/dist/lang/kk.umd.prod.js +1 -1
  69. package/dist/lang/km.umd.prod.js +1 -1
  70. package/dist/lang/ko-KR.umd.prod.js +1 -1
  71. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  72. package/dist/lang/lt.umd.prod.js +1 -1
  73. package/dist/lang/lu.umd.prod.js +1 -1
  74. package/dist/lang/lv.umd.prod.js +1 -1
  75. package/dist/lang/ml.umd.prod.js +1 -1
  76. package/dist/lang/mm.umd.prod.js +1 -1
  77. package/dist/lang/ms.umd.prod.js +1 -1
  78. package/dist/lang/my.umd.prod.js +1 -1
  79. package/dist/lang/nb-NO.umd.prod.js +1 -1
  80. package/dist/lang/nl.umd.prod.js +1 -1
  81. package/dist/lang/pl.umd.prod.js +1 -1
  82. package/dist/lang/pt-BR.umd.prod.js +1 -1
  83. package/dist/lang/pt.umd.prod.js +1 -1
  84. package/dist/lang/ro.umd.prod.js +1 -1
  85. package/dist/lang/ru.umd.prod.js +1 -1
  86. package/dist/lang/sk.umd.prod.js +1 -1
  87. package/dist/lang/sl.umd.prod.js +1 -1
  88. package/dist/lang/sm.umd.prod.js +1 -1
  89. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  90. package/dist/lang/sr.umd.prod.js +1 -1
  91. package/dist/lang/sv.umd.prod.js +1 -1
  92. package/dist/lang/ta.umd.prod.js +1 -1
  93. package/dist/lang/th.umd.prod.js +1 -1
  94. package/dist/lang/tr.umd.prod.js +1 -1
  95. package/dist/lang/ug.umd.prod.js +1 -1
  96. package/dist/lang/uk.umd.prod.js +1 -1
  97. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  98. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  99. package/dist/lang/vi.umd.prod.js +1 -1
  100. package/dist/lang/zh-CN.umd.prod.js +1 -1
  101. package/dist/lang/zh-TW.umd.prod.js +1 -1
  102. package/dist/quasar.cjs.prod.js +2 -2
  103. package/dist/quasar.css +4 -0
  104. package/dist/quasar.esm.js +386 -179
  105. package/dist/quasar.esm.prod.js +2 -2
  106. package/dist/quasar.prod.css +1 -1
  107. package/dist/quasar.rtl.css +4 -0
  108. package/dist/quasar.rtl.prod.css +1 -1
  109. package/dist/quasar.sass +3 -1
  110. package/dist/quasar.umd.js +386 -179
  111. package/dist/quasar.umd.prod.js +2 -2
  112. package/dist/web-types/web-types.json +1 -1
  113. package/package.json +8 -8
  114. package/src/components/ajax-bar/QAjaxBar.js +13 -5
  115. package/src/components/btn/QBtn.js +3 -2
  116. package/src/components/carousel/QCarousel.js +17 -10
  117. package/src/components/checkbox/use-checkbox.js +2 -0
  118. package/src/components/dialog/QDialog.js +8 -4
  119. package/src/components/drawer/QDrawer.js +8 -3
  120. package/src/components/img/QImg.js +25 -11
  121. package/src/components/input/QInput.js +14 -4
  122. package/src/components/layout/QLayout.js +5 -5
  123. package/src/components/menu/QMenu.js +1 -1
  124. package/src/components/pull-to-refresh/QPullToRefresh.js +5 -4
  125. package/src/components/radio/QRadio.js +2 -0
  126. package/src/components/resize-observer/QResizeObserver.js +9 -4
  127. package/src/components/scroll-area/QScrollArea.js +8 -8
  128. package/src/components/select/QSelect.js +19 -8
  129. package/src/components/slide-item/QSlideItem.js +4 -2
  130. package/src/components/slide-transition/QSlideTransition.js +17 -3
  131. package/src/components/tabs/QTabs.js +12 -5
  132. package/src/components/tooltip/QTooltip.js +1 -1
  133. package/src/composables/private/use-anchor.js +8 -3
  134. package/src/composables/private/use-field.js +10 -4
  135. package/src/composables/private/use-portal.js +3 -3
  136. package/src/composables/private/use-timeout.js +6 -3
  137. package/src/css/core/visibility.sass +2 -0
  138. package/src/directives/TouchHold.js +9 -4
  139. package/src/directives/TouchRepeat.js +10 -3
  140. package/src/lang.js +17 -11
  141. package/src/plugins/Loading.js +5 -5
  142. package/src/plugins/Meta.js +4 -2
  143. package/src/plugins/Notify.js +13 -3
  144. package/src/utils/debounce.js +9 -6
  145. package/src/utils/morph.js +7 -6
  146. package/src/utils/prevent-scroll.js +5 -6
  147. package/src/utils/private/click-outside.js +10 -3
  148. package/src/utils/private/global-dialog.js +1 -1
  149. package/src/utils/private/global-nodes.js +44 -13
  150. package/src/utils/private/position-engine.js +67 -25
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quasar Framework v2.11.2
2
+ * Quasar Framework v2.11.4
3
3
  * (c) 2015-present Razvan Stoenescu
4
4
  * Released under the MIT License.
5
5
  */
@@ -555,27 +555,30 @@ var event = {
555
555
  };
556
556
 
557
557
  function debounce (fn, wait = 250, immediate) {
558
- let timeout;
558
+ let timer = null;
559
559
 
560
560
  function debounced (/* ...args */) {
561
561
  const args = arguments;
562
562
 
563
563
  const later = () => {
564
- timeout = void 0;
564
+ timer = null;
565
565
  if (immediate !== true) {
566
566
  fn.apply(this, args);
567
567
  }
568
568
  };
569
569
 
570
- clearTimeout(timeout);
571
- if (immediate === true && timeout === void 0) {
570
+ if (timer !== null) {
571
+ clearTimeout(timer);
572
+ }
573
+ else if (immediate === true) {
572
574
  fn.apply(this, args);
573
575
  }
574
- timeout = setTimeout(later, wait);
576
+
577
+ timer = setTimeout(later, wait);
575
578
  }
576
579
 
577
580
  debounced.cancel = () => {
578
- clearTimeout(timeout);
581
+ timer !== null && clearTimeout(timer);
579
582
  };
580
583
 
581
584
  return debounced
@@ -1069,12 +1072,14 @@ const Plugin$8 = defineReactivePlugin({
1069
1072
  };
1070
1073
 
1071
1074
  {
1072
- const el = document.documentElement;
1073
- el.setAttribute('dir', lang.rtl === true ? 'rtl' : 'ltr');
1074
- el.setAttribute('lang', lang.isoName);
1075
-
1076
1075
  lang.set = Plugin$8.set;
1077
1076
 
1077
+ if (Plugin$8.__langConfig === void 0 || Plugin$8.__langConfig.noHtmlAttrs !== true) {
1078
+ const el = document.documentElement;
1079
+ el.setAttribute('dir', lang.rtl === true ? 'rtl' : 'ltr');
1080
+ el.setAttribute('lang', lang.isoName);
1081
+ }
1082
+
1078
1083
  Object.assign(Plugin$8.__langPack, lang);
1079
1084
 
1080
1085
  Plugin$8.props = lang;
@@ -1086,6 +1091,7 @@ const Plugin$8 = defineReactivePlugin({
1086
1091
  install ({ $q, lang, ssrContext }) {
1087
1092
  {
1088
1093
  $q.lang = Plugin$8.__langPack;
1094
+ Plugin$8.__langConfig = $q.config.lang;
1089
1095
 
1090
1096
  if (this.__installed === true) {
1091
1097
  lang !== void 0 && this.set(lang);
@@ -1640,7 +1646,7 @@ function prepareApp (app, uiOpts, pluginOpts) {
1640
1646
  }
1641
1647
 
1642
1648
  var installQuasar = function (parentApp, opts = {}) {
1643
- const $q = { version: '2.11.2' };
1649
+ const $q = { version: '2.11.4' };
1644
1650
 
1645
1651
  if (globalConfigIsFrozen === false) {
1646
1652
  if (opts.config !== void 0) {
@@ -1839,7 +1845,7 @@ var QAjaxBar = createComponent({
1839
1845
  const onScreen = ref(false);
1840
1846
  const animate = ref(true);
1841
1847
 
1842
- let sessions = 0, timer, speed;
1848
+ let sessions = 0, timer = null, speed;
1843
1849
 
1844
1850
  const classes = computed(() =>
1845
1851
  `q-loading-bar q-loading-bar--${ props.position }`
@@ -1891,19 +1897,21 @@ var QAjaxBar = createComponent({
1891
1897
  if (oldSpeed === 0 && newSpeed > 0) {
1892
1898
  planNextStep();
1893
1899
  }
1894
- else if (oldSpeed > 0 && newSpeed <= 0) {
1900
+ else if (timer !== null && oldSpeed > 0 && newSpeed <= 0) {
1895
1901
  clearTimeout(timer);
1902
+ timer = null;
1896
1903
  }
1897
1904
 
1898
1905
  return sessions
1899
1906
  }
1900
1907
 
1901
- clearTimeout(timer);
1908
+ timer !== null && clearTimeout(timer);
1902
1909
  emit('start');
1903
1910
 
1904
1911
  progress.value = 0;
1905
1912
 
1906
1913
  timer = setTimeout(() => {
1914
+ timer = null;
1907
1915
  animate.value = true;
1908
1916
  newSpeed > 0 && planNextStep();
1909
1917
  }, onScreen.value === true ? 500 : 1);
@@ -1930,13 +1938,18 @@ var QAjaxBar = createComponent({
1930
1938
  return sessions
1931
1939
  }
1932
1940
 
1933
- clearTimeout(timer);
1941
+ if (timer !== null) {
1942
+ clearTimeout(timer);
1943
+ timer = null;
1944
+ }
1945
+
1934
1946
  emit('stop');
1935
1947
 
1936
1948
  const end = () => {
1937
1949
  animate.value = true;
1938
1950
  progress.value = 100;
1939
1951
  timer = setTimeout(() => {
1952
+ timer = null;
1940
1953
  onScreen.value = false;
1941
1954
  }, 1000);
1942
1955
  };
@@ -1954,6 +1967,7 @@ var QAjaxBar = createComponent({
1954
1967
  function planNextStep () {
1955
1968
  if (progress.value < 100) {
1956
1969
  timer = setTimeout(() => {
1970
+ timer = null;
1957
1971
  increment();
1958
1972
  planNextStep();
1959
1973
  }, speed);
@@ -1974,7 +1988,7 @@ var QAjaxBar = createComponent({
1974
1988
  });
1975
1989
 
1976
1990
  onBeforeUnmount(() => {
1977
- clearTimeout(timer);
1991
+ timer !== null && clearTimeout(timer);
1978
1992
  hijacked === true && restoreAjax(start);
1979
1993
  });
1980
1994
 
@@ -3578,7 +3592,7 @@ var QBtn = createComponent({
3578
3592
  const rootRef = ref(null);
3579
3593
  const blurTargetRef = ref(null);
3580
3594
 
3581
- let localTouchTargetEl = null, avoidMouseRipple, mouseTimer;
3595
+ let localTouchTargetEl = null, avoidMouseRipple, mouseTimer = null;
3582
3596
 
3583
3597
  const hasLabel = computed(() =>
3584
3598
  props.label !== void 0 && props.label !== null && props.label !== ''
@@ -3724,8 +3738,9 @@ var QBtn = createComponent({
3724
3738
  // avoid duplicated mousedown event
3725
3739
  // triggering another early ripple
3726
3740
  avoidMouseRipple = true;
3727
- clearTimeout(mouseTimer);
3741
+ mouseTimer !== null && clearTimeout(mouseTimer);
3728
3742
  mouseTimer = setTimeout(() => {
3743
+ mouseTimer = null;
3729
3744
  avoidMouseRipple = false;
3730
3745
  }, 200);
3731
3746
  }
@@ -3971,7 +3986,7 @@ function useAnchor ({
3971
3986
 
3972
3987
  const anchorEl = ref(null);
3973
3988
 
3974
- let touchTimer;
3989
+ let touchTimer = null;
3975
3990
 
3976
3991
  function canShow (evt) {
3977
3992
  // abort with no parent configured or on multi-touch
@@ -4030,6 +4045,7 @@ function useAnchor ({
4030
4045
  ]);
4031
4046
 
4032
4047
  touchTimer = setTimeout(() => {
4048
+ touchTimer = null;
4033
4049
  proxy.show(evt);
4034
4050
  evt.qAnchorHandled = true;
4035
4051
  }, 300);
@@ -4037,7 +4053,11 @@ function useAnchor ({
4037
4053
 
4038
4054
  mobileCleanup (evt) {
4039
4055
  anchorEl.value.classList.remove('non-selectable');
4040
- clearTimeout(touchTimer);
4056
+
4057
+ if (touchTimer !== null) {
4058
+ clearTimeout(touchTimer);
4059
+ touchTimer = null;
4060
+ }
4041
4061
 
4042
4062
  if (showing.value === true && evt !== void 0) {
4043
4063
  clearSelection();
@@ -4151,7 +4171,7 @@ function useAnchor ({
4151
4171
  });
4152
4172
 
4153
4173
  onBeforeUnmount(() => {
4154
- clearTimeout(touchTimer);
4174
+ touchTimer !== null && clearTimeout(touchTimer);
4155
4175
  unconfigureAnchorEl();
4156
4176
  });
4157
4177
 
@@ -4392,15 +4412,18 @@ function removeFocusFn (fn) {
4392
4412
  queue = queue.filter(entry => entry !== fn);
4393
4413
  }
4394
4414
 
4395
- const globalNodes = [];
4415
+ const nodesList = [];
4416
+ const portalTypeList = [];
4417
+
4418
+ let portalIndex = 1;
4396
4419
  let target = document.body;
4397
4420
 
4398
- function createGlobalNode (id) {
4421
+ function createGlobalNode (id, portalType) {
4399
4422
  const el = document.createElement('div');
4400
4423
 
4401
- if (id !== void 0) {
4402
- el.id = id;
4403
- }
4424
+ el.id = portalType !== void 0
4425
+ ? `q-portal--${ portalType }--${ portalIndex++ }`
4426
+ : id;
4404
4427
 
4405
4428
  if (globalConfig.globalNodes !== void 0) {
4406
4429
  const cls = globalConfig.globalNodes.class;
@@ -4410,25 +4433,53 @@ function createGlobalNode (id) {
4410
4433
  }
4411
4434
 
4412
4435
  target.appendChild(el);
4413
- globalNodes.push(el);
4436
+ nodesList.push(el);
4437
+ portalTypeList.push(portalType);
4414
4438
 
4415
4439
  return el
4416
4440
  }
4417
4441
 
4418
4442
  function removeGlobalNode (el) {
4419
- globalNodes.splice(globalNodes.indexOf(el), 1);
4443
+ const nodeIndex = nodesList.indexOf(el);
4444
+
4445
+ nodesList.splice(nodeIndex, 1);
4446
+ portalTypeList.splice(nodeIndex, 1);
4447
+
4420
4448
  el.remove();
4421
4449
  }
4422
4450
 
4423
- function changeGlobalNodesTarget (el) {
4424
- if (el !== target) {
4425
- target = el;
4451
+ function changeGlobalNodesTarget (newTarget) {
4452
+ if (newTarget === target) {
4453
+ return
4454
+ }
4455
+
4456
+ target = newTarget;
4426
4457
 
4427
- globalNodes.forEach(el => {
4428
- if (el.contains(target) === false) {
4429
- target.appendChild(el);
4458
+ if (
4459
+ target === document.body
4460
+ // or we have less than 2 dialogs:
4461
+ || portalTypeList.reduce((acc, type) => (type === 'dialog' ? acc + 1 : acc), 0) < 2
4462
+ ) {
4463
+ nodesList.forEach(node => {
4464
+ if (node.contains(target) === false) {
4465
+ target.appendChild(node);
4430
4466
  }
4431
4467
  });
4468
+
4469
+ return
4470
+ }
4471
+
4472
+ const lastDialogIndex = portalTypeList.lastIndexOf('dialog');
4473
+
4474
+ for (let i = 0; i < nodesList.length; i++) {
4475
+ const el = nodesList[ i ];
4476
+
4477
+ if (
4478
+ (i === lastDialogIndex || portalTypeList[ i ] !== 'dialog')
4479
+ && el.contains(target) === false
4480
+ ) {
4481
+ target.appendChild(el);
4482
+ }
4432
4483
  }
4433
4484
  }
4434
4485
 
@@ -4507,7 +4558,7 @@ function isOnGlobalDialog (vm) {
4507
4558
  // Warning!
4508
4559
  // You MUST specify "inheritAttrs: false" in your component
4509
4560
 
4510
- function usePortal (vm, innerRef, renderPortalContent, checkGlobalDialog) {
4561
+ function usePortal (vm, innerRef, renderPortalContent, type) {
4511
4562
  // showing, including while in show/hide transition
4512
4563
  const portalIsActive = ref(false);
4513
4564
 
@@ -4516,7 +4567,7 @@ function usePortal (vm, innerRef, renderPortalContent, checkGlobalDialog) {
4516
4567
 
4517
4568
  let portalEl = null;
4518
4569
  const focusObj = {};
4519
- const onGlobalDialog = checkGlobalDialog === true && isOnGlobalDialog(vm);
4570
+ const onGlobalDialog = type === 'dialog' && isOnGlobalDialog(vm);
4520
4571
 
4521
4572
  function showPortal (isReady) {
4522
4573
  if (isReady === true) {
@@ -4529,7 +4580,7 @@ function usePortal (vm, innerRef, renderPortalContent, checkGlobalDialog) {
4529
4580
 
4530
4581
  if (portalIsActive.value === false) {
4531
4582
  if (onGlobalDialog === false && portalEl === null) {
4532
- portalEl = createGlobalNode();
4583
+ portalEl = createGlobalNode(false, type);
4533
4584
  }
4534
4585
 
4535
4586
  portalIsActive.value = true;
@@ -4670,11 +4721,14 @@ function useTick () {
4670
4721
  */
4671
4722
 
4672
4723
  function useTimeout () {
4673
- let timer;
4724
+ let timer = null;
4674
4725
  const vm = getCurrentInstance();
4675
4726
 
4676
4727
  function removeTimeout () {
4677
- clearTimeout(timer);
4728
+ if (timer !== null) {
4729
+ clearTimeout(timer);
4730
+ timer = null;
4731
+ }
4678
4732
  }
4679
4733
 
4680
4734
  onDeactivated(removeTimeout);
@@ -4684,7 +4738,7 @@ function useTimeout () {
4684
4738
  removeTimeout,
4685
4739
 
4686
4740
  registerTimeout (fn, delay) {
4687
- clearTimeout(timer);
4741
+ removeTimeout();
4688
4742
 
4689
4743
  if (vmIsDestroyed(vm) === false) {
4690
4744
  timer = setTimeout(fn, delay);
@@ -4966,14 +5020,11 @@ function removeFocusout (fn) {
4966
5020
  }
4967
5021
  }
4968
5022
 
4969
- let timer;
4970
-
4971
5023
  const
4972
5024
  { notPassiveCapture } = listenOpts,
4973
5025
  registeredList = [];
4974
5026
 
4975
5027
  function globalHandler (evt) {
4976
- clearTimeout(timer);
4977
5028
 
4978
5029
  const target = evt.target;
4979
5030
 
@@ -5046,7 +5097,7 @@ function removeClickOutside (clickOutsideProps) {
5046
5097
  registeredList.splice(index, 1);
5047
5098
 
5048
5099
  if (registeredList.length === 0) {
5049
- clearTimeout(timer);
5100
+
5050
5101
  document.removeEventListener('mousedown', globalHandler, notPassiveCapture);
5051
5102
  document.removeEventListener('touchstart', globalHandler, notPassiveCapture);
5052
5103
  }
@@ -5114,17 +5165,32 @@ function getAnchorProps (el, offset) {
5114
5165
  }
5115
5166
 
5116
5167
  return {
5117
- top,
5118
- left,
5119
- right,
5120
- bottom,
5121
- width,
5122
- height,
5168
+ top, bottom, height,
5169
+ left, right, width,
5123
5170
  middle: left + (right - left) / 2,
5124
5171
  center: top + (bottom - top) / 2
5125
5172
  }
5126
5173
  }
5127
5174
 
5175
+ function getAbsoluteAnchorProps (el, absoluteOffset, offset) {
5176
+ let { top, left } = el.getBoundingClientRect();
5177
+
5178
+ top += absoluteOffset.top;
5179
+ left += absoluteOffset.left;
5180
+
5181
+ if (offset !== void 0) {
5182
+ top += offset[ 1 ];
5183
+ left += offset[ 0 ];
5184
+ }
5185
+
5186
+ return {
5187
+ top, bottom: top + 1, height: 1,
5188
+ left, right: left + 1, width: 1,
5189
+ middle: left,
5190
+ center: top
5191
+ }
5192
+ }
5193
+
5128
5194
  function getTargetProps (el) {
5129
5195
  return {
5130
5196
  top: 0,
@@ -5136,6 +5202,13 @@ function getTargetProps (el) {
5136
5202
  }
5137
5203
  }
5138
5204
 
5205
+ function getTopLeftProps (anchorProps, targetProps, cfg) {
5206
+ return {
5207
+ top: anchorProps[ cfg.anchorOrigin.vertical ] - targetProps[ cfg.selfOrigin.vertical ],
5208
+ left: anchorProps[ cfg.anchorOrigin.horizontal ] - targetProps[ cfg.selfOrigin.horizontal ]
5209
+ }
5210
+ }
5211
+
5139
5212
  // cfg: { el, anchorEl, anchorOrigin, selfOrigin, offset, absoluteOffset, cover, fit, maxHeight, maxWidth }
5140
5213
  function setPosition (cfg) {
5141
5214
  if (client.is.ios === true && window.visualViewport !== void 0) {
@@ -5154,25 +5227,15 @@ function setPosition (cfg) {
5154
5227
  }
5155
5228
  }
5156
5229
 
5157
- let anchorProps;
5158
-
5159
5230
  // scroll position might change
5160
5231
  // if max-height/-width changes, so we
5161
5232
  // need to restore it after we calculate
5162
5233
  // the new positioning
5163
5234
  const { scrollLeft, scrollTop } = cfg.el;
5164
5235
 
5165
- if (cfg.absoluteOffset === void 0) {
5166
- anchorProps = getAnchorProps(cfg.anchorEl, cfg.cover === true ? [ 0, 0 ] : cfg.offset);
5167
- }
5168
- else {
5169
- const
5170
- { top: anchorTop, left: anchorLeft } = cfg.anchorEl.getBoundingClientRect(),
5171
- top = anchorTop + cfg.absoluteOffset.top,
5172
- left = anchorLeft + cfg.absoluteOffset.left;
5173
-
5174
- anchorProps = { top, left, width: 1, height: 1, right: left + 1, center: top, middle: left, bottom: top + 1 };
5175
- }
5236
+ const anchorProps = cfg.absoluteOffset === void 0
5237
+ ? getAnchorProps(cfg.anchorEl, cfg.cover === true ? [ 0, 0 ] : cfg.offset)
5238
+ : getAbsoluteAnchorProps(cfg.anchorEl, cfg.absoluteOffset, cfg.offset);
5176
5239
 
5177
5240
  let elStyle = {
5178
5241
  maxHeight: cfg.maxHeight,
@@ -5189,14 +5252,44 @@ function setPosition (cfg) {
5189
5252
 
5190
5253
  Object.assign(cfg.el.style, elStyle);
5191
5254
 
5192
- const
5193
- targetProps = getTargetProps(cfg.el),
5194
- props = {
5195
- top: anchorProps[ cfg.anchorOrigin.vertical ] - targetProps[ cfg.selfOrigin.vertical ],
5196
- left: anchorProps[ cfg.anchorOrigin.horizontal ] - targetProps[ cfg.selfOrigin.horizontal ]
5197
- };
5255
+ const targetProps = getTargetProps(cfg.el);
5256
+ let props = getTopLeftProps(anchorProps, targetProps, cfg);
5257
+
5258
+ if (cfg.absoluteOffset === void 0 || cfg.offset === void 0) {
5259
+ applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin);
5260
+ }
5261
+ else { // we have touch position or context menu with offset
5262
+ const { top, left } = props; // cache initial values
5198
5263
 
5199
- applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin);
5264
+ // apply initial boundaries
5265
+ applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin);
5266
+
5267
+ let hasChanged = false;
5268
+
5269
+ // did it flip vertically?
5270
+ if (props.top !== top) {
5271
+ hasChanged = true;
5272
+ const offsetY = 2 * cfg.offset[ 1 ];
5273
+ anchorProps.center = anchorProps.top -= offsetY;
5274
+ anchorProps.bottom -= offsetY + 2;
5275
+ }
5276
+
5277
+ // did it flip horizontally?
5278
+ if (props.left !== left) {
5279
+ hasChanged = true;
5280
+ const offsetX = 2 * cfg.offset[ 0 ];
5281
+ anchorProps.middle = anchorProps.left -= offsetX;
5282
+ anchorProps.right -= offsetX + 2;
5283
+ }
5284
+
5285
+ if (hasChanged === true) {
5286
+ // re-calculate props with the new anchor
5287
+ props = getTopLeftProps(anchorProps, targetProps, cfg);
5288
+
5289
+ // and re-apply boundaries
5290
+ applyBoundaries(props, anchorProps, targetProps, cfg.anchorOrigin, cfg.selfOrigin);
5291
+ }
5292
+ }
5200
5293
 
5201
5294
  elStyle = {
5202
5295
  top: props.top + 'px',
@@ -5377,7 +5470,7 @@ var QMenu = createComponent({
5377
5470
  processOnMount: true
5378
5471
  });
5379
5472
 
5380
- const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent);
5473
+ const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent, 'menu');
5381
5474
 
5382
5475
  const clickOutsideProps = {
5383
5476
  anchorEl,
@@ -6994,7 +7087,7 @@ var QCarousel = createComponent({
6994
7087
 
6995
7088
  const isDark = useDark(props, $q);
6996
7089
 
6997
- let timer, panelsLen;
7090
+ let timer = null, panelsLen;
6998
7091
 
6999
7092
  const {
7000
7093
  updatePanelsList, getPanelContent,
@@ -7048,7 +7141,6 @@ var QCarousel = createComponent({
7048
7141
 
7049
7142
  watch(() => props.modelValue, () => {
7050
7143
  if (props.autoplay) {
7051
- clearInterval(timer);
7052
7144
  startTimer();
7053
7145
  }
7054
7146
  });
@@ -7057,20 +7149,28 @@ var QCarousel = createComponent({
7057
7149
  if (val) {
7058
7150
  startTimer();
7059
7151
  }
7060
- else {
7061
- clearInterval(timer);
7152
+ else if (timer !== null) {
7153
+ clearTimeout(timer);
7154
+ timer = null;
7062
7155
  }
7063
7156
  });
7064
7157
 
7065
7158
  function startTimer () {
7066
7159
  const duration = isNumber(props.autoplay) === true
7067
- ? props.autoplay
7160
+ ? Math.abs(props.autoplay)
7068
7161
  : 5000;
7069
7162
 
7070
- timer = setTimeout(
7071
- duration >= 0 ? nextPanel : previousPanel,
7072
- Math.abs(duration)
7073
- );
7163
+ timer !== null && clearTimeout(timer);
7164
+ timer = setTimeout(() => {
7165
+ timer = null;
7166
+
7167
+ if (duration >= 0) {
7168
+ nextPanel();
7169
+ }
7170
+ else {
7171
+ previousPanel();
7172
+ }
7173
+ }, duration);
7074
7174
  }
7075
7175
 
7076
7176
  onMounted(() => {
@@ -7078,7 +7178,7 @@ var QCarousel = createComponent({
7078
7178
  });
7079
7179
 
7080
7180
  onBeforeUnmount(() => {
7081
- clearInterval(timer);
7181
+ timer !== null && clearTimeout(timer);
7082
7182
  });
7083
7183
 
7084
7184
  function getNavigationContainer (type, mapping) {
@@ -7559,6 +7659,8 @@ function useCheckbox (type, getInner) {
7559
7659
  const prop = { type: 'checkbox' };
7560
7660
 
7561
7661
  props.name !== void 0 && Object.assign(prop, {
7662
+ // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
7663
+ '.checked': isTrue.value,
7562
7664
  '^checked': isTrue.value === true ? 'checked' : void 0,
7563
7665
  name: props.name,
7564
7666
  value: modelIsArray.value === true
@@ -9394,8 +9496,10 @@ var QResizeObserver = createComponent({
9394
9496
  }
9395
9497
 
9396
9498
  function emitEvent () {
9397
- clearTimeout(timer);
9398
- timer = null;
9499
+ if (timer !== null) {
9500
+ clearTimeout(timer);
9501
+ timer = null;
9502
+ }
9399
9503
 
9400
9504
  if (targetEl) {
9401
9505
  const { offsetWidth: width, offsetHeight: height } = targetEl;
@@ -9429,7 +9533,7 @@ var QResizeObserver = createComponent({
9429
9533
  onMounted(() => { init(); });
9430
9534
 
9431
9535
  onBeforeUnmount(() => {
9432
- clearTimeout(timer);
9536
+ timer !== null && clearTimeout(timer);
9433
9537
 
9434
9538
  if (observer !== void 0) {
9435
9539
  if (observer.disconnect !== void 0) {
@@ -9449,7 +9553,10 @@ var QResizeObserver = createComponent({
9449
9553
  let curDocView;
9450
9554
 
9451
9555
  function cleanup () {
9452
- clearTimeout(timer);
9556
+ if (timer !== null) {
9557
+ clearTimeout(timer);
9558
+ timer = null;
9559
+ }
9453
9560
 
9454
9561
  if (curDocView !== void 0) {
9455
9562
  // iOS is fuzzy, need to check it first
@@ -9602,7 +9709,7 @@ var QTabs = createComponent({
9602
9709
  const tabDataListLen = ref(0);
9603
9710
  const hasFocus = ref(false);
9604
9711
 
9605
- let animateTimer, scrollTimer, unwatchRoute;
9712
+ let animateTimer = null, scrollTimer = null, unwatchRoute;
9606
9713
 
9607
9714
  const tabProps = computed(() => ({
9608
9715
  activeClass: props.activeClass,
@@ -9738,7 +9845,10 @@ var QTabs = createComponent({
9738
9845
  oldEl = oldTab.tabIndicatorRef.value,
9739
9846
  newEl = newTab.tabIndicatorRef.value;
9740
9847
 
9741
- clearTimeout(animateTimer);
9848
+ if (animateTimer !== null) {
9849
+ clearTimeout(animateTimer);
9850
+ animateTimer = null;
9851
+ }
9742
9852
 
9743
9853
  oldEl.style.transition = 'none';
9744
9854
  oldEl.style.transform = 'none';
@@ -9756,6 +9866,7 @@ var QTabs = createComponent({
9756
9866
  // allow scope updates to kick in (QRouteTab needs more time)
9757
9867
  registerAnimateTick(() => {
9758
9868
  animateTimer = setTimeout(() => {
9869
+ animateTimer = null;
9759
9870
  newEl.style.transition = 'transform .25s cubic-bezier(.4, 0, .2, 1)';
9760
9871
  newEl.style.transform = 'none';
9761
9872
  }, 70);
@@ -9808,7 +9919,7 @@ var QTabs = createComponent({
9808
9919
  }
9809
9920
 
9810
9921
  function animScrollTo (value) {
9811
- stopAnimScroll();
9922
+ scrollTimer !== null && clearInterval(scrollTimer);
9812
9923
  scrollTimer = setInterval(() => {
9813
9924
  if (scrollTowards(value) === true) {
9814
9925
  stopAnimScroll();
@@ -9825,7 +9936,10 @@ var QTabs = createComponent({
9825
9936
  }
9826
9937
 
9827
9938
  function stopAnimScroll () {
9828
- clearInterval(scrollTimer);
9939
+ if (scrollTimer !== null) {
9940
+ clearInterval(scrollTimer);
9941
+ scrollTimer = null;
9942
+ }
9829
9943
  }
9830
9944
 
9831
9945
  function onKbdNavigate (keyCode, fromEl) {
@@ -10129,7 +10243,7 @@ var QTabs = createComponent({
10129
10243
  provide(tabsKey, $tabs);
10130
10244
 
10131
10245
  function cleanup () {
10132
- clearTimeout(animateTimer);
10246
+ animateTimer !== null && clearTimeout(animateTimer);
10133
10247
  stopAnimScroll();
10134
10248
  unwatchRoute !== void 0 && unwatchRoute();
10135
10249
  }
@@ -14521,7 +14635,7 @@ let
14521
14635
  vpPendingUpdate = false,
14522
14636
  bodyLeft,
14523
14637
  bodyTop,
14524
- closeTimer;
14638
+ closeTimer = null;
14525
14639
 
14526
14640
  function onWheel (e) {
14527
14641
  if (shouldPreventScroll(e)) {
@@ -14668,9 +14782,9 @@ function preventScroll (state) {
14668
14782
  if (state === true) {
14669
14783
  registered++;
14670
14784
 
14671
- if (closeTimer !== void 0) {
14785
+ if (closeTimer !== null) {
14672
14786
  clearTimeout(closeTimer);
14673
- closeTimer = void 0;
14787
+ closeTimer = null;
14674
14788
  return
14675
14789
  }
14676
14790
 
@@ -14692,11 +14806,10 @@ function preventScroll (state) {
14692
14806
  action = 'remove';
14693
14807
 
14694
14808
  if (client.is.ios === true && client.is.nativeMobile === true) {
14695
- clearTimeout(closeTimer);
14696
-
14809
+ closeTimer !== null && clearTimeout(closeTimer);
14697
14810
  closeTimer = setTimeout(() => {
14698
14811
  apply$1(action);
14699
- closeTimer = void 0;
14812
+ closeTimer = null;
14700
14813
  }, 100);
14701
14814
  return
14702
14815
  }
@@ -14790,7 +14903,7 @@ var QDialog = createComponent({
14790
14903
  const showing = ref(false);
14791
14904
  const animating = ref(false);
14792
14905
 
14793
- let shakeTimeout, refocusTarget = null, isMaximized, avoidAutoClose;
14906
+ let shakeTimeout = null, refocusTarget = null, isMaximized, avoidAutoClose;
14794
14907
 
14795
14908
  const hideOnRouteChange = computed(() =>
14796
14909
  props.persistent !== true
@@ -14809,7 +14922,7 @@ var QDialog = createComponent({
14809
14922
  );
14810
14923
 
14811
14924
  const { showPortal, hidePortal, portalIsAccessible, renderPortal } = usePortal(
14812
- vm, innerRef, renderPortalContent, /* pls do check if on a global dialog */ true
14925
+ vm, innerRef, renderPortalContent, 'dialog'
14813
14926
  );
14814
14927
 
14815
14928
  const { hide } = useModelToggle({
@@ -14972,8 +15085,9 @@ var QDialog = createComponent({
14972
15085
  if (node !== null) {
14973
15086
  node.classList.remove('q-animate--scale');
14974
15087
  node.classList.add('q-animate--scale');
14975
- clearTimeout(shakeTimeout);
15088
+ shakeTimeout !== null && clearTimeout(shakeTimeout);
14976
15089
  shakeTimeout = setTimeout(() => {
15090
+ shakeTimeout = null;
14977
15091
  if (innerRef.value !== null) {
14978
15092
  node.classList.remove('q-animate--scale');
14979
15093
  // some platforms (like desktop Chrome)
@@ -14997,7 +15111,10 @@ var QDialog = createComponent({
14997
15111
  }
14998
15112
 
14999
15113
  function cleanup (hiding) {
15000
- clearTimeout(shakeTimeout);
15114
+ if (shakeTimeout !== null) {
15115
+ clearTimeout(shakeTimeout);
15116
+ shakeTimeout = null;
15117
+ }
15001
15118
 
15002
15119
  if (hiding === true || showing.value === true) {
15003
15120
  updateMaximized(false);
@@ -15188,7 +15305,7 @@ var QDrawer = createComponent({
15188
15305
  return emptyRenderFn
15189
15306
  }
15190
15307
 
15191
- let lastDesktopState, timerMini, layoutTotalWidthWatcher;
15308
+ let lastDesktopState, timerMini = null, layoutTotalWidthWatcher;
15192
15309
 
15193
15310
  const belowBreakpoint = ref(
15194
15311
  props.behavior === 'mobile'
@@ -15563,7 +15680,7 @@ var QDrawer = createComponent({
15563
15680
  }
15564
15681
 
15565
15682
  function animateMini () {
15566
- clearTimeout(timerMini);
15683
+ timerMini !== null && clearTimeout(timerMini);
15567
15684
 
15568
15685
  if (vm.proxy && vm.proxy.$el) {
15569
15686
  // need to speed it up and apply it immediately,
@@ -15573,6 +15690,7 @@ var QDrawer = createComponent({
15573
15690
 
15574
15691
  flagMiniAnimate.value = true;
15575
15692
  timerMini = setTimeout(() => {
15693
+ timerMini = null;
15576
15694
  flagMiniAnimate.value = false;
15577
15695
  if (vm && vm.proxy && vm.proxy.$el) {
15578
15696
  vm.proxy.$el.classList.remove('q-drawer--mini-animate');
@@ -15725,7 +15843,11 @@ var QDrawer = createComponent({
15725
15843
 
15726
15844
  onBeforeUnmount(() => {
15727
15845
  layoutTotalWidthWatcher !== void 0 && layoutTotalWidthWatcher();
15728
- clearTimeout(timerMini);
15846
+
15847
+ if (timerMini !== null) {
15848
+ clearTimeout(timerMini);
15849
+ timerMini = null;
15850
+ }
15729
15851
 
15730
15852
  showing.value === true && cleanup();
15731
15853
 
@@ -16260,7 +16382,7 @@ var QTooltip = createComponent({
16260
16382
 
16261
16383
  Object.assign(anchorEvents, { delayShow, delayHide });
16262
16384
 
16263
- const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent);
16385
+ const { showPortal, hidePortal, renderPortal } = usePortal(vm, innerRef, renderPortalContent, 'tooltip');
16264
16386
 
16265
16387
  // if we're on mobile, let's improve the experience
16266
16388
  // by closing it when user taps outside of it
@@ -17595,15 +17717,23 @@ var QSlideTransition = createComponent({
17595
17717
 
17596
17718
  setup (props, { slots, emit }) {
17597
17719
  let animating = false, doneFn, element;
17598
- let timer, timerFallback, animListener, lastEvent;
17720
+ let timer = null, timerFallback = null, animListener, lastEvent;
17599
17721
 
17600
17722
  function cleanup () {
17601
17723
  doneFn && doneFn();
17602
17724
  doneFn = null;
17603
17725
  animating = false;
17604
17726
 
17605
- clearTimeout(timer);
17606
- clearTimeout(timerFallback);
17727
+ if (timer !== null) {
17728
+ clearTimeout(timer);
17729
+ timer = null;
17730
+ }
17731
+
17732
+ if (timerFallback !== null) {
17733
+ clearTimeout(timerFallback);
17734
+ timerFallback = null;
17735
+ }
17736
+
17607
17737
  element !== void 0 && element.removeEventListener('transitionend', animListener);
17608
17738
  animListener = null;
17609
17739
  }
@@ -17642,8 +17772,11 @@ var QSlideTransition = createComponent({
17642
17772
  begin(el, pos, done);
17643
17773
 
17644
17774
  timer = setTimeout(() => {
17775
+ timer = null;
17645
17776
  el.style.height = `${ el.scrollHeight }px`;
17646
17777
  animListener = evt => {
17778
+ timerFallback = null;
17779
+
17647
17780
  if (Object(evt) !== evt || evt.target === el) {
17648
17781
  end(el, 'show');
17649
17782
  }
@@ -17668,8 +17801,11 @@ var QSlideTransition = createComponent({
17668
17801
  begin(el, pos, done);
17669
17802
 
17670
17803
  timer = setTimeout(() => {
17804
+ timer = null;
17671
17805
  el.style.height = 0;
17672
17806
  animListener = evt => {
17807
+ timerFallback = null;
17808
+
17673
17809
  if (Object(evt) !== evt || evt.target === el) {
17674
17810
  end(el, 'hide');
17675
17811
  }
@@ -18805,7 +18941,7 @@ function useField (state) {
18805
18941
  const { props, emit, slots, attrs, proxy } = getCurrentInstance();
18806
18942
  const { $q } = proxy;
18807
18943
 
18808
- let focusoutTimer;
18944
+ let focusoutTimer = null;
18809
18945
 
18810
18946
  if (state.hasValue === void 0) {
18811
18947
  state.hasValue = computed(() => fieldValueIsFilled(props.modelValue));
@@ -18971,7 +19107,11 @@ function useField (state) {
18971
19107
  }
18972
19108
 
18973
19109
  function onControlFocusin (e) {
18974
- clearTimeout(focusoutTimer);
19110
+ if (focusoutTimer !== null) {
19111
+ clearTimeout(focusoutTimer);
19112
+ focusoutTimer = null;
19113
+ }
19114
+
18975
19115
  if (state.editable.value === true && state.focused.value === false) {
18976
19116
  state.focused.value = true;
18977
19117
  emit('focus', e);
@@ -18979,8 +19119,10 @@ function useField (state) {
18979
19119
  }
18980
19120
 
18981
19121
  function onControlFocusout (e, then) {
18982
- clearTimeout(focusoutTimer);
19122
+ focusoutTimer !== null && clearTimeout(focusoutTimer);
18983
19123
  focusoutTimer = setTimeout(() => {
19124
+ focusoutTimer = null;
19125
+
18984
19126
  if (
18985
19127
  document.hasFocus() === true && (
18986
19128
  state.hasPopupOpen === true
@@ -19230,7 +19372,7 @@ function useField (state) {
19230
19372
  });
19231
19373
 
19232
19374
  onBeforeUnmount(() => {
19233
- clearTimeout(focusoutTimer);
19375
+ focusoutTimer !== null && clearTimeout(focusoutTimer);
19234
19376
  });
19235
19377
 
19236
19378
  // expose public methods
@@ -20533,7 +20675,7 @@ var QImg = createComponent({
20533
20675
  const naturalRatio = ref(props.initialRatio);
20534
20676
  const ratioStyle = useRatio(props, naturalRatio);
20535
20677
 
20536
- let loadTimer;
20678
+ let loadTimer = null, isDestroyed = false;
20537
20679
 
20538
20680
  const images = [
20539
20681
  ref(null),
@@ -20584,7 +20726,11 @@ var QImg = createComponent({
20584
20726
  }
20585
20727
 
20586
20728
  function addImage (imgProps) {
20587
- clearTimeout(loadTimer);
20729
+ if (loadTimer !== null) {
20730
+ clearTimeout(loadTimer);
20731
+ loadTimer = null;
20732
+ }
20733
+
20588
20734
  hasError.value = false;
20589
20735
 
20590
20736
  if (imgProps === null) {
@@ -20599,10 +20745,12 @@ var QImg = createComponent({
20599
20745
  }
20600
20746
 
20601
20747
  function onLoad ({ target }) {
20602
- // if component has been already destroyed
20603
- if (loadTimer === null) { return }
20748
+ if (isDestroyed === true) { return }
20604
20749
 
20605
- clearTimeout(loadTimer);
20750
+ if (loadTimer !== null) {
20751
+ clearTimeout(loadTimer);
20752
+ loadTimer = null;
20753
+ }
20606
20754
 
20607
20755
  naturalRatio.value = target.naturalHeight === 0
20608
20756
  ? 0.5
@@ -20613,21 +20761,21 @@ var QImg = createComponent({
20613
20761
 
20614
20762
  function waitForCompleteness (target, count) {
20615
20763
  // protect against running forever
20616
- if (loadTimer === null || count === 1000) { return }
20764
+ if (isDestroyed === true || count === 1000) { return }
20617
20765
 
20618
20766
  if (target.complete === true) {
20619
20767
  onReady(target);
20620
20768
  }
20621
20769
  else {
20622
20770
  loadTimer = setTimeout(() => {
20771
+ loadTimer = null;
20623
20772
  waitForCompleteness(target, count + 1);
20624
20773
  }, 50);
20625
20774
  }
20626
20775
  }
20627
20776
 
20628
20777
  function onReady (img) {
20629
- // if component has been already destroyed
20630
- if (loadTimer === null) { return }
20778
+ if (isDestroyed === true) { return }
20631
20779
 
20632
20780
  position.value = position.value ^ 1;
20633
20781
  images[ position.value ].value = null;
@@ -20637,7 +20785,11 @@ var QImg = createComponent({
20637
20785
  }
20638
20786
 
20639
20787
  function onError (err) {
20640
- clearTimeout(loadTimer);
20788
+ if (loadTimer !== null) {
20789
+ clearTimeout(loadTimer);
20790
+ loadTimer = null;
20791
+ }
20792
+
20641
20793
  isLoading.value = false;
20642
20794
  hasError.value = true;
20643
20795
  images[ position.value ].value = null;
@@ -20717,8 +20869,12 @@ var QImg = createComponent({
20717
20869
  }
20718
20870
 
20719
20871
  onBeforeUnmount(() => {
20720
- clearTimeout(loadTimer);
20721
- loadTimer = null;
20872
+ isDestroyed = true;
20873
+
20874
+ if (loadTimer !== null) {
20875
+ clearTimeout(loadTimer);
20876
+ loadTimer = null;
20877
+ }
20722
20878
  });
20723
20879
  }
20724
20880
 
@@ -21662,7 +21818,7 @@ var QInput = createComponent({
21662
21818
  const { $q } = proxy;
21663
21819
 
21664
21820
  const temp = {};
21665
- let emitCachedValue = NaN, typedNumber, stopValueWatcher, emitTimer, emitValueFn;
21821
+ let emitCachedValue = NaN, typedNumber, stopValueWatcher, emitTimer = null, emitValueFn;
21666
21822
 
21667
21823
  const inputRef = ref(null);
21668
21824
  const nameProp = useFormInputNameAttr(props);
@@ -21874,6 +22030,8 @@ var QInput = createComponent({
21874
22030
 
21875
22031
  function emitValue (val, stopWatcher) {
21876
22032
  emitValueFn = () => {
22033
+ emitTimer = null;
22034
+
21877
22035
  if (
21878
22036
  props.type !== 'number'
21879
22037
  && temp.hasOwnProperty('value') === true
@@ -21901,7 +22059,7 @@ var QInput = createComponent({
21901
22059
  }
21902
22060
 
21903
22061
  if (props.debounce !== void 0) {
21904
- clearTimeout(emitTimer);
22062
+ emitTimer !== null && clearTimeout(emitTimer);
21905
22063
  temp.value = val;
21906
22064
  emitTimer = setTimeout(emitValueFn, props.debounce);
21907
22065
  }
@@ -21935,7 +22093,11 @@ var QInput = createComponent({
21935
22093
  function onChange (e) {
21936
22094
  onComposition(e);
21937
22095
 
21938
- clearTimeout(emitTimer);
22096
+ if (emitTimer !== null) {
22097
+ clearTimeout(emitTimer);
22098
+ emitTimer = null;
22099
+ }
22100
+
21939
22101
  emitValueFn !== void 0 && emitValueFn();
21940
22102
 
21941
22103
  emit('change', e.target.value);
@@ -21944,7 +22106,11 @@ var QInput = createComponent({
21944
22106
  function onFinishEditing (e) {
21945
22107
  e !== void 0 && stop(e);
21946
22108
 
21947
- clearTimeout(emitTimer);
22109
+ if (emitTimer !== null) {
22110
+ clearTimeout(emitTimer);
22111
+ emitTimer = null;
22112
+ }
22113
+
21948
22114
  emitValueFn !== void 0 && emitValueFn();
21949
22115
 
21950
22116
  typedNumber = false;
@@ -22788,7 +22954,7 @@ var QLayout = createComponent({
22788
22954
  }
22789
22955
  }
22790
22956
 
22791
- let timer;
22957
+ let animateTimer = null;
22792
22958
 
22793
22959
  const $layout = {
22794
22960
  instances: {},
@@ -22819,16 +22985,16 @@ var QLayout = createComponent({
22819
22985
  scroll,
22820
22986
 
22821
22987
  animate () {
22822
- if (timer !== void 0) {
22823
- clearTimeout(timer);
22988
+ if (animateTimer !== null) {
22989
+ clearTimeout(animateTimer);
22824
22990
  }
22825
22991
  else {
22826
22992
  document.body.classList.add('q-body--layout-animate');
22827
22993
  }
22828
22994
 
22829
- timer = setTimeout(() => {
22995
+ animateTimer = setTimeout(() => {
22996
+ animateTimer = null;
22830
22997
  document.body.classList.remove('q-body--layout-animate');
22831
- timer = void 0;
22832
22998
  }, 155);
22833
22999
  },
22834
23000
 
@@ -23097,6 +23263,8 @@ var QRadio = createComponent({
23097
23263
  const prop = { type: 'radio' };
23098
23264
 
23099
23265
  props.name !== void 0 && Object.assign(prop, {
23266
+ // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
23267
+ '.checked': isTrue.value === true,
23100
23268
  '^checked': isTrue.value === true ? 'checked' : void 0,
23101
23269
  name: props.name,
23102
23270
  value: props.val
@@ -24894,6 +25062,8 @@ var QPullToRefresh = createComponent({
24894
25062
  });
24895
25063
  }
24896
25064
 
25065
+ let $el, localScrollTarget, timer = null;
25066
+
24897
25067
  function animateTo ({ pos, ratio }, done) {
24898
25068
  animating.value = true;
24899
25069
  pullPosition.value = pos;
@@ -24902,15 +25072,14 @@ var QPullToRefresh = createComponent({
24902
25072
  pullRatio.value = ratio;
24903
25073
  }
24904
25074
 
24905
- clearTimeout(timer);
25075
+ timer !== null && clearTimeout(timer);
24906
25076
  timer = setTimeout(() => {
25077
+ timer = null;
24907
25078
  animating.value = false;
24908
25079
  done && done();
24909
25080
  }, 300);
24910
25081
  }
24911
25082
 
24912
- let $el, localScrollTarget, timer;
24913
-
24914
25083
  function updateScrollTarget () {
24915
25084
  localScrollTarget = getScrollTarget($el, props.scrollTarget);
24916
25085
  }
@@ -24923,7 +25092,7 @@ var QPullToRefresh = createComponent({
24923
25092
  });
24924
25093
 
24925
25094
  onBeforeUnmount(() => {
24926
- clearTimeout(timer);
25095
+ timer !== null && clearTimeout(timer);
24927
25096
  });
24928
25097
 
24929
25098
  // expose public methods
@@ -25712,7 +25881,7 @@ var QScrollArea = createComponent({
25712
25881
 
25713
25882
  const isDark = useDark(props, proxy.$q);
25714
25883
 
25715
- let timer, panRefPos;
25884
+ let timer = null, panRefPos;
25716
25885
 
25717
25886
  const targetRef = ref(null);
25718
25887
 
@@ -25961,14 +26130,14 @@ var QScrollArea = createComponent({
25961
26130
  }
25962
26131
 
25963
26132
  function startTimer () {
25964
- if (tempShowing.value === true) {
25965
- clearTimeout(timer);
25966
- }
25967
- else {
25968
- tempShowing.value = true;
25969
- }
26133
+ tempShowing.value = true;
26134
+
26135
+ timer !== null && clearTimeout(timer);
26136
+ timer = setTimeout(() => {
26137
+ timer = null;
26138
+ tempShowing.value = false;
26139
+ }, props.delay);
25970
26140
 
25971
- timer = setTimeout(() => { tempShowing.value = false; }, props.delay);
25972
26141
  props.onScroll !== void 0 && emitScroll();
25973
26142
  }
25974
26143
 
@@ -26970,8 +27139,8 @@ var QSelect = createComponent({
26970
27139
  const dialogFieldFocused = ref(false);
26971
27140
  const innerLoadingIndicator = ref(false);
26972
27141
 
26973
- let inputTimer, innerValueCache,
26974
- hasDialog, userInputValue, filterId, defaultInputValue,
27142
+ let inputTimer = null, innerValueCache,
27143
+ hasDialog, userInputValue, filterId = null, defaultInputValue,
26975
27144
  transitionShowComputed, searchBuffer, searchBufferExp;
26976
27145
 
26977
27146
  const inputRef = ref(null);
@@ -27477,7 +27646,12 @@ var QSelect = createComponent({
27477
27646
  }
27478
27647
 
27479
27648
  e.target.value = '';
27480
- clearTimeout(inputTimer);
27649
+
27650
+ if (inputTimer !== null) {
27651
+ clearTimeout(inputTimer);
27652
+ inputTimer = null;
27653
+ }
27654
+
27481
27655
  resetInputValue();
27482
27656
 
27483
27657
  if (typeof value === 'string' && value.length > 0) {
@@ -27842,7 +28016,10 @@ var QSelect = createComponent({
27842
28016
  }
27843
28017
 
27844
28018
  function onInput (e) {
27845
- clearTimeout(inputTimer);
28019
+ if (inputTimer !== null) {
28020
+ clearTimeout(inputTimer);
28021
+ inputTimer = null;
28022
+ }
27846
28023
 
27847
28024
  if (e && e.target && e.target.qComposing === true) {
27848
28025
  return
@@ -27863,6 +28040,7 @@ var QSelect = createComponent({
27863
28040
 
27864
28041
  if (props.onFilter !== void 0) {
27865
28042
  inputTimer = setTimeout(() => {
28043
+ inputTimer = null;
27866
28044
  filter(inputValue.value);
27867
28045
  }, props.inputDebounce);
27868
28046
  }
@@ -27916,7 +28094,7 @@ var QSelect = createComponent({
27916
28094
  menu.value === true && (menu.value = false);
27917
28095
  }, 10);
27918
28096
 
27919
- clearTimeout(filterId);
28097
+ filterId !== null && clearTimeout(filterId);
27920
28098
  filterId = localFilterId;
27921
28099
 
27922
28100
  emit(
@@ -28108,8 +28286,10 @@ var QSelect = createComponent({
28108
28286
  }
28109
28287
 
28110
28288
  if (state.focused.value === false) {
28111
- clearTimeout(filterId);
28112
- filterId = void 0;
28289
+ if (filterId !== null) {
28290
+ clearTimeout(filterId);
28291
+ filterId = null;
28292
+ }
28113
28293
 
28114
28294
  if (state.innerLoading.value === true) {
28115
28295
  emit('filterAbort');
@@ -28230,7 +28410,7 @@ var QSelect = createComponent({
28230
28410
  updatePreState();
28231
28411
 
28232
28412
  onBeforeUnmount(() => {
28233
- clearTimeout(inputTimer);
28413
+ inputTimer !== null && clearTimeout(inputTimer);
28234
28414
  });
28235
28415
 
28236
28416
  // expose public methods
@@ -28490,7 +28670,7 @@ var QSlideItem = createComponent({
28490
28670
 
28491
28671
  const contentRef = ref(null);
28492
28672
 
28493
- let timer, pan = {}, dirRefs = {}, dirContentRefs = {};
28673
+ let timer = null, pan = {}, dirRefs = {}, dirContentRefs = {};
28494
28674
 
28495
28675
  const langDir = computed(() => (
28496
28676
  $q.lang.rtl === true
@@ -28541,7 +28721,9 @@ var QSlideItem = createComponent({
28541
28721
  if (pan.scale === 1) {
28542
28722
  node.style.transform = `translate${ pan.axis }(${ pan.dir * 100 }%)`;
28543
28723
 
28724
+ timer !== null && clearTimeout(timer);
28544
28725
  timer = setTimeout(() => {
28726
+ timer = null;
28545
28727
  emit(pan.showing, { reset });
28546
28728
  emit('action', { side: pan.showing, reset });
28547
28729
  }, 230);
@@ -28612,7 +28794,7 @@ var QSlideItem = createComponent({
28612
28794
  });
28613
28795
 
28614
28796
  onBeforeUnmount(() => {
28615
- clearTimeout(timer);
28797
+ timer !== null && clearTimeout(timer);
28616
28798
  });
28617
28799
 
28618
28800
  // expose public methods
@@ -36847,12 +37029,11 @@ function morph (_options) {
36847
37029
  : (
36848
37030
  options.waitFor === 'transitionend'
36849
37031
  ? new Promise(resolve => {
36850
- const timer = setTimeout(() => {
36851
- endFn();
36852
- }, 400);
36853
-
36854
- const endFn = ev => {
36855
- clearTimeout(timer);
37032
+ const endFn = () => {
37033
+ if (timer !== null) {
37034
+ clearTimeout(timer);
37035
+ timer = null;
37036
+ }
36856
37037
 
36857
37038
  if (elTo) {
36858
37039
  elTo.removeEventListener('transitionend', endFn);
@@ -36862,6 +37043,8 @@ function morph (_options) {
36862
37043
  resolve();
36863
37044
  };
36864
37045
 
37046
+ let timer = setTimeout(endFn, 400);
37047
+
36865
37048
  elTo.addEventListener('transitionend', endFn);
36866
37049
  elTo.addEventListener('transitioncancel', endFn);
36867
37050
  })
@@ -37330,6 +37513,7 @@ var TouchHold = createDirective({
37330
37513
  : ctx.touchSensitivity;
37331
37514
 
37332
37515
  ctx.timer = setTimeout(() => {
37516
+ ctx.timer = void 0;
37333
37517
  clearSelection();
37334
37518
  ctx.triggered = true;
37335
37519
 
@@ -37346,10 +37530,13 @@ var TouchHold = createDirective({
37346
37530
  move (evt) {
37347
37531
  const { top, left } = position(evt);
37348
37532
  if (
37349
- Math.abs(left - ctx.origin.left) >= ctx.sensitivity
37350
- || Math.abs(top - ctx.origin.top) >= ctx.sensitivity
37533
+ ctx.timer !== void 0 && (
37534
+ Math.abs(left - ctx.origin.left) >= ctx.sensitivity
37535
+ || Math.abs(top - ctx.origin.top) >= ctx.sensitivity
37536
+ )
37351
37537
  ) {
37352
37538
  clearTimeout(ctx.timer);
37539
+ ctx.timer = void 0;
37353
37540
  }
37354
37541
  },
37355
37542
 
@@ -37362,8 +37549,9 @@ var TouchHold = createDirective({
37362
37549
  if (ctx.triggered === true) {
37363
37550
  evt !== void 0 && stopAndPrevent(evt);
37364
37551
  }
37365
- else {
37552
+ else if (ctx.timer !== void 0) {
37366
37553
  clearTimeout(ctx.timer);
37554
+ ctx.timer = void 0;
37367
37555
  }
37368
37556
  }
37369
37557
  };
@@ -37415,7 +37603,7 @@ var TouchHold = createDirective({
37415
37603
  cleanEvt(ctx, 'main');
37416
37604
  cleanEvt(ctx, 'temp');
37417
37605
 
37418
- clearTimeout(ctx.timer);
37606
+ ctx.timer !== void 0 && clearTimeout(ctx.timer);
37419
37607
  ctx.styleCleanup !== void 0 && ctx.styleCleanup();
37420
37608
 
37421
37609
  delete el.__qtouchhold;
@@ -37554,6 +37742,8 @@ var TouchRepeat = createDirective({
37554
37742
  };
37555
37743
 
37556
37744
  const fn = () => {
37745
+ ctx.timer = void 0;
37746
+
37557
37747
  if (ctx.event === void 0) {
37558
37748
  return
37559
37749
  }
@@ -37597,8 +37787,9 @@ var TouchRepeat = createDirective({
37597
37787
  },
37598
37788
 
37599
37789
  move (evt) {
37600
- if (ctx.event !== void 0 && shouldEnd(evt, ctx.origin) === true) {
37790
+ if (ctx.event !== void 0 && ctx.timer !== void 0 && shouldEnd(evt, ctx.origin) === true) {
37601
37791
  clearTimeout(ctx.timer);
37792
+ ctx.timer = void 0;
37602
37793
  }
37603
37794
  },
37604
37795
 
@@ -37611,7 +37802,11 @@ var TouchRepeat = createDirective({
37611
37802
  evt !== void 0 && ctx.event.repeatCount > 0 && stopAndPrevent(evt);
37612
37803
 
37613
37804
  cleanEvt(ctx, 'temp');
37614
- clearTimeout(ctx.timer);
37805
+
37806
+ if (ctx.timer !== void 0) {
37807
+ clearTimeout(ctx.timer);
37808
+ ctx.timer = void 0;
37809
+ }
37615
37810
 
37616
37811
  ctx.event = void 0;
37617
37812
  }
@@ -37660,7 +37855,7 @@ var TouchRepeat = createDirective({
37660
37855
  const ctx = el.__qtouchrepeat;
37661
37856
 
37662
37857
  if (ctx !== void 0) {
37663
- clearTimeout(ctx.timer);
37858
+ ctx.timer !== void 0 && clearTimeout(ctx.timer);
37664
37859
 
37665
37860
  cleanEvt(ctx, 'main');
37666
37861
  cleanEvt(ctx, 'temp');
@@ -38109,7 +38304,7 @@ function globalDialog (DefaultComponent, supportsCustomComponent, parentApp) {
38109
38304
 
38110
38305
  let vm, emittedOK = false;
38111
38306
  const dialogRef = ref(null);
38112
- const el = createGlobalNode();
38307
+ const el = createGlobalNode(false, 'dialog');
38113
38308
 
38114
38309
  const applyState = cmd => {
38115
38310
  if (dialogRef.value !== null && dialogRef.value[ cmd ] !== void 0) {
@@ -38817,7 +39012,7 @@ let
38817
39012
  app,
38818
39013
  vm,
38819
39014
  uid$1 = 0,
38820
- timeout,
39015
+ timeout = null,
38821
39016
  props = {},
38822
39017
  activeGroups = {};
38823
39018
 
@@ -38866,10 +39061,10 @@ const Plugin$2 = defineReactivePlugin({
38866
39061
  }
38867
39062
  else {
38868
39063
  props.uid = ++uid$1;
38869
- clearTimeout(timeout);
39064
+ timeout !== null && clearTimeout(timeout);
38870
39065
 
38871
39066
  timeout = setTimeout(() => {
38872
- timeout = void 0;
39067
+ timeout = null;
38873
39068
 
38874
39069
  const el = createGlobalNode('q-loading');
38875
39070
 
@@ -38979,9 +39174,9 @@ const Plugin$2 = defineReactivePlugin({
38979
39174
  }
38980
39175
  }
38981
39176
 
38982
- if (timeout !== void 0) {
39177
+ if (timeout !== null) {
38983
39178
  clearTimeout(timeout);
38984
- timeout = void 0;
39179
+ timeout = null;
38985
39180
  }
38986
39181
 
38987
39182
  Plugin$2.isActive = false;
@@ -39003,7 +39198,7 @@ const Plugin$2 = defineReactivePlugin({
39003
39198
  }
39004
39199
  });
39005
39200
 
39006
- let updateId, currentClientMeta;
39201
+ let updateId = null, currentClientMeta;
39007
39202
  const clientList = [];
39008
39203
 
39009
39204
  function normalize (meta) {
@@ -39137,6 +39332,8 @@ function apply ({ add, remove }) {
39137
39332
  }
39138
39333
 
39139
39334
  function updateClientMeta () {
39335
+ updateId = null;
39336
+
39140
39337
  const data = {
39141
39338
  title: '',
39142
39339
  titleTemplate: null,
@@ -39162,7 +39359,7 @@ function updateClientMeta () {
39162
39359
  }
39163
39360
 
39164
39361
  function planClientUpdate () {
39165
- clearTimeout(updateId);
39362
+ updateId !== null && clearTimeout(updateId);
39166
39363
  updateId = setTimeout(updateClientMeta, 50);
39167
39364
  }
39168
39365
 
@@ -39389,7 +39586,10 @@ function addNotification (config, $q, originalApi) {
39389
39586
 
39390
39587
  if (originalApi !== void 0) {
39391
39588
  // reset timeout if any
39392
- clearTimeout(originalApi.notif.meta.timer);
39589
+ if (originalApi.notif.meta.timer) {
39590
+ clearTimeout(originalApi.notif.meta.timer);
39591
+ originalApi.notif.meta.timer = void 0;
39592
+ }
39393
39593
 
39394
39594
  // retain uid
39395
39595
  notif.meta.uid = originalApi.notif.meta.uid;
@@ -39425,7 +39625,10 @@ function addNotification (config, $q, originalApi) {
39425
39625
  // ok, so it's NOT a new one
39426
39626
  else {
39427
39627
  // reset timeout if any
39428
- clearTimeout(original.meta.timer);
39628
+ if (original.meta.timer) {
39629
+ clearTimeout(original.meta.timer);
39630
+ original.meta.timer = void 0;
39631
+ }
39429
39632
 
39430
39633
  if (notif.badgePosition !== void 0) {
39431
39634
  if (badgePositions.includes(notif.badgePosition) === false) {
@@ -39455,6 +39658,7 @@ function addNotification (config, $q, originalApi) {
39455
39658
 
39456
39659
  if (notif.timeout > 0) {
39457
39660
  notif.meta.timer = setTimeout(() => {
39661
+ notif.meta.timer = void 0;
39458
39662
  dismiss();
39459
39663
  }, notif.timeout + /* show duration */ 1000);
39460
39664
  }
@@ -39503,7 +39707,10 @@ function addNotification (config, $q, originalApi) {
39503
39707
  }
39504
39708
 
39505
39709
  function removeNotification (notif) {
39506
- clearTimeout(notif.meta.timer);
39710
+ if (notif.meta.timer) {
39711
+ clearTimeout(notif.meta.timer);
39712
+ notif.meta.timer = void 0;
39713
+ }
39507
39714
 
39508
39715
  const index = notificationsList[ notif.position ].value.indexOf(notif);
39509
39716
  if (index !== -1) {
@@ -40333,7 +40540,7 @@ function runSequentialPromises (
40333
40540
  */
40334
40541
 
40335
40542
  const Quasar = {
40336
- version: '2.11.2',
40543
+ version: '2.11.4',
40337
40544
  install: installQuasar,
40338
40545
  lang: Plugin$8,
40339
40546
  iconSet: Plugin$7