quasar 2.16.9 → 2.16.10
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/BottomSheet.json +1 -1
- package/dist/api/Dialog.json +1 -1
- package/dist/api/QTable.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/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-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-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/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/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/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 +11 -14
- package/dist/quasar.sass +1 -1
- package/dist/quasar.server.prod.cjs +6 -6
- package/dist/quasar.server.prod.js +6 -6
- package/dist/quasar.umd.js +11 -14
- package/dist/quasar.umd.prod.js +11 -11
- package/dist/types/index.d.ts +3 -3
- package/dist/web-types/web-types.json +1 -1
- package/package.json +1 -1
- package/src/components/item/QList.js +7 -1
- package/src/components/item/QList.test.js +170 -0
- package/src/components/table/QTable.json +1 -1
- package/src/composables/private.use-key-composition/use-key-composition.js +2 -19
- package/src/plugins/dialog/Dialog.json +1 -1
- package/src/utils/private.dialog/create-dialog.json +1 -1
package/package.json
CHANGED
|
@@ -4,6 +4,8 @@ import { createComponent } from '../../utils/private.create/create.js'
|
|
|
4
4
|
import useDark, { useDarkProps } from '../../composables/private.use-dark/use-dark.js'
|
|
5
5
|
import { hSlot } from '../../utils/private.render/render.js'
|
|
6
6
|
|
|
7
|
+
const roleAttrExceptions = [ 'ul', 'ol' ]
|
|
8
|
+
|
|
7
9
|
export default createComponent({
|
|
8
10
|
name: 'QList',
|
|
9
11
|
|
|
@@ -25,6 +27,10 @@ export default createComponent({
|
|
|
25
27
|
const vm = getCurrentInstance()
|
|
26
28
|
const isDark = useDark(props, vm.proxy.$q)
|
|
27
29
|
|
|
30
|
+
const role = computed(() => (
|
|
31
|
+
roleAttrExceptions.includes(props.tag) ? null : 'list')
|
|
32
|
+
)
|
|
33
|
+
|
|
28
34
|
const classes = computed(() =>
|
|
29
35
|
'q-list'
|
|
30
36
|
+ (props.bordered === true ? ' q-list--bordered' : '')
|
|
@@ -34,6 +40,6 @@ export default createComponent({
|
|
|
34
40
|
+ (props.padding === true ? ' q-list--padding' : '')
|
|
35
41
|
)
|
|
36
42
|
|
|
37
|
-
return () => h(props.tag, { class: classes.value }, hSlot(slots.default))
|
|
43
|
+
return () => h(props.tag, { class: classes.value, role: role.value }, hSlot(slots.default))
|
|
38
44
|
}
|
|
39
45
|
})
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { mount, flushPromises } from '@vue/test-utils'
|
|
2
|
+
import { describe, test, expect } from 'vitest'
|
|
3
|
+
|
|
4
|
+
import QList from './QList.js'
|
|
5
|
+
|
|
6
|
+
describe('[QList API]', () => {
|
|
7
|
+
describe('[Props]', () => {
|
|
8
|
+
describe('[default attributes]', () => {
|
|
9
|
+
test('has a role="list" attribute with a div', async () => {
|
|
10
|
+
const wrapper = mount(QList)
|
|
11
|
+
|
|
12
|
+
const target = wrapper.get('.q-list')
|
|
13
|
+
|
|
14
|
+
expect(target.element.getAttribute('role')).toBe('list')
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('does not have a role="list" attribute with a ol', async () => {
|
|
18
|
+
const wrapper = mount(QList, { props: { tag: 'ol' } })
|
|
19
|
+
|
|
20
|
+
const target = wrapper.get('.q-list')
|
|
21
|
+
|
|
22
|
+
expect(target.element.getAttribute('role')).toBe(null)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('does not have a role="list" attribute with a ul', async () => {
|
|
26
|
+
const wrapper = mount(QList, { props: { tag: 'ul' } })
|
|
27
|
+
|
|
28
|
+
const target = wrapper.get('.q-list')
|
|
29
|
+
|
|
30
|
+
expect(target.element.getAttribute('role')).toBe(null)
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
describe('[(prop)bordered]', () => {
|
|
35
|
+
test('type Boolean has effect', async () => {
|
|
36
|
+
const wrapper = mount(QList)
|
|
37
|
+
|
|
38
|
+
const target = wrapper.get('.q-list')
|
|
39
|
+
|
|
40
|
+
expect(target.classes()).not.toContain('q-list--bordered')
|
|
41
|
+
|
|
42
|
+
await wrapper.setProps({ bordered: true })
|
|
43
|
+
await flushPromises()
|
|
44
|
+
|
|
45
|
+
expect(target.classes()).toContain('q-list--bordered')
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('[(prop)dense]', () => {
|
|
50
|
+
test('type Boolean has effect', async () => {
|
|
51
|
+
const wrapper = mount(QList)
|
|
52
|
+
|
|
53
|
+
const target = wrapper.get('.q-list')
|
|
54
|
+
|
|
55
|
+
expect(target.classes()).not.toContain('q-list--dense')
|
|
56
|
+
|
|
57
|
+
await wrapper.setProps({ dense: true })
|
|
58
|
+
await flushPromises()
|
|
59
|
+
|
|
60
|
+
expect(target.classes()).toContain('q-list--dense')
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe('[(prop)separator]', () => {
|
|
65
|
+
test('type Boolean has effect', async () => {
|
|
66
|
+
const wrapper = mount(QList)
|
|
67
|
+
|
|
68
|
+
const target = wrapper.get('.q-list')
|
|
69
|
+
|
|
70
|
+
expect(target.classes()).not.toContain('q-list--separator')
|
|
71
|
+
|
|
72
|
+
await wrapper.setProps({ separator: true })
|
|
73
|
+
await flushPromises()
|
|
74
|
+
|
|
75
|
+
expect(target.classes()).toContain('q-list--separator')
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
describe('[(prop)dark]', () => {
|
|
80
|
+
test('type Boolean has effect', async () => {
|
|
81
|
+
const wrapper = mount(QList)
|
|
82
|
+
await wrapper.setProps({ dark: false })
|
|
83
|
+
|
|
84
|
+
const target = wrapper.get('.q-list')
|
|
85
|
+
|
|
86
|
+
expect(target.classes()).not.toContain('q-list--dark')
|
|
87
|
+
|
|
88
|
+
await wrapper.setProps({ dark: true })
|
|
89
|
+
await flushPromises()
|
|
90
|
+
|
|
91
|
+
expect(target.classes()).toContain('q-list--dark')
|
|
92
|
+
|
|
93
|
+
await wrapper.setProps({ dark: false })
|
|
94
|
+
await wrapper.vm.$q.dark.set(true)
|
|
95
|
+
await flushPromises()
|
|
96
|
+
|
|
97
|
+
expect(target.classes()).not.toContain('q-list--dark')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test('type null has effect', async () => {
|
|
101
|
+
const wrapper = mount(QList)
|
|
102
|
+
await wrapper.vm.$q.dark.set(false)
|
|
103
|
+
|
|
104
|
+
const target = wrapper.get('.q-list')
|
|
105
|
+
expect(target.classes()).not.toContain('q-list--dark')
|
|
106
|
+
|
|
107
|
+
await wrapper.setProps({ dark: null })
|
|
108
|
+
await flushPromises()
|
|
109
|
+
|
|
110
|
+
expect(target.classes()).not.toContain('q-list--dark')
|
|
111
|
+
|
|
112
|
+
await wrapper.vm.$q.dark.set(true)
|
|
113
|
+
|
|
114
|
+
expect(target.classes()).toContain('q-list--dark')
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
describe('[(prop)padding]', () => {
|
|
119
|
+
test('type Boolean has effect', async () => {
|
|
120
|
+
const wrapper = mount(QList)
|
|
121
|
+
|
|
122
|
+
const target = wrapper.get('.q-list')
|
|
123
|
+
|
|
124
|
+
expect(target.classes()).not.toContain('q-list--padding')
|
|
125
|
+
|
|
126
|
+
await wrapper.setProps({ padding: true })
|
|
127
|
+
await flushPromises()
|
|
128
|
+
|
|
129
|
+
expect(target.classes()).toContain('q-list--padding')
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
describe('[(prop)tag]', () => {
|
|
134
|
+
test('type String has effect', async () => {
|
|
135
|
+
const wrapper = mount(QList, { props: { tag: 'ol' } })
|
|
136
|
+
|
|
137
|
+
const target = wrapper.get('.q-list')
|
|
138
|
+
|
|
139
|
+
expect(
|
|
140
|
+
target.element.tagName.toLowerCase()
|
|
141
|
+
).toBe('ol')
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
test('default tag is div', async () => {
|
|
145
|
+
const wrapper = mount(QList)
|
|
146
|
+
|
|
147
|
+
const target = wrapper.get('.q-list')
|
|
148
|
+
|
|
149
|
+
expect(
|
|
150
|
+
target.element.tagName.toLowerCase()
|
|
151
|
+
).toBe('div')
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
describe('[Slots]', () => {
|
|
157
|
+
describe('[(slot)default]', () => {
|
|
158
|
+
test('renders the content', () => {
|
|
159
|
+
const slotContent = 'some-slot-content'
|
|
160
|
+
const wrapper = mount(QList, {
|
|
161
|
+
slots: {
|
|
162
|
+
default: () => slotContent
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
expect(wrapper.html()).toContain(slotContent)
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
})
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { client } from '../../plugins/platform/Platform.js'
|
|
2
|
-
|
|
3
|
-
const isJapanese = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/
|
|
4
|
-
const isChinese = /[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u
|
|
5
|
-
const isKorean = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/
|
|
6
|
-
const isPlainText = /[a-z0-9_ -]$/i
|
|
7
|
-
|
|
8
1
|
export default function (onInput) {
|
|
9
2
|
return function onComposition (e) {
|
|
10
3
|
if (e.type === 'compositionend' || e.type === 'change') {
|
|
@@ -12,18 +5,8 @@ export default function (onInput) {
|
|
|
12
5
|
e.target.qComposing = false
|
|
13
6
|
onInput(e)
|
|
14
7
|
}
|
|
15
|
-
else if (
|
|
16
|
-
e.
|
|
17
|
-
&& e.target.qComposing !== true
|
|
18
|
-
&& typeof e.data === 'string'
|
|
19
|
-
) {
|
|
20
|
-
const isComposing = client.is.firefox === true
|
|
21
|
-
? isPlainText.test(e.data) === false
|
|
22
|
-
: isJapanese.test(e.data) === true || isChinese.test(e.data) === true || isKorean.test(e.data) === true
|
|
23
|
-
|
|
24
|
-
if (isComposing === true) {
|
|
25
|
-
e.target.qComposing = true
|
|
26
|
-
}
|
|
8
|
+
else if (e.type === 'compositionstart') {
|
|
9
|
+
e.target.qComposing = true
|
|
27
10
|
}
|
|
28
11
|
}
|
|
29
12
|
}
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
|
|
278
278
|
"componentProps": {
|
|
279
279
|
"type": "Object",
|
|
280
|
-
"desc": "User defined props which will be forwarded to underlying custom component if 'component' prop is used"
|
|
280
|
+
"desc": "User defined props which will be forwarded to underlying custom component if 'component' prop is used; May also include any built-in QDialog option such as 'persistent' or 'seamless'"
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
}
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"opts": {
|
|
119
119
|
"type": "Object",
|
|
120
120
|
"required": true,
|
|
121
|
-
"desc": "
|
|
121
|
+
"desc": "If using with 'component' prop then the props to update the current 'componentProps' (will be shallowly merged on top of the previous 'componentProps'); Otherwise the props to be shallowly merged with the previous create() param Object"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"returns": {
|