@mixd-id/web-scaffold 0.1.2301231369 → 0.1.2304063756

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 (299) hide show
  1. package/LICENSE +1 -0
  2. package/docs/components/Header2.md +16 -0
  3. package/docs/components/TreeView.md +0 -0
  4. package/package.json +38 -6
  5. package/public/assets/dashboard/bar.png +0 -0
  6. package/public/assets/dashboard/doughnut.png +0 -0
  7. package/public/assets/dashboard/metric.png +0 -0
  8. package/public/assets/dashboard/pie.png +0 -0
  9. package/public/assets/dashboard/polar-area.png +0 -0
  10. package/public/assets/dashboard/virtual-table.png +0 -0
  11. package/public/static/dashboard/bar.png +0 -0
  12. package/public/static/dashboard/doughnut.png +0 -0
  13. package/public/static/dashboard/metric.png +0 -0
  14. package/public/static/dashboard/pie.png +0 -0
  15. package/public/static/dashboard/polar-area.png +0 -0
  16. package/public/static/dashboard/virtual-table.png +0 -0
  17. package/src/App.vue +9 -1
  18. package/src/components/Ahref.vue +175 -9
  19. package/src/components/Alert.vue +172 -75
  20. package/src/components/Article.vue +393 -0
  21. package/src/components/Block.vue +31 -0
  22. package/src/components/Box.vue +34 -0
  23. package/src/components/Button.vue +261 -170
  24. package/src/components/Carousel.vue +171 -120
  25. package/src/components/Chart.vue +485 -0
  26. package/src/components/ChartBar.vue +193 -0
  27. package/src/components/Checkbox.vue +94 -55
  28. package/src/components/CodeEditor.vue +61 -0
  29. package/src/components/ColorPicker.vue +158 -0
  30. package/src/components/ColorPicker2.vue +164 -0
  31. package/src/components/Confirm.vue +178 -0
  32. package/src/components/ContextMenu.vue +158 -76
  33. package/src/components/ConversationBuilder.vue +161 -0
  34. package/src/components/CopyToClipboard.vue +6 -31
  35. package/src/components/Countdown.vue +104 -53
  36. package/src/components/DGrid.vue +21 -0
  37. package/src/components/DGridItem.vue +263 -0
  38. package/src/components/DataList.vue +92 -0
  39. package/src/components/Datepicker.vue +90 -50
  40. package/src/components/DayTimeRange.vue +125 -0
  41. package/src/components/Dropdown.vue +32 -9
  42. package/src/components/ErrorText.vue +30 -9
  43. package/src/components/FBLogin.vue +194 -0
  44. package/src/components/Flex.vue +42 -0
  45. package/src/components/GHeatMaps.vue +317 -0
  46. package/src/components/GSignIn.vue +166 -0
  47. package/src/components/Gmaps.vue +35 -11
  48. package/src/components/GmapsDirection.vue +191 -0
  49. package/src/components/Grid.vue +25 -19
  50. package/src/components/HTMLEditor.vue +258 -79
  51. package/src/components/IconMenu.vue +95 -0
  52. package/src/components/IconMenu2.vue +89 -0
  53. package/src/components/IconPlus.vue +89 -0
  54. package/src/components/Image.vue +164 -60
  55. package/src/components/Image360.vue +2 -2
  56. package/src/components/ImagePreview.vue +23 -11
  57. package/src/components/ImportModal.vue +27 -14
  58. package/src/components/Link.vue +95 -0
  59. package/src/components/List.vue +1246 -0
  60. package/src/components/ListItem.vue +32 -21
  61. package/src/components/ListPage1.vue +88 -17
  62. package/src/components/ListPage1Filter.vue +2 -2
  63. package/src/components/ListView.vue +962 -0
  64. package/src/components/ListViewBarSummary.vue +81 -0
  65. package/src/components/ListViewLineSummary.vue +75 -0
  66. package/src/components/ListViewLiveBarSummary.vue +52 -0
  67. package/src/components/ListViewMapSummary.vue +56 -0
  68. package/src/components/ListViewSettings.vue +514 -0
  69. package/src/components/ListViewTableSummary.vue +77 -0
  70. package/src/components/LogViewerItem.vue +116 -0
  71. package/src/components/Modal.vue +273 -122
  72. package/src/components/MultilineText.vue +177 -0
  73. package/src/components/OTPField.vue +5 -6
  74. package/src/components/ObjectTree.vue +105 -0
  75. package/src/components/PageBuilder.vue +449 -0
  76. package/src/components/Paragraph.vue +41 -0
  77. package/src/components/PresetSelectorFilterItem.vue +192 -0
  78. package/src/components/Radio.vue +62 -87
  79. package/src/components/SearchButton.vue +1 -1
  80. package/src/components/Slider.vue +107 -75
  81. package/src/components/Svg.vue +33 -0
  82. package/src/components/Switch.vue +18 -5
  83. package/src/components/TabView.vue +0 -1
  84. package/src/components/Table.vue +56 -0
  85. package/src/components/TableViewHead.vue +2 -2
  86. package/src/components/Tabs.vue +69 -12
  87. package/src/components/Test.vue +23 -0
  88. package/src/components/Testimonial.vue +86 -0
  89. package/src/components/Text.vue +34 -0
  90. package/src/components/TextBlock.vue +50 -0
  91. package/src/components/TextWithTag.vue +280 -0
  92. package/src/components/Textarea.vue +22 -16
  93. package/src/components/Textbox.vue +83 -62
  94. package/src/components/Thumbnail.vue +27 -0
  95. package/src/components/Timepicker.vue +15 -8
  96. package/src/components/Toast.vue +63 -39
  97. package/src/components/TreeView.vue +101 -0
  98. package/src/components/TreeViewItem.vue +424 -0
  99. package/src/components/TreeViewItem1.vue +282 -0
  100. package/src/components/Video.vue +119 -0
  101. package/src/components/VirtualGrid.vue +297 -0
  102. package/src/components/VirtualScroll.vue +88 -21
  103. package/src/components/VirtualTable.vue +318 -77
  104. package/src/components/YoutubeVideo.vue +196 -0
  105. package/src/configs/dashboard/bar.js +10 -0
  106. package/src/configs/dashboard/collection-1.js +5 -0
  107. package/src/configs/dashboard/data-table.js +9 -0
  108. package/src/configs/dashboard/doughnut.js +7 -0
  109. package/src/configs/dashboard/gheatmaps.js +9 -0
  110. package/src/configs/dashboard/grid-2.js +34 -0
  111. package/src/configs/dashboard/grid-3.js +34 -0
  112. package/src/configs/dashboard/grid-4.js +34 -0
  113. package/src/configs/dashboard/grid.js +15 -0
  114. package/src/configs/dashboard/metric.js +10 -0
  115. package/src/configs/dashboard/pie.js +7 -0
  116. package/src/configs/dashboard/polar-area.js +7 -0
  117. package/src/configs/dashboard/virtual-table.js +9 -0
  118. package/src/configs/icons-fa.json +12 -0
  119. package/src/defs/dashboard-preset.js +22 -0
  120. package/src/index.js +487 -53
  121. package/src/main.js +0 -9
  122. package/src/middleware/http/trim-string.js +20 -0
  123. package/src/mixin/component.js +211 -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 +177 -34
  128. package/src/utils/dashboard.js +140 -0
  129. package/src/utils/event-bus.js +8 -0
  130. package/src/utils/helpers.js +421 -11
  131. package/src/utils/helpers.mjs +338 -16
  132. package/src/utils/importer.js +60 -26
  133. package/src/utils/listpage1.js +403 -267
  134. package/src/utils/listview.js +1287 -0
  135. package/src/utils/preset-selector.js +1419 -0
  136. package/src/utils/preset-selector.mjs +213 -0
  137. package/src/utils/selection.js +15 -36
  138. package/src/utils/web.js +50 -0
  139. package/src/utils/wss.js +311 -0
  140. package/src/utils/wss.mjs +280 -0
  141. package/src/widgets/AhrefSetting.vue +94 -0
  142. package/src/widgets/ArticleSetting.vue +469 -0
  143. package/src/widgets/BackgroundSetting.vue +132 -0
  144. package/src/widgets/BlockSetting.vue +49 -0
  145. package/src/widgets/BorderSetting.vue +201 -0
  146. package/src/widgets/BotEditor/BotEditorActions.vue +163 -0
  147. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  148. package/src/widgets/BotEditor.vue +248 -0
  149. package/src/widgets/BoxSetting.vue +53 -0
  150. package/src/widgets/ButtonSetting.vue +114 -0
  151. package/src/widgets/CarouselSetting.vue +193 -0
  152. package/src/widgets/ColumnSelector.vue +80 -0
  153. package/src/widgets/ComponentPropertyLabel.vue +35 -0
  154. package/src/widgets/ComponentPropertySelector.vue +115 -0
  155. package/src/widgets/ComponentSetting.vue +2220 -0
  156. package/src/widgets/ComponentSetting2.vue +1020 -0
  157. package/src/widgets/ComponentSetting3.vue +231 -0
  158. package/src/widgets/ContactForm.vue +193 -0
  159. package/src/widgets/ContactFormSetting.vue +384 -0
  160. package/src/widgets/CountdownSetting.vue +76 -0
  161. package/src/widgets/Dashboard/BarChart.vue +366 -0
  162. package/src/widgets/Dashboard/BarChartSetting.vue +317 -0
  163. package/src/widgets/Dashboard/DataTable.vue +125 -0
  164. package/src/widgets/Dashboard/DataTableSetting.vue +247 -0
  165. package/src/widgets/Dashboard/DatasourceFilterSharing.vue +93 -0
  166. package/src/widgets/Dashboard/DatasourcePreview.vue +93 -0
  167. package/src/widgets/Dashboard/DatasourceSelector.vue +122 -0
  168. package/src/widgets/Dashboard/Doughnut.vue +199 -0
  169. package/src/widgets/Dashboard/DoughnutSetting.vue +196 -0
  170. package/src/widgets/Dashboard/GHeatMapsSetting.vue +108 -0
  171. package/src/widgets/Dashboard/InteractionEdit.vue +228 -0
  172. package/src/widgets/Dashboard/Metric.vue +161 -0
  173. package/src/widgets/Dashboard/MetricSetting.vue +227 -0
  174. package/src/widgets/Dashboard/Pie.vue +188 -0
  175. package/src/widgets/Dashboard/PieSetting.vue +247 -0
  176. package/src/widgets/Dashboard/PolarArea.vue +201 -0
  177. package/src/widgets/Dashboard/PolarAreaSetting.vue +195 -0
  178. package/src/widgets/Dashboard/SharingModal.vue +115 -0
  179. package/src/widgets/Dashboard/ViewSelector.vue +183 -0
  180. package/src/widgets/Dashboard/VirtualColumnEdit.vue +97 -0
  181. package/src/widgets/Dashboard/VirtualTableSetting.vue +234 -0
  182. package/src/widgets/Dashboard.vue +1794 -0
  183. package/src/widgets/DataListSetting.vue +102 -0
  184. package/src/widgets/EffectSetting.vue +94 -0
  185. package/src/widgets/EmbeddedVideo.vue +60 -0
  186. package/src/widgets/EmbeddedVideoSetting.vue +48 -0
  187. package/src/widgets/FAQ.vue +85 -0
  188. package/src/widgets/FAQSetting.vue +88 -0
  189. package/src/widgets/FeatureList.vue +128 -0
  190. package/src/widgets/FeatureListSetting.vue +223 -0
  191. package/src/widgets/FiltersSetting.vue +88 -0
  192. package/src/widgets/FlexSetting.vue +197 -0
  193. package/src/widgets/GridSetting.vue +290 -0
  194. package/src/widgets/Header.vue +15 -0
  195. package/src/widgets/Header1.vue +41 -0
  196. package/src/widgets/Header1Setting.vue +75 -0
  197. package/src/widgets/Header2.vue +102 -0
  198. package/src/widgets/Header2Setting.vue +277 -0
  199. package/src/widgets/HeaderSetting.vue +104 -0
  200. package/src/widgets/IconList.vue +51 -0
  201. package/src/widgets/IconListSetting.vue +184 -0
  202. package/src/widgets/ImageSetting.vue +146 -0
  203. package/src/widgets/LayoutSetting.vue +251 -0
  204. package/src/widgets/LinkSetting.vue +186 -0
  205. package/src/widgets/LogViewer.vue +85 -0
  206. package/src/widgets/MarginPaddingSetting.vue +58 -0
  207. package/src/widgets/MarginSetting.vue +142 -0
  208. package/src/widgets/MenuEditor.vue +256 -0
  209. package/src/widgets/ModalSetting.vue +96 -0
  210. package/src/widgets/MultiValueSetting.vue +121 -0
  211. package/src/widgets/MultiValueSetting2.vue +114 -0
  212. package/src/widgets/PaddingSetting.vue +142 -0
  213. package/src/widgets/ParagraphSetting.vue +86 -0
  214. package/src/widgets/PresetBar.vue +748 -0
  215. package/src/widgets/PresetBarPivot.vue +186 -0
  216. package/src/widgets/PresetBarPivotColumnEdit.vue +197 -0
  217. package/src/widgets/PresetSelector.vue +673 -0
  218. package/src/widgets/Review.vue +131 -0
  219. package/src/widgets/ReviewSetting.vue +201 -0
  220. package/src/widgets/Share.vue +165 -0
  221. package/src/widgets/ShareSetting.vue +92 -0
  222. package/src/widgets/SizingSetting.vue +306 -0
  223. package/src/widgets/SpacingSetting.vue +77 -0
  224. package/src/widgets/StyleSetting.vue +328 -0
  225. package/src/widgets/StyleSetting2.vue +90 -0
  226. package/src/widgets/SvgSetting.vue +133 -0
  227. package/src/widgets/TableSetting.vue +172 -0
  228. package/src/widgets/TestimonialSetting.vue +152 -0
  229. package/src/widgets/TextBlockSetting.vue +78 -0
  230. package/src/widgets/ThumbnailSetting.vue +49 -0
  231. package/src/widgets/TransitionSetting.vue +64 -0
  232. package/src/widgets/TypographySetting.vue +334 -0
  233. package/src/widgets/UserActionBuilder/UserActionCondition.vue +99 -0
  234. package/src/widgets/UserActionBuilder/UserActionConsole.vue +97 -0
  235. package/src/widgets/UserActionBuilder/UserActionItem.vue +273 -0
  236. package/src/widgets/UserActionBuilder/UserActionOutput.vue +152 -0
  237. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +27 -0
  238. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +28 -0
  239. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +112 -0
  240. package/src/widgets/UserActionBuilder/UserActionProps.vue +213 -0
  241. package/src/widgets/UserActionBuilder.vue +314 -0
  242. package/src/widgets/WebComponentSelector.vue +201 -0
  243. package/src/widgets/WebDatasourceSelector.vue +153 -0
  244. package/src/widgets/WebLayoutSelector.vue +376 -0
  245. package/src/widgets/WebPageBuilder.vue +1849 -0
  246. package/src/widgets/WebPageBuilder2.vue +1091 -0
  247. package/src/widgets/WebPageBuilder3.vue +411 -0
  248. package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +54 -0
  249. package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +75 -0
  250. package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +72 -0
  251. package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +72 -0
  252. package/src/widgets/WebPageBuilder4/BlurSetting.vue +72 -0
  253. package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +64 -0
  254. package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +75 -0
  255. package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +69 -0
  256. package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +72 -0
  257. package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +73 -0
  258. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +65 -0
  259. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +178 -0
  260. package/src/widgets/WebPageBuilder4/DisplaySetting.vue +76 -0
  261. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +71 -0
  262. package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +70 -0
  263. package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +74 -0
  264. package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +71 -0
  265. package/src/widgets/WebPageBuilder4/FlexSetting.vue +96 -0
  266. package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +69 -0
  267. package/src/widgets/WebPageBuilder4/GapSetting.vue +75 -0
  268. package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +68 -0
  269. package/src/widgets/WebPageBuilder4/GridSetting.vue +216 -0
  270. package/src/widgets/WebPageBuilder4/HeightSetting.vue +98 -0
  271. package/src/widgets/WebPageBuilder4/ImageSetting.vue +102 -0
  272. package/src/widgets/WebPageBuilder4/MarginSetting.vue +73 -0
  273. package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +82 -0
  274. package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +90 -0
  275. package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +81 -0
  276. package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +101 -0
  277. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +163 -0
  278. package/src/widgets/WebPageBuilder4/OpacitySetting.vue +77 -0
  279. package/src/widgets/WebPageBuilder4/OverflowSetting.vue +81 -0
  280. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +57 -0
  281. package/src/widgets/WebPageBuilder4/PositionSetting.vue +191 -0
  282. package/src/widgets/WebPageBuilder4/PropertySetting.vue +176 -0
  283. package/src/widgets/WebPageBuilder4/TextSetting.vue +72 -0
  284. package/src/widgets/WebPageBuilder4/TreeView.vue +46 -0
  285. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +303 -0
  286. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +141 -0
  287. package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +172 -0
  288. package/src/widgets/WebPageBuilder4/WidthSetting.vue +105 -0
  289. package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +72 -0
  290. package/src/widgets/WebPageBuilder4.vue +798 -0
  291. package/src/widgets/WebPagePreview.vue +295 -0
  292. package/src/widgets/WebPageSelector.vue +173 -0
  293. package/src/widgets/WebTemplateCreator.vue +156 -0
  294. package/src/widgets/YoutubeVideoSetting.vue +65 -0
  295. package/tailwind.config.js +513 -0
  296. package/public/images/mixd-logo2.png +0 -0
  297. package/src/components/ButtonGroup.vue +0 -101
  298. package/src/components/DynamicTemplate.vue +0 -44
  299. package/src/components/GridColumn.vue +0 -31
