@mixd-id/web-scaffold 0.2.240701 → 0.2.240703

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 (92) hide show
  1. package/docs/schema/user-action.json +266 -0
  2. package/package.json +6 -2
  3. package/public/assets/dashboard/bar.png +0 -0
  4. package/public/assets/dashboard/doughnut.png +0 -0
  5. package/public/assets/dashboard/metric.png +0 -0
  6. package/public/assets/dashboard/pie.png +0 -0
  7. package/public/assets/dashboard/polar-area.png +0 -0
  8. package/public/assets/dashboard/virtual-table.png +0 -0
  9. package/public/static/dashboard/bar.png +0 -0
  10. package/public/static/dashboard/doughnut.png +0 -0
  11. package/public/static/dashboard/metric.png +0 -0
  12. package/public/static/dashboard/pie.png +0 -0
  13. package/public/static/dashboard/polar-area.png +0 -0
  14. package/public/static/dashboard/virtual-table.png +0 -0
  15. package/src/components/Button.vue +179 -160
  16. package/src/components/Checkbox.vue +0 -1
  17. package/src/components/Datepicker.vue +8 -6
  18. package/src/components/GHeatMaps.vue +317 -0
  19. package/src/components/GmapsDirection.vue +191 -0
  20. package/src/components/Grid.vue +2 -0
  21. package/src/components/HTMLEditor.vue +2 -2
  22. package/src/components/List.vue +384 -308
  23. package/src/components/Modal.vue +2 -3
  24. package/src/components/PresetSelectorFilterItem.vue +15 -2
  25. package/src/components/Switch.vue +3 -0
  26. package/src/components/Tabs.vue +1 -1
  27. package/src/components/TextWithTag.vue +67 -25
  28. package/src/components/Textbox.vue +5 -0
  29. package/src/components/VirtualGrid.vue +224 -228
  30. package/src/components/VirtualTable.vue +46 -28
  31. package/src/configs/dashboard/bar.js +10 -0
  32. package/src/configs/dashboard/collection-1.js +5 -0
  33. package/src/configs/dashboard/doughnut.js +7 -0
  34. package/src/configs/dashboard/gheatmaps.js +9 -0
  35. package/src/configs/dashboard/grid-2.js +34 -0
  36. package/src/configs/dashboard/grid-3.js +34 -0
  37. package/src/configs/dashboard/grid-4.js +34 -0
  38. package/src/configs/dashboard/grid.js +15 -0
  39. package/src/configs/dashboard/metric.js +10 -0
  40. package/src/configs/dashboard/pie.js +7 -0
  41. package/src/configs/dashboard/polar-area.js +7 -0
  42. package/src/configs/dashboard/virtual-table.js +9 -0
  43. package/src/defs/dashboard-preset.js +22 -0
  44. package/src/index.js +35 -23
  45. package/src/mixin/ready-state.js +37 -0
  46. package/src/stores/datasource.js +11 -0
  47. package/src/themes/default/index.js +1 -1
  48. package/src/utils/dashboard.js +1080 -0
  49. package/src/utils/event-bus.js +8 -0
  50. package/src/utils/helpers.js +56 -10
  51. package/src/utils/helpers.mjs +35 -1
  52. package/src/utils/preset-selector.js +5 -2
  53. package/src/utils/preset-selector.mjs +23 -13
  54. package/src/widgets/Dashboard/BarChart.vue +330 -0
  55. package/src/widgets/Dashboard/BarChartSetting.vue +317 -0
  56. package/src/widgets/Dashboard/DatasourceFilterSharing.vue +93 -0
  57. package/src/widgets/Dashboard/DatasourcePreview.vue +93 -0
  58. package/src/widgets/Dashboard/DatasourceSelector.vue +122 -0
  59. package/src/widgets/Dashboard/Doughnut.vue +157 -0
  60. package/src/widgets/Dashboard/DoughnutSetting.vue +196 -0
  61. package/src/widgets/Dashboard/GHeatMapsSetting.vue +108 -0
  62. package/src/widgets/Dashboard/InteractionEdit.vue +228 -0
  63. package/src/widgets/Dashboard/Metric.vue +76 -0
  64. package/src/widgets/Dashboard/MetricSetting.vue +174 -0
  65. package/src/widgets/Dashboard/Pie.vue +139 -0
  66. package/src/widgets/Dashboard/PieSetting.vue +247 -0
  67. package/src/widgets/Dashboard/PolarArea.vue +159 -0
  68. package/src/widgets/Dashboard/PolarAreaSetting.vue +195 -0
  69. package/src/widgets/Dashboard/SharingModal.vue +116 -0
  70. package/src/widgets/Dashboard/ViewSelector.vue +183 -0
  71. package/src/widgets/Dashboard/VirtualColumnEdit.vue +97 -0
  72. package/src/widgets/Dashboard/VirtualTableSetting.vue +234 -0
  73. package/src/widgets/Dashboard.vue +1773 -0
  74. package/src/widgets/PresetBar.vue +136 -175
  75. package/src/widgets/PresetBarPivot.vue +186 -0
  76. package/src/widgets/UserActionBuilder/UserActionCondition.vue +97 -0
  77. package/src/widgets/UserActionBuilder/UserActionConsole.vue +77 -0
  78. package/src/widgets/UserActionBuilder/UserActionItem.vue +163 -58
  79. package/src/widgets/UserActionBuilder/UserActionOutput.vue +35 -9
  80. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +27 -0
  81. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +28 -0
  82. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +135 -0
  83. package/src/widgets/UserActionBuilder/UserActionProps.vue +211 -0
  84. package/src/widgets/UserActionBuilder.vue +68 -199
  85. package/src/widgets/WebPageBuilder4/GridSetting.vue +123 -73
  86. package/src/widgets/WebPageBuilder4/HeightSetting.vue +14 -11
  87. package/src/widgets/WebPageBuilder4/MarginSetting.vue +4 -1
  88. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +12 -4
  89. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +4 -0
  90. package/src/widgets/WebPageBuilder4/TreeView.vue +6 -3
  91. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +32 -58
  92. package/tailwind.config.js +2 -2
