quasar 2.4.11 → 2.5.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/BottomSheet.json +4 -0
- package/dist/api/Dialog.json +5 -1
- package/dist/api/Notify.json +20 -10
- package/dist/api/QBtnDropdown.json +4 -2
- package/dist/api/QCheckbox.json +27 -0
- package/dist/api/QEditor.json +4 -2
- package/dist/api/QExpansionItem.json +6 -3
- package/dist/api/QFab.json +4 -2
- package/dist/api/QFabAction.json +4 -2
- package/dist/api/QFile.json +4 -2
- package/dist/api/QImg.json +1 -2
- package/dist/api/QInnerLoading.json +2 -1
- package/dist/api/QInput.json +4 -2
- package/dist/api/QPagination.json +4 -2
- package/dist/api/QRadio.json +18 -0
- package/dist/api/QRange.json +9 -0
- package/dist/api/QScrollArea.json +13 -5
- package/dist/api/QSelect.json +6 -3
- package/dist/api/QSlider.json +9 -0
- package/dist/api/QSplitter.json +8 -4
- package/dist/api/QTable.json +9 -0
- package/dist/api/QTime.json +8 -2
- package/dist/api/QToggle.json +24 -24
- 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 +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/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 +43 -10
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +60 -23
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +34 -11
- package/dist/quasar.umd.js +314 -157
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/transforms/auto-import.json +39 -3
- package/dist/transforms/import-map.json +18 -0
- package/dist/types/api/slider.d.ts +6 -7
- package/dist/types/api/vue-prop-types.ts +15 -0
- package/dist/types/api.d.ts +1 -0
- package/dist/types/index.d.ts +110 -184
- package/dist/types/utils/date.d.ts +25 -13
- package/dist/types/utils/dom.d.ts +4 -2
- package/dist/types/utils.d.ts +3 -1
- package/dist/vetur/quasar-attributes.json +62 -42
- package/dist/vetur/quasar-tags.json +8 -3
- package/dist/web-types/web-types.json +103 -58
- package/package.json +13 -3
- package/src/components/avatar/__tests__/QAvatar.spec.js +121 -0
- package/src/components/badge/__tests__/QBadge.spec.js +74 -0
- package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
- package/src/components/btn/__tests__/QBtn.spec.js +55 -0
- package/src/components/btn/__tests__/use-btn.spec.js +189 -0
- package/src/components/btn-dropdown/QBtnDropdown.json +4 -2
- package/src/components/checkbox/QCheckbox.js +34 -3
- package/src/components/checkbox/QCheckbox.json +17 -0
- package/src/components/checkbox/QCheckbox.sass +17 -5
- package/src/components/checkbox/use-checkbox.js +4 -0
- package/src/components/checkbox/use-checkbox.json +18 -0
- package/src/components/chip/__tests__/QChip.spec.js +155 -0
- package/src/components/date/__tests__/QDate.spec.js +189 -0
- package/src/components/date/__tests__/use-datetime.spec.js +83 -0
- package/src/components/dialog/QDialog.js +1 -1
- package/src/components/dialog/__tests__/QDialog.spec.js +129 -0
- package/src/components/editor/QEditor.js +1 -1
- package/src/components/editor/QEditor.json +3 -1
- package/src/components/editor/__tests__/QEditor.spec.js +195 -0
- package/src/components/expansion-item/QExpansionItem.json +6 -3
- package/src/components/fab/use-fab.json +4 -2
- package/src/components/field/QField.sass +2 -0
- package/src/components/file/QFile.json +4 -2
- package/src/components/form/QForm.js +27 -25
- package/src/components/img/QImg.json +2 -3
- package/src/components/inner-loading/QInnerLoading.json +2 -1
- package/src/components/input/QInput.js +10 -1
- package/src/components/input/QInput.json +4 -2
- package/src/components/input/__tests__/QInput.spec.js +105 -0
- package/src/components/input/__tests__/use-mask.spec.js +29 -0
- package/src/components/menu/QMenu.js +2 -1
- package/src/components/menu/__tests__/QMenu.spec.js +610 -0
- package/src/components/menu/__tests__/WrapperOne.vue +51 -0
- package/src/components/menu/__tests__/WrapperTwo.vue +38 -0
- package/src/components/pagination/QPagination.json +4 -2
- package/src/components/radio/QRadio.js +26 -1
- package/src/components/radio/QRadio.json +16 -0
- package/src/components/radio/QRadio.sass +17 -6
- package/src/components/scroll-area/QScrollArea.json +13 -5
- package/src/components/select/QSelect.js +13 -9
- package/src/components/select/QSelect.json +6 -3
- package/src/components/select/QSelect.sass +1 -0
- package/src/components/select/__tests__/QSelect.spec.js +2003 -0
- package/src/components/select/__tests__/WrapperOne.vue +28 -0
- package/src/components/slider/use-slider.json +9 -0
- package/src/components/splitter/QSplitter.json +8 -4
- package/src/components/stepper/QStep.js +19 -14
- package/src/components/stepper/QStepper.sass +3 -0
- package/src/components/table/QTable.json +9 -0
- package/src/components/table/__tests__/QTable.spec.js +635 -0
- package/src/components/table/__tests__/QTd.spec.js +35 -0
- package/src/components/table/__tests__/QTh.spec.js +27 -0
- package/src/components/table/__tests__/QTr.spec.js +27 -0
- package/src/components/tabs/__tests__/QRouteTab.spec.js +9 -0
- package/src/components/tabs/__tests__/QTab.spec.js +79 -0
- package/src/components/tabs/__tests__/QTabs.spec.js +147 -0
- package/src/components/time/QTime.json +2 -2
- package/src/components/toggle/QToggle.js +5 -13
- package/src/components/toggle/QToggle.json +3 -12
- package/src/components/uploader/__tests__/QUploader.spec.js +161 -0
- package/src/components/virtual-scroll/use-virtual-scroll.js +9 -6
- package/src/composables/private/__tests__/FieldWrapper.vue +39 -0
- package/src/composables/private/__tests__/use-anchor.spec.js +99 -0
- package/src/composables/private/__tests__/use-field.spec.js +351 -0
- package/src/composables/private/__tests__/use-file.spec.js +69 -0
- package/src/composables/private/__tests__/use-form.spec.js +11 -0
- package/src/composables/private/__tests__/use-fullscreen.spec.js +37 -0
- package/src/composables/private/__tests__/use-model-toggle.spec.js +306 -0
- package/src/composables/private/__tests__/use-portal.spec.js +4 -0
- package/src/composables/private/__tests__/use-router-link.spec.js +55 -0
- package/src/composables/private/__tests__/use-size.spec.js +37 -0
- package/src/composables/private/__tests__/use-transition.spec.js +108 -0
- package/src/composables/private/__tests__/use-validate.spec.js +111 -0
- package/src/composables/private/use-field.js +5 -8
- package/src/composables/private/use-fullscreen.js +1 -1
- package/src/composables/private/use-model-toggle.js +1 -1
- package/src/composables/private/use-validate.js +22 -22
- package/src/plugins/BottomSheet.json +1 -0
- package/src/plugins/Dialog.json +1 -0
- package/src/plugins/Meta.js +1 -1
- package/src/plugins/Notify.json +20 -10
- package/src/plugins/Screen.js +11 -8
- package/src/utils/date.js +111 -32
- package/src/utils/private/global-dialog.json +3 -0
- package/src/utils/private/vm.js +14 -8
|
@@ -37,12 +37,16 @@ export default function (focused, innerLoading) {
|
|
|
37
37
|
let validateIndex = 0, unwatchRules
|
|
38
38
|
|
|
39
39
|
const hasRules = computed(() =>
|
|
40
|
-
props.
|
|
41
|
-
&& props.rules !== void 0
|
|
40
|
+
props.rules !== void 0
|
|
42
41
|
&& props.rules !== null
|
|
43
42
|
&& props.rules.length > 0
|
|
44
43
|
)
|
|
45
44
|
|
|
45
|
+
const hasActiveRules = computed(() =>
|
|
46
|
+
props.disable !== true
|
|
47
|
+
&& hasRules.value === true
|
|
48
|
+
)
|
|
49
|
+
|
|
46
50
|
const hasError = computed(() =>
|
|
47
51
|
props.error === true || innerError.value === true
|
|
48
52
|
)
|
|
@@ -80,7 +84,14 @@ export default function (focused, innerLoading) {
|
|
|
80
84
|
else if (isDirtyModel.value === false) {
|
|
81
85
|
isDirtyModel.value = true
|
|
82
86
|
|
|
83
|
-
if (
|
|
87
|
+
if (
|
|
88
|
+
hasActiveRules.value === true
|
|
89
|
+
&& props.lazyRules !== 'ondemand'
|
|
90
|
+
// Don't re-trigger if it's already in progress;
|
|
91
|
+
// It might mean that focus switched to submit btn and
|
|
92
|
+
// QForm's submit() has been called already (ENTER key)
|
|
93
|
+
&& innerLoading.value === false
|
|
94
|
+
) {
|
|
84
95
|
debouncedValidate()
|
|
85
96
|
}
|
|
86
97
|
}
|
|
@@ -102,11 +113,11 @@ export default function (focused, innerLoading) {
|
|
|
102
113
|
* - Promise (pending async validation)
|
|
103
114
|
*/
|
|
104
115
|
function validate (val = props.modelValue) {
|
|
105
|
-
if (
|
|
116
|
+
if (hasActiveRules.value !== true) {
|
|
106
117
|
return true
|
|
107
118
|
}
|
|
108
119
|
|
|
109
|
-
validateIndex
|
|
120
|
+
const index = ++validateIndex
|
|
110
121
|
|
|
111
122
|
if (innerLoading.value !== true && props.lazyRules !== true) {
|
|
112
123
|
isDirtyModel.value = true
|
|
@@ -123,9 +134,7 @@ export default function (focused, innerLoading) {
|
|
|
123
134
|
innerErrorMessage.value = m
|
|
124
135
|
}
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
innerLoading.value = false
|
|
128
|
-
}
|
|
137
|
+
innerLoading.value = false
|
|
129
138
|
}
|
|
130
139
|
|
|
131
140
|
const promises = []
|
|
@@ -155,42 +164,33 @@ export default function (focused, innerLoading) {
|
|
|
155
164
|
return true
|
|
156
165
|
}
|
|
157
166
|
|
|
158
|
-
|
|
159
|
-
innerLoading.value = true
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const index = validateIndex
|
|
167
|
+
innerLoading.value = true
|
|
163
168
|
|
|
164
169
|
return Promise.all(promises).then(
|
|
165
170
|
res => {
|
|
166
|
-
if (index !== validateIndex) {
|
|
167
|
-
return true
|
|
168
|
-
}
|
|
169
|
-
|
|
170
171
|
if (res === void 0 || Array.isArray(res) === false || res.length === 0) {
|
|
171
|
-
update(false)
|
|
172
|
+
index === validateIndex && update(false)
|
|
172
173
|
return true
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
const msg = res.find(r => r === false || typeof r === 'string')
|
|
176
|
-
update(msg !== void 0, msg)
|
|
177
|
+
index === validateIndex && update(msg !== void 0, msg)
|
|
177
178
|
return msg === void 0
|
|
178
179
|
},
|
|
179
180
|
e => {
|
|
180
181
|
if (index === validateIndex) {
|
|
181
182
|
console.error(e)
|
|
182
183
|
update(true)
|
|
183
|
-
return false
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
return
|
|
186
|
+
return false
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
function validateIfNeeded (changedRules) {
|
|
192
192
|
if (
|
|
193
|
-
|
|
193
|
+
hasActiveRules.value === true
|
|
194
194
|
&& props.lazyRules !== 'ondemand'
|
|
195
195
|
&& (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
|
|
196
196
|
) {
|
package/src/plugins/Dialog.json
CHANGED
package/src/plugins/Meta.js
CHANGED
|
@@ -140,7 +140,7 @@ function apply ({ add, remove }) {
|
|
|
140
140
|
function getAttr (seed) {
|
|
141
141
|
return att => {
|
|
142
142
|
const val = seed[ att ]
|
|
143
|
-
return att + (val !== void 0 ? `="${ val }"` : '')
|
|
143
|
+
return att + (val !== true && val !== void 0 ? `="${ val }"` : '')
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
package/src/plugins/Notify.json
CHANGED
|
@@ -254,7 +254,8 @@
|
|
|
254
254
|
]
|
|
255
255
|
},
|
|
256
256
|
"badgeStyle": {
|
|
257
|
-
"type": [ "
|
|
257
|
+
"type": [ "String", "Array", "Object" ],
|
|
258
|
+
"tsType": "VueStyleProp",
|
|
258
259
|
"desc": "Style definitions to be attributed to the badge",
|
|
259
260
|
"examples": [
|
|
260
261
|
"background-color: #ff0000",
|
|
@@ -262,7 +263,8 @@
|
|
|
262
263
|
]
|
|
263
264
|
},
|
|
264
265
|
"badgeClass": {
|
|
265
|
-
"type": [ "
|
|
266
|
+
"type": [ "String", "Array", "Object" ],
|
|
267
|
+
"tsType": "VueClassProp",
|
|
266
268
|
"desc": "Class definitions to be attributed to the badge",
|
|
267
269
|
"examples": [
|
|
268
270
|
"my-special-class",
|
|
@@ -275,7 +277,8 @@
|
|
|
275
277
|
"desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
|
|
276
278
|
},
|
|
277
279
|
"progressClass": {
|
|
278
|
-
"type": [ "
|
|
280
|
+
"type": [ "String", "Array", "Object" ],
|
|
281
|
+
"tsType": "VueClassProp",
|
|
279
282
|
"desc": "Class definitions to be attributed to the progress bar",
|
|
280
283
|
"examples": [
|
|
281
284
|
"my-special-class",
|
|
@@ -406,7 +409,8 @@
|
|
|
406
409
|
"desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
|
|
407
410
|
},
|
|
408
411
|
"progressClass": {
|
|
409
|
-
"type": [ "
|
|
412
|
+
"type": [ "String", "Array", "Object" ],
|
|
413
|
+
"tsType": "VueClassProp",
|
|
410
414
|
"desc": "Class definitions to be attributed to the progress bar",
|
|
411
415
|
"examples": [
|
|
412
416
|
"my-special-class",
|
|
@@ -566,7 +570,8 @@
|
|
|
566
570
|
"examples": [ "bottom-right" ]
|
|
567
571
|
},
|
|
568
572
|
"badgeStyle": {
|
|
569
|
-
"type": [ "
|
|
573
|
+
"type": [ "String", "Array", "Object" ],
|
|
574
|
+
"tsType": "VueStyleProp",
|
|
570
575
|
"desc": "Style definitions to be attributed to the badge",
|
|
571
576
|
"examples": [
|
|
572
577
|
"background-color: #ff0000",
|
|
@@ -574,7 +579,8 @@
|
|
|
574
579
|
]
|
|
575
580
|
},
|
|
576
581
|
"badgeClass": {
|
|
577
|
-
"type": [ "
|
|
582
|
+
"type": [ "String", "Array", "Object" ],
|
|
583
|
+
"tsType": "VueClassProp",
|
|
578
584
|
"desc": "Class definitions to be attributed to the badge",
|
|
579
585
|
"examples": [
|
|
580
586
|
"my-special-class",
|
|
@@ -587,7 +593,8 @@
|
|
|
587
593
|
"desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
|
|
588
594
|
},
|
|
589
595
|
"progressClass": {
|
|
590
|
-
"type": [ "
|
|
596
|
+
"type": [ "String", "Array", "Object" ],
|
|
597
|
+
"tsType": "VueClassProp",
|
|
591
598
|
"desc": "Class definitions to be attributed to the progress bar",
|
|
592
599
|
"examples": [
|
|
593
600
|
"my-special-class",
|
|
@@ -746,7 +753,8 @@
|
|
|
746
753
|
"examples": [ "bottom-right" ]
|
|
747
754
|
},
|
|
748
755
|
"badgeStyle": {
|
|
749
|
-
"type": [ "
|
|
756
|
+
"type": [ "String", "Array", "Object" ],
|
|
757
|
+
"tsType": "VueStyleProp",
|
|
750
758
|
"desc": "Style definitions to be attributed to the badge",
|
|
751
759
|
"examples": [
|
|
752
760
|
"background-color: #ff0000",
|
|
@@ -754,7 +762,8 @@
|
|
|
754
762
|
]
|
|
755
763
|
},
|
|
756
764
|
"badgeClass": {
|
|
757
|
-
"type": [ "
|
|
765
|
+
"type": [ "String", "Array", "Object" ],
|
|
766
|
+
"tsType": "VueClassProp",
|
|
758
767
|
"desc": "Class definitions to be attributed to the badge",
|
|
759
768
|
"examples": [
|
|
760
769
|
"my-special-class",
|
|
@@ -767,7 +776,8 @@
|
|
|
767
776
|
"desc": "Show progress bar to detail when notification will disappear automatically (unless timeout is 0)"
|
|
768
777
|
},
|
|
769
778
|
"progressClass": {
|
|
770
|
-
"type": [ "
|
|
779
|
+
"type": [ "String", "Array", "Object" ],
|
|
780
|
+
"tsType": "VueClassProp",
|
|
771
781
|
"desc": "Class definitions to be attributed to the progress bar",
|
|
772
782
|
"examples": [
|
|
773
783
|
"my-special-class",
|
package/src/plugins/Screen.js
CHANGED
|
@@ -58,12 +58,19 @@ export default defineReactivePlugin({
|
|
|
58
58
|
return
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
const { visualViewport } = window
|
|
62
|
+
const target = visualViewport || window
|
|
63
|
+
const getSize = visualViewport === void 0
|
|
64
|
+
? () => [ window.innerWidth, window.innerHeight ]
|
|
65
|
+
: () => [
|
|
66
|
+
visualViewport.width * visualViewport.scale + window.innerWidth - document.scrollingElement.clientWidth,
|
|
67
|
+
visualViewport.height * visualViewport.scale + window.innerHeight - document.scrollingElement.clientHeight
|
|
68
|
+
]
|
|
69
|
+
|
|
61
70
|
const classes = $q.config.screen !== void 0 && $q.config.screen.bodyClasses === true
|
|
62
71
|
|
|
63
72
|
this.__update = force => {
|
|
64
|
-
const
|
|
65
|
-
w = window.innerWidth,
|
|
66
|
-
h = window.innerHeight
|
|
73
|
+
const [ w, h ] = getSize()
|
|
67
74
|
|
|
68
75
|
if (h !== this.height) {
|
|
69
76
|
this.height = h
|
|
@@ -121,11 +128,7 @@ export default defineReactivePlugin({
|
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
const start = () => {
|
|
124
|
-
const
|
|
125
|
-
style = getComputedStyle(document.body),
|
|
126
|
-
target = window.visualViewport !== void 0
|
|
127
|
-
? window.visualViewport
|
|
128
|
-
: window
|
|
131
|
+
const style = getComputedStyle(document.body)
|
|
129
132
|
|
|
130
133
|
// if css props available
|
|
131
134
|
if (style.getPropertyValue('--q-size-sm')) {
|
package/src/utils/date.js
CHANGED
|
@@ -174,19 +174,18 @@ function formatTimezone (offset, delimeter = '') {
|
|
|
174
174
|
function applyYearMonthDayChange (date, mod, sign) {
|
|
175
175
|
let
|
|
176
176
|
year = date.getFullYear(),
|
|
177
|
-
month = date.getMonth()
|
|
178
|
-
day = date.getDate()
|
|
177
|
+
month = date.getMonth()
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
year += sign * mod.years
|
|
182
|
-
}
|
|
179
|
+
const day = date.getDate()
|
|
183
180
|
|
|
184
|
-
if (mod.
|
|
185
|
-
|
|
181
|
+
if (mod.year !== void 0) {
|
|
182
|
+
year += sign * mod.year
|
|
183
|
+
delete mod.year
|
|
186
184
|
}
|
|
187
185
|
|
|
188
|
-
if (mod.
|
|
189
|
-
|
|
186
|
+
if (mod.month !== void 0) {
|
|
187
|
+
month += sign * mod.month
|
|
188
|
+
delete mod.month
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
date.setDate(1)
|
|
@@ -194,26 +193,14 @@ function applyYearMonthDayChange (date, mod, sign) {
|
|
|
194
193
|
|
|
195
194
|
date.setFullYear(year)
|
|
196
195
|
date.setMonth(month)
|
|
197
|
-
date.setDate(day)
|
|
198
|
-
|
|
199
|
-
return date
|
|
200
|
-
}
|
|
196
|
+
date.setDate(Math.min(day, daysInMonth(date)))
|
|
201
197
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
t = mod.years !== void 0 || mod.months !== void 0 || mod.days !== void 0
|
|
206
|
-
? applyYearMonthDayChange(d, mod, sign)
|
|
207
|
-
: d
|
|
208
|
-
|
|
209
|
-
for (const key in mod) {
|
|
210
|
-
if (key !== 'years' && key !== 'months' && key !== 'days') {
|
|
211
|
-
const op = capitalize(key)
|
|
212
|
-
t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
|
|
213
|
-
}
|
|
198
|
+
if (mod.date !== void 0) {
|
|
199
|
+
date.setDate(date.getDate() + sign * mod.date)
|
|
200
|
+
delete mod.date
|
|
214
201
|
}
|
|
215
202
|
|
|
216
|
-
return
|
|
203
|
+
return date
|
|
217
204
|
}
|
|
218
205
|
|
|
219
206
|
function applyYearMonthDay (date, mod, middle) {
|
|
@@ -230,22 +217,86 @@ function applyYearMonthDay (date, mod, middle) {
|
|
|
230
217
|
date[ `set${ middle }Month` ](month)
|
|
231
218
|
date[ `set${ middle }Date` ](day)
|
|
232
219
|
|
|
220
|
+
delete mod.year
|
|
221
|
+
delete mod.month
|
|
222
|
+
delete mod.date
|
|
223
|
+
|
|
233
224
|
return date
|
|
234
225
|
}
|
|
235
226
|
|
|
236
|
-
|
|
227
|
+
function getChange (date, rawMod, sign) {
|
|
237
228
|
const
|
|
229
|
+
mod = normalizeMod(rawMod),
|
|
230
|
+
d = new Date(date),
|
|
231
|
+
t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
|
|
232
|
+
? applyYearMonthDayChange(d, mod, sign) // removes year/month/day
|
|
233
|
+
: d
|
|
234
|
+
|
|
235
|
+
for (const key in mod) {
|
|
236
|
+
const op = capitalize(key)
|
|
237
|
+
t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return t
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function normalizeMod (mod) {
|
|
244
|
+
const acc = { ...mod }
|
|
245
|
+
|
|
246
|
+
if (mod.years !== void 0) {
|
|
247
|
+
acc.year = mod.years
|
|
248
|
+
delete acc.years
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (mod.months !== void 0) {
|
|
252
|
+
acc.month = mod.months
|
|
253
|
+
delete acc.months
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (mod.days !== void 0) {
|
|
257
|
+
acc.date = mod.days
|
|
258
|
+
delete acc.days
|
|
259
|
+
}
|
|
260
|
+
if (mod.day !== void 0) {
|
|
261
|
+
acc.date = mod.day
|
|
262
|
+
delete acc.day
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (mod.hour !== void 0) {
|
|
266
|
+
acc.hours = mod.hour
|
|
267
|
+
delete acc.hour
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (mod.minute !== void 0) {
|
|
271
|
+
acc.minutes = mod.minute
|
|
272
|
+
delete acc.minute
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (mod.second !== void 0) {
|
|
276
|
+
acc.seconds = mod.second
|
|
277
|
+
delete acc.second
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (mod.millisecond !== void 0) {
|
|
281
|
+
acc.milliseconds = mod.millisecond
|
|
282
|
+
delete acc.millisecond
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return acc
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function adjustDate (date, rawMod, utc) {
|
|
289
|
+
const
|
|
290
|
+
mod = normalizeMod(rawMod),
|
|
238
291
|
middle = utc === true ? 'UTC' : '',
|
|
239
292
|
d = new Date(date),
|
|
240
293
|
t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
|
|
241
|
-
? applyYearMonthDay(d, mod, middle)
|
|
294
|
+
? applyYearMonthDay(d, mod, middle) // removes year/month/day
|
|
242
295
|
: d
|
|
243
296
|
|
|
244
297
|
for (const key in mod) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
t[ `set${ middle }${ op }` ](mod[ key ])
|
|
248
|
-
}
|
|
298
|
+
const op = key.charAt(0).toUpperCase() + key.slice(1)
|
|
299
|
+
t[ `set${ middle }${ op }` ](mod[ key ])
|
|
249
300
|
}
|
|
250
301
|
|
|
251
302
|
return t
|
|
@@ -479,16 +530,23 @@ export function startOfDate (date, unit, utc) {
|
|
|
479
530
|
|
|
480
531
|
switch (unit) {
|
|
481
532
|
case 'year':
|
|
533
|
+
case 'years':
|
|
482
534
|
t[ `${ prefix }Month` ](0)
|
|
483
535
|
case 'month':
|
|
536
|
+
case 'months':
|
|
484
537
|
t[ `${ prefix }Date` ](1)
|
|
485
538
|
case 'day':
|
|
539
|
+
case 'days':
|
|
540
|
+
case 'date':
|
|
486
541
|
t[ `${ prefix }Hours` ](0)
|
|
487
542
|
case 'hour':
|
|
543
|
+
case 'hours':
|
|
488
544
|
t[ `${ prefix }Minutes` ](0)
|
|
489
545
|
case 'minute':
|
|
546
|
+
case 'minutes':
|
|
490
547
|
t[ `${ prefix }Seconds` ](0)
|
|
491
548
|
case 'second':
|
|
549
|
+
case 'seconds':
|
|
492
550
|
t[ `${ prefix }Milliseconds` ](0)
|
|
493
551
|
}
|
|
494
552
|
return t
|
|
@@ -501,16 +559,23 @@ export function endOfDate (date, unit, utc) {
|
|
|
501
559
|
|
|
502
560
|
switch (unit) {
|
|
503
561
|
case 'year':
|
|
562
|
+
case 'years':
|
|
504
563
|
t[ `${ prefix }Month` ](11)
|
|
505
564
|
case 'month':
|
|
565
|
+
case 'months':
|
|
506
566
|
t[ `${ prefix }Date` ](daysInMonth(t))
|
|
507
567
|
case 'day':
|
|
568
|
+
case 'days':
|
|
569
|
+
case 'date':
|
|
508
570
|
t[ `${ prefix }Hours` ](23)
|
|
509
571
|
case 'hour':
|
|
572
|
+
case 'hours':
|
|
510
573
|
t[ `${ prefix }Minutes` ](59)
|
|
511
574
|
case 'minute':
|
|
575
|
+
case 'minutes':
|
|
512
576
|
t[ `${ prefix }Seconds` ](59)
|
|
513
577
|
case 'second':
|
|
578
|
+
case 'seconds':
|
|
514
579
|
t[ `${ prefix }Milliseconds` ](999)
|
|
515
580
|
}
|
|
516
581
|
return t
|
|
@@ -546,21 +611,28 @@ export function getDateDiff (date, subtract, unit = 'days') {
|
|
|
546
611
|
|
|
547
612
|
switch (unit) {
|
|
548
613
|
case 'years':
|
|
614
|
+
case 'year':
|
|
549
615
|
return (t.getFullYear() - sub.getFullYear())
|
|
550
616
|
|
|
551
617
|
case 'months':
|
|
618
|
+
case 'month':
|
|
552
619
|
return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
|
|
553
620
|
|
|
554
621
|
case 'days':
|
|
622
|
+
case 'day':
|
|
623
|
+
case 'date':
|
|
555
624
|
return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
|
|
556
625
|
|
|
557
626
|
case 'hours':
|
|
627
|
+
case 'hour':
|
|
558
628
|
return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
|
|
559
629
|
|
|
560
630
|
case 'minutes':
|
|
631
|
+
case 'minute':
|
|
561
632
|
return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
|
|
562
633
|
|
|
563
634
|
case 'seconds':
|
|
635
|
+
case 'second':
|
|
564
636
|
return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
|
|
565
637
|
}
|
|
566
638
|
}
|
|
@@ -606,26 +678,33 @@ export function isSameDate (date, date2, unit) {
|
|
|
606
678
|
|
|
607
679
|
switch (unit) {
|
|
608
680
|
case 'second':
|
|
681
|
+
case 'seconds':
|
|
609
682
|
if (t.getSeconds() !== d.getSeconds()) {
|
|
610
683
|
return false
|
|
611
684
|
}
|
|
612
685
|
case 'minute': // intentional fall-through
|
|
686
|
+
case 'minutes':
|
|
613
687
|
if (t.getMinutes() !== d.getMinutes()) {
|
|
614
688
|
return false
|
|
615
689
|
}
|
|
616
690
|
case 'hour': // intentional fall-through
|
|
691
|
+
case 'hours':
|
|
617
692
|
if (t.getHours() !== d.getHours()) {
|
|
618
693
|
return false
|
|
619
694
|
}
|
|
620
695
|
case 'day': // intentional fall-through
|
|
696
|
+
case 'days':
|
|
697
|
+
case 'date':
|
|
621
698
|
if (t.getDate() !== d.getDate()) {
|
|
622
699
|
return false
|
|
623
700
|
}
|
|
624
701
|
case 'month': // intentional fall-through
|
|
702
|
+
case 'months':
|
|
625
703
|
if (t.getMonth() !== d.getMonth()) {
|
|
626
704
|
return false
|
|
627
705
|
}
|
|
628
706
|
case 'year': // intentional fall-through
|
|
707
|
+
case 'years':
|
|
629
708
|
if (t.getFullYear() !== d.getFullYear()) {
|
|
630
709
|
return false
|
|
631
710
|
}
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
"definition": {
|
|
10
10
|
"class": {
|
|
11
11
|
"type": [ "String", "Array", "Object" ],
|
|
12
|
+
"tsType": "VueClassProp",
|
|
12
13
|
"desc": "CSS Class name to apply to the Dialog's QCard",
|
|
13
14
|
"examples": [ "my-class" ]
|
|
14
15
|
},
|
|
15
16
|
|
|
16
17
|
"style": {
|
|
17
18
|
"type": [ "String", "Array", "Object" ],
|
|
19
|
+
"tsType": "VueStyleProp",
|
|
18
20
|
"desc": "CSS style to apply to the Dialog's QCard",
|
|
19
21
|
"examples": [ "border: 2px solid black" ]
|
|
20
22
|
}
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
"type": "Object",
|
|
27
29
|
"desc": "Chainable Object",
|
|
28
30
|
"tsType": "DialogChainObject",
|
|
31
|
+
"autoDefineTsType": true,
|
|
29
32
|
"definition": {
|
|
30
33
|
"onOk": {
|
|
31
34
|
"type": "Function",
|
package/src/utils/private/vm.js
CHANGED
|
@@ -15,19 +15,25 @@ export function getParentVm (vm) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function fillNormalizedVNodes (children, vnode) {
|
|
19
|
+
if (typeof vnode.type === 'symbol') {
|
|
20
|
+
if (Array.isArray(vnode.children) === true) {
|
|
21
|
+
vnode.children.forEach(child => {
|
|
22
|
+
fillNormalizedVNodes(children, child)
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
children.add(vnode)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
// vnodes from rendered in advanced slots
|
|
19
32
|
export function getNormalizedVNodes (vnodes) {
|
|
20
33
|
const children = new Set()
|
|
21
34
|
|
|
22
35
|
vnodes.forEach(vnode => {
|
|
23
|
-
|
|
24
|
-
vnode.children.forEach(child => {
|
|
25
|
-
children.add(child)
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
children.add(vnode)
|
|
30
|
-
}
|
|
36
|
+
fillNormalizedVNodes(children, vnode)
|
|
31
37
|
})
|
|
32
38
|
|
|
33
39
|
return Array.from(children)
|