@mixd-id/web-scaffold 0.2.240706 → 0.2.250801010
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 +83 -169
- package/src/components/Card.vue +257 -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 +12 -5
- 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 +528 -403
- package/src/components/ListContextMenu.vue +88 -0
- package/src/components/ListItem.vue +6 -4
- 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 +40 -26
- 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 +16 -22
- 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 +151 -67
- package/src/themes/default/index.js +118 -159
- 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 +38 -36
- 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 +145 -236
- 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 +365 -150
- 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 +1019 -707
- 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,64 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div>
|
|
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
|
-
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-4">
|
|
5
|
+
<div>
|
|
6
|
+
<div class="flex flex-row gap-2">
|
|
7
|
+
<label class="flex-1 text-text-400">Icons</label>
|
|
8
|
+
<button type="button" class="text-primary"
|
|
9
|
+
@click="addIcon()">Add Icon</button>
|
|
10
|
+
</div>
|
|
11
|
+
<ListItem :items="item.props.icons" class="mt-4" body-class="divide-y divide-border-50"
|
|
12
|
+
@reorder="(from, to) => { item.props.icons.splice(to, 0, item.props.icons.splice(from, 1)[0]); apply() }">
|
|
13
|
+
<template v-slot="{ item, index }">
|
|
14
|
+
<div class="flex flex-row gap-1 p-2 bg-text-50 rounded-md mb-1">
|
|
15
|
+
<div data-reorder>
|
|
16
|
+
<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>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex-1 flex flex-row gap-1" @click="openIcon(item)">
|
|
19
|
+
<Image :src="imageSrc(item)"
|
|
20
|
+
class="w-[36px] aspect-square rounded-lg" />
|
|
21
|
+
<div class="flex-1 flex flex-col px-3 leading-0">
|
|
22
|
+
<p class="text-ellipsis overflow-hidden whitespace-nowrap">{{ item.text }}</p>
|
|
23
|
+
<small class="text-ellipsis overflow-hidden whitespace-nowrap">{{ item.target }}</small>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<button type="button" @click="removeIcon(index)">
|
|
28
|
+
<svg class="fill-text-300 hover:fill-red-500" width="16" height="16" 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>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
</ListItem>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="flex flex-row items-center gap-4">
|
|
37
|
+
<label class="flex-1 text-text-400">Columns</label>
|
|
38
|
+
<Dropdown v-for="(_viewType, idx) in viewTypes" class="w-[80px]"
|
|
39
|
+
v-model="item.props.columns[idx]"
|
|
40
|
+
v-show="_viewType.value === viewType"
|
|
41
|
+
@change="apply">
|
|
42
|
+
<option :value="`${viewType}grid-cols-1`">1</option>
|
|
43
|
+
<option :value="`${viewType}grid-cols-2`">2</option>
|
|
44
|
+
<option :value="`${viewType}grid-cols-3`">3</option>
|
|
45
|
+
<option :value="`${viewType}grid-cols-4`">4</option>
|
|
46
|
+
<option :value="`${viewType}grid-cols-5`">5</option>
|
|
47
|
+
<option :value="`${viewType}grid-cols-6`">6</option>
|
|
48
|
+
<option :value="`${viewType}grid-cols-7`">7</option>
|
|
49
|
+
<option :value="`${viewType}grid-cols-8`">8</option>
|
|
50
|
+
<option :value="`${viewType}grid-cols-9`">9</option>
|
|
51
|
+
<option :value="`${viewType}grid-cols-10`">10</option>
|
|
52
|
+
<option :value="`${viewType}grid-cols-11`">11</option>
|
|
53
|
+
<option :value="`${viewType}grid-cols-12`">12</option>
|
|
54
|
+
</Dropdown>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<ComponentSetting2 :item="item"
|
|
59
|
+
:view-type="viewType"
|
|
60
|
+
:view-types="viewTypes"
|
|
61
|
+
:view-index="viewIndex"
|
|
62
|
+
defaultDisplay="block"
|
|
63
|
+
@change="$emit('change')" />
|
|
62
64
|
|
|
63
65
|
<Modal ref="iconModal" width="400" height="320">
|
|
64
66
|
<template v-slot:head>
|
|
@@ -115,14 +117,16 @@ export default{
|
|
|
115
117
|
|
|
116
118
|
props: {
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
item: {
|
|
121
|
+
type: Object,
|
|
122
|
+
required: true
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
viewType: String,
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
viewIndex: Number,
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
viewTypes: Array,
|
|
126
130
|
|
|
127
131
|
},
|
|
128
132
|
|
|
@@ -178,7 +182,7 @@ export default{
|
|
|
178
182
|
<style module>
|
|
179
183
|
|
|
180
184
|
.comp{
|
|
181
|
-
|
|
185
|
+
@apply flex flex-col divide-y divide-border-50;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
</style>
|
|
@@ -1,82 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<div :class="$style.comp">
|
|
4
3
|
<div>
|
|
5
|
-
<div class="flex flex-
|
|
6
|
-
<svg v-if="!expanded['image']" width="12" height="12" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>
|
|
7
|
-
<svg v-else width="12" height="12" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>
|
|
8
|
-
<strong class="flex-1 text-text-400 line-clamp-1" @click="expanded['image'] = !expanded['image']">Image</strong>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<div class="h-[1px] bg-text-100 mt-2 mb-4"></div>
|
|
12
|
-
|
|
13
|
-
<div v-if="expanded['image']" class="flex flex-col gap-4">
|
|
14
|
-
|
|
4
|
+
<div class="flex flex-col gap-4 p-6 py-4">
|
|
15
5
|
<div>
|
|
16
|
-
<div class="flex flex-row
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-primary-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M352 240v32c0 6.6-5.4 12-12 12h-88v88c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-88h-88c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h88v-88c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v88h88c6.6 0 12 5.4 12 12zm96-160v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48zm-48 346V86c0-3.3-2.7-6-6-6H54c-3.3 0-6 2.7-6 6v340c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>
|
|
20
|
-
</button>
|
|
6
|
+
<div class="flex flex-row gap-3">
|
|
7
|
+
<small class="flex-1 text-text-400" @dbclick="log(item.props)">Image</small>
|
|
8
|
+
<ImageUploader ref="uploader" @change="image => item.props.src[viewIndex] = image" :upload-fn="uploadImage" class="text-sm"></ImageUploader>
|
|
21
9
|
</div>
|
|
22
|
-
<div class="
|
|
23
|
-
<div
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<button type="button" class="absolute top-1 right-1 rounded-full bg-white" v-if="item.props.src[index]"
|
|
33
|
-
@click.stop="$refs[`image${index}`][0].reset()">
|
|
34
|
-
<svg width="19" height="19" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"/></svg>
|
|
35
|
-
</button>
|
|
36
|
-
<template #empty>
|
|
37
|
-
<div class="flex items-center justify-center absolute left-0 top-0 right-0 bottom-0">
|
|
38
|
-
<label class="text-text-300">Upload</label>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
</Image>
|
|
42
|
-
<button type="button" v-if="index > 0" class="py-2" @click="src.splice(index, 1)">
|
|
43
|
-
<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>
|
|
10
|
+
<div class="mt-1">
|
|
11
|
+
<div class="flex flex-row items-start gap-2">
|
|
12
|
+
<Image :ref="`image`"
|
|
13
|
+
:src="item.props.src[viewIndex]"
|
|
14
|
+
class="w-[100px] aspect-square rounded-xl bg-white"
|
|
15
|
+
@click="$refs.uploader.edit(item.props.src[viewIndex])"
|
|
16
|
+
item-class="object-cover">
|
|
17
|
+
<button type="button" class="absolute top-1 right-1 rounded-full bg-white" v-if="item.props.src[viewIndex]"
|
|
18
|
+
@click.stop="$refs[`image`].reset()">
|
|
19
|
+
<svg width="19" height="19" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"/></svg>
|
|
44
20
|
</button>
|
|
45
|
-
</
|
|
46
|
-
|
|
21
|
+
</Image>
|
|
47
22
|
</div>
|
|
48
23
|
</div>
|
|
49
24
|
</div>
|
|
50
25
|
|
|
51
26
|
<div>
|
|
52
|
-
<
|
|
27
|
+
<small class="flex-1 text-text-400">Target</small>
|
|
53
28
|
<Textbox v-model="item.props.target" @keyup.enter="apply"/>
|
|
54
29
|
</div>
|
|
55
30
|
|
|
56
31
|
<div>
|
|
57
|
-
<
|
|
32
|
+
<small class="flex-1 text-text-400">Alt</small>
|
|
58
33
|
<Textbox v-model="item.props.alt" @keyup.enter="apply"/>
|
|
59
34
|
</div>
|
|
60
35
|
|
|
61
36
|
</div>
|
|
62
37
|
</div>
|
|
63
38
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
<ComponentSetting2 :item="item"
|
|
40
|
+
:view-type="viewType"
|
|
41
|
+
:view-types="viewTypes"
|
|
42
|
+
:view-index="viewIndex"
|
|
43
|
+
defaultDisplay="block"
|
|
44
|
+
@change="$emit('change')" />
|
|
69
45
|
|
|
70
46
|
</div>
|
|
71
47
|
</template>
|
|
72
48
|
|
|
73
49
|
<script>
|
|
74
50
|
|
|
51
|
+
import ImageUploader from "../components/ImageUploader.vue";
|
|
52
|
+
|
|
75
53
|
export default{
|
|
54
|
+
components: {ImageUploader},
|
|
76
55
|
|
|
77
56
|
emits: [ 'change' ],
|
|
78
57
|
|
|
79
|
-
inject: [ 'confirm', 'imageSrc', 'uploadImage', 'store' ],
|
|
58
|
+
inject: [ 'alert', 'confirm', 'imageSrc', 'uploadImage', 'store' ],
|
|
80
59
|
|
|
81
60
|
props: {
|
|
82
61
|
|
|
@@ -87,6 +66,8 @@ export default{
|
|
|
87
66
|
|
|
88
67
|
viewType: String,
|
|
89
68
|
|
|
69
|
+
viewIndex: Number,
|
|
70
|
+
|
|
90
71
|
viewTypes: Array,
|
|
91
72
|
|
|
92
73
|
},
|
|
@@ -95,20 +76,12 @@ export default{
|
|
|
95
76
|
|
|
96
77
|
apply(){
|
|
97
78
|
this.$emit('change')
|
|
98
|
-
}
|
|
79
|
+
}
|
|
99
80
|
|
|
100
81
|
},
|
|
101
82
|
|
|
102
83
|
computed: {
|
|
103
84
|
|
|
104
|
-
computedComp(){
|
|
105
|
-
return [
|
|
106
|
-
this.$style.comp,
|
|
107
|
-
this.width > 240 ? 'grid-cols-2' : ''
|
|
108
|
-
]
|
|
109
|
-
.join(' ')
|
|
110
|
-
},
|
|
111
|
-
|
|
112
85
|
componentStore(){
|
|
113
86
|
if(this.store && this.store.components){
|
|
114
87
|
if(!this.store.components.compsetting)
|
|
@@ -131,7 +104,7 @@ export default{
|
|
|
131
104
|
return this.item.props.src
|
|
132
105
|
}
|
|
133
106
|
|
|
134
|
-
}
|
|
107
|
+
}
|
|
135
108
|
|
|
136
109
|
}
|
|
137
110
|
|
|
@@ -140,7 +113,7 @@ export default{
|
|
|
140
113
|
<style module>
|
|
141
114
|
|
|
142
115
|
.comp{
|
|
143
|
-
|
|
116
|
+
@apply flex flex-col divide-y divide-border-50;
|
|
144
117
|
}
|
|
145
118
|
|
|
146
119
|
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div class="flex flex-col gap-4">
|
|
4
|
+
<div class="p-6 py-4 flex flex-col gap-4">
|
|
5
5
|
|
|
6
|
-
<div>
|
|
7
|
-
<
|
|
8
|
-
<Textbox v-model="item.props.text"
|
|
6
|
+
<div v-if="item.items.length < 1">
|
|
7
|
+
<small class="text-text-400">Text</small>
|
|
8
|
+
<Textbox v-model="item.props.text" maxlength="50" />
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div>
|
|
12
|
-
<
|
|
12
|
+
<small class="text-text-400">Mode</small>
|
|
13
13
|
<Dropdown v-model="item.props.mode">
|
|
14
14
|
<option disabled selected>Select Mode</option>
|
|
15
15
|
<option value="link">Link</option>
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
|
|
21
21
|
<div v-if="item.props.mode === 'link'" class="flex flex-col gap-4">
|
|
22
22
|
<div>
|
|
23
|
-
<
|
|
23
|
+
<small class="text-text-400">To</small>
|
|
24
24
|
<div class="flex flex-row gap-2">
|
|
25
|
-
<Textbox class="flex-1" v-model="
|
|
25
|
+
<Textbox class="flex-1" v-model="link.href"/>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div v-if="isExternalLink">
|
|
30
|
-
<
|
|
31
|
-
<Dropdown v-model="
|
|
30
|
+
<small class="text-text-400">Target</small>
|
|
31
|
+
<Dropdown v-model="link.target">
|
|
32
32
|
<option value="_self">Self</option>
|
|
33
33
|
<option value="_blank">Blank</option>
|
|
34
34
|
<option value="_parent">Parent</option>
|
|
@@ -39,15 +39,29 @@
|
|
|
39
39
|
|
|
40
40
|
<div v-else-if="item.props.mode === 'route'" class="flex flex-col gap-4">
|
|
41
41
|
<div>
|
|
42
|
-
<
|
|
42
|
+
<small class="text-text-400">To</small>
|
|
43
43
|
<div class="flex flex-row gap-2">
|
|
44
44
|
<Dropdown v-model="route.type" class="w-[70px]"
|
|
45
|
-
@change="
|
|
45
|
+
@change="item.props.route = { type:route.type }">
|
|
46
46
|
<option disabled selected>Choose Type</option>
|
|
47
|
+
<option value="name">Name</option>
|
|
47
48
|
<option value="path">Path</option>
|
|
48
49
|
<option value="hash">Hash</option>
|
|
49
50
|
</Dropdown>
|
|
50
|
-
|
|
51
|
+
|
|
52
|
+
<Dropdown v-if="route.type === 'name'"
|
|
53
|
+
class="flex-1"
|
|
54
|
+
v-model="route.name">
|
|
55
|
+
<option value="Home">Home</option>
|
|
56
|
+
<option value="Cart">Cart</option>
|
|
57
|
+
<option value="Search">Search</option>
|
|
58
|
+
<option value="AccountProfile">Account Profile</option>
|
|
59
|
+
<option value="AccountHistory">Account History</option>
|
|
60
|
+
</Dropdown>
|
|
61
|
+
<Textbox v-else-if="route.type === 'path'"
|
|
62
|
+
class="flex-1"
|
|
63
|
+
v-model="route.path"
|
|
64
|
+
maxlength="100" />
|
|
51
65
|
<Textbox v-else-if="route.type === 'hash'" class="flex-1" v-model="route.hash" @keyup.enter="$emit('change')"/>
|
|
52
66
|
</div>
|
|
53
67
|
</div>
|
|
@@ -56,7 +70,7 @@
|
|
|
56
70
|
<div v-else-if="item.props.mode === 'download'" class="flex flex-col gap-4">
|
|
57
71
|
|
|
58
72
|
<div>
|
|
59
|
-
<
|
|
73
|
+
<small class="text-text-400">File</small>
|
|
60
74
|
<div>
|
|
61
75
|
<input type="file" ref="file" class="hidden"
|
|
62
76
|
accept=".jpg,.jpeg,.png,.gif,.xls,.xlsx,.doc,.docx,.ppt,.pptx,.csv,.pdf"
|
|
@@ -81,19 +95,19 @@
|
|
|
81
95
|
</div>
|
|
82
96
|
|
|
83
97
|
<div>
|
|
84
|
-
<
|
|
85
|
-
<Textbox v-model="download.as"
|
|
98
|
+
<small class="text-text-400">As</small>
|
|
99
|
+
<Textbox v-model="download.as" :placeholder="placeholder"/>
|
|
86
100
|
</div>
|
|
87
101
|
</div>
|
|
88
102
|
|
|
89
|
-
|
|
90
103
|
</div>
|
|
91
104
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
<ComponentSetting2 :item="item"
|
|
106
|
+
:view-type="viewType"
|
|
107
|
+
:view-types="viewTypes"
|
|
108
|
+
:view-index="viewIndex"
|
|
109
|
+
defaultDisplay="block"
|
|
110
|
+
@change="$emit('change')" />
|
|
97
111
|
|
|
98
112
|
</div>
|
|
99
113
|
</template>
|
|
@@ -106,14 +120,16 @@ export default{
|
|
|
106
120
|
|
|
107
121
|
props: {
|
|
108
122
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
item: {
|
|
124
|
+
type: Object,
|
|
125
|
+
required: true
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
viewType: String,
|
|
113
129
|
|
|
114
|
-
|
|
130
|
+
viewIndex: Number,
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
viewTypes: Array,
|
|
117
133
|
|
|
118
134
|
},
|
|
119
135
|
|
|
@@ -152,14 +168,6 @@ export default{
|
|
|
152
168
|
return (this.item.props.href ?? '').indexOf('://') > -1;
|
|
153
169
|
},
|
|
154
170
|
|
|
155
|
-
download(){
|
|
156
|
-
if(!this.item.props.download){
|
|
157
|
-
this.item.props.download = {}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return this.item.props.download
|
|
161
|
-
},
|
|
162
|
-
|
|
163
171
|
placeholder(){
|
|
164
172
|
return this.download.originalName ?? this.download.name
|
|
165
173
|
},
|
|
@@ -169,7 +177,22 @@ export default{
|
|
|
169
177
|
this.item.props.route = {}
|
|
170
178
|
|
|
171
179
|
return this.item.props.route
|
|
172
|
-
}
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
link(){
|
|
183
|
+
if(!this.item.props.link)
|
|
184
|
+
this.item.props.link = {}
|
|
185
|
+
|
|
186
|
+
return this.item.props.link
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
download(){
|
|
190
|
+
if(!this.item.props.download){
|
|
191
|
+
this.item.props.download = {}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return this.item.props.download
|
|
195
|
+
},
|
|
173
196
|
|
|
174
197
|
}
|
|
175
198
|
|
|
@@ -180,7 +203,7 @@ export default{
|
|
|
180
203
|
<style module>
|
|
181
204
|
|
|
182
205
|
.comp{
|
|
183
|
-
|
|
206
|
+
@apply flex flex-col divide-y divide-border-50;
|
|
184
207
|
}
|
|
185
208
|
|
|
186
209
|
</style>
|