quasar 2.3.4 → 2.4.3
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/Loading.json +2 -6
- package/dist/api/Notify.json +5 -5
- package/dist/api/QAvatar.json +1 -1
- package/dist/api/QBreadcrumbsEl.json +32 -11
- package/dist/api/QBtn.json +32 -16
- package/dist/api/QBtnDropdown.json +33 -17
- package/dist/api/QBtnToggle.json +4 -1
- package/dist/api/QCarousel.json +4 -4
- package/dist/api/QChatMessage.json +4 -12
- package/dist/api/QChip.json +4 -4
- package/dist/api/QExpansionItem.json +34 -13
- package/dist/api/QFab.json +32 -2
- package/dist/api/QFabAction.json +9 -1
- package/dist/api/QField.json +1 -0
- package/dist/api/QFile.json +1 -0
- package/dist/api/QInput.json +1 -0
- package/dist/api/QItem.json +31 -10
- package/dist/api/QLinearProgress.json +1 -1
- package/dist/api/QOptionGroup.json +74 -4
- package/dist/api/QPagination.json +4 -4
- package/dist/api/QPullToRefresh.json +1 -1
- package/dist/api/QRange.json +592 -107
- package/dist/api/QRating.json +3 -3
- package/dist/api/QRouteTab.json +32 -12
- package/dist/api/QSelect.json +4 -7
- package/dist/api/QSlider.json +504 -39
- package/dist/api/QStep.json +4 -4
- package/dist/api/QStepper.json +4 -4
- package/dist/api/QTab.json +1 -1
- package/dist/api/QTable.json +4 -4
- package/dist/api/QTimelineEntry.json +1 -1
- package/dist/api/QToggle.json +1 -1
- package/dist/api/QTree.json +1 -1
- package/dist/api/QUploader.json +16 -2
- package/dist/api/QVideo.json +11 -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/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 +277 -196
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +344 -275
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +243 -189
- package/dist/quasar.umd.js +16670 -16294
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/transforms/loader-asset-urls.json +20 -0
- package/dist/types/api/slider.d.ts +46 -0
- package/dist/types/api/validation.d.ts +4 -0
- package/dist/types/api.d.ts +2 -0
- package/dist/types/composables.d.ts +3 -3
- package/dist/types/index.d.ts +599 -121
- package/dist/types/utils/date.d.ts +2 -1
- package/dist/vetur/quasar-attributes.json +254 -82
- package/dist/vetur/quasar-tags.json +61 -18
- package/dist/web-types/web-types.json +635 -197
- package/package.json +1 -1
- package/src/api.extends.json +1 -2
- package/src/components/breadcrumbs/QBreadcrumbs.js +7 -2
- package/src/components/breadcrumbs/QBreadcrumbs.sass +0 -3
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +14 -8
- package/src/components/btn/QBtn.js +5 -5
- package/src/components/btn/use-btn.js +21 -21
- package/src/components/btn/use-btn.json +22 -13
- package/src/components/btn-toggle/QBtnToggle.json +3 -0
- package/src/components/checkbox/use-checkbox.js +1 -1
- package/src/components/color/QColor.js +32 -26
- package/src/components/color/QColor.sass +10 -23
- package/src/components/date/QDate.sass +2 -0
- package/src/components/dialog/QDialog.js +7 -5
- package/src/components/drawer/QDrawer.js +18 -15
- package/src/components/editor/QEditor.js +1 -1
- package/src/components/editor/QEditor.sass +10 -1
- package/src/components/expansion-item/QExpansionItem.js +4 -1
- package/src/components/fab/QFab.js +18 -12
- package/src/components/fab/QFab.json +33 -0
- package/src/components/fab/QFab.sass +1 -1
- package/src/components/fab/QFabAction.js +14 -7
- package/src/components/fab/QFabAction.json +10 -0
- package/src/components/file/QFile.js +12 -5
- package/src/components/file/QFile.sass +4 -2
- package/src/components/footer/QFooter.js +1 -1
- package/src/components/header/QHeader.js +1 -1
- package/src/components/icon/QIcon.js +1 -1
- package/src/components/infinite-scroll/QInfiniteScroll.js +4 -5
- package/src/components/item/QItem.js +2 -3
- package/src/components/linear-progress/QLinearProgress.json +1 -1
- package/src/components/menu/QMenu.js +6 -2
- package/src/components/option-group/QOptionGroup.js +3 -0
- package/src/components/option-group/QOptionGroup.json +48 -2
- package/src/components/parallax/QParallax.js +4 -2
- package/src/components/popup-edit/QPopupEdit.js +2 -5
- package/src/components/radio/QRadio.js +2 -7
- package/src/components/range/QRange.js +132 -273
- package/src/components/range/QRange.json +11 -121
- package/src/components/rating/QRating.json +3 -3
- package/src/components/resize-observer/QResizeObserver.js +11 -10
- package/src/components/scroll-area/QScrollArea.js +8 -2
- package/src/components/scroll-observer/QScrollObserver.js +2 -0
- package/src/components/select/QSelect.js +4 -1
- package/src/components/slider/QSlider.js +61 -137
- package/src/components/slider/QSlider.json +1 -121
- package/src/components/slider/QSlider.sass +203 -138
- package/src/components/slider/use-slider.js +454 -107
- package/src/components/slider/use-slider.json +546 -0
- package/src/components/stepper/QStepper.js +3 -3
- package/src/components/stepper/QStepper.sass +24 -26
- package/src/components/table/QTable.js +26 -46
- package/src/components/tabs/QRouteTab.js +1 -2
- package/src/components/tabs/QRouteTab.json +0 -7
- package/src/components/tabs/QTabs.js +91 -24
- package/src/components/tabs/use-tab.js +26 -13
- package/src/components/tooltip/QTooltip.js +1 -2
- package/src/components/tree/QTree.js +14 -12
- package/src/components/uploader/QUploader.json +14 -2
- package/src/components/uploader/uploader-core.js +16 -9
- package/src/components/video/QVideo.js +4 -1
- package/src/components/video/QVideo.json +12 -1
- package/src/components/virtual-scroll/QVirtualScroll.sass +1 -0
- package/src/components/virtual-scroll/use-virtual-scroll.js +30 -17
- package/src/composables/private/use-field.js +18 -20
- package/src/composables/private/use-file.js +20 -5
- package/src/composables/private/use-form.js +2 -3
- package/src/composables/private/use-fullscreen.js +15 -4
- package/src/composables/private/use-model-toggle.js +1 -1
- package/src/composables/private/use-portal.js +9 -7
- package/src/composables/private/use-router-link.js +44 -23
- package/src/composables/private/use-router-link.json +26 -10
- package/src/composables/private/use-split-attrs.js +4 -4
- package/src/composables/private/use-tick.js +7 -14
- package/src/composables/private/use-validate.js +21 -15
- package/src/composables/private/use-validate.json +1 -0
- package/src/css/core/helpers.sass +3 -0
- package/src/css/core/positioning.sass +5 -0
- package/src/css/variables.sass +4 -6
- package/src/directives/ScrollFire.js +1 -0
- package/src/icon-set.js +2 -4
- package/src/plugins/AppFullscreen.js +70 -53
- package/src/plugins/AppVisibility.js +2 -3
- package/src/plugins/BottomSheet.js +3 -5
- package/src/plugins/Dialog.js +3 -5
- package/src/plugins/LoadingBar.js +17 -18
- package/src/plugins/Notify.js +296 -295
- package/src/plugins/Platform.js +14 -14
- package/src/utils/clone.js +53 -4
- package/src/utils/date.js +4 -4
- package/src/utils/dom.js +2 -2
- package/src/utils/open-url.js +2 -2
- package/src/utils/patterns.js +1 -0
- package/src/utils/private/define-reactive-plugin.js +10 -8
- package/src/utils/private/focus-manager.js +8 -10
- package/src/utils/private/global-dialog.js +6 -8
- package/src/utils/private/inject-obj-prop.js +13 -0
- package/src/utils/private/is.js +2 -2
|
@@ -2,6 +2,8 @@ import { ref, computed, watch, onBeforeUnmount, getCurrentInstance } from 'vue'
|
|
|
2
2
|
|
|
3
3
|
import useFormChild from '../use-form-child.js'
|
|
4
4
|
import { testPattern } from '../../utils/patterns.js'
|
|
5
|
+
import { debounce } from '../../utils.js'
|
|
6
|
+
import { injectProp } from '../../utils/private/inject-obj-prop.js'
|
|
5
7
|
|
|
6
8
|
const lazyRulesValues = [ true, false, 'ondemand' ]
|
|
7
9
|
|
|
@@ -35,7 +37,8 @@ export default function (focused, innerLoading) {
|
|
|
35
37
|
let validateIndex = 0, unwatchRules
|
|
36
38
|
|
|
37
39
|
const hasRules = computed(() =>
|
|
38
|
-
props.
|
|
40
|
+
props.disable !== true
|
|
41
|
+
&& props.rules !== void 0
|
|
39
42
|
&& props.rules !== null
|
|
40
43
|
&& props.rules.length > 0
|
|
41
44
|
)
|
|
@@ -44,7 +47,7 @@ export default function (focused, innerLoading) {
|
|
|
44
47
|
props.error === true || innerError.value === true
|
|
45
48
|
)
|
|
46
49
|
|
|
47
|
-
const
|
|
50
|
+
const errorMessage = computed(() => (
|
|
48
51
|
typeof props.errorMessage === 'string' && props.errorMessage.length > 0
|
|
49
52
|
? props.errorMessage
|
|
50
53
|
: innerErrorMessage.value
|
|
@@ -69,15 +72,16 @@ export default function (focused, innerLoading) {
|
|
|
69
72
|
}, { immediate: true })
|
|
70
73
|
|
|
71
74
|
watch(focused, val => {
|
|
72
|
-
if (
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
isDirtyModel.value = false
|
|
76
|
-
}
|
|
75
|
+
if (val === true) {
|
|
76
|
+
if (isDirtyModel.value === null) {
|
|
77
|
+
isDirtyModel.value = false
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
}
|
|
80
|
+
else if (isDirtyModel.value === false) {
|
|
81
|
+
isDirtyModel.value = true
|
|
82
|
+
|
|
83
|
+
if (hasRules.value === true && props.lazyRules !== 'ondemand') {
|
|
84
|
+
debouncedValidate()
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
})
|
|
@@ -88,6 +92,7 @@ export default function (focused, innerLoading) {
|
|
|
88
92
|
isDirtyModel.value = null
|
|
89
93
|
innerError.value = false
|
|
90
94
|
innerErrorMessage.value = null
|
|
95
|
+
debouncedValidate.cancel()
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
/*
|
|
@@ -189,25 +194,26 @@ export default function (focused, innerLoading) {
|
|
|
189
194
|
&& props.lazyRules !== 'ondemand'
|
|
190
195
|
&& (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
|
|
191
196
|
) {
|
|
192
|
-
|
|
197
|
+
debouncedValidate()
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
200
|
|
|
201
|
+
const debouncedValidate = debounce(validate, 0)
|
|
202
|
+
|
|
196
203
|
onBeforeUnmount(() => {
|
|
197
204
|
unwatchRules !== void 0 && unwatchRules()
|
|
205
|
+
debouncedValidate.cancel()
|
|
198
206
|
})
|
|
199
207
|
|
|
200
208
|
// expose public methods & props
|
|
201
209
|
Object.assign(proxy, { resetValidation, validate })
|
|
202
|
-
|
|
203
|
-
get: () => hasError.value
|
|
204
|
-
})
|
|
210
|
+
injectProp(proxy, 'hasError', () => hasError.value)
|
|
205
211
|
|
|
206
212
|
return {
|
|
207
213
|
isDirtyModel,
|
|
208
214
|
hasRules,
|
|
209
215
|
hasError,
|
|
210
|
-
|
|
216
|
+
errorMessage,
|
|
211
217
|
|
|
212
218
|
validate,
|
|
213
219
|
resetValidation
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
"rules": {
|
|
30
30
|
"type": "Array",
|
|
31
|
+
"tsType": "ValidationRule",
|
|
31
32
|
"desc": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules",
|
|
32
33
|
"examples": [
|
|
33
34
|
":rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"",
|
|
@@ -69,6 +69,11 @@
|
|
|
69
69
|
max-width: 100vw
|
|
70
70
|
max-height: 100vh
|
|
71
71
|
|
|
72
|
+
body.q-ios-padding .fullscreen
|
|
73
|
+
padding-top: $ios-statusbar-height !important
|
|
74
|
+
padding-top: env(safe-area-inset-top) !important
|
|
75
|
+
padding-bottom: env(safe-area-inset-bottom) !important
|
|
76
|
+
|
|
72
77
|
.absolute-full, .fullscreen, .fixed-full
|
|
73
78
|
top: 0
|
|
74
79
|
right: 0
|
package/src/css/variables.sass
CHANGED
|
@@ -39,20 +39,18 @@ $flex-gutter: ('none': 0, 'xs': $flex-gutter-xs, 'sm': $flex-gutter-sm, 'md': $f
|
|
|
39
39
|
// sorry for long line; we need .sass and it doesn't support multi-line list
|
|
40
40
|
$sizes: ('xs': 0, 'sm': ($breakpoint-xs + 1), 'md': ($breakpoint-sm + 1), 'lg': ($breakpoint-md + 1), 'xl': ($breakpoint-lg + 1)) !default
|
|
41
41
|
|
|
42
|
-
$breakpoint-xs-
|
|
43
|
-
$breakpoint-xs-max: $breakpoint-xs !default
|
|
42
|
+
$breakpoint-xs-max: (map-get($sizes, "sm") - 0.02) !default
|
|
44
43
|
|
|
45
44
|
$breakpoint-sm-min: map-get($sizes, "sm") !default
|
|
46
|
-
$breakpoint-sm-max: $
|
|
45
|
+
$breakpoint-sm-max: (map-get($sizes, "md") - 0.02) !default
|
|
47
46
|
|
|
48
47
|
$breakpoint-md-min: map-get($sizes, "md") !default
|
|
49
|
-
$breakpoint-md-max: $
|
|
48
|
+
$breakpoint-md-max: (map-get($sizes, "lg") - 0.02) !default
|
|
50
49
|
|
|
51
50
|
$breakpoint-lg-min: map-get($sizes, "lg") !default
|
|
52
|
-
$breakpoint-lg-max: $
|
|
51
|
+
$breakpoint-lg-max: (map-get($sizes, "xl") - 0.02) !default
|
|
53
52
|
|
|
54
53
|
$breakpoint-xl-min: map-get($sizes, "xl") !default
|
|
55
|
-
$breakpoint-xl-max: 9999px !default
|
|
56
54
|
|
|
57
55
|
$h1: (size: 6rem, line-height: 6rem, letter-spacing: -.01562em, weight: 300) !default
|
|
58
56
|
$h2: (size: 3.75rem, line-height: 3.75rem, letter-spacing: -.00833em, weight: 300) !default
|
package/src/icon-set.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import defineReactivePlugin from './utils/private/define-reactive-plugin.js'
|
|
2
2
|
import materialIcons from '../icon-set/material-icons.js'
|
|
3
|
+
import { injectProp } from './utils/private/inject-obj-prop.js'
|
|
3
4
|
|
|
4
5
|
const Plugin = defineReactivePlugin({
|
|
5
6
|
iconMapFn: null,
|
|
@@ -42,10 +43,7 @@ const Plugin = defineReactivePlugin({
|
|
|
42
43
|
|
|
43
44
|
$q.iconSet = this.__icons
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
get: () => this.iconMapFn,
|
|
47
|
-
set: val => { this.iconMapFn = val }
|
|
48
|
-
})
|
|
46
|
+
injectProp($q, 'iconMapFn', () => this.iconMapFn, val => { this.iconMapFn = val })
|
|
49
47
|
|
|
50
48
|
if (this.__installed === true) {
|
|
51
49
|
iconSet !== void 0 && this.set(iconSet)
|
|
@@ -3,15 +3,41 @@ import { changeGlobalNodesTarget } from '../utils/private/global-nodes.js'
|
|
|
3
3
|
|
|
4
4
|
const prefixes = {}
|
|
5
5
|
|
|
6
|
+
function assignFn (fn) {
|
|
7
|
+
Object.assign(Plugin, {
|
|
8
|
+
request: fn,
|
|
9
|
+
exit: fn,
|
|
10
|
+
toggle: fn
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
function getFullscreenElement () {
|
|
7
15
|
return (
|
|
8
16
|
document.fullscreenElement
|
|
9
17
|
|| document.mozFullScreenElement
|
|
10
18
|
|| document.webkitFullscreenElement
|
|
11
19
|
|| document.msFullscreenElement
|
|
20
|
+
|| null
|
|
12
21
|
)
|
|
13
22
|
}
|
|
14
23
|
|
|
24
|
+
function updateEl () {
|
|
25
|
+
const newEl = Plugin.activeEl = Plugin.isActive === false
|
|
26
|
+
? null
|
|
27
|
+
: getFullscreenElement()
|
|
28
|
+
|
|
29
|
+
changeGlobalNodesTarget(
|
|
30
|
+
newEl === null || newEl === document.documentElement
|
|
31
|
+
? document.body
|
|
32
|
+
: newEl
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function togglePluginState () {
|
|
37
|
+
Plugin.isActive = Plugin.isActive === false
|
|
38
|
+
updateEl()
|
|
39
|
+
}
|
|
40
|
+
|
|
15
41
|
// needed for consistency across browsers
|
|
16
42
|
function promisify (target, fn) {
|
|
17
43
|
try {
|
|
@@ -31,80 +57,71 @@ const Plugin = defineReactivePlugin({
|
|
|
31
57
|
}, {
|
|
32
58
|
isCapable: false,
|
|
33
59
|
|
|
34
|
-
request (target) {
|
|
35
|
-
if (Plugin.isCapable === true && Plugin.isActive === false) {
|
|
36
|
-
const el = target || document.documentElement
|
|
37
|
-
return promisify(el, prefixes.request)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return Plugin.__getErr()
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
exit () {
|
|
44
|
-
return Plugin.isCapable === true && Plugin.isActive === true
|
|
45
|
-
? promisify(document, prefixes.exit)
|
|
46
|
-
: Plugin.__getErr()
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
toggle (target) {
|
|
50
|
-
return Plugin.isActive === true
|
|
51
|
-
? Plugin.exit()
|
|
52
|
-
: Plugin.request(target)
|
|
53
|
-
},
|
|
54
|
-
|
|
55
60
|
install ({ $q }) {
|
|
56
61
|
$q.fullscreen = this
|
|
57
62
|
}
|
|
58
63
|
})
|
|
59
64
|
|
|
60
|
-
if (__QUASAR_SSR_SERVER__
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
if (__QUASAR_SSR_SERVER__ === true) {
|
|
66
|
+
assignFn(() => Promise.resolve())
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
prefixes.request = [
|
|
70
|
+
'requestFullscreen',
|
|
71
|
+
'msRequestFullscreen', 'mozRequestFullScreen', 'webkitRequestFullscreen'
|
|
72
|
+
].find(request => document.documentElement[ request ] !== void 0)
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
Plugin.isCapable = prefixes.request !== void 0
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
if (Plugin.isCapable === false) {
|
|
77
|
+
// it means the browser does NOT support it
|
|
78
|
+
assignFn(() => Promise.reject('Not capable'))
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
Object.assign(Plugin, {
|
|
82
|
+
request (target) {
|
|
83
|
+
const el = target || document.documentElement
|
|
84
|
+
const { activeEl } = Plugin
|
|
85
|
+
|
|
86
|
+
if (el === activeEl) {
|
|
87
|
+
return Promise.resolve()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const queue = activeEl !== null && el.contains(activeEl) === true
|
|
91
|
+
? Plugin.exit()
|
|
92
|
+
: Promise.resolve()
|
|
74
93
|
|
|
75
|
-
|
|
94
|
+
return queue.finally(() => promisify(el, prefixes.request))
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
exit () {
|
|
98
|
+
return Plugin.isActive === true
|
|
99
|
+
? promisify(document, prefixes.exit)
|
|
100
|
+
: Promise.resolve()
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
toggle (target) {
|
|
104
|
+
return Plugin.isActive === true
|
|
105
|
+
? Plugin.exit()
|
|
106
|
+
: Plugin.request(target)
|
|
107
|
+
}
|
|
108
|
+
})
|
|
76
109
|
|
|
77
110
|
prefixes.exit = [
|
|
78
111
|
'exitFullscreen',
|
|
79
112
|
'msExitFullscreen', 'mozCancelFullScreen', 'webkitExitFullscreen'
|
|
80
113
|
].find(exit => document[ exit ])
|
|
81
114
|
|
|
82
|
-
Plugin.isActive =
|
|
115
|
+
Plugin.isActive = Boolean(getFullscreenElement())
|
|
116
|
+
Plugin.isActive === true && updateEl()
|
|
83
117
|
|
|
84
118
|
;[
|
|
85
119
|
'onfullscreenchange',
|
|
86
120
|
'onmsfullscreenchange', 'onwebkitfullscreenchange'
|
|
87
121
|
].forEach(evt => {
|
|
88
|
-
document[ evt ] =
|
|
89
|
-
Plugin.isActive = Plugin.isActive === false
|
|
90
|
-
|
|
91
|
-
if (Plugin.isActive === false) {
|
|
92
|
-
Plugin.activeEl = null
|
|
93
|
-
changeGlobalNodesTarget(document.body)
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
Plugin.activeEl = getFullscreenElement()
|
|
97
|
-
changeGlobalNodesTarget(
|
|
98
|
-
Plugin.activeEl === document.documentElement
|
|
99
|
-
? document.body
|
|
100
|
-
: Plugin.activeEl
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
}
|
|
122
|
+
document[ evt ] = togglePluginState
|
|
104
123
|
})
|
|
105
124
|
}
|
|
106
|
-
|
|
107
|
-
init()
|
|
108
125
|
}
|
|
109
126
|
|
|
110
127
|
export default Plugin
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import defineReactivePlugin from '../utils/private/define-reactive-plugin.js'
|
|
2
|
+
import { injectProp } from '../utils/private/inject-obj-prop.js'
|
|
2
3
|
|
|
3
4
|
const Plugin = defineReactivePlugin({
|
|
4
5
|
appVisible: true
|
|
@@ -9,9 +10,7 @@ const Plugin = defineReactivePlugin({
|
|
|
9
10
|
return
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
get: () => this.appVisible
|
|
14
|
-
})
|
|
13
|
+
injectProp($q, 'appVisible', () => this.appVisible)
|
|
15
14
|
}
|
|
16
15
|
})
|
|
17
16
|
|
|
@@ -3,11 +3,9 @@ import globalDialog from '../utils/private/global-dialog.js'
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
install ({ $q, parentApp }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
else {
|
|
10
|
-
this.create = $q.bottomSheet = globalDialog(BottomSheet, false, parentApp)
|
|
6
|
+
$q.bottomSheet = globalDialog(BottomSheet, false, parentApp)
|
|
7
|
+
if (this.__installed !== true) {
|
|
8
|
+
this.create = $q.bottomSheet
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
}
|
package/src/plugins/Dialog.js
CHANGED
|
@@ -3,11 +3,9 @@ import globalDialog from '../utils/private/global-dialog.js'
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
install ({ $q, parentApp }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
else {
|
|
10
|
-
this.create = $q.dialog = globalDialog(DialogPlugin, true, parentApp)
|
|
6
|
+
$q.dialog = globalDialog(DialogPlugin, true, parentApp)
|
|
7
|
+
if (this.__installed !== true) {
|
|
8
|
+
this.create = $q.dialog
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
}
|
|
@@ -7,9 +7,9 @@ import { createChildApp } from '../install-quasar.js'
|
|
|
7
7
|
|
|
8
8
|
import QAjaxBar from '../components/ajax-bar/QAjaxBar.js'
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const barRef = ref(null)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const Plugin = defineReactivePlugin({
|
|
13
13
|
isActive: false
|
|
14
14
|
}, {
|
|
15
15
|
start: noop,
|
|
@@ -31,41 +31,40 @@ export default defineReactivePlugin({
|
|
|
31
31
|
|
|
32
32
|
const props = ref(
|
|
33
33
|
$q.config.loadingBar !== void 0
|
|
34
|
-
? { ...$q.config.loadingBar
|
|
35
|
-
: {
|
|
34
|
+
? { ...$q.config.loadingBar }
|
|
35
|
+
: {}
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
const el = createGlobalNode('q-loading-bar')
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
createChildApp({
|
|
41
41
|
name: 'LoadingBar',
|
|
42
42
|
|
|
43
43
|
// hide App from Vue devtools
|
|
44
44
|
devtools: { hide: true },
|
|
45
45
|
|
|
46
|
-
setup: () => () => h(QAjaxBar, props.value)
|
|
46
|
+
setup: () => () => h(QAjaxBar, { ...props.value, ref: barRef })
|
|
47
47
|
}, parentApp).mount(el)
|
|
48
48
|
|
|
49
49
|
Object.assign(this, {
|
|
50
|
-
start
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.isActive = bar.calls > 0
|
|
50
|
+
start (speed) {
|
|
51
|
+
barRef.value.start(speed)
|
|
52
|
+
Plugin.isActive = barRef.value.calls > 0
|
|
54
53
|
},
|
|
55
|
-
stop
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.isActive = bar.calls > 0
|
|
54
|
+
stop () {
|
|
55
|
+
barRef.value.stop()
|
|
56
|
+
Plugin.isActive = barRef.value.calls > 0
|
|
59
57
|
},
|
|
60
58
|
increment () {
|
|
61
|
-
|
|
62
|
-
bar.increment.apply(null, arguments)
|
|
59
|
+
barRef.value.increment.apply(null, arguments)
|
|
63
60
|
},
|
|
64
|
-
setDefaults
|
|
61
|
+
setDefaults (opts) {
|
|
65
62
|
if (opts === Object(opts)) {
|
|
66
|
-
|
|
63
|
+
Object.assign(props.value, opts)
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
})
|
|
70
67
|
}
|
|
71
68
|
})
|
|
69
|
+
|
|
70
|
+
export default Plugin
|