package/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  MIT License
2
3
 
3
4
  Copyright (c) 2022 mixd-id
@@ -0,0 +1,16 @@
1
+ # Header 2
2
+
3
+ ### Properties
4
+ | Name | Type | Default | Description |
5
+ |--------------------------|--------|---------|----------------------------|
6
+ | `logo` | Array | [] | Responsive Array of Object |
7
+ | `logo[].url` | String | | Logo url |
8
+ | `icons` | Array | {} | Responsive Array of Object |
9
+ | `icons[].items` | Array | {} | Array of Object |
10
+ | `icons[].items[].icon` | String | | (required) icon value |
11
+ | `icons[].items[].target` | String | | (required) target value |
12
+ | `icons[].items[].text` | String | route | route, search |
13
+ | `menu[].items[].icon` | String | | svg, image |
14
+ | `menu[].items[].text` | String | | |
15
+ | `menu[].items[].target` | String | | |
16
+ | `menu[].items[].items` | Array | | |
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.2301231369",
4
+ "version": "0.1.2304063756",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -11,12 +11,38 @@
11
11
  "exports": {
12
12
  ".": "./src/index.js",
13
13
  "./themes/default": "./src/themes/default/index.js",
14
+ "./components/*": "./src/components/*",
15
+ "./widgets/*": "./src/widgets/*",
16
+ "./mixin/component": "./src/mixin/component.js",
17
+ "./mixin/edit-mode": "./src/mixin/edit-mode.js",
18
+ "./middleware/http/trim-string": "./src/middleware/http/trim-string.js",
14
19
  "./helpers": {
15
20
  "require": "./src/utils/helpers.js",
16
21
  "import": "./src/utils/helpers.mjs"
17
22
  },
23
+ "./helpers.js": "./src/utils/helpers.js",
24
+ "./helpers.mjs": "./src/utils/helpers.mjs",
25
+
26
+ "./wss": {
27
+ "require": "./src/utils/wss.js",
28
+ "import": "./src/utils/wss.mjs"
29
+ },
30
+ "./wss.js": "./src/utils/wss.js",
31
+ "./wss.mjs": "./src/utils/wss.mjs",
32
+
18
33
  "./importer": "./src/utils/importer.js",
19
- "./listpage1": "./src/utils/listpage1.js"
34
+ "./listpage1": "./src/utils/listpage1.js",
35
+ "./dashboard": "./src/utils/dashboard.js",
36
+ "./listview": "./src/utils/listview.js",
37
+
38
+ "./preset-selector": {
39
+ "require": "./src/utils/preset-selector.js",
40
+ "import": "./src/utils/preset-selector.mjs"
41
+ },
42
+ "./preset-selector.js": "./src/utils/preset-selector.js",
43
+ "./preset-selector.mjs": "./src/utils/preset-selector.mjs",
44
+
45
+ "./web": "./src/utils/web.js"
20
46
  },
