@mixd-id/web-scaffold 0.2.240702 → 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 -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/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,7 +7,8 @@
7
7
  class="items-end"
8
8
  item-class="max-w-[40px]"
9
9
  v-model="margin[index]"
10
- :prefix="viewType" />
10
+ :prefix="viewType"
11
+ :readonly="readonly" />
11
12
  </div>
12
13
  </div>
13
14
  </template>
@@ -30,6 +31,8 @@ export default{
30
31
 
31
32
  index: Number,
32
33
 
34
+ readonly: [ Boolean, Number ],
35
+
33
36
  viewType: String,
34
37
 
35
38
  },
@@ -16,7 +16,8 @@
16
16
  <div class="flex flex-row gap-1" :class="`grid-cols-${type}`">
17
17
  <select @change="applyValue"
18
18
  v-model="value[0]"
19
- :class="itemClass">
19
+ :class="itemClass"
20
+ :disabled="readonly">
20
21
  <option value="">-</option>
21
22
  <option v-for="value in values"
22
23
  :value="`${prefix}${keys[type][0]}${Array.isArray(value) ? value[0] : value}`">
@@ -27,7 +28,8 @@
27
28
  <select v-if="type > 0"
28
29
  @change="applyValue"
29
30
  v-model="value[1]"
30
- :class="itemClass">
31
+ :class="itemClass"
32
+ :disabled="readonly">
31
33
  <option value="">-</option>
32
34
  <option v-for="value in values"
33
35
  :value="`${prefix}${keys[type][1]}${Array.isArray(value) ? value[0] : value}`">
@@ -38,7 +40,8 @@
38
40
  <select v-if="type > 1"
39
41
  @change="applyValue"
40
42
  v-model="value[2]"
41
- :class="itemClass">
43
+ :class="itemClass"
44
+ :disabled="readonly">
42
45
  <option value="">-</option>
43
46
  <option v-for="value in values"
44
47
  :value="`${prefix}${keys[type][2]}${Array.isArray(value) ? value[0] : value}`">
@@ -49,7 +52,8 @@
49
52
  <select v-if="type > 1"
50
53
  @change="applyValue"
51
54
  v-model="value[3]"
52
- :class="itemClass">
55
+ :class="itemClass"
56
+ :disabled="readonly">
53
57
  <option value="">-</option>
54
58
  <option v-for="value in values"
55
59
  :value="`${prefix}${keys[type][3]}${Array.isArray(value) ? value[0] : value}`">
@@ -87,6 +91,8 @@ export default{
87
91
 
88
92
  prefix: String,
89
93
 
94
+ readonly: [ Boolean, Number ],
95
+
90
96
  values: {
91
97
  type: Array,
92
98
  default: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
@@ -104,6 +110,8 @@ export default{
104
110
  },
105
111
 
106
112
  setType(type){
113
+ if(this.readonly) return
114
+
107
115
  this.type = type
108
116
  this.value = []
109
117
  },
@@ -5,6 +5,7 @@
5
5
  <MultiValueSetting class="items-end"
6
6
  item-class="max-w-[40px]"
7
7
  v-model="padding[index]"
8
+ :readonly="readonly"
8
9
  :prefix="viewType" />
9
10
  </div>
10
11
  </div>
@@ -27,6 +28,9 @@ export default {
27
28
  },
28
29
 
29
30
  index: Number,
31
+
32
+ readonly: [ Boolean, Number ],
33
+
30
34
  viewType: String,
31
35
 
32
36
  },
@@ -4,10 +4,12 @@
4
4
  :parent="items"
5
5
  :config="config"
6
6
  :item="item"
7
+ :depth="0"
8
+ :readonly="readonly"
7
9
  :value="modelValue"
8
10
  @change="uid => $emit('update:modelValue', uid)">
9
- <template #item="{ item, parent }">
10
- <slot name="item" :item="item" :parent="parent"></slot>
11
+ <template #item="{ item, parent, depth }">
12
+ <slot name="item" :item="item" :parent="parent" :depth="depth"></slot>
11
13
  </template>
12
14
  </TreeViewItem>
13
15
  </div>
@@ -28,7 +30,8 @@ export default{
28
30
  items: Array,
29
31
  config: Object,
30
32
  modelValue: String,
31
- },
33
+ readonly: Boolean
34
+ }
32
35
 
