quasar 2.22.0 → 2.23.1

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 (146) hide show
  1. package/dist/api/Mutation.json +1 -1
  2. package/dist/api/QLinearProgress.json +1 -1
  3. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  4. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  5. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  6. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  9. package/dist/icon-set/fontawesome-v7-pro.umd.prod.js +1 -1
  10. package/dist/icon-set/fontawesome-v7.umd.prod.js +1 -1
  11. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  12. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  15. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  16. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  17. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  18. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  19. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  21. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  23. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  24. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-fontawesome-v7.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-ionicons-v7.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-ionicons-v8.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  40. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  44. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  45. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  46. package/dist/icon-set/themify.umd.prod.js +1 -1
  47. package/dist/lang/ar-TN.umd.prod.js +1 -1
  48. package/dist/lang/ar.umd.prod.js +1 -1
  49. package/dist/lang/az-Latn.umd.prod.js +1 -1
  50. package/dist/lang/bg.umd.prod.js +1 -1
  51. package/dist/lang/bn.umd.prod.js +1 -1
  52. package/dist/lang/bs-BA.umd.prod.js +1 -1
  53. package/dist/lang/ca.umd.prod.js +1 -1
  54. package/dist/lang/cs.umd.prod.js +1 -1
  55. package/dist/lang/da.umd.prod.js +1 -1
  56. package/dist/lang/de-CH.umd.prod.js +1 -1
  57. package/dist/lang/de-DE.umd.prod.js +1 -1
  58. package/dist/lang/de.umd.prod.js +1 -1
  59. package/dist/lang/el.umd.prod.js +1 -1
  60. package/dist/lang/en-GB.umd.prod.js +1 -1
  61. package/dist/lang/en-US.umd.prod.js +1 -1
  62. package/dist/lang/eo.umd.prod.js +1 -1
  63. package/dist/lang/es.umd.prod.js +1 -1
  64. package/dist/lang/et.umd.prod.js +1 -1
  65. package/dist/lang/eu.umd.prod.js +1 -1
  66. package/dist/lang/fa-IR.umd.prod.js +1 -1
  67. package/dist/lang/fa.umd.prod.js +1 -1
  68. package/dist/lang/fi.umd.prod.js +1 -1
  69. package/dist/lang/fr.umd.prod.js +1 -1
  70. package/dist/lang/gn.umd.prod.js +1 -1
  71. package/dist/lang/he.umd.prod.js +1 -1
  72. package/dist/lang/hi.umd.prod.js +1 -1
  73. package/dist/lang/hr.umd.prod.js +1 -1
  74. package/dist/lang/hu.umd.prod.js +1 -1
  75. package/dist/lang/id.umd.prod.js +1 -1
  76. package/dist/lang/is.umd.prod.js +1 -1
  77. package/dist/lang/it.umd.prod.js +1 -1
  78. package/dist/lang/ja.umd.prod.js +1 -1
  79. package/dist/lang/kk.umd.prod.js +1 -1
  80. package/dist/lang/km.umd.prod.js +1 -1
  81. package/dist/lang/ko-KR.umd.prod.js +1 -1
  82. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  83. package/dist/lang/lb.umd.prod.js +1 -1
  84. package/dist/lang/lt.umd.prod.js +1 -1
  85. package/dist/lang/lu.umd.prod.js +1 -1
  86. package/dist/lang/lv.umd.prod.js +1 -1
  87. package/dist/lang/mk.umd.prod.js +1 -1
  88. package/dist/lang/ml.umd.prod.js +1 -1
  89. package/dist/lang/mm.umd.prod.js +1 -1
  90. package/dist/lang/ms-MY.umd.prod.js +1 -1
  91. package/dist/lang/ms.umd.prod.js +1 -1
  92. package/dist/lang/my.umd.prod.js +1 -1
  93. package/dist/lang/nb-NO.umd.prod.js +1 -1
  94. package/dist/lang/nl.umd.prod.js +1 -1
  95. package/dist/lang/pl.umd.prod.js +1 -1
  96. package/dist/lang/pt-BR.umd.prod.js +1 -1
  97. package/dist/lang/pt.umd.prod.js +1 -1
  98. package/dist/lang/ro.umd.prod.js +1 -1
  99. package/dist/lang/ru.umd.prod.js +1 -1
  100. package/dist/lang/sk.umd.prod.js +1 -1
  101. package/dist/lang/sl.umd.prod.js +1 -1
  102. package/dist/lang/sm.umd.prod.js +1 -1
  103. package/dist/lang/sq.umd.prod.js +1 -1
  104. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  105. package/dist/lang/sr.umd.prod.js +1 -1
  106. package/dist/lang/sv.umd.prod.js +1 -1
  107. package/dist/lang/ta.umd.prod.js +1 -1
  108. package/dist/lang/th.umd.prod.js +1 -1
  109. package/dist/lang/tl.umd.prod.js +1 -1
  110. package/dist/lang/tr.umd.prod.js +1 -1
  111. package/dist/lang/ug.umd.prod.js +1 -1
  112. package/dist/lang/uk.umd.prod.js +1 -1
  113. package/dist/lang/ur-PK.umd.prod.js +1 -1
  114. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  115. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  116. package/dist/lang/vi.umd.prod.js +1 -1
  117. package/dist/lang/zh-CN.umd.prod.js +1 -1
  118. package/dist/lang/zh-TW.umd.prod.js +1 -1
  119. package/dist/quasar.client.js +92 -30
  120. package/dist/quasar.css +16 -11
  121. package/dist/quasar.prod.css +1 -1
  122. package/dist/quasar.rtl.css +20 -20
  123. package/dist/quasar.rtl.prod.css +1 -1
  124. package/dist/quasar.sass +18 -12
  125. package/dist/quasar.server.prod.cjs +4 -4
  126. package/dist/quasar.server.prod.js +4 -4
  127. package/dist/quasar.umd.js +92 -29
  128. package/dist/quasar.umd.prod.js +31 -31
  129. package/dist/transforms/import-map.json +1 -1
  130. package/dist/types/composables.d.ts +5 -0
  131. package/dist/types/index.d.ts +1 -1
  132. package/dist/web-types/web-types.json +1 -1
  133. package/package.json +1 -1
  134. package/src/components/btn/QBtn.js +1 -1
  135. package/src/components/fab/QFab.sass +11 -9
  136. package/src/components/linear-progress/QLinearProgress.js +4 -11
  137. package/src/components/linear-progress/QLinearProgress.json +1 -1
  138. package/src/components/linear-progress/QLinearProgress.sass +7 -2
  139. package/src/composables/private.use-fullscreen/use-fullscreen.js +72 -17
  140. package/src/composables/private.use-fullscreen/use-fullscreen.test.js +158 -0
  141. package/src/composables/use-animation-frame/use-animation-frame.js +47 -0
  142. package/src/composables/use-animation-frame/use-animation-frame.test.js +122 -0
  143. package/src/composables.js +1 -1
  144. package/src/directives/mutation/Mutation.json +1 -1
  145. package/src/utils/private.click-outside/click-outside.js +27 -12
  146. package/src/utils/private.click-outside/click-outside.test.js +132 -0
