quasar 2.22.0 → 2.23.0
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.
- package/dist/api/Mutation.json +1 -1
- package/dist/api/QLinearProgress.json +1 -1
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v7-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v7.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v8.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +1 -1
- package/dist/lang/ar.umd.prod.js +1 -1
- package/dist/lang/az-Latn.umd.prod.js +1 -1
- package/dist/lang/bg.umd.prod.js +1 -1
- package/dist/lang/bn.umd.prod.js +1 -1
- package/dist/lang/bs-BA.umd.prod.js +1 -1
- package/dist/lang/ca.umd.prod.js +1 -1
- package/dist/lang/cs.umd.prod.js +1 -1
- package/dist/lang/da.umd.prod.js +1 -1
- package/dist/lang/de-CH.umd.prod.js +1 -1
- package/dist/lang/de-DE.umd.prod.js +1 -1
- package/dist/lang/de.umd.prod.js +1 -1
- package/dist/lang/el.umd.prod.js +1 -1
- package/dist/lang/en-GB.umd.prod.js +1 -1
- package/dist/lang/en-US.umd.prod.js +1 -1
- package/dist/lang/eo.umd.prod.js +1 -1
- package/dist/lang/es.umd.prod.js +1 -1
- package/dist/lang/et.umd.prod.js +1 -1
- package/dist/lang/eu.umd.prod.js +1 -1
- package/dist/lang/fa-IR.umd.prod.js +1 -1
- package/dist/lang/fa.umd.prod.js +1 -1
- package/dist/lang/fi.umd.prod.js +1 -1
- package/dist/lang/fr.umd.prod.js +1 -1
- package/dist/lang/gn.umd.prod.js +1 -1
- package/dist/lang/he.umd.prod.js +1 -1
- package/dist/lang/hi.umd.prod.js +1 -1
- package/dist/lang/hr.umd.prod.js +1 -1
- package/dist/lang/hu.umd.prod.js +1 -1
- package/dist/lang/id.umd.prod.js +1 -1
- package/dist/lang/is.umd.prod.js +1 -1
- package/dist/lang/it.umd.prod.js +1 -1
- package/dist/lang/ja.umd.prod.js +1 -1
- package/dist/lang/kk.umd.prod.js +1 -1
- package/dist/lang/km.umd.prod.js +1 -1
- package/dist/lang/ko-KR.umd.prod.js +1 -1
- package/dist/lang/kur-CKB.umd.prod.js +1 -1
- package/dist/lang/lb.umd.prod.js +1 -1
- package/dist/lang/lt.umd.prod.js +1 -1
- package/dist/lang/lu.umd.prod.js +1 -1
- package/dist/lang/lv.umd.prod.js +1 -1
- package/dist/lang/mk.umd.prod.js +1 -1
- package/dist/lang/ml.umd.prod.js +1 -1
- package/dist/lang/mm.umd.prod.js +1 -1
- package/dist/lang/ms-MY.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +1 -1
- package/dist/lang/nb-NO.umd.prod.js +1 -1
- package/dist/lang/nl.umd.prod.js +1 -1
- package/dist/lang/pl.umd.prod.js +1 -1
- package/dist/lang/pt-BR.umd.prod.js +1 -1
- package/dist/lang/pt.umd.prod.js +1 -1
- package/dist/lang/ro.umd.prod.js +1 -1
- package/dist/lang/ru.umd.prod.js +1 -1
- package/dist/lang/sk.umd.prod.js +1 -1
- package/dist/lang/sl.umd.prod.js +1 -1
- package/dist/lang/sm.umd.prod.js +1 -1
- package/dist/lang/sq.umd.prod.js +1 -1
- package/dist/lang/sr-CYR.umd.prod.js +1 -1
- package/dist/lang/sr.umd.prod.js +1 -1
- package/dist/lang/sv.umd.prod.js +1 -1
- package/dist/lang/ta.umd.prod.js +1 -1
- package/dist/lang/th.umd.prod.js +1 -1
- package/dist/lang/tl.umd.prod.js +1 -1
- package/dist/lang/tr.umd.prod.js +1 -1
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +1 -1
- package/dist/lang/ur-PK.umd.prod.js +1 -1
- package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
- package/dist/lang/uz-Latn.umd.prod.js +1 -1
- package/dist/lang/vi.umd.prod.js +1 -1
- package/dist/lang/zh-CN.umd.prod.js +1 -1
- package/dist/lang/zh-TW.umd.prod.js +1 -1
- package/dist/quasar.client.js +92 -30
- package/dist/quasar.css +16 -11
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +20 -20
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +18 -12
- package/dist/quasar.server.prod.cjs +4 -4
- package/dist/quasar.server.prod.js +4 -4
- package/dist/quasar.umd.js +92 -29
- package/dist/quasar.umd.prod.js +31 -31
- package/dist/transforms/import-map.json +1 -1
- package/dist/types/composables.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/web-types/web-types.json +1 -1
- package/package.json +1 -1
- package/src/components/btn/QBtn.js +1 -1
- package/src/components/fab/QFab.sass +11 -9
- package/src/components/linear-progress/QLinearProgress.js +4 -11
- package/src/components/linear-progress/QLinearProgress.json +1 -1
- package/src/components/linear-progress/QLinearProgress.sass +7 -2
- package/src/composables/private.use-fullscreen/use-fullscreen.js +72 -17
- package/src/composables/private.use-fullscreen/use-fullscreen.test.js +158 -0
- package/src/composables/use-animation-frame/use-animation-frame.js +47 -0
- package/src/composables/use-animation-frame/use-animation-frame.test.js +122 -0
- package/src/composables.js +1 -1
- package/src/directives/mutation/Mutation.json +1 -1
- package/src/utils/private.click-outside/click-outside.js +27 -12
- 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
|
+
})
|