@kizmann/nano-ui 0.6.9 → 0.6.14

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.6.9",
3
+ "version": "0.6.14",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -149,7 +149,7 @@ export default {
149
149
 
150
150
  renderHeader()
151
151
  {
152
- if ( !this.label ) {
152
+ if ( !this.label && !this.$slots.label ) {
153
153
  return null;
154
154
  }
155
155
 
@@ -206,7 +206,7 @@ export default {
206
206
 
207
207
  let tempValue = Arr.clone(this.NCollapse.tempValue);
208
208
 
209
- if ( !this.label ) {
209
+ if ( !this.label && !this.$slots.label ) {
210
210
  tempValue.push(this.name);
211
211
  }
212
212
 
@@ -236,7 +236,7 @@ export default {
236
236
 
237
237
  Obj.each(setup['binds'], (value, key) => {
238
238
 
239
- if ( Any.isString(key) ) {
239
+ if ( Any.isString(value) ) {
240
240
  value = { value: value };
241
241
  }
242
242
 
@@ -570,11 +570,25 @@ class NDraghandler {
570
570
 
571
571
  this.dropNodes = this.rootNode.tempSelected = [];
572
572
 
573
- this.rootNode.$emit('move', sources,
573
+ let eventName = 'move';
574
+
575
+ if ( Arr.has(global.keyMods, 18) ) {
576
+ eventName = 'moveAlt';
577
+ }
578
+
579
+ if ( Arr.has(global.keyMods, 17) ) {
580
+ eventName = 'moveCtrl';
581
+ }
582
+
583
+ if ( Arr.has(global.keyMods, 91) ) {
584
+ eventName = 'moveMeta';
585
+ }
586
+
587
+ this.rootNode.$emit(eventName, sources,
574
588
  Obj.get(target, 'uid'), strategy);
575
589
 
576
- this.rootNode.$emit('moveraw', this.cacheNodes,
577
- target, strategy);
590
+ this.rootNode.$emit(eventName + 'Raw',
591
+ this.cacheNodes, target, strategy);
578
592
 
579
593
  this.rootNode.$emit('update:selected',
580
594
  this.rootNode.tempSelected);
@@ -172,9 +172,17 @@ export default {
172
172
 
173
173
  watch: {
174
174
 
175
- modelValue()
175
+ modelValue(value)
176
176
  {
177
- this.tempValue = this.modelValue;
177
+ if ( ! this.multiple && Any.isArray(value) ) {
178
+ value = null;
179
+ }
180
+
181
+ if ( this.multiple && ! Any.isArray(value) ) {
182
+ value = [];
183
+ }
184
+
185
+ this.tempValue = value;
178
186
  },
179
187
 
180
188
  search()
@@ -307,11 +315,21 @@ export default {
307
315
 
308
316
  this.$refs.popover.close();
309
317
 
310
- if ( this.tempValue === tempValue ) {
318
+ let denyUpdate = this.tempValue === tempValue;
319
+
320
+ if ( this.multiple && ! Any.isArray(this.modelValue) ) {
321
+ denyUpdate = false;
322
+ }
323
+
324
+ if ( ! this.multiple && Any.isArray(this.modelValue) ) {
325
+ denyUpdate = false;
326
+ }
327
+
328
+ if ( denyUpdate ) {
311
329
  return;
312
330
  }
313
331
 
314
- this.$emit('update:modelValue',
332
+ this.$emit('update:modelValue',
315
333
  this.tempValue = tempValue);
316
334
  },
317
335
 
@@ -431,7 +449,7 @@ export default {
431
449
 
432
450
  },
433
451
 
434
- created()
452
+ beforeMount()
435
453
  {
436
454
  if ( this.multiple && ! Any.isArray(this.tempValue) ) {
437
455
  this.tempValue = [];
@@ -440,13 +458,11 @@ export default {
440
458
  if ( this.multiple && ! Any.isArray(this.clearValue) ) {
441
459
  this.tempClear = [];
442
460
  }
443
- },
444
461
 
445
- beforeMount()
446
- {
447
462
  this.searchOptions();
448
463
  },
449
464
 
465
+
450
466
  renderLabelClear()
451
467
  {
452
468
  if ( ! this.clearable || Any.isEmpty(this.tempValue) ) {
@@ -529,6 +545,10 @@ export default {
529
545
 
530
546
  renderLabelItems()
531
547
  {
548
+ if ( ! Any.isArray(this.tempValue) ) {
549
+ return null;
550
+ }
551
+
532
552
  if ( this.collapse ) {
533
553
  return this.ctor('renderLabelCollapse')();
534
554
  }
@@ -6,7 +6,7 @@ export default {
6
6
 
7
7
  props: {
8
8
 
9
- value: {
9
+ modelValue: {
10
10
  default()
11
11
  {
12
12
  return null;
@@ -144,7 +144,7 @@ export default {
144
144
  {
145
145
  return {
146
146
  focus: false,
147
- tempValue: Now.make(this.value),
147
+ tempValue: Now.make(this.modelValue),
148
148
  }
149
149
  },
150
150