@mixd-id/web-scaffold 0.1.230406050 → 0.1.230406052
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/package.json
CHANGED
|
@@ -129,7 +129,7 @@ export default {
|
|
|
129
129
|
|
|
130
130
|
if(caller){
|
|
131
131
|
|
|
132
|
-
const media = this.$util.
|
|
132
|
+
const media = this.$util.calculateMediaPrefix(window.innerWidth)
|
|
133
133
|
let maxHeight, transformOrigin
|
|
134
134
|
let top, right, bottom, left
|
|
135
135
|
if([ '*', 'sm' ].includes(media)){
|
package/src/components/Modal.vue
CHANGED
|
@@ -63,7 +63,10 @@ export default{
|
|
|
63
63
|
class:{ type: String, default: '' },
|
|
64
64
|
dismissable: undefined,
|
|
65
65
|
height: String,
|
|
66
|
-
position:
|
|
66
|
+
position: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'bottom'
|
|
69
|
+
},
|
|
67
70
|
state: [ Number, Boolean, String ],
|
|
68
71
|
transition: { type: String, default: 'slideup' },
|
|
69
72
|
width: String,
|
package/src/index.js
CHANGED
|
@@ -2,11 +2,6 @@ import {defineAsyncComponent, ref} from "vue"
|
|
|
2
2
|
import {observeInit} from './utils/helpers.mjs'
|
|
3
3
|
import throttle from "lodash/throttle"
|
|
4
4
|
|
|
5
|
-
const calculateIsMobile = () => {
|
|
6
|
-
if(typeof window === 'undefined') return false
|
|
7
|
-
return window.innerWidth < window.innerHeight && window.innerWidth <= 800
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
let _UNIQID = 0
|
|
11
6
|
const uniqid = () => {
|
|
12
7
|
return _UNIQID++
|
|
@@ -191,7 +186,7 @@ const util = {
|
|
|
191
186
|
})
|
|
192
187
|
},
|
|
193
188
|
|
|
194
|
-
|
|
189
|
+
calculateMediaPrefix(width){
|
|
195
190
|
|
|
196
191
|
let prefix = '*'
|
|
197
192
|
for(let breakpoint in mediaBreakpoints){
|
|
@@ -201,7 +196,9 @@ const util = {
|
|
|
201
196
|
}
|
|
202
197
|
|
|
203
198
|
return prefix
|
|
204
|
-
}
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
uniqid
|
|
205
202
|
|
|
206
203
|
}
|
|
207
204
|
|
|
@@ -209,18 +206,17 @@ export default{
|
|
|
209
206
|
|
|
210
207
|
install: (app, options) => {
|
|
211
208
|
|
|
212
|
-
let isMobile = ref(calculateIsMobile())
|
|
213
|
-
|
|
214
209
|
if(typeof window !== 'undefined' && 'IntersectionObserver' in window) {
|
|
215
210
|
app.config.globalProperties.$observe = observeInit()
|
|
216
211
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
app.config.globalProperties.$screenPrefix = ref(util.calculateMediaPrefix(window.innerWidth))
|
|
213
|
+
const onWindowResize = throttle(() => {
|
|
214
|
+
app.config.globalProperties.$screenPrefix.value = util.calculateMediaPrefix(window.innerWidth)
|
|
215
|
+
}, 500, { leading:true })
|
|
216
|
+
window.addEventListener('resize', onWindowResize)
|
|
220
217
|
}
|
|
221
218
|
|
|
222
219
|
app.config.globalProperties.uniqid = uniqid
|
|
223
|
-
app.config.globalProperties.isMobile = isMobile
|
|
224
220
|
app.config.globalProperties.$download = download
|
|
225
221
|
app.config.globalProperties.$preload = preload
|
|
226
222
|
app.config.globalProperties.$popPreloads = popPreloads
|