@syncfusion/ej2-inputs 25.1.35 → 25.1.38

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.
@@ -88,7 +88,7 @@ var Input;
88
88
  if (parent.classList.contains('e-input-group') || parent.classList.contains('e-outline') || parent.classList.contains('e-filled')) {
89
89
  parent.classList.add('e-input-focus');
90
90
  }
91
- if (args.floatLabelType === 'Auto') {
91
+ if (args.floatLabelType !== 'Never') {
92
92
  setTimeout(function () {
93
93
  Input.calculateWidth(args.element, parent);
94
94
  }, 80);
@@ -99,7 +99,7 @@ var Input;
99
99
  if (parent.classList.contains('e-input-group') || parent.classList.contains('e-outline') || parent.classList.contains('e-filled')) {
100
100
  parent.classList.remove('e-input-focus');
101
101
  }
102
- if (args.floatLabelType === 'Auto' && args.element.value === '') {
102
+ if (args.floatLabelType !== 'Never') {
103
103
  setTimeout(function () {
104
104
  Input.calculateWidth(args.element, parent);
105
105
  }, 80);
@@ -504,7 +504,7 @@ var Input;
504
504
  */
505
505
  function setValue$$1(value, element, floatLabelType, clearButton) {
506
506
  element.value = value;
507
- if (floatLabelType === 'Auto' && value === '') {
507
+ if (floatLabelType !== 'Never') {
508
508
  calculateWidth(element, element.parentElement);
509
509
  }
510
510
  if ((!isNullOrUndefined(floatLabelType)) && floatLabelType === 'Auto') {
@@ -3951,7 +3951,7 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
3951
3951
  if (this.placeholder && !this.isFocus) {
3952
3952
  this.setMaskPlaceholder(false, false);
3953
3953
  }
3954
- if (this.value === "") {
3954
+ if (this.value === "" && oldProp.value != null) {
3955
3955
  this.element.selectionStart = 0;
3956
3956
  this.element.selectionEnd = 0;
3957
3957
  }
@@ -6761,6 +6761,10 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
6761
6761
  if (args !== 'tooltip') {
6762
6762
  this.updateConfig();
6763
6763
  }
6764
+ if (this.readonly) {
6765
+ this.sliderContainer.classList.remove(classNames.readonly);
6766
+ this.setReadOnly();
6767
+ }
6764
6768
  };
6765
6769
  Slider.prototype.changeRtl = function () {
6766
6770
  if (!this.enableRtl && this.type === 'Range') {
@@ -6904,6 +6908,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
6904
6908
  break;
6905
6909
  case 'tooltip':
6906
6910
  if (!isNullOrUndefined(newProp.tooltip) && !isNullOrUndefined(oldProp.tooltip)) {
6911
+ this.initialTooltip = true;
6907
6912
  this.setTooltip(prop);
6908
6913
  if (!this.showButtons) {
6909
6914
  this.wireEvents();
@@ -11818,9 +11823,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
11818
11823
  createPopupOnClick: this.createPopupOnClick,
11819
11824
  open: this.onOpen.bind(this),
11820
11825
  click: function () {
11826
+ var ev = new MouseEvent('click', { bubbles: true, cancelable: false });
11821
11827
  _this.trigger('change', {
11822
11828
  currentValue: { hex: _this.value.slice(0, 7), rgba: _this.convertToRgbString(_this.hexToRgb(_this.value)) },
11823
- previousValue: { hex: null, rgba: null }, value: _this.value
11829
+ previousValue: { hex: null, rgba: null }, value: _this.value, event: ev
11824
11830
  });
11825
11831
  }
11826
11832
  });
@@ -12321,7 +12327,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12321
12327
  this.hsv[2] = this.hsv[2] > 100 ? 100 : this.hsv[2];
12322
12328
  this.setHandlerPosition();
12323
12329
  };
12324
- ColorPicker.prototype.convertToOtherFormat = function (isKey) {
12330
+ ColorPicker.prototype.convertToOtherFormat = function (isKey, e) {
12325
12331
  if (isKey === void 0) { isKey = false; }
12326
12332
  var pValue = this.rgbToHex(this.rgb);
12327
12333
  this.rgb = this.hsvToRgb.apply(this, this.hsv);
@@ -12329,7 +12335,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12329
12335
  var rgba = this.convertToRgbString(this.rgb);
12330
12336
  this.updatePreview(rgba);
12331
12337
  this.updateInput(cValue);
12332
- this.triggerEvent(cValue, pValue, rgba, isKey);
12338
+ this.triggerEvent(cValue, pValue, rgba, isKey, e);
12333
12339
  };
12334
12340
  ColorPicker.prototype.updateInput = function (value) {
12335
12341
  var wrapper = this.getWrapper();
@@ -12562,10 +12568,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12562
12568
  }
12563
12569
  });
12564
12570
  };
12565
- ColorPicker.prototype.triggerChangeEvent = function (value) {
12571
+ ColorPicker.prototype.triggerChangeEvent = function (value, e) {
12566
12572
  var hex = value.slice(0, 7);
12567
12573
  this.trigger('change', {
12568
- currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) },
12574
+ currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) }, event: e,
12569
12575
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
12570
12576
  value: this.enableOpacity ? value : hex
12571
12577
  });
@@ -12584,7 +12590,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12584
12590
  this.hsv[prob] = 0;
12585
12591
  }
12586
12592
  this.updateHsv();
12587
- this.convertToOtherFormat(true);
12593
+ this.convertToOtherFormat(true, e);
12588
12594
  };
12589
12595
  ColorPicker.prototype.handlerDown = function (e) {
12590
12596
  e.preventDefault();
@@ -12601,7 +12607,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12601
12607
  this.setHsv(this.clientX, this.clientY);
12602
12608
  this.getDragHandler().style.transition = 'left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)';
12603
12609
  this.updateHsv();
12604
- this.convertToOtherFormat();
12610
+ this.convertToOtherFormat(false, e);
12605
12611
  this.getDragHandler().focus();
12606
12612
  EventHandler.add(document, 'mousemove touchmove', this.handlerMove, this);
12607
12613
  EventHandler.add(document, 'mouseup touchend', this.handlerEnd, this);
@@ -12623,7 +12629,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12623
12629
  this.setHsv(x, y);
12624
12630
  var dragHandler = this.getDragHandler();
12625
12631
  this.updateHsv();
12626
- this.convertToOtherFormat();
12632
+ this.convertToOtherFormat(false, e);
12627
12633
  this.getTooltipInst().refresh(dragHandler);
12628
12634
  if (!this.tooltipEle.style.transform) {
12629
12635
  if (Math.abs(this.clientX - x) > 8 || Math.abs(this.clientY - y) > 8) {
@@ -12767,7 +12773,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12767
12773
  this.setHandlerPosition();
12768
12774
  this.updateInput(cValue);
12769
12775
  select('.' + PREVIEW + ' .' + CURRENT, this.container).style.backgroundColor = this.convertToRgbString(this.rgb);
12770
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12776
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12771
12777
  };
12772
12778
  ColorPicker.prototype.paletteClickHandler = function (e) {
12773
12779
  e.preventDefault();
@@ -12786,7 +12792,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12786
12792
  if (this.getWrapper().classList.contains(SHOWVALUE)) {
12787
12793
  this.updateInput(cValue);
12788
12794
  }
12789
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12795
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12790
12796
  }
12791
12797
  if (!this.inline && !this.showButtons) {
12792
12798
  this.closePopup(e);
@@ -12845,7 +12851,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12845
12851
  ColorPicker.prototype.ctrlBtnClick = function (ele, e) {
12846
12852
  if (ele.classList.contains(APPLY)) {
12847
12853
  var cValue = this.rgbToHex(this.rgb);
12848
- this.triggerChangeEvent(cValue);
12854
+ this.triggerChangeEvent(cValue, e);
12849
12855
  }
12850
12856
  if (!this.inline) {
12851
12857
  this.closePopup(e);
@@ -12953,7 +12959,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12953
12959
  if (value.length === 9) {
12954
12960
  pValue = this.rgbToHex(this.rgb);
12955
12961
  this.rgb = this.hexToRgb(value + value.substr(-2));
12956
- this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value);
12962
+ this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value, e);
12957
12963
  }
12958
12964
  else {
12959
12965
  return;
@@ -12965,7 +12971,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12965
12971
  pValue = this.rgbToHex(this.rgb);
12966
12972
  this.rgb[0] = Number(target.value);
12967
12973
  hsv = this.rgbToHsv.apply(this, this.rgb);
12968
- this.inputValueChange(hsv, pValue);
12974
+ this.inputValueChange(hsv, pValue, null, e);
12969
12975
  }
12970
12976
  break;
12971
12977
  case 'G':
@@ -12973,7 +12979,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12973
12979
  pValue = this.rgbToHex(this.rgb);
12974
12980
  this.rgb[1] = Number(target.value);
12975
12981
  hsv = this.rgbToHsv.apply(this, this.rgb);
12976
- this.inputValueChange(hsv, pValue);
12982
+ this.inputValueChange(hsv, pValue, null, e);
12977
12983
  }
12978
12984
  break;
12979
12985
  case 'B':
@@ -12981,7 +12987,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12981
12987
  pValue = this.rgbToHex(this.rgb);
12982
12988
  this.rgb[2] = Number(target.value);
12983
12989
  hsv = this.rgbToHsv.apply(this, this.rgb);
12984
- this.inputValueChange(hsv, pValue);
12990
+ this.inputValueChange(hsv, pValue, null, e);
12985
12991
  }
12986
12992
  break;
12987
12993
  case 'H':
@@ -12991,14 +12997,14 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
12991
12997
  if (this.hsv[1] !== Number(target.value)) {
12992
12998
  this.hsv[1] = Number(target.value);
12993
12999
  this.updateHsv();
12994
- this.convertToOtherFormat();
13000
+ this.convertToOtherFormat(false, e);
12995
13001
  }
12996
13002
  break;
12997
13003
  case 'V':
12998
13004
  if (this.hsv[2] !== Number(target.value)) {
12999
13005
  this.hsv[2] = Number(target.value);
13000
13006
  this.updateHsv();
13001
- this.convertToOtherFormat();
13007
+ this.convertToOtherFormat(false, e);
13002
13008
  }
13003
13009
  break;
13004
13010
  case 'A':
@@ -13006,7 +13012,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
13006
13012
  break;
13007
13013
  }
13008
13014
  };
13009
- ColorPicker.prototype.inputValueChange = function (hsv, pValue, value) {
13015
+ ColorPicker.prototype.inputValueChange = function (hsv, pValue, value, e) {
13010
13016
  if (hsv[0] !== this.hsv[0]) {
13011
13017
  this.hueSlider.setProperties({ 'value': hsv[0] }, true);
13012
13018
  this.hueSlider.refresh();
@@ -13018,13 +13024,16 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
13018
13024
  this.updateInput(value ? value : cValue);
13019
13025
  var rgba = this.convertToRgbString(this.rgb);
13020
13026
  this.updatePreview(rgba);
13021
- this.triggerEvent(cValue, pValue, rgba);
13027
+ this.triggerEvent(cValue, pValue, rgba, false, e);
13022
13028
  };
13023
- ColorPicker.prototype.triggerEvent = function (cValue, pValue, rgba, isKey) {
13029
+ ColorPicker.prototype.triggerEvent = function (cValue, pValue, rgba, isKey, e) {
13024
13030
  if (isKey === void 0) { isKey = false; }
13025
13031
  var hex = cValue.slice(0, 7);
13032
+ if (isNullOrUndefined(e)) {
13033
+ e = new MouseEvent('click', { bubbles: true, cancelable: false });
13034
+ }
13026
13035
  if (!this.showButtons && !isKey) {
13027
- this.trigger('change', { currentValue: { hex: hex, rgba: rgba },
13036
+ this.trigger('change', { currentValue: { hex: hex, rgba: rgba }, event: e,
13028
13037
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) }, value: cValue });
13029
13038
  if (this.enableOpacity) {
13030
13039
  this.setProperties({ 'value': cValue }, true);
@@ -13036,7 +13045,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
13036
13045
  }
13037
13046
  else {
13038
13047
  this.trigger('select', {
13039
- currentValue: { hex: hex, rgba: rgba },
13048
+ currentValue: { hex: hex, rgba: rgba }, event: e,
13040
13049
  previousValue: { hex: pValue.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(pValue)) }
13041
13050
  });
13042
13051
  }
@@ -15328,6 +15337,10 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
15328
15337
  this.lastWidth = newWidth;
15329
15338
  };
15330
15339
  SignatureBase.prototype.endDraw = function () {
15340
+ if (isNullOrUndefined(this.pointColl)) {
15341
+ return;
15342
+ }
15343
+
15331
15344
  var canDrawCurve = this.pointColl.length > 2;
15332
15345
  var point = this.pointColl[0];
15333
15346
  if (!canDrawCurve && point) {
@@ -15597,7 +15610,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
15597
15610
  var args = { actionName: 'clear' };
15598
15611
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
15599
15612
  this.tempContext.clearRect(0, 0, this.tempContext.canvas.width, this.tempContext.canvas.height);
15600
- if (this.saveWithBackground) {
15613
+ if (this.saveWithBackground && this.backgroundImage) {
15601
15614
  this.setBackgroundImage(this.backgroundImage, 'temp');
15602
15615
  }
15603
15616
  this.internalRefresh();