33
36
  }
34
37
 
@@ -9,11 +9,11 @@
9
9
  <button type="button" class="p-1 px-2 w-[18px]"
10
10
  v-if="Array.isArray((item ?? {}).items) && item.items.length > 0"
11
11
  @click="currentConfig.childCollapsed = !currentConfig.childCollapsed">
12
- <svg v-if="!currentConfig.childCollapsed" width="14" height="14" class="fill-text-300 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>
13
- <svg v-else width="14" height="14" class="fill-text-300 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>
12
+ <svg v-if="!currentConfig.childCollapsed" width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>
13
+ <svg v-else width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>
14
14
  </button>
15
15
  <div class="flex-1 flex">
16
- <slot name="item" :item="item" :parent="parent"></slot>
16
+ <slot name="item" :item="item" :parent="parent" :depth="depth"></slot>
17
17
  </div>
18
18
  </div>
19
19
 
@@ -22,12 +22,14 @@
22
22
  class="ml-6 flex flex-col gap-1">
23
23
  <TreeViewItem v-for="subItem in item.items"
24
24
  :parent="item.items"
25
+ :depth="depth + 1"
25
26
  :config="config"
27
+ :readonly="readonly"
26
28
  @change="(uid) => $emit('change', uid)"
27
29
  :value="value"
28
30
  :item="subItem">
29
- <template #item="{ item, parent }">
30
- <slot name="item" :item="item" :parent="parent"></slot>
31
+ <template #item="{ item, parent, depth }">
32
+ <slot name="item" :item="item" :parent="parent" :depth="depth"></slot>
31
33
  </template>
32
34
  </TreeViewItem>
33
35
  </div>
@@ -36,8 +38,6 @@
36
38
 
37
39
  <script>
38
40
 
39
- import {copyToClipboard} from "../../utils/helpers.mjs";
40
-
41
41
  let dragged = null
42
42
  let guide1 = null
43
43
 
@@ -46,6 +46,28 @@ export default{
46
46
  TreeViewItem: () => import('./TreeViewItem.vue')
47
47
  },
48
48
 
