@mixd-id/web-scaffold 0.2.240705 → 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 -402
- 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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<div class="p-3 cursor-pointer flex flex-row" @click="expanded = !expanded">
|
|
5
|
+
<div class="flex-1">{{ text ?? 'Untitled' }}</div>
|
|
6
|
+
<button type="button">
|
|
7
|
+
<svg :class="expanded ? 'rotate-180' : ''" width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"/></svg>
|
|
8
|
+
</button>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div v-if="expanded || editMode === 1" class="px-3">
|
|
12
|
+
<component v-for="comp in items"
|
|
13
|
+
:is="`${comp.type}`"
|
|
14
|
+
:key="comp.uid"
|
|
15
|
+
:="comp" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
|
|
23
|
+
import {componentMixin} from "../mixin/component";
|
|
24
|
+
|
|
25
|
+
export default{
|
|
26
|
+
|
|
27
|
+
mixins: [ componentMixin ],
|
|
28
|
+
|
|
29
|
+
props:{
|
|
30
|
+
items: Array,
|
|
31
|
+
text: String,
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
data(){
|
|
35
|
+
return {
|
|
36
|
+
expanded: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
provide(){
|
|
41
|
+
return {
|
|
42
|
+
parentData: this.data
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style>
|
|
51
|
+
|
|
52
|
+
.menuitem2-enter-active,
|
|
53
|
+
.menuitem2-leave-active {
|
|
54
|
+
max-height: 100vh;
|
|
55
|
+
transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.menuitem2-enter-from,
|
|
59
|
+
.menuitem2-leave-to{
|
|
60
|
+
max-height: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
<style module>
|
|
66
|
+
|
|
67
|
+
.comp {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
</style>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
|
+
|
|
3
4
|
<div :class="circleClass" :style="circleStyle"
|
|
4
5
|
@click="mode === 'hex' ? $refs.inputColor.click() : $refs.contextMenu.open($refs.btn)"
|
|
5
6
|
ref="btn"></div>
|
|
7
|
+
|
|
6
8
|
<input type="color" :class="$style.inputColor" ref="inputColor"
|
|
7
9
|
@change="select($refs.inputColor.value)"/>
|
|
8
10
|
|
|
@@ -18,9 +20,9 @@
|
|
|
18
20
|
</div>
|
|
19
21
|
<div class="grid grid-cols-2 gap-4">
|
|
20
22
|
<button type="button" @click="select('')"
|
|
21
|
-
class="w-full p-1 border-
|
|
23
|
+
class="w-full p-1 border-border-100 border-[1px] rounded-lg">None</button>
|
|
22
24
|
<button type="button" v-if="mode !== 'class' && Boolean(customColor)"
|
|
23
|
-
class="w-full p-1 border-
|
|
25
|
+
class="w-full p-1 border-border-100 border-[1px] rounded-lg"
|
|
24
26
|
@click="$refs.inputColor.click()">Custom</button>
|
|
25
27
|
</div>
|
|
26
28
|
</div>
|
|
@@ -71,6 +73,8 @@ export default{
|
|
|
71
73
|
|
|
72
74
|
valueType: String,
|
|
73
75
|
|
|
76
|
+
itemClass: String
|
|
77
|
+
|
|
74
78
|
},
|
|
75
79
|
|
|
76
80
|
methods: {
|
|
@@ -104,6 +108,7 @@ export default{
|
|
|
104
108
|
circleClass(){
|
|
105
109
|
return [
|
|
106
110
|
this.$style.circle,
|
|
111
|
+
this.itemClass,
|
|
107
112
|
this.mode === 'class' ?
|
|
108
113
|
(this.modelValue ?? '').replace('text-', 'bg-').replace('border-', 'bg-') :
|
|
109
114
|
''
|
|
@@ -145,7 +150,7 @@ export default{
|
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
.circle{
|
|
148
|
-
@apply w-[24px] h-[24px] rounded-full cursor-pointer border-[2px] border-
|
|
153
|
+
@apply w-[24px] h-[24px] rounded-full cursor-pointer border-[2px] border-border-200;
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
.inputColor{
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<small class="text-text-400" v-if="title">
|
|
5
|
+
{{ title }}
|
|
6
|
+
</small>
|
|
7
|
+
|
|
3
8
|
<div :class="circleClass" :style="circleStyle"
|
|
4
9
|
@click="mode === 'hex' ? $refs.inputColor.click() : $refs.contextMenu.open($refs.btn)"
|
|
5
10
|
ref="btn"></div>
|
|
11
|
+
|
|
6
12
|
<input type="color" :class="$style.inputColor" ref="inputColor"
|
|
7
|
-
@change="select($refs.inputColor.value)"/>
|
|
13
|
+
@change="select($refs.inputColor.value)" />
|
|
8
14
|
|
|
9
15
|
<ContextMenu ref="contextMenu" :dismiss="false">
|
|
10
16
|
<div class="p-4 flex flex-col gap-4">
|
|
@@ -18,13 +24,14 @@
|
|
|
18
24
|
</div>
|
|
19
25
|
<div class="grid grid-cols-2 gap-4">
|
|
20
26
|
<button type="button" @click="select('')"
|
|
21
|
-
class="w-full p-1 border-
|
|
27
|
+
class="w-full p-1 border-border-100 border-[1px] rounded-lg">None</button>
|
|
22
28
|
<button type="button" v-if="mode !== 'class' && Boolean(customColor)"
|
|
23
|
-
class="w-full p-1 border-
|
|
29
|
+
class="w-full p-1 border-border-100 border-[1px] rounded-lg"
|
|
24
30
|
@click="$refs.inputColor.click()">Custom</button>
|
|
25
31
|
</div>
|
|
26
32
|
</div>
|
|
27
33
|
</ContextMenu>
|
|
34
|
+
|
|
28
35
|
</div>
|
|
29
36
|
</template>
|
|
30
37
|
|
|
@@ -34,8 +41,6 @@ import {hexToRgb, rgbToHex} from "../utils/helpers.mjs";
|
|
|
34
41
|
|
|
35
42
|
export default{
|
|
36
43
|
|
|
37
|
-
emits: [ 'change', 'update:modelValue' ],
|
|
38
|
-
|
|
39
44
|
props: {
|
|
40
45
|
|
|
41
46
|
mode: {
|
|
@@ -50,6 +55,8 @@ export default{
|
|
|
50
55
|
]
|
|
51
56
|
},
|
|
52
57
|
|
|
58
|
+
title: String,
|
|
59
|
+
|
|
53
60
|
values: {
|
|
54
61
|
type: Array,
|
|
55
62
|
default: [
|
|
@@ -71,30 +78,41 @@ export default{
|
|
|
71
78
|
|
|
72
79
|
customColor: undefined,
|
|
73
80
|
|
|
74
|
-
modelValue: String,
|
|
75
|
-
|
|
76
81
|
prefix: String,
|
|
77
82
|
|
|
78
83
|
valueType: String,
|
|
79
84
|
|
|
85
|
+
|
|
86
|
+
name: String,
|
|
87
|
+
|
|
88
|
+
item: {
|
|
89
|
+
type: Object,
|
|
90
|
+
required: true
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
viewType: String,
|
|
94
|
+
|
|
95
|
+
viewIndex: Number,
|
|
96
|
+
|
|
97
|
+
viewTypes: Array,
|
|
98
|
+
|
|
80
99
|
},
|
|
81
100
|
|
|
82
101
|
methods: {
|
|
83
102
|
|
|
84
103
|
select(color){
|
|
85
104
|
if(this.mode === 'class'){
|
|
86
|
-
|
|
105
|
+
this.value[this.viewIndex] = `${this.viewType}${this.keys[0][0]}${color}`
|
|
87
106
|
}
|
|
88
107
|
else{
|
|
89
108
|
if(this.valueType === 'rgb'){
|
|
90
109
|
const hex = hexToRgb(color)
|
|
91
|
-
this
|
|
110
|
+
this.value[this.viewIndex] = `${hex.r},${hex.g},${hex.b}`
|
|
92
111
|
}
|
|
93
112
|
else{
|
|
94
|
-
this
|
|
113
|
+
this.value[this.viewIndex] = color
|
|
95
114
|
}
|
|
96
115
|
}
|
|
97
|
-
this.$emit('change')
|
|
98
116
|
this.$refs.contextMenu.close()
|
|
99
117
|
}
|
|
100
118
|
|
|
@@ -102,16 +120,20 @@ export default{
|
|
|
102
120
|
|
|
103
121
|
computed:{
|
|
104
122
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
123
|
+
value(){
|
|
124
|
+
if(!Array.isArray(this.item.props[this.name]))
|
|
125
|
+
this.item.props[this.name] = []
|
|
126
|
+
|
|
127
|
+
return this.item.props[this.name]
|
|
128
|
+
},
|
|
109
129
|
|
|
110
130
|
circleClass(){
|
|
131
|
+
const value = this.value[this.viewIndex]
|
|
132
|
+
|
|
111
133
|
return [
|
|
112
134
|
this.$style.circle,
|
|
113
135
|
this.mode === 'class' ?
|
|
114
|
-
(
|
|
136
|
+
(value ?? '').replace('text-', 'bg-').replace('border-', 'bg-') :
|
|
115
137
|
''
|
|
116
138
|
]
|
|
117
139
|
.filter(_=>_)
|
|
@@ -121,9 +143,9 @@ export default{
|
|
|
121
143
|
circleStyle(){
|
|
122
144
|
if(this.mode !== 'class'){
|
|
123
145
|
|
|
124
|
-
let value = this.
|
|
146
|
+
let value = this.value[this.viewIndex]
|
|
125
147
|
if(this.valueType === 'rgb'){
|
|
126
|
-
value = rgbToHex(...(
|
|
148
|
+
value = rgbToHex(...(value ?? '').split(','))
|
|
127
149
|
}
|
|
128
150
|
|
|
129
151
|
return {
|
|
@@ -151,7 +173,7 @@ export default{
|
|
|
151
173
|
}
|
|
152
174
|
|
|
153
175
|
.circle{
|
|
154
|
-
@apply w-[24px] h-[24px] rounded-full cursor-pointer border-[2px] border-
|
|
176
|
+
@apply w-[24px] h-[24px] rounded-full cursor-pointer border-[2px] border-border-200;
|
|
155
177
|
}
|
|
156
178
|
|
|
157
179
|
.inputColor{
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<Dropdown v-model="mode" @change="calculate">
|
|
5
|
+
<option value="none">None</option>
|
|
6
|
+
<option value="solid">Solid</option>
|
|
7
|
+
<option value="linear">Linear Gradient</option>
|
|
8
|
+
<option value="radial">Radial Gradient</option>
|
|
9
|
+
</Dropdown>
|
|
10
|
+
|
|
11
|
+
<div v-if="computedBackground"
|
|
12
|
+
class="h-[8px] border-[1px] border-border-200 rounded-lg"
|
|
13
|
+
:style="{ background:computedBackground }"></div>
|
|
14
|
+
|
|
15
|
+
<div v-if="mode === 'solid'">
|
|
16
|
+
<input type="color" v-model="color1" @change="calculate" />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div v-else-if="[ 'linear', 'radial' ].includes(mode)" class="flex flex-row gap-3">
|
|
20
|
+
<input type="color" v-model="color1" @change="calculate" />
|
|
21
|
+
<div class="flex-1"></div>
|
|
22
|
+
<input type="color" v-model="color2" @change="calculate" />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
|
|
31
|
+
emits: [ 'update:modelValue' ],
|
|
32
|
+
|
|
33
|
+
props: {
|
|
34
|
+
|
|
35
|
+
modelValue: String
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
methods: {
|
|
40
|
+
|
|
41
|
+
calculate(){
|
|
42
|
+
this.$emit('update:modelValue', this.computedBackground)
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
mounted() {
|
|
47
|
+
if(`${this.modelValue ?? ''}`.substring(0, 1) === '#'){
|
|
48
|
+
this.color1 = this.modelValue
|
|
49
|
+
this.mode = 'solid'
|
|
50
|
+
}
|
|
51
|
+
else if(`${this.modelValue ?? ''}`.indexOf('linear-') >= 0){
|
|
52
|
+
const match = this.modelValue.match(/linear-gradient\(([^,]+),([^,]+),([^)]+)\)/)
|
|
53
|
+
|
|
54
|
+
this.mode = 'linear'
|
|
55
|
+
this.color1 = ((match ?? [])[2] ?? '').trim()
|
|
56
|
+
this.color2 = ((match ?? [])[3] ?? '').trim()
|
|
57
|
+
}
|
|
58
|
+
else if(`${this.modelValue ?? ''}`.indexOf('radial-') >= 0){
|
|
59
|
+
const match = this.modelValue.match(/radial-gradient\(([^,]+),([^,]+),([^)]+)\)/)
|
|
60
|
+
|
|
61
|
+
this.mode = 'radial'
|
|
62
|
+
this.color1 = ((match ?? [])[2] ?? '').trim()
|
|
63
|
+
this.color2 = ((match ?? [])[3] ?? '').trim()
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
data() {
|
|
68
|
+
return {
|
|
69
|
+
mode: "solid", // solid, linear, radial
|
|
70
|
+
color1: "",
|
|
71
|
+
color2: "",
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
computed: {
|
|
76
|
+
computedBackground() {
|
|
77
|
+
if (this.mode === "solid") {
|
|
78
|
+
return this.color1;
|
|
79
|
+
}
|
|
80
|
+
else if (this.mode === "linear") {
|
|
81
|
+
return `linear-gradient(to right, ${this.color1}, ${this.color2})`;
|
|
82
|
+
}
|
|
83
|
+
else if (this.mode === "radial") {
|
|
84
|
+
return `radial-gradient(circle, ${this.color1}, ${this.color2})`;
|
|
85
|
+
}
|
|
86
|
+
else{
|
|
87
|
+
return null
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style module>
|
|
95
|
+
|
|
96
|
+
.comp {
|
|
97
|
+
@apply flex flex-col gap-2;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
</style>
|
|
@@ -18,16 +18,18 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
20
|
<div class="mt-4 flex flex-row gap-2">
|
|
21
|
-
<Button ref="btnOK" @click="onConfirm" class="min-w-[88px]" tabindex="0">
|
|
21
|
+
<Button ref="btnOK" @click="onConfirm" class="min-w-[88px] text-lg" tabindex="0">
|
|
22
22
|
<strong class="px-4">
|
|
23
23
|
{{ buttonText[0] }}
|
|
24
24
|
</strong>
|
|
25
25
|
</Button>
|
|
26
|
-
<Button variant="minimal" @click="onDismiss" class="min-w-[88px] px-4 hover:text-primary">
|
|
26
|
+
<Button variant="minimal" @click="onDismiss" class="min-w-[88px] px-4 hover:text-primary text-lg">
|
|
27
27
|
{{ buttonText[1] }}
|
|
28
28
|
</Button>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
+
<slot name="end"></slot>
|
|
32
|
+
|
|
31
33
|
</div>
|
|
32
34
|
</Transition>
|
|
33
35
|
</div>
|
|
@@ -113,15 +115,15 @@ export default{
|
|
|
113
115
|
.confirm{
|
|
114
116
|
@apply fixed top-0 left-0 flex w-screen h-screen px-8;
|
|
115
117
|
@apply items-center justify-center bg-white/50 backdrop-blur-md;
|
|
116
|
-
|
|
118
|
+
z-index: 150;
|
|
117
119
|
}
|
|
118
120
|
[data-theme="dark"] .confirm{
|
|
119
121
|
@apply bg-black/50;
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
.confirm>*{
|
|
123
|
-
@apply max-h-[60vh] overflow-y-auto bg-base-
|
|
124
|
-
@apply border-[1px] border-
|
|
125
|
+
@apply max-h-[60vh] overflow-y-auto bg-base-400 dark:bg-base-300 rounded-xl;
|
|
126
|
+
@apply border-[1px] border-border-50;
|
|
125
127
|
@apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
|
|
126
128
|
}
|
|
127
129
|
|
|
@@ -130,7 +132,7 @@ export default{
|
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
.cont2{
|
|
133
|
-
@apply my-4 text-center flex-1 overflow-y-auto;
|
|
135
|
+
@apply my-4 text-center flex-1 overflow-y-auto px-6;
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
.title{
|
|
@@ -138,7 +140,7 @@ export default{
|
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
.description{
|
|
141
|
-
@apply overflow-y-auto whitespace-pre-line text-center;
|
|
143
|
+
@apply overflow-y-auto whitespace-pre-line text-center text-lg;
|
|
142
144
|
overflow-wrap: break-word;
|
|
143
145
|
word-wrap: break-word;
|
|
144
146
|
-ms-word-break: break-all;
|