@mixd-id/web-scaffold 0.1.230406198 → 0.1.230406200
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/Carousel.vue +18 -15
- package/src/components/DataList.vue +59 -0
- package/src/components/Flex.vue +7 -0
- package/src/components/Link.vue +7 -0
- package/src/components/Modal.vue +4 -2
- package/src/components/TextBlock.vue +16 -2
- package/src/index.js +2 -0
- package/src/widgets/ComponentSetting.vue +143 -1
- package/src/widgets/ContactForm.vue +14 -2
- package/src/widgets/ContactFormSetting.vue +42 -22
- package/src/widgets/DataListSetting.vue +102 -0
- package/src/widgets/GridSetting.vue +1 -3
- package/src/widgets/ImageSetting.vue +1 -1
- package/src/widgets/ModalSetting.vue +1 -8
- package/src/widgets/StyleSetting.vue +1 -1
- package/src/widgets/WebDatasourceSelector.vue +43 -41
- package/src/widgets/WebPageBuilder.vue +14 -13
- package/tailwind.config.js +2 -0
package/package.json
CHANGED
|
@@ -360,21 +360,24 @@ export default{
|
|
|
360
360
|
@apply bg-primary-500;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
363
|
+
@media screen and (max-width: 768px){
|
|
364
|
+
.htmlNoScroll{
|
|
365
|
+
min-height: 100.3%;
|
|
366
|
+
overscroll-behavior-y: none;
|
|
367
|
+
height: 100%;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
}
|
|
370
|
+
.bodyNoScroll{
|
|
371
|
+
overscroll-behavior: none;
|
|
372
|
+
overscroll-behavior-y: none;
|
|
373
|
+
overflow: hidden;
|
|
374
|
+
position: fixed;
|
|
375
|
+
width: 100%;
|
|
376
|
+
margin: 0;
|
|
377
|
+
max-height: 100%;
|
|
378
|
+
-webkit-overflow-scrolling: touch;
|
|
379
|
+
}
|
|
378
380
|
}
|
|
379
381
|
|
|
382
|
+
|
|
380
383
|
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<component v-for="(item, idx) in dataItems"
|
|
5
|
+
:is="item.type"
|
|
6
|
+
:key="item.key"
|
|
7
|
+
:="item" />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
import {componentMixin} from "../mixin/component";
|
|
14
|
+
|
|
15
|
+
export default{
|
|
16
|
+
|
|
17
|
+
mixins: [ componentMixin ],
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
|
|
21
|
+
datasource: Object,
|
|
22
|
+
|
|
23
|
+
items: Array,
|
|
24
|
+
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
computed: {
|
|
28
|
+
|
|
29
|
+
dataItems(){
|
|
30
|
+
if(this.items.length < 1) return []
|
|
31
|
+
|
|
32
|
+
const items = []
|
|
33
|
+
|
|
34
|
+
const dataItems = ((this.pageData ?? {})[(this.datasource ?? {}).key] ?? {}).items ?? []
|
|
35
|
+
|
|
36
|
+
const itemJSON = JSON.stringify(this.items[0])
|
|
37
|
+
|
|
38
|
+
for(let data of dataItems){
|
|
39
|
+
const item = JSON.parse(itemJSON)
|
|
40
|
+
item.data = data
|
|
41
|
+
items.push(item)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return items
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style module>
|
|
54
|
+
|
|
55
|
+
.comp{
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
</style>
|
package/src/components/Flex.vue
CHANGED
package/src/components/Link.vue
CHANGED
|
@@ -50,6 +50,7 @@ export default{
|
|
|
50
50
|
target: String,
|
|
51
51
|
text: String,
|
|
52
52
|
download: Object,
|
|
53
|
+
data: Object,
|
|
53
54
|
},
|
|
54
55
|
|
|
55
56
|
computed: {
|
|
@@ -70,6 +71,12 @@ export default{
|
|
|
70
71
|
return obj
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
provide(){
|
|
77
|
+
return {
|
|
78
|
+
parentData: this.data
|
|
79
|
+
}
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
}
|
package/src/components/Modal.vue
CHANGED
|
@@ -79,6 +79,8 @@ export default{
|
|
|
79
79
|
|
|
80
80
|
height: String,
|
|
81
81
|
|
|
82
|
+
dock: String,
|
|
83
|
+
|
|
82
84
|
position: {
|
|
83
85
|
type: String,
|
|
84
86
|
default: 'bottom'
|
|
@@ -167,7 +169,7 @@ export default{
|
|
|
167
169
|
computedClass(){
|
|
168
170
|
return [
|
|
169
171
|
this.$style.modal,
|
|
170
|
-
this.$style['modal-' + this.position],
|
|
172
|
+
this.$style['modal-' + (this.dock ?? this.position)],
|
|
171
173
|
this.class,
|
|
172
174
|
this.mode === 'v-show' ? this.$style['v-show'] : '',
|
|
173
175
|
this.computedState ? this.$style.open : ''
|
|
@@ -188,7 +190,7 @@ export default{
|
|
|
188
190
|
return this.transition
|
|
189
191
|
}
|
|
190
192
|
else{
|
|
191
|
-
switch(this.position){
|
|
193
|
+
switch(this.dock ?? this.position){
|
|
192
194
|
case 'top':
|
|
193
195
|
return 'slidedown'
|
|
194
196
|
case 'bottom':
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component :is="tagName" :class="$style.comp">
|
|
3
|
-
{{
|
|
3
|
+
{{ computedText }}
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
8
|
|
|
9
9
|
import {componentMixin} from "../mixin/component";
|
|
10
|
+
import {applyDatasourceReplacer} from "../utils/helpers";
|
|
10
11
|
|
|
11
12
|
export default{
|
|
12
13
|
|
|
14
|
+
inject: [ 'parentData' ],
|
|
15
|
+
|
|
13
16
|
mixins: [ componentMixin ],
|
|
14
17
|
|
|
15
18
|
props: {
|
|
@@ -21,7 +24,18 @@ export default{
|
|
|
21
24
|
default: 'span'
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
computed: {
|
|
30
|
+
|
|
31
|
+
computedText(){
|
|
32
|
+
if(this.parentData){
|
|
33
|
+
return applyDatasourceReplacer(this.text, this.parentData)
|
|
34
|
+
}
|
|
35
|
+
return this.text
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
25
39
|
|
|
26
40
|
}
|
|
27
41
|
|
package/src/index.js
CHANGED
|
@@ -422,6 +422,7 @@ export default{
|
|
|
422
422
|
app.component('Testimonial', defineAsyncComponent(() => import("./components/Testimonial.vue")))
|
|
423
423
|
app.component('TextBlock', defineAsyncComponent(() => import("./components/TextBlock.vue")))
|
|
424
424
|
app.component('TextEditor', defineAsyncComponent(() => import("./components/TextEditor.vue")))
|
|
425
|
+
app.component('DataList', defineAsyncComponent(() => import("./components/DataList.vue")))
|
|
425
426
|
|
|
426
427
|
app.component('AhrefSetting', defineAsyncComponent(() => import("./widgets/AhrefSetting.vue")))
|
|
427
428
|
app.component('ArticleSetting', defineAsyncComponent(() => import("./widgets/ArticleSetting.vue")))
|
|
@@ -470,5 +471,6 @@ export default{
|
|
|
470
471
|
app.component('WebLayoutSelector', defineAsyncComponent(() => import("./widgets/WebLayoutSelector.vue")))
|
|
471
472
|
app.component('WebTemplateCreator', defineAsyncComponent(() => import("./widgets/WebTemplateCreator.vue")))
|
|
472
473
|
app.component('ModalSetting', defineAsyncComponent(() => import("./widgets/ModalSetting.vue")))
|
|
474
|
+
app.component('DataListSetting', defineAsyncComponent(() => import("./widgets/DataListSetting.vue")))
|
|
473
475
|
}
|
|
474
476
|
}
|
|
@@ -495,7 +495,117 @@
|
|
|
495
495
|
</button>
|
|
496
496
|
</div>
|
|
497
497
|
<div class="h-[1px] bg-text-100 mt-2 mb-4"></div>
|
|
498
|
-
<div
|
|
498
|
+
<div v-if="expanded['gridColumn']"
|
|
499
|
+
v-for="(_, idx) in viewTypes"
|
|
500
|
+
v-show="viewType === _.value"
|
|
501
|
+
class="grid grid-cols-2 gap-4">
|
|
502
|
+
|
|
503
|
+
<div>
|
|
504
|
+
<label class="text-text-400">Columns</label>
|
|
505
|
+
<Dropdown v-model="columns[idx]" class="mt-1">
|
|
506
|
+
<option value="">Not Set</option>
|
|
507
|
+
<option :value="`${viewType}grid-cols-1`">1</option>
|
|
508
|
+
<option :value="`${viewType}grid-cols-2`">2</option>
|
|
509
|
+
<option :value="`${viewType}grid-cols-3`">3</option>
|
|
510
|
+
<option :value="`${viewType}grid-cols-4`">4</option>
|
|
511
|
+
<option :value="`${viewType}grid-cols-5`">5</option>
|
|
512
|
+
<option :value="`${viewType}grid-cols-6`">6</option>
|
|
513
|
+
<option :value="`${viewType}grid-cols-7`">7</option>
|
|
514
|
+
<option :value="`${viewType}grid-cols-8`">8</option>
|
|
515
|
+
<option :value="`${viewType}grid-cols-9`">9</option>
|
|
516
|
+
<option :value="`${viewType}grid-cols-10`">10</option>
|
|
517
|
+
<option :value="`${viewType}grid-cols-11`">11</option>
|
|
518
|
+
<option :value="`${viewType}grid-cols-12`">12</option>
|
|
519
|
+
<option :value="`${viewType}grid-cols-none`">None</option>
|
|
520
|
+
</Dropdown>
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
<div>
|
|
524
|
+
<label class="text-text-400">Rows</label>
|
|
525
|
+
<Dropdown v-model="rows[idx]"
|
|
526
|
+
class="mt-1">
|
|
527
|
+
<option value="">Not Set</option>
|
|
528
|
+
<option :value="`${viewType}grid-rows-1`">1</option>
|
|
529
|
+
<option :value="`${viewType}grid-rows-2`">2</option>
|
|
530
|
+
<option :value="`${viewType}grid-rows-3`">3</option>
|
|
531
|
+
<option :value="`${viewType}grid-rows-4`">4</option>
|
|
532
|
+
<option :value="`${viewType}grid-rows-5`">5</option>
|
|
533
|
+
<option :value="`${viewType}grid-rows-6`">6</option>
|
|
534
|
+
<option :value="`${viewType}grid-rows-7`">7</option>
|
|
535
|
+
<option :value="`${viewType}grid-rows-8`">8</option>
|
|
536
|
+
<option :value="`${viewType}grid-rows-9`">9</option>
|
|
537
|
+
<option :value="`${viewType}grid-rows-10`">10</option>
|
|
538
|
+
<option :value="`${viewType}grid-rows-11`">11</option>
|
|
539
|
+
<option :value="`${viewType}grid-rows-12`">12</option>
|
|
540
|
+
<option :value="`${viewType}grid-rows-none`">None</option>
|
|
541
|
+
</Dropdown>
|
|
542
|
+
</div>
|
|
543
|
+
|
|
544
|
+
<div>
|
|
545
|
+
<label class="text-text-400">Gap</label>
|
|
546
|
+
<Dropdown v-model="gap[idx]" class="mt-1">
|
|
547
|
+
<option value="">Not Set</option>
|
|
548
|
+
<option :value="`${viewType}gap-0`">0</option>
|
|
549
|
+
<option :value="`${viewType}gap-1`">1</option>
|
|
550
|
+
<option :value="`${viewType}gap-2`">2</option>
|
|
551
|
+
<option :value="`${viewType}gap-3`">3</option>
|
|
552
|
+
<option :value="`${viewType}gap-4`">4</option>
|
|
553
|
+
<option :value="`${viewType}gap-5`">5</option>
|
|
554
|
+
<option :value="`${viewType}gap-6`">6</option>
|
|
555
|
+
<option :value="`${viewType}gap-7`">7</option>
|
|
556
|
+
<option :value="`${viewType}gap-8`">8</option>
|
|
557
|
+
<option :value="`${viewType}gap-9`">9</option>
|
|
558
|
+
<option :value="`${viewType}gap-10`">10</option>
|
|
559
|
+
<option :value="`${viewType}gap-11`">11</option>
|
|
560
|
+
<option :value="`${viewType}gap-12`">12</option>
|
|
561
|
+
</Dropdown>
|
|
562
|
+
</div>
|
|
563
|
+
|
|
564
|
+
<div>
|
|
565
|
+
<label class="text-text-400">Auto Flow</label>
|
|
566
|
+
<Dropdown v-model="autoFlow[idx]" class="mt-1">
|
|
567
|
+
<option value="">Not Set</option>
|
|
568
|
+
<option :value="`${viewType}grid-flow-row`">Row</option>
|
|
569
|
+
<option :value="`${viewType}grid-flow-col`">Col</option>
|
|
570
|
+
<option :value="`${viewType}grid-flow-dense`">Dense</option>
|
|
571
|
+
<option :value="`${viewType}grid-flow-row-dense`">Row Dense</option>
|
|
572
|
+
<option :value="`${viewType}grid-flow-col-dense`">Col Dense</option>
|
|
573
|
+
</Dropdown>
|
|
574
|
+
</div>
|
|
575
|
+
|
|
576
|
+
<div>
|
|
577
|
+
<label class="text-text-400">Align Items</label>
|
|
578
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
579
|
+
v-show="viewType === _.value"
|
|
580
|
+
v-model="alignItems[idx]"
|
|
581
|
+
class="w-full">
|
|
582
|
+
<option value="">Not Set</option>
|
|
583
|
+
<option :value="`${viewType}items-start`">Start</option>
|
|
584
|
+
<option :value="`${viewType}items-end`">End</option>
|
|
585
|
+
<option :value="`${viewType}items-center`">Center</option>
|
|
586
|
+
<option :value="`${viewType}items-baseline`">Baseline</option>
|
|
587
|
+
<option :value="`${viewType}items-stretch`">Stretch</option>
|
|
588
|
+
</Dropdown>
|
|
589
|
+
</div>
|
|
590
|
+
|
|
591
|
+
<div>
|
|
592
|
+
<label class="text-text-400">Justify Content</label>
|
|
593
|
+
<Dropdown v-for="(_, idx) in viewTypes"
|
|
594
|
+
v-show="viewType === _.value"
|
|
595
|
+
v-model="justifyContent[idx]"
|
|
596
|
+
class="w-full">
|
|
597
|
+
<option value="">Not Set</option>
|
|
598
|
+
<option :value="`${viewType}justify-normal`">Normal</option>
|
|
599
|
+
<option :value="`${viewType}justify-start`">Start</option>
|
|
600
|
+
<option :value="`${viewType}justify-end`">End</option>
|
|
601
|
+
<option :value="`${viewType}justify-center`">Center</option>
|
|
602
|
+
<option :value="`${viewType}justify-between`">Between</option>
|
|
603
|
+
<option :value="`${viewType}justify-around`">Around</option>
|
|
604
|
+
<option :value="`${viewType}justify-evenly`">Evenly</option>
|
|
605
|
+
<option :value="`${viewType}justify-stretch`">Stretch</option>
|
|
606
|
+
</Dropdown>
|
|
607
|
+
</div>
|
|
608
|
+
|
|
499
609
|
<div>
|
|
500
610
|
<label class="flex-1 text-text-400">Column Span</label>
|
|
501
611
|
<div v-for="(_, index) in viewTypes"
|
|
@@ -1083,6 +1193,36 @@ export default{
|
|
|
1083
1193
|
|
|
1084
1194
|
computed: {
|
|
1085
1195
|
|
|
1196
|
+
autoFlow(){
|
|
1197
|
+
if(!Array.isArray(this.item.props.autoFlow))
|
|
1198
|
+
this.item.props.autoFlow = []
|
|
1199
|
+
return this.item.props.autoFlow
|
|
1200
|
+
},
|
|
1201
|
+
|
|
1202
|
+
columns(){
|
|
1203
|
+
if(!Array.isArray(this.item.props.columns))
|
|
1204
|
+
this.item.props.columns = []
|
|
1205
|
+
return this.item.props.columns
|
|
1206
|
+
},
|
|
1207
|
+
|
|
1208
|
+
rows(){
|
|
1209
|
+
if(!Array.isArray(this.item.props.rows))
|
|
1210
|
+
this.item.props.rows = []
|
|
1211
|
+
return this.item.props.rows
|
|
1212
|
+
},
|
|
1213
|
+
|
|
1214
|
+
alignItems(){
|
|
1215
|
+
if(!Array.isArray(this.item.props.alignItems))
|
|
1216
|
+
this.item.props.alignItems = []
|
|
1217
|
+
return this.item.props.alignItems
|
|
1218
|
+
},
|
|
1219
|
+
|
|
1220
|
+
justifyContent(){
|
|
1221
|
+
if(!Array.isArray(this.item.props.justifyContent))
|
|
1222
|
+
this.item.props.justifyContent = []
|
|
1223
|
+
return this.item.props.justifyContent
|
|
1224
|
+
},
|
|
1225
|
+
|
|
1086
1226
|
animate(){
|
|
1087
1227
|
if(!Array.isArray(this.item.props.animate))
|
|
1088
1228
|
this.item.props.animate = []
|
|
@@ -1582,6 +1722,8 @@ export default{
|
|
|
1582
1722
|
[ 'Inline Flex', 'inline-flex' ],
|
|
1583
1723
|
[ 'Table', 'table' ],
|
|
1584
1724
|
[ 'Inline Table', 'inline-table' ],
|
|
1725
|
+
[ 'Grid', 'grid' ],
|
|
1726
|
+
[ 'Inline Grid', 'inline-grid' ],
|
|
1585
1727
|
],
|
|
1586
1728
|
divideStyle: [
|
|
1587
1729
|
[ 'Solid', 'divide-solid' ],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<Dropdown v-else-if="field.type === 'topic'" v-model="form[field.type]"
|
|
27
27
|
class="bg-white text-xl md:w-[200px] max-w-full">
|
|
28
|
-
<option value="" disabled selected>Pilih Topik Pertanyaan</option>
|
|
28
|
+
<option value="" disabled selected>{{ field.placeholder ? field.placeholder : 'Pilih Topik Pertanyaan' }}</option>
|
|
29
29
|
<option v-for="item in field.items" :value="item.text">{{ item.text }}</option>
|
|
30
30
|
</Dropdown>
|
|
31
31
|
|
|
@@ -91,6 +91,18 @@ export default{
|
|
|
91
91
|
return
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
const utm = this.utm && Object.values(this.utm).join('').length > 0 ? this.utm :
|
|
95
|
+
('utm_source' in this.$route.query || 'utm_medium' in this.$route.query ||
|
|
96
|
+
'utm_campaign' in this.$route.query || 'utm_id' in this.$route.query ||
|
|
97
|
+
'utm_term' in this.$route.query || 'utm_content' in this.$route.query ? {
|
|
98
|
+
source: this.$route.query.utm_source,
|
|
99
|
+
medium: this.$route.query.utm_medium,
|
|
100
|
+
campaign: this.$route.query.utm_campaign,
|
|
101
|
+
id: this.$route.query.utm_id,
|
|
102
|
+
term: this.$route.query.utm_term,
|
|
103
|
+
content: this.$route.query.utm_content,
|
|
104
|
+
} : null)
|
|
105
|
+
|
|
94
106
|
this.$refs.submitBtn.setState(2)
|
|
95
107
|
this.axios({
|
|
96
108
|
method: this.submitMethod ?? 'post',
|
|
@@ -101,7 +113,7 @@ export default{
|
|
|
101
113
|
componentUid: this.uid,
|
|
102
114
|
...this.form,
|
|
103
115
|
type: 1,
|
|
104
|
-
utm
|
|
116
|
+
utm,
|
|
105
117
|
},
|
|
106
118
|
params: this.form
|
|
107
119
|
})
|
|
@@ -205,6 +205,10 @@
|
|
|
205
205
|
<template v-slot:head>
|
|
206
206
|
<div class="relative p-5">
|
|
207
207
|
<h3>Topic</h3>
|
|
208
|
+
|
|
209
|
+
<button type="button" class="absolute right-0 top-0 p-3" @click="$refs.topicModal.close()">
|
|
210
|
+
<svg width="18" height="18" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
211
|
+
</button>
|
|
208
212
|
</div>
|
|
209
213
|
</template>
|
|
210
214
|
<template #foot="{ context }">
|
|
@@ -213,32 +217,48 @@
|
|
|
213
217
|
</div>
|
|
214
218
|
</template>
|
|
215
219
|
<template #default="{ context }">
|
|
216
|
-
<div class="flex-1 p-5 flex flex-col gap-
|
|
217
|
-
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
<div>
|
|
230
|
-
<
|
|
231
|
-
<svg width="
|
|
232
|
-
</
|
|
220
|
+
<div class="flex-1 p-5 flex flex-col gap-4">
|
|
221
|
+
|
|
222
|
+
<div>
|
|
223
|
+
<label class="text-text-400">Label</label>
|
|
224
|
+
<Textbox v-model="context.label" />
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div>
|
|
228
|
+
<label class="text-text-400">Items</label>
|
|
229
|
+
<ListItem :items="context.items"
|
|
230
|
+
@reorder="(from, to) => { context.items.splice(to, 0, context.items.splice(from, 1)[0]); }"
|
|
231
|
+
body-class="flex flex-col divide-y divide-text-200 border-[1px] border-text-200 mt-1">
|
|
232
|
+
<template v-slot="{ item, index }">
|
|
233
|
+
<div class="flex flex-row items-center gap-3 px-3">
|
|
234
|
+
<div data-reorder>
|
|
235
|
+
<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>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="flex-1">
|
|
238
|
+
<Textbox v-model="item.text" class="border-none" placeholder="Topic Name" />
|
|
239
|
+
</div>
|
|
240
|
+
<div>
|
|
241
|
+
<button type="button" @click="context.items.splice(index, 1)">
|
|
242
|
+
<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>
|
|
243
|
+
</button>
|
|
244
|
+
</div>
|
|
233
245
|
</div>
|
|
234
|
-
</
|
|
235
|
-
</
|
|
236
|
-
|
|
246
|
+
</template>
|
|
247
|
+
</ListItem>
|
|
248
|
+
|
|
249
|
+
<div class="text-center">
|
|
250
|
+
<button type="button" class="text-primary p-3" @click="context.items.push({})">Add Item</button>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
237
253
|
|
|
238
|
-
<div
|
|
239
|
-
<
|
|
254
|
+
<div>
|
|
255
|
+
<label class="text-text-400">Placeholder</label>
|
|
256
|
+
<Textbox v-model="context.placeholder" />
|
|
240
257
|
</div>
|
|
241
258
|
|
|
259
|
+
<br />
|
|
260
|
+
<br />
|
|
261
|
+
|
|
242
262
|
</div>
|
|
243
263
|
</template>
|
|
244
264
|
</Modal>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<div>
|
|
5
|
+
<div class="flex flex-row gap-4 items-center cursor-pointer"
|
|
6
|
+
@click="expanded['datalist'] = !expanded['datalist']">
|
|
7
|
+
<strong class="flex-1 text-text-400">Data List</strong>
|
|
8
|
+
<label class="text-primary">
|
|
9
|
+
{{ expanded['datalist'] ? 'Hide': 'Show' }}
|
|
10
|
+
</label>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="h-[1px] bg-text-100 mt-2 mb-4"></div>
|
|
13
|
+
<div v-if="expanded['datalist']">
|
|
14
|
+
|
|
15
|
+
<div>
|
|
16
|
+
<label class="flex-1 text-text-400">Data key</label>
|
|
17
|
+
<Textbox v-model="datasource.key" @keyup.enter="apply"/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<ComponentSetting :item="item"
|
|
24
|
+
:view-type="viewType"
|
|
25
|
+
:view-types="viewTypes"
|
|
26
|
+
defaultDisplay="flex"
|
|
27
|
+
@change="apply" />
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
|
|
34
|
+
export default{
|
|
35
|
+
|
|
36
|
+
emits: [ 'change' ],
|
|
37
|
+
|
|
38
|
+
inject: [ 'confirm', 'imageSrc', 'uploadImage', 'store' ],
|
|
39
|
+
|
|
40
|
+
props: {
|
|
41
|
+
|
|
42
|
+
item: {
|
|
43
|
+
type: Object,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
viewType: String,
|
|
48
|
+
|
|
49
|
+
viewTypes: Array,
|
|
50
|
+
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
methods: {
|
|
54
|
+
|
|
55
|
+
apply(){
|
|
56
|
+
this.$emit('change')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
computed: {
|
|
62
|
+
|
|
63
|
+
componentStore(){
|
|
64
|
+
if(this.store && this.store.components){
|
|
65
|
+
if(!this.store.components.compsetting)
|
|
66
|
+
this.store.components.compsetting = {}
|
|
67
|
+
|
|
68
|
+
return this.store.components.compsetting
|
|
69
|
+
}
|
|
70
|
+
return {}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
expanded(){
|
|
74
|
+
if(!this.componentStore['expanded'])
|
|
75
|
+
this.componentStore['expanded'] = {}
|
|
76
|
+
return this.componentStore['expanded']
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
datasource(){
|
|
80
|
+
if(!this.item.props.datasource)
|
|
81
|
+
this.item.props.datasource = {}
|
|
82
|
+
return this.item.props.datasource
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
data(){
|
|
88
|
+
return {
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style module>
|
|
97
|
+
|
|
98
|
+
.comp{
|
|
99
|
+
@apply flex flex-col gap-6;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
</style>
|
|
@@ -33,9 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<div>
|
|
35
35
|
<label class="text-text-400">Rows</label>
|
|
36
|
-
<Dropdown v-
|
|
37
|
-
v-show="_.value === viewType"
|
|
38
|
-
v-model="rows[index]"
|
|
36
|
+
<Dropdown v-model="rows[idx]"
|
|
39
37
|
class="mt-1"
|
|
40
38
|
@change="$emit('change')">
|
|
41
39
|
<option value="">Not Set</option>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</label>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="h-[1px] bg-text-100 mt-2 mb-4"></div>
|
|
13
|
-
<div v-if="expanded['image']">
|
|
13
|
+
<div v-if="expanded['image']" class="flex flex-col gap-4">
|
|
14
14
|
|
|
15
15
|
<div v-for="(_viewType, index) in viewTypes"
|
|
16
16
|
v-show="_viewType.value === viewType">
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="col-span-2 flex flex-row items-center">
|
|
21
21
|
<label :class="$style.label" class="flex-1">Position</label>
|
|
22
22
|
<div class="flex flex-row items-center gap-1">
|
|
23
|
-
<Dropdown v-model="
|
|
23
|
+
<Dropdown v-model="item.props.dock">
|
|
24
24
|
<option disabled selected>Choose Position</option>
|
|
25
25
|
<option value="center">Center</option>
|
|
26
26
|
<option value="top">Top</option>
|
|
@@ -72,13 +72,6 @@ export default{
|
|
|
72
72
|
|
|
73
73
|
computed: {
|
|
74
74
|
|
|
75
|
-
position(){
|
|
76
|
-
if(!Array.isArray(this.item.props.position))
|
|
77
|
-
this.item.props.position = []
|
|
78
|
-
|
|
79
|
-
return this.item.props.position
|
|
80
|
-
}
|
|
81
|
-
|
|
82
75
|
}
|
|
83
76
|
|
|
84
77
|
}
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
</div>
|
|
164
164
|
|
|
165
165
|
<div class="p-6 text-center">
|
|
166
|
-
<button type="button" class="text-primary" @click="resetMedia">Reset</button>
|
|
166
|
+
<button type="button" class="text-primary" @click="resetMedia">Reset to Default Style</button>
|
|
167
167
|
</div>
|
|
168
168
|
|
|
169
169
|
</div>
|
|
@@ -19,45 +19,43 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
<div class="flex-1 p-6 flex flex-col gap-4">
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div>
|
|
28
|
-
<label class="text-text-400">Key</label>
|
|
29
|
-
<Textbox v-model="datasource.key" />
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div>
|
|
33
|
-
<label class="text-text-400">Model</label>
|
|
34
|
-
<Dropdown v-model="datasource.model">
|
|
22
|
+
<div>
|
|
23
|
+
<label class="text-text-400">Model</label>
|
|
24
|
+
<Dropdown v-model="datasource.type" @change="setType">
|
|
35
25
|
<option disabled selected>Select Model</option>
|
|
36
|
-
<option v-for="model in
|
|
26
|
+
<option v-for="model in datasources" :value="model.type">{{ model.name }}</option>
|
|
37
27
|
</Dropdown>
|
|
38
|
-
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div v-if="datasource.type">
|
|
39
31
|
|
|
40
|
-
<div>
|
|
41
|
-
<label class="text-text-400">Filters</label>
|
|
42
32
|
<div>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
<option disabled selected>Choose Field</option>
|
|
46
|
-
<option v-for="column in modelColumns" :value="column.name">{{ column.name }}</option>
|
|
47
|
-
</Dropdown>
|
|
48
|
-
<Dropdown v-model="filter.operator">
|
|
49
|
-
<option disabled selected>Choose Operator</option>
|
|
50
|
-
<option value="=">=</option>
|
|
51
|
-
</Dropdown>
|
|
52
|
-
<Textbox v-model="filter.value" />
|
|
53
|
-
<button type="button" @click="datasource.filters.splice(idx, 1)">
|
|
54
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
55
|
-
</button>
|
|
56
|
-
</div>
|
|
33
|
+
<label class="text-text-400">Key</label>
|
|
34
|
+
<Textbox v-model="datasource.key" />
|
|
57
35
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
|
|
37
|
+
<div v-if="datasource.filters">
|
|
38
|
+
<label class="text-text-400">Filters</label>
|
|
39
|
+
<div>
|
|
40
|
+
<div v-for="(filter, idx) in datasource.filters" class="flex flex-row gap-2">
|
|
41
|
+
<Dropdown v-model="filter.key">
|
|
42
|
+
<option disabled selected>Choose Field</option>
|
|
43
|
+
<option v-for="column in modelColumns" :value="column.name">{{ column.name }}</option>
|
|
44
|
+
</Dropdown>
|
|
45
|
+
<Dropdown v-model="filter.operator">
|
|
46
|
+
<option disabled selected>Choose Operator</option>
|
|
47
|
+
<option value="=">=</option>
|
|
48
|
+
</Dropdown>
|
|
49
|
+
<Textbox v-model="filter.value" />
|
|
50
|
+
<button type="button" @click="datasource.filters.splice(idx, 1)">
|
|
51
|
+
<svg width="14" height="14" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="p-3 text-center">
|
|
56
|
+
<button type="button" class="text-primary"
|
|
57
|
+
@click="datasource.filters.push({})">Add Filter</button>
|
|
58
|
+
</div>
|
|
61
59
|
</div>
|
|
62
60
|
</div>
|
|
63
61
|
|
|
@@ -89,7 +87,7 @@ export default{
|
|
|
89
87
|
},
|
|
90
88
|
|
|
91
89
|
create(){
|
|
92
|
-
this.datasource = {
|
|
90
|
+
this.datasource = {}
|
|
93
91
|
this.isOpen = true
|
|
94
92
|
},
|
|
95
93
|
|
|
@@ -102,12 +100,17 @@ export default{
|
|
|
102
100
|
if(this.useDatasource){
|
|
103
101
|
this.socketEmit2(this.useDatasource[0], {})
|
|
104
102
|
.then(res => {
|
|
105
|
-
this.
|
|
103
|
+
this.datasources = res.datasources
|
|
106
104
|
})
|
|
107
105
|
.catch(err => console.error(err))
|
|
108
106
|
}
|
|
109
107
|
},
|
|
110
108
|
|
|
109
|
+
setType(){
|
|
110
|
+
const datasource = this.datasources.filter(_ => _.type === this.datasource.type).pop()
|
|
111
|
+
Object.assign(this.datasource, datasource)
|
|
112
|
+
}
|
|
113
|
+
|
|
111
114
|
},
|
|
112
115
|
|
|
113
116
|
mounted() {
|
|
@@ -117,13 +120,12 @@ export default{
|
|
|
117
120
|
computed: {
|
|
118
121
|
|
|
119
122
|
canApply(){
|
|
120
|
-
return this.datasource.
|
|
121
|
-
this.datasource.key
|
|
122
|
-
this.datasource.model
|
|
123
|
+
return this.datasource.type &&
|
|
124
|
+
this.datasource.key
|
|
123
125
|
},
|
|
124
126
|
|
|
125
127
|
modelColumns(){
|
|
126
|
-
return (this.
|
|
128
|
+
return (this.datasources.filter(_ => _.name === this.datasource.model).pop() ?? {}).columns ?? []
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
},
|
|
@@ -131,7 +133,7 @@ export default{
|
|
|
131
133
|
data(){
|
|
132
134
|
return {
|
|
133
135
|
isOpen: false,
|
|
134
|
-
|
|
136
|
+
datasources: null,
|
|
135
137
|
datasource: {
|
|
136
138
|
filters: []
|
|
137
139
|
},
|
|
@@ -540,8 +540,7 @@
|
|
|
540
540
|
@postMessageToIframe="onPostMessageToIframe"/>
|
|
541
541
|
</div>
|
|
542
542
|
|
|
543
|
-
|
|
544
|
-
<div class="p-5 text-center" v-if="useTemplateCreator">
|
|
543
|
+
<div class="p-5 text-center" v-if="useTemplateCreator && currentItem.type !== 'Style'">
|
|
545
544
|
<button type="button" class="text-primary"
|
|
546
545
|
@click="openTemplateCreator">
|
|
547
546
|
Save as Template
|
|
@@ -748,13 +747,11 @@ export default{
|
|
|
748
747
|
}
|
|
749
748
|
|
|
750
749
|
for(let key in component.props){
|
|
751
|
-
if(!this.compClasses.includes(key) &&
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}*/
|
|
757
|
-
instance[key] = value
|
|
750
|
+
if(!this.compClasses.includes(key) &&
|
|
751
|
+
!this.containerClasses.includes(key) &&
|
|
752
|
+
!this.itemClasses.includes(key) &&
|
|
753
|
+
![ 'enabled' ].includes(key)){
|
|
754
|
+
instance[key] = component.props[key]
|
|
758
755
|
}
|
|
759
756
|
}
|
|
760
757
|
|
|
@@ -1543,6 +1540,8 @@ export default{
|
|
|
1543
1540
|
icons:[], columns:[ 'grid-cols-4' ],
|
|
1544
1541
|
}},
|
|
1545
1542
|
|
|
1543
|
+
{ type:'DataList', name:'Data List', group:'Widgets', props:{}, items:[] },
|
|
1544
|
+
|
|
1546
1545
|
{ type:'FAQ', name:'FAQ', group:'Widgets', thumbnailUrl:"/images/templates/faq.gif", props:{ items:[] }},
|
|
1547
1546
|
|
|
1548
1547
|
{ type:'FeatureList', name:'Feature List', group:'Widgets', props:{ items:[], columns:[], variant:['variant1'] }},
|
|
@@ -1635,9 +1634,11 @@ export default{
|
|
|
1635
1634
|
'textTransform', 'whitespace', 'textOverflow', 'textDecoration',
|
|
1636
1635
|
'boxShadow', 'opacity',
|
|
1637
1636
|
'colSpan', 'rowSpan',
|
|
1638
|
-
'flex', 'flexAlign', 'flexJustify', '
|
|
1637
|
+
'flex', 'flexAlign', 'flexJustify', 'flexBasis', 'flexColumns',
|
|
1638
|
+
'zIndex',
|
|
1639
1639
|
|
|
1640
1640
|
'autoFlow', 'alignItems', 'justifyContent',
|
|
1641
|
+
'letterSpacing',
|
|
1641
1642
|
|
|
1642
1643
|
'animate',
|
|
1643
1644
|
|
|
@@ -1646,12 +1647,12 @@ export default{
|
|
|
1646
1647
|
containerClasses: [
|
|
1647
1648
|
'containerVariant', 'containerGridColumn', 'containerGap'
|
|
1648
1649
|
],
|
|
1649
|
-
host: null,
|
|
1650
|
-
iframeStyle: {},
|
|
1651
|
-
iframeSrc: '',
|
|
1652
1650
|
itemClasses: [
|
|
1653
1651
|
'itemMinWidth', 'itemRatio', 'itemVariant'
|
|
1654
1652
|
],
|
|
1653
|
+
host: null,
|
|
1654
|
+
iframeStyle: {},
|
|
1655
|
+
iframeSrc: '',
|
|
1655
1656
|
layouts: [],
|
|
1656
1657
|
prevData: null,
|
|
1657
1658
|
previewModes: [
|
package/tailwind.config.js
CHANGED
|
@@ -35,6 +35,7 @@ module.exports = {
|
|
|
35
35
|
'aspect-[1/2]', 'aspect-[2/3]', 'aspect-[3/4]', 'aspect-[8/9]',
|
|
36
36
|
|
|
37
37
|
'hidden', 'block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table',
|
|
38
|
+
'grid', 'inline-grid',
|
|
38
39
|
|
|
39
40
|
'static', 'fixed', 'absolute', 'relative', 'sticky',
|
|
40
41
|
|
|
@@ -252,6 +253,7 @@ module.exports = {
|
|
|
252
253
|
'md:aspect-[1/2]', 'md:aspect-[2/3]', 'md:aspect-[3/4]', 'md:aspect-[8/9]',
|
|
253
254
|
|
|
254
255
|
'md:hidden', 'md:block', 'md:inline-block', 'md:inline', 'md:flex', 'md:inline-flex', 'md:table', 'md:inline-table',
|
|
256
|
+
'md:grid', 'md:inline-grid',
|
|
255
257
|
|
|
256
258
|
'md:static', 'md:fixed', 'md:absolute', 'md:relative', 'md:sticky',
|
|
257
259
|
|