@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.
- package/docs/schema/user-action.json +266 -0
- package/package.json +6 -2
- package/public/assets/dashboard/bar.png +0 -0
- package/public/assets/dashboard/doughnut.png +0 -0
- package/public/assets/dashboard/metric.png +0 -0
- package/public/assets/dashboard/pie.png +0 -0
- package/public/assets/dashboard/polar-area.png +0 -0
- package/public/assets/dashboard/virtual-table.png +0 -0
- package/public/static/dashboard/bar.png +0 -0
- package/public/static/dashboard/doughnut.png +0 -0
- package/public/static/dashboard/metric.png +0 -0
- package/public/static/dashboard/pie.png +0 -0
- package/public/static/dashboard/polar-area.png +0 -0
- package/public/static/dashboard/virtual-table.png +0 -0
- package/src/components/Button.vue +179 -160
- package/src/components/Checkbox.vue +0 -1
- package/src/components/Datepicker.vue +8 -6
- package/src/components/GHeatMaps.vue +317 -0
- package/src/components/GmapsDirection.vue +191 -0
- package/src/components/Grid.vue +2 -0
- package/src/components/HTMLEditor.vue +2 -2
- package/src/components/List.vue +384 -308
- package/src/components/Modal.vue +2 -3
- package/src/components/PresetSelectorFilterItem.vue +15 -2
- package/src/components/Switch.vue +3 -0
- package/src/components/Tabs.vue +1 -1
- package/src/components/TextWithTag.vue +67 -25
- package/src/components/Textbox.vue +5 -0
- package/src/components/VirtualGrid.vue +224 -228
- package/src/components/VirtualTable.vue +46 -28
- package/src/configs/dashboard/bar.js +10 -0
- package/src/configs/dashboard/collection-1.js +5 -0
- package/src/configs/dashboard/doughnut.js +7 -0
- package/src/configs/dashboard/gheatmaps.js +9 -0
- package/src/configs/dashboard/grid-2.js +34 -0
- package/src/configs/dashboard/grid-3.js +34 -0
- package/src/configs/dashboard/grid-4.js +34 -0
- package/src/configs/dashboard/grid.js +15 -0
- package/src/configs/dashboard/metric.js +10 -0
- package/src/configs/dashboard/pie.js +7 -0
- package/src/configs/dashboard/polar-area.js +7 -0
- package/src/configs/dashboard/virtual-table.js +9 -0
- package/src/defs/dashboard-preset.js +22 -0
- package/src/index.js +37 -23
- package/src/mixin/ready-state.js +37 -0
- package/src/stores/datasource.js +11 -0
- package/src/themes/default/index.js +1 -1
- package/src/utils/dashboard.js +1080 -0
- package/src/utils/event-bus.js +8 -0
- package/src/utils/helpers.js +56 -8
- package/src/utils/helpers.mjs +35 -1
- package/src/utils/preset-selector.js +5 -2
- package/src/utils/preset-selector.mjs +23 -13
- package/src/widgets/BotEditor/BotEditorActions.vue +162 -0
- package/src/widgets/BotEditor.vue +228 -0
- package/src/widgets/Dashboard/BarChart.vue +330 -0
- package/src/widgets/Dashboard/BarChartSetting.vue +317 -0
- package/src/widgets/Dashboard/DatasourceFilterSharing.vue +93 -0
- package/src/widgets/Dashboard/DatasourcePreview.vue +93 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +122 -0
- package/src/widgets/Dashboard/Doughnut.vue +157 -0
- package/src/widgets/Dashboard/DoughnutSetting.vue +196 -0
- package/src/widgets/Dashboard/GHeatMapsSetting.vue +108 -0
- package/src/widgets/Dashboard/InteractionEdit.vue +228 -0
- package/src/widgets/Dashboard/Metric.vue +76 -0
- package/src/widgets/Dashboard/MetricSetting.vue +174 -0
- package/src/widgets/Dashboard/Pie.vue +139 -0
- package/src/widgets/Dashboard/PieSetting.vue +247 -0
- package/src/widgets/Dashboard/PolarArea.vue +159 -0
- package/src/widgets/Dashboard/PolarAreaSetting.vue +195 -0
- package/src/widgets/Dashboard/SharingModal.vue +116 -0
- package/src/widgets/Dashboard/ViewSelector.vue +183 -0
- package/src/widgets/Dashboard/VirtualColumnEdit.vue +97 -0
- package/src/widgets/Dashboard/VirtualTableSetting.vue +234 -0
- package/src/widgets/Dashboard.vue +1773 -0
- package/src/widgets/PresetBar.vue +136 -175
- package/src/widgets/PresetBarPivot.vue +186 -0
- package/src/widgets/PresetSelector.vue +2 -2
- package/src/widgets/UserActionBuilder/UserActionCondition.vue +99 -0
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +77 -0
- package/src/widgets/UserActionBuilder/UserActionItem.vue +166 -58
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +35 -9
- package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +27 -0
- package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +28 -0
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +135 -0
- package/src/widgets/UserActionBuilder/UserActionProps.vue +213 -0
- package/src/widgets/UserActionBuilder.vue +68 -199
- package/src/widgets/WebPageBuilder4/GridSetting.vue +123 -73
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +14 -11
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +4 -1
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +12 -4
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +4 -0
- package/src/widgets/WebPageBuilder4/TreeView.vue +6 -3
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +32 -58
- 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>
|