@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,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
|
|
|
@@ -148,197 +136,121 @@ 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 bg-primary border-primary text-white;
|
|
181
|
+
@apply hover:bg-primary-600 hover:border-primary-600 disabled:bg-primary;
|
|
206
182
|
}
|
|
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;
|
|
183
|
+
.button-primary *{
|
|
184
|
+
@apply text-white fill-white;
|
|
239
185
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
186
|
+
.button-primary .svgBg{
|
|
187
|
+
@apply !fill-none;
|
|
188
|
+
stroke: #fff;
|
|
189
|
+
stroke-opacity: 25%;
|
|
244
190
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
191
|
+
.button-primary .svgHg {
|
|
192
|
+
fill: #fff;
|
|
193
|
+
fill-opacity: 750%;
|
|
248
194
|
}
|
|
249
195
|
|
|
250
|
-
.button-secondary
|
|
251
|
-
@apply
|
|
196
|
+
.button-secondary{
|
|
197
|
+
@apply bg-secondary border-secondary text-white;
|
|
198
|
+
@apply hover:bg-secondary-600 hover:border-secondary-600;
|
|
252
199
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
stroke: rgb(var(--text-400));
|
|
200
|
+
.button-secondary .svgBg{
|
|
201
|
+
stroke: #fff;
|
|
256
202
|
stroke-opacity: 25%;
|
|
257
203
|
}
|
|
258
|
-
|
|
259
204
|
.button-secondary .svgHg {
|
|
260
|
-
fill:
|
|
205
|
+
fill: #fff;
|
|
261
206
|
fill-opacity: 75%;
|
|
262
207
|
}
|
|
263
208
|
|
|
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;
|
|
209
|
+
.button-outline{
|
|
210
|
+
@apply border-primary bg-transparent text-primary;
|
|
211
|
+
@apply hover:bg-transparent hover:border-primary-600;
|
|
275
212
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
@apply text-white fill-white;
|
|
213
|
+
.button-outline>*{
|
|
214
|
+
@apply text-primary fill-primary;
|
|
279
215
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
@apply fill-transparent
|
|
216
|
+
.button-outline:disabled>*{
|
|
217
|
+
@apply text-primary-300 fill-primary-300;
|
|
283
218
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
@apply stroke-red-400;
|
|
219
|
+
.button-outline .svgBg{
|
|
220
|
+
stroke: rgb(var(--primary-600));
|
|
287
221
|
stroke-opacity: 50%;
|
|
288
222
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
@apply fill-text-500;
|
|
223
|
+
.button-outline .svgHg {
|
|
224
|
+
fill: rgb(var(--primary-500));
|
|
292
225
|
fill-opacity: 100%;
|
|
293
226
|
}
|
|
294
227
|
|
|
295
|
-
.button-minimal
|
|
296
|
-
@apply border-
|
|
228
|
+
.button-minimal{
|
|
229
|
+
@apply border-transparent bg-transparent text-text;
|
|
230
|
+
@apply hover:bg-transparent hover:border-transparent;
|
|
297
231
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.button-minimal .svgBg {
|
|
303
|
-
stroke: rgb(var(--text-500));
|
|
232
|
+
.button-minimal .svgBg{
|
|
233
|
+
stroke: #fff;
|
|
304
234
|
stroke-opacity: 25%;
|
|
305
235
|
}
|
|
306
|
-
|
|
307
236
|
.button-minimal .svgHg {
|
|
308
|
-
fill:
|
|
237
|
+
fill: #fff;
|
|
309
238
|
fill-opacity: 75%;
|
|
310
239
|
}
|
|
311
240
|
|
|
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 {
|
|
241
|
+
.button-red{
|
|
242
|
+
@apply bg-red-500 border-red-500 text-white;
|
|
243
|
+
@apply hover:bg-red-600 hover:border-red-600 disabled:bg-red-600;
|
|
325
244
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.loading > * {
|
|
332
|
-
opacity: 0;
|
|
245
|
+
.button-red .svgBg{
|
|
246
|
+
stroke: #fff;
|
|
247
|
+
stroke-opacity: 25%;
|
|
333
248
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
opacity:
|
|
249
|
+
.button-red .svgHg {
|
|
250
|
+
fill: #fff;
|
|
251
|
+
fill-opacity: 75%;
|
|
337
252
|
}
|
|
338
253
|
|
|
339
|
-
.spinner {
|
|
340
|
-
@apply animate-spin h-5 w-5;
|
|
341
|
-
}
|
|
342
254
|
|
|
343
255
|
</style>
|
|
344
256
|
|
|
@@ -0,0 +1,235 @@
|
|
|
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"></slot>
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
</Transition>
|
|
26
|
+
</Teleport>
|
|
27
|
+
<div v-else :class="computedClass">
|
|
28
|
+
<slot name="default"></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
|
+
return this.mounted &&
|
|
60
|
+
(this.query ? this.query in this.$route.query : this._state);
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
computedStyle(){
|
|
64
|
+
return {
|
|
65
|
+
width: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.width),
|
|
66
|
+
height: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.height),
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
computedTransition(){
|
|
71
|
+
return 'slidedown'
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
data(){
|
|
77
|
+
return {
|
|
78
|
+
mounted: false,
|
|
79
|
+
_state: false
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
methods:{
|
|
84
|
+
|
|
85
|
+
close(){
|
|
86
|
+
if(!this.float) return
|
|
87
|
+
|
|
88
|
+
if(this.query){
|
|
89
|
+
this.$router.replace({
|
|
90
|
+
...this.$route,
|
|
91
|
+
query: {
|
|
92
|
+
...this.$route.query,
|
|
93
|
+
[this.query]: undefined
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
else{
|
|
98
|
+
this._state = false
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
open(){
|
|
104
|
+
if(this.query){
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
else{
|
|
108
|
+
this._state = true
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
onAfterLeave(){
|
|
113
|
+
this.$nextTick(() => {
|
|
114
|
+
let overlay = document.querySelector('.bW9k')
|
|
115
|
+
if(overlay){
|
|
116
|
+
if(overlay.children.length < 1)
|
|
117
|
+
overlay.classList.remove('bW9l')
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
mounted(){
|
|
125
|
+
this.mounted = true
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
props:{
|
|
129
|
+
|
|
130
|
+
class: String,
|
|
131
|
+
|
|
132
|
+
dismissable: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
float: Boolean,
|
|
138
|
+
|
|
139
|
+
height: {
|
|
140
|
+
type: [ String, Number ],
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
state: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: false
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
query: String,
|
|
149
|
+
|
|
150
|
+
width: [ String, Number ],
|
|
151
|
+
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
watch: {
|
|
155
|
+
|
|
156
|
+
computedState: {
|
|
157
|
+
immediate: true,
|
|
158
|
+
handler(state){
|
|
159
|
+
if(!this.float) return
|
|
160
|
+
|
|
161
|
+
let overlay = document.querySelector('.bW9k')
|
|
162
|
+
if(overlay){
|
|
163
|
+
if(state){
|
|
164
|
+
overlay.classList.add('bW9l')
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style>
|
|
177
|
+
|
|
178
|
+
.bW9k{
|
|
179
|
+
@apply z-20 hidden w-[100vw] h-[100vh];
|
|
180
|
+
@apply bg-white/50 backdrop-blur-xl;
|
|
181
|
+
position: fixed;
|
|
182
|
+
top: 0;
|
|
183
|
+
left: 0;
|
|
184
|
+
bottom: 0;
|
|
185
|
+
right: 0;
|
|
186
|
+
z-index: 100;
|
|
187
|
+
}
|
|
188
|
+
[data-theme="dark"] .bW9k{
|
|
189
|
+
@apply bg-black/50;
|
|
190
|
+
}
|
|
191
|
+
.bW9l{
|
|
192
|
+
@apply flex items-center justify-center;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
</style>
|
|
196
|
+
|
|
197
|
+
<style module>
|
|
198
|
+
|
|
199
|
+
.static{
|
|
200
|
+
@apply flex flex-col;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.modal{
|
|
204
|
+
@apply fixed;
|
|
205
|
+
@apply bg-base-400 dark:bg-base-300;
|
|
206
|
+
@apply border-[1px] border-border-50 flex max-h-[90vh] max-w-full;
|
|
207
|
+
@apply rounded-xl overflow-hidden transition-all;
|
|
208
|
+
@apply flex flex-col;
|
|
209
|
+
z-index: 101;
|
|
210
|
+
transition: all 200ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
211
|
+
transform: scale(0);
|
|
212
|
+
opacity: 0;
|
|
213
|
+
}
|
|
214
|
+
.modal.state-open{
|
|
215
|
+
transform: scale(1);
|
|
216
|
+
opacity: 1;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.overlay{
|
|
220
|
+
@apply absolute z-20 left-0 bottom-0 top-0 right-0 bg-white/50 backdrop-blur-sm;
|
|
221
|
+
}
|
|
222
|
+
html[data-theme='dark'] .overlay{
|
|
223
|
+
@apply bg-black/50;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media screen and (max-width: 640px){
|
|
227
|
+
|
|
228
|
+
.modal {
|
|
229
|
+
width: 100% !important;
|
|
230
|
+
max-height: 90vh;
|
|
231
|
+
@apply self-end;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
</style>
|