@mixd-id/web-scaffold 0.2.240702 → 0.2.240704

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 (95) 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 +37 -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 -8
  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/BotEditor/BotEditorActions.vue +162 -0
  55. package/src/widgets/BotEditor.vue +228 -0
  56. package/src/widgets/Dashboard/BarChart.vue +330 -0
  57. package/src/widgets/Dashboard/BarChartSetting.vue +317 -0
  58. package/src/widgets/Dashboard/DatasourceFilterSharing.vue +93 -0
  59. package/src/widgets/Dashboard/DatasourcePreview.vue +93 -0
  60. package/src/widgets/Dashboard/DatasourceSelector.vue +122 -0
  61. package/src/widgets/Dashboard/Doughnut.vue +157 -0
  62. package/src/widgets/Dashboard/DoughnutSetting.vue +196 -0
  63. package/src/widgets/Dashboard/GHeatMapsSetting.vue +108 -0
  64. package/src/widgets/Dashboard/InteractionEdit.vue +228 -0
  65. package/src/widgets/Dashboard/Metric.vue +76 -0
  66. package/src/widgets/Dashboard/MetricSetting.vue +174 -0
  67. package/src/widgets/Dashboard/Pie.vue +139 -0
  68. package/src/widgets/Dashboard/PieSetting.vue +247 -0
  69. package/src/widgets/Dashboard/PolarArea.vue +159 -0
  70. package/src/widgets/Dashboard/PolarAreaSetting.vue +195 -0
  71. package/src/widgets/Dashboard/SharingModal.vue +116 -0
  72. package/src/widgets/Dashboard/ViewSelector.vue +183 -0
  73. package/src/widgets/Dashboard/VirtualColumnEdit.vue +97 -0
  74. package/src/widgets/Dashboard/VirtualTableSetting.vue +234 -0
  75. package/src/widgets/Dashboard.vue +1773 -0
  76. package/src/widgets/PresetBar.vue +136 -175
  77. package/src/widgets/PresetBarPivot.vue +186 -0
  78. package/src/widgets/PresetSelector.vue +2 -2
  79. package/src/widgets/UserActionBuilder/UserActionCondition.vue +99 -0
  80. package/src/widgets/UserActionBuilder/UserActionConsole.vue +77 -0
  81. package/src/widgets/UserActionBuilder/UserActionItem.vue +166 -58
  82. package/src/widgets/UserActionBuilder/UserActionOutput.vue +35 -9
  83. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +27 -0
  84. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +28 -0
  85. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +135 -0
  86. package/src/widgets/UserActionBuilder/UserActionProps.vue +213 -0
  87. package/src/widgets/UserActionBuilder.vue +68 -199
  88. package/src/widgets/WebPageBuilder4/GridSetting.vue +123 -73
  89. package/src/widgets/WebPageBuilder4/HeightSetting.vue +14 -11
  90. package/src/widgets/WebPageBuilder4/MarginSetting.vue +4 -1
  91. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +12 -4
  92. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +4 -0
  93. package/src/widgets/WebPageBuilder4/TreeView.vue +6 -3
  94. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +32 -58
  95. package/tailwind.config.js +2 -2