@@ -7,24 +7,30 @@
7
7
 
8
8
  <div class="flex-1 flex flex-col gap-5 p-5">
9
9
 
10
- <div>
10
+ <div class="flex flex-row items-center gap-2">
11
+ <div class="flex-1">
12
+ <h5>User</h5>
13
+ </div>
11
14
  <button type="button" @click="create">
12
15
  <svg width="21" height="21" 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 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"/></svg>
13
16
  </button>
14
17
  </div>
15
18
 
16
- <VirtualGrid :items="items" class="rounded-xl" container-class="divide-y divide-text-50">
17
- <template #item="{ item }">
18
- <div class="p-3 hover:bg-base-500 flex flex-row"
19
- :class="item.uid === actionUid ? 'bg-base-500' : 'bg-base-400'"
20
- @click="$emit('select', item.uid)">
21
- <label class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap">{{ item.name }}</label>
22
- <button type="button" @click="$emit('remove', item )">
23
- <svg width="14" height="14" 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="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>
24
- </button>
25
- </div>
26
- </template>
27
- </VirtualGrid>
19
+ <div class="flex-1 flex flex-col">
20
+ <label class="text-text-300">Actions</label>
21
+ <VirtualGrid :items="items" class="flex-1 rounded-xl" container-class="divide-y divide-text-50">
22
+ <template #item="{ item }">
23
+ <div class="p-3 hover:bg-base-500 flex flex-row"
24
+ :class="item.uid === actionUid ? 'bg-base-500' : 'bg-base-400'"
25
+ @click="$emit('select', item.uid)">
26
+ <label class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap">{{ item.name }}</label>
27
+ <button type="button" @click="$emit('remove', item )">
28
+ <svg width="14" height="14" 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="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>
29
+ </button>
30
+ </div>
31
+ </template>
32
+ </VirtualGrid>
33
+ </div>
28
34
  </div>
29
35
 
30
36
  </div>
@@ -34,6 +40,14 @@
34
40
  <div class="flex-1 flex flex-row">
35
41
  <div class="flex-1 flex flex-col">
36
42
 
