@mixd-id/web-scaffold 0.2.250801012 → 0.2.250801013

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 (283) hide show
  1. package/package.json +2 -1
  2. package/src/components/AccountIcon.vue +19 -0
  3. package/src/components/Ahref.vue +200 -0
  4. package/src/components/Alert.vue +257 -0
  5. package/src/components/ArrayList.vue +49 -0
  6. package/src/components/Article.vue +387 -0
  7. package/src/components/BarChart.vue +87 -0
  8. package/src/components/Block.vue +31 -0
  9. package/src/components/Box.vue +34 -0
  10. package/src/components/Button.vue +258 -0
  11. package/src/components/Card.vue +253 -0
  12. package/src/components/Carousel.vue +404 -0
  13. package/src/components/Cart.vue +192 -0
  14. package/src/components/CartIcon.vue +89 -0
  15. package/src/components/Chart.vue +485 -0
  16. package/src/components/ChartBar.vue +192 -0
  17. package/src/components/ChatTyping.vue +69 -0
  18. package/src/components/Checkbox.vue +200 -0
  19. package/src/components/CodeEditor.vue +50 -0
  20. package/src/components/CollapsiblePanel.vue +70 -0
  21. package/src/components/ColorPicker.vue +649 -0
  22. package/src/components/Confirm.vue +180 -0
  23. package/src/components/ContextMenu.vue +265 -0
  24. package/src/components/ContextMenuItem.vue +53 -0
  25. package/src/components/CopyToClipboard.vue +34 -0
  26. package/src/components/Countdown.vue +264 -0
  27. package/src/components/Dashboard.vue +870 -0
  28. package/src/components/Datepicker.vue +412 -0
  29. package/src/components/Datetimepicker.vue +355 -0
  30. package/src/components/DayTimeRange.vue +126 -0
  31. package/src/components/DoughnutChart.vue +68 -0
  32. package/src/components/Dropdown.vue +315 -0
  33. package/src/components/ErrorText.vue +57 -0
  34. package/src/components/FBLogin.vue +194 -0
  35. package/src/components/FilterCard.vue +177 -0
  36. package/src/components/Flex.vue +44 -0
  37. package/src/components/GHeatMaps.vue +317 -0
  38. package/src/components/GSignIn.vue +166 -0
  39. package/src/components/Gmaps.vue +251 -0
  40. package/src/components/GmapsDirection.vue +191 -0
  41. package/src/components/Grid.vue +35 -0
  42. package/src/components/HTMLEditor.vue +778 -0
  43. package/src/components/IconMenu.vue +95 -0
  44. package/src/components/IconMenu2.vue +89 -0
  45. package/src/components/IconPlus.vue +89 -0
  46. package/src/components/Image.vue +311 -0
  47. package/src/components/Image360.vue +140 -0
  48. package/src/components/ImageFullScreen.vue +101 -0
  49. package/src/components/ImagePreview.vue +93 -0
  50. package/src/components/ImageUploader.vue +111 -0
  51. package/src/components/ImportModal.vue +260 -0
  52. package/src/components/LineChart.vue +104 -0
  53. package/src/components/Link.vue +95 -0
  54. package/src/components/List.vue +1381 -0
  55. package/src/components/ListContextMenu.vue +88 -0
  56. package/src/components/ListItem.vue +160 -0
  57. package/src/components/LogViewerItem.vue +116 -0
  58. package/src/components/MarkdownEdit.vue +227 -0
  59. package/src/components/MarkdownPreview.vue +102 -0
  60. package/src/components/MenuItem1.vue +36 -0
  61. package/src/components/Metric.vue +105 -0
  62. package/src/components/MultiDropdown.vue +124 -0
  63. package/src/components/MultilineText.vue +174 -0
  64. package/src/components/OTPField.vue +139 -0
  65. package/src/components/PageBuilder.vue +449 -0
  66. package/src/components/Paragraph.vue +40 -0
  67. package/src/components/PieChart.vue +67 -0
  68. package/src/components/PresetSelectorFilterItem.vue +203 -0
  69. package/src/components/Radio.vue +109 -0
  70. package/src/components/SearchModal.vue +153 -0
  71. package/src/components/Slider.vue +407 -0
  72. package/src/components/SplitPane.vue +129 -0
  73. package/src/components/Svg.vue +33 -0
  74. package/src/components/SvgEditor.vue +173 -0
  75. package/src/components/Switch.vue +101 -0
  76. package/src/components/TabView.vue +105 -0
  77. package/src/components/Table.vue +56 -0
  78. package/src/components/TableView.vue +200 -0
  79. package/src/components/TableViewHead.vue +159 -0
  80. package/src/components/Tabs.vue +131 -0
  81. package/src/components/Test.vue +23 -0
  82. package/src/components/Testimonial.vue +86 -0
  83. package/src/components/Text.vue +34 -0
  84. package/src/components/TextBlock.vue +50 -0
  85. package/src/components/TextEditor.vue +85 -0
  86. package/src/components/TextWithTag.vue +298 -0
  87. package/src/components/Textarea.vue +195 -0
  88. package/src/components/Textbox.vue +216 -0
  89. package/src/components/Thumbnail.vue +27 -0
  90. package/src/components/Timepicker.vue +223 -0
  91. package/src/components/Toast.vue +117 -0
  92. package/src/components/Tooltip.vue +143 -0
  93. package/src/components/TreeMenu.vue +122 -0
  94. package/src/components/TreeView.vue +107 -0
  95. package/src/components/TreeViewItem.vue +452 -0
  96. package/src/components/TreeViewItem1.vue +282 -0
  97. package/src/components/Uploader.vue +45 -0
  98. package/src/components/Video.vue +119 -0
  99. package/src/components/VirtualGrid.vue +296 -0
  100. package/src/components/VirtualScroll.vue +282 -0
  101. package/src/components/VirtualTable.vue +956 -0
  102. package/src/components/YoutubeVideo.vue +196 -0
  103. package/src/configs/dashboard/bar.js +10 -0
  104. package/src/configs/dashboard/collection-1.js +5 -0
  105. package/src/configs/dashboard/data-table.js +9 -0
  106. package/src/configs/dashboard/doughnut.js +7 -0
  107. package/src/configs/dashboard/gheatmaps.js +9 -0
  108. package/src/configs/dashboard/grid-2.js +34 -0
  109. package/src/configs/dashboard/grid-3.js +34 -0
  110. package/src/configs/dashboard/grid-4.js +34 -0
  111. package/src/configs/dashboard/grid.js +15 -0
  112. package/src/configs/dashboard/metric.js +10 -0
  113. package/src/configs/dashboard/pie.js +7 -0
  114. package/src/configs/dashboard/polar-area.js +7 -0
  115. package/src/configs/dashboard/virtual-table.js +9 -0
  116. package/src/configs/icons-fa.json +12 -0
  117. package/src/configs/web-page-builder.js +118 -0
  118. package/src/directives/intersect.js +26 -0
  119. package/src/hooks/device.js +14 -0
  120. package/src/index.css +3 -0
  121. package/src/index.js +687 -0
  122. package/src/middleware/http/trim-string.js +20 -0
  123. package/src/mixin/component.js +306 -0
  124. package/src/mixin/ready-state.js +37 -0
  125. package/src/stores/components.js +36 -0
  126. package/src/stores/datasource.js +11 -0
  127. package/src/themes/default/index.js +303 -0
  128. package/src/utils/dashboard.js +304 -0
  129. package/src/utils/event-bus.js +8 -0
  130. package/src/utils/helpers.cjs +635 -0
  131. package/src/utils/helpers.js +635 -0
  132. package/src/utils/helpers.mjs +722 -0
  133. package/src/utils/importer.js +209 -0
  134. package/src/utils/list.mjs +1509 -0
  135. package/src/utils/listview.js +1287 -0
  136. package/src/utils/preset-selector.cjs +1455 -0
  137. package/src/utils/preset-selector.js +1452 -0
  138. package/src/utils/preset-selector.mjs +234 -0
  139. package/src/utils/queue.js +63 -0
  140. package/src/utils/selection.js +43 -0
  141. package/src/utils/web.js +50 -0
  142. package/src/utils/web.mjs +120 -0
  143. package/src/utils/wss.js +313 -0
  144. package/src/utils/wss.mjs +286 -0
  145. package/src/widgets/AhrefSetting.vue +97 -0
  146. package/src/widgets/ArticleSetting.vue +457 -0
  147. package/src/widgets/BackgroundColorSetting.vue +149 -0
  148. package/src/widgets/BackgroundSetting.vue +132 -0
  149. package/src/widgets/BlockSetting.vue +49 -0
  150. package/src/widgets/BorderColorSetting.vue +53 -0
  151. package/src/widgets/BorderSetting.vue +201 -0
  152. package/src/widgets/BotEditor/BotEditorActions.vue +163 -0
  153. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  154. package/src/widgets/BotEditor.vue +248 -0
  155. package/src/widgets/BoxSetting.vue +53 -0
  156. package/src/widgets/ButtonSetting.vue +113 -0
  157. package/src/widgets/CarouselSetting.vue +181 -0
  158. package/src/widgets/CartSetting.vue +46 -0
  159. package/src/widgets/CheckoutSetting.vue +46 -0
  160. package/src/widgets/CollapsiblePanelSetting.vue +46 -0
  161. package/src/widgets/ColumnSelector.vue +104 -0
  162. package/src/widgets/ComponentPropertyLabel.vue +35 -0
  163. package/src/widgets/ComponentPropertySelector.vue +115 -0
  164. package/src/widgets/ComponentSetting.vue +2220 -0
  165. package/src/widgets/ComponentSetting2.vue +927 -0
  166. package/src/widgets/ComponentSetting3.vue +231 -0
  167. package/src/widgets/ContactForm.vue +193 -0
  168. package/src/widgets/ContactFormSetting.vue +395 -0
  169. package/src/widgets/CountdownSetting.vue +76 -0
  170. package/src/widgets/DataListSetting.vue +102 -0
  171. package/src/widgets/EffectSetting.vue +94 -0
  172. package/src/widgets/EmbeddedVideo.vue +60 -0
  173. package/src/widgets/EmbeddedVideoSetting.vue +50 -0
  174. package/src/widgets/FAQ.vue +98 -0
  175. package/src/widgets/FAQSetting.vue +94 -0
  176. package/src/widgets/FeatureList.vue +131 -0
  177. package/src/widgets/FeatureListSetting.vue +233 -0
  178. package/src/widgets/FiltersSetting.vue +88 -0
  179. package/src/widgets/FlexSetting.vue +174 -0
  180. package/src/widgets/GridSetting.vue +165 -0
  181. package/src/widgets/Header.vue +15 -0
  182. package/src/widgets/Header0.vue +41 -0
  183. package/src/widgets/Header0Setting.vue +75 -0
  184. package/src/widgets/Header2.vue +65 -0
  185. package/src/widgets/Header2Setting.vue +193 -0
  186. package/src/widgets/HeaderSetting.vue +102 -0
  187. package/src/widgets/IconList.vue +51 -0
  188. package/src/widgets/IconListSetting.vue +188 -0
  189. package/src/widgets/ImageSetting.vue +119 -0
  190. package/src/widgets/LayoutSetting.vue +251 -0
  191. package/src/widgets/LinkSetting.vue +209 -0
  192. package/src/widgets/LinkSettingModal.vue +173 -0
  193. package/src/widgets/LogViewer.vue +85 -0
  194. package/src/widgets/MarginPaddingSetting.vue +58 -0
  195. package/src/widgets/MarginSetting.vue +142 -0
  196. package/src/widgets/MenuEditor.vue +251 -0
  197. package/src/widgets/MenuItem1Setting.vue +78 -0
  198. package/src/widgets/ModalSetting.vue +94 -0
  199. package/src/widgets/MultiValueSetting.vue +121 -0
  200. package/src/widgets/MultiValueSetting2.vue +147 -0
  201. package/src/widgets/OGSettingModal.vue +103 -0
  202. package/src/widgets/PaddingSetting.vue +142 -0
  203. package/src/widgets/ParagraphSetting.vue +89 -0
  204. package/src/widgets/PositionSetting.vue +209 -0
  205. package/src/widgets/PresetBar.vue +988 -0
  206. package/src/widgets/PresetBarPivot.vue +198 -0
  207. package/src/widgets/PresetBarPivotColumnEdit.vue +197 -0
  208. package/src/widgets/PresetSelector.vue +709 -0
  209. package/src/widgets/Review.vue +131 -0
  210. package/src/widgets/ReviewSetting.vue +201 -0
  211. package/src/widgets/SearchModalSetting.vue +70 -0
  212. package/src/widgets/Share.vue +164 -0
  213. package/src/widgets/ShareSetting.vue +99 -0
  214. package/src/widgets/SizingSetting.vue +306 -0
  215. package/src/widgets/SpacingSetting.vue +77 -0
  216. package/src/widgets/StyleSetting.vue +543 -0
  217. package/src/widgets/StyleSetting2.vue +90 -0
  218. package/src/widgets/SvgSetting.vue +133 -0
  219. package/src/widgets/TableSetting.vue +172 -0
  220. package/src/widgets/TestimonialSetting.vue +161 -0
  221. package/src/widgets/TextBlockSetting.vue +81 -0
  222. package/src/widgets/ThumbnailSetting.vue +49 -0
  223. package/src/widgets/TransitionSetting.vue +64 -0
  224. package/src/widgets/TypographySetting.vue +334 -0
  225. package/src/widgets/UserActionBuilder/UserActionCondition.vue +99 -0
  226. package/src/widgets/UserActionBuilder/UserActionConsole.vue +97 -0
  227. package/src/widgets/UserActionBuilder/UserActionItem.vue +273 -0
  228. package/src/widgets/UserActionBuilder/UserActionOutput.vue +150 -0
  229. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +27 -0
  230. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +28 -0
  231. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +112 -0
  232. package/src/widgets/UserActionBuilder/UserActionProps.vue +213 -0
  233. package/src/widgets/UserActionBuilder.vue +314 -0
  234. package/src/widgets/WebComponentSelector.vue +205 -0
  235. package/src/widgets/WebDatasourceSelector.vue +153 -0
  236. package/src/widgets/WebLayoutSelector.vue +139 -0
  237. package/src/widgets/WebPageBuilder.vue +2161 -0
  238. package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +54 -0
  239. package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +75 -0
  240. package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +72 -0
  241. package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +72 -0
  242. package/src/widgets/WebPageBuilder4/BlurSetting.vue +72 -0
  243. package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +54 -0
  244. package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +75 -0
  245. package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +69 -0
  246. package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +72 -0
  247. package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +73 -0
  248. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +65 -0
  249. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +178 -0
  250. package/src/widgets/WebPageBuilder4/DisplaySetting.vue +76 -0
  251. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +71 -0
  252. package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +70 -0
  253. package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +74 -0
  254. package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +71 -0
  255. package/src/widgets/WebPageBuilder4/FlexSetting.vue +96 -0
  256. package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +69 -0
  257. package/src/widgets/WebPageBuilder4/GapSetting.vue +75 -0
  258. package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +68 -0
  259. package/src/widgets/WebPageBuilder4/GridSetting.vue +216 -0
  260. package/src/widgets/WebPageBuilder4/HeightSetting.vue +98 -0
  261. package/src/widgets/WebPageBuilder4/ImageSetting.vue +102 -0
  262. package/src/widgets/WebPageBuilder4/MarginSetting.vue +73 -0
  263. package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +82 -0
  264. package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +90 -0
  265. package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +81 -0
  266. package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +101 -0
  267. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +163 -0
  268. package/src/widgets/WebPageBuilder4/OpacitySetting.vue +77 -0
  269. package/src/widgets/WebPageBuilder4/OverflowSetting.vue +81 -0
  270. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +57 -0
  271. package/src/widgets/WebPageBuilder4/PositionSetting.vue +191 -0
  272. package/src/widgets/WebPageBuilder4/PropertySetting.vue +176 -0
  273. package/src/widgets/WebPageBuilder4/TextSetting.vue +72 -0
  274. package/src/widgets/WebPageBuilder4/TreeView.vue +46 -0
  275. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +303 -0
  276. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +141 -0
  277. package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +168 -0
  278. package/src/widgets/WebPageBuilder4/WidthSetting.vue +105 -0
  279. package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +72 -0
  280. package/src/widgets/WebPagePreview.vue +295 -0
  281. package/src/widgets/WebPageSelector.vue +173 -0
  282. package/src/widgets/WebTemplateCreator.vue +156 -0
  283. package/src/widgets/YoutubeVideoSetting.vue +68 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.2.250801012",
