@mixd-id/web-scaffold 0.2.240705 → 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 -402
  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
@@ -4,7 +4,7 @@
4
4
  <div>
5
5
  <Checkbox v-model="pivot.enabled"
6
6
  @change="apply()">
7
- Pivot Enabled
7
+ Enabled
8
8
  </Checkbox>
9
9
  </div>
10
10
 
@@ -13,14 +13,14 @@
13
13
  <div>
14
14
  <div class="flex flex-row items-center gap-2">
15
15
  <label>Groups</label>
16
- <button type="button" @click="$refs.columnSelector.open(obj => addPivot('rows', obj), columns)">
16
+ <button type="button" @click="$refs.columnSelector.open(obj => addPivot('rows', obj), pivotColumns)">
17
17
  <svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path 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"/></svg>
18
18
  </button>
19
19
  </div>
20
20
  <ListItem :items="pivot.rows"
21
21
  @reorder="(from, to) => { pivot.rows.splice(to, 0, pivot.rows.splice(from, 1)[0]); apply() }"
22
- class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-text-200 bg-base-400 rounded-lg p-0.5"
23
- container-class="divide-y divide-text-50">
22
+ class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-border-200 bg-base-300 rounded-lg p-0.5"
23
+ container-class="divide-y divide-border-50">
24
24
  <template v-slot="{ item, index }">
25
25
  <div class="flex flex-row items-center gap-3 p-2 bg-base-500 hover:bg-primary-100 first:rounded-t-md last:rounded-b-md">
26
26
  <div data-reorder v-if="(pivot.rows ?? []).length > 1">
@@ -33,7 +33,7 @@
33
33
  </strong>
34
34
  <select v-if="item.type === 'date'"
35
35
  v-model="item.aggregrate"
36
- class="px-1 appearance-none bg-base-300 rounded-md border-[1px] border-text-50 outline-none"
36
+ class="px-1 appearance-none bg-base-300 rounded-md border-[1px] border-border-50 outline-none"
37
37
  @change="apply()">
38
38
  <option value="hour">Hour</option>
39
39
  <option value="date">Date</option>
@@ -58,8 +58,8 @@
58
58
  </div>
59
59
  <ListItem :items="pivot.values"
60
60
  @reorder="(from, to) => { pivot.values.splice(to, 0, pivot.values.splice(from, 1)[0]); }"
61
- class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-text-200 bg-base-400 rounded-lg p-0.5"
62
- container-class="divide-y divide-text-50">
61
+ class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-border-200 bg-base-300 rounded-lg p-0.5"
62
+ container-class="divide-y divide-border-50">
63
63
  <template v-slot="{ item, index }">
64
64
  <div class="flex flex-row items-center gap-3 p-2 bg-base-500 hover:bg-primary-100 first:rounded-t-md last:rounded-b-md">
65
65
  <div data-reorder v-if="(pivot.values ?? []).length > 1">
@@ -71,15 +71,17 @@
71
71
  {{ item.label ? item.label : item.key }}
72
72
  </strong>
73
73
  <select v-model="item.aggregrate"
74
- class="px-1 appearance-none bg-base-300 w-[80px] rounded-md border-[1px] border-text-50 outline-none"
74
+ class="px-1 appearance-none bg-base-300 w-[80px] rounded-md border-[1px] border-border-50 outline-none"
75
75
  @change="apply()">
76
76
  <option value="">Default</option>
77
77
  <option value="count">Count</option>
78
78
  <option value="countDistinct">Distinct Count</option>
79
- <option v-if="[ 'number' ].includes(item.type)" value="sum">Sum</option>
80
- <option v-if="[ 'number' ].includes(item.type)" value="avg">Average</option>
81
- <option v-if="[ 'number' ].includes(item.type)" value="min">Min</option>
82
- <option v-if="[ 'number' ].includes(item.type)" value="max">Max</option>
79
+ <option value="first">First</option>
80
+ <option value="last">Last</option>
81
+ <option v-if="[ 'number', 'currency' ].includes(item.type)" value="sum">Sum</option>
82
+ <option v-if="[ 'number', 'currency' ].includes(item.type)" value="avg">Average</option>
83
+ <option v-if="[ 'number', 'currency' ].includes(item.type)" value="min">Min</option>
84
+ <option v-if="[ 'number', 'currency' ].includes(item.type)" value="max">Max</option>
83
85
  </select>
84
86
  </div>
85
87
  <button type="button" @click="pivot.values.splice(index, 1); apply()">
@@ -100,8 +102,8 @@
100
102
  </div>