@@ -0,0 +1,132 @@
1
+ import { afterEach, describe, expect, test, vi } from 'vitest'
2
+
3
+ import { addClickOutside, removeClickOutside } from './click-outside.js'
4
+ import { portalProxyList } from '../private.portal/portal.js'
5
+
6
+ // Elements and clickOutside states created during a test, cleaned up after.
7
+ const createdEls = []
8
+ const registeredStates = []
9
+
10
+ function createEl() {
11
+ const el = document.createElement('div')
12
+ document.body.append(el)
13
+ createdEls.push(el)
14
+ return el
15
+ }
16
+
17
+ // Register a fake portal (QMenu / QDialog / QTooltip) in the shared
18
+ // portalProxyList, mimicking what usePortal.showPortal() does.
19
+ function pushPortal(name, { seamless = false } = {}) {
20
+ const contentEl = createEl()
21
+ portalProxyList.push({
22
+ contentEl,
23
+ $: { type: { name }, props: { seamless } }
24
+ })
25
+ return contentEl
26
+ }
27
+
28
+ // Register a closable popup (QMenu-like) both as a portal and as a
29
+ // clickOutside listener, returning its content element and the spy.
30
+ function pushMenu() {
31
+ const contentEl = pushPortal('QMenu')
32
+ const onClickOutside = vi.fn()
33
+ const state = {
34
+ anchorEl: { value: null },
35
+ innerRef: { value: contentEl },
36
+ onClickOutside
37
+ }
38
+ addClickOutside(state)
39
+ registeredStates.push(state)
40
+ return { contentEl, onClickOutside }
41
+ }
42
+
43
+ function mousedownOn(el) {
44
+ el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }))
45
+ }
46
+
47
+ afterEach(() => {
48
+ registeredStates.forEach(removeClickOutside)
49
+ registeredStates.length = 0
50
+ portalProxyList.length = 0
51
+ createdEls.forEach(el => el.remove())
52
+ createdEls.length = 0
53
+ vi.restoreAllMocks()
54
+ })
55
+
56
+ describe('[clickOutside API]', () => {
57
+ describe('[Functions]', () => {
58
+ describe('[(function)addClickOutside]', () => {
59
+ test('closes nested menus that have no dialog between them', () => {
60
+ // stack (open order): outer QMenu -> inner QMenu
61
+ const outer = pushMenu()
62
+ const inner = pushMenu()
63
+
64
+ // click somewhere outside both menus
65
+ mousedownOn(createEl())
66
+
67
+ expect(inner.onClickOutside).toHaveBeenCalledTimes(1)
68
+ expect(outer.onClickOutside).toHaveBeenCalledTimes(1)
69
+ })
70
+
71
+ test('does not close a menu shielded by a modal dialog (issue #18091)', () => {
72
+ // stack (open order): outer QMenu -> modal QDialog -> inner QMenu
73
+ const outer = pushMenu()
74
+ const dialogEl = pushPortal('QDialog', { seamless: false })
75
+ const inner = pushMenu()
76
+
77
+ // click inside the dialog, but outside the inner menu popup
78
+ mousedownOn(dialogEl)
79
+
80
+ // only the inner Select popup should close
81
+ expect(inner.onClickOutside).toHaveBeenCalledTimes(1)
82
+ // the outer Select popup stays open (shielded by the dialog backdrop)
83
+ expect(outer.onClickOutside).not.toHaveBeenCalled()
84
+ })
85
+
86
+ test('a seamless dialog is not a boundary (has no backdrop)', () => {
87
+ // stack (open order): outer QMenu -> seamless QDialog -> inner QMenu
88
+ const outer = pushMenu()
89
+ const dialogEl = pushPortal('QDialog', { seamless: true })
90
+ const inner = pushMenu()
91
+
92
+ // click inside the seamless dialog, outside the inner menu popup
93
+ mousedownOn(dialogEl)
94
+
95
+ // without a backdrop, both menus close as before
96
+ expect(inner.onClickOutside).toHaveBeenCalledTimes(1)
97
+ expect(outer.onClickOutside).toHaveBeenCalledTimes(1)
98
+ })
99
+
100
+ test('a modal dialog on top closes nothing beneath it', () => {
101
+ // stack (open order): outer QMenu -> modal QDialog (top-most)
102
+ const outer = pushMenu()
103
+ const dialogEl = pushPortal('QDialog', { seamless: false })
104
+
105
+ mousedownOn(dialogEl)
106
+
107
+ expect(outer.onClickOutside).not.toHaveBeenCalled()
108
+ })
109
+
110
+ test('a QTooltip above a modal dialog does not unshield an earlier menu', () => {
111
+ // stack (open order): outer QMenu -> modal QDialog -> QTooltip
112
+ // the QTooltip is skipped while scanning for the dialog boundary; that
113
+ // skip must not let the click reach the menu opened before the dialog
114
+ const outer = pushMenu()
115
+ const dialogEl = pushPortal('QDialog', { seamless: false })
116
+ pushPortal('QTooltip')
117
+
118
+ // click inside the dialog, outside every popup
119
+ mousedownOn(dialogEl)
120
+
121
+ expect(outer.onClickOutside).not.toHaveBeenCalled()
122
+ })
123
+ })
124
+
125
+ describe('[(function)removeClickOutside]', () => {
126
+ test('has correct return value', () => {
127
+ const result = removeClickOutside({})
128
+ expect(result).toBeUndefined()
129
+ })
130
+ })
131
+ })
132
+ })