@kizmann/nano-ui 0.7.10 → 0.7.11

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/nano-ui",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -64,7 +64,7 @@ export default {
64
64
  uid: UUID(),
65
65
  elements: [],
66
66
  options: [],
67
- tempValue: this.item,
67
+ tempValue: this.item,
68
68
  };
69
69
  },
70
70
 
@@ -89,11 +89,16 @@ export default {
89
89
  this.unbindSyncEvent();
90
90
  },
91
91
 
92
+ updated()
93
+ {
94
+ Any.delay(() => this.$refs.scrollbar.adaptHeight(), 500);
95
+ },
96
+
92
97
  methods: {
93
98
 
94
99
  bindSyncEvent()
95
100
  {
96
- if ( ! this.syncEvent ) {
101
+ if ( !this.syncEvent ) {
97
102
  return;
98
103
  }
99
104
 
@@ -109,7 +114,7 @@ export default {
109
114
  }
110
115
  };
111
116
 
112
- Event.bind(this.options[0], syncFunction,
117
+ Event.bind(this.options[0], syncFunction,
113
118
  this.uid);
114
119
  },
115
120
 
@@ -120,19 +125,19 @@ export default {
120
125
 
121
126
  setValue(value)
122
127
  {
123
- this.$emit('update:modelValue',
128
+ this.$emit('update:modelValue',
124
129
  this.tempValue = value);
125
130
  },
126
131
 
127
132
  addColumn(column)
128
133
  {
129
- Arr.add(this.elements,
134
+ Arr.add(this.elements,
130
135
  column, { uid: column.uid });
131
136
  },
132
137
 
133
138
  removeColumn(column)
134
139
  {
135
- Arr.remove(this.elements,
140
+ Arr.remove(this.elements,
136
141
  { uid: column.uid });
137
142
  },
138
143
 
@@ -148,8 +153,8 @@ export default {
148
153
  renderEmpty()
149
154
  {
150
155
  return (
151
- <NEmptyIcon disabled={! this.showEmptyIcon} class="n-info__empty">
152
- { this.$slots.empty && this.$slots.empty() || this.trans('No entry') }
156
+ <NEmptyIcon disabled={!this.showEmptyIcon} class="n-info__empty">
157
+ {this.$slots.empty && this.$slots.empty() || this.trans('No entry')}
153
158
  </NEmptyIcon>
154
159
  );
155
160
  },
@@ -163,16 +168,16 @@ export default {
163
168
  let elements = Obj.each(this.elements, (column) => {
164
169
  return (
165
170
  <div class="n-info__column">
166
- { column.ctor('renderLabel')({ item: this.tempValue }) }
167
- { column.ctor('renderBody')({ item: this.tempValue }) }
171
+ {column.ctor('renderLabel')({ item: this.tempValue })}
172
+ {column.ctor('renderBody')({ item: this.tempValue })}
168
173
  </div>
169
174
  );
170
175
  });
171
176
 
172
177
  return (
173
- <div class="n-info__body">
174
- { Any.vals(elements)}
175
- </div>
178
+ <div class="n-info__body">
179
+ {Any.vals(elements)}
180
+ </div>
176
181
  );
177
182
  },
178
183
 
@@ -184,12 +189,15 @@ export default {
184
189
  'n-info--' + this.size,
185
190
  ];
186
191
 
192
+ let infoHtml = (
193
+ <NScrollbar ref="scrollbar" relative={this.relative}>
194
+ {this.ctor('renderBody')()}
195
+ </NScrollbar>
196
+ );
197
+
187
198
  return (
188
199
  <div class={classList}>
189
- <NScrollbar relative={this.relative}>
190
- { this.ctor('renderBody')() }
191
- </NScrollbar>
192
- { this.$slots.default() }
200
+ {[infoHtml, this.$slots.default()]}
193
201
  </div>
194
202
  );
195
203
  }
@@ -80,7 +80,7 @@ export default {
80
80
  framerate: {
81
81
  default()
82
82
  {
83
- return 30;
83
+ return 24;
84
84
  },
85
85
  type: [Number]
86
86
  },
@@ -310,7 +310,7 @@ export default {
310
310
  // Dom.find(this.$el).addClass('has-native-hbar');
311
311
  // }
312
312
 
313
- let hasVtrack = outerHeight && outerHeight < innerHeight - 1;
313
+ let hasVtrack = outerHeight && outerHeight < innerHeight;
314
314
 
315
315
  if ( hasVtrack ) {
316
316
  Dom.find(this.$el).addClass('has-vtrack');
@@ -388,7 +388,7 @@ export default {
388
388
  // Dom.find(this.$el).addClass('has-native-vbar');
389
389
  // }
390
390
 
391
- let hasHtrack = outerWidth && outerWidth < innerWidth - 1;
391
+ let hasHtrack = outerWidth && outerWidth < innerWidth;
392
392
 
393
393
  if ( hasHtrack ) {
394
394
  Dom.find(this.$el).addClass('has-htrack');
@@ -446,16 +446,26 @@ export default {
446
446
 
447
447
  adaptHeight()
448
448
  {
449
- let height = Dom.find(this.$refs.content)
450
- .child().height();
449
+ if ( ! this.cacheChildEl ) {
450
+ this.cacheChildEl = Dom.find(this.$refs.content).child();
451
+ }
451
452
 
452
- let window = Dom.find(this.$el)
453
+ let height = this.cacheChildEl
454
+ .height();
455
+
456
+ if ( ! this.cacheWindwoEl ) {
457
+ this.cacheWindwoEl = Dom.find(this.$el);
458
+ }
459
+
460
+ let window = this.cacheWindwoEl
453
461
  .innerHeight();
454
462
 
455
- if ( height === this.passedHeight ) {
463
+ if ( height === this.passedHeight && window === this.windowCache ) {
456
464
  return;
457
465
  }
458
466
 
467
+ this.windowCache = window;
468
+
459
469
  if ( this.overflowY ) {
460
470
  this.adaptScrollHeight();
461
471
  }