4
+ "version": "0.2.250801013",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -154,6 +154,7 @@
154
154
  "author": "mixd.id",
155
155
  "license": "ISC",
156
156
  "files": [
157
+ "src",
157
158
  "docs/components"
158
159
  ],
159
160
  "bugs": {
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <button type="button">
3
+
4
+ </button>
5
+ </template>
6
+
7
+ <script setup>
8
+
9
+
10
+
11
+ </script>
12
+
13
+ <style module>
14
+
15
+ .comp{
16
+
17
+ }
18
+
19
+ </style>
@@ -0,0 +1,200 @@
1
+ <template>
2
+ <a v-if="isExternalLink" :href="href" :target="target" :class="compClass" :style="computedStyle">
3
+ <slot>{{ text }}</slot>
4
+ </a>
5
+ <router-link v-else :to="href" :target="target" :class="compClass">
6
+ <slot>{{ text }}</slot>
7
+ </router-link>
8
+ </template>
9
+
10
+ <script>
11
+
12
+ import {componentMixin} from "../mixin/component";
13
+
14
+ export default {
15
+
16
+ mixins: [ componentMixin ],
17
+
18
+ props: {
19
+
20
+ href: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+
25
+ target: String,
26
+
27
+ text: String,
28
+
29
+ variant: {
30
+ type: [ String, Number ],
31
+ default: "primary" // primary|secondary|outline, default:primary
32
+ },
33
+
34
+ },
35
+
36
+ computed: {
37
+
38
+ isExternalLink() {
39
+ return typeof this.href === 'string' && this.href.indexOf('://') > 0
40
+ },
41
+
42
+ compClass(){
43
+ return [
44
+ this.$style.button,
45
+ this.$style['button-' + this.variant]
46
+ ]
47
+ .filter(_ => _)
48
+ .join(' ')
49
+ },
50
+
51
+ },
52
+ }
53
+ </script>
54
+
55
+ <style module>
56
+
57
+ .button{
58
+ @apply p-2;
59
+ @apply relative flex items-center justify-center;
60
+ @apply whitespace-nowrap text-ellipsis overflow-hidden;
61
+ @apply rounded-lg;
62
+ }
63
+ .button>*:first-child{
64
+ @apply flex items-center justify-center
65
+ }
66
+ .button:disabled{
67
+ @apply opacity-60;
68
+ }
69
+ .button:active{
70
+ @apply top-[1px] left-[1px] relative;
71
+ }
72
+
73
+ .button-primary{
74
+ @apply bg-primary-500 text-white rounded-lg;
75
+ box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
76
+ outline: solid 1px rgb(var(--primary-700));
77
+ border: solid 1px rgb(var(--primary-400));
78
+ }
79
+ .button-primary:focus{
80
+ outline-color: rgb(var(--primary-800));
81
+ border-color: rgb(var(--primary-600));
82
+ }
83
+ .button-primary:hover{
84
+ @apply bg-primary-600;
85
+ outline-color: rgb(var(--primary-800))
86
+ }
87
+ .button-primary:disabled{
88
+ @apply bg-primary-500 opacity-50 top-0 left-0 cursor-not-allowed;
89
+ @apply top-0 left-0;
90
+ outline: solid 1px rgb(var(--primary-700));
91
+ }
92
+ .button-primary *{
93
+ @apply text-white fill-white;
94
+ }
95
+ .button-primary.loading *{
96
+ @apply fill-transparent
97
+ }
98
+ .button-primary .svgBg{
99
+ stroke: #fff;
100
+ stroke-opacity: 25%;
101
+ }
102
+ .button-primary .svgHg{
103
+ fill: #fff;
104
+ fill-opacity: 75%;
105
+ }
106
+
107
+ .button-outline{
108
+ @apply bg-transparent text-primary-500;
109
+ outline: solid 1px rgb(var(--primary-700));
110
+ }
111
+ .button-outline:hover{
112
+ outline-color: rgb(var(--primary-800))
113
+ }
114
+ .button-outline:disabled{
115
+ @apply opacity-50 top-0 left-0 cursor-not-allowed;
116
+ @apply text-text border-primary-500;
117
+ }
118
+ .button-outline *{
119
+ @apply text-primary-500 fill-primary-500;
120
+ }
121
+ .button-outline.loading *{
122
+ @apply fill-transparent
123
+ }
124
+ .button-outline .svgBg{
125
+ stroke: rgb(var(--primary-600));
126
+ stroke-opacity: 50%;
127
+ }
128
+ .button-outline .svgHg{
129
+ fill: rgb(var(--primary));
130
+ fill-opacity: 100%;
131
+ }
132
+
133
+ .button-secondary{
134
+ @apply bg-secondary text-text-500 rounded-lg;
135
+ box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
136
+ outline: solid 1px rgb(var(--secondary-700));
137
+ border: solid 1px rgb(var(--secondary-400));
138
+ }
139
+ .button-secondary:hover{
140
+ @apply bg-secondary-600;
141
+ outline-color: rgb(var(--secondary-800))
142
+ }
143
+ .button-secondary:disabled{
144
+ @apply bg-secondary-500 opacity-50 top-0 left-0 cursor-not-allowed;
145
+ outline: solid 1px rgb(var(--secondary-700));
146
+ }
147
+ .button-secondary *{
148
+ @apply text-text-500 fill-white;
149
+ }
150
+ .button-secondary.loading *{
151
+ @apply fill-transparent
152
+ }
153
+ .button-secondary .svgBg{
154
+ stroke: rgb(var(--text-400));
155
+ stroke-opacity: 25%;
156
+ }
157
+ .button-secondary .svgHg{
158
+ fill: rgb(var(--text-500));
159
+ fill-opacity: 75%;
160
+ }
161
+
162
+ .button-red{
163
+ @apply bg-red-500 text-white rounded-md border-[2px] border-red-500;
164
+ }
165
+ .button-red:hover{
166
+ @apply bg-red-600 border-red-600;
167
+ }
168
+ .button-red:disabled{
169
+ @apply bg-red-500 border-red-500 opacity-50 top-0 left-0 cursor-not-allowed;
170
+ }
171
+ .button-red *{
172
+ @apply text-white fill-white;
173
+ }
174
+ .button-red.loading *{
175
+ @apply fill-transparent
176
+ }
177
+ .button-red .svgBg{
178
+ @apply stroke-red-400;
179
+ stroke-opacity: 50%;
180
+ }
181
+ .button-red .svgHg{
182
+ @apply fill-text-500;
183
+ fill-opacity: 100%;
184
+ }
185
+
186
+ .button-minimal{
187
+ @apply border-[2px] border-transparent;
188
+ }
189
+ .button-minimal:hover{
190
+ }
191
+ .button-minimal .svgBg{
192
+ stroke: rgb(var(--text-500));
193
+ stroke-opacity: 25%;
194
+ }
195
+ .button-minimal .svgHg{
196
+ fill: rgb(var(--text));
197
+ fill-opacity: 75%;
198
+ }
199
+
200
+ </style>
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <Teleport to=".YWxl">
3
+ <Transition name="alert-outer">
4
+ <div v-if="isOpen" :class="$style.alert" ref="alert">
5
+ <Transition name="alert" @after-appear="onAfterAppear" appear>
6
+ <div :class="$style.cont1">
7
+
8
+ <div :class="$style.cont2">
9
+ <slot v-if="$slots['icon']" name="icon"></slot>
10
+ <svg width="100" height="100" class="fill-red-500" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
11
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 13.75C12.4142 13.75 12.75 13.4142 12.75 13V8.00001C12.75 7.5858 12.4142 7.25001 12 7.25001C11.5858 7.25001 11.25 7.5858 11.25 8.00001V13C11.25 13.4142 11.5858 13.75 12 13.75Z"/>
12
+ <path d="M13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16Z"/>
13
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"/>
14
+ </svg>
15
+ <h5 :class="$style.title">{{ title }}</h5>
16
+ </div>
17
+
18
+ <div :class="$style.details">
19
+ <p class="text-center break-words whitespace-pre-line" v-if="message">{{ message }}</p>
20
+ <p class="text-center break-words max-w-[420px] whitespace-pre-line" v-if="stack">{{ stack }}</p>
21
+ </div>
22
+
23
+ <div :class="$style.details" v-if="details">
24
+ <div v-if="!showDetails" class="text-center">
25
+ <button type="button" class="text-primary" @click="showDetails = true">Open Details</button>
26
+ </div>
27
+ <div v-else class="flex flex-col gap-4">
28
+ <div v-for="(v, k) in details">
29
+ <small class="font-bold">{{ k }}</small>
30
+ <div class="block break-all text-sm">{{ v }}</div>
31
+ </div>
32
+
33
+ <div class="self-stretch text-center">
34
+ <button type="button" class="text-primary text-sm" @click="copy">Copy Details</button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
39
+ <div>
40
+ <br />
41
+ <Button ref="btnOK" @click="onConfirm">
42
+ <strong class="px-4">
43
+ {{ buttonText }}
44
+ </strong>
45
+ </Button>
46
+ </div>
47
+ </div>
48
+ </Transition>
49
+ </div>
50
+ </Transition>
51
+ </Teleport>
52
+ </template>
53
+
54
+ <script>
55
+
56
+ import {copyToClipboard, unPascalCase} from "../utils/helpers.mjs";
57
+
58
+ export default{
59
+
60
+ methods: {
61
+
62
+ /**
63
+ * @param {object} obj - The alert object
64
+ * @param {string} [obj.title] - The title of the alert
65
+ * @param {string} obj.message - The message of the alert
66
+ * @param {string} [obj.buttonText] - The text of the button
67
+ * @param {function} [obj.onConfirm] - The callback function when the alert button is clicked
68
+ */
69
+ open(obj){
70
+ this.alert = obj
71
+ this.isOpen = true
72
+ this.showDetails = false
73
+ },
74
+
75
+ close(){
76
+ this.isOpen = false
77
+ },
78
+
79
+ copy(){
80
+ const text = []
81
+ for(let key in this.details){
82
+ text.push(`${key}\n${this.details[key]}\n\n`)
83
+ }
84
+ copyToClipboard(text.join("\n"))
85
+ },
86
+
87
+ onAfterAppear(){
88
+ this.$refs.btnOK.focus()
89
+ this.$emit('appear')
90
+ },
91
+
92
+ onConfirm(){
93
+ if(typeof this.alert.onConfirm === 'function'){
94
+ this.alert.onConfirm()
95
+ }
96
+ this.close()
97
+ }
98
+
99
+ },
100
+
101
+ computed: {
102
+
103
+ buttonText(){
104
+ return this.alert.buttonText ?? this.$t('OK')
105
+ },
106
+
107
+ err(){
108
+ return this.alert.reason && this.alert.reason.response ? this.alert.reason.response.data :
109
+ (this.alert.response && this.alert.response.data ? this.alert.response.data : this.alert)
110
+ },
111
+
112
+ title(){
113
+
114
+ if(this.err.title){
115
+ return this.err.title
116
+ }
117
+ else if(this.err.name){
118
+ return unPascalCase(this.err.name)
119
+ }
120
+ else if(this.err.type){
121
+ return unPascalCase(this.err.type)
122
+ }
123
+ else if(this.err.status){
124
+ return `Error ${this.err.status}`
125
+ }
126
+ else{
127
+ return this.$t('Alert')
128
+ }
129
+ },
130
+
131
+ message(){
132
+ if(this.err.errors){
133
+ return typeof this.err.errors === 'object' &&
134
+ Object.keys(this.err.errors).length > 0 ?
135
+ Object.values(this.err.errors).map(_ => {
136
+ if(Array.isArray(_))
137
+ return _
138
+ return JSON.stringify(_)
139
+ })
140
+ .join("\n"):
141
+ this.err.errors
142
+ }
143
+ else if(this.err.reason){
144
+ if(this.err.reason.stack){
145
+ return this.err.reason.stack
146
+ }
147
+ else{
148
+ return this.err.reason
149
+ }
150
+ }
151
+ else if(this.err.message){
152
+ return this.err.message
153
+ }
154
+ else{
155
+ return ''
156
+ }
157
+ },
158
+
159
+ stack(){
160
+ if(this.err.stack){
161
+ return this.err.stack
162
+ }
163
+ },
164
+
165
+ details(){
166
+
167
+ if(this.alert.details && typeof this.alert.details === 'object'){
168
+ const details = {}
169
+ for(let key in this.alert.details){
170
+ if([ 'name', 'title', 'message' ].includes(key)) continue
171
+
172
+ details[key] = typeof this.alert.details[key] === 'object' ?
173
+ JSON.stringify(this.alert.details[key]) :
174
+ this.alert.details[key]
175
+ }
176
+ return Object.keys(details).length > 0 ? details : null
177
+ }
178
+
179
+ }
180
+
181
+ },
182
+
183
+ data(){
184
+ return {
185
+ alert: {},
186
+ isOpen: false,
187
+ showDetails: false
188
+ }
189
+ }
190
+
191
+ }
192
+
193
+ </script>
194
+
195
+ <style module>
196
+
197
+ .alert{
198
+ @apply fixed top-0 left-0 flex w-screen h-screen;
199
+ @apply items-center justify-center bg-white/50 backdrop-blur-md;
200
+ z-index: 150;
201
+ }
202
+ [data-theme="dark"] .alert{
203
+ @apply bg-black/50;
204
+ }
205
+
206
+ .alert>*{
207
+ @apply max-h-[60vh] overflow-y-auto bg-base-400 dark:bg-base-300 rounded-xl;
208
+ @apply border-[1px] border-border-50;
209
+ @apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
210
+ }
211
+
212
+ .cont1{
213
+ @apply flex flex-col items-center p-6 gap-1;
214
+ }
215
+
216
+ .cont2{
217
+ @apply flex flex-col items-center;
218
+ }
219
+
220
+ .title{
221
+ @apply text-center;
222
+ }
223
+
224
+ .details{
225
+ @apply flex-1 flex flex-col gap-4 overflow-auto min-h-[1.6rem] self-stretch;
226
+ }
227
+ .details::-webkit-scrollbar {
228
+ display: none;
229
+ }
230
+
231
+ </style>
232
+
233
+ <style>
234
+
235
+ .alert-outer-enter-active,
236
+ .alert-outer-leave-active {
237
+ transition: opacity 100ms cubic-bezier(0.25, 1, 0.5, 1);
238
+ }
239
+
240
+ .alert-outer-enter-from,
241
+ .alert-outer-leave-to {
242
+ opacity: 0;
243
+ }
244
+
245
+ .alert-enter-active,
246
+ .alert-leave-active {
247
+ transition: all 300ms cubic-bezier(0.25, 1, 0.5, 1);
248
+ transform: translate3d(0, 0, 0);
249
+ }
250
+
251
+ .alert-enter-from,
252
+ .alert-leave-to {
253
+ transform: translate3d(0, 20px, 0);
254
+ opacity: 0;
255
+ }
256
+
257
+ </style>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <div class="flex-1 flex flex-row flex-wrap gap-1">
4
+ <div v-for="item in items">
5
+ <slot name="default" :item="item">
6
+ <div :class="$style.item">
7
+ {{ item.name }}
8
+
9
+ <button type="button" @click="$emit('remove', item)">
10
+ <svg width="11" height="11" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>
11
+ </button>
12
+ </div>
13
+ </slot>
14
+ </div>
15
+ </div>
16
+ <button type="button" class="p-2" @click="$emit('add')">
17
+ <svg width="14" height="14" class="fill-text-300 hover:fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M64 192C28.61 192 0 220.6 0 256s28.61 64 64 64s64-28.62 64-64S99.39 192 64 192zM256 192C220.6 192 192 220.6 192 256s28.61 64 64 64s64-28.62 64-64S291.4 192 256 192zM448 192c-35.39 0-64 28.62-64 64s28.61 64 64 64s64-28.62 64-64S483.4 192 448 192z"/></svg>
18
+ </button>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+
24
+ export default{
25
+
26
+ emits: [ 'add', 'remove' ],
27
+
28
+ props: {
29
+ items: Array
30
+ }
31
+
32
+ }
33
+
34
+ </script>
35
+
36
+ <style module>
37
+
38
+ .comp{
39
+ @apply min-w-[200px] p-1;
40
+ @apply border-[1px] border-border-200 bg-base-300 hover:border-border-300 rounded-lg;
41
+ @apply flex flex-row items-start flex-nowrap;
42
+ }
43
+
44
+ .item{
45
+ @apply border-[1px] border-border-200 hover:border-border-300 rounded-lg p-1 px-2;
46
+ @apply flex flex-row items-center gap-2;
47
+ }
48
+
49
+ </style>