@mixd-id/web-scaffold 0.2.240706 → 0.2.250801009
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/docs/components/Dashboard.md +56 -0
- package/log.txt +7 -0
- package/package.json +27 -19
- package/src/components/404.vue +61 -0
- package/src/components/AccountIcon.vue +19 -0
- package/src/components/Ahref.vue +1 -1
- package/src/components/Alert.vue +4 -13
- package/src/components/ArrayList.vue +49 -0
- package/src/components/Article.vue +24 -30
- package/src/components/Button.vue +79 -167
- package/src/components/Card.vue +235 -0
- package/src/components/Carousel.vue +61 -60
- package/src/components/Cart.vue +192 -0
- package/src/components/CartIcon.vue +89 -0
- package/src/components/ChartBar.vue +2 -3
- package/src/components/Checkbox.vue +20 -11
- package/src/components/Checkout.vue +373 -0
- package/src/components/CheckoutDelivery.vue +267 -0
- package/src/components/CodeEditor.vue +5 -16
- package/src/components/CollapsiblePanel.vue +70 -0
- package/src/components/ColorPicker.vue +8 -3
- package/src/components/ColorPicker2.vue +41 -19
- package/src/components/ColorPicker3.vue +100 -0
- package/src/components/Confirm.vue +9 -7
- package/src/components/ContextMenu.vue +122 -206
- package/src/components/ContextMenuItem.vue +53 -0
- package/src/components/Dashboard.vue +243 -0
- package/src/components/Dashboard2.vue +118 -0
- package/src/components/DashboardComponentSelector.vue +96 -0
- package/src/components/DashboardConfigs.vue +202 -0
- package/src/components/Datepicker.vue +102 -41
- package/src/components/DayTimeRange.vue +3 -2
- package/src/components/Dropdown.vue +7 -4
- package/src/components/Flex.vue +14 -40
- package/src/components/GHeatMaps.vue +2 -2
- package/src/components/Grid.vue +6 -6
- package/src/components/HTMLEditor.vue +27 -14
- package/src/components/Image.vue +62 -108
- package/src/components/ImagePreview.vue +14 -4
- package/src/components/ImageUploader.vue +114 -0
- package/src/components/ImportModal.vue +3 -3
- package/src/components/Link.vue +62 -6
- package/src/components/List.vue +524 -403
- package/src/components/ListContextMenu.vue +88 -0
- package/src/components/ListItem.vue +5 -3
- package/src/components/ListPage1.vue +14 -15
- package/src/components/ListView.vue +5 -6
- package/src/components/ListViewSettings.vue +2 -2
- package/src/components/LogViewerItem.vue +1 -1
- package/src/components/MarkdownEdit.vue +128 -0
- package/src/components/MarkdownPreview.vue +102 -0
- package/src/components/MenuItem1.vue +36 -0
- package/src/components/Modal.vue +95 -43
- package/src/components/MultiDropdown.vue +124 -0
- package/src/components/MultilineText.vue +1 -4
- package/src/components/OTPField.vue +11 -17
- package/src/components/ObjectTree.vue +1 -1
- package/src/components/PageBuilder.vue +3 -3
- package/src/components/Paragraph.vue +1 -2
- package/src/components/PresetSelectorFilterItem.vue +107 -95
- package/src/components/Radio.vue +1 -1
- package/src/components/SearchModal.vue +153 -0
- package/src/components/Slider.vue +1 -1
- package/src/components/Svg.vue +1 -1
- package/src/components/SvgEditor.vue +173 -0
- package/src/components/Switch.vue +4 -5
- package/src/components/Table.vue +2 -2
- package/src/components/TableView.vue +2 -3
- package/src/components/TableViewHead.vue +2 -2
- package/src/components/Tabs.vue +1 -1
- package/src/components/Testimonial.vue +2 -2
- package/src/components/Text.vue +7 -22
- package/src/components/TextEditor.vue +3 -3
- package/src/components/TextWithTag.vue +61 -30
- package/src/components/Textarea.vue +11 -16
- package/src/components/Textbox.vue +9 -19
- package/src/components/Timepicker.vue +25 -15
- package/src/components/Toast.vue +5 -3
- package/src/components/TreeMenu.vue +122 -0
- package/src/components/TreeView.vue +15 -10
- package/src/components/TreeView2.vue +38 -0
- package/src/components/TreeViewItem.vue +58 -29
- package/src/components/TreeViewItem2.vue +55 -0
- package/src/components/Uploader.vue +45 -0
- package/src/components/Video.vue +119 -0
- package/src/components/VirtualGrid.vue +24 -7
- package/src/components/VirtualTable.vue +363 -128
- package/src/configs/dashboard/data-table.js +9 -0
- package/src/configs/web-page-builder.js +118 -0
- package/src/directives/intersect.js +26 -0
- package/src/hooks/device.js +14 -0
- package/src/index.js +62 -107
- package/src/mixin/component.js +147 -67
- package/src/themes/default/index.js +83 -155
- package/src/utils/dashboard.js +22 -962
- package/src/utils/helpers.cjs +635 -0
- package/src/utils/helpers.js +91 -60
- package/src/utils/helpers.mjs +245 -12
- package/src/utils/importer.js +22 -3
- package/src/utils/list.mjs +1509 -0
- package/src/utils/preset-selector.cjs +1455 -0
- package/src/utils/preset-selector.js +489 -95
- package/src/utils/preset-selector.mjs +59 -20
- package/src/utils/queue.js +63 -0
- package/src/utils/web.mjs +120 -0
- package/src/utils/wss.js +37 -29
- package/src/utils/wss.mjs +24 -19
- package/src/widgets/AhrefSetting.vue +16 -13
- package/src/widgets/ArticleSetting.vue +15 -27
- package/src/widgets/BackgroundColorSetting.vue +153 -0
- package/src/widgets/BorderColorSetting.vue +57 -0
- package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
- package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
- package/src/widgets/BotEditor.vue +35 -15
- package/src/widgets/ButtonSetting.vue +12 -13
- package/src/widgets/CarouselSetting.vue +33 -45
- package/src/widgets/CartSetting.vue +46 -0
- package/src/widgets/CheckoutSetting.vue +46 -0
- package/src/widgets/CollapsiblePanelSetting.vue +46 -0
- package/src/widgets/ColumnSelector.vue +29 -5
- package/src/widgets/ComponentSetting.vue +1 -1
- package/src/widgets/ComponentSetting2.vue +112 -234
- package/src/widgets/ComponentSetting3.vue +1 -1
- package/src/widgets/ContactForm.vue +3 -3
- package/src/widgets/ContactFormSetting.vue +41 -30
- package/src/widgets/Dashboard/BarChart.vue +47 -11
- package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
- package/src/widgets/Dashboard/DataTable.vue +125 -0
- package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
- package/src/widgets/Dashboard/Doughnut.vue +49 -7
- package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
- package/src/widgets/Dashboard/Metric.vue +78 -19
- package/src/widgets/Dashboard/MetricSetting.vue +81 -28
- package/src/widgets/Dashboard/Pie.vue +55 -6
- package/src/widgets/Dashboard/PieSetting.vue +1 -1
- package/src/widgets/Dashboard/PolarArea.vue +49 -7
- package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
- package/src/widgets/Dashboard/SharingModal.vue +4 -5
- package/src/widgets/Dashboard/ViewSelector.vue +2 -2
- package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
- package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
- package/src/widgets/EmbeddedVideoSetting.vue +7 -5
- package/src/widgets/FAQ.vue +16 -3
- package/src/widgets/FAQSetting.vue +53 -47
- package/src/widgets/FeatureList.vue +3 -0
- package/src/widgets/FeatureListSetting.vue +112 -102
- package/src/widgets/FlexSetting.vue +83 -106
- package/src/widgets/GridSetting.vue +71 -196
- package/src/widgets/Header2.vue +34 -71
- package/src/widgets/Header2Setting.vue +95 -179
- package/src/widgets/HeaderSetting.vue +16 -18
- package/src/widgets/IconListSetting.vue +69 -65
- package/src/widgets/ImageSetting.vue +33 -60
- package/src/widgets/LinkSetting.vue +60 -37
- package/src/widgets/LinkSettingModal.vue +173 -0
- package/src/widgets/LogViewer.vue +1 -1
- package/src/widgets/MarginSetting.vue +2 -2
- package/src/widgets/MenuEditor.vue +1 -1
- package/src/widgets/MenuItem1Setting.vue +78 -0
- package/src/widgets/ModalSetting.vue +42 -44
- package/src/widgets/MultiValueSetting.vue +2 -2
- package/src/widgets/MultiValueSetting2.vue +78 -45
- package/src/widgets/OGSettingModal.vue +103 -0
- package/src/widgets/PaddingSetting.vue +2 -2
- package/src/widgets/ParagraphSetting.vue +16 -13
- package/src/widgets/PositionSetting.vue +209 -0
- package/src/widgets/PresetBar.vue +359 -210
- package/src/widgets/PresetBarPivot.vue +31 -19
- package/src/widgets/PresetSelector.vue +29 -17
- package/src/widgets/SearchModalSetting.vue +70 -0
- package/src/widgets/Share.vue +1 -2
- package/src/widgets/ShareSetting.vue +67 -60
- package/src/widgets/StyleSetting.vue +227 -116
- package/src/widgets/TestimonialSetting.vue +97 -88
- package/src/widgets/TextBlockSetting.vue +16 -13
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
- package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
- package/src/widgets/UserActionBuilder.vue +4 -16
- package/src/widgets/WebComponentSelector.vue +15 -11
- package/src/widgets/WebLayoutSelector.vue +41 -270
- package/src/widgets/WebPageBuilder.vue +693 -704
- package/src/widgets/WebPageBuilder2.vue +7 -7
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
- package/src/widgets/WebPageBuilder4.vue +289 -575
- package/src/widgets/WebPageSelector.vue +1 -1
- package/src/widgets/YoutubeVideoSetting.vue +16 -13
- package/tailwind.config.js +3 -35
- package/docs/schema/user-action.json +0 -266
- package/src/App.vue +0 -25
- package/src/components/SearchButton.vue +0 -57
- package/src/entry-client.js +0 -27
- package/src/entry-server.js +0 -73
- package/src/events/event.js +0 -2
- package/src/main.js +0 -29
- package/src/mixin/website.js +0 -121
- package/src/router.js +0 -57
- package/src/widgets/MobileMenu.vue +0 -182
- package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
- package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
- package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
- package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
- package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
- package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
- package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
- package/test.json +0 -22
- /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
- /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-4">
|
|
5
|
+
<div>
|
|
6
|
+
<label class="text-text-400">Video URL</label>
|
|
7
|
+
<Textbox v-model="item.props.videoUrl"
|
|
8
|
+
@keyup.enter="$emit('change')" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
9
11
|
|
|
10
12
|
<ComponentSetting2 :item="item"
|
|
11
13
|
:view-type="viewType"
|
package/src/widgets/FAQ.vue
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<h3>{{ title }}</h3>
|
|
4
4
|
<div :class="$style.items">
|
|
5
5
|
<div v-for="(item, idx) in items" :class="$style.item">
|
|
6
|
-
<input type="checkbox" :name="$style.comp" :id="
|
|
7
|
-
<label :for="
|
|
6
|
+
<input type="checkbox" :name="$style.comp" :id="getId(idx)" />
|
|
7
|
+
<label :for="getId(idx)" class="text-lg">{{ item.question }}</label>
|
|
8
8
|
<div>
|
|
9
9
|
<div class="p-4 pt-0 pb-8 text-lg" v-html="item.answer"></div>
|
|
10
10
|
</div>
|
|
@@ -33,8 +33,21 @@ export default{
|
|
|
33
33
|
|
|
34
34
|
data(){
|
|
35
35
|
return {
|
|
36
|
-
id: this.uniqid()
|
|
36
|
+
id: this.uniqid(),
|
|
37
|
+
mounted: false
|
|
37
38
|
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
methods: {
|
|
42
|
+
|
|
43
|
+
getId(idx){
|
|
44
|
+
return this.mounted ? `${this.$style.comp}${this.id}${idx}` : ''
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
mounted() {
|
|
50
|
+
this.mounted = true
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-5">
|
|
5
|
+
<div>
|
|
6
|
+
<label class="flex-1 text-text-400">Title</label>
|
|
7
|
+
<Textbox class="mt-1" v-model="item.props.title" @keyup.enter="$emit('change')"/>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div>
|
|
11
|
+
<div class="flex flex-row gap-4">
|
|
12
|
+
<label class="flex-1 text-text-400">FAQ</label>
|
|
13
|
+
<button type="button" class="text-primary" @click="addFAQ">{{ $t('Add')}}</button>
|
|
14
|
+
</div>
|
|
15
|
+
<ListItem :items="item.props.items"
|
|
16
|
+
class="mt-2 bg-base-300 border-border-200 border-[1px] rounded-lg overflow-hidden"
|
|
17
|
+
container-class="divide-y divide-border-50"
|
|
18
|
+
@reorder="(from, to) => { item.props.items.splice(to, 0, item.props.items.splice(from, 1)[0]); $emit('change') }">
|
|
19
|
+
<template v-slot="{ item:obj }">
|
|
20
|
+
<div v-if="obj._edit" class="flex flex-col gap-2 mb-1 p-3">
|
|
21
|
+
<Textbox v-model="obj.question" :placeholder="$t('Question')" maxlength="60" />
|
|
22
|
+
<Textarea v-model="obj.answer" rows="4" :placeholder="$t('Answer')" />
|
|
23
|
+
<Button type="button" @click="() => { delete obj._edit; $emit('change'); }">OK</Button>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-else class="flex flex-row gap-3 p-2 rounded-md mb-1">
|
|
26
|
+
<div data-reorder class="flex items-center">
|
|
27
|
+
<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>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex-1 flex flex-col cursor-pointer" @click="obj._edit = true">
|
|
30
|
+
<p class="text-ellipsis overflow-x-hidden whitespace-nowrap">{{ obj.question }}</p>
|
|
31
|
+
<small class="text-text-400 text-ellipsis overflow-x-hidden whitespace-nowrap">{{ obj.answer }}</small>
|
|
32
|
+
</div>
|
|
33
|
+
<button type="button" @click="confirm($t('Remove this obj?'), '', () => { obj.props.images[idx].splice(index, 1); $emit('change') })">
|
|
34
|
+
<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>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</ListItem>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<ComponentSetting2 :item="item"
|
|
43
|
+
:view-type="viewType"
|
|
44
|
+
:view-types="viewTypes"
|
|
45
|
+
:view-index="viewIndex"
|
|
46
|
+
defaultDisplay="block"
|
|
47
|
+
@change="$emit('change')" />
|
|
44
48
|
|
|
45
49
|
</div>
|
|
46
50
|
</template>
|
|
@@ -55,14 +59,16 @@ export default{
|
|
|
55
59
|
|
|
56
60
|
props: {
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
item: {
|
|
63
|
+
type: Object,
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
viewType: String,
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
viewIndex: Number,
|
|
70
|
+
|
|
71
|
+
viewTypes: Array,
|
|
66
72
|
|
|
67
73
|
},
|
|
68
74
|
|
|
@@ -82,7 +88,7 @@ export default{
|
|
|
82
88
|
<style module>
|
|
83
89
|
|
|
84
90
|
.comp{
|
|
85
|
-
|
|
91
|
+
@apply flex flex-col divide-y divide-border-50;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
</style>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<div v-for="item in items" class="flex gap-4" :class="computedItemClass">
|
|
12
12
|
<div>
|
|
13
13
|
<Image :src="imageUrl(item.imageUrl)"
|
|
14
|
+
@click="previewImage(imageUrl(item.imageUrl))"
|
|
14
15
|
:class="`object-contain ${item.sizeClass} rounded-xl`"
|
|
15
16
|
edit-selectable="false" />
|
|
16
17
|
</div>
|
|
@@ -29,6 +30,8 @@ import {componentMixin} from "../mixin/component";
|
|
|
29
30
|
|
|
30
31
|
export default{
|
|
31
32
|
|
|
33
|
+
inject: [ 'previewImage' ],
|
|
34
|
+
|
|
32
35
|
mixins: [ componentMixin ],
|
|
33
36
|
|
|
34
37
|
props:{
|
|
@@ -1,100 +1,107 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div class="flex flex-col gap-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-4">
|
|
5
|
+
<div class="flex flex-col gap-1">
|
|
6
|
+
<label class="text-text-400">Title</label>
|
|
7
|
+
<Textbox v-model="item.props.title" maxlength="40" @keyup.enter="$emit('change')" placeholder="Title" />
|
|
8
|
+
<Textarea v-model="item.props.description" rows="3" @blur="$emit('change')" placeholder="Description" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="flex flex-col gap-1">
|
|
12
|
+
<label class="text-text-400">Mode</label>
|
|
13
|
+
<Dropdown v-model="item.props.mode" @change="item.props.items = []">
|
|
14
|
+
<option value="">Static</option>
|
|
15
|
+
<option value="dynamic">Dynamic</option>
|
|
16
|
+
</Dropdown>
|
|
17
|
+
<Textbox v-if="item.props.mode === 'dynamic'"
|
|
18
|
+
placeholder="Var" v-model="item.props.src"
|
|
19
|
+
@blur="$emit('change')"
|
|
20
|
+
@keyup.enter="$emit('change')" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div v-if="item.props.mode !== 'dynamic'">
|
|
24
|
+
<div class="flex flex-row gap-4">
|
|
25
|
+
<label class="flex-1 text-text-400">Items</label>
|
|
26
|
+
<button type="button" class="text-primary"
|
|
27
|
+
@click="$refs.imageModal.open({ image:{} })">Add Item</button>
|
|
28
|
+
</div>
|
|
29
|
+
<ListItem :items="item.props.items.filter((_) => _)"
|
|
30
|
+
class="mt-1 border-[1px] border-border-200 bg-base-300 rounded-lg overflow-hidden"
|
|
31
|
+
container-class="divide-y divide-border-50"
|
|
32
|
+
@reorder="(from, to) => { item.props.items.splice(to, 0, item.props.items.splice(from, 1)[0]); $emit('change') }">
|
|
33
|
+
<template v-slot="{ item:image, index }">
|
|
34
|
+
<div class="flex flex-row gap-3 p-2 px-3 items-center rounded-lg">
|
|
35
|
+
<div data-reorder>
|
|
36
|
+
<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>
|
|
37
|
+
</div>
|
|
38
|
+
<div @click="$refs.imageModal.open({ image, idx, index })">
|
|
39
|
+
<Image :src="imageUrl(image)"
|
|
40
|
+
class="w-[32px] aspect-square rounded-md"
|
|
41
|
+
item-class="object-cover" />
|
|
42
|
+
</div>
|
|
43
|
+
<div class="flex-1 flex flex-col leading-4" @click="$refs.imageModal.open({ image, idx, index })">
|
|
44
|
+
<p class="text-ellipsis whitespace-nowrap overflow-hidden">{{ image.title }}</p>
|
|
45
|
+
<p class="text-sm text-ellipsis whitespace-nowrap overflow-hidden">{{ image.description }}</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<button type="button" @click="confirm('Hapus gambar ini?', '', () => { item.props.items.splice(index, 1); $emit('change') })">
|
|
49
|
+
<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>
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
</ListItem>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div v-else>
|
|
58
|
+
<label class="flex-1 text-text-400">Item</label>
|
|
59
|
+
<div class="mt-1 flex flex-col gap-1">
|
|
60
|
+
<Textbox v-model="itemPropsItem.title" placeholder="Title var"
|
|
61
|
+
@blur="$emit('change')"
|
|
62
|
+
@keyup.enter="$emit('change')"/>
|
|
63
|
+
<Textbox v-model="itemPropsItem.description" placeholder="Description var"
|
|
64
|
+
@blur="$emit('change')"
|
|
65
|
+
@keyup.enter="$emit('change')"/>
|
|
66
|
+
<Textbox v-model="itemPropsItem.imageUrl" placeholder="Image var"
|
|
67
|
+
@blur="$emit('change')"
|
|
68
|
+
@keyup.enter="$emit('change')"/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="flex flex-row items-center gap-4">
|
|
73
|
+
<label class="flex-1 text-text-400">Columns</label>
|
|
74
|
+
<Dropdown v-for="(_viewType, idx) in viewTypes" class="w-[60px]"
|
|
75
|
+
v-model="containerGridColumn[idx]"
|
|
76
|
+
v-show="_viewType.value === viewType"
|
|
77
|
+
@change="$emit('change')">
|
|
78
|
+
<option :value="`${viewType}grid-cols-1`">1</option>
|
|
79
|
+
<option :value="`${viewType}grid-cols-2`">2</option>
|
|
80
|
+
<option :value="`${viewType}grid-cols-3`">3</option>
|
|
81
|
+
<option :value="`${viewType}grid-cols-4`">4</option>
|
|
82
|
+
<option :value="`${viewType}grid-cols-5`">5</option>
|
|
83
|
+
<option :value="`${viewType}grid-cols-6`">6</option>
|
|
84
|
+
</Dropdown>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="flex flex-row items-center gap-4">
|
|
88
|
+
<label class="flex-1 text-text-400">Style</label>
|
|
89
|
+
<Dropdown v-for="(_viewType, idx) in viewTypes" class="w-[150px]"
|
|
90
|
+
v-model="itemVariant[idx]"
|
|
91
|
+
v-show="_viewType.value === viewType"
|
|
92
|
+
@change="$emit('change')">
|
|
93
|
+
<option :value="`${viewType}flex-row ${viewType}text-left ${viewType}fl-uO88`">Style 1</option>
|
|
94
|
+
<option :value="`${viewType}flex-col ${viewType}items-center ${viewType}text-center ${viewType}fl-uO89`">Style 2</option>
|
|
95
|
+
</Dropdown>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<ComponentSetting2 :item="item"
|
|
100
|
+
:view-type="viewType"
|
|
101
|
+
:view-types="viewTypes"
|
|
102
|
+
:view-index="viewIndex"
|
|
103
|
+
defaultDisplay="block"
|
|
104
|
+
@change="$emit('change')" />
|
|
98
105
|
|
|
99
106
|
<Modal ref="imageModal" width="360" height="460">
|
|
100
107
|
<template #head="{ context }">
|
|
@@ -127,7 +134,8 @@
|
|
|
127
134
|
<label class="flex-1 text-text-400">Gambar</label>
|
|
128
135
|
<button type="button" class="text-primary" @click="$refs.imageUpload.edit()">Ubah</button>
|
|
129
136
|
</div>
|
|
130
|
-
<Image ref="imageUpload" :src="imageUrl(context.image)"
|
|
137
|
+
<Image ref="imageUpload" :src="imageUrl(context.image)"
|
|
138
|
+
class="w-[120px] bg-text-50 mt-1 aspect-square"
|
|
131
139
|
:editable="true"
|
|
132
140
|
@click="$refs.imageUpload.edit()"
|
|
133
141
|
@change="(base64, file) => { uploadImage(file).then((res) => context.image.imageUrl = res.name); }"/>
|
|
@@ -177,14 +185,16 @@ export default{
|
|
|
177
185
|
|
|
178
186
|
props: {
|
|
179
187
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
item: {
|
|
189
|
+
type: Object,
|
|
190
|
+
required: true
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
viewType: String,
|
|
184
194
|
|
|
185
|
-
|
|
195
|
+
viewIndex: Number,
|
|
186
196
|
|
|
187
|
-
|
|
197
|
+
viewTypes: Array,
|
|
188
198
|
|
|
189
199
|
},
|
|
190
200
|
|
|
@@ -217,7 +227,7 @@ export default{
|
|
|
217
227
|
<style module>
|
|
218
228
|
|
|
219
229
|
.comp{
|
|
220
|
-
|
|
230
|
+
@apply flex flex-col divide-y divide-border-50;
|
|
221
231
|
}
|
|
222
232
|
|
|
223
233
|
</style>
|