@mixd-id/web-scaffold 0.2.250801010 → 0.2.250801012

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 (398) hide show
  1. package/docs/components/AccountIcon.md +16 -0
  2. package/docs/components/Ahref.md +35 -0
  3. package/docs/components/Alert.md +72 -0
  4. package/docs/components/ArrayList.md +39 -0
  5. package/docs/components/Article.md +28 -0
  6. package/docs/components/BarChart.md +81 -0
  7. package/docs/components/Block.md +23 -0
  8. package/docs/components/Box.md +15 -0
  9. package/docs/components/Button.md +68 -0
  10. package/docs/components/Card.md +67 -0
  11. package/docs/components/Carousel.md +70 -0
  12. package/docs/components/Cart.md +20 -0
  13. package/docs/components/CartIcon.md +29 -0
  14. package/docs/components/Chart.md +53 -0
  15. package/docs/components/ChartBar.md +34 -0
  16. package/docs/components/ChatTyping.md +21 -0
  17. package/docs/components/Checkbox.md +63 -0
  18. package/docs/components/CodeEditor.md +25 -0
  19. package/docs/components/CollapsiblePanel.md +41 -0
  20. package/docs/components/ColorPicker.md +52 -0
  21. package/docs/components/Confirm.md +62 -0
  22. package/docs/components/ContextMenu.md +76 -0
  23. package/docs/components/ContextMenuItem.md +29 -0
  24. package/docs/components/CopyToClipboard.md +43 -0
  25. package/docs/components/Countdown.md +47 -0
  26. package/docs/components/Datepicker.md +61 -0
  27. package/docs/components/Datetimepicker.md +57 -0
  28. package/docs/components/DayTimeRange.md +20 -0
  29. package/docs/components/Dropdown.md +65 -0
  30. package/docs/components/ErrorText.md +15 -0
  31. package/docs/components/FBLogin.md +21 -0
  32. package/docs/components/Flex.md +44 -0
  33. package/docs/components/GHeatMaps.md +16 -0
  34. package/docs/components/GSignIn.md +21 -0
  35. package/docs/components/Gmaps.md +16 -0
  36. package/docs/components/GmapsDirection.md +20 -0
  37. package/docs/components/Grid.md +36 -0
  38. package/docs/components/HTMLEditor.md +26 -0
  39. package/docs/components/IconMenu.md +20 -0
  40. package/docs/components/Image.md +78 -0
  41. package/docs/components/Link.md +33 -0
  42. package/docs/components/MultiDropdown.md +46 -0
  43. package/docs/components/Radio.md +55 -0
  44. package/docs/components/Slider.md +47 -0
  45. package/docs/components/Switch.md +43 -0
  46. package/docs/components/Table.md +31 -0
  47. package/docs/components/Tabs.md +65 -0
  48. package/docs/components/Text.md +30 -0
  49. package/docs/components/Textarea.md +66 -0
  50. package/docs/components/Textbox.md +97 -0
  51. package/docs/components/Timepicker.md +62 -0
  52. package/docs/components/Toast.md +59 -0
  53. package/docs/components/Uploader.md +51 -0
  54. package/docs/components/Video.md +54 -0
  55. package/package.json +65 -2
  56. package/docs/components/Dashboard.md +0 -56
  57. package/docs/components/Header2.md +0 -16
  58. package/log.txt +0 -7
  59. package/public/assets/dashboard/bar.png +0 -0
  60. package/public/assets/dashboard/doughnut.png +0 -0
  61. package/public/assets/dashboard/metric.png +0 -0
  62. package/public/assets/dashboard/pie.png +0 -0
  63. package/public/assets/dashboard/polar-area.png +0 -0
  64. package/public/assets/dashboard/virtual-table.png +0 -0
  65. package/public/static/dashboard/bar.png +0 -0
  66. package/public/static/dashboard/doughnut.png +0 -0
  67. package/public/static/dashboard/metric.png +0 -0
  68. package/public/static/dashboard/pie.png +0 -0
  69. package/public/static/dashboard/polar-area.png +0 -0
  70. package/public/static/dashboard/virtual-table.png +0 -0
  71. package/src/components/404.vue +0 -61
  72. package/src/components/AccountIcon.vue +0 -19
  73. package/src/components/Ahref.vue +0 -200
  74. package/src/components/Alert.vue +0 -257
  75. package/src/components/ArrayList.vue +0 -49
  76. package/src/components/Article.vue +0 -387
  77. package/src/components/Block.vue +0 -31
  78. package/src/components/Box.vue +0 -34
  79. package/src/components/Button.vue +0 -258
  80. package/src/components/Card.vue +0 -257
  81. package/src/components/Carousel.vue +0 -364
  82. package/src/components/Cart.vue +0 -192
  83. package/src/components/CartIcon.vue +0 -89
  84. package/src/components/Chart.vue +0 -485
  85. package/src/components/ChartBar.vue +0 -192
  86. package/src/components/ChatTyping.vue +0 -69
  87. package/src/components/Checkbox.vue +0 -200
  88. package/src/components/Checkout.vue +0 -373
  89. package/src/components/CheckoutDelivery.vue +0 -267
  90. package/src/components/CodeEditor.vue +0 -50
  91. package/src/components/CollapsiblePanel.vue +0 -70
  92. package/src/components/ColorPicker.vue +0 -165
  93. package/src/components/ColorPicker2.vue +0 -186
  94. package/src/components/ColorPicker3.vue +0 -100
  95. package/src/components/Confirm.vue +0 -180
  96. package/src/components/ContextMenu.vue +0 -265
  97. package/src/components/ContextMenuItem.vue +0 -53
  98. package/src/components/ConversationBuilder.vue +0 -161
  99. package/src/components/CopyToClipboard.vue +0 -34
  100. package/src/components/Countdown.vue +0 -264
  101. package/src/components/DGrid.vue +0 -21
  102. package/src/components/DGridItem.vue +0 -263
  103. package/src/components/Dashboard.vue +0 -243
  104. package/src/components/Dashboard2.vue +0 -118
  105. package/src/components/DashboardComponentSelector.vue +0 -96
  106. package/src/components/DashboardConfigs.vue +0 -202
  107. package/src/components/DataList.vue +0 -92
  108. package/src/components/Datepicker.vue +0 -399
  109. package/src/components/DayTimeRange.vue +0 -126
  110. package/src/components/Dropdown.vue +0 -224
  111. package/src/components/ErrorText.vue +0 -57
  112. package/src/components/FBLogin.vue +0 -194
  113. package/src/components/Feed.vue +0 -118
  114. package/src/components/Flex.vue +0 -44
  115. package/src/components/GHeatMaps.vue +0 -317
  116. package/src/components/GSignIn.vue +0 -166
  117. package/src/components/Gmaps.vue +0 -251
  118. package/src/components/GmapsDirection.vue +0 -191
  119. package/src/components/Grid.vue +0 -35
  120. package/src/components/HTMLEditor.vue +0 -588
  121. package/src/components/IconMenu.vue +0 -95
  122. package/src/components/IconMenu2.vue +0 -89
  123. package/src/components/IconPlus.vue +0 -89
  124. package/src/components/Image.vue +0 -263
  125. package/src/components/Image360.vue +0 -140
  126. package/src/components/ImageFullScreen.vue +0 -101
  127. package/src/components/ImagePreview.vue +0 -93
  128. package/src/components/ImageUploader.vue +0 -114
  129. package/src/components/ImportModal.vue +0 -260
  130. package/src/components/Link.vue +0 -95
  131. package/src/components/List.vue +0 -1381
  132. package/src/components/ListContextMenu.vue +0 -88
  133. package/src/components/ListItem.vue +0 -160
  134. package/src/components/ListPage1.vue +0 -1401
  135. package/src/components/ListPage1Filter.vue +0 -170
  136. package/src/components/ListView.vue +0 -961
  137. package/src/components/ListViewBarSummary.vue +0 -81
  138. package/src/components/ListViewLineSummary.vue +0 -75
  139. package/src/components/ListViewLiveBarSummary.vue +0 -52
  140. package/src/components/ListViewMapSummary.vue +0 -56
  141. package/src/components/ListViewSettings.vue +0 -514
  142. package/src/components/ListViewTableSummary.vue +0 -77
  143. package/src/components/LogViewerItem.vue +0 -116
  144. package/src/components/MarkdownEdit.vue +0 -128
  145. package/src/components/MarkdownPreview.vue +0 -102
  146. package/src/components/MenuItem1.vue +0 -36
  147. package/src/components/Modal.vue +0 -456
  148. package/src/components/MultiDropdown.vue +0 -124
  149. package/src/components/MultilineText.vue +0 -174
  150. package/src/components/OTPField.vue +0 -139
  151. package/src/components/ObjectTree.vue +0 -105
  152. package/src/components/PageBuilder.vue +0 -449
  153. package/src/components/Paragraph.vue +0 -40
  154. package/src/components/PresetSelectorFilterItem.vue +0 -203
  155. package/src/components/Radio.vue +0 -109
  156. package/src/components/SearchModal.vue +0 -153
  157. package/src/components/Slider.vue +0 -317
  158. package/src/components/SplitPane.vue +0 -129
  159. package/src/components/Svg.vue +0 -33
  160. package/src/components/SvgEditor.vue +0 -173
  161. package/src/components/Switch.vue +0 -101
  162. package/src/components/TabView.vue +0 -105
  163. package/src/components/Table.vue +0 -56
  164. package/src/components/TableView.vue +0 -200
  165. package/src/components/TableViewHead.vue +0 -159
  166. package/src/components/Tabs.vue +0 -131
  167. package/src/components/Test.vue +0 -23
  168. package/src/components/Testimonial.vue +0 -86
  169. package/src/components/Text.vue +0 -34
  170. package/src/components/TextBlock.vue +0 -50
  171. package/src/components/TextEditor.vue +0 -85
  172. package/src/components/TextWithTag.vue +0 -298
  173. package/src/components/Textarea.vue +0 -184
  174. package/src/components/Textbox.vue +0 -216
  175. package/src/components/Thumbnail.vue +0 -27
  176. package/src/components/Timepicker.vue +0 -125
  177. package/src/components/Toast.vue +0 -117
  178. package/src/components/TreeMenu.vue +0 -122
  179. package/src/components/TreeView.vue +0 -106
  180. package/src/components/TreeView2.vue +0 -38
  181. package/src/components/TreeViewItem.vue +0 -453
  182. package/src/components/TreeViewItem1.vue +0 -282
  183. package/src/components/TreeViewItem2.vue +0 -55
  184. package/src/components/Uploader.vue +0 -45
  185. package/src/components/Video.vue +0 -119
  186. package/src/components/VirtualGrid.vue +0 -297
  187. package/src/components/VirtualScroll.vue +0 -282
  188. package/src/components/VirtualTable.vue +0 -956
  189. package/src/components/YoutubeVideo.vue +0 -196
  190. package/src/configs/dashboard/bar.js +0 -10
  191. package/src/configs/dashboard/collection-1.js +0 -5
  192. package/src/configs/dashboard/data-table.js +0 -9
  193. package/src/configs/dashboard/doughnut.js +0 -7
  194. package/src/configs/dashboard/gheatmaps.js +0 -9
  195. package/src/configs/dashboard/grid-2.js +0 -34
  196. package/src/configs/dashboard/grid-3.js +0 -34
  197. package/src/configs/dashboard/grid-4.js +0 -34
  198. package/src/configs/dashboard/grid.js +0 -15
  199. package/src/configs/dashboard/metric.js +0 -10
  200. package/src/configs/dashboard/pie.js +0 -7
  201. package/src/configs/dashboard/polar-area.js +0 -7
  202. package/src/configs/dashboard/virtual-table.js +0 -9
  203. package/src/configs/icons-fa.json +0 -12
  204. package/src/configs/web-page-builder.js +0 -118
  205. package/src/defs/dashboard-preset.js +0 -22
  206. package/src/directives/intersect.js +0 -26
  207. package/src/hooks/device.js +0 -14
  208. package/src/index.css +0 -3
  209. package/src/index.js +0 -648
  210. package/src/middleware/http/trim-string.js +0 -20
  211. package/src/mixin/component.js +0 -306
  212. package/src/mixin/ready-state.js +0 -37
  213. package/src/stores/components.js +0 -36
  214. package/src/stores/datasource.js +0 -11
  215. package/src/themes/default/index.js +0 -303
  216. package/src/utils/dashboard.js +0 -140
  217. package/src/utils/event-bus.js +0 -8
  218. package/src/utils/helpers.cjs +0 -635
  219. package/src/utils/helpers.js +0 -635
  220. package/src/utils/helpers.mjs +0 -722
  221. package/src/utils/importer.js +0 -209
  222. package/src/utils/list.mjs +0 -1509
  223. package/src/utils/listpage1.js +0 -1507
  224. package/src/utils/listview.js +0 -1287
  225. package/src/utils/preset-selector.cjs +0 -1455
  226. package/src/utils/preset-selector.js +0 -1452
  227. package/src/utils/preset-selector.mjs +0 -234
  228. package/src/utils/queue.js +0 -63
  229. package/src/utils/selection.js +0 -43
  230. package/src/utils/web.js +0 -50
  231. package/src/utils/web.mjs +0 -120
  232. package/src/utils/wss.js +0 -296
  233. package/src/utils/wss.mjs +0 -285
  234. package/src/widgets/AhrefSetting.vue +0 -97
  235. package/src/widgets/ArticleSetting.vue +0 -457
  236. package/src/widgets/BackgroundColorSetting.vue +0 -153
  237. package/src/widgets/BackgroundSetting.vue +0 -132
  238. package/src/widgets/BlockSetting.vue +0 -49
  239. package/src/widgets/BorderColorSetting.vue +0 -57
  240. package/src/widgets/BorderSetting.vue +0 -201
  241. package/src/widgets/BotEditor/BotEditorActions.vue +0 -163
  242. package/src/widgets/BotEditor/BotEditorSettings.vue +0 -21
  243. package/src/widgets/BotEditor.vue +0 -248
  244. package/src/widgets/BoxSetting.vue +0 -53
  245. package/src/widgets/ButtonSetting.vue +0 -113
  246. package/src/widgets/CarouselSetting.vue +0 -181
  247. package/src/widgets/CartSetting.vue +0 -46
  248. package/src/widgets/CheckoutSetting.vue +0 -46
  249. package/src/widgets/CollapsiblePanelSetting.vue +0 -46
  250. package/src/widgets/ColumnSelector.vue +0 -104
  251. package/src/widgets/ComponentPropertyLabel.vue +0 -35
  252. package/src/widgets/ComponentPropertySelector.vue +0 -115
  253. package/src/widgets/ComponentSetting.vue +0 -2220
  254. package/src/widgets/ComponentSetting2.vue +0 -927
  255. package/src/widgets/ComponentSetting3.vue +0 -231
  256. package/src/widgets/ContactForm.vue +0 -193
  257. package/src/widgets/ContactFormSetting.vue +0 -395
  258. package/src/widgets/CountdownSetting.vue +0 -76
  259. package/src/widgets/Dashboard/BarChart.vue +0 -366
  260. package/src/widgets/Dashboard/BarChartSetting.vue +0 -317
  261. package/src/widgets/Dashboard/DataTable.vue +0 -125
  262. package/src/widgets/Dashboard/DataTableSetting.vue +0 -243
  263. package/src/widgets/Dashboard/DatasourceFilterSharing.vue +0 -93
  264. package/src/widgets/Dashboard/DatasourcePreview.vue +0 -93
  265. package/src/widgets/Dashboard/DatasourceSelector.vue +0 -122
  266. package/src/widgets/Dashboard/Doughnut.vue +0 -199
  267. package/src/widgets/Dashboard/DoughnutSetting.vue +0 -196
  268. package/src/widgets/Dashboard/GHeatMapsSetting.vue +0 -108
  269. package/src/widgets/Dashboard/InteractionEdit.vue +0 -228
  270. package/src/widgets/Dashboard/Metric.vue +0 -135
  271. package/src/widgets/Dashboard/MetricSetting.vue +0 -227
  272. package/src/widgets/Dashboard/Pie.vue +0 -188
  273. package/src/widgets/Dashboard/PieSetting.vue +0 -247
  274. package/src/widgets/Dashboard/PolarArea.vue +0 -201
  275. package/src/widgets/Dashboard/PolarAreaSetting.vue +0 -195
  276. package/src/widgets/Dashboard/SharingModal.vue +0 -115
  277. package/src/widgets/Dashboard/ViewSelector.vue +0 -183
  278. package/src/widgets/Dashboard/VirtualColumnEdit.vue +0 -97
  279. package/src/widgets/Dashboard/VirtualTableSetting.vue +0 -171
  280. package/src/widgets/Dashboard0.vue +0 -1856
  281. package/src/widgets/DataListSetting.vue +0 -102
  282. package/src/widgets/EffectSetting.vue +0 -94
  283. package/src/widgets/EmbeddedVideo.vue +0 -60
  284. package/src/widgets/EmbeddedVideoSetting.vue +0 -50
  285. package/src/widgets/FAQ.vue +0 -98
  286. package/src/widgets/FAQSetting.vue +0 -94
  287. package/src/widgets/FeatureList.vue +0 -131
  288. package/src/widgets/FeatureListSetting.vue +0 -233
  289. package/src/widgets/FiltersSetting.vue +0 -88
  290. package/src/widgets/FlexSetting.vue +0 -174
  291. package/src/widgets/GridSetting.vue +0 -165
  292. package/src/widgets/Header.vue +0 -15
  293. package/src/widgets/Header0.vue +0 -41
  294. package/src/widgets/Header0Setting.vue +0 -75
  295. package/src/widgets/Header2.vue +0 -65
  296. package/src/widgets/Header2Setting.vue +0 -193
  297. package/src/widgets/HeaderSetting.vue +0 -102
  298. package/src/widgets/IconList.vue +0 -51
  299. package/src/widgets/IconListSetting.vue +0 -188
  300. package/src/widgets/ImageSetting.vue +0 -119
  301. package/src/widgets/LayoutSetting.vue +0 -251
  302. package/src/widgets/LinkSetting.vue +0 -209
  303. package/src/widgets/LinkSettingModal.vue +0 -173
  304. package/src/widgets/LogViewer.vue +0 -85
  305. package/src/widgets/MarginPaddingSetting.vue +0 -58
  306. package/src/widgets/MarginSetting.vue +0 -142
  307. package/src/widgets/MenuEditor.vue +0 -256
  308. package/src/widgets/MenuItem1Setting.vue +0 -78
  309. package/src/widgets/ModalSetting.vue +0 -94
  310. package/src/widgets/MultiValueSetting.vue +0 -121
  311. package/src/widgets/MultiValueSetting2.vue +0 -147
  312. package/src/widgets/OGSettingModal.vue +0 -103
  313. package/src/widgets/PaddingSetting.vue +0 -142
  314. package/src/widgets/ParagraphSetting.vue +0 -89
  315. package/src/widgets/PositionSetting.vue +0 -209
  316. package/src/widgets/PresetBar.vue +0 -990
  317. package/src/widgets/PresetBarPivot.vue +0 -198
  318. package/src/widgets/PresetBarPivotColumnEdit.vue +0 -197
  319. package/src/widgets/PresetSelector.vue +0 -685
  320. package/src/widgets/Review.vue +0 -131
  321. package/src/widgets/ReviewSetting.vue +0 -201
  322. package/src/widgets/SearchModalSetting.vue +0 -70
  323. package/src/widgets/Share.vue +0 -164
  324. package/src/widgets/ShareSetting.vue +0 -99
  325. package/src/widgets/SizingSetting.vue +0 -306
  326. package/src/widgets/SpacingSetting.vue +0 -77
  327. package/src/widgets/StyleSetting.vue +0 -543
  328. package/src/widgets/StyleSetting2.vue +0 -90
  329. package/src/widgets/SvgSetting.vue +0 -133
  330. package/src/widgets/TableSetting.vue +0 -172
  331. package/src/widgets/TestimonialSetting.vue +0 -161
  332. package/src/widgets/TextBlockSetting.vue +0 -81
  333. package/src/widgets/ThumbnailSetting.vue +0 -49
  334. package/src/widgets/TransitionSetting.vue +0 -64
  335. package/src/widgets/TypographySetting.vue +0 -334
  336. package/src/widgets/UserActionBuilder/UserActionCondition.vue +0 -99
  337. package/src/widgets/UserActionBuilder/UserActionConsole.vue +0 -97
  338. package/src/widgets/UserActionBuilder/UserActionItem.vue +0 -273
  339. package/src/widgets/UserActionBuilder/UserActionOutput.vue +0 -152
  340. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +0 -27
  341. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +0 -28
  342. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +0 -112
  343. package/src/widgets/UserActionBuilder/UserActionProps.vue +0 -213
  344. package/src/widgets/UserActionBuilder.vue +0 -314
  345. package/src/widgets/WebComponentSelector.vue +0 -205
  346. package/src/widgets/WebDatasourceSelector.vue +0 -153
  347. package/src/widgets/WebLayoutSelector.vue +0 -147
  348. package/src/widgets/WebPageBuilder.vue +0 -2161
  349. package/src/widgets/WebPageBuilder2.vue +0 -1091
  350. package/src/widgets/WebPageBuilder3.vue +0 -411
  351. package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +0 -54
  352. package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +0 -75
  353. package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +0 -72
  354. package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +0 -72
  355. package/src/widgets/WebPageBuilder4/BlurSetting.vue +0 -72
  356. package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +0 -64
  357. package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +0 -75
  358. package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +0 -69
  359. package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +0 -72
  360. package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +0 -73
  361. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -65
  362. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +0 -178
  363. package/src/widgets/WebPageBuilder4/DisplaySetting.vue +0 -76
  364. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +0 -71
  365. package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +0 -70
  366. package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +0 -74
  367. package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +0 -71
  368. package/src/widgets/WebPageBuilder4/FlexSetting.vue +0 -96
  369. package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +0 -69
  370. package/src/widgets/WebPageBuilder4/GapSetting.vue +0 -75
  371. package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +0 -68
  372. package/src/widgets/WebPageBuilder4/GridSetting.vue +0 -216
  373. package/src/widgets/WebPageBuilder4/HeightSetting.vue +0 -98
  374. package/src/widgets/WebPageBuilder4/ImageSetting.vue +0 -102
  375. package/src/widgets/WebPageBuilder4/MarginSetting.vue +0 -73
  376. package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +0 -82
  377. package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +0 -90
  378. package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +0 -81
  379. package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +0 -101
  380. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +0 -163
  381. package/src/widgets/WebPageBuilder4/OpacitySetting.vue +0 -77
  382. package/src/widgets/WebPageBuilder4/OverflowSetting.vue +0 -81
  383. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +0 -57
  384. package/src/widgets/WebPageBuilder4/PositionSetting.vue +0 -191
  385. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -176
  386. package/src/widgets/WebPageBuilder4/TextSetting.vue +0 -72
  387. package/src/widgets/WebPageBuilder4/TreeView.vue +0 -46
  388. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -303
  389. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +0 -141
  390. package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +0 -172
  391. package/src/widgets/WebPageBuilder4/WidthSetting.vue +0 -105
  392. package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +0 -72
  393. package/src/widgets/WebPageBuilder4.vue +0 -798
  394. package/src/widgets/WebPagePreview.vue +0 -295
  395. package/src/widgets/WebPageSelector.vue +0 -173
  396. package/src/widgets/WebTemplateCreator.vue +0 -156
  397. package/src/widgets/YoutubeVideoSetting.vue +0 -68
  398. package/tailwind.config.js +0 -481