43
+ <div class="p-2 flex flex-row items-center panel-400 border-b-[1px] border-text-50">
44
+ <h5 class="pl-3">{{ item?.name }}</h5>
45
+ <div class="flex-1"></div>
46
+ <div>
47
+ <Button class="px-6 rounded-full" @click="save">Save</Button>
48
+ </div>
49
+ </div>
50
+
37
51
  <div class="flex-1 overflow-auto">
38
52
  <div class="p-12" v-if="item">
39
53
  <UserActionItem :config="config"
@@ -43,150 +57,22 @@
43
57
  </div>
44
58
  </div>
45
59
 
60
+ <div class="p-5" v-if="item && item.type === 1 && item.key === 'onNewMessage'">
61
+ <UserActionConsole ref="console"
62
+ @test-message="testMessage"
63
+ @test-reset="$emit('test-reset')" />
64
+ </div>
65
+
46
66
  </div>
47
67
 
48
68
  <div :class="$style.rightPane" :style="rightStyle">
49
69
  <div :class="$style.rightBoundary" @mousedown="(e) => $util.dragResize(e, resize2)"></div>
50
70
 
51
- <div v-if="selectedItem" class="p-5 flex flex-col gap-5">
52
-
53
- <div class="flex flex-row gap-5">
54
- <div class="flex-1">
55
- <label>Name</label>
56
- <Textbox v-model="selectedItem.name" class="mt-1"/>
57
- </div>
58
- <div>
59
- <label>Enabled</label>
60
- <Switch v-model="selectedItem.enabled" class="mt-1"/>
61
- </div>
62
- </div>
63
-
64
- <div>
65
- <label>Type</label>
66
- <div class="flex flex-row gap-3 mt-1">
67
- <Radio v-model="selectedItem.type" :value="1">Event</Radio>
68
-
69
- <Radio v-model="selectedItem.type" :value="2">Time</Radio>
70
- </div>
71
- </div>
72
-
73
- <div>
74
- <label>Event</label>
75
- <Dropdown class="mt-1" v-model="selectedItem.event">
76
- <option v-for="(obj, key) in eventOpt" :value="key">{{ obj.text }}</option>
77
- </Dropdown>
78
- </div>
79
-
80
- <div>
81
- <div class="flex flex-row items-center gap-2">
82
- <label class="flex-1">Condition</label>
83
- <button type="button" class="text-primary" @click="addParams(selectedItem)">Add Condition</button>
84
- </div>
85
- <ListItem :items="selectedItem.params"
86
- @reorder="(from, to) => { selectedItem.params.splice(to, 0, selectedItem.params.splice(from, 1)[0]); }">
87
- <template v-slot="{ item, index }">
88
- <div class="flex flex-row items-center gap-2 px-3">
89
- <div data-reorder>
90
- <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>
91
- </div>
92
- <div class="flex-1 flex flex-row gap-2">
93
- <Dropdown class="w-[100px]" v-model="item.key">
94
- <option v-for="column in eventOpt['message.create']['conditions']" :value="column.key">
95
- {{ column.text }}
96
- </option>
97
- </Dropdown>
98
- <div class="flex flex-row gap-2">
99
- <Dropdown class="w-[80px]" v-model="item.op">
100
- <option value="contains">Contains</option>
101
- </Dropdown>
102
- <Textbox class="w-[100px]" v-model="item.value"></Textbox>
103
- </div>
104
- </div>
105
- <div>
106
- <button type="button" @click="selectedItem.params.splice(index, 1)">
107
- <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>
108
- </button>
109
- </div>
110
- </div>
111
- </template>
112
- </ListItem>
113
- </div>
114
-
115
- <div>
116
- <div class="flex flex-row items-center gap-2">
117
- <label class="flex-1">Output</label>
118
- <button type="button" class="text-primary" @click="$refs.userActionOutput.create()">Add Output</button>
119
- </div>
120
- <ListItem :items="selectedItem.output"
121
- class="mt-1 border-[1px] rounded-xl border-text-200"
122
- container-class="divide-y divide-text-200"
123
- @reorder="(from, to) => { selectedItem.output.splice(to, 0, selectedItem.output.splice(from, 1)[0]); }">
124
- <template v-slot="{ item, index }">
125
- <div class="flex flex-row items-center gap-3 px-3">
126
- <div data-reorder>
127
- <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>
128
- </div>
129
- <div class="flex-1 p-2">
130
- {{ item.text }}
131
- </div>
132
- <button type="button" @click="selectedItem.output.splice(index, 1)">
133
- <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>
134
- </button>
135
- </div>
136
- </template>
137
- </ListItem>
138
-
139
- <UserActionOutput ref="userActionOutput" :outputs="outputs" @apply="addOutput">
140
-
141
- <template #reply="{ output }">
142
- <slot name="output-reply">
143
- <div class="p-6 flex flex-col gap-5">
144
-
145
- <div>
146
- <label class="text-text-400">Image</label>
147
- <Image :src="output.params.imageUrl"
148
- :editable="true"
149
- @change="(base64, file) => output.params.imageUrl = file"
150
- ref="image"
151
- class="w-full min-h-[100px] border-[1px] border-text-200 bg-base-500 rounded-lg flex">
152
- <template #empty>
153
- <div class="flex-1 flex items-center justify-center">
154
- <button type="button" @click="$refs.image.edit()">
155
- <svg width="24" height="24" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M630.8 469.1l-55.95-43.85C575.3 422.2 575.1 419.2 575.1 416l.0034-320c0-35.35-28.65-64-64-64H127.1C113.6 32 100.4 36.98 89.78 45.06L38.81 5.113C28.34-3.058 13.31-1.246 5.109 9.192C-3.063 19.63-1.235 34.72 9.187 42.89L601.2 506.9C605.6 510.3 610.8 512 615.1 512c7.125 0 14.17-3.156 18.91-9.188C643.1 492.4 641.2 477.3 630.8 469.1zM223.1 149.6l-64.29-50.39C164.2 97.15 169.9 96 175.1 96c26.51 0 48 21.49 48 48C223.1 145.9 223.4 147.7 223.1 149.6zM331.2 234.3l23.45-35.18C357.7 194.7 362.7 192 368 192s10.35 2.672 13.31 7.125l103.9 155.9L331.2 234.3zM145.1 416c-6.021 0-11.53-3.379-14.26-8.75c-2.73-5.367-2.215-11.81 1.334-16.68l70-96C206.1 290.4 210.9 288 216 288s9.916 2.441 12.93 6.574l32.46 44.51l16.43-24.65L63.99 146.8L63.99 416c0 35.35 28.65 64 64 64h361.1l-81.66-64H145.1z"/></svg>
156
- </button>
157
- </div>
158
- </template>
159
- </Image>
160
- </div>
161
-
162
- <div>
163
- <label class="text-text-400">Text</label>
164
- <TextWithTag rows="5" v-model="output.params.text" :items="replyTextItems" />
165
- </div>
166
-
167
- </div>
168
- </slot>
169
- </template>
170
-
171
- </UserActionOutput>
172
- </div>
173
-
174
- </div>
175
-
176
- <div class="p-5">
177
- <pre class="text-xs">{{ selectedItem }}</pre>
178
- </div>
71
+ <UserActionProps ref="userActionProps" :instance="selectedItem" />
179
72
 
