@mixd-id/web-scaffold 0.1.230406136 → 0.1.230406138
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
package/src/components/Image.vue
CHANGED
|
@@ -66,7 +66,9 @@ export default{
|
|
|
66
66
|
computed:{
|
|
67
67
|
|
|
68
68
|
actualSrc(){
|
|
69
|
-
|
|
69
|
+
if(typeof window !== 'undefined'){
|
|
70
|
+
return this.mediaSrc[this.$screenPrefix]
|
|
71
|
+
}
|
|
70
72
|
},
|
|
71
73
|
|
|
72
74
|
compClass(){
|
|
@@ -109,6 +111,7 @@ export default{
|
|
|
109
111
|
},
|
|
110
112
|
|
|
111
113
|
unmounted() {
|
|
114
|
+
this.$observe.unregister(this.$el)
|
|
112
115
|
this.$unresize(this.onResize)
|
|
113
116
|
},
|
|
114
117
|
|
|
@@ -259,6 +262,7 @@ export default{
|
|
|
259
262
|
watch:{
|
|
260
263
|
|
|
261
264
|
src(to){
|
|
265
|
+
this.mediaSrc = {}
|
|
262
266
|
this.loadSrc()
|
|
263
267
|
},
|
|
264
268
|
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {defineAsyncComponent, reactive
|
|
2
|
-
import {
|
|
1
|
+
import {defineAsyncComponent, reactive} from "vue"
|
|
2
|
+
import {observeInit} from './utils/helpers.mjs'
|
|
3
3
|
import throttle from "lodash/throttle"
|
|
4
4
|
|
|
5
5
|
let _UNIQID = 0
|
|
@@ -252,7 +252,7 @@ const util = {
|
|
|
252
252
|
let prefix = ''
|
|
253
253
|
for(let breakpoint in mediaBreakpoints){
|
|
254
254
|
if(width > breakpoint){
|
|
255
|
-
prefix = mediaBreakpoints[breakpoint]
|
|
255
|
+
prefix = mediaBreakpoints[breakpoint] ?? prefix
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -273,12 +273,11 @@ export default{
|
|
|
273
273
|
app.config.globalProperties.$observe = observeInit()
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
app.config.globalProperties.$screenPrefix =
|
|
276
|
+
app.config.globalProperties.$screenPrefix = util.calculateMediaPrefix(window.innerWidth)
|
|
277
277
|
const onWindowResize = throttle(() => {
|
|
278
278
|
app.config.globalProperties.$screenPrefix = util.calculateMediaPrefix(window.innerWidth)
|
|
279
279
|
resizeEvents.forEach((fn) => fn())
|
|
280
|
-
|
|
281
|
-
}, 500, { leading:true })
|
|
280
|
+
}, 1000, { leading:true })
|
|
282
281
|
|
|
283
282
|
window.addEventListener('resize', onWindowResize)
|
|
284
283
|
}
|
|
@@ -348,7 +347,6 @@ export default{
|
|
|
348
347
|
app.component('Countdown', defineAsyncComponent(() => import("./components/Countdown.vue")))
|
|
349
348
|
app.component('Datepicker', defineAsyncComponent(() => import("./components/Datepicker.vue")))
|
|
350
349
|
app.component('Dropdown', defineAsyncComponent(() => import("./components/Dropdown.vue")))
|
|
351
|
-
app.component('DynamicTemplate', defineAsyncComponent(() => import("./components/DynamicTemplate.vue")))
|
|
352
350
|
app.component('ErrorText', defineAsyncComponent(() => import("./components/ErrorText.vue")))
|
|
353
351
|
app.component('Feed', defineAsyncComponent(() => import("./components/Feed.vue")))
|
|
354
352
|
app.component('Gmaps', defineAsyncComponent(() => import("./components/Gmaps.vue")))
|
package/src/utils/helpers.mjs
CHANGED
|
@@ -281,8 +281,7 @@ function observeInit(){
|
|
|
281
281
|
|
|
282
282
|
const observeCols = {}
|
|
283
283
|
|
|
284
|
-
const once = function(el, callback)
|
|
285
|
-
{
|
|
284
|
+
const once = function(el, callback){
|
|
286
285
|
if(typeof el.__observeKey !== 'undefined') return
|
|
287
286
|
|
|
288
287
|
intersectionObserver.observe(el)
|
|
@@ -292,8 +291,7 @@ function observeInit(){
|
|
|
292
291
|
el.__observeKey = key
|
|
293
292
|
}
|
|
294
293
|
|
|
295
|
-
const always = function(el, callback)
|
|
296
|
-
{
|
|
294
|
+
const always = function(el, callback){
|
|
297
295
|
if(typeof el.__observeKey !== 'undefined') return
|
|
298
296
|
|
|
299
297
|
intersectionObserver.observe(el)
|
|
@@ -33,8 +33,12 @@
|
|
|
33
33
|
|
|
34
34
|
<div class="flex flex-row gap-4" v-if="!page.isSystem">
|
|
35
35
|
<div class="flex flex-col gap-1">
|
|
36
|
-
<label class="text-text-400 w-[40px]">{{ $t('
|
|
37
|
-
<
|
|
36
|
+
<label class="text-text-400 w-[40px]">{{ $t('Status') }}</label>
|
|
37
|
+
<Dropdown v-model="page.status" @change="save">
|
|
38
|
+
<option :value="-1">{{ $t('Disabled') }}</option>
|
|
39
|
+
<option :value="0">{{ $t('Draft') }}</option>
|
|
40
|
+
<option :value="1">{{ $t('Active') }}</option>
|
|
41
|
+
</Dropdown>
|
|
38
42
|
</div>
|
|
39
43
|
|
|
40
44
|
<div class="flex-1">
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$style.comp">
|
|
3
|
-
<component :is="components"></component>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
import * as Vue from "vue/dist/vue.esm-bundler";
|
|
10
|
-
|
|
11
|
-
export default{
|
|
12
|
-
|
|
13
|
-
props: [ 'template' ],
|
|
14
|
-
|
|
15
|
-
data(){
|
|
16
|
-
return {
|
|
17
|
-
components: null
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
watch: {
|
|
22
|
-
|
|
23
|
-
template: {
|
|
24
|
-
immediate: true,
|
|
25
|
-
handler(to){
|
|
26
|
-
this.components = Vue.compile(to)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style module>
|
|
39
|
-
|
|
40
|
-
.comp{
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
</style>
|