@mixd-id/web-scaffold 0.2.240706 → 0.2.250801009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/docs/components/Dashboard.md +56 -0
  2. package/log.txt +7 -0
  3. package/package.json +27 -19
  4. package/src/components/404.vue +61 -0
  5. package/src/components/AccountIcon.vue +19 -0
  6. package/src/components/Ahref.vue +1 -1
  7. package/src/components/Alert.vue +4 -13
  8. package/src/components/ArrayList.vue +49 -0
  9. package/src/components/Article.vue +24 -30
  10. package/src/components/Button.vue +79 -167
  11. package/src/components/Card.vue +235 -0
  12. package/src/components/Carousel.vue +61 -60
  13. package/src/components/Cart.vue +192 -0
  14. package/src/components/CartIcon.vue +89 -0
  15. package/src/components/ChartBar.vue +2 -3
  16. package/src/components/Checkbox.vue +20 -11
  17. package/src/components/Checkout.vue +373 -0
  18. package/src/components/CheckoutDelivery.vue +267 -0
  19. package/src/components/CodeEditor.vue +5 -16
  20. package/src/components/CollapsiblePanel.vue +70 -0
  21. package/src/components/ColorPicker.vue +8 -3
  22. package/src/components/ColorPicker2.vue +41 -19
  23. package/src/components/ColorPicker3.vue +100 -0
  24. package/src/components/Confirm.vue +9 -7
  25. package/src/components/ContextMenu.vue +122 -206
  26. package/src/components/ContextMenuItem.vue +53 -0
  27. package/src/components/Dashboard.vue +243 -0
  28. package/src/components/Dashboard2.vue +118 -0
  29. package/src/components/DashboardComponentSelector.vue +96 -0
  30. package/src/components/DashboardConfigs.vue +202 -0
  31. package/src/components/Datepicker.vue +102 -41
  32. package/src/components/DayTimeRange.vue +3 -2
  33. package/src/components/Dropdown.vue +7 -4
  34. package/src/components/Flex.vue +14 -40
  35. package/src/components/GHeatMaps.vue +2 -2
  36. package/src/components/Grid.vue +6 -6
  37. package/src/components/HTMLEditor.vue +27 -14
  38. package/src/components/Image.vue +62 -108
  39. package/src/components/ImagePreview.vue +14 -4
  40. package/src/components/ImageUploader.vue +114 -0
  41. package/src/components/ImportModal.vue +3 -3
  42. package/src/components/Link.vue +62 -6
  43. package/src/components/List.vue +524 -403
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +5 -3
  46. package/src/components/ListPage1.vue +14 -15
  47. package/src/components/ListView.vue +5 -6
  48. package/src/components/ListViewSettings.vue +2 -2
  49. package/src/components/LogViewerItem.vue +1 -1
  50. package/src/components/MarkdownEdit.vue +128 -0
  51. package/src/components/MarkdownPreview.vue +102 -0
  52. package/src/components/MenuItem1.vue +36 -0
  53. package/src/components/Modal.vue +95 -43
  54. package/src/components/MultiDropdown.vue +124 -0
  55. package/src/components/MultilineText.vue +1 -4
  56. package/src/components/OTPField.vue +11 -17
  57. package/src/components/ObjectTree.vue +1 -1
  58. package/src/components/PageBuilder.vue +3 -3
  59. package/src/components/Paragraph.vue +1 -2
  60. package/src/components/PresetSelectorFilterItem.vue +107 -95
  61. package/src/components/Radio.vue +1 -1
  62. package/src/components/SearchModal.vue +153 -0
  63. package/src/components/Slider.vue +1 -1
  64. package/src/components/Svg.vue +1 -1
  65. package/src/components/SvgEditor.vue +173 -0
  66. package/src/components/Switch.vue +4 -5
  67. package/src/components/Table.vue +2 -2
  68. package/src/components/TableView.vue +2 -3
  69. package/src/components/TableViewHead.vue +2 -2
  70. package/src/components/Tabs.vue +1 -1
  71. package/src/components/Testimonial.vue +2 -2
  72. package/src/components/Text.vue +7 -22
  73. package/src/components/TextEditor.vue +3 -3
  74. package/src/components/TextWithTag.vue +61 -30
  75. package/src/components/Textarea.vue +11 -16
  76. package/src/components/Textbox.vue +9 -19
  77. package/src/components/Timepicker.vue +25 -15
  78. package/src/components/Toast.vue +5 -3
  79. package/src/components/TreeMenu.vue +122 -0
  80. package/src/components/TreeView.vue +15 -10
  81. package/src/components/TreeView2.vue +38 -0
  82. package/src/components/TreeViewItem.vue +58 -29
  83. package/src/components/TreeViewItem2.vue +55 -0
  84. package/src/components/Uploader.vue +45 -0
  85. package/src/components/Video.vue +119 -0
  86. package/src/components/VirtualGrid.vue +24 -7
  87. package/src/components/VirtualTable.vue +363 -128
  88. package/src/configs/dashboard/data-table.js +9 -0
  89. package/src/configs/web-page-builder.js +118 -0
  90. package/src/directives/intersect.js +26 -0
  91. package/src/hooks/device.js +14 -0
  92. package/src/index.js +62 -107
  93. package/src/mixin/component.js +147 -67
  94. package/src/themes/default/index.js +83 -155
  95. package/src/utils/dashboard.js +22 -962
  96. package/src/utils/helpers.cjs +635 -0
  97. package/src/utils/helpers.js +91 -60
  98. package/src/utils/helpers.mjs +245 -12
  99. package/src/utils/importer.js +22 -3
  100. package/src/utils/list.mjs +1509 -0
  101. package/src/utils/preset-selector.cjs +1455 -0
  102. package/src/utils/preset-selector.js +489 -95
  103. package/src/utils/preset-selector.mjs +59 -20
  104. package/src/utils/queue.js +63 -0
  105. package/src/utils/web.mjs +120 -0
  106. package/src/utils/wss.js +37 -29
  107. package/src/utils/wss.mjs +24 -19
  108. package/src/widgets/AhrefSetting.vue +16 -13
  109. package/src/widgets/ArticleSetting.vue +15 -27
  110. package/src/widgets/BackgroundColorSetting.vue +153 -0
  111. package/src/widgets/BorderColorSetting.vue +57 -0
  112. package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
  113. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  114. package/src/widgets/BotEditor.vue +35 -15
  115. package/src/widgets/ButtonSetting.vue +12 -13
  116. package/src/widgets/CarouselSetting.vue +33 -45
  117. package/src/widgets/CartSetting.vue +46 -0
  118. package/src/widgets/CheckoutSetting.vue +46 -0
  119. package/src/widgets/CollapsiblePanelSetting.vue +46 -0
  120. package/src/widgets/ColumnSelector.vue +29 -5
  121. package/src/widgets/ComponentSetting.vue +1 -1
  122. package/src/widgets/ComponentSetting2.vue +112 -234
  123. package/src/widgets/ComponentSetting3.vue +1 -1
  124. package/src/widgets/ContactForm.vue +3 -3
  125. package/src/widgets/ContactFormSetting.vue +41 -30
  126. package/src/widgets/Dashboard/BarChart.vue +47 -11
  127. package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
  128. package/src/widgets/Dashboard/DataTable.vue +125 -0
  129. package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
  130. package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
  131. package/src/widgets/Dashboard/Doughnut.vue +49 -7
  132. package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
  133. package/src/widgets/Dashboard/Metric.vue +78 -19
  134. package/src/widgets/Dashboard/MetricSetting.vue +81 -28
  135. package/src/widgets/Dashboard/Pie.vue +55 -6
  136. package/src/widgets/Dashboard/PieSetting.vue +1 -1
  137. package/src/widgets/Dashboard/PolarArea.vue +49 -7
  138. package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
  139. package/src/widgets/Dashboard/SharingModal.vue +4 -5
  140. package/src/widgets/Dashboard/ViewSelector.vue +2 -2
  141. package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
  142. package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
  143. package/src/widgets/EmbeddedVideoSetting.vue +7 -5
  144. package/src/widgets/FAQ.vue +16 -3
  145. package/src/widgets/FAQSetting.vue +53 -47
  146. package/src/widgets/FeatureList.vue +3 -0
  147. package/src/widgets/FeatureListSetting.vue +112 -102
  148. package/src/widgets/FlexSetting.vue +83 -106
  149. package/src/widgets/GridSetting.vue +71 -196
  150. package/src/widgets/Header2.vue +34 -71
  151. package/src/widgets/Header2Setting.vue +95 -179
  152. package/src/widgets/HeaderSetting.vue +16 -18
  153. package/src/widgets/IconListSetting.vue +69 -65
  154. package/src/widgets/ImageSetting.vue +33 -60
  155. package/src/widgets/LinkSetting.vue +60 -37
  156. package/src/widgets/LinkSettingModal.vue +173 -0
  157. package/src/widgets/LogViewer.vue +1 -1
  158. package/src/widgets/MarginSetting.vue +2 -2
  159. package/src/widgets/MenuEditor.vue +1 -1
  160. package/src/widgets/MenuItem1Setting.vue +78 -0
  161. package/src/widgets/ModalSetting.vue +42 -44
  162. package/src/widgets/MultiValueSetting.vue +2 -2
  163. package/src/widgets/MultiValueSetting2.vue +78 -45
  164. package/src/widgets/OGSettingModal.vue +103 -0
  165. package/src/widgets/PaddingSetting.vue +2 -2
  166. package/src/widgets/ParagraphSetting.vue +16 -13
  167. package/src/widgets/PositionSetting.vue +209 -0
  168. package/src/widgets/PresetBar.vue +359 -210
  169. package/src/widgets/PresetBarPivot.vue +31 -19
  170. package/src/widgets/PresetSelector.vue +29 -17
  171. package/src/widgets/SearchModalSetting.vue +70 -0
  172. package/src/widgets/Share.vue +1 -2
  173. package/src/widgets/ShareSetting.vue +67 -60
  174. package/src/widgets/StyleSetting.vue +227 -116
  175. package/src/widgets/TestimonialSetting.vue +97 -88
  176. package/src/widgets/TextBlockSetting.vue +16 -13
  177. package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
  178. package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
  179. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
  180. package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
  181. package/src/widgets/UserActionBuilder.vue +4 -16
  182. package/src/widgets/WebComponentSelector.vue +15 -11
  183. package/src/widgets/WebLayoutSelector.vue +41 -270
  184. package/src/widgets/WebPageBuilder.vue +693 -704
  185. package/src/widgets/WebPageBuilder2.vue +7 -7
  186. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
  187. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
  188. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
  189. package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
  190. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
  191. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
  192. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
  193. package/src/widgets/WebPageBuilder4.vue +289 -575
  194. package/src/widgets/WebPageSelector.vue +1 -1
  195. package/src/widgets/YoutubeVideoSetting.vue +16 -13
  196. package/tailwind.config.js +3 -35
  197. package/docs/schema/user-action.json +0 -266
  198. package/src/App.vue +0 -25
  199. package/src/components/SearchButton.vue +0 -57
  200. package/src/entry-client.js +0 -27
  201. package/src/entry-server.js +0 -73
  202. package/src/events/event.js +0 -2
  203. package/src/main.js +0 -29
  204. package/src/mixin/website.js +0 -121
  205. package/src/router.js +0 -57
  206. package/src/widgets/MobileMenu.vue +0 -182
  207. package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
  208. package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
  209. package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
  210. package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
  211. package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
  212. package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
  213. package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
  214. package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
  215. package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
  216. package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
  217. package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
  218. package/test.json +0 -22
  219. /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
  220. /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
