bk-magic-vue 2.5.2 → 2.5.3-beta.11

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.
@@ -7687,6 +7687,9 @@
7687
7687
  if (shouldEmitInput) {
7688
7688
  this.$emit('input', now);
7689
7689
  }
7690
+ },
7691
+ visualValue: function visualValue(val) {
7692
+ this.focusedTime.time = this.internalValue.map(extractTime);
7690
7693
  }
7691
7694
  },
7692
7695
  mounted: function mounted() {
@@ -27119,7 +27122,7 @@
27119
27122
  var isIOS = isBrowser$2 && /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream;
27120
27123
  var defaultProps = {
27121
27124
  a11y: true,
27122
- allowHTML: false,
27125
+ allowHTML: true,
27123
27126
  animateFill: true,
27124
27127
  animation: 'shift-away',
27125
27128
  appendTo: function appendTo() {
@@ -28368,7 +28371,7 @@
28368
28371
  interactive: true,
28369
28372
  boundary: 'window',
28370
28373
  content: '',
28371
- allowHTML: false,
28374
+ allowHTML: true,
28372
28375
  extCls: ''
28373
28376
  };
28374
28377
  var validPlacements$2 = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
@@ -29208,7 +29211,8 @@
29208
29211
  38, 40, 37, 39,
29209
29212
  46,
29210
29213
  9
29211
- ]
29214
+ ],
29215
+ isOnComposition: false
29212
29216
  };
29213
29217
  },
29214
29218
  computed: {
@@ -29470,7 +29474,7 @@
29470
29474
  var target = event.currentTarget;
29471
29475
  var value = target.value;
29472
29476
  if (this.inputType === 'number') {
29473
- if (this.validKeyCodeList.indexOf(keyCode) < 0) {
29477
+ if (this.validKeyCodeList.indexOf(keyCode) < 0 || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
29474
29478
  event.stopPropagation();
29475
29479
  event.preventDefault();
29476
29480
  return false;
@@ -29507,6 +29511,22 @@
29507
29511
  event.preventDefault();
29508
29512
  this.handleNumberDelete(event);
29509
29513
  }
29514
+ if (document.getSelection().type !== 'Range') {
29515
+ if (value.indexOf('-') === 0 && target.selectionStart === 0) {
29516
+ var keyCodeList = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
29517
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
29518
+ 189,
29519
+ 109,
29520
+ 190,
29521
+ 110
29522
+ ];
29523
+ if (keyCodeList.indexOf(keyCode) > -1) {
29524
+ event.stopPropagation();
29525
+ event.preventDefault();
29526
+ return false;
29527
+ }
29528
+ }
29529
+ }
29510
29530
  }
29511
29531
  this.$emit('keydown', value, event);
29512
29532
  },
@@ -29524,12 +29544,16 @@
29524
29544
  var value = event.target.value;
29525
29545
  if (/^number$/i.test(this.type) && value !== '') {
29526
29546
  if (value !== '' && /^-?\d*(.\d*)?$/i.test(value)) {
29527
- if (value > this.max || value < this.min) {
29528
- value = this.getCurrentNumberValue();
29547
+ if (value === '-') {
29548
+ value = this.min === minSafeInteger$1 ? 0 : this.min;
29549
+ } else {
29550
+ if (value > this.max || value < this.min) {
29551
+ value = this.getCurrentNumberValue();
29552
+ }
29529
29553
  }
29530
29554
  }
29531
29555
  if (typeof this.precision !== 'undefined') {
29532
- value = this.toPrecision(Number(value), this.precision, true);
29556
+ value = this.toPrecision(_parseFloat$2(value), this.precision, true);
29533
29557
  } else {
29534
29558
  value = Number(value);
29535
29559
  }
@@ -29562,12 +29586,28 @@
29562
29586
  }
29563
29587
  return '';
29564
29588
  },
29589
+ handlerCompositionstart: function handlerCompositionstart(e) {
29590
+ this.isOnComposition = true;
29591
+ },
29592
+ handlerCompositionend: function handlerCompositionend(e) {
29593
+ if (this.inputType === 'number' && this.isOnComposition) {
29594
+ e.target.value = this.curValue;
29595
+ this.isOnComposition = false;
29596
+ this.handlerInput(e);
29597
+ }
29598
+ },
29565
29599
  handlerInput: function handlerInput(event) {
29566
- var value = event.target.value;
29567
- this.setCurValue(value);
29568
- this.$emit('input', value, event);
29569
- this.$emit('change', value, event);
29570
- this.dispatch('bk-form-item', 'form-change');
29600
+ var _this3 = this;
29601
+ if (this.inputType === 'number' && this.isOnComposition) {
29602
+ return;
29603
+ }
29604
+ this.$nextTick(function () {
29605
+ var value = event.target.value;
29606
+ _this3.setCurValue(value);
29607
+ _this3.$emit('input', value, event);
29608
+ _this3.$emit('change', value, event);
29609
+ _this3.dispatch('bk-form-item', 'form-change');
29610
+ });
29571
29611
  },
29572
29612
  handlerClear: function handlerClear(event) {
29573
29613
  this.curValue = '';
@@ -29690,7 +29730,9 @@
29690
29730
  "focus": _vm.handlerFocus,
29691
29731
  "blur": _vm.handlerBlur,
29692
29732
  "input": _vm.handlerInput,
29693
- "paste": _vm.handlerPaste
29733
+ "paste": _vm.handlerPaste,
29734
+ "compositionstart": _vm.handlerCompositionstart,
29735
+ "compositionend": _vm.handlerCompositionend
29694
29736
  }
29695
29737
  }, 'input', _vm.bindAttribute, false)), /^number$/i.test(_vm.type) && !_vm.disabled && !_vm.readonly ? [_vm.showControls ? _c('span', {
29696
29738
  staticClass: "input-number-option"
@@ -41442,8 +41484,10 @@
41442
41484
  setHeaderStyle: function setHeaderStyle() {
41443
41485
  var _this4 = this;
41444
41486
  this.$nextTick(function () {
41445
- _this4.$refs.bkTable.style.setProperty('--customHeaderColor', _this4.customHeaderColor);
41446
- _this4.$refs.bkTable.style.setProperty('--customHeaderColorHover', _this4.customHeaderColorHover);
41487
+ if (_this4.$refs.bkTable) {
41488
+ _this4.$refs.bkTable.style.setProperty('--customHeaderColor', _this4.customHeaderColor);
41489
+ _this4.$refs.bkTable.style.setProperty('--customHeaderColorHover', _this4.customHeaderColorHover);
41490
+ }
41447
41491
  });
41448
41492
  },
41449
41493
  setCurrentRow: function setCurrentRow(row) {