21
47
  "dependencies": {
22
48
  "@faker-js/faker": "^7.3.0",
@@ -24,27 +50,33 @@
24
50
  "@tailwindcss/line-clamp": "^0.4.0",
25
51
  "@vueuse/core": "^9.0.2",
26
52
  "adm-zip": "^0.5.10",
27
- "axios": "^1.3.4",
53
+ "axios": "^1.7.9",
54
+ "bcrypt": "^5.1.1",
28
55
  "chart.js": "^4.2.1",
29
56
  "compression": "^1.7.4",
30
57
  "cookie-parser": "^1.4.6",
31
58
  "cors": "^2.8.5",
32
- "daisyui": "^2.19.0",
59
+ "crypto-js": "^4.2.0",
33
60
  "dayjs": "^1.11.2",
61
+ "eventemitter2": "^6.4.7",
34
62
  "exceljs": "^4.3.0",
35
63
  "express": "^4.18.1",
36
64
  "file-type": "^18.2.1",
37
65
  "glob": "^8.0.3",
38
66
  "lodash": "^4.17.21",
39
67
  "md5": "^2.3.0",
68
+ "mitt": "^3.0.1",
40
69
  "nprogress": "^0.2.0",
41
- "pinia": "^2.0.14",
70
+ "pinia": "^2.3.0",
42
71
  "prismjs": "^1.28.0",
72
+ "redis": "^4.6.13",
73
+ "sequelize": "^6.37.5",
43
74
  "serve-static": "^1.15.0",
44
75
  "tailwindcss": "^3.2.4",
45
76
  "vue": "^3.2.25",
46
77
  "vue-chartjs": "^5.2.0",
47
- "vue-router": "^4.0.14"
78
+ "vue-router": "^4.0.14",
79
+ "ws": "^8.16.0"
48
80
  },
