@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,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button :class="compClass" @click="onClick" :style="computedStyle"
|
|
3
|
-
v-tooltip="disabledText">
|
|
3
|
+
v-tooltip="disabledText" :disabled="isDisabled" :title="isLoading ? 1 : -1">
|
|
4
4
|
<slot>{{ text }}</slot>
|
|
5
|
-
<
|
|
6
|
-
<svg
|
|
5
|
+
<span v-if="isLoading" :class="$style.spinner">
|
|
6
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
7
7
|
<circle :class="$style.svgBg" cx="12" cy="12" r="10" stroke-width="4"></circle>
|
|
8
8
|
<path :class="$style.svgHg" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
9
9
|
</svg>
|
|
10
|
-
</
|
|
10
|
+
</span>
|
|
11
11
|
</button>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
@@ -39,8 +39,6 @@ export default{
|
|
|
39
39
|
|
|
40
40
|
targetType: String,
|
|
41
41
|
|
|
42
|
-
width: Array,
|
|
43
|
-
|
|
44
42
|
disabledText: String
|
|
45
43
|
|
|
46
44
|
},
|
|
@@ -52,9 +50,8 @@ export default{
|
|
|
52
50
|
return [
|
|
53
51
|
this.$style.button,
|
|
54
52
|
this.$style['button-' + this.variant],
|
|
55
|
-
this.isDisabled ? this.$style['button-disabled'] : '',
|
|
56
|
-
this.
|
|
57
|
-
parseInt(this.computedState) === 2 ? this.$style.loading : ''
|
|
53
|
+
this.isDisabled ? `${this.$style['button-disabled'] ?? ''}` + ' ' + `${this.$style['button-' + this.variant + '-disabled'] ?? ''}` : '',
|
|
54
|
+
this.isLoading ? `${this.$style['button-loading'] ?? ''}` + ' ' + `${this.$style['button-' + this.variant + '-loading'] ?? ''}` : ''
|
|
58
55
|
]
|
|
59
56
|
.filter(_ => _)
|
|
60
57
|
.join(' ')
|
|
@@ -70,15 +67,6 @@ export default{
|
|
|
70
67
|
|
|
71
68
|
computedState() {
|
|
72
69
|
return this._state ?? this.state
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
widths() {
|
|
76
|
-
if (!Array.isArray(this.width)) return ['', '']
|
|
77
|
-
|
|
78
|
-
return [
|
|
79
|
-
this.width[0] ?? '',
|
|
80
|
-
this.width[1] ? this.width[1] : (this.width[0] ?? ''),
|
|
81
|
-
]
|
|
82
70
|
}
|
|
83
71
|
|
|
84
72
|
},
|
|
@@ -95,7 +83,7 @@ export default{
|
|
|
95
83
|
this.$el.focus()
|
|
96
84
|
},
|
|
97
85
|
|
|
98
|
-
setState(state
|
|
86
|
+
setState(state) {
|
|
99
87
|
this._state = state
|
|
100
88
|
},
|
|
101
89
|
|
|
@@ -103,7 +91,7 @@ export default{
|
|
|
103
91
|
this._state = null
|
|
104
92
|
},
|
|
105
93
|
|
|
106
|
-
onClick() {
|
|
94
|
+
onClick(e) {
|
|
107
95
|
if ('edit-mode' in this.$route.query) return
|
|
108
96
|
|
|
109
97
|
if (this.isDisabled) {
|
|
@@ -125,7 +113,7 @@ export default{
|
|
|
125
113
|
break
|
|
126
114
|
}
|
|
127
115
|
} else {
|
|
128
|
-
this.$emit('click')
|
|
116
|
+
this.$emit('click', e)
|
|
129
117
|
}
|
|
130
118
|
}
|
|
131
119
|
},
|
|
@@ -148,197 +136,123 @@ export default{
|
|
|
148
136
|
|
|
149
137
|
<style module>
|
|
150
138
|
|
|
151
|
-
.button
|
|
152
|
-
@apply p-2;
|
|
153
|
-
@apply
|
|
154
|
-
@apply
|
|
155
|
-
@apply
|
|
139
|
+
.button{
|
|
140
|
+
@apply p-2 px-8 rounded-lg relative inline-flex flex-row items-center justify-center;
|
|
141
|
+
@apply whitespace-nowrap text-ellipsis overflow-hidden min-h-7;
|
|
142
|
+
@apply border-[1px];
|
|
143
|
+
@apply active:top-[1px] active:left-[1px] disabled:top-0 disabled:left-0;
|
|
144
|
+
@apply cursor-pointer disabled:cursor-not-allowed disabled:text-opacity-60;
|
|
156
145
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
@apply flex items-center justify-center
|
|
146
|
+
.button:disabled svg{
|
|
147
|
+
@apply opacity-50;
|
|
160
148
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
@apply text-opacity-50;
|
|
149
|
+
.button:disabled>*{
|
|
150
|
+
@apply opacity-50;
|
|
164
151
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
@apply top-[1px] left-[1px] relative;
|
|
152
|
+
.button-loading{
|
|
153
|
+
@apply !text-opacity-0;
|
|
168
154
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
@apply bg-primary-500 text-white rounded-lg;
|
|
172
|
-
@apply hover:bg-primary-600 focus:border-primary-300;
|
|
173
|
-
box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
|
|
174
|
-
border: solid 1px rgb(var(--primary-500));
|
|
155
|
+
.button-loading>*{
|
|
156
|
+
@apply !opacity-0;
|
|
175
157
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
.button-primary-disabled:hover {
|
|
179
|
-
@apply bg-primary-300 border-primary-300 top-0 left-0 cursor-not-allowed text-opacity-50;
|
|
180
|
-
@apply top-0 left-0;
|
|
158
|
+
.button-loading>label{
|
|
159
|
+
@apply hidden;
|
|
181
160
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
@apply text-white fill-white;
|
|
161
|
+
.button>label{
|
|
162
|
+
@apply pointer-events-none;
|
|
185
163
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
@apply fill-transparent
|
|
164
|
+
.spinner{
|
|
165
|
+
@apply absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center;
|
|
189
166
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
stroke: #fff;
|
|
193
|
-
stroke-opacity: 25%;
|
|
167
|
+
.button-loading .spinner{
|
|
168
|
+
@apply !opacity-100;
|
|
194
169
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
fill
|
|
198
|
-
fill-opacity: 75%;
|
|
170
|
+
.spinner svg{
|
|
171
|
+
@apply !opacity-100;
|
|
172
|
+
@apply fill-text animate-spin w-5 h-5;
|
|
199
173
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
@apply
|
|
174
|
+
.svgBg{
|
|
175
|
+
@apply !opacity-100;
|
|
176
|
+
@apply stroke-text-50 fill-transparent;
|
|
203
177
|
}
|
|
204
178
|
|
|
205
|
-
.button-
|
|
179
|
+
.button-primary{
|
|
180
|
+
@apply border-primary text-white;
|
|
181
|
+
background: var(--primary-500);
|
|
182
|
+
@apply hover:bg-primary-600 hover:border-primary-600 disabled:bg-primary;
|
|
206
183
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
.button-outline-disabled:hover {
|
|
210
|
-
@apply top-0 left-0 cursor-not-allowed;
|
|
211
|
-
@apply text-text border-primary-500 text-opacity-50;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.button-outline * {
|
|
215
|
-
@apply text-primary-500 fill-primary-500;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.button-outline.loading * {
|
|
219
|
-
@apply fill-transparent
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.button-outline .svgBg {
|
|
223
|
-
stroke: rgb(var(--primary-600));
|
|
224
|
-
stroke-opacity: 50%;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.button-outline .svgHg {
|
|
228
|
-
fill: rgb(var(--primary-500));
|
|
229
|
-
fill-opacity: 100%;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.button-secondary {
|
|
233
|
-
@apply bg-secondary-500 border-secondary-500 text-primary-700 rounded-lg text-white;
|
|
234
|
-
border: solid 1px rgb(var(--secondary-500));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.button-secondary:hover {
|
|
238
|
-
@apply bg-secondary-600 border-secondary-600;
|
|
184
|
+
.button-primary *{
|
|
185
|
+
@apply text-white fill-white;
|
|
239
186
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
187
|
+
.button-primary .svgBg{
|
|
188
|
+
@apply !fill-none;
|
|
189
|
+
stroke: #fff;
|
|
190
|
+
stroke-opacity: 25%;
|
|
244
191
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
192
|
+
.button-primary .svgHg {
|
|
193
|
+
fill: #fff;
|
|
194
|
+
fill-opacity: 750%;
|
|
248
195
|
}
|
|
249
196
|
|
|
250
|
-
.button-secondary
|
|
251
|
-
@apply
|
|
197
|
+
.button-secondary{
|
|
198
|
+
@apply border-secondary text-white;
|
|
199
|
+
@apply hover:bg-secondary-600 hover:border-secondary-600;
|
|
200
|
+
background: var(--secondary-500);
|
|
252
201
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
stroke: rgb(var(--text-400));
|
|
202
|
+
.button-secondary .svgBg{
|
|
203
|
+
stroke: #fff;
|
|
256
204
|
stroke-opacity: 25%;
|
|
257
205
|
}
|
|
258
|
-
|
|
259
206
|
.button-secondary .svgHg {
|
|
260
|
-
fill:
|
|
207
|
+
fill: #fff;
|
|
261
208
|
fill-opacity: 75%;
|
|
262
209
|
}
|
|
263
210
|
|
|
264
|
-
.button-
|
|
265
|
-
@apply bg-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
.button-red:hover {
|
|
269
|
-
@apply bg-red-600 border-red-600;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.button-red-disabled,
|
|
273
|
-
.button-red-disabled:hover {
|
|
274
|
-
@apply bg-red-500 border-red-500 top-0 left-0 cursor-not-allowed text-opacity-50;
|
|
211
|
+
.button-outline{
|
|
212
|
+
@apply border-primary bg-transparent text-primary;
|
|
213
|
+
@apply hover:bg-transparent hover:border-primary-600;
|
|
275
214
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
@apply text-white fill-white;
|
|
215
|
+
.button-outline>*{
|
|
216
|
+
@apply text-primary fill-primary;
|
|
279
217
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
@apply fill-transparent
|
|
218
|
+
.button-outline:disabled>*{
|
|
219
|
+
@apply text-primary-300 fill-primary-300;
|
|
283
220
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
@apply stroke-red-400;
|
|
221
|
+
.button-outline .svgBg{
|
|
222
|
+
stroke: rgb(var(--primary-600));
|
|
287
223
|
stroke-opacity: 50%;
|
|
288
224
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
@apply fill-text-500;
|
|
225
|
+
.button-outline .svgHg {
|
|
226
|
+
fill: rgb(var(--primary-500));
|
|
292
227
|
fill-opacity: 100%;
|
|
293
228
|
}
|
|
294
229
|
|
|
295
|
-
.button-minimal
|
|
296
|
-
@apply border-
|
|
230
|
+
.button-minimal{
|
|
231
|
+
@apply border-transparent bg-transparent text-text;
|
|
232
|
+
@apply hover:bg-transparent hover:border-transparent;
|
|
297
233
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.button-minimal .svgBg {
|
|
303
|
-
stroke: rgb(var(--text-500));
|
|
234
|
+
.button-minimal .svgBg{
|
|
235
|
+
stroke: #fff;
|
|
304
236
|
stroke-opacity: 25%;
|
|
305
237
|
}
|
|
306
|
-
|
|
307
238
|
.button-minimal .svgHg {
|
|
308
|
-
fill:
|
|
239
|
+
fill: #fff;
|
|
309
240
|
fill-opacity: 75%;
|
|
310
241
|
}
|
|
311
242
|
|
|
312
|
-
.
|
|
313
|
-
@apply
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
.loading {
|
|
317
|
-
color: transparent;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.loading > *:first-child {
|
|
321
|
-
@apply opacity-0
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.loading:hover {
|
|
243
|
+
.button-red{
|
|
244
|
+
@apply bg-red-500 border-red-500 text-white;
|
|
245
|
+
@apply hover:bg-red-600 hover:border-red-600 disabled:bg-red-600;
|
|
325
246
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.loading > * {
|
|
332
|
-
opacity: 0;
|
|
247
|
+
.button-red .svgBg{
|
|
248
|
+
stroke: #fff;
|
|
249
|
+
stroke-opacity: 25%;
|
|
333
250
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
opacity:
|
|
251
|
+
.button-red .svgHg {
|
|
252
|
+
fill: #fff;
|
|
253
|
+
fill-opacity: 75%;
|
|
337
254
|
}
|
|
338
255
|
|
|
339
|
-
.spinner {
|
|
340
|
-
@apply animate-spin h-5 w-5;
|
|
341
|
-
}
|
|
342
256
|
|
|
343
257
|
</style>
|
|
344
258
|
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport v-if="float" to=".bW9k">
|
|
3
|
+
<Transition name="slideup"
|
|
4
|
+
@after-leave="onAfterLeave"
|
|
5
|
+
appear>
|
|
6
|
+
<div v-if="computedState"
|
|
7
|
+
:class="computedClass"
|
|
8
|
+
:style="computedStyle">
|
|
9
|
+
|
|
10
|
+
<slot name="header">
|
|
11
|
+
<div class="relative">
|
|
12
|
+
<div class="absolute top-0 right-0">
|
|
13
|
+
<button type="button" @click="close" class="p-4">
|
|
14
|
+
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
16
|
+
</svg>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</slot>
|
|
21
|
+
|
|
22
|
+
<slot name="default" :context="context"></slot>
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
</Transition>
|
|
26
|
+
</Teleport>
|
|
27
|
+
<div v-else :class="computedClass">
|
|
28
|
+
<slot name="default" :context="context"></slot>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
|
|
34
|
+
const modals = []
|
|
35
|
+
|
|
36
|
+
const onDismiss = (e) => {
|
|
37
|
+
if(e.target.classList.contains('bW9k')){
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.querySelector('.bW9k').addEventListener('click', onDismiss)
|
|
43
|
+
|
|
44
|
+
export default{
|
|
45
|
+
|
|
46
|
+
computed: {
|
|
47
|
+
|
|
48
|
+
computedClass(){
|
|
49
|
+
return [
|
|
50
|
+
this.float ? this.$style.modal : this.$style.static,
|
|
51
|
+
this.class,
|
|
52
|
+
this.computedState ? this.$style['state-open'] : ''
|
|
53
|
+
]
|
|
54
|
+
.join(' ')
|
|
55
|
+
.trim()
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
computedState(){
|
|
59
|
+
const state = this.query ? this.query in this.$route.query :
|
|
60
|
+
(this.hash ? this.$route.hash.indexOf(this.hash) > -1 : this._state);
|
|
61
|
+
|
|
62
|
+
return state
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
computedStyle(){
|
|
66
|
+
return {
|
|
67
|
+
width: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.width),
|
|
68
|
+
height: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.height),
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
computedTransition(){
|
|
73
|
+
return 'slidedown'
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
data(){
|
|
79
|
+
return {
|
|
80
|
+
_state: false,
|
|
81
|
+
context: {}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
methods:{
|
|
86
|
+
|
|
87
|
+
close(){
|
|
88
|
+
if(!this.float) return
|
|
89
|
+
|
|
90
|
+
if(this.query){
|
|
91
|
+
this.$router.replace({
|
|
92
|
+
...this.$route,
|
|
93
|
+
query: {
|
|
94
|
+
...this.$route.query,
|
|
95
|
+
[this.query]: undefined
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
else if(this.hash){
|
|
100
|
+
|
|
101
|
+
let currentHash = ''
|
|
102
|
+
const hashNames = this.$route.hash.split('#')
|
|
103
|
+
for(let name of hashNames){
|
|
104
|
+
if(name.indexOf(this.hash.substring(1)) > -1){
|
|
105
|
+
currentHash = `#${name}`
|
|
106
|
+
break
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.$router.replace({
|
|
111
|
+
...this.$route,
|
|
112
|
+
hash: this.$route.hash.replace(currentHash, '')
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
else{
|
|
116
|
+
this._state = false
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
open(context = {}){
|
|
122
|
+
this.context = context
|
|
123
|
+
|
|
124
|
+
if(this.query){
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
else{
|
|
128
|
+
this._state = true
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
onAfterLeave(){
|
|
133
|
+
this.$nextTick(() => {
|
|
134
|
+
let overlay = document.querySelector('.bW9k')
|
|
135
|
+
if(overlay){
|
|
136
|
+
if(overlay.children.length < 1)
|
|
137
|
+
overlay.classList.remove('bW9l')
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
mounted(){
|
|
145
|
+
this.mounted = true
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
props:{
|
|
149
|
+
|
|
150
|
+
class: String,
|
|
151
|
+
|
|
152
|
+
dismissable: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: false
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
float: Boolean,
|
|
158
|
+
|
|
159
|
+
height: {
|
|
160
|
+
type: [ String, Number ],
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
state: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: false
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
hash: String,
|
|
169
|
+
|
|
170
|
+
query: String,
|
|
171
|
+
|
|
172
|
+
width: [ String, Number ],
|
|
173
|
+
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
watch: {
|
|
177
|
+
|
|
178
|
+
computedState: {
|
|
179
|
+
immediate: true,
|
|
180
|
+
handler(state){
|
|
181
|
+
if(!this.float) return
|
|
182
|
+
|
|
183
|
+
let overlay = document.querySelector('.bW9k')
|
|
184
|
+
if(overlay){
|
|
185
|
+
if(state){
|
|
186
|
+
overlay.classList.add('bW9l')
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
</script>
|
|
197
|
+
|
|
198
|
+
<style>
|
|
199
|
+
|
|
200
|
+
.bW9k{
|
|
201
|
+
@apply z-20 hidden w-[100vw] h-[100vh];
|
|
202
|
+
@apply bg-white/50 backdrop-blur-xl;
|
|
203
|
+
position: fixed;
|
|
204
|
+
top: 0;
|
|
205
|
+
left: 0;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
right: 0;
|
|
208
|
+
z-index: 100;
|
|
209
|
+
}
|
|
210
|
+
[data-theme="dark"] .bW9k{
|
|
211
|
+
@apply bg-black/50;
|
|
212
|
+
}
|
|
213
|
+
.bW9l{
|
|
214
|
+
@apply flex items-center justify-center;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
</style>
|
|
218
|
+
|
|
219
|
+
<style module>
|
|
220
|
+
|
|
221
|
+
.static{
|
|
222
|
+
@apply flex flex-col;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.modal{
|
|
226
|
+
@apply fixed;
|
|
227
|
+
@apply bg-base-400 dark:bg-base-300;
|
|
228
|
+
@apply border-[1px] border-border-50 flex max-h-[90vh] max-w-full;
|
|
229
|
+
@apply rounded-xl overflow-hidden transition-all;
|
|
230
|
+
@apply flex flex-col;
|
|
231
|
+
z-index: 101;
|
|
232
|
+
transition: all 200ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
233
|
+
transform: scale(0);
|
|
234
|
+
opacity: 0;
|
|
235
|
+
}
|
|
236
|
+
.modal.state-open{
|
|
237
|
+
transform: scale(1);
|
|
238
|
+
opacity: 1;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.overlay{
|
|
242
|
+
@apply absolute z-20 left-0 bottom-0 top-0 right-0 bg-white/50 backdrop-blur-sm;
|
|
243
|
+
}
|
|
244
|
+
html[data-theme='dark'] .overlay{
|
|
245
|
+
@apply bg-black/50;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@media screen and (max-width: 640px){
|
|
249
|
+
|
|
250
|
+
.modal {
|
|
251
|
+
width: 100% !important;
|
|
252
|
+
max-height: 90vh;
|
|
253
|
+
@apply self-end;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
</style>
|