@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
@@ -1,165 +1,146 @@
1
1
  <template>
2
2
  <button :class="compClass" @click="onClick" :style="computedStyle"
3
3
  v-tooltip="disabledText">
4
- <slot>
5
- <span v-if="icon" v-html="icon"></span>
6
- {{ text }}
7
- </slot>
8
- <div v-if="isLoading" :class="$style.loadingPane">
9
- <svg :class="$style.spinner" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
10
- <circle :class="$style.svgBg" cx="12" cy="12" r="10" stroke-width="4"></circle>
11
- <path :class="$style.svgHg" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
12
- </svg>
13
- </div>
14
- </button>
4
+ <slot>{{ text }}</slot>
5
+ <div v-if="isLoading" :class="$style.loadingPane">
6
+ <svg :class="$style.spinner" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
7
+ <circle :class="$style.svgBg" cx="12" cy="12" r="10" stroke-width="4"></circle>
8
+ <path :class="$style.svgHg" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
9
+ </svg>
10
+ </div>
11
+ </button>
15
12
  </template>
16
13
 
17
14
  <script>
18
15
 
19
16
  import {componentMixin} from "../mixin/component";
20
- import {eventBus} from "../events/event";
21
17
 
22
18
  export default{
23
19
 
24
20
  emits: [ 'click', 'disabled-click' ],
25
21
 
26
- mixins: [ componentMixin ],
22
+ mixins: [ componentMixin ],
27
23
 
28
- props: {
24
+ props: {
29
25
 
30
- variant: {
31
- type: [ String, Number ],
32
- default: "primary" // primary|secondary|outline, default:primary
33
- },
26
+ variant: {
27
+ type: [ String, Number ],
28
+ default: "primary" // primary|secondary|outline, default:primary
29
+ },
34
30
 
35
- state: {
31
+ state: {
36
32
  type: [ String, Number ], // -1:disabled, 1:normal, 2:loading, default: normal,
37
- default: 1
38
- },
39
-
40
- icon: {
41
- type: String,
42
- default: `<svg width="14" height="14" class="fill-black" 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="M236 176c0 15.46-12.54 28-28 28S180 191.5 180 176S192.5 148 208 148S236 160.5 236 176zM500.3 500.3c-15.62 15.62-40.95 15.62-56.57 0l-119.7-119.7c-40.41 27.22-90.9 40.65-144.7 33.46c-91.55-12.23-166-87.28-177.6-178.9c-17.24-136.2 97.29-250.7 233.4-233.4c91.64 11.6 166.7 86.07 178.9 177.6c7.19 53.8-6.236 104.3-33.46 144.7l119.7 119.7C515.9 459.3 515.9 484.7 500.3 500.3zM294.1 182.2C294.1 134.5 255.6 96 207.1 96C160.4 96 121.9 134.5 121.9 182.2c0 38.35 56.29 108.5 77.87 134C201.8 318.5 204.7 320 207.1 320c3.207 0 6.26-1.459 8.303-3.791C237.8 290.7 294.1 220.5 294.1 182.2z"/></svg>`
33
+ default: 1
43
34
  },
44
35
 
45
- actions: Array,
36
+ text: String,
46
37
 
47
- text: String,
38
+ target: String,
48
39
 
49
- target: String,
40
+ targetType: String,
50
41
 
51
- targetType: String,
52
-
53
- width: Array,
42
+ width: Array,
54
43
 
55
44
  disabledText: String
56
45
 
57
- },
46
+ },
58
47
 
59
- computed:{
48
+ computed: {
60
49
 
61
- compClass(){
50
+ compClass() {
62
51
 
63
- return [
64
- this.$style.button,
65
- this.$style['button-' + this.variant],
66
- parseInt(this.computedState) === 2 ? this.$style.loading : ''
67
- ]
68
- .filter(_ => _)
69
- .join(' ')
70
- },
52
+ return [
53
+ this.$style.button,
54
+ this.$style['button-' + this.variant],
55
+ this.isDisabled ? this.$style['button-disabled'] : '',
56
+ this.isDisabled ? this.$style['button-' + this.variant + '-disabled'] : '',
57
+ parseInt(this.computedState) === 2 ? this.$style.loading : ''
58
+ ]
59
+ .filter(_ => _)
60
+ .join(' ')
61
+ },
71
62
 
72
- isDisabled(){
73
- return parseInt(this.computedState) !== 1
74
- },
63
+ isDisabled() {
64
+ return parseInt(this.computedState) !== 1
65
+ },
75
66
 
76
- isLoading(){
77
- return parseInt(this.computedState) === 2
78
- },
67
+ isLoading() {
68
+ return parseInt(this.computedState) === 2
69
+ },
79
70
 
80
- computedState(){
81
- return this._state ?? this.state
82
- },
71
+ computedState() {
72
+ return this._state ?? this.state
73
+ },
83
74
 
84
- widths(){
85
- if(!Array.isArray(this.width)) return [ '', '' ]
75
+ widths() {
76
+ if (!Array.isArray(this.width)) return ['', '']
86
77
 
87
- return [
88
- this.width[0] ?? '',
89
- this.width[1] ? this.width[1] : (this.width[0] ?? ''),
90
- ]
91
- }
78
+ return [
79
+ this.width[0] ?? '',
80
+ this.width[1] ? this.width[1] : (this.width[0] ?? ''),
81
+ ]
82
+ }
92
83
 
93
- },
84
+ },
94
85
 
95
- data(){
96
- return {
97
- _state: null
98
- }
99
- },
86
+ data() {
87
+ return {
88
+ _state: null
89
+ }
90
+ },
100
91
 
101
- methods:{
92
+ methods: {
102
93
 
103
- focus(){
104
- this.$el.focus()
105
- },
94
+ focus() {
95
+ this.$el.focus()
96
+ },
106
97
 
107
- setState(state, percentage){
108
- this._state = state
109
- },
98
+ setState(state, percentage) {
99
+ this._state = state
100
+ },
110
101
 
111
- resetState(){
102
+ resetState() {
112
103
  this._state = null
113
- },
114
-
115
- onClick(){
116
- if(!('edit-mode' in this.$route.query)){
104
+ },
117
105
 
118
- if(this.isDisabled){
119
- this.$emit('disabled-click')
120
- }
121
- else{
122
- if(this.target){
123
- switch(this.targetType){
124
-
125
- case 'section':
126
- this.scrollTo(this.target)
127
- break
128
-
129
- default:
130
- if(this.target.indexOf('://') >= 0){
131
- window.location = this.target
132
- }
133
- else{
134
- this.$router.push(this.target)
135
- }
136
- break
137
- }
138
- }
139
- else{
140
- this.$emit('click')
106
+ onClick() {
107
+ if ('edit-mode' in this.$route.query) return
108
+
109
+ if (this.isDisabled) {
110
+ this.$emit('disabled-click')
111
+ } else {
112
+ if (this.target) {
113
+ switch (this.targetType) {
114
+
115
+ case 'section':
116
+ this.scrollTo(this.target)
117
+ break
118
+
119
+ default:
120
+ if (this.target.indexOf('://') >= 0) {
121
+ window.location = this.target
122
+ } else {
123
+ this.$router.push(this.target)
124
+ }
125
+ break
141
126
  }
127
+ } else {
128
+ this.$emit('click')
142
129
  }
143
130
  }
131
+ },
144
132
 
145
- if(this.page?.editMode !== 'design'){
146
- this.actions?.forEach(action => {
147
- eventBus.emit(action.target, action)
148
- })
133
+ scrollTo(exp) {
134
+ const el = document.querySelector('._' + exp.substring(0, 4))
135
+ if (el) {
136
+ window.scrollTo({
137
+ top: el.offsetTop - 100,
138
+ behavior: 'smooth'
139
+ });
149
140
  }
150
- },
151
-
152
- scrollTo(exp){
153
- const el = document.querySelector('._' + exp.substring(0, 4))
154
- if(el){
155
- window.scrollTo({
156
- top: el.offsetTop - 100,
157
- behavior: 'smooth'
158
- });
159
- }
160
- },
141
+ },
161
142
 
162
- },
143
+ },
163
144
 
164
145
  }
165
146
 
@@ -167,166 +148,204 @@ export default{
167
148
 
168
149
  <style module>
169
150
 
170
- .button{
151
+ .button {
171
152
  @apply p-2;
172
153
  @apply relative flex items-center justify-center;
173
154
  @apply whitespace-nowrap text-ellipsis overflow-hidden;
174
155
  @apply rounded-lg appearance-none;
175
156
  }
176
- .button>*:first-child{
157
+
158
+ .button > *:first-child {
177
159
  @apply flex items-center justify-center
178
160
  }
179
- .button-disabled{
161
+
162
+ .button-disabled {
180
163
  @apply text-opacity-50;
181
164
  }
182
- .button:active{
165
+
166
+ .button:active {
183
167
  @apply top-[1px] left-[1px] relative;
184
168
  }
185
169
 
186
- .button-primary{
170
+ .button-primary {
187
171
  @apply bg-primary-500 text-white rounded-lg;
188
172
  box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
189
173
  border: solid 1px rgb(var(--primary-500));
190
174
  }
191
- .button-primary:focus{
175
+
176
+ .button-primary:focus {
192
177
  border-color: rgb(var(--primary-600));
193
178
  }
194
- .button-primary:hover{
179
+
180
+ .button-primary:hover {
195
181
  @apply bg-primary-600;
196
182
  }
183
+
197
184
  .button-primary-disabled,
198
- .button-primary-disabled:hover{
185
+ .button-primary-disabled:hover {
199
186
  @apply bg-primary-500 top-0 left-0 cursor-not-allowed text-opacity-50;
200
187
  @apply top-0 left-0;
201
188
  }
202
- .button-primary *{
189
+
190
+ .button-primary * {
203
191
  @apply text-white fill-white;
204
192
  }
205
- .button-primary.loading *{
193
+
194
+ .button-primary.loading * {
206
195
  @apply fill-transparent
207
196
  }
208
- .button-primary .svgBg{
197
+
198
+ .button-primary .svgBg {
209
199
  stroke: #fff;
210
200
  stroke-opacity: 25%;
211
201
  }
212
- .button-primary .svgHg{
202
+
203
+ .button-primary .svgHg {
213
204
  fill: #fff;
214
205
  fill-opacity: 75%;
215
206
  }
216
207
 
217
- .button-outline{
208
+ .button-outline {
218
209
  @apply bg-transparent text-primary-500 border-[1px] border-primary;
219
210
  }
220
- .button-outline:hover{
211
+
212
+ .button-outline:hover {
221
213
  }
214
+
222
215
  .button-outline-disabled,
223
- .button-outline-disabled:hover{
216
+ .button-outline-disabled:hover {
224
217
  @apply top-0 left-0 cursor-not-allowed;
225
218
  @apply text-text border-primary-500 text-opacity-50;
226
219
  }
227
- .button-outline *{
220
+
221
+ .button-outline * {
228
222
  @apply text-primary-500 fill-primary-500;
229
223
  }
230
- .button-outline.loading *{
224
+
225
+ .button-outline.loading * {
231
226
  @apply fill-transparent
232
227
  }
233
- .button-outline .svgBg{
228
+
229
+ .button-outline .svgBg {
234
230
  stroke: rgb(var(--primary-600));
235
231
  stroke-opacity: 50%;
236
232
  }
237
- .button-outline .svgHg{
233
+
234
+ .button-outline .svgHg {
238
235
  fill: rgb(var(--primary-500));
239
236
  fill-opacity: 100%;
240
237
  }
241
238
 
242
- .button-secondary{
239
+ .button-secondary {
243
240
  @apply bg-secondary-500 border-secondary-500 text-primary-700 rounded-lg text-white;
244
241
  border: solid 1px rgb(var(--secondary-500));
245
242
  }
246
- .button-secondary:hover{
243
+
244
+ .button-secondary:hover {
247
245
  @apply bg-secondary-600 border-secondary-600;
248
246
  }
247
+
249
248
  .button-secondary-disabled,
250
- .button-secondary-disabled:hover{
249
+ .button-secondary-disabled:hover {
251
250
  @apply bg-secondary-400 border-secondary-400 cursor-not-allowed text-opacity-50;
252
251
  }
253
- .button-secondary *{
252
+
253
+ .button-secondary * {
254
254
  @apply text-text-500 fill-white;
255
255
  }
256
- .button-secondary.loading *{
256
+
257
+ .button-secondary.loading * {
257
258
  @apply fill-transparent
258
259
  }
259
- .button-secondary .svgBg{
260
+
261
+ .button-secondary .svgBg {
260
262
  stroke: rgb(var(--text-400));
261
263
  stroke-opacity: 25%;
262
264
  }
263
- .button-secondary .svgHg{
265
+
266
+ .button-secondary .svgHg {
264
267
  fill: rgb(var(--text-500));
265
268
  fill-opacity: 75%;
266
269
  }
267
270
 
268
- .button-red{
271
+ .button-red {
269
272
  @apply bg-red-500 text-white rounded-md border-[2px] border-red-500;
270
273
  }
271
- .button-red:hover{
274
+
275
+ .button-red:hover {
272
276
  @apply bg-red-600 border-red-600;
273
277
  }
278
+
274
279
  .button-red-disabled,
275
- .button-red-disabled:hover{
280
+ .button-red-disabled:hover {
276
281
  @apply bg-red-500 border-red-500 top-0 left-0 cursor-not-allowed text-opacity-50;
277
282
  }
278
- .button-red *{
283
+
284
+ .button-red * {
279
285
  @apply text-white fill-white;
280
286
  }
281
- .button-red.loading *{
287
+
288
+ .button-red.loading * {
282
289
  @apply fill-transparent
283
290
  }
284
- .button-red .svgBg{
291
+
292
+ .button-red .svgBg {
285
293
  @apply stroke-red-400;
286
294
  stroke-opacity: 50%;
287
295
  }
288
- .button-red .svgHg{
296
+
297
+ .button-red .svgHg {
289
298
  @apply fill-text-500;
290
299
  fill-opacity: 100%;
291
300
  }
292
301
 
293
- .button-minimal{
302
+ .button-minimal {
294
303
  @apply border-[2px] border-transparent;
295
304
  }
296
- .button-minimal:hover{
305
+
306
+ .button-minimal:hover {
297
307
  }
298
- .button-minimal .svgBg{
308
+
309
+ .button-minimal .svgBg {
299
310
  stroke: rgb(var(--text-500));
300
311
  stroke-opacity: 25%;
301
312
  }
302
- .button-minimal .svgHg{
313
+
314
+ .button-minimal .svgHg {
303
315
  fill: rgb(var(--text));
304
316
  fill-opacity: 75%;
305
317
  }
306
318
 
307
- .loadingPane{
319
+ .loadingPane {
308
320
  @apply absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center pl-1;
309
321
  }
310
- .loading{
322
+
323
+ .loading {
311
324
  color: transparent;
312
325
  }
313
- .loading>*:first-child{
326
+
327
+ .loading > *:first-child {
314
328
  @apply opacity-0
315
329
  }
316
- .loading:hover{
330
+
331
+ .loading:hover {
317
332
  }
318
- .loading:active{
333
+
334
+ .loading:active {
319
335
  @apply top-0 left-0;
320
336
  }
321
- .loading>*{
337
+
338
+ .loading > * {
322
339
  opacity: 0;
323
340
  }
324
- .loading .loadingPane{
341
+
342
+ .loading .loadingPane {
325
343
  opacity: 1;
326
344
  }
327
345
 
328
- .spinner{
346
+ .spinner {
329
347
  @apply animate-spin h-5 w-5;
330
348
  }
331
349
 
332
350
  </style>
351
+
@@ -61,7 +61,6 @@ export default {
61
61
  return this.modelValue.includes(this.value)
62
62
  }
63
63
  else if(this.modelValue){
64
- console.log(2, this.value, this.modelValue)
65
64
  return this.value === this.modelValue
66
65
  }
67
66
  else{
@@ -266,7 +266,7 @@ export default{
266
266
  .datepicker {
267
267
  @apply min-h-[var(--h-cp)];
268
268
  @apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
269
- @apply border-[1px] border-text-200;
269
+ @apply border-[1px] border-text-200 bg-base-500 rounded-lg;
270
270
  @apply cursor-pointer;
271
271
  }
272
272
  .datepicker:not(.readonly){
@@ -290,12 +290,18 @@ export default{
290
290
  .button{
291
291
  @apply rounded-full aspect-square;
292
292
  }
293
+ .button:hover{
294
+ @apply bg-primary-200;
295
+ }
296
+ .button.selected{
297
+ @apply bg-primary text-white;
298
+ }
293
299
  .button.otherMonth{
294
300
  @apply text-text-300;
295
301
  }
296
302
 
297
303
  .arrow{
298
- @apply absolute right-0 pointer-events-none bg-base-50 px-2;
304
+ @apply absolute right-0 pointer-events-none px-2;
299
305
  top: 50%;
300
306
  transform: translate3d(0, -50%, 0);
301
307
  }
@@ -303,10 +309,6 @@ export default{
303
309
  @apply block fill-text-300;
304
310
  }
305
311
 
306
- .selected{
307
- @apply bg-primary;
308
- }
309
-
310
312
  .mode-calendar{
311
313
  @apply p-2 h-auto;
312
314
  }