@@ -0,0 +1,56 @@
1
+ # Dashboard
2
+ Dashboard components
3
+
4
+ ## Configs
5
+ | Property | Type | Default | Description |
6
+ |----------|------|---------|-------------|
7
+ | params | Object | {} | | Dashboard parameters |
8
+ | params.presetUid | String | "" | | Preset unique identifier |
9
+
10
+ ## Samples
11
+ ```json
12
+ {
13
+ "params": {
14
+ "presetUid": "abc",
15
+ "viewUid": "def"
16
+ },
17
+
18
+ "presets": [
19
+
20
+ {
21
+ "name": "Preset Name",
22
+
23
+ "views": [
24
+ {
25
+ "type": "Grid",
26
+ "uid": ":uid"
27
+ }
28
+ ],
29
+
30
+ "datasource": {
31
+
32
+ ":uid": {
33
+ "uid": ":uid",
34
+ "datasourceUid": "234",
35
+ "filters": [],
36
+ "sorts": [],
37
+ "groups": [],
38
+ "pivot": []
39
+ },
40
+
41
+ }
42
+
43
+ }
44
+
45
+ ]
46
+ }
47
+ ```
48
+
49
+
50
+ ## Sub Components
51
+
52
+ ### Dashboard Configs
53
+ Dashboard configuration panel
54
+
55
+ ### Dashboard Component Selector
56
+ Component selector for adding component to preset views
package/log.txt ADDED
@@ -0,0 +1,7 @@
1
+ [2025-06-28 16:30:51]
2
+ POST https://198.168.4.239/ksapisvr
3
+ --
4
+ {"api_jsonkolnss":[{"Request":"HASIL","attempt":"0","noBukti":"KSSOE312506000008745","noHP":"085339156956","linkFoto":"https://www.kliknss.co.id/images/kols/097da1af5ef3f112e6ce0d771bdcbeda.jpg","lat":"-10.0409983","long":"124.5253983","jamFoto":"14:02:09","statusKunjungan":"3","lokasiKunjungan":"05","bertemuDengan":"org tua","hubDenganKonsumen":"KELUARGA","konsBayarTarik":"1","tanggalJanjiBayar":"","tanggalKunjunganUlang":"","penyebabKonsTidakBayar":"","historisKons":"","noHPKons":"08552364562","alamatRumahSkr":"desa takarii","keberadaanKonsumen":"01","pekerjaanSkr":"AG","subPekerjaan":"63","unitBisaDiFoto":"Y","keberadaanUnit":"11","klasifikasiKons":"999","layakTdkLayak":"","latMulai":"-10.0408867","lonMulai":"124.5252633","latSampai":"-10.0409114","lonSampai":"124.5252886","latSelesai":"-10.0409983","lonSelesai":"124.5253983","jamMulai":"13:58:54","jamSampai":"13:59:11","jamSelesai":"13:59:14","linkFotoBerkas":"https://www.kliknss.co.id/images/kols/9dbec61757412e358e9a68013aa80f25.jpg","jamKirim":"2025-06-28 16:51:04.695692","tempatDikunjungi":"rmh org tya","hariLuang":"Senin","jamLuang":"10:00 - 12:00","kodePelacakan":"","latFotoPelacakan":"","longFotoPelacakan":"","jamFotoPelacakan":"","provPelacakan":"","kotaPelacakan":"","kecPelacakan":"","kelPelacakan":"","kodePosPelacakan":"","alamatPelacakan":"","provPemegangUnit":"","kotaPemegangUnit":"","kecPemegangUnit":"","kelPemegangUnit":"","kodePosPemegangUnit":"","alamatPemegangUnit":"","hubPemegangUnit":"","hubPemegangUnitLainnya":"","namaPemegangUnit":"","ketTidakTerlacak":"","Suspect":"TIDAK","KetKunjKolvsAlmtagih":"TIDAK SESUAI","JrkKunjKolvsAlmtagih":"29652.31661401902","KetKunjKolvsResurvey":"TIDAK SESUAI","JrkKunjKolvsResurvey":"29652.31661401902","KetKunjKolvsSurvey":"TIDAK SESUAI","JrkKunjKolvsSurvey":"32674.530270079635","KetKunjKolvsTmptKerja":"TIDAK SESUAI","JrkKunjKolvsTmptKerja":"32674.530270079635","KetKunjKolvsKelSurvey":"TIDAK SESUAI","JrkKunjKolvsKelSurvey":"52918.18337137214"}]}
5
+
6
+ E================ t= 61ms
7
+ {"status":-1,"message":"ap_rdjsn gagal, response=master label di program tidak ditemukan/tidak urut di jawaban server","data":"ap_rdjsn gagal, response=master label di program tidak ditemukan/tidak urut di jawaban server "}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.2.240706",
4
+ "version": "0.2.250801009",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -12,7 +12,6 @@
12
12
  ".": "./src/index.js",
