@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.
Files changed (220) hide show
  1. package/docs/components/Dashboard.md +56 -0
  2. package/log.txt +7 -0
  3. package/package.json +27 -19
  4. package/src/components/404.vue +61 -0
  5. package/src/components/AccountIcon.vue +19 -0
  6. package/src/components/Ahref.vue +1 -1
  7. package/src/components/Alert.vue +4 -13
  8. package/src/components/ArrayList.vue +49 -0
  9. package/src/components/Article.vue +24 -30
  10. package/src/components/Button.vue +79 -167
  11. package/src/components/Card.vue +235 -0
  12. package/src/components/Carousel.vue +61 -60
  13. package/src/components/Cart.vue +192 -0
  14. package/src/components/CartIcon.vue +89 -0
  15. package/src/components/ChartBar.vue +2 -3
  16. package/src/components/Checkbox.vue +20 -11
  17. package/src/components/Checkout.vue +373 -0
  18. package/src/components/CheckoutDelivery.vue +267 -0
  19. package/src/components/CodeEditor.vue +5 -16
  20. package/src/components/CollapsiblePanel.vue +70 -0
  21. package/src/components/ColorPicker.vue +8 -3
  22. package/src/components/ColorPicker2.vue +41 -19
  23. package/src/components/ColorPicker3.vue +100 -0
  24. package/src/components/Confirm.vue +9 -7
  25. package/src/components/ContextMenu.vue +122 -206
  26. package/src/components/ContextMenuItem.vue +53 -0
  27. package/src/components/Dashboard.vue +243 -0
  28. package/src/components/Dashboard2.vue +118 -0
  29. package/src/components/DashboardComponentSelector.vue +96 -0
  30. package/src/components/DashboardConfigs.vue +202 -0
  31. package/src/components/Datepicker.vue +102 -41
  32. package/src/components/DayTimeRange.vue +3 -2
  33. package/src/components/Dropdown.vue +7 -4
  34. package/src/components/Flex.vue +14 -40
  35. package/src/components/GHeatMaps.vue +2 -2
  36. package/src/components/Grid.vue +6 -6
  37. package/src/components/HTMLEditor.vue +27 -14
  38. package/src/components/Image.vue +62 -108
  39. package/src/components/ImagePreview.vue +14 -4
  40. package/src/components/ImageUploader.vue +114 -0
  41. package/src/components/ImportModal.vue +3 -3
  42. package/src/components/Link.vue +62 -6
  43. package/src/components/List.vue +524 -403
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +5 -3
  46. package/src/components/ListPage1.vue +14 -15
  47. package/src/components/ListView.vue +5 -6
  48. package/src/components/ListViewSettings.vue +2 -2
  49. package/src/components/LogViewerItem.vue +1 -1
  50. package/src/components/MarkdownEdit.vue +128 -0
  51. package/src/components/MarkdownPreview.vue +102 -0
  52. package/src/components/MenuItem1.vue +36 -0
  53. package/src/components/Modal.vue +95 -43
  54. package/src/components/MultiDropdown.vue +124 -0
  55. package/src/components/MultilineText.vue +1 -4
  56. package/src/components/OTPField.vue +11 -17
  57. package/src/components/ObjectTree.vue +1 -1
  58. package/src/components/PageBuilder.vue +3 -3
  59. package/src/components/Paragraph.vue +1 -2
  60. package/src/components/PresetSelectorFilterItem.vue +107 -95
  61. package/src/components/Radio.vue +1 -1
  62. package/src/components/SearchModal.vue +153 -0
  63. package/src/components/Slider.vue +1 -1
  64. package/src/components/Svg.vue +1 -1
  65. package/src/components/SvgEditor.vue +173 -0
  66. package/src/components/Switch.vue +4 -5
  67. package/src/components/Table.vue +2 -2
  68. package/src/components/TableView.vue +2 -3
  69. package/src/components/TableViewHead.vue +2 -2
  70. package/src/components/Tabs.vue +1 -1
  71. package/src/components/Testimonial.vue +2 -2
  72. package/src/components/Text.vue +7 -22
  73. package/src/components/TextEditor.vue +3 -3
  74. package/src/components/TextWithTag.vue +61 -30
  75. package/src/components/Textarea.vue +11 -16
  76. package/src/components/Textbox.vue +9 -19
  77. package/src/components/Timepicker.vue +25 -15
  78. package/src/components/Toast.vue +5 -3
  79. package/src/components/TreeMenu.vue +122 -0
  80. package/src/components/TreeView.vue +15 -10
  81. package/src/components/TreeView2.vue +38 -0
  82. package/src/components/TreeViewItem.vue +58 -29
  83. package/src/components/TreeViewItem2.vue +55 -0
  84. package/src/components/Uploader.vue +45 -0
  85. package/src/components/Video.vue +119 -0
  86. package/src/components/VirtualGrid.vue +24 -7
  87. package/src/components/VirtualTable.vue +363 -128
  88. package/src/configs/dashboard/data-table.js +9 -0
  89. package/src/configs/web-page-builder.js +118 -0
  90. package/src/directives/intersect.js +26 -0
  91. package/src/hooks/device.js +14 -0
  92. package/src/index.js +62 -107
  93. package/src/mixin/component.js +147 -67
  94. package/src/themes/default/index.js +83 -155
  95. package/src/utils/dashboard.js +22 -962
  96. package/src/utils/helpers.cjs +635 -0
  97. package/src/utils/helpers.js +91 -60
  98. package/src/utils/helpers.mjs +245 -12
  99. package/src/utils/importer.js +22 -3
  100. package/src/utils/list.mjs +1509 -0
  101. package/src/utils/preset-selector.cjs +1455 -0
  102. package/src/utils/preset-selector.js +489 -95
  103. package/src/utils/preset-selector.mjs +59 -20
  104. package/src/utils/queue.js +63 -0
  105. package/src/utils/web.mjs +120 -0
  106. package/src/utils/wss.js +37 -29
  107. package/src/utils/wss.mjs +24 -19
  108. package/src/widgets/AhrefSetting.vue +16 -13
  109. package/src/widgets/ArticleSetting.vue +15 -27
  110. package/src/widgets/BackgroundColorSetting.vue +153 -0
  111. package/src/widgets/BorderColorSetting.vue +57 -0
  112. package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
  113. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  114. package/src/widgets/BotEditor.vue +35 -15
  115. package/src/widgets/ButtonSetting.vue +12 -13
  116. package/src/widgets/CarouselSetting.vue +33 -45
  117. package/src/widgets/CartSetting.vue +46 -0
  118. package/src/widgets/CheckoutSetting.vue +46 -0
  119. package/src/widgets/CollapsiblePanelSetting.vue +46 -0
  120. package/src/widgets/ColumnSelector.vue +29 -5
  121. package/src/widgets/ComponentSetting.vue +1 -1
  122. package/src/widgets/ComponentSetting2.vue +112 -234
  123. package/src/widgets/ComponentSetting3.vue +1 -1
  124. package/src/widgets/ContactForm.vue +3 -3
  125. package/src/widgets/ContactFormSetting.vue +41 -30
  126. package/src/widgets/Dashboard/BarChart.vue +47 -11
  127. package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
  128. package/src/widgets/Dashboard/DataTable.vue +125 -0
  129. package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
  130. package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
  131. package/src/widgets/Dashboard/Doughnut.vue +49 -7
  132. package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
  133. package/src/widgets/Dashboard/Metric.vue +78 -19
  134. package/src/widgets/Dashboard/MetricSetting.vue +81 -28
  135. package/src/widgets/Dashboard/Pie.vue +55 -6
  136. package/src/widgets/Dashboard/PieSetting.vue +1 -1
  137. package/src/widgets/Dashboard/PolarArea.vue +49 -7
  138. package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
  139. package/src/widgets/Dashboard/SharingModal.vue +4 -5
  140. package/src/widgets/Dashboard/ViewSelector.vue +2 -2
  141. package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
  142. package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
  143. package/src/widgets/EmbeddedVideoSetting.vue +7 -5
  144. package/src/widgets/FAQ.vue +16 -3
  145. package/src/widgets/FAQSetting.vue +53 -47
  146. package/src/widgets/FeatureList.vue +3 -0
  147. package/src/widgets/FeatureListSetting.vue +112 -102
  148. package/src/widgets/FlexSetting.vue +83 -106
  149. package/src/widgets/GridSetting.vue +71 -196
  150. package/src/widgets/Header2.vue +34 -71
  151. package/src/widgets/Header2Setting.vue +95 -179
  152. package/src/widgets/HeaderSetting.vue +16 -18
  153. package/src/widgets/IconListSetting.vue +69 -65
  154. package/src/widgets/ImageSetting.vue +33 -60
  155. package/src/widgets/LinkSetting.vue +60 -37
  156. package/src/widgets/LinkSettingModal.vue +173 -0
  157. package/src/widgets/LogViewer.vue +1 -1
  158. package/src/widgets/MarginSetting.vue +2 -2
  159. package/src/widgets/MenuEditor.vue +1 -1
  160. package/src/widgets/MenuItem1Setting.vue +78 -0
  161. package/src/widgets/ModalSetting.vue +42 -44
  162. package/src/widgets/MultiValueSetting.vue +2 -2
  163. package/src/widgets/MultiValueSetting2.vue +78 -45
  164. package/src/widgets/OGSettingModal.vue +103 -0
  165. package/src/widgets/PaddingSetting.vue +2 -2
  166. package/src/widgets/ParagraphSetting.vue +16 -13
  167. package/src/widgets/PositionSetting.vue +209 -0
  168. package/src/widgets/PresetBar.vue +359 -210
  169. package/src/widgets/PresetBarPivot.vue +31 -19
  170. package/src/widgets/PresetSelector.vue +29 -17
  171. package/src/widgets/SearchModalSetting.vue +70 -0
  172. package/src/widgets/Share.vue +1 -2
  173. package/src/widgets/ShareSetting.vue +67 -60
  174. package/src/widgets/StyleSetting.vue +227 -116
  175. package/src/widgets/TestimonialSetting.vue +97 -88
  176. package/src/widgets/TextBlockSetting.vue +16 -13
  177. package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
  178. package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
  179. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
  180. package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
  181. package/src/widgets/UserActionBuilder.vue +4 -16
  182. package/src/widgets/WebComponentSelector.vue +15 -11
  183. package/src/widgets/WebLayoutSelector.vue +41 -270
  184. package/src/widgets/WebPageBuilder.vue +693 -704
  185. package/src/widgets/WebPageBuilder2.vue +7 -7
  186. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
  187. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
  188. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
  189. package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
  190. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
  191. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
  192. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
  193. package/src/widgets/WebPageBuilder4.vue +289 -575
  194. package/src/widgets/WebPageSelector.vue +1 -1
  195. package/src/widgets/YoutubeVideoSetting.vue +16 -13
  196. package/tailwind.config.js +3 -35
  197. package/docs/schema/user-action.json +0 -266
  198. package/src/App.vue +0 -25
  199. package/src/components/SearchButton.vue +0 -57
  200. package/src/entry-client.js +0 -27
  201. package/src/entry-server.js +0 -73
  202. package/src/events/event.js +0 -2
  203. package/src/main.js +0 -29
  204. package/src/mixin/website.js +0 -121
  205. package/src/router.js +0 -57
  206. package/src/widgets/MobileMenu.vue +0 -182
  207. package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
  208. package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
  209. package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
  210. package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
  211. package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
  212. package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
  213. package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
  214. package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
  215. package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
  216. package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
  217. package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
  218. package/test.json +0 -22
  219. /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
  220. /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