180
73
  </div>
181
74
  </div>
182
75
 
183
- <div class="p-2 px-5 flex flex-row">
184
- <div>
185
- <Button class="w-[100px]" @click="save">Save</Button>
186
- </div>
187
- <div class="flex-1"></div>
188
- </div>
189
-
190
76
  </div>
191
77
 
192
78
  <div v-else class="flex-1 flex flex-col items-center justify-center">
@@ -202,10 +88,14 @@
202
88
  import UserActionItem from './UserActionBuilder/UserActionItem.vue'
203
89
  import UserActionOutput from './UserActionBuilder/UserActionOutput.vue'
204
90
  import VirtualGrid from '../components/VirtualGrid.vue'
91
+ import UserActionConsole from "./UserActionBuilder/UserActionConsole.vue";
92
+ import UserActionProps from "./UserActionBuilder/UserActionProps.vue";
205
93
 
206
94
  export default{
207
95
 
208
96
  components: {
97
+ UserActionProps,
98
+ UserActionConsole,
209
99
  UserActionOutput,
210
100
  UserActionItem,
211
101
  VirtualGrid
@@ -213,6 +103,10 @@ export default{
213
103
 
214
104
  computed: {
215
105
 
106
+ canIsFallback(){
107
+ return true
108
+ },
109
+
216
110
  cConfig(){
217
111
  return this.config ?? this._config
218
112
  },
@@ -233,18 +127,6 @@ export default{
233
127
  }
234
128
  },
235
129
 
236
- outputs(){
237
- return this.eventOpt[this.selectedItem.event]?.outputs ?? []
238
- },
239
-
240
- replyTextItems(){
241
- return [
242
- { text:"Mobile Number", value:"{mobileNumber}" },
243
- { text:"Name", value:"{name}" },
244
- { text:"Created At", value:"{createdAt}" },
245
- ]
246
- },
247
-
248
130
  rightBar() {
249
131
  if (!this.cConfig.rightBar) {
250
132
  this.cConfig.rightBar = {
@@ -293,30 +175,12 @@ export default{
293
175
  }
294
176
  },
295
177
 
296
- emits: [ 'remove', 'select' ],
178
+ emits: [ 'remove', 'select', 'test-message', 'test-reset' ],
297
179
 
298
180
  inject: [ 'alert', 'confirm', 'socket', 'toast' ],
299
181
 
300
182
  methods: {
301
183
 
302
- addParams(item){
303
- if(!Array.isArray(item.params))
304
- item.params = []
305
-
306
- item.params.push({})
307
- },
308
-
309
- addOutput(output, idx){
310
- if(!this.selectedItem) return
311
-
312
- if(!Array.isArray(this.selectedItem.output))
313
- this.selectedItem.output = []
314
-
315
- idx ?
316
- Object.assign(this.selectedItem.output[idx], output) :
317
- this.selectedItem.output.push(output)
318
- },
319
-
320
184
  create(){
321
185
  this.socket.send(`${this.src}.create`, {})
322
186
  .then(_ => {
@@ -341,9 +205,24 @@ export default{
341
205
  .catch(err => this.toast(err))
342
206
  },
343
207
 
208
+ addTestMessage(message){
209
+ this.$refs.console.addMessage(message)
210
+ },
211
+
212
+ getWhatsappTemplateSrc(){
213
+ return this.whatsappTemplateSrc
214
+ },
215
+
216
+ testMessage(message){
217
+ this.$emit('test-message', {
218
+ message,
219
+ action: this.item
220
+ })
221
+ },
222
+
344
223
  resize1(w) {
345
224
  const nextWidth = this.leftBar.width + w
346
- if (nextWidth >= 240 && nextWidth <= 480) {
225
+ if (nextWidth >= 200 && nextWidth <= 480) {
347
226
  this.leftBar.width += w
348
227
  }
349
228
  },
@@ -356,7 +235,7 @@ export default{
356
235
  },
357
236
 
358
237
  save(){
359
- this.socket.send(`${this.src}.save`, this.item)
238
+ this.socket.send(`${this.src}.save`, { userId:this.uid, item:this.item })
360
239
  .then(_ => this.toast('Saved'))
361
240
  .catch(err => this.alert(err))
362
241
  },
@@ -377,34 +256,24 @@ export default{
377
256
 
378
257
  config: Object,
379
258
 
380
- eventOpt: {
381
- type: Object,
382
- default: () => ({
383
-
384
- 'message.create': {
385
- text: 'On message create',
386
- conditions: [
387
- { key:"body", text:"Text", type:"string", operators:[ [ 'contains', 'Contains' ], [ 'startsWith', 'Starts With' ] ] },
388
- { key:"direction", text:"Direction", type:"enum", enum:[ [ 1, 'In' ], [ 2, 'Out' ] ] },
389
- ],
390
- outputs: [
391
- { type: "reply", text:"Reply" }
392
- ]
393
- }
394
-
395
- })
396
- },
397
-
398
259
  timeOpt: {
399
260
  type: Object
400
261
  },
401
262
 
402
263
  src: [ String ],
403
264
 
265
+ whatsappTemplateSrc: String,
266
+
404
267
  uid: String,
405
268
 
406
269
  },
407
270
 
271
+ provide(){
272
+ return {
273
+ getWhatsappTemplateSrc: this.getWhatsappTemplateSrc
274
+ }
275
+ },
276
+
408
277
  watch: {
409
278
 
410
279
  actionUid: {
@@ -1,89 +1,125 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
- <strong>Grid Setting</strong>
4
3
 
5
4
  <div class="flex flex-row items-center">
6
- <label class="flex-1">Enabled</label>
7
- <Switch v-model="value.props.enabled" />
5
+ <label class="flex-1">Active</label>
6
+ <Switch v-model="value.props.enabled" :readonly="readonly" />
8
7
  </div>
9
8
 
10
- <div class="flex flex-row items-center">
11
- <label class="flex-1">Columns</label>
12
- <Dropdown v-for="(_, idx) in viewTypes"
13
- v-show="viewType === _.value"
14
- v-model="columns[idx]"
15
- class="w-[100px]">
16
- <option value="">Default</option>
17
- <option v-for="i in 12" :value="`${viewType}grid-cols-${i}`">{{ i }}</option>
18
- <option :value="`${viewType}grid-cols-none`">None</option>
19
- </Dropdown>
9
+ <div class="flex flex-col gap-1">
10
+ <label class="flex-1">Label</label>
11
+ <Textbox v-model="value.props.label"
12
+ maxlength="30"
13
+ placeholder="Label"
14
+ :readonly="readonly"
15
+ @keyup.enter="$emit('change')"
16
+ @blur="$emit('change')" />
20
17
  </div>
21
18
 
22
- <div class="flex flex-row items-center">
23
- <label class="flex-1">Rows</label>
24
- <Dropdown v-for="(_, idx) in viewTypes"
25
- v-show="viewType === _.value"
26
- v-model="rows[idx]"
27
- class="w-[100px]">
28
- <option value="">Default</option>
29
- <option v-for="i in 12" :value="`${viewType}grid-rows-${i}`">{{ i }}</option>
30
- <option :value="`${viewType}grid-rows-none`">None</option>
31
- </Dropdown>
19
+ <div class="grid grid-cols-3 gap-3">
20
+ <div>
21
+ <label class="flex-1">Columns</label>
22
+ <Dropdown v-for="(_, idx) in viewTypes"
23
+ v-show="viewType === _.value"
24
+ v-model="columns[idx]"
25
+ :readonly="readonly">
26
+ <option value="">Default</option>
27
+ <option v-for="i in 12" :value="`${viewType}grid-cols-${i}`">{{ i }}</option>
28
+ <option :value="`${viewType}grid-cols-none`">None</option>
29
+ </Dropdown>
30
+ </div>
31
+
32
+ <div>
33
+ <label class="flex-1">Rows</label>
34
+ <Dropdown v-for="(_, idx) in viewTypes"
35
+ v-show="viewType === _.value"
36
+ v-model="rows[idx]"
37
+ :readonly="readonly">
38
+ <option value="">Default</option>
39
+ <option v-for="i in 12" :value="`${viewType}grid-rows-${i}`">{{ i }}</option>
40
+ <option :value="`${viewType}grid-rows-none`">None</option>
41
+ </Dropdown>
42
+ </div>
43
+
44
+ <div>
45
+ <label class="flex-1">Gap</label>
46
+ <Dropdown v-for="(_, idx) in viewTypes"
47
+ v-show="viewType === _.value"
48
+ v-model="gap[idx]"
49
+ :readonly="readonly">
50
+ <option value="">Not Set</option>
51
+ <option :value="`${viewType}gap-0`">0</option>
52
+ <option :value="`${viewType}gap-1`">1</option>
53
+ <option :value="`${viewType}gap-2`">2</option>
54
+ <option :value="`${viewType}gap-3`">3</option>
55
+ <option :value="`${viewType}gap-4`">4</option>
56
+ <option :value="`${viewType}gap-5`">5</option>
57
+ <option :value="`${viewType}gap-6`">6</option>
58
+ <option :value="`${viewType}gap-7`">7</option>
59
+ <option :value="`${viewType}gap-8`">8</option>
60
+ </Dropdown>
61
+ </div>
32
62
  </div>
33
63
 
34
- <div class="flex flex-row items-center">
35
- <label class="flex-1">Gap</label>
36
- <Dropdown v-for="(_, idx) in viewTypes"
37
- v-show="viewType === _.value"
38
- v-model="gap[idx]">
39
- <option value="">Not Set</option>
40
- <option :value="`${viewType}gap-0`">0</option>
41
- <option :value="`${viewType}gap-1`">1</option>
42
- <option :value="`${viewType}gap-2`">2</option>
43
- <option :value="`${viewType}gap-3`">3</option>
44
- <option :value="`${viewType}gap-4`">4</option>
45
- <option :value="`${viewType}gap-5`">5</option>
46
- <option :value="`${viewType}gap-6`">6</option>
47
- <option :value="`${viewType}gap-7`">7</option>
48
- <option :value="`${viewType}gap-8`">8</option>
49
- </Dropdown>
64
+ <div class="grid grid-cols-2 gap-3">
65
+ <div>
66
+ <label class="flex-1">Align Items</label>
67
+ <Dropdown v-for="(_, idx) in viewTypes"
68
+ v-show="viewType === _.value"
69
+ v-model="alignItems[idx]"
70
+ :readonly="readonly">
71
+ <option value="">Default</option>
72
+ <option :value="`${viewType}items-start`">Start</option>
73
+ <option :value="`${viewType}items-end`">End</option>
74
+ <option :value="`${viewType}items-center`">Center</option>
75
+ <option :value="`${viewType}items-baseline`">Baseline</option>
76
+ <option :value="`${viewType}items-stretch`">Stretch</option>
77
+ </Dropdown>
78
+ </div>
79
+
80
+ <div>
81
+ <label class="flex-1">Justify Content</label>
82
+ <Dropdown v-for="(_, idx) in viewTypes"
83
+ v-show="viewType === _.value"
84
+ v-model="justifyContent[idx]"
85
+ :readonly="readonly">
86
+ <option value="">Default</option>
87
+ <option :value="`${viewType}justify-normal`">Normal</option>
88
+ <option :value="`${viewType}justify-start`">Start</option>
89
+ <option :value="`${viewType}justify-end`">End</option>
90
+ <option :value="`${viewType}justify-center`">Center</option>
91
+ <option :value="`${viewType}justify-between`">Between</option>
92
+ <option :value="`${viewType}justify-around`">Around</option>
93
+ <option :value="`${viewType}justify-evenly`">Evenly</option>
94
+ <option :value="`${viewType}justify-stretch`">Stretch</option>
95
+ </Dropdown>
96
+ </div>
50
97
  </div>
51
98
 
52
- <div class="flex flex-row items-center">
53
- <label class="flex-1">Align Items</label>
54
- <Dropdown v-for="(_, idx) in viewTypes"
55
- v-show="viewType === _.value"
56
- v-model="alignItems[idx]">
57
- <option value="">Default</option>
58
- <option :value="`${viewType}items-start`">Start</option>
59
- <option :value="`${viewType}items-end`">End</option>
60
- <option :value="`${viewType}items-center`">Center</option>
61
- <option :value="`${viewType}items-baseline`">Baseline</option>
62
- <option :value="`${viewType}items-stretch`">Stretch</option>
63
- </Dropdown>
64
- </div>
65
-
66
- <div class="flex flex-row items-center">
67
- <label class="flex-1">Justify Content</label>
68
- <Dropdown v-for="(_, idx) in viewTypes"
69
- v-show="viewType === _.value"
70
- v-model="justifyContent[idx]">
71
- <option value="">Default</option>
72
- <option :value="`${viewType}justify-normal`">Normal</option>
73
- <option :value="`${viewType}justify-start`">Start</option>
74
- <option :value="`${viewType}justify-end`">End</option>
75
- <option :value="`${viewType}justify-center`">Center</option>
76
- <option :value="`${viewType}justify-between`">Between</option>
77
- <option :value="`${viewType}justify-around`">Around</option>
78
- <option :value="`${viewType}justify-evenly`">Evenly</option>
79
- <option :value="`${viewType}justify-stretch`">Stretch</option>
80
- </Dropdown>
99
+ <div class="grid grid-cols-2 gap-3">
100
+ <div>
101
+ <label class="flex-1">Col Span</label>
102
+ <Dropdown v-for="(_, idx) in viewTypes"
103
+ v-show="viewType === _.value"
104
+ v-model="colSpan[idx]"
105
+ :readonly="readonly">
106
+ <option value="">Default</option>
107
+ <option v-for="i in 12" :value="`${viewType}col-span-${i}`">{{ i }}</option>
108
+ </Dropdown>
109
+ </div>
110
+
111
+ <div>
112
+ <label class="flex-1">Row Span</label>
113
+ <Dropdown v-for="(_, idx) in viewTypes"
114
+ v-show="viewType === _.value"
115
+ v-model="rowSpan[idx]"
116
+ :readonly="readonly">
117
+ <option value="">Default</option>
118
+ <option v-for="i in 12" :value="`${viewType}row-span-${i}`">{{ i }}</option>
119
+ </Dropdown>
120
+ </div>
81
121
  </div>
82
122
 
83
- <PaddingSetting :value="value" :index="index" />
84
-
85
- <MarginSetting :value="value" :index="index" />
86
-
87
123
  </div>
88
124
  </template>
89
125
 
@@ -108,6 +144,8 @@ export default{
108
144
 
109
145
  index: Number,
110
146
 
147
+ readonly: [ Boolean, Number ],
148
+
111
149
  viewType: String,
112
150
 
113
151
  },
@@ -145,6 +183,18 @@ export default{
145
183
  return this.value.props.justifyContent
146
184
  },
147
185
 
186
+ colSpan(){
187
+ if(!Array.isArray(this.value.props.colSpan) || this.value.props.colSpan.length < 1)
188
+ this.value.props.colSpan = [ '' ]
189
+ return this.value.props.colSpan
190
+ },
191
+
192
+ rowSpan(){
193
+ if(!Array.isArray(this.value.props.rowSpan) || this.value.props.rowSpan.length < 1)
194
+ this.value.props.rowSpan = [ '' ]
195
+ return this.value.props.rowSpan
196
+ },
197
+
148
198
  },
149
199
 
150
200
  data(){
@@ -160,7 +210,7 @@ export default{
160
210
  <style module>
161
211
 
162
212
  .comp{
163
- @apply flex flex-col gap-5;
213
+ @apply flex flex-col gap-6 p-6;
164
214
  }
165
215
 
166
216
  </style>
@@ -2,7 +2,8 @@
2
2
  <div :class="$style.comp">
3
3
  <div class="flex flex-row items-center">
4
4
  <label class="flex-1">Height</label>
5
- <Dropdown v-model="height[index]">
5
+ <Dropdown v-model="height[index]"
6
+ :readonly="readonly">
6
7
  <option value="">Unset</option>
7
8
  <option v-for="value in values" :value="`${viewType}${value[0]}`">
8
9
  {{ value[1] }}
@@ -25,6 +26,8 @@ export default{
25
26
  required: true
26
27
  },
27
28
 
29
+ readonly: [ Boolean, Number ],
30
+
28
31
  value: {
29
32
  type: Object,
30
33
  required: true
@@ -69,16 +72,16 @@ export default{
69
72
  [ 'h-32', '32' ],
70
73
  [ 'h-36', '36' ],
71
74
  [ 'h-48', '48' ],
72
- [ 'h-10vh', '10vh' ],
73
- [ 'h-20vh', '20vh' ],
74
- [ 'h-30vh', '30vh' ],
75
- [ 'h-40vh', '40vh' ],
76
- [ 'h-50vh', '50vh' ],
77
- [ 'h-60vh', '60vh' ],
78
- [ 'h-70vh', '70vh' ],
79
- [ 'h-80vh', '80vh' ],
80
- [ 'h-90vh', '90vh' ],
81
- [ 'h-100vh', '100vh' ]
75
+ [ 'h-[10vh]', '10vh' ],
76
+ [ 'h-[20vh]', '20vh' ],
77
+ [ 'h-[30vh]', '30vh' ],
78
+ [ 'h-[40vh]', '40vh' ],
79
+ [ 'h-[50vh]', '50vh' ],
80
+ [ 'h-[60vh]', '60vh' ],
81
+ [ 'h-[70vh]', '70vh' ],
82
+ [ 'h-[80vh]', '80vh' ],
83
+ [ 'h-[90vh]', '90vh' ],
84
+ [ 'h-[100vh]', '100vh' ]
82
85
  ]
83
86
  }
84
87
  }