@kizmann/nano-ui 1.0.12 → 1.0.13

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/nano-ui",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -47,7 +47,7 @@
47
47
  "webpack-dev-server": "^4.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "@kizmann/pico-js": "^1.0.10",
50
+ "@kizmann/pico-js": "^1.0.11",
51
51
  "docsify": "^4.13.1",
52
52
  "moment": "^2.30.1"
53
53
  }
@@ -51,6 +51,14 @@ export default {
51
51
  type: [String]
52
52
  },
53
53
 
54
+ multiple: {
55
+ default()
56
+ {
57
+ return true;
58
+ },
59
+ type: [Boolean]
60
+ }
61
+
54
62
  },
55
63
 
56
64
  data()
@@ -77,16 +85,24 @@ export default {
77
85
  Dom.find(el).removeClass('is-visible');
78
86
  });
79
87
 
80
- Dom.inviewMaxY(`[data-group-key]`, (el, attr) => {
88
+ let options = {
89
+ el: `[data-group-key]`, parent: this.$el
90
+ }
91
+
92
+ Dom.inviewMaxY(options, (el) => {
81
93
 
82
- let selector = `[data-menu-key="${attr}"]`;
94
+ let selector = `[data-menu-key="${el.attr}"]`;
83
95
 
84
96
  Dom.find(this.$el).find(selector)
85
97
  .addClass('is-visible');
86
98
 
87
99
  this.$refs.menu.scrollIntoView(selector)
100
+ });
101
+ },
102
+
103
+ handleVisibleItems(els)
104
+ {
88
105
 
89
- }, this.$el);
90
106
  },
91
107
 
92
108
  onSearchInput()
@@ -135,7 +151,7 @@ export default {
135
151
  Dom.find(selector).addClass('on-search');
136
152
  });
137
153
 
138
- this.$refs.body.scrollIntoView(selector)
154
+ this.$refs.body.scrollIntoView(selector, 0, 100);
139
155
  }
140
156
 
141
157
  },
@@ -196,12 +196,12 @@ export default {
196
196
  }
197
197
  },
198
198
 
199
- scrollIntoView(selector, delay = 0, offset = 0)
199
+ scrollIntoView(selector, delay = 0, padding = 0)
200
200
  {
201
- Any.delay(() => this.onScrollIntoView(selector, offset), delay);
201
+ Any.delay(() => this.onScrollIntoView(selector, padding), delay);
202
202
  },
203
203
 
204
- onScrollIntoView(selector, offset = 0)
204
+ onScrollIntoView(selector, padding = 0)
205
205
  {
206
206
  let $el = Dom.find(this.$el).find(selector);
207
207
 
@@ -214,11 +214,11 @@ export default {
214
214
  let offsetTop = $el.offsetTop(this.$el);
215
215
 
216
216
  if ( offsetTop < scrollTop ) {
217
- this.$refs.content.scrollTop = offsetTop;
217
+ this.$refs.content.scrollTop = offsetTop - padding;
218
218
  }
219
219
 
220
220
  if ( offsetTop + $el.height() >= scrollTop + outerHeight ) {
221
- this.$refs.content.scrollTop = offsetTop - outerHeight + $el.height();
221
+ this.$refs.content.scrollTop = offsetTop - outerHeight + $el.height() + padding;
222
222
  }
223
223
 
224
224
  let scrollLeft = this.$refs.content
@@ -230,11 +230,11 @@ export default {
230
230
  let offsetLeft = $el.offsetLeft(this.$el);
231
231
 
232
232
  if ( offsetLeft < scrollLeft ) {
233
- this.$refs.content.scrollLeft = offsetLeft;
233
+ this.$refs.content.scrollLeft = offsetLeft - padding;
234
234
  }
235
235
 
236
236
  if ( offsetLeft + $el.width() >= scrollLeft + outerWidth ) {
237
- this.$refs.content.scrollLeft = offsetLeft - outerWidth + $el.width();
237
+ this.$refs.content.scrollLeft = offsetLeft - outerWidth + $el.width() + padding;
238
238
  }
239
239
  },
240
240