13
13
  "./themes/default": "./src/themes/default/index.js",
14
14
  "./components/*": "./src/components/*",
15
- "./mixin/*": "./src/mixin/*",
16
15
  "./widgets/*": "./src/widgets/*",
17
16
  "./mixin/component": "./src/mixin/component.js",
18
17
  "./mixin/edit-mode": "./src/mixin/edit-mode.js",
@@ -21,58 +20,67 @@
21
20
  "require": "./src/utils/helpers.js",
22
21
  "import": "./src/utils/helpers.mjs"
23
22
  },
23
+ "./helpers.js": "./src/utils/helpers.js",
24
+ "./helpers.mjs": "./src/utils/helpers.mjs",
25
+ "./queue": "./src/utils/queue.js",
24
26
  "./wss": {
25
27
  "require": "./src/utils/wss.js",
26
28
  "import": "./src/utils/wss.mjs"
27
29
  },
30
+ "./wss.js": "./src/utils/wss.js",
31
+ "./wss.mjs": "./src/utils/wss.mjs",
28
32
  "./importer": "./src/utils/importer.js",
29
33
  "./listpage1": "./src/utils/listpage1.js",
30
34
  "./dashboard": "./src/utils/dashboard.js",
31
35
  "./listview": "./src/utils/listview.js",