@@ -0,0 +1,234 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <div class="flex justify-center border-b-[1px] border-text-50" v-if="tabItems.length > 1">
5
+ <Tabs :items="tabItems" v-model="value.tabIndex" />
6
+ </div>
7
+
8
+ <div class="flex-1 overflow-y-auto flex flex-col">
9
+ <div v-if="value.tabIndex === 1" class="flex-1 flex flex-col gap-5 p-6">
10
+
11
+ <div class="flex flex-row items-center ">
12
+ <label class="flex-1">Active</label>
13
+ <Switch v-model="value.props.enabled" :readonly="readonly" />
14
+ </div>
15
+
16
+ <div class="flex flex-col gap-1">
17
+ <label class="text-text-400">Label</label>
18
+ <Textbox v-model="value.props.label" maxlength="50" placeholder="Label" :readonly="readonly" />
19
+ </div>
20
+
21
+ <div class="flex flex-row items-center">
22
+ <label class="flex-1">Datasource</label>
23
+ <div>
24
+ <Dropdown class="min-w-[150px]"
25
+ :readonly="readonly"
26
+ v-model="value.props.datasourceUid">
27
+ <option v-for="_datasource in datasource"
28
+ :value="_datasource.uid">
29
+ {{ _datasource.name }}
30
+ </option>
31
+ </Dropdown>
32
+ </div>
33
+ </div>
34
+
35
+ </div>
36
+
37
+ <div v-else-if="value.tabIndex === 2" class="flex-1 flex flex-col gap-5 p-6">
38
+
39
+ <div>
40
+ <Textbox placeholder="Search..." v-model="search">
41
+ <template #start>
42
+ <div class="pl-3">
43
+ <svg width="14" height="14" class="fill-text-300" 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="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>
44
+ </div>
45
+ </template>
46
+ </Textbox>
47
+ </div>
48
+
49
+ <VirtualGrid class="flex-1 border-[1px] border-text-50 rounded-xl"
50
+ container-class="divide-y divide-text-50"
51
+ :items="columns">
52
+ <template #item="{ item }">
53
+ <div class="flex-1 flex flex-row gap-2 items-center p-1 px-3 group">
54
+ <div>
55
+ <Checkbox v-model="item.visible" default="true" :disabled="readonly" />
56
+ </div>
57
+ <Textbox v-model="item.label2" :placeholder="item.label" :readonly="readonly"
58
+ class="flex-1 border-none bg-transparent" :class="$style.columnTextbox"
59
+ item-class="p-1 px-0" />
60
+ <div class="hidden flex-col justify-center group-hover:flex">
61
+ <button type="button" @click="moveUp(item)">
62
+ <svg width="11" height="11" class="fill-text-300 hover:fill-primary" 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="M9.39 265.4l127.1-128C143.6 131.1 151.8 128 160 128s16.38 3.125 22.63 9.375l127.1 128c9.156 9.156 11.9 22.91 6.943 34.88S300.9 320 287.1 320H32.01c-12.94 0-24.62-7.781-29.58-19.75S.2333 274.5 9.39 265.4z"/></svg>
63
+ </button>
64
+ <button type="button" @click="moveDown(item)">
65
+ <svg width="11" height="11" class="fill-text-300 hover:fill-primary" 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 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
66
+ </button>
67
+ </div>
68
+ </div>
69
+ </template>
70
+ </VirtualGrid>
71
+
72
+ </div>
73
+ </div>
74
+
75
+ </div>
76
+ </template>
77
+
78
+ <script>
79
+
80
+ import WebPagePropertySelector from "../WebPageBuilder4/WebPagePropertySelector.vue";
81
+ import {defineAsyncComponent} from "vue";
82
+ import InteractionEdit from "./InteractionEdit.vue";
83
+
84
+ export default{
85
+ components: {
86
+ InteractionEdit,
87
+ HeightSetting: defineAsyncComponent(() => import('../WebPageBuilder4/HeightSetting.vue')),
88
+ WebPagePropertySelector
89
+ },
90
+
91
+ computed: {
92
+
93
+ interactions(){
94
+ if(!Array.isArray(this.value.props.interactions))
95
+ this.value.props.interactions = []
96
+ return this.value.props.interactions
97
+ },
98
+
99
+ selectedDatasource(){
100
+ return this.datasource.find(d => d.uid === this.value.props.datasourceUid)
101
+ },
102
+
103
+ definedProperties(){
104
+ const settings = []
105
+
106
+ for(let key in this.properties){
107
+ if(key in this.value.props){
108
+ settings.push(this.properties[key])
109
+ }
110
+ }
111
+
112
+ return settings
113
+ },
114
+
115
+ tabItems(){
116
+ return [
117
+ { text:'General', value:1 },
118
+ this.value.props.datasourceUid ? { text:'Columns', value:2 } : null,
119
+ ]
120
+ .filter(_ => _)
121
+ },
122
+
123
+ columns(){
124
+ const searches = this.search.toLowerCase().split(' ').filter(_ => _.length > 2)
125
+ return (this.value.props.datasourceColumns ?? []).filter(_ => {
126
+ return !_.key.startsWith('_') &&
127
+ (searches.length < 1 || searches.every(search => _.label.toLowerCase().includes(search)))
128
+ })
129
+ },
130
+
131
+ },
132
+
133
+ data(){
134
+ return {
135
+ properties: {
136
+ 'height': { component:"HeightSetting", text:'Height', group:'Layout' }
137
+ },
138
+ search: ''
139
+ }
140
+ },
141
+
142
+ emits: [ 'change' ],
143
+
144
+ inject: [ 'uploadImage', 'viewTypes' ],
145
+
146
+ props: {
147
+
148
+ datasource: Object,
149
+
150
+ index: Number,
151
+
152
+ readonly: [ Boolean, Number ],
153
+
154
+ value: {
155
+ type: Object,
156
+ required: true
157
+ },
158
+
159
+ viewType: String,
160
+
161
+ },
162
+
163
+ methods: {
164
+
165
+ addInteraction(obj){
166
+ this.$util.push(this.interactions, obj)
167
+ },
168
+
169
+ applyDefault(){
170
+ if(!this.value.props.datasourceUid && this.datasource?.length === 1){
171
+ this.value.props.datasourceUid = this.datasource[0].uid
172
+ }
173
+
174
+ if(!this.value.tabIndex)
175
+ this.value.tabIndex = 1
176
+ },
177
+
178
+ generateColumns(){
179
+ this.value.props.datasourceColumns = (this.selectedDatasource.pivot?.enabled ?
180
+ this.selectedDatasource.pivot.columns :
181
+ this.selectedDatasource.columns)
182
+ .map((_, __) => ({
183
+ ..._,
184
+ visible: __ < 10
185
+ }))
186
+ },
187
+
188
+ moveDown(item){
189
+ const index = this.value.props.datasourceColumns.indexOf(item)
190
+ if(index + 1 < this.value.props.datasourceColumns.length){
191
+ this.value.props.datasourceColumns.splice(index + 1, 0, this.value.props.datasourceColumns.splice(index, 1)[0])
192
+ }
193
+ },
194
+
195
+ moveUp(item){
196
+ const index = this.value.props.datasourceColumns.indexOf(item)
197
+ if(index - 1 >= 0){
198
+ this.value.props.datasourceColumns.splice(index - 1, 0, this.value.props.datasourceColumns.splice(index, 1)[0])
199
+ }
200
+ },
201
+
202
+
203
+ },
204
+
205
+ mounted() {
206
+ this.applyDefault()
207
+ },
208
+
209
+ watch: {
210
+
211
+ 'value.props.datasourceUid'(to){
212
+ if(to){
213
+ this.generateColumns()
214
+ this.$emit('change')
215
+ }
216
+ }
217
+
218
+ }
219
+
220
+ }
221
+
222
+ </script>
223
+
224
+ <style module>
225
+
226
+ .comp{
227
+ @apply flex-1 flex flex-col;
228
+ }
229
+
230
+ .columnTextbox input::placeholder{
231
+ @apply text-text;
232
+ }
233
+
234
+ </style>