@@ -1,1856 +0,0 @@
1
- <template>
2
- <div v-if="cConfig" :class="$style.comp">
3
-
4
- <div :style="sidebarStyle"
5
- class="relative flex flex-col border-r-[1px] border-border-50 panel-400 overflow-hidden">
6
-
7
- <TransitionGroup class="flex-1 flex flex-col" name="openltr" tag="div">
8
-
9
- <div v-if="selectedView" class="flex-1 flex flex-col">
10
- <div class="p-5 flex flex-row gap-3">
11
- <button type="button" @click="delete cConfig.selectedView">
12
- <svg class="fill-text hover:fill-primary" height="16" viewBox="0 0 448 512" width="16"
13
- xmlns="http://www.w3.org/2000/svg">
14
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
15
- <path
16
- d="M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z"/>
17
- </svg>
18
- </button>
19
- <div class="leading-tight flex-1">
20
- <small class="text-xs text-text-400">{{ selectedView.type }}</small>
21
- <h5 class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap" @click="log(selectedView)">
22
- {{ selectedView.props.label ?? selectedView.name }}
23
- </h5>
24
- </div>
25
- </div>
26
-
27
- <div class="flex-1 overflow-y-auto flex flex-col">
28
-
29
- <component :is="`${selectedView?.type}Setting`"
30
- :config="config"
31
- :datasource="selectedPreset.datasource"
32
- :index="viewTypeIndex"
33
- :readonly="selectedPreset.readonly"
34
- :value="selectedView"
35
- :view-type="config.viewType"
36
- @change="load({ [selectedView.uid]:selectedView })" />
37
-
38
- </div>
39
- </div>
40
-
41
- <div v-else-if="selectedDatasource" class="flex-1 flex flex-col">
42
- <div class="p-5 flex flex-row items-center gap-2 pb-0">
43
- <button type="button" @click="delete cConfig.selectedDatasource">
44
- <svg class="fill-text hover:fill-primary" height="16" viewBox="0 0 448 512" width="16"
45
- xmlns="http://www.w3.org/2000/svg">
46
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
47
- <path
48
- d="M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z"/>
49
- </svg>
50
- </button>
51
- <Textbox v-model="selectedDatasource.name"
52
- class="flex-1 bg-transparent border-transparent rounded-none"
53
- item-class="font-bold text-lg p-0"
54
- @click="log(selectedDatasource)"/>
55
- <button v-if="previewSrc" class="text-primary" type="button"
56
- @click="previewDatasource(selectedDatasource)">
57
- Preview
58
- </button>
59
- </div>
60
-
61
- <div class="flex justify-center border-b-[1px] border-border-50 mt-3">
62
- <Tabs v-model="selectedDatasource.tabIndex" :items="datasourceTabs"/>
63
- </div>
64
-
65
- <div class="flex-1 overflow-y-auto flex">
66
-
67
- <div v-if="selectedDatasource.tabIndex === 1" class="py-5 flex-1 flex flex-col gap-5">
68
-
69
- <div class="px-5">
70
- <Textbox placeholder="Search columns..." v-model="datasourceColumnSearch" />
71
- </div>
72
-
73
- <VirtualGrid class="flex-1"
74
- :items="selectedDatasourceColumns">
75
- <template #item="{ item }">
76
- <div v-if="!item.key.startsWith('_') || (item.key.startsWith('_') && (preset.pivot && preset.pivot.enabled))"
77
- class="flex flex-row items-center gap-3 mx-5">
78
- <div class="flex-1 flex flex-row gap-2 items-center" :class="$style.button">
79
- <div>
80
- {{ item.label2 ?? item.label }}
81
- </div>
82
- </div>
83
- </div>
84
- </template>
85
- </VirtualGrid>
86
-
87
- <div class="h-[1px] bg-text-50"></div>
88
-
89
- <div class="h-[200px] flex flex-col">
90
- <div class="flex flex-row gap-2 px-5">
91
- <label class="text-text-400 flex-1">Computed Columns</label>
92
- <button type="button" class="text-primary" @click="$refs.virtualColumnEdit.open({}, addComputedColumns)">
93
- Add Column
94
- </button>
95
- </div>
96
- <VirtualGrid class="flex-1 mt-5" :items="selectedDatasourceComputedColumns">
97
- <template #item="{ item, index }">
98
- <div class="flex flex-row items-center gap-3 p-3 mx-5 group" :class="$style.button">
99
- <div class="flex-1">{{ item.label }}</div>
100
- <div class="hidden flex-row gap-3 group-hover:flex">
101
- <button type="button" class="text-primary" @click="selectedDatasource.computedColumns.splice(index, 1)">
102
- <svg width="16" height="16" class="fill-text-300 hover:fill-red-600" 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="M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z"/></svg>
103
- </button>
104
- <button type="button" class="text-primary" @click="$refs.virtualColumnEdit.open(item, addComputedColumns)">
105
- <svg width="14" height="14" class="fill-text-300 hover:fill-primary-600" 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="M383.1 448H63.1V128h156.1l64-64H63.1C28.65 64 0 92.65 0 128v320c0 35.35 28.65 64 63.1 64h319.1c35.34 0 63.1-28.65 63.1-64l-.0039-220.1l-63.1 63.99V448zM497.9 42.19l-28.13-28.14c-18.75-18.75-49.14-18.75-67.88 0l-38.62 38.63l96.01 96.01l38.62-38.63C516.7 91.33 516.7 60.94 497.9 42.19zM147.3 274.4l-19.04 95.22c-1.678 8.396 5.725 15.8 14.12 14.12l95.23-19.04c4.646-.9297 8.912-3.213 12.26-6.562l186.8-186.8l-96.01-96.01L153.8 262.2C150.5 265.5 148.2 269.8 147.3 274.4z"/></svg>
106
- </button>
107
- </div>
108
- </div>
109
- </template>
110
- </VirtualGrid>
111
-
112
- <VirtualColumnEdit ref="virtualColumnEdit" :columns="selectedDatasource.columns" />
113
- </div>
114
- </div>
115
-
116
- <div v-else-if="selectedDatasource.tabIndex === 2"
117
- class="flex-1 flex flex-col divide-y divide-border-50 py-3">
118
-
119
- <ListItem :items="selectedDatasource.filters"
120
- class="bg-transparent"
121
- container-class="flex flex-col divide-y divide-border-50"
122
- @reorder="(from, to) => { selectedDatasource.filters.splice(to, 0, selectedDatasource.filters.splice(from, 1)[0]); }">
123
- <template v-slot="{ item:filter, index:idx }">
124
- <div class="p-5">
125
- <div class="flex flex-row items-start">
126
- <Checkbox v-model="filter.enabled" :default="true" :disabled="selectedPreset.readonly"
127
- @change="onDatasourceFilterChanged"/>
128
- <div class="flex-1 flex flex-col gap-3">
129
- <div class="flex-1 flex flex-row items-center gap-2">
130
- <strong class="flex-1 cursor-pointer whitespace-nowrap text-ellipsis overflow-hidden"
131
- data-reorder
132
- @click="filter._collapsed = !filter._collapsed">
133
- <svg :class="filter._collapsed === true ? `` : `rotate-90`"
134
- class="inline fill-text transition-transform relative top-[-1px]"
135
- height="11" viewBox="0 0 256 512" width="11" xmlns="http://www.w3.org/2000/svg">
136
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
137
- <path
138
- d="M118.6 105.4l128 127.1C252.9 239.6 256 247.8 256 255.1s-3.125 16.38-9.375 22.63l-128 127.1c-9.156 9.156-22.91 11.9-34.88 6.943S64 396.9 64 383.1V128c0-12.94 7.781-24.62 19.75-29.58S109.5 96.23 118.6 105.4z"/>
139
- </svg>
140
- {{ selectedDatasourceColumn(filter.key).label ?? filter.key }}
141
- </strong>
142
- <select v-if="filter.value.length > 1"
143
- v-model="filter.modifier"
144
- class="appearance-none bg-text-50 min-w-[60px] text-text-400 px-2 outline-none"
145
- @change="onDatasourceFilterChanged()">
146
- <option value="and">And</option>
147
- <option value="or">Or</option>
148
- </select>
149
- <button
150
- v-if="!selectedPreset.readonly && typeOf(selectedDatasourceColumn(filter.key).type) !== 'enum' && filter._collapsed !== true"
151
- type="button" @click="filter.value.push({})">
152
- <svg class="fill-text-300" height="14" viewBox="0 0 448 512" width="14"
153
- xmlns="http://www.w3.org/2000/svg">
154
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
155
- <path
156
- d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/>
157
- </svg>
158
- </button>
159
- <button v-if="!selectedPreset.readonly" class="p-1" type="button"
160
- @click="selectedDatasource.filters.splice(idx, 1);onDatasourceFilterChanged()">
161
- <svg class="fill-text-300 hover:fill-red-500" height="14" viewBox="0 0 320 512"
162
- width="14" xmlns="http://www.w3.org/2000/svg">
163
- <path
164
- d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/>
165
- </svg>
166
- </button>
167
-
168
- <button v-if="selectedPreset.sharing?.length > 0 && !selectedPreset.readonly"
169
- class="p-0.5 rounded-full"
170
- type="button"
171
- @click="$refs.datasourceFilterSharing.open(filter.sharing, (sharing) => { filter.sharing = sharing; load() })">
172
- <svg :class="filter.sharing?.length > 0 ? 'fill-primary' : 'fill-text-300 hover:fill-primary'" height="14"
173
- viewBox="0 0 640 512"
174
- width="14" xmlns="http://www.w3.org/2000/svg">
175
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
176
- <path
177
- d="M319.9 320c57.41 0 103.1-46.56 103.1-104c0-57.44-46.54-104-103.1-104c-57.41 0-103.1 46.56-103.1 104C215.9 273.4 262.5 320 319.9 320zM369.9 352H270.1C191.6 352 128 411.7 128 485.3C128 500.1 140.7 512 156.4 512h327.2C499.3 512 512 500.1 512 485.3C512 411.7 448.4 352 369.9 352zM512 160c44.18 0 80-35.82 80-80S556.2 0 512 0c-44.18 0-80 35.82-80 80S467.8 160 512 160zM183.9 216c0-5.449 .9824-10.63 1.609-15.91C174.6 194.1 162.6 192 149.9 192H88.08C39.44 192 0 233.8 0 285.3C0 295.6 7.887 304 17.62 304h199.5C196.7 280.2 183.9 249.7 183.9 216zM128 160c44.18 0 80-35.82 80-80S172.2 0 128 0C83.82 0 48 35.82 48 80S83.82 160 128 160zM551.9 192h-61.84c-12.8 0-24.88 3.037-35.86 8.24C454.8 205.5 455.8 210.6 455.8 216c0 33.71-12.78 64.21-33.16 88h199.7C632.1 304 640 295.6 640 285.3C640 233.8 600.6 192 551.9 192z"/>
178
- </svg>
179
- </button>
180
- </div>
181
- <div v-if="filter._collapsed !== true">
182
- <div v-if="Array.isArray(filter.value)" class="flex flex-col gap-2">
183
- <div v-for="(filterVal, filterIdx) in filter.value" class="flex flex-row gap-2">
184
- <PresetSelectorFilterItem
185
- :column="selectedDatasourceColumn(filter.key)"
186
- :enumCache="enumCache"
187
- :readonly="selectedPreset.readonly"
188
- :type="typeOf(selectedDatasourceColumn(filter.key).type)"
189
- :typeParams="typeParamsOf(selectedDatasourceColumn(filter.key))"
190
- :value="filterVal"
191
- class="flex-1"
192
- @change="onDatasourceFilterChanged"/>
193
-
194
- <button v-if="filter.value.length > 1 && !selectedPreset.readonly"
195
- class="p-1"
196
- type="button"
197
- @click="filter.value.splice(filterIdx, 1);onDatasourceFilterChanged()">
198
- <svg class="fill-text-300 hover:fill-red-500" height="14" viewBox="0 0 320 512"
199
- width="14" xmlns="http://www.w3.org/2000/svg">
200
- <path
201
- d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/>
202
- </svg>
203
- </button>
204
- </div>
205
- </div>
206
- <PresetSelectorFilterItem v-else
207
- :column="selectedDatasourceColumn(filter.key)"
208
- :enumCache="enumCache"
209
- :readonly="selectedPreset.readonly"
210
- :type="typeOf(selectedDatasourceColumn(filter.key).type)"
211
- :value="filter"
212
- @change="onDatasourceFilterChanged"/>
213
- </div>
214
- </div>
215
- </div>
216
- </div>
217
- </template>
218
- </ListItem>
219
-
220
- <div v-for="(filter, idx) in queryFilters[selectedDatasource.uid]" class="p-5">
221
-
222
- <div class="flex flex-col gap-2">
223
- <strong>{{ filter.key }}</strong>
224
- <div class="flex flex-row gap-2">
225
- <Dropdown v-model="filter.operator" :readonly="true" class="w-[100px]">
226
- <option :value="filter.operator">{{ filter.operator }}</option>
227
- </Dropdown>
228
- <Textbox v-model="filter.value" :readonly="true" class="flex-1"/>
229
- </div>
230
- </div>
231
-
232
- </div>
233
-
234
- <div v-if="!selectedPreset.readonly" class="p-5 flex justify-center">
235
- <button class="text-primary flex flex-row items-center justify-center p-3"
236
- type="button"
237
- @click="$refs.columnSelector.open(addFilter, selectedDatasourceFilterColumns)">
238
- <svg class="fill-primary" height="16" viewBox="0 0 448 512" width="16"
239
- xmlns="http://www.w3.org/2000/svg">
240
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
241
- <path
242
- d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/>
243
- </svg>
244
- Add Filter
245
- </button>
246
- </div>
247
-
248
- <DatasourceFilterSharing ref="datasourceFilterSharing" :items="selectedPreset.sharing"
249
- :readonly="selectedPreset.readonly"/>
250
- </div>
251
-
252
- <div v-else-if="selectedDatasource.tabIndex === 3" class="p-5 flex-1 flex flex-col">
253
-
254
- <ListItem v-if="selectedDatasource.sorts?.length > 0"
255
- :items="selectedDatasource.sorts"
256
- container-class="flex flex-col rounded-lg border-[1px] border-border-50 bg-base-300 divide-y divide-border-50"
257
- @reorder="(from, to) => { selectedDatasource.sorts.splice(to, 0, selectedDatasource.sorts.splice(from, 1)[0]); }">
258
- <template v-slot="{ item, index }">
259
- <div class="flex flex-row items-center gap-3 p-1">
260
- <div v-if="!selectedPreset.readonly" data-reorder>
261
- <svg class="fill-text-300" height="14" viewBox="0 0 512 512" width="14"
262
- xmlns="http://www.w3.org/2000/svg">
263
- <path
264
- d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/>
265
- </svg>
266
- </div>
267
- <div class="flex-1 flex flex-row gap-3">
268
- <Dropdown v-model="item.key"
269
- :readonly="selectedPreset.readonly"
270
- class="flex-1"
271
- @change="">
272
- <option v-for="column in selectedDatasourceSortColumns"
273
- :value="column.key">
274
- {{ column.label2 ?? column.label }}
275
- </option>
276
- </Dropdown>
277
- <div class="flex flex-row">
278
- <Radio v-model="item.type" :disabled="selectedPreset.readonly" custom="true" value="asc"
279
- @change="">
280
- <button :class="item.type === 'asc' ? 'bg-primary' : ''" class="p-1" type="button">
281
- <svg :class="item.type === 'asc' ? 'fill-white' : 'fill-text'" height="14" viewBox="0 0 512 512"
282
- width="14" xmlns="http://www.w3.org/2000/svg">
283
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
284
- <path
285
- d="M439.1 432H377.1l81.87-105.3c5.625-7.25 6.656-17.06 2.625-25.28C457.5 293.2 449.1 288 439.1 288h-111.1c-13.25 0-23.1 10.75-23.1 24s10.75 24 23.1 24h62.94L309.1 441.3c-5.623 7.25-6.654 17.06-2.625 25.28C310.5 474.8 318.8 480 327.1 480h111.1c13.25 0 23.1-10.75 23.1-24S453.2 432 439.1 432zM477.5 189.3l-71.1-144c-8.123-16.31-34.81-16.31-42.94 0l-71.1 144c-5.938 11.84-1.125 26.25 10.75 32.19c11.9 5.938 26.25 1.156 32.19-10.75L338.8 200h90.34l5.359 10.72C438.7 219.2 447.2 224 456 224c3.594 0 7.25-.8125 10.69-2.531C478.6 215.5 483.4 201.1 477.5 189.3zM362.8 152l21.17-42.34L405.2 152H362.8zM206.4 335.1L152 394.9V56.02c0-13.27-10.75-24.02-24-24.02S104 42.76 104 56.02v338.9l-54.37-58.95c-4.719-5.125-11.16-7.719-17.62-7.719c-5.812 0-11.66 2.094-16.28 6.375c-9.75 8.977-10.34 24.18-1.344 33.94l95.1 104.1c9.062 9.82 26.19 9.82 35.25 0l95.1-104.1c9-9.758 8.406-24.96-1.344-33.94C230.5 325.5 215.3 326.2 206.4 335.1z"/>
286
- </svg>
287
- </button>
288
- </Radio>
289
- <Radio v-model="item.type" :disabled="selectedPreset.readonly" custom="true" value="desc"
290
- @change="">
291
- <button :class="item.type === 'desc' ? 'bg-primary' : ''" class="p-1" type="button">
292
- <svg :class="item.type === 'desc' ? 'fill-white' : 'fill-text'" height="14" viewBox="0 0 512 512"
293
- width="14" xmlns="http://www.w3.org/2000/svg">
294
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
295
- <path
296
- d="M327.1 80h62.94L309.1 185.2c-5.623 7.25-6.654 17.06-2.625 25.28c4.031 8.25 12.41 13.47 21.56 13.47h111.1c13.25 0 23.1-10.75 23.1-24s-10.75-24-23.1-24H377.1l81.87-105.2c5.625-7.25 6.656-17.06 2.625-25.28C457.5 37.22 449.1 32 439.1 32h-111.1c-13.25 0-23.1 10.75-23.1 24S314.7 80 327.1 80zM477.5 445.3l-71.1-144c-8.123-16.3-34.81-16.3-42.94 0l-71.1 144c-5.938 11.84-1.125 26.25 10.75 32.19c11.9 5.938 26.25 1.156 32.19-10.75l5.359-10.72h90.34l5.359 10.72c4.219 8.438 12.69 13.28 21.5 13.28c3.594 0 7.25-.8125 10.69-2.531C478.6 471.5 483.4 457.1 477.5 445.3zM362.8 407.1l21.17-42.34l21.17 42.34H362.8zM206.4 335.1L152 394.9V56.02c0-13.27-10.75-24.02-24-24.02S104 42.76 104 56.02v338.9l-54.37-58.95c-4.719-5.125-11.16-7.719-17.62-7.719c-5.812 0-11.66 2.094-16.28 6.375c-9.75 8.977-10.34 24.18-1.344 33.94l95.1 104.1c9.062 9.82 26.19 9.82 35.25 0l95.1-104.1c9-9.758 8.406-24.96-1.344-33.94C230.5 325.5 215.3 326.2 206.4 335.1z"/>
297
- </svg>
298
- </button>
299
- </Radio>
300
- </div>
301
- </div>
302
- <button v-if="!selectedPreset.readonly" type="button"
303
- @click="selectedDatasource.sorts.splice(index, 1); ">
304
- <svg class="fill-text-300 hover:fill-red-500" height="16" viewBox="0 0 320 512"
305
- width="16" xmlns="http://www.w3.org/2000/svg">
306
- <path
307
- d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/>
308
- </svg>
309
- </button>
310
- </div>
311
- </template>
312
- </ListItem>
313
-
314
- <button v-if="!selectedPreset.readonly"
315
- class="text-primary flex flex-row items-center justify-center p-3"
316
- type="button"
317
- @click="addSort({ type:'asc' })">
318
- <svg class="fill-primary" height="16" viewBox="0 0 448 512" width="16"
319
- xmlns="http://www.w3.org/2000/svg">
320
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
321
- <path
322
- d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/>
323
- </svg>
324
- Add Sort
325
- </button>
326
-
327
- </div>
328
-
329
- <div v-else-if="selectedDatasource.tabIndex === 4" class="p-5 flex-1 flex flex-col gap-5">
330
-
331
- <PresetBarPivot :columns="selectedDatasourcePivotColumns"
332
- :pivot="selectedDatasourcePivot"
333
- @apply="updatePivot"/>
334
-
335
- <br/>
336
- </div>
337
-
338
- <ColumnSelector ref="columnSelector"/>
339
- </div>
340
- </div>
341
-
342
- <div v-else-if="selectedPreset" class="flex-1 flex flex-col">
343
- <div class="p-5 flex flex-row gap-2">
344
- <button type="button" @click="delete cConfig.params.selectedUid">
345
- <svg class="fill-text hover:fill-primary" height="16" viewBox="0 0 448 512" width="16"
346
- xmlns="http://www.w3.org/2000/svg">
347
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
348
- <path
349
- d="M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z"/>
350
- </svg>
351
- </button>
352
- <Textbox v-model="selectedPreset.name"
353
- class="flex-1 border-transparent bg-transparent"
354
- item-class="p-0 text-lg font-bold"
355
- :readonly="!!!presetNameChanging">
356
- <template #end>
357
- <div v-if="!presetNameChanging" class="pl-5">
358
- <button type="button" class="text-primary" @click="presetNameChanging = selectedPreset.name">Edit</button>
359
- </div>
360
- <div v-else class="flex flex-row gap-3">
361
- <button type="button" class="text-primary" @click="selectedPreset.name = presetNameChanging; presetNameChanging = null">Revert</button>
362
- <button type="button" class="text-primary" @click="presetNameChanging = null">Save</button>
363
- </div>
364
- </template>
365
- </Textbox>
366
- </div>
367
-
368
- <div class="flex justify-center border-b-[1px] border-border-50">
369
- <Tabs :items="presetTabs" v-model="selectedPresetParams.tabIndex" />
370
- </div>
371
-
372
- <div class="flex-1 overflow-y-auto">
373
-
374
- <div v-if="selectedPresetParams.tabIndex === 1" class="p-5">
375
- <div class="flex flex-row gap-2">
376
- <label class="flex-1" @click="log(selectedPreset.views)">Views</label>
377
- <button v-if="!selectedPreset.readonly" class="text-primary" type="button"
378
- @click="(e) => $refs.chooseView.open((_) => addView(_, selectedPreset.views, { unshift:e.shiftKey }))">
379
- Add View
380
- </button>
381
- </div>
382
- <div class="flex flex-col">
383
- <TreeView v-model="selectedViewUid"
384
- :config="componentsConfig"
385
- :items="selectedPreset.views"
386
- :readonly="selectedPreset.readonly"
387
- class="mt-2">
388
- <template #item="{ item, parent, depth }">
389
- <div class="flex-1 p-3 overflow-hidden text-ellipsis cursor-pointer flex flex-row items-center gap-3">
390
- <div>
391
- <svg v-if="item.type === 'Grid'" class="fill-text-200" height="14" viewBox="0 0 512 512"
392
- width="14" xmlns="http://www.w3.org/2000/svg">
393
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
394
- <path
395
- d="M448 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V96C512 60.65 483.3 32 448 32zM64 96h160v128H64V96zM64 416V288h160v128H64zM448 416h-160V288h160V416zM448 224h-160V96h160V224z"/>
396
- </svg>
397
- <svg v-else-if="item.type === 'Doughnut'" class="fill-text-200" height="14" viewBox="0 0 512 512"
398
- width="14" xmlns="http://www.w3.org/2000/svg">
399
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
400
- <path
401
- d="M512 256c0-26.88-16.6-49.84-40.22-59.34c-20.88-75.75-80.68-135.6-156.4-156.4C305.8 16.6 282.9 0 256 0C229.1 0 206.2 16.6 196.7 40.22c-75.75 20.88-135.6 80.68-156.4 156.4C16.6 206.2 0 229.1 0 256s16.6 49.84 40.22 59.34c20.88 75.75 80.68 135.6 156.4 156.4C206.2 495.4 229.1 512 256 512c26.88 0 49.84-16.6 59.34-40.22c75.75-20.88 135.6-80.68 156.4-156.4C495.4 305.8 512 282.9 512 256zM448 240c8.875 0 16 7.125 16 16c0 8.875-7.125 16-16 16S432 264.9 432 256C432 247.1 439.1 240 448 240zM272 64c0 8.875-7.125 16-16 16C247.1 80 240 72.88 240 64S247.1 48 256 48C264.9 48 272 55.12 272 64zM64 272C55.12 272 48 264.9 48 256c0-8.875 7.125-16 16-16S80 247.1 80 256C80 264.9 72.88 272 64 272zM240 448c0-8.875 7.125-16 16-16c8.875 0 16 7.125 16 16s-7.125 16-16 16C247.1 464 240 456.9 240 448zM305.1 407.5C293.4 393.2 275.9 384 256 384c-19.88 0-37.39 9.235-49.14 23.49C158.4 391.6 120.4 353.6 104.5 305.1C118.8 293.4 128 275.9 128 256S118.8 218.6 104.5 206.9c15.88-48.5 53.85-86.47 102.3-102.3C218.6 118.8 236.1 128 256 128c19.88 0 37.39-9.235 49.14-23.49c48.5 15.88 86.47 53.85 102.3 102.3C393.2 218.6 384 236.1 384 256s9.235 37.39 23.49 49.14C391.6 353.6 353.6 391.6 305.1 407.5z"/>
402
- </svg>
403
- <svg v-else-if="item.type === 'VirtualTable'" class="fill-text-200" height="14" viewBox="0 0 512 512"
404
- width="14" xmlns="http://www.w3.org/2000/svg">
405
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
406
- <path
407
- d="M448 32H64.05C28.7 32 .0492 60.65 .0492 96v320c0 35.35 28.65 64 64 64h383.1c35.35 0 64-28.65 64-64V96C512 60.65 483.4 32 448 32zM224 416H64v-96h160V416zM224 256H64V160h160V256zM448 416h-160v-96h160V416zM448 256h-160V160h160V256z"/>
408
- </svg>
409
- <svg v-else-if="item.type === 'Pie'" class="fill-text-200" height="14" viewBox="0 0 576 512"
410
- width="14" xmlns="http://www.w3.org/2000/svg">
411
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
412
- <path
413
- d="M559.7 288l-237.2-.0006l157.1 158c6.124 6.124 15.99 6.484 22.24 .7343c38.62-36.5 65.25-85.62 73.12-140.9C577.2 296.4 569.4 288 559.7 288zM543.1 223.2c-8.249-119.5-103.7-214.1-223.2-223.2c-9.124-.6249-16.76 7.113-16.76 16.24L304 240l223.7-.0012C536.9 240 544.6 232.4 543.1 223.2zM256 288V50.75c0-9.624-8.369-17.48-17.87-16.11C119 51.52 27.89 155.6 32.14 280.4c4.375 128.1 114.8 233.2 242.9 231.6c50.37-.6249 97-16.88 135.2-44c7.999-5.624 8.487-17.24 1.612-24.11L256 288z"/>
414
- </svg>
415
- <svg v-else-if="item.type === 'PolarArea'" class="fill-text-200" height="14" viewBox="0 0 640 512"
416
- width="14" xmlns="http://www.w3.org/2000/svg">
417
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
418
- <path
419
- d="M119.1 272C107.1 252.1 87.55 240 64 240c-35.25 0-64 28.75-64 64s28.75 64 64 64c23.55 0 43.96-12.97 55.08-32h60.15C177.1 325.7 176 314.1 176 304s1.127-21.66 3.229-32H119.1zM576 192c35.25 0 64-28.75 64-64s-28.75-64-64-64s-64 28.75-64 64S540.8 192 576 192zM576 384c-11.19 0-21.66 3.094-30.78 8.213l-86.1-52.2C461.6 328.5 464 316.6 464 304c0-16.77-3.436-32.68-9.301-47.36l67.3-49.36c-17.94-12.26-31.13-30.59-37.53-51.86l-67.96 49.84C394.5 187.3 366.7 176 336 176c-7.988 0-15.74 .9492-23.32 2.352L276.3 100.3C283.5 89.98 288 77.54 288 64c0-35.25-28.75-64-64-64S160 28.75 160 64c0 33.29 25.73 60.47 58.28 63.42l36.57 78.36C226.5 229.3 208 264.3 208 304c0 70.67 57.33 128 128 128c34.97 0 66.61-14.11 89.71-36.85l86.39 51.83C512.1 447.3 512 447.7 512 448c0 35.25 28.75 64 64 64S640 483.3 640 448S611.3 384 576 384zM336 352C309.5 352 288 330.5 288 304S309.5 256 336 256S384 277.5 384 304S362.5 352 336 352z"/>
420
- </svg>
421
- </div>
422
- <div :class="!item.props?.enabled ? 'line-through opacity-50' : ''"
423
- class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap">
424
- <strong class="hover:text-primary" @click="cConfig.selectedView = item.uid">
425
- {{ item.props?.label ?? (item.name ?? item.type) }}
426
- </strong>
427
- </div>
428
- <button v-if="item.isContainer && !selectedPreset.readonly"
429
- class="px-1"
430
- type="button"
431
- @click="(e) => $refs.chooseView.open((_) => addView(_, item.items, { unshift:e.shiftKey }))">
432
- <svg class="fill-text-300 hover:fill-primary-600" height="14" viewBox="0 0 448 512"
433
- width="14" xmlns="http://www.w3.org/2000/svg">
434
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
435
- <path
436
- d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/>
437
- </svg>
438
- </button>
439
- <button v-if="!selectedPreset.readonly" :ref="`viewOpt${item.uid}`" type="button"
440
- @click="$refs.viewOpt.open($refs[`viewOpt${item.uid}`], { item, parent })">
441
- <svg class="fill-text-300 hover:fill-primary" height="14" viewBox="0 0 512 512"
442
- width="14" xmlns="http://www.w3.org/2000/svg">
443
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
444
- <path
445
- 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"/>
446
- </svg>
447
- </button>
448
- </div>
449
- </template>
450
- </TreeView>
451
-
452
- <ContextMenu ref="viewOpt" position="bottom-right">
453
- <template #default="{ context }">
454
- <div class="flex flex-col min-w-[200px]">
455
-
456
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
457
- @click="cConfig.selectedView = context.item.uid">
458
- <div class="w-[30px]">
459
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
460
- xmlns="http://www.w3.org/2000/svg">
461
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
462
- <path
463
- d="M495.6 49.23l-32.82-32.82C451.8 5.471 437.5 0 423.1 0c-14.33 0-28.66 5.469-39.6 16.41L167.5 232.5C159.1 240 154.8 249.5 152.4 259.8L128.3 367.2C126.5 376.1 133.4 384 141.1 384c.916 0 1.852-.0918 2.797-.2813c0 0 74.03-15.71 107.4-23.56c10.1-2.377 19.13-7.459 26.46-14.79l217-217C517.5 106.5 517.4 71.1 495.6 49.23zM461.7 94.4L244.7 311.4C243.6 312.5 242.5 313.1 241.2 313.4c-13.7 3.227-34.65 7.857-54.3 12.14l12.41-55.2C199.6 268.9 200.3 267.5 201.4 266.5l216.1-216.1C419.4 48.41 421.6 48 423.1 48s3.715 .4062 5.65 2.342l32.82 32.83C464.8 86.34 464.8 91.27 461.7 94.4zM424 288c-13.25 0-24 10.75-24 24v128c0 13.23-10.78 24-24 24h-304c-13.22 0-24-10.77-24-24v-304c0-13.23 10.78-24 24-24h144c13.25 0 24-10.75 24-24S229.3 64 216 64L71.1 63.99C32.31 63.99 0 96.29 0 135.1v304C0 479.7 32.31 512 71.1 512h303.1c39.69 0 71.1-32.3 71.1-72L448 312C448 298.8 437.3 288 424 288z"/>
464
- </svg>
465
- </div>
466
- Edit
467
- </button>
468
-
469
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
470
- @click="duplicateComponent(context.item, context.parent)">
471
- <div class="w-[30px]">
472
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
473
- xmlns="http://www.w3.org/2000/svg">
474
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
475
- <path
476
- d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/>
477
- </svg>
478
- </div>
479
- Duplicate
480
- </button>
481
-
482
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
483
- @click="context.parent.splice(context.parent.indexOf(context.item), 1)">
484
- <div class="w-[30px]">
485
- <svg class="fill-text-300" height="16" viewBox="0 0 320 512" width="16"
486
- xmlns="http://www.w3.org/2000/svg">
487
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
488
- <path
489
- 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"/>
490
- </svg>
491
- </div>
492
- Remove
493
- </button>
494
-
495
- </div>
496
- </template>
497
- </ContextMenu>
498
- </div>
499
- </div>
500
-
501
- <div v-else-if="selectedPresetParams.tabIndex === 2" class="p-5">
502
- <div class="flex flex-row gap-2">
503
- <label class="flex-1" @click="log(selectedPreset.datasource)">Datasource</label>
504
- <button v-if="!selectedPreset.readonly && selectedPreset.addDatasource !== false" class="text-primary"
505
- type="button"
506
- @click="$refs.chooseDatasource.open()">
507
- Add Datasource
508
- </button>
509
- </div>
510
- <div class="flex flex-col mt-2">
511
- <ListItem :items="selectedPreset.datasource"
512
- class="bg-transparent"
513
- container-class="flex flex-col gap-1">
514
- <template v-slot="{ item, index }">
515
- <div class="flex flex-row items-center gap-3 p-3 bg-base-500 hover:bg-text-50 rounded-lg">
516
- <div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden cursor-pointer"
517
- @click="cConfig.selectedDatasource = item.uid">
518
- {{ item.name }}
519
- </div>
520
- <button v-if="!selectedPreset.readonly" :ref="`datasourceOpt${index}`" type="button"
521
- @click="$refs.datasourceMenu.open($refs[`datasourceOpt${index}`], { index, uid:item.uid })">
522
- <svg class="fill-text-300 hover:fill-primary" height="14" viewBox="0 0 512 512"
523
- width="14" xmlns="http://www.w3.org/2000/svg">
524
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
525
- <path
526
- 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"/>
527
- </svg>
528
- </button>
529
- </div>
530
- </template>
531
- </ListItem>
532
- </div>
533
- <ContextMenu ref="datasourceMenu" position="bottom-right">
534
- <template #default="{ context }">
535
- <div class="flex flex-col min-w-[200px]">
536
-
537
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
538
- @click="cConfig.selectedDatasource = context.uid">
539
- <div class="w-[30px]">
540
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
541
- xmlns="http://www.w3.org/2000/svg">
542
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
543
- <path
544
- d="M495.6 49.23l-32.82-32.82C451.8 5.471 437.5 0 423.1 0c-14.33 0-28.66 5.469-39.6 16.41L167.5 232.5C159.1 240 154.8 249.5 152.4 259.8L128.3 367.2C126.5 376.1 133.4 384 141.1 384c.916 0 1.852-.0918 2.797-.2813c0 0 74.03-15.71 107.4-23.56c10.1-2.377 19.13-7.459 26.46-14.79l217-217C517.5 106.5 517.4 71.1 495.6 49.23zM461.7 94.4L244.7 311.4C243.6 312.5 242.5 313.1 241.2 313.4c-13.7 3.227-34.65 7.857-54.3 12.14l12.41-55.2C199.6 268.9 200.3 267.5 201.4 266.5l216.1-216.1C419.4 48.41 421.6 48 423.1 48s3.715 .4062 5.65 2.342l32.82 32.83C464.8 86.34 464.8 91.27 461.7 94.4zM424 288c-13.25 0-24 10.75-24 24v128c0 13.23-10.78 24-24 24h-304c-13.22 0-24-10.77-24-24v-304c0-13.23 10.78-24 24-24h144c13.25 0 24-10.75 24-24S229.3 64 216 64L71.1 63.99C32.31 63.99 0 96.29 0 135.1v304C0 479.7 32.31 512 71.1 512h303.1c39.69 0 71.1-32.3 71.1-72L448 312C448 298.8 437.3 288 424 288z"/>
545
- </svg>
546
- </div>
547
- Edit
548
- </button>
549
-
550
- <button v-if="!selectedPreset.readonly" :class="appStyle.menuItem"
551
- class="w-full p-3 text-left flex flex-row items-center"
552
- @click="duplicateDatasource(context.index)">
553
- <div class="w-[30px]">
554
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
555
- xmlns="http://www.w3.org/2000/svg">
556
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
557
- <path
558
- d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/>
559
- </svg>
560
- </div>
561
- Duplicate
562
- </button>
563
-
564
- <button v-if="!selectedPreset.readonly" :class="appStyle.menuItem"
565
- class="w-full p-3 text-left flex flex-row items-center"
566
- @click="removeDatasource(context.index)">
567
- <div class="w-[30px]">
568
- <svg class="fill-text-300" height="16" viewBox="0 0 320 512" width="16"
569
- xmlns="http://www.w3.org/2000/svg">
570
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
571
- <path
572
- 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"/>
573
- </svg>
574
- </div>
575
- Remove
576
- </button>
577
-
578
- </div>
579
- </template>
580
- </ContextMenu>
581
- </div>
582
-
583
- <div v-else-if="selectedPresetParams.tabIndex === 3" class="p-5">
584
- <div class="flex flex-row gap-2">
585
- <label class="flex-1">Sharing</label>
586
- <button class="text-primary" type="button"
587
- @click="$refs.sharingModal.open([], { callback:addSharing })">
588
- Share
589
- </button>
590
-
591
- <SharingModal ref="sharingModal" :src="sharingSrc"/>
592
- </div>
593
- <div class="flex flex-col gap-1 mt-2">
594
- <div v-for="(item, index) in selectedPreset.shared"
595
- class="bg-base-500 hover:bg-text-50 p-3 rounded-lg flex flex-row gap-2 items-center gap-1">
596
- <div class="flex-1 flex flex-row items-center cursor-default gap-2">
597
- <svg class="fill-text-200" height="14" viewBox="0 0 448 512" width="14"
598
- xmlns="http://www.w3.org/2000/svg">
599
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
600
- <path
601
- d="M224 256c70.7 0 128-57.31 128-128s-57.3-128-128-128C153.3 0 96 57.31 96 128S153.3 256 224 256zM274.7 304H173.3C77.61 304 0 381.6 0 477.3c0 19.14 15.52 34.67 34.66 34.67h378.7C432.5 512 448 496.5 448 477.3C448 381.6 370.4 304 274.7 304z"/>
602
- </svg>
603
- {{ item.user?.name ?? item.userId }}
604
- </div>
605
- <button type="button" @click="removeSharing(item, index)">
606
- <svg class="fill-text-300 hover:fill-red-600" height="14" viewBox="0 0 320 512"
607
- width="14" xmlns="http://www.w3.org/2000/svg">
608
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
609
- <path
610
- 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"/>
611
- </svg>
612
- </button>
613
- </div>
614
- </div>
615
- </div>
616
-
617
- </div>
618
-
619
- </div>
620
-
621
- <div v-else class="flex-1 flex flex-col">
622
- <div class="p-5 px-6 flex flex-row items-start gap-2">
623
- <div class="flex-1">
624
- <h5>{{ title }}</h5>
625
- </div>
626
- <button v-if="hasPresets" type="button" @click="addPreset">
627
- <svg class="fill-primary" height="19" viewBox="0 0 448 512" width="19" xmlns="http://www.w3.org/2000/svg">
628
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
629
- <path
630
- d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/>
631
- </svg>
632
- </button>
633
- </div>
634
-
635
- <div v-if="hasPresets" class="flex-1 overflow-y-auto flex flex-col gap-5 px-3 my-5">
636
-
637
- <div v-if="(presets ?? []).length > 0">
638
- <div class="p-3">
639
- <label class="text-text-400">Views</label>
640
- </div>
641
-
642
- <ListItem :items="presets">
643
- <template v-slot="{ item, index }">
644
- <div :class="$style.listMenu">
645
- <Radio :checked="item.uid === cConfigParams.viewedUid" class="flex-1 py-3"
646
- @click="(e) => e.shiftKey ? openPreset(item.uid) : selectPreset(item.uid)">
647
- {{ item.name }}
648
- </Radio>
649
- <button :ref="`presetItemBtn${index}`"
650
- type="button"
651
- :class="$style.listBtn"
652
- @click="$refs.presetItemMenu.open($refs[`presetItemBtn${index}`], { item, index })">
653
- <svg class="fill-text-300 hover:fill-primary" height="14" viewBox="0 0 128 512"
654
- width="14" xmlns="http://www.w3.org/2000/svg">
655
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
656
- <path
657
- d="M128 64c0-35.39-28.62-64-64-64S0 28.61 0 64s28.62 64 64 64S128 99.39 128 64zM128 256c0-35.39-28.62-64-64-64S0 220.6 0 256s28.62 64 64 64S128 291.4 128 256zM128 448c0-35.39-28.62-64-64-64s-64 28.61-64 64s28.62 64 64 64S128 483.4 128 448z"/>
658
- </svg>
659
- </button>
660
- </div>
661
- </template>
662
- </ListItem>
663
-
664
- <ContextMenu ref="presetItemMenu" position="bottom-right">
665
- <template #default="{ context }">
666
- <div v-if="!context?.sharing" class="flex flex-col min-w-[200px] divide-y divide-border-50">
667
-
668
- <div class="divide-y divide-border-50">
669
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
670
- @click="openPreset(context.item.uid)">
671
- <div class="w-[30px]">
672
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
673
- xmlns="http://www.w3.org/2000/svg">
674
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
675
- <path
676
- d="M256 0C114.6 0 0 114.6 0 255.1S114.6 512 255.1 512S512 397.4 512 256S397.4 0 256 0zM210.8 368.1c-22.25 5.24-71.61 15.71-71.61 15.71c-.6309 .127-1.22 .1499-1.83 .1499c-5.711 0-10.33-5.232-9.151-11.13l16.1-71.61c1.551-6.895 5.027-13.21 10.03-18.21l101-101l74.67 74.67l-101.6 101.6C223.5 363.1 217.5 366.5 210.8 368.1zM373.1 213.6l-20.45 20.45l-74.67-74.67l20.4-20.4C305.7 131.6 315.2 128 324.8 128c9.553 0 19.11 3.646 26.4 10.94l21.88 21.88C387.6 175.4 387.7 198.1 373.1 213.6z"/>
677
- </svg>
678
- </div>
679
- Edit
680
- </button>
681
-
682
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
683
- @click="duplicate(context.item)">
684
- <div class="w-[30px]">
685
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
686
- xmlns="http://www.w3.org/2000/svg">
687
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
688
- <path
689
- d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/>
690
- </svg>
691
- </div>
692
- Duplicate
693
- </button>
694
- </div>
695
-
696
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
697
- @click="confirm('Remove this preset?', () => removePreset(context.item))">
698
- <div class="w-[30px]">
699
- <svg class="fill-text-300" height="16" viewBox="0 0 320 512" width="16"
700
- xmlns="http://www.w3.org/2000/svg">
701
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
702
- <path
703
- 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"/>
704
- </svg>
705
- </div>
706
- Remove
707
- </button>
708
- </div>
709
-
710
- <div v-else>
711
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
712
- @click="openPreset(context.item.uid)">
713
- <div class="w-[30px]">
714
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
715
- xmlns="http://www.w3.org/2000/svg">
716
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
717
- <path
718
- d="M256 0C114.6 0 0 114.6 0 255.1S114.6 512 255.1 512S512 397.4 512 256S397.4 0 256 0zM210.8 368.1c-22.25 5.24-71.61 15.71-71.61 15.71c-.6309 .127-1.22 .1499-1.83 .1499c-5.711 0-10.33-5.232-9.151-11.13l16.1-71.61c1.551-6.895 5.027-13.21 10.03-18.21l101-101l74.67 74.67l-101.6 101.6C223.5 363.1 217.5 366.5 210.8 368.1zM373.1 213.6l-20.45 20.45l-74.67-74.67l20.4-20.4C305.7 131.6 315.2 128 324.8 128c9.553 0 19.11 3.646 26.4 10.94l21.88 21.88C387.6 175.4 387.7 198.1 373.1 213.6z"/>
719
- </svg>
720
- </div>
721
- Open
722
- </button>
723
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
724
- @click="duplicate(context.item)">
725
- <div class="w-[30px]">
726
- <svg class="fill-text-300" height="16" viewBox="0 0 512 512" width="16"
727
- xmlns="http://www.w3.org/2000/svg">
728
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
729
- <path
730
- d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/>
731
- </svg>
732
- </div>
733
- Duplicate
734
- </button>
735
- <button :class="appStyle.menuItem" class="w-full p-3 text-left flex flex-row items-center"
736
- @click="removeShared(context.item, context.index)">
737
- <div class="w-[30px]">
738
- <svg class="fill-text-300" height="16" viewBox="0 0 320 512" width="16"
739
- xmlns="http://www.w3.org/2000/svg">
740
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
741
- <path
742
- 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"/>
743
- </svg>
744
- </div>
745
- Remove
746
- </button>
747
- </div>
748
- </template>
749
- </ContextMenu>
750
- </div>
751
-
752
- <div v-if="(sharedPresets ?? []).length > 0">
753
- <div class="px-3">
754
- <label class="text-text-400">Shared</label>
755
- </div>
756
-
757
- <ListItem :items="sharedPresets"
758
- class="bg-transparent">
759
- <template v-slot="{ item, index }">
760
- <div :class="$style.listMenu">
761
- <Radio :checked="item.uid === cConfigParams.viewedUid" class="flex-1 py-3"
762
- @click="(e) => e.shiftKey ? openPreset(item.uid) : selectPreset(item.uid)">
763
- {{ item.name }}
764
- </Radio>
765
- <button :ref="`sharedPresetItemBtn${index}`"
766
- type="button"
767
- :class="$style.listBtn"
768
- @click="$refs.contextMenu2.open($refs[`sharedPresetItemBtn${index}`], { item, index, sharing:true })">
769
- <svg class="fill-text-300 hover:fill-primary" height="14" viewBox="0 0 128 512"
770
- width="14" xmlns="http://www.w3.org/2000/svg">
771
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
772
- <path
773
- d="M128 64c0-35.39-28.62-64-64-64S0 28.61 0 64s28.62 64 64 64S128 99.39 128 64zM128 256c0-35.39-28.62-64-64-64S0 220.6 0 256s28.62 64 64 64S128 291.4 128 256zM128 448c0-35.39-28.62-64-64-64s-64 28.61-64 64s28.62 64 64 64S128 483.4 128 448z"/>
774
- </svg>
775
- </button>
776
- </div>
777
- </template>
778
- </ListItem>
779
-
780
- <ContextMenu ref="contextMenu2" position="bottom-right">
781
- <template #default="{ context }">
782
- <div class="flex flex-col min-w-[200px] divide-y divide-border-50">
783
-
784
- <button class="w-full p-3 text-left flex flex-row gap-3" :class="appStyle.menuItem"
785
- @click="duplicate(context.item)">
786
- <div class="w-[24px]">
787
- <svg width="16" height="16" class="mx-auto fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg>
788
- </div>
789
- Duplicate
790
- </button>
791
-
792
- <button class="w-full p-3 text-left flex flex-row gap-3 text-red-500" :class="appStyle.menuItem"
793
- @click="removeShared(context.item, context.index)">
794
- <div class="w-[24px]">
795
- <svg width="19" height="19" class="mx-auto fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M469.65 181.65l-11.31-11.31c-6.25-6.25-16.38-6.25-22.63 0L384 222.06l-51.72-51.72c-6.25-6.25-16.38-6.25-22.63 0l-11.31 11.31c-6.25 6.25-6.25 16.38 0 22.63L350.06 256l-51.72 51.72c-6.25 6.25-6.25 16.38 0 22.63l11.31 11.31c6.25 6.25 16.38 6.25 22.63 0L384 289.94l51.72 51.72c6.25 6.25 16.38 6.25 22.63 0l11.31-11.31c6.25-6.25 6.25-16.38 0-22.63L417.94 256l51.72-51.72c6.24-6.25 6.24-16.38-.01-22.63zM576 64H205.26C188.28 64 172 70.74 160 82.74L9.37 233.37c-12.5 12.5-12.5 32.76 0 45.25L160 429.25c12 12 28.28 18.75 45.25 18.75H576c35.35 0 64-28.65 64-64V128c0-35.35-28.65-64-64-64zm16 320c0 8.82-7.18 16-16 16H205.26c-4.27 0-8.29-1.66-11.31-4.69L54.63 256l139.31-139.31c3.02-3.02 7.04-4.69 11.31-4.69H576c8.82 0 16 7.18 16 16v256z"/></svg>
796
- </div>
797
- Remove
798
- </button>
799
-
800
- </div>
801
- </template>
802
- </ContextMenu>
803
- </div>
804
-
805
-
806
- </div>
807
- <div v-else class="flex-1 flex items-center justify-center">
808
- <button class="cursor-pointer flex flex-col gap-1 items-center"
809
- type="button"
810
- @click="addPreset">
811
- <svg class="fill-primary" height="32" viewBox="0 0 448 512" width="32" xmlns="http://www.w3.org/2000/svg">
812
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
813
- <path
814
- d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/>
815
- </svg>
816
- Create New Preset
817
- </button>
818
- </div>
819
-
820
- </div>
821
-
822
- </TransitionGroup>
823
-
824
- <div :class="$style.resize1"
825
- @mousedown="(e) => $util.dragResize(e, resize1)"></div>
826
- </div>
827
-
828
- <div v-if="readyState === 0" class="flex-1 flex items-center justify-center">
829
- <svg class="animate-spin aspect-square w-[64px] h-[64px]" fill="none" viewBox="0 0 24 24"
830
- xmlns="http://www.w3.org/2000/svg">
831
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
832
- <path class="opacity-75" 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"
833
- fill="currentColor"></path>
834
- </svg>
835
- </div>
836
-
837
- <div v-else-if="viewedPreset" class="flex-1 px-8 py-5 overflow-y-auto flex flex-col gap-6">
838
-
839
- <div ref="title" class="flex flex-row gap-2 md:gap-2 items-center">
840
- <button :class="sidebar.open ? 'bg-primary' : ''"
841
- class="p-2 rounded-xl"
842
- type="button"
843
- @click="sidebar.open = !sidebar.open">
844
- <svg :class="sidebar.open ? 'fill-white' : 'fill-white hover:fill-primary'" height="21" viewBox="0 0 512 512"
845
- width="21" xmlns="http://www.w3.org/2000/svg">
846
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
847
- <path
848
- d="M480 384H249.2C236.9 355.8 208.8 336 176 336S115.1 355.8 102.8 384H32c-17.67 0-32 14.33-32 32s14.33 32 32 32h70.75C115.1 476.2 143.2 496 176 496s60.89-19.77 73.25-48H480c17.67 0 32-14.33 32-32S497.7 384 480 384zM176 448c-17.64 0-32-14.36-32-32s14.36-32 32-32s32 14.36 32 32S193.6 448 176 448zM480 224h-70.75C396.9 195.8 368.8 176 336 176S275.1 195.8 262.8 224H32C14.33 224 0 238.3 0 256s14.33 32 32 32h230.8C275.1 316.2 303.2 336 336 336s60.89-19.77 73.25-48H480c17.67 0 32-14.33 32-32S497.7 224 480 224zM336 288c-17.64 0-32-14.36-32-32s14.36-32 32-32s32 14.36 32 32S353.6 288 336 288zM32 128h102.8C147.1 156.2 175.2 176 208 176s60.89-19.77 73.25-48H480c17.67 0 32-14.33 32-32s-14.33-32-32-32h-198.8C268.9 35.77 240.8 16 208 16S147.1 35.77 134.8 64H32C14.33 64 0 78.33 0 96S14.33 128 32 128zM208 64c17.64 0 32 14.36 32 32s-14.36 32-32 32s-32-14.36-32-32S190.4 64 208 64z"/>
849
- </svg>
850
- </button>
851
-
852
- <div class="flex flex-col whitespace-nowrap text-ellipsis overflow-hidden">
853
- <div class="cursor-pointer group px-2 md:px-0"
854
- @click="!sidebar.open ? $refs.contextMenu.open($refs.title) : null">
855
- <small class="text-text-400 text-xs">{{ title ?? 'Untitled' }}</small>
856
- <div class="flex flex-row items-baseline gap-1">
857
- <h5 :class="!sidebar.open ? 'group-hover:text-primary' : ''"
858
- class="whitespace-nowrap relative top-[-2px] text-ellipsis overflow-hidden">
859
- {{ viewedPreset.name ?? 'Preset Name' }}
860
- </h5>
861
- <svg v-if="!sidebar.open" class="fill-text group-hover:fill-primary relative top-[-1px]" height="13"
862
- viewBox="0 0 320 512" width="13"
863
- xmlns="http://www.w3.org/2000/svg">
864
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
865
- <path
866
- d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/>
867
- </svg>
868
- </div>
869
- </div>
870
- <ContextMenu ref="contextMenu" class="panel-400">
871
- <div class="flex flex-col min-w-[300px] divide-y divide-border-50">
872
-
873
- <div class="p-3 flex flex-col gap-1 bg-base-300">
874
- <button v-for="(preset, idx) in presets"
875
- :class="config.presetIdx === idx ? 'bg-primary-200 text-white' : 'hover:bg-primary-100'"
876
- class="p-2 px-5 text-left flex flex-row items-center rounded-md"
877
- type="button"
878
- @click="selectPreset(preset.uid)">
879
- <label class="flex-1 pr-12">
880
- {{ preset.name }}
881
- </label>
882
- <div class="p-1">
883
- <div v-if="idx < 10"
884
- class="border-[1px] border-text-300 px-2 text-mono text-xs text-text-400 rounded-lg">
885
- Alt {{ idx + 1 }}
886
- </div>
887
- </div>
888
- </button>
889
- </div>
890
-
891
- <div class="px-3">
892
- <button class="text-primary p-5 text-left w-full" type="button" @click="openPreset">Edit</button>
893
- </div>
894
-
895
- </div>
896
- </ContextMenu>
897
- </div>
898
-
899
- <div v-if="Object.keys(queryFilters).length > 0" class="flex-1 flex justify-end">
900
- <div
901
- class="flex flex-row gap-3 items-start bg-primary-50 p-2 border-[1px] border-primary rounded-xl pl-3 min-w-[240px]">
902
- <div v-for="(arr, uid) in queryFilters" class="cursor-default flex-1">
903
- <div class="text-sm text-text-400">{{ viewedPreset.datasource.find(_ => _.uid === uid)?.name }}</div>
904
- <div>
905
- <div v-for="filter in arr" class="flex flex-row gap-2">
906
- <div>{{ filter.key }}</div>
907
- <div>{{ filter.operator }}</div>
908
- <div>{{ filter.value }}</div>
909
- </div>
910
- </div>
911
- </div>
912
- <button type="button" @click="removeQueryFilter">
913
- <svg class="fill-text-300 hover:fill-red-600" height="16" viewBox="0 0 320 512" width="16"
914
- xmlns="http://www.w3.org/2000/svg">
915
- <!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
916
- <path
917
- 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"/>
918
- </svg>
919
- </button>
920
- </div>
921
- </div>
922
- </div>
923
-
924
- <div class="flex flex-col gap-6">
925
-
926
- <component :is="component?.type"
927
- v-for="component in viewedComponents"
928
- :="component"/>
929
-
930
- </div>
931
-
932
- </div>
933
-
934
- <DatasourceSelector ref="chooseDatasource"
935
- :list-src="datasourceListSrc"
936
- :src="datasourceSrc"
937
- @add="addDatasource"/>
938
-
939
- <ViewSelector ref="chooseView"/>
940
-
941
- <DatasourcePreview ref="datasourcePreview" :src="previewSrc"/>
942
-
943
- </div>
944
- </template>
945
-
946
- <script>
947
-
948
- import {defineAsyncComponent} from "vue";
949
- import {generatePivotColumns, getPresetUid} from "../utils/preset-selector.mjs";
950
- import {invokeAfterIdle} from "../utils/helpers.mjs";
951
- import {useEmitter} from "../utils/event-bus";
952
-
953
- const findComponents = (items, uid) => {
954
- if (!Array.isArray(items)) return
955
-
956
- for (let item of items) {
957
- if (item.uid === uid)
958
- return item
959
-
960
- if (item.items) {
961
- const component = findComponents(item.items, uid)
962
- if (component)
963
- return component
964
- }
965
- }
966
- }
967
-
968
- export default {
969
-
970
- components: {
971
- VirtualColumnEdit: defineAsyncComponent(() => import('./Dashboard/VirtualColumnEdit.vue')),
972
- DatasourceFilterSharing: defineAsyncComponent(() => import('./Dashboard/DatasourceFilterSharing.vue')),
973
- PresetBarPivot: defineAsyncComponent(() => import('../widgets/PresetBarPivot.vue')),
974
- DatasourcePreview: defineAsyncComponent(() => import('./Dashboard/DatasourcePreview.vue')),
975
- PresetSelectorFilterItem: defineAsyncComponent(() => import('../components/PresetSelectorFilterItem.vue')),
976
- SharingModal: defineAsyncComponent(() => import('./Dashboard/SharingModal.vue')),
977
- DoughnutSetting: defineAsyncComponent(() => import('./Dashboard/DoughnutSetting.vue')),
978
- GridSetting: defineAsyncComponent(() => import('./WebPageBuilder4/GridSetting.vue')),
979
- MarginSetting: defineAsyncComponent(() => import('./WebPageBuilder4/MarginSetting.vue')),
980
- PaddingSetting: defineAsyncComponent(() => import('./WebPageBuilder4/PaddingSetting.vue')),
981
- MultiValueSetting: defineAsyncComponent(() => import('./WebPageBuilder4/MultiValueSetting.vue')),
982
- BarChartSetting: defineAsyncComponent(() => import('./Dashboard/BarChartSetting.vue')),
983
- MetricSetting: defineAsyncComponent(() => import('./Dashboard/MetricSetting.vue')),
984
- GHeatMapsSetting: defineAsyncComponent(() => import('./Dashboard/GHeatMapsSetting.vue')),
985
- DataTableSetting: defineAsyncComponent(() => import('./Dashboard/DataTableSetting.vue')),
986
- VirtualTableSetting: defineAsyncComponent(() => import('./Dashboard/VirtualTableSetting.vue')),
987
- PieSetting: defineAsyncComponent(() => import('./Dashboard/PieSetting.vue')),
988
- PolarAreaSetting: defineAsyncComponent(() => import('./Dashboard/PolarAreaSetting.vue')),
989
- TreeView: defineAsyncComponent(() => import('./WebPageBuilder4/TreeView.vue')),
990
- ViewSelector: defineAsyncComponent(() => import('./Dashboard/ViewSelector.vue')),
991
- DatasourceSelector: defineAsyncComponent(() => import('./Dashboard/DatasourceSelector.vue'))
992
- },
993
-
994
- computed: {
995
-
996
- cConfig() {
997
- if (!this.config.viewType)
998
- this.config.viewType = 'md:'
999
-
1000
- return this.config
1001
- },
1002
-
1003
- cConfigParams() {
1004
- if(!this.cConfig.params)
1005
- this.cConfig.params = {}
1006
-
1007
- return this.cConfig.params
1008
- },
1009
-
1010
- componentsConfig() {
1011
- if (!this.cConfig.components)
1012
- this.cConfig.components = {}
1013
- return this.cConfig.components
1014
- },
1015
-
1016
- datasourceTabs() {
1017
- return [
1018
- {text: "Columns", value: 1},
1019
- {text: "Filters", value: 2},
1020
- {text: "Sorts", value: 3},
1021
- this.selectedDatasource?.pivot !== false ? {text: "Pivots", value: 4} : null,
1022
- ]
1023
- .filter(_ => _)
1024
- },
1025
-
1026
- hasPresets() {
1027
- return (this.presets ?? []).length > 0 ||
1028
- (this.sharedPresets ?? []).length > 0
1029
- },
1030
-
1031
- presets(){
1032
- if(!Array.isArray(this.config.presets)){
1033
- this.config.presets = []
1034
- }
1035
-
1036
- return this.config.presets
1037
- },
1038
-
1039
- presetTabs(){
1040
- return [
1041
- { text:"Datasource", value:2 },
1042
- { text:"Views", value:1 },
1043
- !!this.sharingSrc ? { text:"Share", value:3 } : null,
1044
- ]
1045
- .filter(_ => _)
1046
- },
1047
-
1048
- sharedPresets(){
1049
- if(!Array.isArray(this.config.sharedPresets)){
1050
- this.config.sharedPresets = []
1051
- }
1052
-
1053
- return this.config.sharedPresets
1054
- },
1055
-
1056
- selectedDatasource() {
1057
- const datasource = this.selectedPreset?.datasource[this.selectedPreset.datasource.findIndex(_ => _.uid === this.cConfig.selectedDatasource)]
1058
-
1059
- if (datasource) {
1060
- if (!datasource.tabIndex) datasource.tabIndex = 2
1061
-
1062
- }
1063
-
1064
- return datasource
1065
- },
1066
-
1067
- selectedDatasourceFilterColumns() {
1068
- if (!this.selectedDatasource) return []
1069
-
1070
- return this.selectedDatasource.columns.filter(_ => {
1071
- return _.filterable !== false
1072
- })
1073
- },
1074
-
1075
- selectedDatasourceSortColumns() {
1076
- if (!this.selectedDatasource) return []
1077
-
1078
- return this.selectedDatasource.columns.filter(_ => _.key && !_.key.startsWith('_'))
1079
- },
1080
-
1081
- selectedDatasourcePivotColumns() {
1082
- if (!this.selectedDatasource) return []
1083
- return this.selectedDatasource.columns.filter(_ => {
1084
- return _.pivot !== false
1085
- })
1086
- },
1087
-
1088
- selectedDatasourcePivot() {
1089
- if (!this.selectedDatasource) return
1090
-
1091
- if (!this.selectedDatasource.pivot)
1092
- this.selectedDatasource.pivot = {rows: [], columns: [], values: []}
1093
-
1094
- return this.selectedDatasource.pivot
1095
- },
1096
-
1097
- selectedDatasourceColumns(){
1098
- return this.selectedDatasource?.columns.filter(column => {
1099
- if(this.datasourceColumnSearch)
1100
- return column.key.toLowerCase().includes(this.datasourceColumnSearch.toLowerCase())
1101
- return true
1102
- })
1103
- },
1104
-
1105
- selectedDatasourceComputedColumns(){
1106
- return this.selectedDatasource?.computedColumns?.filter(column => {
1107
- if(this.datasourceColumnSearch)
1108
- return column.key.toLowerCase().includes(this.datasourceColumnSearch.toLowerCase())
1109
- return true
1110
- })
1111
- },
1112
-
1113
- selectedPreset() {
1114
- if(!Array.isArray(this.presets)) return
1115
-
1116
- const preset = this.presets[this.presets.findIndex(_ => _.uid === this.cConfig.params.selectedUid)] ??
1117
- this.sharedPresets[this.sharedPresets.findIndex(_ => _.uid === this.cConfig.params.selectedUid)]
1118
- if(!preset) return
1119
-
1120
- if (!Array.isArray(preset.datasource))
1121
- preset.datasource = []
1122
-
1123
- if (!Array.isArray(preset.views))
1124
- preset.views = []
1125
-
1126
- if(!preset.params)
1127
- preset.params = {}
1128
-
1129
- if(!preset.params.tabIndex)
1130
- preset.params.tabIndex = 2
1131
-
1132
- return preset
1133
- },
1134
-
1135
- selectedPresetParams(){
1136
- if(!this.selectedPreset) return
1137
-
1138
- if(!this.selectedPreset.params)
1139
- this.selectedPreset.params = {}
1140
-
1141
- return this.selectedPreset.params
1142
- },
1143
-
1144
- selectedView() {
1145
- return findComponents(this.selectedPreset?.views, this.cConfig.selectedView)
1146
- },
1147
-
1148
- sidebar() {
1149
- if (!this.cConfig.sidebar || !('open' in this.cConfig.sidebar))
1150
- this.cConfig.sidebar = {
1151
- open: true,
1152
- width: 360
1153
- }
1154
-
1155
- return this.cConfig.sidebar
1156
- },
1157
-
1158
- sidebarStyle() {
1159
- return {
1160
- width: !this.sidebar.open ? 0 : this.sidebar.width + 'px'
1161
- }
1162
- },
1163
-
1164
- viewedPreset() {
1165
- if(!Array.isArray(this.presets)) return
1166
-
1167
- return this.presets[this.presets.findIndex(_ => _.uid === this.cConfigParams.viewedUid)]
1168
- ??
1169
- this.sharedPresets[this.sharedPresets.findIndex(_ => _.uid === this.cConfigParams.viewedUid)]
1170
- },
1171
-
1172
- viewedComponents() {
1173
- if (!this.viewedPreset || !this.viewedPreset.views) return []
1174
-
1175
- return this.viewedPreset.views
1176
- .map(_ => this.createComponentInstance(_))
1177
- .filter(_ => _)
1178
- },
1179
-
1180
- viewTypeIndex() {
1181
- return this.viewTypes.findIndex(v => v.value === this.cConfig.viewType)
1182
- },
1183
-
1184
- queryFilters() {
1185
-
1186
- const filters = {}
1187
- for (let key in this.$route.query) {
1188
- if (key.indexOf(`.filters.`) > 0) {
1189
- const [uid, _, filterKey, filterOperator] = key.split('.')
1190
- const value = this.$route.query[key]
1191
-
1192
- if (!filters[uid])
1193
- filters[uid] = []
1194
-
1195
- filters[uid].push({
1196
- key: filterKey,
1197
- operator: filterOperator,
1198
- value
1199
- })
1200
- }
1201
- }
1202
-
1203
- return filters
1204
- },
1205
-
1206
- src(){ return `${this.controller}.load` },
1207
-
1208
- presetSrc(){ return `${this.controller}.preset` },
1209
-
1210
- datasourceSrc(){ return `${this.controller}.load-datasource` },
1211
-
1212
- datasourceListSrc(){ return `/datasource` },
1213
-
1214
- previewSrc(){ return `${this.controller}.preview` },
1215
-
1216
- sharingSrc(){ return `${this.controller}.load-sharing` },
1217
-
1218
- removeSharingSrc(){ return `${this.controller}.remove-shared` },
1219
-
1220
- },
1221
-
1222
- data() {
1223
- return {
1224
- compClasses: [
1225
- 'aspectRatio', 'position', 'left', 'top', 'right', 'bottom',
1226
-
1227
- 'bdSize', 'bdColor', 'bdRadius', 'bdStyle',
1228
- 'divideSize', 'divideColor', 'divideStyle',
1229
- 'outlineWidth', 'outlineColor', 'outlineStyle',
1230
- 'bgColors', 'bgSize', 'bgPosition', 'bgRepeat',
1231
- 'textAlign', 'verticalAlign',
1232
- 'gap',
1233
- 'padding', 'margin',
1234
- 'direction', 'columns', 'rows', 'display', 'wrap',
1235
- 'width', 'minWidth', 'maxWidth',
1236
- 'height', 'minHeight', 'maxHeight',
1237
- 'fontFamily', 'fontSize', 'fontWeight', 'textColor', 'lineHeight', 'overflow',
1238
- 'textTransform', 'whitespace', 'textOverflow', 'textDecoration',
1239
- 'boxShadow', 'opacity',
1240
- 'colSpan', 'rowSpan',
1241
- 'flex', 'flexAlign', 'flexJustify', 'flexBasis', 'flexColumns', 'flexWrap',
1242
- 'flexDirection',
1243
- 'zIndex',
1244
-
1245
- 'autoFlow', 'alignItems', 'justifyContent',
1246
- 'letterSpacing', 'lineClamp',
1247
-
1248
- 'animate',
1249
-
1250
- 'blur', 'grayscale',
1251
- ],
1252
- containerClasses: [
1253
- 'containerVariant', 'containerGridColumn', 'containerGap'
1254
- ],
1255
- itemClasses: [
1256
- 'itemMinWidth', 'itemRatio', 'itemVariant'
1257
- ],
1258
-
1259
- data: {},
1260
-
1261
- initialConfig: null,
1262
-
1263
- datasourceColumnSearch: '',
1264
-
1265
- enumCache: {},
1266
-
1267
- previewData: null,
1268
-
1269
- readyState: 1,
1270
-
1271
- selectedViewUid: null,
1272
-
1273
- viewTypes: [
1274
- {text: 'Mobile', value: ''},
1275
- {text: 'Tablet', value: 'md:'},
1276
- {text: 'Desktop', value: 'xl:'},
1277
- {text: 'TV', value: '2xl:'},
1278
- ],
1279
-
1280
- values: {},
1281
-
1282
- presetNameChanging: null
1283
- }
1284
- },
1285
-
1286
- emits: ['change', 'save'],
1287
-
1288
- inject: ['alert', 'appStyle', 'confirm', 'socket'],
1289
-
1290
- methods: {
1291
-
1292
- addComputedColumns(column){
1293
- if(!Array.isArray(this.selectedDatasource.computedColumns))
1294
- this.selectedDatasource.computedColumns = []
1295
-
1296
- this.$util.push(this.selectedDatasource.computedColumns, column, { key: "key" })
1297
-
1298
- this.load()
1299
- },
1300
-
1301
- addDatasource(datasource) {
1302
- const newDatasource = JSON.parse(JSON.stringify(datasource))
1303
- delete newDatasource.id
1304
- newDatasource.datasourceUid = newDatasource.uid
1305
- newDatasource.uid = getPresetUid()
1306
- this.selectedPreset.datasource.push(newDatasource)
1307
- this.load()
1308
- },
1309
-
1310
- addFilter(filter) {
1311
- if (!Array.isArray(this.selectedDatasource.filters))
1312
- this.selectedDatasource.filters = []
1313
- this.selectedDatasource.filters.push({key: filter.key, value: [{}]})
1314
- this.onDatasourceFilterChanged()
1315
- },
1316
-
1317
- addPreset() {
1318
- if (!Array.isArray(this.presets))
1319
- this.presets = []
1320
-
1321
- const uid = getPresetUid()
1322
-
1323
- const newPreset = {
1324
- name: 'New Preset',
1325
- uid,
1326
- }
1327
- this.presets.push(newPreset)
1328
- this.cConfigParams.viewedUid = uid
1329
-
1330
- this.openPreset(newPreset.uid, {select: true})
1331
- },
1332
-
1333
- addSharing(item) {
1334
- const obj = {
1335
- key: this.presetKey,
1336
- presetUid: this.selectedPreset.uid,
1337
- userId: item.id
1338
- }
1339
-
1340
- this.socket.send(`${this.controller}.add-sharing`, obj)
1341
- .then(newItem => {
1342
- if (!Array.isArray(this.selectedPreset.shared))
1343
- this.selectedPreset.shared = []
1344
- this.$util.push(this.selectedPreset.shared, newItem, {key: "presetUid"})
1345
- })
1346
- },
1347
-
1348
- removeSharing(item, index) {
1349
- this.confirm('Remove shared?', () => {
1350
- this.socket.send(`${this.controller}.remove-sharing`, item)
1351
- .then(_ => {
1352
- this.selectedPreset.sharing.splice(index, 1)
1353
- })
1354
- })
1355
- },
1356
-
1357
- removeShared(item, index) {
1358
- this.confirm('Remove shared?', () => {
1359
- this.socket.send(`${this.controller}.remove-sharing`, item.UserConfigPresetShared)
1360
- .then(_ => {
1361
- this.sharedPresets.splice(index, 1)
1362
- })
1363
- })
1364
- },
1365
-
1366
- addSort(obj) {
1367
- if (!Array.isArray(this.selectedDatasource.sorts))
1368
- this.selectedDatasource.sorts = []
1369
- this.selectedDatasource.sorts.push(obj)
1370
- },
1371
-
1372
- addView(item, items, opt = {unshift: false}) {
1373
- items[opt?.unshift ? 'unshift' : 'push'](item)
1374
- if (item.openOnAdd !== false)
1375
- this.$nextTick(() => this.cConfig.selectedView = item.uid)
1376
- },
1377
-
1378
- createComponentInstance(component) {
1379
-
1380
- if (!component.uid) return
1381
- if (!component.props.enabled) return
1382
-
1383
- const compUid = '_' + component.uid.substring(0, 4) + ' '
1384
-
1385
- const instance = {
1386
- type: component.type,
1387
- uid: component.uid,
1388
-
1389
- class: compUid + this.compClasses.map(key => {
1390
- return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
1391
- })
1392
- .filter(_ => _)
1393
- .join(' '),
1394
-
1395
- containerClass: this.containerClasses.map(key => {
1396
- return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
1397
- })
1398
- .filter(_ => _)
1399
- .join(' '),
1400
-
1401
- itemClass: this.itemClasses.map(key => {
1402
- return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
1403
- })
1404
- .filter(_ => _)
1405
- .join(' ')
1406
- }
1407
-
1408
- for (let key in component.props) {
1409
- if (!this.compClasses.includes(key) &&
1410
- !this.containerClasses.includes(key) &&
1411
- !this.itemClasses.includes(key) &&
1412
- !['enabled'].includes(key)) {
1413
- instance[key] = component.props[key]
1414
- }
1415
- }
1416
-
1417
- const whitelistProps = [
1418
- 'column', 'datasourceUid', 'rows'
1419
- ]
1420
- whitelistProps.forEach((key) => {
1421
- if (component.props[key]) {
1422
- instance[key] = component.props[key]
1423
- }
1424
- })
1425
-
1426
- if (Array.isArray(component.items)) {
1427
- instance.items = component.items.map((_) => this.createComponentInstance(_)).filter(_ => _)
1428
- }
1429
-
1430
- if (this.values[instance.uid])
1431
- instance.value = this.values[instance.uid]
1432
-
1433
- return instance
1434
- },
1435
-
1436
- duplicate(preset) {
1437
-
1438
- const newPreset = JSON.parse(JSON.stringify(preset))
1439
- newPreset.uid = getPresetUid()
1440
- newPreset.name += '(Copy)'
1441
- delete newPreset.readonly
1442
- delete newPreset.sharing
1443
- this.presets.push(newPreset)
1444
-
1445
- this.$nextTick(() => {
1446
- this.cConfigParams.viewedUid = newPreset.uid
1447
- this.openPreset(newPreset.uid)
1448
- this.selectPreset(newPreset.uid)
1449
- this.savePreset()
1450
- })
1451
- },
1452
-
1453
- duplicateComponent(item, parent) {
1454
-
1455
- const recurseSet = (item) => {
1456
- item.uid = getPresetUid()
1457
-
1458
- if(Array.isArray(item.items)){
1459
- for(let subItem of item.items)
1460
- recurseSet(subItem)
1461
- }
1462
- }
1463
-
1464
- const index = parent.findIndex(_ => _ === item)
1465
-
1466
- const newItem = JSON.parse(JSON.stringify(item))
1467
- recurseSet(newItem)
1468
- newItem.name += ' (Copy)';
1469
-
1470
- parent.splice(index + 1, null, newItem)
1471
-
1472
- this.load({[newItem.uid]: {}})
1473
- },
1474
-
1475
- duplicateDatasource(index) {
1476
-
1477
- const newDatasource = JSON.parse(JSON.stringify(this.selectedPreset.datasource[index]))
1478
-
1479
- newDatasource.uid = getPresetUid()
1480
- newDatasource.name += ' (Copy)';
1481
-
1482
- this.selectedPreset.datasource.splice(index + 1, 0, newDatasource)
1483
- },
1484
-
1485
- emitRoot(name, component) {
1486
-
1487
- switch (name) {
1488
-
1489
- case 'scroll-end':
1490
- this.loadNext(component)
1491
- break
1492
-
1493
- }
1494
- },
1495
-
1496
- async load(uids) {
1497
- if(uids){
1498
- Object.keys(uids).forEach(uid => this.emitter.emit(`${uid}.load`))
1499
- }
1500
- else{
1501
- this.emitter.emit(`dashboard.load`)
1502
- }
1503
- },
1504
-
1505
- async loadNext(component) {
1506
- if (!this.values[component.uid]) return
1507
-
1508
- const {items} = this.values[component.uid]
1509
- const afterItem = items[items.length - 1]
1510
-
1511
- const views = this.recurseViews(this.viewedComponents, {[component.uid]: {afterItem}})
1512
-
1513
- const {name, datasource} = this.viewedPreset
1514
-
1515
- this.socket.send(this.src, {
1516
- name,
1517
- views,
1518
- datasource: datasource.map(_datasource => {
1519
- return {
1520
- ..._datasource,
1521
- filters: [
1522
- ...(_datasource.filters ?? []),
1523
- ...(this.queryFilters[_datasource.uid] ?? [])
1524
- ]
1525
- }
1526
- })
1527
- })
1528
- .then(_ => {
1529
- if(_[component.uid]){
1530
- const {items, hasNext} = _[component.uid]
1531
- this.values[component.uid].items.push(...items)
1532
- this.values[component.uid].hasNext = hasNext
1533
- }
1534
- })
1535
- },
1536
-
1537
- onDatasourceFilterChanged() {
1538
-
1539
- let datasourceFilterOK = true
1540
- for (let filter of this.selectedDatasource.filters) {
1541
- if (Array.isArray(filter.value)) {
1542
- for (let value of filter.value) {
1543
- for (let key in value) {
1544
- if (!value[key]) {
1545
- datasourceFilterOK = false
1546
- break
1547
- }
1548
- }
1549
- }
1550
- }
1551
-
1552
- if (!datasourceFilterOK) break
1553
- }
1554
-
1555
- if (datasourceFilterOK) {
1556
- this.load()
1557
- }
1558
- },
1559
-
1560
- openPreset(uid) {
1561
- this.cConfig.params.selectedUid = uid
1562
- },
1563
-
1564
- previewDatasource(datasource) {
1565
- this.$refs.datasourcePreview?.open(datasource)
1566
- },
1567
-
1568
- recurseViews(items, uids) {
1569
-
1570
- let results = []
1571
-
1572
- for (let item of items) {
1573
- if (item.datasourceUid && (!uids || uids[item.uid])) {
1574
-
1575
- const currentDatasource = this.viewedPreset.datasource.find(_ => _.uid === item.datasourceUid)
1576
-
1577
- if (currentDatasource) {
1578
- results.push({
1579
- type: item.type,
1580
- uid: item.uid,
1581
- ...item
1582
- })
1583
- }
1584
- }
1585
- else if (item.items) {
1586
- const subResults = this.recurseViews(item.items, uids)
1587
- results.push(...subResults)
1588
- }
1589
- }
1590
-
1591
- return results
1592
- },
1593
-
1594
- selectedDatasourceColumn(key) {
1595
- return this.selectedDatasource.columns.filter(_ => _.key === key).pop() ?? {}
1596
- },
1597
-
1598
- typeOf(type) {
1599
- if (['boolean'].includes(type))
1600
- return 'boolean'
1601
- else if (['date'].includes(type))
1602
- return 'date'
1603
- else if (['number'].includes(type))
1604
- return 'number'
1605
- else if (['enum'].includes(type))
1606
- return 'enum'
1607
- else
1608
- return 'text'
1609
- },
1610
-
1611
- removeDatasource(index) {
1612
- this.selectedPreset.datasource.splice(index, 1)
1613
- this.load()
1614
- },
1615
-
1616
- selectPreset(uid, params = {}) {
1617
- this.$router.push({
1618
- query: {
1619
- uid,
1620
- ...params
1621
- }
1622
- })
1623
- this.savePreset()
1624
- },
1625
-
1626
- resize1(w) {
1627
- if (this.sidebar.width + w >= 270 && this.sidebar.width + w <= 600) {
1628
- this.sidebar.width += w
1629
- }
1630
- },
1631
-
1632
- typeParamsOf(column) {
1633
- if (['enum'].includes(column.type)) {
1634
- return column.typeParams
1635
- }
1636
- return []
1637
- },
1638
-
1639
- getConfig() {
1640
- return this.cConfig
1641
- },
1642
-
1643
- getPresets() {
1644
- return this.presets
1645
- },
1646
-
1647
- removeQueryFilter() {
1648
-
1649
- const query = {}
1650
- for (let key in this.$route.query) {
1651
- if (key.indexOf('.filters.') < 0) {
1652
- query[key] = this.$route.query[key]
1653
- }
1654
- }
1655
-
1656
- this.$router.replace({query})
1657
- },
1658
-
1659
- async preview(datasource) {
1660
- return new Promise((resolve, reject) => {
1661
- this.socket.send(this.previewSrc, {datasource})
1662
- .then(res => {
1663
- this.previewData = res
1664
- resolve(res)
1665
- })
1666
- .catch(err => reject(err))
1667
- })
1668
- },
1669
-
1670
- updatePivot() {
1671
- this.preview(this.selectedDatasource)
1672
- .then(res => {
1673
- generatePivotColumns(this.selectedDatasource, res.items)
1674
- })
1675
- },
1676
-
1677
- async loadPreset(){
1678
- if(!Object.keys(this.$route.query).map(_ => _.toLowerCase()).includes('reset')) {
1679
- if(this.presetKey) {
1680
- return this.socket.send(this.presetSrc, { key:this.presetKey })
1681
- .then(async (config) => {
1682
- if(config){
1683
- Object.assign(this.config, config ?? {})
1684
-
1685
- /*if(this.$route.query?.search)
1686
- this.preset.search = this.$route.query.search*/
1687
- }
1688
- })
1689
- .catch(() => {})
1690
- }
1691
- }
1692
- else {
1693
- return new Promise((resolve) => {
1694
- const query = {}
1695
- for (let key in this.$route.query) {
1696
- if (key.toLowerCase() !== 'reset')
1697
- query[key] = this.$route.query[key]
1698
- }
1699
- this.$router.replace({
1700
- ...this.$route,
1701
- query
1702
- })
1703
-
1704
- resolve()
1705
- })
1706
- }
1707
- },
1708
-
1709
- savePreset: invokeAfterIdle(function(reset = false, preset = false){
1710
- if(!this.presetKey) return
1711
- if(!this.config) return
1712
-
1713
- return this.socket.send(this.presetSrc, {
1714
- key: this.presetKey,
1715
- config: this.config,
1716
- })
1717
- .catch(() => {})
1718
- }),
1719
-
1720
- async removePreset(preset){
1721
- return this.socket.send(this.presetSrc, {
1722
- key: this.presetKey,
1723
- removePreset: preset
1724
- })
1725
- .then(_ => {
1726
- this.presets.splice(this.presets.findIndex(_ => _.uid === preset.uid), 1)
1727
- })
1728
- .catch(() => {})
1729
- },
1730
-
1731
- },
1732
-
1733
- mounted() {
1734
- this.loadPreset()
1735
- .then(_ => this.load())
1736
- },
1737
-
1738
- props: {
1739
-
1740
- config: Object,
1741
- defaultConfig: Function,
1742
- presetKey: String,
1743
-
1744
- controller: {
1745
- type: String,
1746
- required: true
1747
- },
1748
-
1749
-
1750
- title: String,
1751
-
1752
- },
1753
-
1754
- provide() {
1755
- return {
1756
- listStyle: () => {
1757
- },
1758
- viewTypes: this.viewTypes,
1759
- dashboardStyle: this.$style,
1760
- previewDatasource: this.previewDatasource,
1761
- emitRoot: this.emitRoot,
1762
- getConfig: this.getConfig,
1763
- getPresets: this.getPresets,
1764
- selectPreset: this.selectPreset,
1765
- preview: this.preview,
1766
- getSrc: () => this.src,
1767
- getViewedPreset: () => this.viewedPreset,
1768
- getQueryFilters: () => this.queryFilters,
1769
- }
1770
- },
1771
-
1772
- setup(){
1773
- const emitter = useEmitter()
1774
- return {
1775
- emitter
1776
- }
1777
- },
1778
-
1779
- watch: {
1780
-
1781
- 'presets'(to) {
1782
- this.cConfigParams.viewedUid = 'uid' in this.$route.query ? this.$route.query.uid : this.cConfigParams.viewedUid
1783
- },
1784
-
1785
- 'cConfigParams.viewedUid'() {
1786
- this.$emit('change')
1787
- },
1788
-
1789
- 'cConfig.params.selectedUid'() {
1790
- this.savePreset()
1791
- this.presetNameChanging = null
1792
- },
1793
-
1794
- 'cConfig.selectedDatasource'() {
1795
- this.savePreset()
1796
- },
1797
-
1798
- '$route.query': {
1799
- handler(to) {
1800
- if (this.cConfig) {
1801
- this.cConfigParams.viewedUid = 'uid' in to ? to.uid : this.cConfigParams.viewedUid
1802
- this.load()
1803
- }
1804
- }
1805
- },
1806
-
1807
- config: {
1808
- deep: true,
1809
- handler(to, from){
1810
- if(Object.keys(from ?? {}).length > 0){
1811
- this.savePreset()
1812
- }
1813
- }
1814
- },
1815
-
1816
- selectedPreset: {
1817
- deep: true,
1818
- handler(to, from) {
1819
- if(to) {
1820
- this.savePreset()
1821
- }
1822
- }
1823
- }
1824
-
1825
- }
1826
-
1827
- }
1828
-
1829
- </script>
1830
-
1831
- <style module>
1832
-
1833
- .comp {
1834
- @apply flex flex-row;
1835
- }
1836
-
1837
- .resize1 {
1838
- @apply w-[3px] cursor-ew-resize absolute top-0 right-0 bottom-0;
1839
- }
1840
-
1841
- .button {
1842
- @apply text-left p-3 border-[1px] border-transparent rounded-lg cursor-pointer;
1843
- @apply hover:border-primary-300 hover:bg-primary-100;
1844
- }
1845
-
1846
- .listMenu{
1847
- @apply flex flex-row items-center gap-1 hover:bg-text-50 px-3 rounded-xl;
1848
- }
1849
- .listMenu .listBtn{
1850
- @apply hidden p-1;
1851
- }
1852
- .listMenu:hover .listBtn{
1853
- @apply block;
1854
- }
1855
-
1856
- </style>