quasar 2.7.7 → 2.8.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.
- package/dist/api/Loading.json +57 -1
- package/dist/api/QBtnDropdown.json +4 -0
- package/dist/api/QEditor.json +105 -97
- package/dist/api/QField.json +6 -0
- package/dist/api/QFile.json +6 -0
- package/dist/api/QInput.json +6 -0
- package/dist/api/QSelect.json +6 -0
- package/dist/api/QTable.json +36 -49
- package/dist/api/QUploader.json +86 -8
- 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/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 +2 -2
- 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 +2 -2
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +2 -2
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +2 -2
- 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-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/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/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/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/kz.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/mm.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/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.cjs.prod.js +2 -2
- package/dist/quasar.esm.js +39647 -0
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.sass +1 -1
- package/dist/quasar.umd.js +355 -295
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/transforms/import-map.json +1 -0
- package/dist/types/index.d.ts +223 -117
- package/dist/web-types/web-types.json +6 -1
- package/package.json +1 -1
- package/src/components/banner/QBanner.js +2 -2
- package/src/components/bar/QBar.js +2 -2
- package/src/components/btn-dropdown/QBtnDropdown.js +8 -2
- package/src/components/btn-dropdown/QBtnDropdown.json +5 -0
- package/src/components/card/QCard.js +2 -2
- package/src/components/carousel/QCarousel.js +1 -1
- package/src/components/date/QDate.js +6 -6
- package/src/components/dialog-plugin/DialogPlugin.js +1 -1
- package/src/components/editor/QEditor.js +5 -5
- package/src/components/editor/QEditor.json +76 -67
- package/src/components/infinite-scroll/QInfiniteScroll.js +7 -7
- package/src/components/page-sticky/use-page-sticky.js +1 -2
- package/src/components/popup-edit/QPopupEdit.js +10 -10
- package/src/components/popup-proxy/QPopupProxy.js +7 -7
- package/src/components/pull-to-refresh/QPullToRefresh.js +3 -3
- package/src/components/range/QRange.js +5 -1
- package/src/components/resize-observer/QResizeObserver.js +6 -6
- package/src/components/scroll-area/QScrollArea.js +25 -25
- package/src/components/scroll-observer/QScrollObserver.js +3 -3
- package/src/components/select/QSelect.js +2 -1
- package/src/components/slider/QSlider.js +5 -1
- package/src/components/slider/use-slider.js +1 -1
- package/src/components/table/QTable.json +28 -50
- package/src/components/table/table-column-selection.js +1 -1
- package/src/components/table/table-pagination.js +0 -4
- package/src/components/table/table-sort.js +1 -1
- package/src/components/time/QTime.js +5 -5
- package/src/components/tree/QTree.js +2 -2
- package/src/components/uploader/QUploader.json +107 -0
- package/src/components/uploader/__tests__/QUploader.spec.js +33 -2
- package/src/components/uploader/uploader-core.js +48 -53
- package/src/composables/private/use-field.js +5 -4
- package/src/composables/private/use-file.js +1 -0
- package/src/composables/private/use-panel.js +7 -7
- package/src/composables/private/use-portal.js +7 -7
- package/src/composables/private/use-validate.json +7 -0
- package/src/directives/ClosePopup.js +4 -4
- package/src/directives/Intersection.js +1 -1
- package/src/index.dev.js +16 -0
- package/src/{index.all.js → index.ssr.js} +0 -0
- package/src/install-quasar.js +1 -1
- package/src/plugins/Loading.js +122 -73
- package/src/plugins/Loading.json +48 -1
- package/src/plugins/LoadingBar.js +1 -1
- package/src/plugins/Notify.js +1 -1
- package/src/utils/create-uploader-component.js +1 -1
- package/src/utils/date.js +1 -1
- package/src/utils/dom.js +2 -5
- package/src/utils/{private/is.js → is.js} +11 -7
- package/src/utils/morph.js +1 -1
- package/src/utils/open-url.js +7 -2
- package/src/utils/private/click-outside.js +3 -3
- package/src/utils/private/date-persian.js +12 -12
- package/src/utils/private/portal.js +24 -24
- package/src/utils/private/vm.js +10 -9
- package/src/utils/private/web-storage.js +1 -1
- package/src/utils.js +2 -0
package/src/plugins/Loading.js
CHANGED
|
@@ -5,16 +5,18 @@ import QSpinner from '../components/spinner/QSpinner.js'
|
|
|
5
5
|
import defineReactivePlugin from '../utils/private/define-reactive-plugin.js'
|
|
6
6
|
import { createGlobalNode, removeGlobalNode } from '../utils/private/global-nodes.js'
|
|
7
7
|
import preventScroll from '../utils/prevent-scroll.js'
|
|
8
|
-
import { isObject } from '../utils/
|
|
8
|
+
import { isObject } from '../utils/is.js'
|
|
9
9
|
|
|
10
10
|
let
|
|
11
11
|
app,
|
|
12
12
|
vm,
|
|
13
13
|
uid = 0,
|
|
14
14
|
timeout,
|
|
15
|
-
props = {}
|
|
15
|
+
props = {},
|
|
16
|
+
activeGroups = {}
|
|
16
17
|
|
|
17
18
|
const originalDefaults = {
|
|
19
|
+
group: '__default_quasar_group__',
|
|
18
20
|
delay: 0,
|
|
19
21
|
message: false,
|
|
20
22
|
html: false,
|
|
@@ -29,102 +31,149 @@ const originalDefaults = {
|
|
|
29
31
|
|
|
30
32
|
const defaults = { ...originalDefaults }
|
|
31
33
|
|
|
34
|
+
function registerProps (opts) {
|
|
35
|
+
if (opts && opts.group !== void 0 && activeGroups[ opts.group ] !== void 0) {
|
|
36
|
+
return Object.assign(activeGroups[ opts.group ], opts)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const newProps = isObject(opts) === true && opts.ignoreDefaults === true
|
|
40
|
+
? { ...originalDefaults, ...opts }
|
|
41
|
+
: { ...defaults, ...opts }
|
|
42
|
+
|
|
43
|
+
activeGroups[ newProps.group ] = newProps
|
|
44
|
+
return newProps
|
|
45
|
+
}
|
|
46
|
+
|
|
32
47
|
const Plugin = defineReactivePlugin({
|
|
33
48
|
isActive: false
|
|
34
49
|
}, {
|
|
35
50
|
show (opts) {
|
|
36
51
|
if (__QUASAR_SSR_SERVER__) { return }
|
|
37
52
|
|
|
38
|
-
props =
|
|
39
|
-
|
|
40
|
-
: { ...defaults, ...opts }
|
|
53
|
+
props = registerProps(opts)
|
|
54
|
+
const { group } = props
|
|
41
55
|
|
|
42
56
|
Plugin.isActive = true
|
|
43
57
|
|
|
44
58
|
if (app !== void 0) {
|
|
45
59
|
props.uid = uid
|
|
46
60
|
vm.$forceUpdate()
|
|
47
|
-
return
|
|
48
61
|
}
|
|
62
|
+
else {
|
|
63
|
+
props.uid = ++uid
|
|
64
|
+
clearTimeout(timeout)
|
|
49
65
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
timeout = setTimeout(() => {
|
|
54
|
-
timeout = void 0
|
|
55
|
-
|
|
56
|
-
const el = createGlobalNode('q-loading')
|
|
57
|
-
|
|
58
|
-
app = createApp({
|
|
59
|
-
name: 'QLoading',
|
|
60
|
-
|
|
61
|
-
setup () {
|
|
62
|
-
onMounted(() => {
|
|
63
|
-
preventScroll(true)
|
|
64
|
-
})
|
|
66
|
+
timeout = setTimeout(() => {
|
|
67
|
+
timeout = void 0
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const el = createGlobalNode('q-loading')
|
|
70
|
+
|
|
71
|
+
app = createApp({
|
|
72
|
+
name: 'QLoading',
|
|
73
|
+
|
|
74
|
+
setup () {
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
preventScroll(true)
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
function onAfterLeave () {
|
|
80
|
+
// might be called to finalize
|
|
81
|
+
// previous leave, even if it was cancelled
|
|
82
|
+
if (Plugin.isActive !== true && app !== void 0) {
|
|
83
|
+
preventScroll(false)
|
|
84
|
+
app.unmount(el)
|
|
85
|
+
removeGlobalNode(el)
|
|
86
|
+
app = void 0
|
|
87
|
+
vm = void 0
|
|
88
|
+
}
|
|
75
89
|
}
|
|
76
|
-
}
|
|
77
90
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
function getContent () {
|
|
92
|
+
if (Plugin.isActive !== true) {
|
|
93
|
+
return null
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const content = [
|
|
97
|
+
h(props.spinner, {
|
|
98
|
+
class: 'q-loading__spinner',
|
|
99
|
+
color: props.spinnerColor,
|
|
100
|
+
size: props.spinnerSize
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
props.message && content.push(
|
|
105
|
+
h('div', {
|
|
106
|
+
class: 'q-loading__message'
|
|
107
|
+
+ (props.messageColor ? ` text-${ props.messageColor }` : ''),
|
|
108
|
+
[ props.html === true ? 'innerHTML' : 'textContent' ]: props.message
|
|
109
|
+
})
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return h('div', {
|
|
113
|
+
class: 'q-loading fullscreen flex flex-center z-max ' + props.customClass.trim(),
|
|
114
|
+
key: props.uid
|
|
115
|
+
}, [
|
|
116
|
+
h('div', {
|
|
117
|
+
class: 'q-loading__backdrop'
|
|
118
|
+
+ (props.backgroundColor ? ` bg-${ props.backgroundColor }` : '')
|
|
119
|
+
}),
|
|
120
|
+
|
|
121
|
+
h('div', {
|
|
122
|
+
class: 'q-loading__box column items-center ' + props.boxClass
|
|
123
|
+
}, content)
|
|
124
|
+
])
|
|
81
125
|
}
|
|
82
126
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
props.message && content.push(
|
|
92
|
-
h('div', {
|
|
93
|
-
class: 'q-loading__message'
|
|
94
|
-
+ (props.messageColor ? ` text-${ props.messageColor }` : ''),
|
|
95
|
-
[ props.html === true ? 'innerHTML' : 'textContent' ]: props.message
|
|
96
|
-
})
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
return h('div', {
|
|
100
|
-
class: 'q-loading fullscreen flex flex-center z-max ' + props.customClass.trim(),
|
|
101
|
-
key: props.uid
|
|
102
|
-
}, [
|
|
103
|
-
h('div', {
|
|
104
|
-
class: 'q-loading__backdrop'
|
|
105
|
-
+ (props.backgroundColor ? ` bg-${ props.backgroundColor }` : '')
|
|
106
|
-
}),
|
|
107
|
-
|
|
108
|
-
h('div', {
|
|
109
|
-
class: 'q-loading__box column items-center ' + props.boxClass
|
|
110
|
-
}, content)
|
|
111
|
-
])
|
|
127
|
+
return () => h(Transition, {
|
|
128
|
+
name: 'q-transition--fade',
|
|
129
|
+
appear: true,
|
|
130
|
+
onAfterLeave
|
|
131
|
+
}, getContent)
|
|
112
132
|
}
|
|
133
|
+
})
|
|
113
134
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
onAfterLeave
|
|
118
|
-
}, getContent)
|
|
119
|
-
}
|
|
120
|
-
})
|
|
135
|
+
vm = app.mount(el)
|
|
136
|
+
}, props.delay)
|
|
137
|
+
}
|
|
121
138
|
|
|
122
|
-
|
|
123
|
-
|
|
139
|
+
return paramProps => {
|
|
140
|
+
// if we don't have params (or not an Object param) then we need to hide this group
|
|
141
|
+
if (paramProps === void 0 || Object(paramProps) !== paramProps) {
|
|
142
|
+
Plugin.hide(group)
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// else we have params so we need to update this group
|
|
147
|
+
Plugin.show({ ...paramProps, group })
|
|
148
|
+
}
|
|
124
149
|
},
|
|
125
150
|
|
|
126
|
-
hide () {
|
|
151
|
+
hide (group) {
|
|
127
152
|
if (__QUASAR_SSR_SERVER__ !== true && Plugin.isActive === true) {
|
|
153
|
+
if (group === void 0) {
|
|
154
|
+
// clear out any active groups
|
|
155
|
+
activeGroups = {}
|
|
156
|
+
}
|
|
157
|
+
else if (activeGroups[ group ] === void 0) {
|
|
158
|
+
// we've already hidden it so nothing to do
|
|
159
|
+
return
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
// remove active group
|
|
163
|
+
delete activeGroups[ group ]
|
|
164
|
+
|
|
165
|
+
const keys = Object.keys(activeGroups)
|
|
166
|
+
|
|
167
|
+
// if there are other groups registered then
|
|
168
|
+
// show last registered one since that one is still active
|
|
169
|
+
if (keys.length !== 0) {
|
|
170
|
+
// get last registered group
|
|
171
|
+
const lastGroup = keys[ keys.length - 1 ]
|
|
172
|
+
Plugin.show({ group: lastGroup })
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
128
177
|
if (timeout !== void 0) {
|
|
129
178
|
clearTimeout(timeout)
|
|
130
179
|
timeout = void 0
|
package/src/plugins/Loading.json
CHANGED
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
"desc": "Message to display",
|
|
19
19
|
"examples": [ "Processing your request" ]
|
|
20
20
|
},
|
|
21
|
+
"group": {
|
|
22
|
+
"type": "String",
|
|
23
|
+
"desc": "Default Loading group name",
|
|
24
|
+
"default": "__default_quasar_group__",
|
|
25
|
+
"examples": [ "default-group-name" ],
|
|
26
|
+
"addedIn": "v2.8"
|
|
27
|
+
},
|
|
21
28
|
"html": {
|
|
22
29
|
"extends": "html",
|
|
23
30
|
"desc": "Force render the message as HTML; This can lead to XSS attacks so make sure that you sanitize the content"
|
|
@@ -67,10 +74,13 @@
|
|
|
67
74
|
|
|
68
75
|
"methods": {
|
|
69
76
|
"show": {
|
|
77
|
+
"tsInjectionPoint": true,
|
|
70
78
|
"desc": "Activate and show",
|
|
71
79
|
"params": {
|
|
72
80
|
"opts": {
|
|
73
81
|
"type": "Object",
|
|
82
|
+
"tsType": "QLoadingShowOptions",
|
|
83
|
+
"autoDefineTsType": true,
|
|
74
84
|
"desc": "All props are optional",
|
|
75
85
|
"definition": {
|
|
76
86
|
"delay": {
|
|
@@ -83,6 +93,12 @@
|
|
|
83
93
|
"desc": "Message to display",
|
|
84
94
|
"examples": [ "Processing your request" ]
|
|
85
95
|
},
|
|
96
|
+
"group": {
|
|
97
|
+
"type": "String",
|
|
98
|
+
"desc": "Loading group name",
|
|
99
|
+
"examples": [ "some-api-call" ],
|
|
100
|
+
"addedIn": "v2.8"
|
|
101
|
+
},
|
|
86
102
|
"html": {
|
|
87
103
|
"extends": "html",
|
|
88
104
|
"desc": "Render the message as HTML; This can lead to XSS attacks so make sure that you sanitize the message first"
|
|
@@ -124,11 +140,35 @@
|
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
142
|
}
|
|
143
|
+
},
|
|
144
|
+
"returns": {
|
|
145
|
+
"type": "Function",
|
|
146
|
+
"desc": "Calling this function with no parameters hides the group; When called with one Object parameter then it updates the Loading group (specified properties are shallow merged with the group ones; note that group cannot be changed while updating and it is ignored)",
|
|
147
|
+
"params": {
|
|
148
|
+
"props": {
|
|
149
|
+
"type": "Object",
|
|
150
|
+
"tsType": "QLoadingUpdateOptions",
|
|
151
|
+
"required": false,
|
|
152
|
+
"desc": "Loading properties that will be shallow merged to the group ones; (See 'opts' param of 'show()' for object properties, except 'group')",
|
|
153
|
+
"__exemption": [ "definition", "examples" ]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"returns": null,
|
|
157
|
+
"addedIn": "v2.8"
|
|
127
158
|
}
|
|
128
159
|
},
|
|
129
160
|
|
|
130
161
|
"hide": {
|
|
131
|
-
"desc": "Hide it"
|
|
162
|
+
"desc": "Hide it",
|
|
163
|
+
"params": {
|
|
164
|
+
"group": {
|
|
165
|
+
"type": "String",
|
|
166
|
+
"desc": "Optional Loading group name to hide instead of hiding all groups",
|
|
167
|
+
"required": false,
|
|
168
|
+
"examples": [ "some-api-call" ],
|
|
169
|
+
"addedIn": "v2.8"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
132
172
|
},
|
|
133
173
|
|
|
134
174
|
"setDefaults": {
|
|
@@ -149,6 +189,13 @@
|
|
|
149
189
|
"desc": "Message to display",
|
|
150
190
|
"examples": [ "Processing your request" ]
|
|
151
191
|
},
|
|
192
|
+
"group": {
|
|
193
|
+
"type": "String",
|
|
194
|
+
"desc": "Default Loading group name",
|
|
195
|
+
"default": "__default_quasar_group__",
|
|
196
|
+
"examples": [ "default-group-name" ],
|
|
197
|
+
"addedIn": "v2.8"
|
|
198
|
+
},
|
|
152
199
|
"spinnerSize": {
|
|
153
200
|
"type": "Number",
|
|
154
201
|
"desc": "Spinner size (in pixels)",
|
|
@@ -6,7 +6,7 @@ import { createGlobalNode } from '../utils/private/global-nodes.js'
|
|
|
6
6
|
import { createChildApp } from '../install-quasar.js'
|
|
7
7
|
|
|
8
8
|
import QAjaxBar from '../components/ajax-bar/QAjaxBar.js'
|
|
9
|
-
import { isObject } from '../utils/
|
|
9
|
+
import { isObject } from '../utils/is.js'
|
|
10
10
|
|
|
11
11
|
const barRef = ref(null)
|
|
12
12
|
|
package/src/plugins/Notify.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createComponent } from '../utils/private/create.js'
|
|
|
9
9
|
import { noop } from '../utils/event.js'
|
|
10
10
|
import { createGlobalNode } from '../utils/private/global-nodes.js'
|
|
11
11
|
import { createChildApp } from '../install-quasar.js'
|
|
12
|
-
import { isObject } from '../utils/
|
|
12
|
+
import { isObject } from '../utils/is.js'
|
|
13
13
|
|
|
14
14
|
let uid = 0
|
|
15
15
|
|
|
@@ -2,7 +2,7 @@ import { coreProps, coreEmits, getRenderer } from '../components/uploader/upload
|
|
|
2
2
|
|
|
3
3
|
import { createComponent } from './private/create.js'
|
|
4
4
|
import getEmitsObject from './private/get-emits-object.js'
|
|
5
|
-
import { isObject } from './
|
|
5
|
+
import { isObject } from './is.js'
|
|
6
6
|
|
|
7
7
|
const coreEmitsObject = getEmitsObject(coreEmits)
|
|
8
8
|
|
package/src/utils/date.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint no-fallthrough: 0 */
|
|
2
2
|
|
|
3
|
-
import { isDate } from './
|
|
3
|
+
import { isDate } from './is.js'
|
|
4
4
|
import { pad, capitalize } from './format.js'
|
|
5
5
|
import { jalaaliMonthLength } from './private/date-persian.js'
|
|
6
6
|
import lang, { defaultLang } from '../lang.js'
|
package/src/utils/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unref } from 'vue'
|
|
2
2
|
|
|
3
3
|
export function offset (el) {
|
|
4
4
|
if (el === window) {
|
|
@@ -63,10 +63,7 @@ export function getElement (el) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const target =
|
|
67
|
-
? el.value
|
|
68
|
-
: el
|
|
69
|
-
|
|
66
|
+
const target = unref(el)
|
|
70
67
|
if (target) {
|
|
71
68
|
return target.$el || target
|
|
72
69
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
hasMap = typeof Map === 'function',
|
|
3
|
-
hasSet = typeof Set === 'function',
|
|
4
|
-
hasArrayBuffer = typeof ArrayBuffer === 'function'
|
|
5
1
|
|
|
6
2
|
export function isDeepEqual (a, b) {
|
|
7
3
|
if (a === b) {
|
|
@@ -31,7 +27,7 @@ export function isDeepEqual (a, b) {
|
|
|
31
27
|
return true
|
|
32
28
|
}
|
|
33
29
|
|
|
34
|
-
if (
|
|
30
|
+
if (a.constructor === Map) {
|
|
35
31
|
if (a.size !== b.size) {
|
|
36
32
|
return false
|
|
37
33
|
}
|
|
@@ -55,7 +51,7 @@ export function isDeepEqual (a, b) {
|
|
|
55
51
|
return true
|
|
56
52
|
}
|
|
57
53
|
|
|
58
|
-
if (
|
|
54
|
+
if (a.constructor === Set) {
|
|
59
55
|
if (a.size !== b.size) {
|
|
60
56
|
return false
|
|
61
57
|
}
|
|
@@ -71,7 +67,7 @@ export function isDeepEqual (a, b) {
|
|
|
71
67
|
return true
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
if (
|
|
70
|
+
if (a.buffer != null && a.buffer.constructor === ArrayBuffer) {
|
|
75
71
|
length = a.length
|
|
76
72
|
|
|
77
73
|
if (length !== b.length) {
|
|
@@ -137,3 +133,11 @@ export function isRegexp (v) {
|
|
|
137
133
|
export function isNumber (v) {
|
|
138
134
|
return typeof v === 'number' && isFinite(v)
|
|
139
135
|
}
|
|
136
|
+
|
|
137
|
+
export default {
|
|
138
|
+
deepEqual: isDeepEqual,
|
|
139
|
+
object: isObject,
|
|
140
|
+
date: isDate,
|
|
141
|
+
regexp: isRegexp,
|
|
142
|
+
number: isNumber
|
|
143
|
+
}
|
package/src/utils/morph.js
CHANGED
package/src/utils/open-url.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import Platform from '../plugins/Platform.js'
|
|
2
2
|
|
|
3
|
-
import { noop } from '
|
|
3
|
+
import { noop } from './event.js'
|
|
4
|
+
import { isNumber } from './is.js'
|
|
4
5
|
|
|
5
6
|
function parseFeatures (winFeatures) {
|
|
6
7
|
const cfg = Object.assign({ noopener: true }, winFeatures)
|
|
7
8
|
const feat = []
|
|
8
9
|
for (const key in cfg) {
|
|
9
|
-
|
|
10
|
+
const value = cfg[ key ]
|
|
11
|
+
if (value === true) {
|
|
10
12
|
feat.push(key)
|
|
11
13
|
}
|
|
14
|
+
else if (isNumber(value) || (typeof value === 'string' && value !== '')) {
|
|
15
|
+
feat.push(key + '=' + value)
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
return feat.join(',')
|
|
14
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listenOpts } from '../event.js'
|
|
2
|
-
import {
|
|
2
|
+
import { portalProxyList } from '../private/portal.js'
|
|
3
3
|
|
|
4
4
|
let timer
|
|
5
5
|
|
|
@@ -22,10 +22,10 @@ function globalHandler (evt) {
|
|
|
22
22
|
|
|
23
23
|
// check last portal vm if it's
|
|
24
24
|
// a QDialog and not in seamless mode
|
|
25
|
-
let portalIndex =
|
|
25
|
+
let portalIndex = portalProxyList.length - 1
|
|
26
26
|
|
|
27
27
|
while (portalIndex >= 0) {
|
|
28
|
-
const proxy =
|
|
28
|
+
const proxy = portalProxyList[ portalIndex ].$
|
|
29
29
|
|
|
30
30
|
if (proxy.type.name !== 'QDialog') {
|
|
31
31
|
break
|
|
@@ -141,9 +141,9 @@ function jalCal (jy, withoutLeap) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
return {
|
|
144
|
-
leap
|
|
145
|
-
gy
|
|
146
|
-
march
|
|
144
|
+
leap,
|
|
145
|
+
gy,
|
|
146
|
+
march
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -188,9 +188,9 @@ function d2j (jdn) {
|
|
|
188
188
|
jm = 1 + div(k, 31)
|
|
189
189
|
jd = mod(k, 31) + 1
|
|
190
190
|
return {
|
|
191
|
-
jy
|
|
192
|
-
jm
|
|
193
|
-
jd
|
|
191
|
+
jy,
|
|
192
|
+
jm,
|
|
193
|
+
jd
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
else {
|
|
@@ -207,9 +207,9 @@ function d2j (jdn) {
|
|
|
207
207
|
jm = 7 + div(k, 30)
|
|
208
208
|
jd = mod(k, 30) + 1
|
|
209
209
|
return {
|
|
210
|
-
jy
|
|
211
|
-
jm
|
|
212
|
-
jd
|
|
210
|
+
jy,
|
|
211
|
+
jm,
|
|
212
|
+
jd
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -253,9 +253,9 @@ function d2g (jdn) {
|
|
|
253
253
|
gm = mod(div(i, 153), 12) + 1,
|
|
254
254
|
gy = div(j, 1461) - 100100 + div(8 - gm, 6)
|
|
255
255
|
return {
|
|
256
|
-
gy
|
|
257
|
-
gm
|
|
258
|
-
gd
|
|
256
|
+
gy,
|
|
257
|
+
gm,
|
|
258
|
+
gd
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getParentProxy } from './vm.js'
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const portalProxyList = []
|
|
4
4
|
|
|
5
|
-
export function
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
&&
|
|
5
|
+
export function getPortalProxy (el) {
|
|
6
|
+
return portalProxyList.find(proxy =>
|
|
7
|
+
proxy.__qPortalInnerRef.value !== null
|
|
8
|
+
&& proxy.__qPortalInnerRef.value.contains(el)
|
|
9
9
|
)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function closePortalMenus (
|
|
12
|
+
export function closePortalMenus (proxy, evt) {
|
|
13
13
|
do {
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (proxy.$options.name === 'QMenu') {
|
|
15
|
+
proxy.hide(evt)
|
|
16
16
|
|
|
17
17
|
// is this a point of separation?
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
18
|
+
if (proxy.$props.separateClosePopup === true) {
|
|
19
|
+
return getParentProxy(proxy)
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
else if (
|
|
22
|
+
else if (proxy.__qPortalInnerRef !== void 0) {
|
|
23
23
|
// treat it as point of separation if parent is QPopupProxy
|
|
24
24
|
// (so mobile matches desktop behavior)
|
|
25
25
|
// and hide it too
|
|
26
|
-
const parent =
|
|
26
|
+
const parent = getParentProxy(proxy)
|
|
27
27
|
|
|
28
28
|
if (parent !== void 0 && parent.$options.name === 'QPopupProxy') {
|
|
29
|
-
|
|
29
|
+
proxy.hide(evt)
|
|
30
30
|
return parent
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
return
|
|
33
|
+
return proxy
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
} while (
|
|
37
|
+
proxy = getParentProxy(proxy)
|
|
38
|
+
} while (proxy !== void 0 && proxy !== null)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function closePortals (
|
|
42
|
-
while (depth !== 0 &&
|
|
43
|
-
if (
|
|
41
|
+
export function closePortals (proxy, evt, depth) {
|
|
42
|
+
while (depth !== 0 && proxy !== void 0 && proxy !== null) {
|
|
43
|
+
if (proxy.__qPortalInnerRef !== void 0) {
|
|
44
44
|
depth--
|
|
45
45
|
|
|
46
|
-
if (
|
|
47
|
-
|
|
46
|
+
if (proxy.$options.name === 'QMenu') {
|
|
47
|
+
proxy = closePortalMenus(proxy, evt)
|
|
48
48
|
continue
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
proxy.hide(evt)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
proxy = getParentProxy(proxy)
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/utils/private/vm.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
// copied to docs too
|
|
3
|
+
export function getParentProxy (proxy) {
|
|
4
|
+
if (Object(proxy.$parent) === proxy.$parent) {
|
|
5
|
+
return proxy.$parent
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
let { parent } = proxy.$
|
|
8
9
|
|
|
9
|
-
while (Object(
|
|
10
|
-
if (Object(
|
|
11
|
-
return
|
|
10
|
+
while (Object(parent) === parent) {
|
|
11
|
+
if (Object(parent.proxy) === parent.proxy) {
|
|
12
|
+
return parent.proxy
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
parent = parent.parent
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
package/src/utils.js
CHANGED
|
@@ -12,6 +12,7 @@ import extend from './utils/extend.js'
|
|
|
12
12
|
import format from './utils/format.js'
|
|
13
13
|
import frameDebounce from './utils/frame-debounce.js'
|
|
14
14
|
import getCssVar from './utils/get-css-var.js'
|
|
15
|
+
import is from './utils/is.js'
|
|
15
16
|
import morph from './utils/morph.js'
|
|
16
17
|
import openURL from './utils/open-url.js'
|
|
17
18
|
import patterns from './utils/patterns.js'
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
frameDebounce,
|
|
37
38
|
getCssVar,
|
|
38
39
|
noop,
|
|
40
|
+
is,
|
|
39
41
|
morph,
|
|
40
42
|
openURL,
|
|
41
43
|
patterns,
|