32
36
  "./preset-selector": {
33
- "require": "./src/utils/preset-selector.js",
37
+ "require": "./src/utils/preset-selector.cjs",
34
38
  "import": "./src/utils/preset-selector.mjs"
35
39
  },
36
- "./web": "./src/utils/web.js"
40
+ "./hooks/*": "./src/hooks/*",
41
+ "./preset-selector.cjs": "./src/utils/preset-selector.cjs",
42
+ "./preset-selector.js": "./src/utils/preset-selector.js",
43
+ "./preset-selector.mjs": "./src/utils/preset-selector.mjs",
44
+ "./list": {
45
+ "import": "./src/utils/list.mjs"
46
+ },
47
+ "./list.mjs": "./src/utils/list.mjs",
48
+ "./web": {
49
+ "require": "./src/utils/web.js",
50
+ "import": "./src/utils/web.mjs"
51
+ }
37
52
  },
38
53
  "dependencies": {
39
- "@faker-js/faker": "^7.3.0",
40
- "@googlemaps/js-api-loader": "^1.15.1",
54
+ "@googlemaps/js-api-loader": "^1.16.8",
41
55
  "@tailwindcss/line-clamp": "^0.4.0",
42
56
  "@vueuse/core": "^9.0.2",
43
57
  "adm-zip": "^0.5.10",
58
+ "axios": "1.8.2",
59
+ "bcrypt": "^5.1.1",
44
60
  "chart.js": "^4.2.1",
45
61
  "compression": "^1.7.4",
46
- "cookie-parser": "^1.4.6",
47
- "cors": "^2.8.5",
48
62
  "crypto-js": "^4.2.0",
49
63
  "dayjs": "^1.11.2",
50
64
  "eventemitter2": "^6.4.7",
51
- "events": "^3.3.0",
52
65
  "exceljs": "^4.3.0",
53
- "express": "^4.18.1",
54
66
  "file-type": "^18.2.1",
55
67
  "glob": "^8.0.3",
56
68
  "lodash": "^4.17.21",
69
+ "lodash-es": "^4.17.21",
70
+ "marked": "^16.4.1",
57
71
  "md5": "^2.3.0",
58
72
  "mitt": "^3.0.1",
59
- "nprogress": "^0.2.0",
60
73
  "pinia": "^2.0.2",
61
- "prismjs": "^1.28.0",
74
+ "prismjs": "1.30.0",
62
75
  "redis": "^4.6.13",
63
- "serve-static": "^1.15.0",
76
+ "sequelize": "^6.37.7",
64
77
  "tailwindcss": "^3.2.4",
78
+ "tinycolor2": "^1.6.0",
65
79
  "vue": "^3.2.25",
66
80
  "vue-chartjs": "^5.2.0",
67
81
  "vue-router": "^4.0.14",
68
82
  "ws": "^8.16.0"
69
83
  },
