@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.
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 +83 -169
  11. package/src/components/Card.vue +257 -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 +12 -5
  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 +528 -403
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +6 -4
  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 +40 -26
  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 +16 -22
  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 +151 -67
  94. package/src/themes/default/index.js +118 -159
  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 +38 -36
  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 +145 -236
  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 +365 -150
  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 +1019 -707
  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
 
@@ -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 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 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
- .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;
184
+ .button-primary *{
185
+ @apply text-white fill-white;
239
186
  }
240
-
241
- .button-secondary-disabled,
242
- .button-secondary-disabled:hover {
243
- @apply bg-secondary-400 border-secondary-400 cursor-not-allowed text-opacity-50;
187
+ .button-primary .svgBg{
188
+ @apply !fill-none;
189
+ stroke: #fff;
190
+ stroke-opacity: 25%;
244
191
  }
245
-
246
- .button-secondary * {
247
- @apply text-text-500 fill-white;
192
+ .button-primary .svgHg {
193
+ fill: #fff;
194
+ fill-opacity: 750%;
248
195
  }
249
196
 
250
- .button-secondary.loading * {
251
- @apply fill-transparent
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
- .button-secondary .svgBg {
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: rgb(var(--text-500));
207
+ fill: #fff;
261
208
  fill-opacity: 75%;
262
209
  }
263
210
 
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;
211
+ .button-outline{
212
+ @apply border-primary bg-transparent text-primary;
213
+ @apply hover:bg-transparent hover:border-primary-600;
275
214
  }
276
-
277
- .button-red * {
278
- @apply text-white fill-white;
215
+ .button-outline>*{
216
+ @apply text-primary fill-primary;
279
217
  }
280
-
281
- .button-red.loading * {
282
- @apply fill-transparent
218
+ .button-outline:disabled>*{
219
+ @apply text-primary-300 fill-primary-300;
283
220
  }
284
-
285
- .button-red .svgBg {
286
- @apply stroke-red-400;
221
+ .button-outline .svgBg{
222
+ stroke: rgb(var(--primary-600));
287
223
  stroke-opacity: 50%;
288
224
  }
289
-
290
- .button-red .svgHg {
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-[2px] border-transparent;
230
+ .button-minimal{
231
+ @apply border-transparent bg-transparent text-text;
232
+ @apply hover:bg-transparent hover:border-transparent;
297
233
  }
298
-
299
- .button-minimal:hover {
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: rgb(var(--text));
239
+ fill: #fff;
309
240
  fill-opacity: 75%;
310
241
  }
311
242
 
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 {
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
- .loading:active {
328
- @apply top-0 left-0;
329
- }
330
-
331
- .loading > * {
332
- opacity: 0;
247
+ .button-red .svgBg{
248
+ stroke: #fff;
249
+ stroke-opacity: 25%;
333
250
  }
334
-
335
- .loading .loadingPane {
336
- opacity: 1;
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>