49
81
  "devDependencies": {
50
82
  "@vitejs/plugin-vue": "^2.2.0",
Binary file
Binary file
Binary file
Binary file
package/src/App.vue CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  <script>
6
6
 
7
+ export default {
8
+ name: 'App',
9
+
10
+ setup(){
11
+
12
+ }
13
+ }
14
+
7
15
  </script>
8
16
 
9
17
  <style>
@@ -14,4 +22,4 @@
14
22
  <style module>
15
23
 
16
24
 
17
- </style>
25
+ </style>
@@ -1,34 +1,200 @@
1
1
  <template>
2
- <a v-if="isExternalLink" :href="href" :target="target">
3
- <slot />
2
+ <a v-if="isExternalLink" :href="href" :target="target" :class="compClass" :style="computedStyle">
3
+ <slot>{{ text }}</slot>
4
4
  </a>
5
- <router-link v-else :to="href" :target="target">
6
- <slot />
5
+ <router-link v-else :to="href" :target="target" :class="compClass">
6
+ <slot>{{ text }}</slot>
7
7
  </router-link>
8
8
  </template>
9
9
 
10
10
  <script>
11
11
 
12
+ import {componentMixin} from "../mixin/component";
13
+
12
14
  export default {
13
15
 
16
+ mixins: [ componentMixin ],
17
+
14
18
  props: {
15
19
 
16
- href: String,
20
+ href: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+
25
+ target: String,
17
26
 
18
- target: String
27
+ text: String,
28
+
29
+ variant: {
30
+ type: [ String, Number ],
31
+ default: "primary" // primary|secondary|outline, default:primary
32
+ },
19
33
 
20
34
  },
21
35
 
22
36
  computed: {
23
37
 
24
38
  isExternalLink() {
25
- return typeof this.href === 'string' && (this.href.startsWith('http') || this.href.startsWith('tel:'))
26
- }
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
+
27
51
  },
28
52
  }
29
53
  </script>
30
54
 
31
55
  <style module>
32
56
 
57
+ .button{
58
+ @apply p-2 h-[var(--h-cp)];
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
+ }
33
199
 
34
- </style>
200
+ </style>
@@ -1,43 +1,48 @@
1
1
  <template>
2
2
  <Teleport to=".YWxl">
3
3
  <Transition name="alert-outer">
4
- <div v-if="!!state" :class="$style.alert" ref="alert">
4
+ <div v-if="isOpen" :class="$style.alert" ref="alert">
5
5
  <Transition name="alert" @after-appear="onAfterAppear" appear>
6
- <div class="p-4 flex flex-col items-center leading-6">
7
-
8
- <slot v-if="$slots['icon']" name="icon"></slot>
9
- <svg v-else-if="mode === 'alert'" width="100" height="100" class="fill-red-500" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
10
- <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"/>
11
- <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"/>
12
- <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"/>
13
- </svg>
14
- <svg v-else-if="mode === 'confirm'" width="100" height="100" class="fill-text-300" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
15
- <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"/>
16
- <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"/>
17
- <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"/>
18
- </svg>
19
-
20
- <div class="my-4 text-center flex-1 overflow-y-auto">
21
- <h5 class="my-1 break-all">{{ title }}</h5>
22
- <p class="break-all overflow-y-auto whitespace-pre-line text-left">{{ description }}</p>
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>
23
16
  </div>
24
-
25
- <div class="mt-4" v-if="mode === 'alert'">
26
- <Button @click="$emit('dismiss')" class="min-w-[88px]">
27
- <strong class="px-4">
28
- {{ text }}
29
- </strong>
30
- </Button>
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>
31
37
  </div>
32
- <div class="mt-4 flex flex-row gap-2" v-else-if="mode === 'confirm'">
33
- <Button @click="$emit('confirm')" class="min-w-[88px]">
38
+
39
+ <div>
40
+ <br />
41
+ <Button ref="btnOK" @click="onConfirm">
34
42
  <strong class="px-4">
35
- {{ text }}
43
+ {{ buttonText }}
36
44
  </strong>
37
45
  </Button>
38
- <Button variant="minimal" @click="$emit('dismiss')" class="min-w-[88px] px-4 hover:text-primary">
39
- Cancel
40
- </Button>
41
46
  </div>
42
47
  </div>
43
48
  </Transition>
@@ -48,69 +53,139 @@
48
53
 
49
54
  <script>
50
55
 
56
+ import {copyToClipboard, unPascalCase} from "../utils/helpers.mjs";
57
+
51
58
  export default{
52
59
 
53
- props: {
54
- state: Object,
55
- mode: {
56
- type: String,
57
- default: 'alert' // alert | confirm
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
58
77
  },
59
- text: {
60
- type: String,
61
- default: 'OK'
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()
62
97
  }
98
+
63
99
  },
64
100
 
65
101
  computed: {
66
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
+
67
112
  title(){
68
- let title
69
113
 
70
- if(this.state && this.state.title){
71
- if(typeof this.state.title === 'object' && this.state.title.type === 'ValidationError'){
72
- title = 'Validation error'
73
- }
74
- else{
75
- title = this.state.title
76
- }
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}`
77
125
  }
126
+ else{
127
+ return this.$t('Alert')
128
+ }
129
+ },
78
130
 
79
- return title
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
+ }
80
157
  },
81
158
 
82
- description(){
83
- let description
159
+ stack(){
160
+ if(this.err.stack){
161
+ return this.err.stack
162
+ }
163
+ },
84
164
 
85
- if(this.state){
165
+ details(){
86
166
 
87
- if(typeof this.state.title === 'object' && this.state.title.type === 'ValidationError'){
88
- description = {}
89
- for(let key in this.state.title.errors){
90
- this.state.title.errors[key].forEach((text) => {
91
- description[text] = 1
92
- })
93
- }
94
- description = Object.keys(description).join("\n")
95
- }
96
- else{
97
- description = this.state.description
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]
98
175
  }
176
+ return Object.keys(details).length > 0 ? details : null
99
177
  }
100
178
 
101
- return description
102
179
  }
103
180
 
104
181
  },
105
182
 
106
- emits: [ 'appear', 'confirm', 'dismiss' ],
107
-
108
- methods: {
109
-
110
- onAfterAppear(){
111
- this.$emit('appear')
183
+ data(){
184
+ return {
185
+ alert: {},
186
+ isOpen: false,
187
+ showDetails: false
112
188
  }
113
-
114
189
  }
115
190
 
116
191
  }
@@ -120,15 +195,37 @@ export default{
120
195
  <style module>
121
196
 
122
197
  .alert{
123
- @apply fixed top-0 left-0 flex w-screen h-screen px-8;
124
- @apply items-center justify-center bg-black/70 backdrop-blur-md;
198
+ @apply fixed top-0 left-0 flex w-screen h-screen;
199
+ @apply items-center justify-center bg-white/50 backdrop-blur-md;
125
200
  z-index: 60;
126
201
  }
202
+ [data-theme="dark"] .alert{
203
+ @apply bg-black/50;
204
+ }
127
205
 
128
206
  .alert>*{
129
- @apply max-h-[50vh] overflow-y-auto bg-base-500 rounded-xl;
207
+ @apply max-h-[60vh] overflow-y-auto bg-base-500 rounded-xl;
130
208
  @apply border-[1px] border-text-50;
131
- @apply min-w-[280px] max-w-[80vw] md:max-w-[400px];
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;
132
229
  }
133
230
 
134
231
  </style>
@@ -157,4 +254,4 @@ export default{
157
254
  opacity: 0;
158
255
  }
159
256
 
160
- </style>
257
+ </style>