70
- "devDependencies": {
71
- "@vitejs/plugin-vue": "^2.2.0",
72
- "autoprefixer": "^10.4.4",
73
- "postcss": "^8.4.12",
74
- "vite": "^2.8.0"
75
- },
76
84
  "description": "This scaffold based on express vitejs vuejs",
77
85
  "repository": {
78
86
  "type": "git",
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div :class="$style.el">
3
+
4
+ <div>
5
+ <h1>{{ title }}</h1>
6
+ <p>{{ description }}</p>
7
+ </div>
8
+
9
+ <slot>
10
+ <component v-if="items?.length > 0"
11
+ v-for="item in items"
12
+ :is="item.type"
13
+ :key="item.key"
14
+ :="item" />
15
+
16
+ <router-link v-else :to="{ path:'/' }" class="text-primary">
17
+ Back to Home
18
+ </router-link>
19
+ </slot>
20
+
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+
26
+ export default {
27
+
28
+ props: {
29
+
30
+ description: {
31
+ type: String,
32
+ default: 'The page you are looking for does not exist.'
33
+ },
34
+
35
+ title: {
36
+ type: String,
37
+ default: 'Page Not Found'
38
+ },
39
+
40
+ items: Array
41
+
42
+ },
43
+
44
+ methods: {
45
+
46
+
47
+ }
48
+
49
+ }
50
+
51
+ </script>
52
+
53
+ <style module>
54
+
55
+ .el{
56
+ @apply w-full max-w-[600px] mx-auto;
57
+ @apply flex flex-col gap-8 items-center justify-center;
58
+ @apply min-h-[60vh]
59
+ }
60
+
61
+ </style>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <button type="button">
3
+
4
+ </button>
5
+ </template>
6
+
7
+ <script setup>
8
+
9
+
10
+
11
+ </script>
12
+
13
+ <style module>
14
+
15
+ .comp{
16
+
17
+ }
18
+
19
+ </style>
@@ -55,7 +55,7 @@ export default {
55
55
  <style module>
56
56
 
57
57
  .button{
58
- @apply p-2 h-[var(--h-cp)];
58
+ @apply p-2;
59
59
  @apply relative flex items-center justify-center;
60
60
  @apply whitespace-nowrap text-ellipsis overflow-hidden;
61
61
  @apply rounded-lg;
@@ -54,14 +54,9 @@
54
54
  <script>
55
55
 
56
56
  import {copyToClipboard, unPascalCase} from "../utils/helpers.mjs";
57
- import Button from "./Button.vue";
58
57
 
59
58
  export default{
60
59
 
61
- components: {
62
- Button
63
- },
64
-
65
60
  methods: {
66
61
 
67
62
  /**
@@ -90,12 +85,8 @@ export default{
90
85
  },
91
86
 
92
87
  onAfterAppear(){
93
- window.setTimeout(() => {
94
- console.log(this.$refs)
95
- }, 2000)
96
- //this.$refs.btnOK.focus()
88
+ this.$refs.btnOK.focus()
97
89
  this.$emit('appear')
98
-
99
90
  },
100
91
 
101
92
  onConfirm(){
@@ -206,15 +197,15 @@ export default{
206
197
  .alert{
207
198
  @apply fixed top-0 left-0 flex w-screen h-screen;
208
199
  @apply items-center justify-center bg-white/50 backdrop-blur-md;
209
- z-index: 60;
200
+ z-index: 150;
210
201
  }
211
202
  [data-theme="dark"] .alert{
212
203
  @apply bg-black/50;
213
204
  }
214
205
 
215
206
  .alert>*{
216
- @apply max-h-[60vh] overflow-y-auto bg-base-500 rounded-xl;
217
- @apply border-[1px] border-text-50;
207
+ @apply max-h-[60vh] overflow-y-auto bg-base-400 dark:bg-base-300 rounded-xl;
208
+ @apply border-[1px] border-border-50;
218
209
  @apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
219
210
  }
220
211
 
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <div class="flex-1 flex flex-row flex-wrap gap-1">
4
+ <div v-for="item in items">
5
+ <slot name="default" :item="item">
6
+ <div :class="$style.item">
7
+ {{ item.name }}
8
+
9
+ <button type="button" @click="$emit('remove', item)">
10
+ <svg width="11" height="11" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>
11
+ </button>
12
+ </div>
13
+ </slot>
14
+ </div>
15
+ </div>
16
+ <button type="button" class="p-2" @click="$emit('add')">
17
+ <svg width="14" height="14" class="fill-text-300 hover:fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M64 192C28.61 192 0 220.6 0 256s28.61 64 64 64s64-28.62 64-64S99.39 192 64 192zM256 192C220.6 192 192 220.6 192 256s28.61 64 64 64s64-28.62 64-64S291.4 192 256 192zM448 192c-35.39 0-64 28.62-64 64s28.61 64 64 64s64-28.62 64-64S483.4 192 448 192z"/></svg>
18
+ </button>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+
24
+ export default{
25
+
26
+ emits: [ 'add', 'remove' ],
27
+
28
+ props: {
29
+ items: Array
30
+ }
31
+
32
+ }
33
+
34
+ </script>
35
+
36
+ <style module>
37
+
38
+ .comp{
39
+ @apply min-w-[200px] p-1;
40
+ @apply border-[1px] border-border-200 bg-base-300 hover:border-border-300 rounded-lg;
41
+ @apply flex flex-row items-start flex-nowrap;
42
+ }
43
+
44
+ .item{
45
+ @apply border-[1px] border-border-200 hover:border-border-300 rounded-lg p-1 px-2;
46
+ @apply flex flex-row items-center gap-2;
47
+ }
48
+
49
+ </style>
@@ -1,19 +1,16 @@
1
1
  <template>
2
- <div :class="$style.comp" :style="computedStyle">
3
- <article ref="article" :class="$style.article"
4
- v-html="computedHtml"
5
- :contenteditable="editMode === 1"
6
- @input="onInput"
7
- @click="onClick"
8
- @paste="onPaste"></article>
9
- </div>
2
+ <article :class="$style.article"
3
+ v-html="computedHtml"
4
+ :style="computedStyle"
5
+ @input="onInput"
6
+ @click="onClick"
7
+ @paste="onPaste" />
10
8
  </template>
11
9
 
12
10
  <script>
13
11
 
14
- import { componentMixin } from '../mixin/component';
12
+ import {componentMixin} from '../mixin/component';
15
13
  import {getSelection, restoreSelection, saveSelection} from "../utils/selection";
16
- import {applyDatasourceReplacer} from "../utils/helpers.mjs";
17
14
 
18
15
  export default{
19
16
 
@@ -28,7 +25,7 @@ export default{
28
25
  methods: {
29
26
 
30
27
  getSelection(){
31
- const { text = '', href = '', target = '' } = saveSelection(this.$refs.article)
28
+ const { text = '', href = '', target = '' } = saveSelection(this.$el)
32
29
  return {
33
30
  text,
34
31
  href,
@@ -56,7 +53,7 @@ export default{
56
53
 
57
54
  onClick(){
58
55
  if(this.editMode){
59
- let { element } = getSelection(this.$refs.article)
56
+ let { element } = getSelection(this.$el)
60
57
 
61
58
  const table = this.closest(element, 'table')
62
59
 
@@ -82,7 +79,7 @@ export default{
82
79
  uid: this.uid,
83
80
  type: 'setProp',
84
81
  value: {
85
- htmlText: this.$refs.article.innerHTML
82
+ htmlText: this.$el.innerHTML
86
83
  }
87
84
  }, '*')
88
85
  },
@@ -101,7 +98,7 @@ export default{
101
98
 
102
99
  addTableColumn(){
103
100
 
104
- let { element } = getSelection(this.$refs.article)
101
+ let { element } = getSelection(this.$el)
105
102
  if(element.nodeType !== 1)
106
103
  element = element.parentNode
107
104
  const table = this.closest(element, 'table')
@@ -130,7 +127,7 @@ export default{
130
127
 
131
128
  addTableRow(){
132
129
 
133
- let { element } = getSelection(this.$refs.article)
130
+ let { element } = getSelection(this.$el)
134
131
  if(element.nodeType !== 1)
135
132
  element = element.parentNode
136
133
  const table = this.closest(element, 'table')
@@ -154,7 +151,7 @@ export default{
154
151
 
155
152
  removeTableRow(){
156
153
 
157
- let { element } = getSelection(this.$refs.article)
154
+ let { element } = getSelection(this.$el)
158
155
  if(element.nodeType !== 1)
159
156
  element = element.parentNode
160
157
  const table = this.closest(element, 'table')
@@ -171,7 +168,7 @@ export default{
171
168
 
172
169
  removeTableColumn(){
173
170
 
174
- let { element } = getSelection(this.$refs.article)
171
+ let { element } = getSelection(this.$el)
175
172
  if(element.nodeType !== 1)
176
173
  element = element.parentNode
177
174
  const table = this.closest(element, 'table')
@@ -232,7 +229,7 @@ export default{
232
229
 
233
230
  case 'saveSelection':
234
231
  case 'getSelection':
235
- const sel = saveSelection(this.$refs.article)
232
+ const sel = saveSelection(this.$el)
236
233
  const { text, target, href } = sel
237
234
  result = {
238
235
  text,
@@ -257,7 +254,7 @@ export default{
257
254
  break
258
255
 
259
256
  case 'removeLink':
260
- const { element } = getSelection(this.$refs.article)
257
+ const { element } = getSelection(this.$el)
261
258
 
262
259
  let a = element
263
260
  while(a && a.tagName !== 'A'){
@@ -316,7 +313,7 @@ export default{
316
313
  document.execCommand(type, false, value);
317
314
  break
318
315
  }
319
- this.$refs.article.focus()
316
+ this.$el.focus()
320
317
  break
321
318
 
322
319
  }
@@ -325,16 +322,16 @@ export default{
325
322
  }
326
323
 
327
324
  })
325
+
326
+ this.$el.setAttribute('contenteditable', 'true')
328
327
  }
329
328
  },
330
329
 
331
330
  computed: {
332
331
 
333
332
  computedHtml(){
334
- if(this.editMode && this.editMode === 1)
335
- return this.htmlText
336
- return applyDatasourceReplacer(this.htmlText, this.pageData)
337
- },
333
+ return this.htmlText
334
+ }
338
335
 
339
336
  },
340
337
 
@@ -350,11 +347,8 @@ export default{
350
347
 
351
348
  <style module>
352
349
 
353
- .comp{
354
- @apply relative;
355
- }
356
-
357
350
  .article{
351
+ @apply relative;
358
352
  }
359
353
  .article *{
360
354
  }
@@ -382,11 +376,11 @@ export default{
382
376
  .article font[size='7']{ @apply text-4xl; }
383
377
 
384
378
  .article table{
385
- @apply border-[1px] border-text-200 border-collapse w-full;
379
+ @apply border-[1px] border-border-200 border-collapse w-full;
386
380
  table-layout: fixed;
387
381
  }
388
382
  .article table th, .article table td{
389
- @apply border-[1px] border-text-200 p-3 text-left;
383
+ @apply border-[1px] border-border-200 p-3 text-left;
390
384
  @apply break-words;
391
385
  }
392
386