101
103
  <ListItem :items="pivot.columns"
102
104
  @reorder="(from, to) => { pivot.columns.splice(to, 0, pivot.columns.splice(from, 1)[0]); pivot.manualColumns = true; apply() }"
103
- class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-text-200 bg-base-400 rounded-lg p-0.5"
104
- container-class="divide-y divide-text-50">
105
+ class="mt-2 h-[25vh] overflow-y-auto border-[1px] border-border-200 bg-base-300 rounded-lg p-0.5"
106
+ container-class="divide-y divide-border-50">
105
107
  <template v-slot="{ item, index }">
106
108
  <div class="flex flex-row gap-2 items-center px-2 bg-base-500">
107
109
  <div data-reorder>
@@ -129,6 +131,8 @@
129
131
  </div>
130
132
 
131
133
  </div>
134
+ <br />
135
+ <br />
132
136
 
133
137
  <ColumnSelector ref="columnSelector" />
134
138
 
@@ -147,6 +151,14 @@ export default{
147
151
 
148
152
  emits: [ 'apply' ],
149
153
 
154
+ computed: {
155
+
156
+ pivotColumns(){
157
+ return this.columns.filter(_ => _.filterable === true && (_.pivot ?? true) !== false)
158
+ },
159
+
160
+ },
161
+
150
162
  methods: {
151
163
 
152
164
  apply(){
@@ -154,7 +166,11 @@ export default{
154
166
  },
155
167
 
156
168
  addPivot(type, obj){
157
- console.log(this.pivot, type)
169
+ if(!Array.isArray(this.pivot[type])){
170
+ this.pivot[type] = []
171
+ }
172
+ console.log(this.pivot[type])
173
+
158
174
  this.pivot[type].push(Object.assign({}, obj))
159
175
  this.apply()
160
176
  },
@@ -179,8 +195,4 @@ export default{
179
195
 
180
196
  }
181
197
 
182
- .columnTextbox input::placeholder{
183
- @apply text-text;
184
- }
185
-
186
198
  </style>
@@ -52,10 +52,10 @@
52
52
  </template>
53
53
 
54
54
  <div v-if="mode === 'select'" class="flex-1 flex flex-col">
55
- <div class="flex flex-col bg-base-300 border-t-[1px] border-b-[1px] border-text-50 divide-y divide-text-50">
55
+ <div class="flex flex-col bg-base-300 border-t-[1px] border-b-[1px] border-border-50 divide-y divide-border-50">
56
56
  <div v-for="(preset, idx) in config.presets"
57
57
  class="px-6 text-left hover:bg-primary-200 hover:text-white flex flex-row items-center">
58
- <div class="flex-1 py-4" @click="select(idx)">
58
+ <div class="flex-1 py-4" @click="select(preset)">
59
59
  {{ preset.name }}
60
60
  </div>
61
61
  <button type="button"
@@ -69,7 +69,7 @@
69
69
 
70
70
  <ContextMenu ref="contextMenu" position="bottom-right">
71
71
  <template #default="{ context }">
72
- <div class="flex flex-col min-w-[200px] divide-y divide-text-50">
72
+ <div class="flex flex-col min-w-[200px] divide-y divide-border-50">
73
73
 
74
74
  <button class="w-full p-3 text-left flex flex-row gap-3" :class="appStyle.menuItem"
75
75
  @click="edit(context.idx)">
@@ -103,10 +103,10 @@
103
103
  <div v-else class="flex-1 flex flex-row">
104
104
 
105
105
  <div v-if="tabIndex === 1" class="flex-1 flex flex-row">
106
- <div class="w-[240px] border-r-[1px] border-text-50 overflow-y-auto">
107
- <div class="flex flex-col divide-y divide-text-50">
106
+ <div class="w-[240px] border-r-[1px] border-border-50 overflow-y-auto">
107
+ <div class="flex flex-col divide-y divide-border-50">
108
108
  <ListItem :items="presetColumns"
109
- body-class="divide-y divide-text-50"
109
+ body-class="divide-y divide-border-50"
110
110
  @reorder="(from, to) => { presetColumns.splice(to, 0, presetColumns.splice(from, 1)[0]); }">
111
111
  <template v-slot="{ item }">
112
112
  <div class="flex flex-row items-center gap-3 px-3 p-2 hover:bg-primary-100"
@@ -118,7 +118,7 @@
118
118
  <div class="flex-1 flex flex-row gap-2 items-center">
119
119
  <div>
120
120
  <div class="w-[14px] rounded-full h-[14px]"
121
- :class="!('visible' in item) || item.visible ? 'bg-primary' : 'bg-text-200'"></div>
121
+ :class="!('visible' in item) || item.visible ? 'bg-primary' : 'bg-text-300'"></div>
122
122
  </div>
123
123
  {{ item.label ? item.label : item.key }}
124
124
  </div>
@@ -150,9 +150,9 @@
150
150
  </div>
151
151
 
152
152
  <div v-if="tabIndex === 2" class="flex-1 flex flex-row">
153
- <div class="w-[200px] border-r-[1px] border-text-50 overflow-y-auto">
153
+ <div class="w-[200px] border-r-[1px] border-border-50 overflow-y-auto">
154
154
 
155
- <div class="flex flex-col divide-y divide-text-50 border-b-[1px] border-text-50">
155
+ <div class="flex flex-col divide-y divide-border-50 border-b-[1px] border-border-50">
156
156
  <button v-for="column in filterColumns"
157
157
  type="button"
158
158
  :disabled="filterColumnAdded(column)"
@@ -169,7 +169,7 @@
169
169
 
170
170
  </div>
171
171
 
172
- <div class="flex-1 flex flex-col divide-y divide-text-50 overflow-y-auto">
172
+ <div class="flex-1 flex flex-col divide-y divide-border-50 overflow-y-auto">
173
173
 
174
174
  <div v-for="(filter, idx) in preset.filters" class="p-6">
175
175
 
@@ -334,7 +334,7 @@
334
334
  </div>
335
335
  <ListItem :items="presetPivot.rows"
336
336
  @reorder="(from, to) => { presetPivot.rows.splice(to, 0, presetPivot.rows.splice(from, 1)[0]); }"
337
- class="mt-2 h-[200px] border-[1px] border-text-200">
337
+ class="mt-2 h-[200px] border-[1px] border-border-200">
338
338
  <template v-slot="{ item, index }">
339
339
  <div class="flex flex-row items-center gap-3 p-2 hover:bg-primary-100">
340
340
  <div data-reorder>
@@ -371,7 +371,7 @@
371
371
  </div>
372
372
  <ListItem :items="presetPivot.columns"
373
373
  @reorder="(from, to) => { presetPivot.columns.splice(to, 0, presetPivot.columns.splice(from, 1)[0]); }"
374
- class="mt-2 h-[200px] border-[1px] border-text-200">
374
+ class="mt-2 h-[200px] border-[1px] border-border-200">
375
375
  <template v-slot="{ item, index }">
376
376
  <div class="flex flex-row items-center gap-3 p-2 hover:bg-primary-100">
377
377
  <div data-reorder>
@@ -399,7 +399,7 @@
399
399
  </div>
400
400
  <ListItem :items="presetPivot.values"
401
401
  @reorder="(from, to) => { presetPivot.values.splice(to, 0, presetPivot.values.splice(from, 1)[0]); }"
402
- class="mt-2 h-[200px] border-[1px] border-text-200">
402
+ class="mt-2 h-[200px] border-[1px] border-border-200">
403
403
  <template v-slot="{ item, index }">
404
404
  <div class="flex flex-row items-center gap-3 p-2 hover:bg-primary-100">
405
405
  <div data-reorder>
@@ -464,7 +464,7 @@ export default{
464
464
 
465
465
  emits: [ 'select' ],
466
466
 
467
- inject: [ 'appStyle', 'alert', 'confirm', 'socketEmit2' ],
467
+ inject: [ 'appStyle', 'alert', 'confirm' ],
468
468
 
469
469
  props: {
470
470
 
@@ -479,6 +479,18 @@ export default{
479
479
 
480
480
  computed: {
481
481
 
482
+ configParams(){
483
+ if(!this.config.params)
484
+ this.config.params = {}
485
+
486
+ if(this.config.presets.length > 0 &&
487
+ (!this.config.params.presetIdx ||
488
+ !this.config.presets.find(_ => _.uid === this.config.params.presetIdx)))
489
+ this.config.params.presetIdx = this.config.presets[0].uid
490
+
491
+ return this.config.params
492
+ },
493
+
482
494
  filterColumns(){
483
495
  return JSON.parse(JSON.stringify(this.config.columns ?? []))
484
496
  .filter(_ => !('filterable' in _) || _.filterable)
@@ -641,8 +653,8 @@ export default{
641
653
  })
642
654
  },
643
655
 
644
- select(idx){
645
- this.config.presetIdx = idx
656
+ select(item){
657
+ this.configParams.presetIdx = item.uid
646
658
  this.close()
647
659
  this.$emit('select')
648
660
  },
@@ -652,7 +664,7 @@ export default{
652
664
  return 'boolean'
653
665
  else if([ 'date' ].includes(type))
654
666
  return 'date'
655
- else if([ 'number' ].includes(type))
667
+ else if([ 'number', 'currency', 'decimal' ].includes(type))
656
668
  return 'number'
657
669
  else
658
670
  return 'text'
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
+
6
+ <div>
7
+ <label class="flex-1 text-text-400">API Url</label>
8
+ <Textbox v-model="item.props.apiUrl"/>
9
+ </div>
10
+
11
+ </div>
12
+
13
+ <ComponentSetting2 :item="item"
14
+ :view-type="viewType"
15
+ :view-types="viewTypes"
16
+ :view-index="viewIndex"
17
+ defaultDisplay="block"
18
+ @change="$emit('change')" />
19
+
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+
25
+ export default{
26
+
27
+ emits: [ 'change' ],
28
+
29
+ props: {
30
+
31
+ item: {
32
+ type: Object,
33
+ required: true
34
+ },
35
+
36
+ viewType: String,
37
+
38
+ viewIndex: Number,
39
+
40
+ viewTypes: Array,
41
+
42
+ },
43
+
44
+ data(){
45
+ return {
46
+ }
47
+ },
48
+
49
+ inject: [ ],
50
+
51
+ methods: {
52
+
53
+
54
+ },
55
+
56
+ computed: {
57
+
58
+ }
59
+
60
+ }
61
+
62
+ </script>
63
+
64
+ <style module>
65
+
66
+ .comp{
67
+ @apply flex flex-col divide-y divide-border-50;
68
+ }
69
+
70
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :data-uid="uid">
3
3
  <strong v-if="title" class="mr-6">{{ title }}</strong>
4
4
 
5
5
  <div v-if="direction === 'vertical'" class="flex-1 flex flex-col divide-y divide-text-100 self-stretch">
@@ -110,7 +110,6 @@ export default{
110
110
  },
111
111
 
112
112
  waShareUrl(){
113
- if(typeof window === 'undefined') return
114
113
  return `https://wa.me/send?text=` + encodeURIComponent(this.currentUrl)
115
114
  },
116
115
 
@@ -1,59 +1,64 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
3
 
4
- <div>
5
- <label class="text-text-400">Title</label>
6
- <Textbox v-model="item.props.title" @keyup.enter="$emit('change')"/>
7
- </div>
8
-
9
- <div>
10
- <div class="flex flex-row items-center gap-4">
11
- <label class="flex-1 text-text-400">Platform</label>
12
- <button type="button" class="text-primary p-2" @click="(e) => $refs.contextMenu.open(e.target)">Add Platform</button>
13
- </div>
14
- <ListItem :items="item.props.channels"
15
- @reorder="(from, to) => { item.props.channels.splice(to, 0, item.props.channels.splice(from, 1)[0]); $emit('change') }">
16
- <template v-slot="{ item:channel, index }">
17
- <div class="flex flex-row items-center gap-2 mb-1 bg-text-50 rounded-lg p-2">
18
- <div data-reorder>
19
- <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path 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"/></svg>
20
- </div>
21
- <div class="flex-1">{{ channel.channel }}</div>
22
- <div>
23
- <button type="button" @click="confirm('Hapus channel ini?', '', () => { item.props.channels.splice(index, 1); $emit('change') })">
24
- <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path 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"/></svg>
25
- </button>
26
- </div>
27
- </div>
28
- </template>
29
- </ListItem>
30
- </div>
31
-
32
- <ComponentSetting2 :item="item"
33
- :view-type="viewType"
34
- :view-types="viewTypes"
35
- defaultDisplay="flex"
36
- @change="$emit('change')" />
37
-
38
- <ContextMenu ref="contextMenu" position="bottom-right">
39
- <div class="flex flex-col min-w-[200px]">
40
- <button type="button" class="p-3 disabled:text-text-300"
41
- @click="item.props.channels.push({ channel:'facebook' });$emit('change')"
42
- :disabled="item.props.channels.findIndex(_ => _.channel === 'facebook') > -1">Facebook</button>
43
-
44
- <button type="button" class="p-3 disabled:text-text-300"
45
- @click="item.props.channels.push({ channel:'twitter' });$emit('change')"
46
- :disabled="item.props.channels.findIndex(_ => _.channel === 'twitter') > -1">Twitter</button>
47
-
48
- <button type="button" class="p-3 disabled:text-text-300"
49
- @click="item.props.channels.push({ channel:'whatsapp' });$emit('change')"
50
- :disabled="item.props.channels.findIndex(_ => _.channel === 'whatsapp') > -1">Whatsapp</button>
51
-
52
- <button type="button" class="p-3 disabled:text-text-300"
53
- @click="item.props.channels.push({ channel:'instagram' });$emit('change')"
54
- :disabled="item.props.channels.findIndex(_ => _.channel === 'instagram') > -1">Instagram</button>
55
- </div>
56
- </ContextMenu>
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
+ <div>
6
+ <label class="text-text-400">Title</label>
7
+ <Textbox v-model="item.props.title" @keyup.enter="$emit('change')"/>
8
+ </div>
9
+
10
+ <div>
11
+ <div class="flex flex-row items-center gap-4">
12
+ <label class="flex-1 text-text-400">Platform</label>
13
+ <button type="button" class="text-primary p-2" @click="(e) => $refs.contextMenu.open(e.target)">Add Platform</button>
14
+ </div>
15
+ <ListItem :items="item.props.channels"
16
+ class="border-[1px] border-border-200 bg-base-300 rounded-lg overflow-hidden"
17
+ container-class="divide-y divide-border-50"
18
+ @reorder="(from, to) => { item.props.channels.splice(to, 0, item.props.channels.splice(from, 1)[0]); $emit('change') }">
19
+ <template v-slot="{ item:channel, index }">
20
+ <div class="flex flex-row items-center gap-2 p-2">
21
+ <div data-reorder>
22
+ <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path 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"/></svg>
23
+ </div>
24
+ <div class="flex-1">{{ channel.channel }}</div>
25
+ <div>
26
+ <button type="button" @click="confirm('Hapus channel ini?', '', () => { item.props.channels.splice(index, 1); $emit('change') })">
27
+ <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path 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"/></svg>
28
+ </button>
29
+ </div>
30
+ </div>
31
+ </template>
32
+ </ListItem>
33
+ </div>
34
+ </div>
35
+
36
+ <ContextMenu ref="contextMenu" position="bottom-right">
37
+ <div class="flex flex-col min-w-[200px]">
38
+ <button type="button" class="p-3 disabled:text-text-300"
39
+ @click="item.props.channels.push({ channel:'facebook' });$emit('change')"
40
+ :disabled="item.props.channels.findIndex(_ => _.channel === 'facebook') > -1">Facebook</button>
41
+
42
+ <button type="button" class="p-3 disabled:text-text-300"
43
+ @click="item.props.channels.push({ channel:'twitter' });$emit('change')"
44
+ :disabled="item.props.channels.findIndex(_ => _.channel === 'twitter') > -1">Twitter</button>
45
+
46
+ <button type="button" class="p-3 disabled:text-text-300"
47
+ @click="item.props.channels.push({ channel:'whatsapp' });$emit('change')"
48
+ :disabled="item.props.channels.findIndex(_ => _.channel === 'whatsapp') > -1">Whatsapp</button>
49
+
50
+ <button type="button" class="p-3 disabled:text-text-300"
51
+ @click="item.props.channels.push({ channel:'instagram' });$emit('change')"
52
+ :disabled="item.props.channels.findIndex(_ => _.channel === 'instagram') > -1">Instagram</button>
53
+ </div>
54
+ </ContextMenu>
55
+
56
+ <ComponentSetting2 :item="item"
57
+ :view-type="viewType"
58
+ :view-types="viewTypes"
59
+ :view-index="viewIndex"
60
+ defaultDisplay="block"
61
+ @change="$emit('change')" />
57
62
 
58
63
  </div>
59
64
  </template>
@@ -68,14 +73,16 @@ export default{
68
73
 
69
74
  props: {
70
75
 
71
- item: {
72
- type: Object,
73
- required: true
74
- },
76
+ item: {
77
+ type: Object,
78
+ required: true
79
+ },
75
80
 
76
- viewType: String,
81
+ viewType: String,
77
82
 
78
- viewTypes: Array,
83
+ viewIndex: Number,
84
+
85
+ viewTypes: Array,
79
86
 
80
87
  }
81
88
 
@@ -86,7 +93,7 @@ export default{
86
93
  <style module>
87
94
 
88
95
  .comp{
89
- @apply flex flex-col gap-4;
96
+ @apply flex flex-col divide-y divide-border-50;
90
97
  }
91
98
 
92
99
  </style>