@mixd-id/web-scaffold 0.1.230406087 → 0.1.230406088
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
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
<div ref="inner" :class="innerClass">
|
|
5
5
|
<div v-for="item in items" :class="itemClass">
|
|
6
|
-
<component :is="item.type"
|
|
6
|
+
<component :is="item.type"
|
|
7
|
+
:uid="item.uid"
|
|
8
|
+
:="item.props"
|
|
9
|
+
:ratio="ratio"
|
|
10
|
+
:ext-class="item.extClass" />
|
|
7
11
|
</div>
|
|
8
12
|
</div>
|
|
9
13
|
|
|
@@ -5,33 +5,6 @@
|
|
|
5
5
|
v-show="viewType === _.value">
|
|
6
6
|
<div class="grid grid-cols-2 gap-4">
|
|
7
7
|
|
|
8
|
-
<div class="col-span-2">
|
|
9
|
-
<div class="flex flex-row gap-2">
|
|
10
|
-
<label class="flex-1 text-text-400">Items</label>
|
|
11
|
-
<button type="button" class="text-primary"
|
|
12
|
-
@click="$refs.imageModal.open({ viewType, item:{ type:'Image', props:{ src:[], margin:[], padding:[], bdColor:[], bdSize:[ '0' ], bdRadius:[], bdStyle:[ 'solid' ] } } })">Add Item</button>
|
|
13
|
-
</div>
|
|
14
|
-
<ListItem :items="item.props.items" class="mt-1"
|
|
15
|
-
@reorder="(from, to) => { item.props.items.splice(to, 0, item.props.items.splice(from, 1)[0]); $emit('change') }">
|
|
16
|
-
<template v-slot="{ item:comp, index }">
|
|
17
|
-
<div class="flex flex-row gap-3 p-2 bg-base-500 items-center rounded-lg mb-2">
|
|
18
|
-
<div data-reorder>
|
|
19
|
-
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="flex-1"
|
|
22
|
-
@click="$refs.imageModal.open({ item:comp, index, viewType })">
|
|
23
|
-
<component :is="`${comp.type}Item`" :item="comp" :viewType="viewType" :viewTypes="viewTypes" />
|
|
24
|
-
</div>
|
|
25
|
-
<div>
|
|
26
|
-
<button type="button" @click="confirm('Remove item?', { onConfirm: () => { item.props.items.splice(index, 1); $emit('change') }})">
|
|
27
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
28
|
-
</button>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
</ListItem>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
8
|
<div>
|
|
36
9
|
<label class="text-text-400">Ratio</label>
|
|
37
10
|
<Dropdown v-model="item.props.ratio[idx]" class="mt-1" @change="$emit('change')">
|
|
@@ -105,8 +78,8 @@
|
|
|
105
78
|
<template #foot="{ context }">
|
|
106
79
|
<div class="p-5">
|
|
107
80
|
<Button type="button" class="w-full" @click="context.index >= 0 ?
|
|
108
|
-
item.
|
|
109
|
-
item.
|
|
81
|
+
item.items[context.index] = context.item :
|
|
82
|
+
item.items.push(context.item);
|
|
110
83
|
$refs.imageModal.close();
|
|
111
84
|
$emit('change')
|
|
112
85
|
">
|
|
@@ -154,6 +127,12 @@ export default{
|
|
|
154
127
|
|
|
155
128
|
imageRatio(){
|
|
156
129
|
return 'aspect-[4/1] md:aspect-[8/1]'
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
items(){
|
|
133
|
+
if(!Array.isArray(this.item.items))
|
|
134
|
+
this.item.items = []
|
|
135
|
+
return this.item.items
|
|
157
136
|
}
|
|
158
137
|
|
|
159
138
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
2
|
+
<div :class="compClass">
|
|
3
3
|
<div :class="$style.form">
|
|
4
4
|
|
|
5
5
|
<div>
|
|
@@ -49,6 +49,7 @@ export default{
|
|
|
49
49
|
padding: Array,
|
|
50
50
|
enabled: undefined,
|
|
51
51
|
name: String,
|
|
52
|
+
class: String,
|
|
52
53
|
|
|
53
54
|
title: String,
|
|
54
55
|
description: String,
|
|
@@ -89,8 +90,6 @@ export default{
|
|
|
89
90
|
compClass(){
|
|
90
91
|
return [
|
|
91
92
|
this.$style.comp,
|
|
92
|
-
this.status === 1 && this.spinnerType === 'shimmer' && !this.$slots['loading'] ?
|
|
93
|
-
this.$style.shimmer : '',
|
|
94
93
|
this.extClass,
|
|
95
94
|
this.class ?? ''
|
|
96
95
|
]
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<div class="flex flex-row items-center gap-2 p-3 bg-base-500 rounded-lg">
|
|
24
24
|
<svg data-reorder width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
25
25
|
<div class="flex-1 px-2">
|
|
26
|
-
<label>{{ field.type }}</label>
|
|
26
|
+
<label>{{ field.label ?? field.type }}</label>
|
|
27
27
|
</div>
|
|
28
28
|
<button type="button" @click="confirm($t('Remove this item?'), '', () => { item.props.fields.splice(index, 1); $emit('change') })">
|
|
29
29
|
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
@@ -108,25 +108,10 @@
|
|
|
108
108
|
|
|
109
109
|
<ContextMenu ref="fieldOpt" position="bottom-right">
|
|
110
110
|
<div class="flex flex-col gap-1 min-w-[120px]">
|
|
111
|
-
<button
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<button class="p-3 bg-base-500 text-left pl-8 hover:bg-text-50"
|
|
116
|
-
@click="item.props.fields.push({ type:'mobileNumber', label:'Nomor HP' });$emit('change')">
|
|
117
|
-
Mobile Number
|
|
118
|
-
</button>
|
|
119
|
-
<button class="p-3 bg-base-500 text-left pl-8 hover:bg-text-50"
|
|
120
|
-
@click="item.props.fields.push({ type:'email', label:'Email' });$emit('change')">
|
|
121
|
-
Email
|
|
122
|
-
</button>
|
|
123
|
-
<button class="p-3 bg-base-500 text-left pl-8 hover:bg-text-50"
|
|
124
|
-
@click="item.props.fields.push({ type:'remark', label:'Pertanyaan' });$emit('change')">
|
|
125
|
-
Pertanyaan
|
|
126
|
-
</button>
|
|
127
|
-
<button class="p-3 bg-base-500 text-left pl-8 hover:bg-text-50"
|
|
128
|
-
@click="item.props.fields.push({ type:'referralCode', label:'Kode Referral (optional)' });$emit('change')">
|
|
129
|
-
Referral Code
|
|
111
|
+
<button v-for="field in fields"
|
|
112
|
+
class="p-3 bg-base-500 text-left pl-8 hover:bg-text-50"
|
|
113
|
+
@click="item.props.fields.push(field);$emit('change')">
|
|
114
|
+
{{ field.label }}
|
|
130
115
|
</button>
|
|
131
116
|
</div>
|
|
132
117
|
</ContextMenu>
|
|
@@ -164,6 +149,25 @@ export default{
|
|
|
164
149
|
|
|
165
150
|
},
|
|
166
151
|
|
|
152
|
+
data(){
|
|
153
|
+
return {
|
|
154
|
+
fields: [
|
|
155
|
+
{ type:'name', label:'Nama' },
|
|
156
|
+
{ type:'mobileNumber', label:'Nomor HP' },
|
|
157
|
+
{ type:'email', label:'Email' },
|
|
158
|
+
{ type:'remark', label:'Pertanyaan' },
|
|
159
|
+
{ type:'referralCode', label:'Kode Referral (optional)' },
|
|
160
|
+
{ type:'ktpNumber', label:'Nomor KTP' },
|
|
161
|
+
{ type:'birthDate', label:'Tanggal Lahir' },
|
|
162
|
+
{ type:'position', label:'Jabatan yang Dilamar' },
|
|
163
|
+
{ type:'provinceName', label:'Propinsi Domisili' },
|
|
164
|
+
{ type:'education', label:'Pendidikan Terakhir' },
|
|
165
|
+
{ type:'major', label:'Jurusan' },
|
|
166
|
+
{ type:'university', label:'Nama Sekolah/Institusi/Universitas' },
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
167
171
|
methods: {
|
|
168
172
|
|
|
169
173
|
addField(type){
|
|
@@ -564,6 +564,7 @@ export default{
|
|
|
564
564
|
},
|
|
565
565
|
|
|
566
566
|
generateExtClass(props){
|
|
567
|
+
if(!props || typeof props !== 'object') return ''
|
|
567
568
|
|
|
568
569
|
return [
|
|
569
570
|
props.padding ? props.padding.join(' ') : '',
|
|
@@ -604,7 +605,6 @@ export default{
|
|
|
604
605
|
]
|
|
605
606
|
.filter(_ => _)
|
|
606
607
|
.join(' ')
|
|
607
|
-
|
|
608
608
|
},
|
|
609
609
|
|
|
610
610
|
setExtClass(components){
|
|
@@ -618,6 +618,14 @@ export default{
|
|
|
618
618
|
comp.items = this.setExtClass(comp.items)
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
+
if(comp.props && Array.isArray(comp.props.items)){
|
|
622
|
+
comp.props.items = this.setExtClass(comp.props.items)
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if(comp.type === 'Carousel'){
|
|
626
|
+
console.log('Carousel', comp)
|
|
627
|
+
}
|
|
628
|
+
|
|
621
629
|
return comp
|
|
622
630
|
})
|
|
623
631
|
},
|
|
@@ -815,9 +823,9 @@ export default{
|
|
|
815
823
|
|
|
816
824
|
components: [
|
|
817
825
|
|
|
818
|
-
{ type:'Carousel', name:'Carousel', group:'Widgets', props:{
|
|
826
|
+
{ type:'Carousel', name:'Carousel', group:'Widgets', items:[], props:{
|
|
819
827
|
name: 'Untitled Carousel',
|
|
820
|
-
ratio:[ '4/3', '8/3' ]
|
|
828
|
+
ratio:[ '4/3', '8/3' ]
|
|
821
829
|
}},
|
|
822
830
|
|
|
823
831
|
{ type:'ContactForm', name:'Contact Form', group:'Widgets', props:{
|