- <div v-if="isLoading" :class="$style.loadingPane">
6
- <svg :class="$style.spinner" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
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
- </div>
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.isDisabled ? this.$style['button-' + this.variant + '-disabled'] : '',
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, percentage) {
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 relative flex items-center justify-center;
154
- @apply whitespace-nowrap text-ellipsis overflow-hidden;
155
- @apply rounded-lg appearance-none;
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
- .button > *:first-child {
159
- @apply flex items-center justify-center
146
+ .button:disabled svg{
147
+ @apply opacity-50;
160
148
  }
161
-
162
- .button-disabled {
163
- @apply text-opacity-50;
149
+ .button:disabled>*{
150
+ @apply opacity-50;
164
151
  }
165
-
166
- .button:active {
167
- @apply top-[1px] left-[1px] relative;
152
+ .button-loading{
153
+ @apply !text-opacity-0;
168
154
  }
169
-
170
- .button-primary {
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
- .button-primary-disabled,
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
- .button-primary * {
184
- @apply text-white fill-white;
161
+ .button>label{
162
+ @apply pointer-events-none;
185
163
  }
186
-
187
- .button-primary.loading * {
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
- .button-primary .svgBg {
192
- stroke: #fff;
193
- stroke-opacity: 25%;
167
+ .button-loading .spinner{
168
+ @apply !opacity-100;
194
169
  }
195
-
196
- .button-primary .svgHg {
197
- fill: #fff;
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
- .button-outline {
202
- @apply bg-transparent text-primary-500 border-[1px] border-primary;
174
+ .svgBg{
175
+ @apply !opacity-100;
176
+ @apply stroke-text-50 fill-transparent;
203
177
  }
204
178
 
205
- .button-outline:hover {
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
- .button-outline-disabled,
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
- .button-secondary-disabled,
242
- .button-secondary-disabled:hover {
243
- @apply bg-secondary-400 border-secondary-400 cursor-not-allowed text-opacity-50;
186
+ .button-primary .svgBg{
187
+ @apply !fill-none;
188
+ stroke: #fff;
189
+ stroke-opacity: 25%;
244
190
  }
245
-
246
- .button-secondary * {
247
- @apply text-text-500 fill-white;
191
+ .button-primary .svgHg {
192
+ fill: #fff;
193
+ fill-opacity: 750%;
248
194
  }
249
195
 
250
- .button-secondary.loading * {
251
- @apply fill-transparent
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
- .button-secondary .svgBg {
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: rgb(var(--text-500));
205
+ fill: #fff;
261
206
  fill-opacity: 75%;
262
207
  }
263
208
 
264
- .button-red {
265
- @apply bg-red-500 text-white rounded-md border-[2px] border-red-500;
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
- .button-red * {
278
- @apply text-white fill-white;
213
+ .button-outline>*{
214
+ @apply text-primary fill-primary;
279
215
  }
280
-
281
- .button-red.loading * {
282
- @apply fill-transparent
216
+ .button-outline:disabled>*{
217
+ @apply text-primary-300 fill-primary-300;
283
218
  }
284
-
285
- .button-red .svgBg {
286
- @apply stroke-red-400;
219
+ .button-outline .svgBg{
220
+ stroke: rgb(var(--primary-600));
287
221
  stroke-opacity: 50%;
288
222
  }
289
-
290
- .button-red .svgHg {
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-[2px] border-transparent;
228
+ .button-minimal{
229
+ @apply border-transparent bg-transparent text-text;
230
+ @apply hover:bg-transparent hover:border-transparent;
297
231
  }
298
-
299
- .button-minimal:hover {
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: rgb(var(--text));
237
+ fill: #fff;
309
238
  fill-opacity: 75%;
310
239
  }
311
240
 
312
- .loadingPane {
313
- @apply absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center pl-1;
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
- .loading:active {
328
- @apply top-0 left-0;
329
- }
330
-
331
- .loading > * {
332
- opacity: 0;
245
+ .button-red .svgBg{
246
+ stroke: #fff;
247
+ stroke-opacity: 25%;
333
248
  }
334
-
335
- .loading .loadingPane {
336
- opacity: 1;
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>