@mixd-id/web-scaffold 0.1.230406082 → 0.1.230406083
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 +1 -1
- package/src/components/CodeEditor.vue +0 -1
- package/src/components/Flex.vue +11 -14
- package/src/components/Image360.vue +2 -2
- package/src/components/ListView.vue +0 -1
- package/src/components/TabView.vue +0 -1
- package/src/components/TableViewHead.vue +2 -2
- package/src/components/TextBlock.vue +1 -1
- package/src/index.js +2 -1
- package/src/mixin/component.js +3 -2
- package/src/widgets/ContactForm.vue +21 -10
- package/src/widgets/ContactFormSetting.vue +15 -0
- package/src/widgets/FlexSetting.vue +20 -3
- package/src/widgets/Share.vue +1 -1
- package/src/widgets/StyleSetting.vue +1 -1
- package/src/widgets/WebPageBuilder.vue +3 -3
package/package.json
CHANGED
package/src/components/Flex.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
2
|
+
<div :class="compClass" :style="computedStyle">
|
|
3
3
|
|
|
4
4
|
<component v-for="(item, idx) in computedItems"
|
|
5
5
|
:is="item.type"
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
:class="itemClass(idx)" />
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
|
-
|
|
14
13
|
</template>
|
|
15
14
|
|
|
16
15
|
<script>
|
|
@@ -27,29 +26,27 @@ export default{
|
|
|
27
26
|
columnType: Array,
|
|
28
27
|
},
|
|
29
28
|
|
|
29
|
+
methods: {
|
|
30
|
+
|
|
31
|
+
itemClass(idx){
|
|
32
|
+
return ((this.flexColumns ?? [])[idx] ?? []).join(' ')
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
30
36
|
computed: {
|
|
31
37
|
|
|
32
38
|
computedItems(){
|
|
33
39
|
return this.items.filter((_) => _.props.enabled)
|
|
34
40
|
},
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const classNames = [
|
|
42
|
+
compClass(){
|
|
43
|
+
return [
|
|
39
44
|
this.$style.comp,
|
|
40
45
|
this.extClass
|
|
41
46
|
]
|
|
42
|
-
|
|
43
|
-
return classNames.join(' ')
|
|
47
|
+
.join(' ')
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
methods: {
|
|
49
|
-
|
|
50
|
-
itemClass(idx){
|
|
51
|
-
return (this.flexColumns[idx] ?? []).join(' ')
|
|
52
|
-
},
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
}
|
package/src/index.js
CHANGED
|
@@ -318,7 +318,8 @@ export default{
|
|
|
318
318
|
app.component('BoxItem', defineAsyncComponent(() => import("./widgets/BoxItem.vue")))
|
|
319
319
|
app.component('BoxSetting', defineAsyncComponent(() => import("./widgets/BoxSetting.vue")))
|
|
320
320
|
app.component('ButtonItem', defineAsyncComponent(() => import("./widgets/ButtonItem.vue")))
|
|
321
|
-
app.component('ButtonSetting', defineAsyncComponent(() => import("./
|
|
321
|
+
app.component('ButtonSetting', defineAsyncComponent(() => import("./wid" +
|
|
322
|
+
"gets/ButtonSetting.vue")))
|
|
322
323
|
app.component('CarouselItem', defineAsyncComponent(() => import("./widgets/CarouselItem.vue")))
|
|
323
324
|
app.component('CarouselSetting', defineAsyncComponent(() => import("./widgets/CarouselSetting.vue")))
|
|
324
325
|
app.component('ContactForm', defineAsyncComponent(() => import("./widgets/ContactForm.vue")))
|
package/src/mixin/component.js
CHANGED
|
@@ -32,7 +32,8 @@ export const componentMixin = {
|
|
|
32
32
|
direction: Array,
|
|
33
33
|
gap: Array,
|
|
34
34
|
display: Array,
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
flexColumns: Array,
|
|
36
37
|
|
|
37
38
|
fontFamily: Array,
|
|
38
39
|
fontSize: Array,
|
|
@@ -64,7 +65,7 @@ export const componentMixin = {
|
|
|
64
65
|
|
|
65
66
|
computedStyle(){
|
|
66
67
|
return {
|
|
67
|
-
'background-image':
|
|
68
|
+
'background-image': 'xmd' === 'md' ? (this.bgImages[1] ?? this.bgImages[0]) : this.bgImages[0]
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
<div class="flex flex-col gap-4">
|
|
11
11
|
<div v-for="field in fields">
|
|
12
12
|
<label class="text-gray-700">{{ field.label ?? field.type }}</label>
|
|
13
|
-
<Textbox v-if="field.type === 'name'" v-model="form[field.type]" class="bg-white text-xl" :readonly="
|
|
14
|
-
<Textbox v-if="field.type === 'email'" v-model="form[field.type]" class="bg-white text-xl w-[300px] max-w-full" :readonly="
|
|
15
|
-
<Textbox v-else-if="field.type === 'mobileNumber'" v-model="form[field.type]" class="bg-white text-xl" type="tel" :readonly="
|
|
16
|
-
<Textbox v-else-if="field.type === 'referralCode'" v-model="form[field.type]" class="bg-white text-xl w-[200px] max-w-full" :readonly="
|
|
17
|
-
<Textarea v-else-if="field.type === 'remark'" v-model="form[field.type]" rows="2" :readonly="
|
|
13
|
+
<Textbox v-if="field.type === 'name'" v-model="form[field.type]" class="bg-white text-xl" :readonly="completed" />
|
|
14
|
+
<Textbox v-if="field.type === 'email'" v-model="form[field.type]" class="bg-white text-xl md:w-[300px] max-w-full" :readonly="completed" />
|
|
15
|
+
<Textbox v-else-if="field.type === 'mobileNumber'" v-model="form[field.type]" class="bg-white text-xl" type="tel" :readonly="completed" />
|
|
16
|
+
<Textbox v-else-if="field.type === 'referralCode'" v-model="form[field.type]" class="bg-white text-xl md:w-[200px] max-w-full" :readonly="completed" />
|
|
17
|
+
<Textarea v-else-if="field.type === 'remark'" v-model="form[field.type]" rows="2" :readonly="completed"></Textarea>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
<Button ref="submitBtn" class="w-full" @click="submitForm" :state="!canSubmit ? -1 : 1">
|
|
22
|
-
<h5>{{
|
|
22
|
+
<h5>{{ completed ? 'Form berhasil dikirim' : 'Kirim' }}</h5>
|
|
23
23
|
</Button>
|
|
24
24
|
|
|
25
25
|
</div>
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<script>
|
|
30
30
|
|
|
31
31
|
import {componentMixin} from "../mixin/component";
|
|
32
|
+
import axios from "axios";
|
|
32
33
|
|
|
33
34
|
export default{
|
|
34
35
|
|
|
@@ -53,6 +54,8 @@ export default{
|
|
|
53
54
|
description: String,
|
|
54
55
|
fields: Array,
|
|
55
56
|
onSubmit: Array,
|
|
57
|
+
submitUrl: String,
|
|
58
|
+
submitMethod: String
|
|
56
59
|
|
|
57
60
|
},
|
|
58
61
|
|
|
@@ -60,10 +63,18 @@ export default{
|
|
|
60
63
|
|
|
61
64
|
submitForm(){
|
|
62
65
|
if('edit-mode' in this.$route.query) return
|
|
66
|
+
if(!this.submitUrl) return
|
|
63
67
|
|
|
64
68
|
this.$refs.submitBtn.setState(2)
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
axios({
|
|
70
|
+
method: this.submitMethod ?? 'post',
|
|
71
|
+
url: this.submitUrl,
|
|
72
|
+
data: this.form,
|
|
73
|
+
params: this.form
|
|
74
|
+
})
|
|
75
|
+
.then(_ => this.completed = true)
|
|
76
|
+
.catch(err => this.alert(err))
|
|
77
|
+
.finally(_ => this.$refs.submitBtn.resetState(2))
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
},
|
|
@@ -72,7 +83,7 @@ export default{
|
|
|
72
83
|
|
|
73
84
|
canSubmit(){
|
|
74
85
|
return this.fields.every(field => [ 'referralCode', 'email', 'remark' ].includes(field.type) || this.form[field.type]) &&
|
|
75
|
-
!this.
|
|
86
|
+
!this.completed
|
|
76
87
|
},
|
|
77
88
|
|
|
78
89
|
compClass(){
|
|
@@ -92,7 +103,7 @@ export default{
|
|
|
92
103
|
data(){
|
|
93
104
|
return {
|
|
94
105
|
form: {},
|
|
95
|
-
|
|
106
|
+
completed: false
|
|
96
107
|
}
|
|
97
108
|
},
|
|
98
109
|
|
|
@@ -85,6 +85,21 @@
|
|
|
85
85
|
</ListItem>
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
|
+
<div>
|
|
89
|
+
<label class="text-text-400">Submit URL</label>
|
|
90
|
+
<div class="flex flex-row gap-2 mt-1">
|
|
91
|
+
<Dropdown v-model="item.props.submitMethod"
|
|
92
|
+
class="w-[100px]"
|
|
93
|
+
@change="$emit('change')">
|
|
94
|
+
<option value="get">GET</option>
|
|
95
|
+
<option value="post">POST</option>
|
|
96
|
+
</Dropdown>
|
|
97
|
+
<Textbox v-model="item.props.submitUrl"
|
|
98
|
+
class="flex-1"
|
|
99
|
+
@keyup.enter="$emit('change')"/>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
88
103
|
<ComponentSetting :item="item"
|
|
89
104
|
:view-type="viewType"
|
|
90
105
|
:view-types="viewTypes"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<label class="text-text-400">Direction</label>
|
|
9
9
|
<Dropdown v-for="(_, idx) in viewTypes"
|
|
10
10
|
v-show="viewType === _.value"
|
|
11
|
-
v-model="
|
|
11
|
+
v-model="direction[idx]"
|
|
12
12
|
@change="$emit('change')">
|
|
13
13
|
<option value="">Default</option>
|
|
14
14
|
<option :value="`${viewType}flex-row`">Row</option>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<label class="text-text-400">Gap</label>
|
|
23
23
|
<Dropdown v-for="(_, idx) in viewTypes"
|
|
24
24
|
v-show="viewType === _.value"
|
|
25
|
-
v-model="
|
|
25
|
+
v-model="gap[idx]"
|
|
26
26
|
class="w-[120px]"
|
|
27
27
|
@change="$emit('change')">
|
|
28
28
|
<option value="">Not Set</option>
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
</template>
|
|
69
69
|
</ListItem>
|
|
70
|
-
|
|
71
70
|
<div class="text-center">
|
|
72
71
|
<button type="button" class="p-3 text-primary" @click="item.props.flexColumns.push([ '', '' ])">Add Column</button>
|
|
73
72
|
</div>
|
|
@@ -103,6 +102,24 @@ export default{
|
|
|
103
102
|
|
|
104
103
|
viewTypes: Array,
|
|
105
104
|
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
computed: {
|
|
108
|
+
|
|
109
|
+
direction(){
|
|
110
|
+
if(!Array.isArray(this.item.props.direction))
|
|
111
|
+
this.item.props.direction = [ 'flex-column' ]
|
|
112
|
+
|
|
113
|
+
return this.item.props.direction
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
gap(){
|
|
117
|
+
if(!Array.isArray(this.item.props.gap))
|
|
118
|
+
this.item.props.gap = [ 'gap-2' ]
|
|
119
|
+
|
|
120
|
+
return this.item.props.gap
|
|
121
|
+
}
|
|
122
|
+
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
}
|
package/src/widgets/Share.vue
CHANGED
|
@@ -78,7 +78,7 @@ export default{
|
|
|
78
78
|
<style module>
|
|
79
79
|
|
|
80
80
|
.comp{
|
|
81
|
-
@apply
|
|
81
|
+
@apply flex flex-row md:flex-col gap-2 items-center md:items-start;
|
|
82
82
|
background-image: v-bind(bgImages[0]);
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -664,7 +664,7 @@ export default{
|
|
|
664
664
|
listen(){
|
|
665
665
|
this.socketEmit2('page.subscribe', { name:'page' })
|
|
666
666
|
.then(() => {
|
|
667
|
-
|
|
667
|
+
|
|
668
668
|
})
|
|
669
669
|
.catch((err) => this.toast(err))
|
|
670
670
|
},
|
|
@@ -672,7 +672,7 @@ export default{
|
|
|
672
672
|
stopListen(){
|
|
673
673
|
this.socketEmit2('page.unsubscribe', { name:'page' })
|
|
674
674
|
.then(() => {
|
|
675
|
-
|
|
675
|
+
|
|
676
676
|
})
|
|
677
677
|
.catch((err) => this.toast(err))
|
|
678
678
|
},
|
|
@@ -855,7 +855,7 @@ export default{
|
|
|
855
855
|
}},
|
|
856
856
|
|
|
857
857
|
{ type:'Flex', name:'Flex', group:'Layouts', items:[], props:{
|
|
858
|
-
flexColumns: [], direction: [], gap: [],
|
|
858
|
+
flexColumns: [], direction: [ 'flex-col' ], gap: [],
|
|
859
859
|
}},
|
|
860
860
|
|
|
861
861
|
{ type:'Grid', name:'Grid', group:'Layouts', items:[], gap:[], props:{
|