quasar 2.4.8 → 2.4.12
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/LoadingBar.json +7 -0
- package/dist/api/Platform.json +171 -0
- package/dist/api/QAjaxBar.json +13 -1
- package/dist/api/QFile.json +1 -0
- package/dist/api/QTree.json +7 -0
- package/dist/api/QUploader.json +3 -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/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/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/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-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-mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.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.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/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.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/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/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/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/ml.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +6 -0
- 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/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/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/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.cjs.prod.js +2 -2
- package/dist/quasar.css +10 -3
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +10 -3
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +9 -3
- package/dist/quasar.umd.js +207 -101
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/types/api/qfile.d.ts +8 -0
- package/dist/types/api/qselect.d.ts +4 -0
- package/dist/types/api/qtable.d.ts +12 -0
- package/dist/types/api/qtree.d.ts +31 -0
- package/dist/types/api/quploader.d.ts +28 -0
- package/dist/types/api/touchswipe.d.ts +11 -0
- package/dist/types/api/validation.d.ts +1 -1
- package/dist/types/api.d.ts +6 -0
- package/dist/types/index.d.ts +422 -314
- package/dist/types/ts-helpers.d.ts +6 -2
- package/dist/types/utils.d.ts +4 -1
- package/dist/vetur/quasar-attributes.json +4 -0
- package/dist/vetur/quasar-tags.json +1 -0
- package/dist/web-types/web-types.json +11 -1
- package/lang/index.json +4 -0
- package/lang/my.js +90 -0
- package/package.json +1 -1
- package/src/components/ajax-bar/QAjaxBar.js +22 -12
- package/src/components/ajax-bar/QAjaxBar.json +16 -1
- package/src/components/date/QDate.js +6 -1
- package/src/components/dialog/QDialog.js +1 -1
- package/src/components/dialog-plugin/DialogPlugin.js +1 -1
- package/src/components/editor/QEditor.js +1 -1
- package/src/components/form/QForm.js +12 -2
- package/src/components/icon/QIcon.js +3 -3
- package/src/components/icon/QIcon.sass +2 -2
- package/src/components/infinite-scroll/QInfiniteScroll.js +3 -2
- package/src/components/input/QInput.js +1 -1
- package/src/components/menu/QMenu.js +2 -1
- package/src/components/scroll-area/QScrollArea.js +36 -11
- package/src/components/select/QSelect.js +32 -27
- package/src/components/select/QSelect.sass +4 -0
- package/src/components/stepper/QStep.js +19 -14
- package/src/components/stepper/QStepper.sass +3 -0
- package/src/components/tabs/QTabs.js +10 -2
- package/src/components/tree/QTree.js +8 -1
- package/src/components/tree/QTree.json +8 -0
- package/src/components/uploader/uploader-core.js +2 -0
- package/src/components/uploader/xhr-uploader-plugin.json +2 -1
- package/src/components/virtual-scroll/use-virtual-scroll.js +14 -5
- package/src/composables/private/use-field.js +18 -9
- package/src/composables/private/use-file.json +1 -0
- package/src/plugins/LoadingBar.js +3 -3
- package/src/plugins/LoadingBar.json +8 -0
- package/src/plugins/Platform.js +15 -8
- package/src/plugins/Platform.json +166 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { ComponentOptions, ComponentPublicInstance, ComputedOptions, MethodOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
2
2
|
|
|
3
|
-
export type LooseDictionary = { [index in string]: any };
|
|
4
|
-
|
|
5
3
|
export type StringDictionary<T extends string> = Required<
|
|
6
4
|
{ [index in T]: string }
|
|
7
5
|
>;
|
|
8
6
|
|
|
7
|
+
// Needed to prevent TS to collapse `'value1' | 'value2' | string` to `string`, which breaks first parameter autocomplete
|
|
8
|
+
// See: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-832522611
|
|
9
|
+
export type LiteralUnion<T extends U, U = string> =
|
|
10
|
+
| T
|
|
11
|
+
| (U & Record<never, never>);
|
|
12
|
+
|
|
9
13
|
// See: https://stackoverflow.com/a/49936686/7931540
|
|
10
14
|
export type DeepPartial<T> = {
|
|
11
15
|
[P in keyof T]?: T[P] extends Array<infer U>
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Error on "quasar" import shown in IDE is normal, as we only have Components/Directives/Plugins types after the build step
|
|
2
|
+
// The import will work correctly at runtime
|
|
3
|
+
import { QUploader } from "quasar";
|
|
1
4
|
import {
|
|
2
5
|
ComponentOptionsMixin,
|
|
3
6
|
ComponentPropsOptions,
|
|
@@ -135,4 +138,4 @@ export function createUploaderComponent<
|
|
|
135
138
|
Emits extends EmitsOptions = []
|
|
136
139
|
>(
|
|
137
140
|
options: CreateUploaderComponentOptions<Props, Emits>
|
|
138
|
-
): DefineComponent<Props, {}, {}, {}, {}, {}, {},
|
|
141
|
+
): QUploader & DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits>;
|
|
@@ -5559,6 +5559,10 @@
|
|
|
5559
5559
|
"type": "any",
|
|
5560
5560
|
"description": "Key of node currently selected"
|
|
5561
5561
|
},
|
|
5562
|
+
"q-tree/no-selection-unset": {
|
|
5563
|
+
"type": "boolean",
|
|
5564
|
+
"description": "Do not allow un-selection when clicking currently selected node"
|
|
5565
|
+
},
|
|
5562
5566
|
"q-tree/default-expand-all": {
|
|
5563
5567
|
"type": "boolean",
|
|
5564
5568
|
"description": "Allow the tree to have all its branches expanded, when first rendered"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "quasar",
|
|
5
|
-
"version": "2.4.
|
|
5
|
+
"version": "2.4.12",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -17964,6 +17964,16 @@
|
|
|
17964
17964
|
"description": "Key of node currently selected\n\nExamples:\nv-model:selected=\"selectedKey\"",
|
|
17965
17965
|
"doc-url": "https://v2.quasar.dev/vue-components/tree"
|
|
17966
17966
|
},
|
|
17967
|
+
{
|
|
17968
|
+
"name": "no-selection-unset",
|
|
17969
|
+
"value": {
|
|
17970
|
+
"kind": "expression",
|
|
17971
|
+
"type": "boolean"
|
|
17972
|
+
},
|
|
17973
|
+
"description": "Do not allow un-selection when clicking currently selected node",
|
|
17974
|
+
"doc-url": "https://v2.quasar.dev/vue-components/tree",
|
|
17975
|
+
"type": "boolean"
|
|
17976
|
+
},
|
|
17967
17977
|
{
|
|
17968
17978
|
"name": "default-expand-all",
|
|
17969
17979
|
"value": {
|
package/lang/index.json
CHANGED
package/lang/my.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
isoName: 'my',
|
|
3
|
+
nativeName: 'Malaysia',
|
|
4
|
+
label: {
|
|
5
|
+
clear: 'kosong',
|
|
6
|
+
ok: 'pasti',
|
|
7
|
+
cancel: 'Batal',
|
|
8
|
+
close: 'penutupan',
|
|
9
|
+
set: 'sediakan',
|
|
10
|
+
select: 'pilih',
|
|
11
|
+
reset: 'set semula',
|
|
12
|
+
remove: 'keluarkan',
|
|
13
|
+
update: 'memperbaharui',
|
|
14
|
+
create: 'cipta',
|
|
15
|
+
search: 'cari',
|
|
16
|
+
filter: 'penapis',
|
|
17
|
+
refresh: 'segarkan semula'
|
|
18
|
+
},
|
|
19
|
+
date: {
|
|
20
|
+
days: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
|
|
21
|
+
daysShort: 'Aha_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
|
|
22
|
+
months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
|
|
23
|
+
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogo_Sep_Okt_Nov_Dis'.split('_'),
|
|
24
|
+
headerTitle: date => new Intl.DateTimeFormat('my', {
|
|
25
|
+
weekday: 'short', month: 'short', day: 'numeric'
|
|
26
|
+
}).format(date),
|
|
27
|
+
firstDayOfWeek: 0, // 0-6, 0 - Sunday, 1 Monday, ...
|
|
28
|
+
format24h: false,
|
|
29
|
+
pluralDay: 'langit'
|
|
30
|
+
},
|
|
31
|
+
table: {
|
|
32
|
+
noData: 'tiada data tersedia',
|
|
33
|
+
noResults: 'Tiada data yang sepadan ditemui',
|
|
34
|
+
loading: 'memuatkan...',
|
|
35
|
+
selectedRecords: rows => 'dipilih' + rows + 'baris',
|
|
36
|
+
recordsPerPage: 'baris setiap muka surat:',
|
|
37
|
+
allRows: 'semua',
|
|
38
|
+
pagination: (start, end, total) => start + '-' + end + ' / ' + total,
|
|
39
|
+
columns: 'Senaraikan'
|
|
40
|
+
},
|
|
41
|
+
editor: {
|
|
42
|
+
url: 'URL',
|
|
43
|
+
bold: 'berani',
|
|
44
|
+
italic: 'condong',
|
|
45
|
+
strikethrough: 'tembus',
|
|
46
|
+
underline: 'gariskan',
|
|
47
|
+
unorderedList: 'senarai tidak teratur',
|
|
48
|
+
orderedList: 'senarai pesanan',
|
|
49
|
+
subscript: 'subskrip',
|
|
50
|
+
superscript: 'superskrip',
|
|
51
|
+
hyperlink: 'Hiperpautan',
|
|
52
|
+
toggleFullscreen: 'togol skrin penuh',
|
|
53
|
+
quote: 'tanda petikan',
|
|
54
|
+
left: 'Jajar ke kiri',
|
|
55
|
+
center: 'penjajaran tengah',
|
|
56
|
+
right: 'Sejajar ke kanan',
|
|
57
|
+
justify: 'wajar',
|
|
58
|
+
print: 'Cetak',
|
|
59
|
+
outdent: 'mengurangkan lekukan',
|
|
60
|
+
indent: 'meningkatkan inden',
|
|
61
|
+
removeFormat: 'gaya yang jelas',
|
|
62
|
+
formatting: 'format',
|
|
63
|
+
fontSize: 'Saiz huruf',
|
|
64
|
+
align: 'selaraskan',
|
|
65
|
+
hr: 'Masukkan garisan mendatar',
|
|
66
|
+
undo: 'membatalkan',
|
|
67
|
+
redo: 'buat semula',
|
|
68
|
+
heading1: 'Tajuk satu',
|
|
69
|
+
heading2: 'Tajuk dua',
|
|
70
|
+
heading3: 'Tajuk tiga',
|
|
71
|
+
heading4: 'Tajuk Empat',
|
|
72
|
+
heading5: 'Tajuk Lima',
|
|
73
|
+
heading6: 'Tajuk Enam',
|
|
74
|
+
paragraph: 'perenggan',
|
|
75
|
+
code: 'kod',
|
|
76
|
+
size1: 'sangat kecil',
|
|
77
|
+
size2: 'lebih kecil',
|
|
78
|
+
size3: 'biasa',
|
|
79
|
+
size4: 'sederhana hingga besar',
|
|
80
|
+
size5: 'besar',
|
|
81
|
+
size6: 'sangat besar',
|
|
82
|
+
size7: 'super besar',
|
|
83
|
+
defaultFont: 'fon lalai',
|
|
84
|
+
viewSource: 'menyemak data'
|
|
85
|
+
},
|
|
86
|
+
tree: {
|
|
87
|
+
noNodes: 'tiada nod tersedia',
|
|
88
|
+
noResults: 'Tiada nod yang sepadan ditemui'
|
|
89
|
+
}
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -119,7 +119,7 @@ export default createComponent({
|
|
|
119
119
|
const onScreen = ref(false)
|
|
120
120
|
const animate = ref(true)
|
|
121
121
|
|
|
122
|
-
let
|
|
122
|
+
let sessions = 0, timer, speed
|
|
123
123
|
|
|
124
124
|
const classes = computed(() =>
|
|
125
125
|
`q-loading-bar q-loading-bar--${ props.position }`
|
|
@@ -165,16 +165,17 @@ export default createComponent({
|
|
|
165
165
|
const oldSpeed = speed
|
|
166
166
|
speed = Math.max(0, newSpeed) || 0
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
sessions++
|
|
169
169
|
|
|
170
|
-
if (
|
|
170
|
+
if (sessions > 1) {
|
|
171
171
|
if (oldSpeed === 0 && newSpeed > 0) {
|
|
172
172
|
planNextStep()
|
|
173
173
|
}
|
|
174
174
|
else if (oldSpeed > 0 && newSpeed <= 0) {
|
|
175
175
|
clearTimeout(timer)
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
|
|
178
|
+
return sessions
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
clearTimeout(timer)
|
|
@@ -182,25 +183,32 @@ export default createComponent({
|
|
|
182
183
|
|
|
183
184
|
progress.value = 0
|
|
184
185
|
|
|
185
|
-
if (onScreen.value === true) { return }
|
|
186
|
-
|
|
187
|
-
onScreen.value = true
|
|
188
|
-
animate.value = false
|
|
189
186
|
timer = setTimeout(() => {
|
|
190
187
|
animate.value = true
|
|
191
188
|
newSpeed > 0 && planNextStep()
|
|
192
|
-
},
|
|
189
|
+
}, onScreen.value === true ? 500 : 1)
|
|
190
|
+
|
|
191
|
+
if (onScreen.value !== true) {
|
|
192
|
+
onScreen.value = true
|
|
193
|
+
animate.value = false
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return sessions
|
|
193
197
|
}
|
|
194
198
|
|
|
195
199
|
function increment (amount) {
|
|
196
|
-
if (
|
|
200
|
+
if (sessions > 0) {
|
|
197
201
|
progress.value = inc(progress.value, amount)
|
|
198
202
|
}
|
|
203
|
+
|
|
204
|
+
return sessions
|
|
199
205
|
}
|
|
200
206
|
|
|
201
207
|
function stop () {
|
|
202
|
-
|
|
203
|
-
if (
|
|
208
|
+
sessions = Math.max(0, sessions - 1)
|
|
209
|
+
if (sessions > 0) {
|
|
210
|
+
return sessions
|
|
211
|
+
}
|
|
204
212
|
|
|
205
213
|
clearTimeout(timer)
|
|
206
214
|
emit('stop')
|
|
@@ -219,6 +227,8 @@ export default createComponent({
|
|
|
219
227
|
else {
|
|
220
228
|
end()
|
|
221
229
|
}
|
|
230
|
+
|
|
231
|
+
return sessions
|
|
222
232
|
}
|
|
223
233
|
|
|
224
234
|
function planNextStep () {
|
|
@@ -73,6 +73,11 @@
|
|
|
73
73
|
"desc": "Delay (in milliseconds) between progress auto-increments; If delay is 0 then it disables auto-incrementing",
|
|
74
74
|
"examples": [ 400, 0 ]
|
|
75
75
|
}
|
|
76
|
+
},
|
|
77
|
+
"returns": {
|
|
78
|
+
"type": "Number",
|
|
79
|
+
"desc": "Number of active simultaneous sessions",
|
|
80
|
+
"__exemption": [ "examples" ]
|
|
76
81
|
}
|
|
77
82
|
},
|
|
78
83
|
|
|
@@ -84,11 +89,21 @@
|
|
|
84
89
|
"desc": "Amount (0 < x <= 100) to increment with",
|
|
85
90
|
"examples": [ 1 ]
|
|
86
91
|
}
|
|
92
|
+
},
|
|
93
|
+
"returns": {
|
|
94
|
+
"type": "Number",
|
|
95
|
+
"desc": "Number of active simultaneous sessions",
|
|
96
|
+
"__exemption": [ "examples" ]
|
|
87
97
|
}
|
|
88
98
|
},
|
|
89
99
|
|
|
90
100
|
"stop": {
|
|
91
|
-
"desc": "Notify bar that one process you were waiting has finished"
|
|
101
|
+
"desc": "Notify bar that one process you were waiting has finished",
|
|
102
|
+
"returns": {
|
|
103
|
+
"type": "Number",
|
|
104
|
+
"desc": "Number of active simultaneous sessions",
|
|
105
|
+
"__exemption": [ "examples" ]
|
|
106
|
+
}
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
}
|
|
@@ -153,7 +153,12 @@ export default createComponent({
|
|
|
153
153
|
normalizedModel.value
|
|
154
154
|
.filter(date => typeof date === 'string')
|
|
155
155
|
.map(date => decodeString(date, innerMask.value, innerLocale.value))
|
|
156
|
-
.filter(date =>
|
|
156
|
+
.filter(date =>
|
|
157
|
+
date.dateHash !== null
|
|
158
|
+
&& date.day !== null
|
|
159
|
+
&& date.month !== null
|
|
160
|
+
&& date.year !== null
|
|
161
|
+
)
|
|
157
162
|
)
|
|
158
163
|
|
|
159
164
|
const rangeModel = computed(() => {
|
|
@@ -144,8 +144,8 @@ export default createComponent({
|
|
|
144
144
|
color: vmColor.value,
|
|
145
145
|
label: okLabel.value,
|
|
146
146
|
ripple: false,
|
|
147
|
-
...(Object(props.ok) === props.ok ? props.ok : { flat: true }),
|
|
148
147
|
disable: okDisabled.value,
|
|
148
|
+
...(Object(props.ok) === props.ok ? props.ok : { flat: true }),
|
|
149
149
|
'data-autofocus': (props.focus === 'ok' && hasForm.value !== true) || void 0,
|
|
150
150
|
onClick: onOk
|
|
151
151
|
}))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, onMounted, getCurrentInstance, nextTick, provide } from 'vue'
|
|
1
|
+
import { h, ref, onActivated, onDeactivated, onMounted, getCurrentInstance, nextTick, provide } from 'vue'
|
|
2
2
|
|
|
3
3
|
import { createComponent } from '../../utils/private/create.js'
|
|
4
4
|
import { stopAndPrevent } from '../../utils/event.js'
|
|
@@ -144,7 +144,7 @@ export default createComponent({
|
|
|
144
144
|
const target = rootRef.value.querySelector('[autofocus], [data-autofocus]')
|
|
145
145
|
|| Array.prototype.find.call(rootRef.value.querySelectorAll('[tabindex]'), el => el.tabIndex > -1)
|
|
146
146
|
|
|
147
|
-
target !== null && target !== void 0 && target.focus()
|
|
147
|
+
target !== null && target !== void 0 && target.focus({ preventScroll: true })
|
|
148
148
|
})
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -161,6 +161,16 @@ export default createComponent({
|
|
|
161
161
|
}
|
|
162
162
|
})
|
|
163
163
|
|
|
164
|
+
let shouldActivate = false
|
|
165
|
+
|
|
166
|
+
onDeactivated(() => {
|
|
167
|
+
shouldActivate = true
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
onActivated(() => {
|
|
171
|
+
shouldActivate === true && props.autofocus === true && focus()
|
|
172
|
+
})
|
|
173
|
+
|
|
164
174
|
onMounted(() => {
|
|
165
175
|
props.autofocus === true && focus()
|
|
166
176
|
})
|
|
@@ -168,13 +168,13 @@ export default createComponent({
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
if (type.value.img === true) {
|
|
171
|
-
return h('
|
|
171
|
+
return h('span', data, hMergeSlot(slots.default, [
|
|
172
172
|
h('img', { src: type.value.src })
|
|
173
173
|
]))
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
if (type.value.svg === true) {
|
|
177
|
-
return h('
|
|
177
|
+
return h('span', data, hMergeSlot(slots.default, [
|
|
178
178
|
h('svg', {
|
|
179
179
|
viewBox: type.value.viewBox
|
|
180
180
|
}, type.value.nodes)
|
|
@@ -182,7 +182,7 @@ export default createComponent({
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
if (type.value.svguse === true) {
|
|
185
|
-
return h('
|
|
185
|
+
return h('span', data, hMergeSlot(slots.default, [
|
|
186
186
|
h('svg', {
|
|
187
187
|
viewBox: type.value.viewBox
|
|
188
188
|
}, [
|
|
@@ -41,7 +41,6 @@ export default createComponent({
|
|
|
41
41
|
const rootRef = ref(null)
|
|
42
42
|
|
|
43
43
|
let index = props.initialIndex || 0
|
|
44
|
-
let scrollPos = false
|
|
45
44
|
let localScrollTarget, poll
|
|
46
45
|
|
|
47
46
|
const classes = computed(() =>
|
|
@@ -180,8 +179,10 @@ export default createComponent({
|
|
|
180
179
|
watch(() => props.scrollTarget, updateScrollTarget)
|
|
181
180
|
watch(() => props.debounce, setDebounce)
|
|
182
181
|
|
|
182
|
+
let scrollPos = false
|
|
183
|
+
|
|
183
184
|
onActivated(() => {
|
|
184
|
-
if (
|
|
185
|
+
if (scrollPos !== false && localScrollTarget) {
|
|
185
186
|
setVerticalScrollPosition(localScrollTarget, scrollPos)
|
|
186
187
|
}
|
|
187
188
|
})
|
|
@@ -181,7 +181,7 @@ export default createComponent({
|
|
|
181
181
|
|
|
182
182
|
if (node && node.contains(document.activeElement) !== true) {
|
|
183
183
|
node = node.querySelector('[autofocus], [data-autofocus]') || node
|
|
184
|
-
node.focus()
|
|
184
|
+
node.focus({ preventScroll: true })
|
|
185
185
|
}
|
|
186
186
|
})
|
|
187
187
|
}
|
|
@@ -309,6 +309,7 @@ export default createComponent({
|
|
|
309
309
|
// the focus is not in a vue child component
|
|
310
310
|
if (
|
|
311
311
|
handlesFocus.value === true
|
|
312
|
+
&& props.noFocus !== true
|
|
312
313
|
&& childHasFocus(innerRef.value, evt.target) !== true
|
|
313
314
|
) {
|
|
314
315
|
focus()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, computed, withDirectives, onBeforeUnmount, getCurrentInstance } from 'vue'
|
|
1
|
+
import { h, ref, computed, withDirectives, onActivated, onDeactivated, onBeforeUnmount, getCurrentInstance } from 'vue'
|
|
2
2
|
|
|
3
3
|
import useDark, { useDarkProps } from '../../composables/private/use-dark.js'
|
|
4
4
|
|
|
@@ -108,6 +108,9 @@ export default createComponent({
|
|
|
108
108
|
&& panning.value === false
|
|
109
109
|
) || scroll.vertical.size.value <= container.vertical.value + 1
|
|
110
110
|
)
|
|
111
|
+
scroll.vertical.thumbStart = computed(() =>
|
|
112
|
+
scroll.vertical.percentage.value * (container.vertical.value - scroll.vertical.thumbSize.value)
|
|
113
|
+
)
|
|
111
114
|
scroll.vertical.thumbSize = computed(() =>
|
|
112
115
|
Math.round(
|
|
113
116
|
between(
|
|
@@ -118,13 +121,11 @@ export default createComponent({
|
|
|
118
121
|
)
|
|
119
122
|
)
|
|
120
123
|
scroll.vertical.style = computed(() => {
|
|
121
|
-
const thumbSize = scroll.vertical.thumbSize.value
|
|
122
|
-
const pos = scroll.vertical.percentage.value * (container.vertical.value - thumbSize)
|
|
123
124
|
return {
|
|
124
125
|
...props.thumbStyle,
|
|
125
126
|
...props.verticalThumbStyle,
|
|
126
|
-
top: `${
|
|
127
|
-
height: `${ thumbSize }px`
|
|
127
|
+
top: `${ scroll.vertical.thumbStart.value }px`,
|
|
128
|
+
height: `${ scroll.vertical.thumbSize.value }px`
|
|
128
129
|
}
|
|
129
130
|
})
|
|
130
131
|
scroll.vertical.thumbClass = computed(() =>
|
|
@@ -149,6 +150,9 @@ export default createComponent({
|
|
|
149
150
|
&& panning.value === false
|
|
150
151
|
) || scroll.horizontal.size.value <= container.horizontal.value + 1
|
|
151
152
|
)
|
|
153
|
+
scroll.horizontal.thumbStart = computed(() =>
|
|
154
|
+
scroll.horizontal.percentage.value * (container.horizontal.value - scroll.horizontal.thumbSize.value)
|
|
155
|
+
)
|
|
152
156
|
scroll.horizontal.thumbSize = computed(() =>
|
|
153
157
|
Math.round(
|
|
154
158
|
between(
|
|
@@ -159,13 +163,11 @@ export default createComponent({
|
|
|
159
163
|
)
|
|
160
164
|
)
|
|
161
165
|
scroll.horizontal.style = computed(() => {
|
|
162
|
-
const thumbSize = scroll.horizontal.thumbSize.value
|
|
163
|
-
const pos = scroll.horizontal.percentage.value * (container.horizontal.value - thumbSize)
|
|
164
166
|
return {
|
|
165
167
|
...props.thumbStyle,
|
|
166
168
|
...props.horizontalThumbStyle,
|
|
167
|
-
left: `${
|
|
168
|
-
width: `${ thumbSize }px`
|
|
169
|
+
left: `${ scroll.horizontal.thumbStart.value }px`,
|
|
170
|
+
width: `${ scroll.horizontal.thumbSize.value }px`
|
|
169
171
|
}
|
|
170
172
|
})
|
|
171
173
|
scroll.horizontal.thumbClass = computed(() =>
|
|
@@ -311,8 +313,11 @@ export default createComponent({
|
|
|
311
313
|
const data = scroll[ axis ]
|
|
312
314
|
|
|
313
315
|
if (data.thumbHidden.value !== true) {
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
+
const offset = evt[ dirProps[ axis ].offset ]
|
|
317
|
+
if (offset < data.thumbStart.value || offset > data.thumbStart.value + data.thumbSize.value) {
|
|
318
|
+
const pos = offset - data.thumbSize.value / 2
|
|
319
|
+
setScroll(pos / container[ axis ].value * data.size.value, axis)
|
|
320
|
+
}
|
|
316
321
|
|
|
317
322
|
// activate thumb pan
|
|
318
323
|
if (data.ref.value !== null) {
|
|
@@ -375,6 +380,26 @@ export default createComponent({
|
|
|
375
380
|
}
|
|
376
381
|
})
|
|
377
382
|
|
|
383
|
+
let scrollPosition = null
|
|
384
|
+
|
|
385
|
+
onDeactivated(() => {
|
|
386
|
+
scrollPosition = {
|
|
387
|
+
top: scroll.vertical.position.value,
|
|
388
|
+
left: scroll.horizontal.position.value
|
|
389
|
+
}
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
onActivated(() => {
|
|
393
|
+
if (scrollPosition === null) { return }
|
|
394
|
+
|
|
395
|
+
const scrollTarget = targetRef.value
|
|
396
|
+
|
|
397
|
+
if (scrollTarget !== null) {
|
|
398
|
+
setHorizontalScrollPosition(scrollTarget, scrollPosition.left)
|
|
399
|
+
setVerticalScrollPosition(scrollTarget, scrollPosition.top)
|
|
400
|
+
}
|
|
401
|
+
})
|
|
402
|
+
|
|
378
403
|
onBeforeUnmount(emitScroll.cancel)
|
|
379
404
|
|
|
380
405
|
return () => {
|