49
+ emits: [ 'change' ],
50
+
51
+ name: 'TreeViewItem',
52
+
53
+ props: {
54
+ item: {
55
+ type: Object,
56
+ required: true,
57
+ validator(v){
58
+ return 'uid' in v
59
+ }
60
+ },
61
+ depth: Number,
62
+ readonly: Boolean,
63
+ parent: Array,
64
+ config: {
65
+ type: Object,
66
+ default: () => ({})
67
+ },
68
+ value: String,
69
+ },
70
+
49
71
  computed: {
50
72
 
51
73
  currentConfig(){
@@ -56,10 +78,6 @@ export default{
56
78
 
57
79
  },
58
80
 
59
- emits: [ 'change' ],
60
-
61
- inject: [ 'toast' ],
62
-
63
81
  methods: {
64
82
 
65
83
  createGuide(){
@@ -140,28 +158,9 @@ export default{
140
158
  delete dragged.targetParent
141
159
  },
142
160
 
143
- onKeyDown(e){
144
- if((e.ctrlKey || e.metaKey)){
145
-
146
- if(e.keyCode === 67){
147
- e.preventDefault()
148
-
149
- copyToClipboard(JSON.stringify(this.item))
150
- .then(() => this.toast('Copied to clipboard'))
151
-
152
- this.log(e)
153
- }
154
- else if(e.keyCode === 86){
155
- e.preventDefault()
156
- e.stopPropagation()
157
- console.log(this.item)
158
- }
159
-
160
- }
161
- },
162
-
163
161
  mouseDown(e){
164
162
  if(!this.$el || this.$el.nodeType !== 1) return
163
+ if(this.readonly) return
165
164
 
166
165
  e.preventDefault()
167
166
 
@@ -210,8 +209,6 @@ export default{
210
209
 
211
210
  if(dragged && dragged.parent && dragged.targetParent){
212
211
 
213
- console.log(dragged, dragged.parent, dragged.targetParent)
214
-
215
212
  const targetIdx = dragged.targetParent.indexOf(dragged.target)
216
213
  const moveDirection = e.clientY < dragged.startY ? -1 : 1
217
214
  const sameParent = dragged.parent === dragged.targetParent
@@ -276,30 +273,7 @@ export default{
276
273
  window.addEventListener('mouseup', mouseUp)
277
274
  },
278
275
 
279
- },
280
-
281
- mounted() {
282
- //window.addEventListener('keydown', this.onKeyDown)
283
- },
284
-
285
- name: 'TreeViewItem',
286
-
287
- props: {
288
- item: {
289
- type: Object,
290
- required: true,
291
- validator(v){
292
- return 'uid' in v
293
- }
294
- },
295
- parent: Array,
296
- config: Object,
297
- value: String,
298
- },
299
-
300
- unmounted() {
301
- //window.removeEventListener('keydown', this.onKeyDown)
302
- },
276
+ }
303
277
 
304
278
  }
305
279
 
@@ -317,7 +291,7 @@ export default{
317
291
 
318
292
  .item{
319
293
  @apply flex flex-row items-center;
320
- @apply bg-base-500 rounded-lg;
294
+ @apply bg-base-500 hover:bg-text-50 rounded-lg;
321
295
  }
322
296
  .item.active{
323
297
  @apply bg-text-50;
@@ -86,7 +86,7 @@ module.exports = {
86
86
 
87
87
  'h-1', 'h-2', 'h-3', 'h-4', 'h-5', 'h-6', 'h-7', 'h-8', 'h-9',
88
88
  'h-10', 'h-11', 'h-12', 'h-14', 'h-16', 'h-20', 'h-24', 'h-32', 'h-36', 'h-48',
89
- 'h-10vh', 'h-20vh', 'h-30vh', 'h-40vh', 'h-50vh', 'h-60vh', 'h-70vh', 'h-80vh', 'h-90vh', 'h-100vh',
89
+ 'h-[10vh]', 'h-[20vh]', 'h-[30vh]', 'h-[40vh]', 'h-[50vh]', 'h-[60vh]', 'h-[70vh]', 'h-[80vh]', 'h-[90vh]', 'h-[100vh]',
90
90
 
91
91
  'min-h-0', 'min-h-full', 'min-h-screen', 'min-h-min', 'min-h-max', 'min-h-fit',
92
92
  'min-h-[90vh]', 'min-h-[80vh]', 'min-h-[70vh]', 'min-h-[60vh]', 'min-h-[50vh]', 'min-h-[40vh]',
@@ -316,7 +316,7 @@ module.exports = {
316
316
 
317
317
  'md:h-1', 'md:h-2', 'md:h-3', 'md:h-4', 'md:h-5', 'md:h-6', 'md:h-7', 'md:h-8', 'md:h-9',
318
318
  'md:h-10', 'md:h-11', 'md:h-12', 'md:h-14', 'md:h-16', 'md:h-20', 'md:h-24', 'md:h-32', 'md:h-36', 'md:h-48',
319
- 'md:h-10vh', 'md:h-20vh', 'md:h-30vh', 'md:h-40vh', 'md:h-50vh', 'md:h-60vh', 'md:h-70vh', 'md:h-80vh', 'md:h-90vh', 'md:h-100vh',
319
+ 'md:h-[10vh]', 'md:h-[20vh]', 'md:h-[30vh]', 'md:h-[40vh]', 'md:h-[50vh]', 'md:h-[60vh]', 'md:h-[70vh]', 'md:h-[80vh]', 'md:h-[90vh]', 'md:h-[100vh]',
320
320
 
321
321
  'md:min-h-0', 'md:min-h-full', 'md:min-h-screen', 'md:min-h-md:min', 'md:min-h-max', 'md:min-h-fit',
322
322
  'md:min-h-[90vh]', 'md:min-h-[80vh]', 'md:min-h-[70vh]', 'md:min-h-[60vh]', 'md:min-h-[50vh]', 'md:min-h-[40vh]',