@mixd-id/web-scaffold 0.1.230406368 → 0.1.230406370

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406368",
4
+ "version": "0.1.230406370",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -55,7 +55,7 @@
55
55
  "md5": "^2.3.0",
56
56
  "mitt": "^3.0.1",
57
57
  "nprogress": "^0.2.0",
58
- "pinia": "^2.0.2",
58
+ "pinia": "^2.3.0",
59
59
  "prismjs": "^1.28.0",
60
60
  "redis": "^4.6.13",
61
61
  "serve-static": "^1.15.0",
@@ -82,6 +82,8 @@ export default{
82
82
  this.isOnEndScroll = false
83
83
  }
84
84
  }
85
+
86
+ this.scrolled = this.scrollTop > 0
85
87
  }, 16),
86
88
 
87
89
  init(){
@@ -218,6 +220,8 @@ export default{
218
220
  isOnEndScroll: false,
219
221
  selectedIndex: -1,
220
222
  state: 1,
223
+ scrolled: false,
224
+ scrollerCache: {}
221
225
  }
222
226
  },
223
227
 
@@ -227,11 +231,11 @@ export default{
227
231
 
228
232
  watch: {
229
233
 
230
- column(to){
234
+ column(){
231
235
  this.resize()
232
236
  },
233
237
 
234
- gap(to){
238
+ gap(){
235
239
  this.resize()
236
240
  },
237
241
 
@@ -246,6 +250,19 @@ export default{
246
250
  }
247
251
  },
248
252
 
253
+ scrollerStyle(to){
254
+ if(this.scrolled && this.scrollerCache?.id){
255
+ const index = this.items.findIndex(_ => _.id === this.scrollerCache.id)
256
+ const addToScroll = (index - this.scrollerCache.index) * this.itemHeight
257
+ this.scrollTop = this.$el.scrollTop = this.scrollTop + addToScroll
258
+ }
259
+
260
+ this.scrollerCache = {
261
+ id: this.items[this.visibleStartIndex].id,
262
+ index: this.visibleStartIndex
263
+ }
264
+ },
265
+
249
266
  }
250
267
 
251
268
  }
@@ -139,7 +139,9 @@ export default{
139
139
  maxVisibleItems: 0,
140
140
  isOnEndScroll: false,
141
141
  selectedIndex: -1,
142
- state: 1
142
+ state: 1,
143
+ scrolled: false,
144
+ scrollerCache: {}
143
145
  }
144
146
  },
145
147
 
@@ -318,6 +320,8 @@ export default{
318
320
  this.isOnEndScroll = false
319
321
  }
320
322
  }
323
+
324
+ this.scrolled = this.scrollTop > 0
321
325
  }, 16),
322
326
 
323
327
  passiveScrollSupported() {
@@ -600,7 +604,20 @@ export default{
600
604
  handler(){
601
605
  this.resize()
602
606
  }
603
- }
607
+ },
608
+
609
+ scrollerStyle(to){
610
+ if(this.scrolled && this.scrollerCache?.id){
611
+ const index = this.items.findIndex(_ => _.id === this.scrollerCache.id)
612
+ const addToScroll = (index - this.scrollerCache.index) * this.itemHeight
613
+ this.scrollTop = this.$refs.cont.scrollTop = this.scrollTop + addToScroll
614
+ }
615
+
616
+ this.scrollerCache = {
617
+ id: this.items[this.visibleStartIndex].id,
618
+ index: this.visibleStartIndex
619
+ }
620
+ },
604
621
 
605
622
  }
606
623
 
package/src/index.js CHANGED
@@ -618,7 +618,7 @@ export default{
618
618
  app.component('Header1', defineAsyncComponent(() => import("./widgets/Header1.vue")))
619
619
  app.component('Header2', defineAsyncComponent(() => import("./widgets/Header2.vue")))
620
620
  app.component('HeaderSetting', defineAsyncComponent(() => import("./widgets/HeaderSetting.vue")))
621
- app.component('Header1Setting', defineAsyncComponent(() => import("./widgets/Header1Setting.vue")))
621
+ //app.component('Header1Setting', defineAsyncComponent(() => import("./widgets/Header1Setting.vue")))
622
622
  app.component('Header2Setting', defineAsyncComponent(() => import("./widgets/Header2Setting.vue")))
623
623
  app.component('IconList', defineAsyncComponent(() => import("./widgets/IconList.vue")))
624
624
  app.component('IconListSetting', defineAsyncComponent(() => import("./widgets/IconListSetting.vue")))
@@ -530,6 +530,19 @@ function capitalize(str) {
530
530
  });
531
531
  }
532
532
 
533
+ const removeUnderscoredKey = (obj) => {
534
+ if(typeof obj === 'object' && obj !== null){
535
+ for(let key in obj){
536
+ if(key.startsWith('_')){
537
+ delete obj[key]
538
+ }
539
+ else if(Array.isArray(obj[key])){
540
+ obj[key].forEach(_ => removeUnderscoredKey(_))
541
+ }
542
+ }
543
+ }
544
+ }
545
+
533
546
  module.exports = {
534
547
  capitalize,
535
548
  ceil,
@@ -559,4 +572,5 @@ module.exports = {
559
572
  datasourceGet,
560
573
  datasourceLoad,
561
574
  dayTimeRange,
575
+ removeUnderscoredKey
562
576
  }
@@ -73,6 +73,11 @@
73
73
  </VirtualGrid>
74
74
 
75
75
  </div>
76
+
77
+ <div v-else-if="value.tabIndex === 3" class="flex-1 flex flex-col gap-5 p-6">
78
+
79
+ </div>
80
+
76
81
  </div>
77
82
 
78
83
  </div>
@@ -119,6 +124,9 @@ export default{
119
124
  return [
120
125
  { text:'General', value:1 },
121
126
  this.value.props.datasourceUid ? { text:'Columns', value:2 } : null,
127
+ this.value.props.datasourceUid ? { text:'Filters', value:3 } : null,
128
+ this.value.props.datasourceUid ? { text:'Sorts', value:4 } : null,
129
+ this.value.props.datasourceUid ? { text:'Pivot', value:5 } : null,
122
130
  ]
123
131
  .filter(_ => _)
124
132
  },
@@ -53,7 +53,7 @@
53
53
 
54
54
  <div v-if="mode === 'select'" class="flex-1 flex flex-col">
55
55
  <div class="flex flex-col bg-base-300 border-t-[1px] border-b-[1px] border-text-50 divide-y divide-text-50">
56
- <button v-for="(preset, idx) in config.presets" type="button"
56
+ <div v-for="(preset, idx) in config.presets"
57
57
  class="px-6 text-left hover:bg-primary-200 hover:text-white flex flex-row items-center">
58
58
  <div class="flex-1 py-4" @click="select(idx)">
59
59
  {{ preset.name }}
@@ -64,7 +64,7 @@
64
64
  @click="$refs.contextMenu.open($refs.btn[idx], { idx })">
65
65
  <svg width="16" height="16" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><path d="M64 208c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zM16 104c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48zm0 304c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48z"/></svg>
66
66
  </button>
67
- </button>
67
+ </div>
68
68
  </div>
69
69
 
70
70
  <ContextMenu ref="contextMenu" position="bottom-right">