@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(() => {
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(() => {
104
104
  Input.calculateWidth(args.element, parent);
105
105
  }, 80);
@@ -501,7 +501,7 @@ var Input;
501
501
  */
502
502
  function setValue$$1(value, element, floatLabelType, clearButton) {
503
503
  element.value = value;
504
- if (floatLabelType === 'Auto' && value === '') {
504
+ if (floatLabelType !== 'Never') {
505
505
  calculateWidth(element, element.parentElement);
506
506
  }
507
507
  if ((!isNullOrUndefined(floatLabelType)) && floatLabelType === 'Auto') {
@@ -3888,7 +3888,7 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3888
3888
  if (this.placeholder && !this.isFocus) {
3889
3889
  this.setMaskPlaceholder(false, false);
3890
3890
  }
3891
- if (this.value === "") {
3891
+ if (this.value === "" && oldProp.value != null) {
3892
3892
  this.element.selectionStart = 0;
3893
3893
  this.element.selectionEnd = 0;
3894
3894
  }
@@ -6651,6 +6651,10 @@ let Slider = class Slider extends Component {
6651
6651
  if (args !== 'tooltip') {
6652
6652
  this.updateConfig();
6653
6653
  }
6654
+ if (this.readonly) {
6655
+ this.sliderContainer.classList.remove(classNames.readonly);
6656
+ this.setReadOnly();
6657
+ }
6654
6658
  }
6655
6659
  changeRtl() {
6656
6660
  if (!this.enableRtl && this.type === 'Range') {
@@ -6792,6 +6796,7 @@ let Slider = class Slider extends Component {
6792
6796
  break;
6793
6797
  case 'tooltip':
6794
6798
  if (!isNullOrUndefined(newProp.tooltip) && !isNullOrUndefined(oldProp.tooltip)) {
6799
+ this.initialTooltip = true;
6795
6800
  this.setTooltip(prop);
6796
6801
  if (!this.showButtons) {
6797
6802
  this.wireEvents();
@@ -11575,9 +11580,10 @@ let ColorPicker = class ColorPicker extends Component {
11575
11580
  createPopupOnClick: this.createPopupOnClick,
11576
11581
  open: this.onOpen.bind(this),
11577
11582
  click: () => {
11583
+ const ev = new MouseEvent('click', { bubbles: true, cancelable: false });
11578
11584
  this.trigger('change', {
11579
11585
  currentValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
11580
- previousValue: { hex: null, rgba: null }, value: this.value
11586
+ previousValue: { hex: null, rgba: null }, value: this.value, event: ev
11581
11587
  });
11582
11588
  }
11583
11589
  });
@@ -12073,14 +12079,14 @@ let ColorPicker = class ColorPicker extends Component {
12073
12079
  this.hsv[2] = this.hsv[2] > 100 ? 100 : this.hsv[2];
12074
12080
  this.setHandlerPosition();
12075
12081
  }
12076
- convertToOtherFormat(isKey = false) {
12082
+ convertToOtherFormat(isKey = false, e) {
12077
12083
  const pValue = this.rgbToHex(this.rgb);
12078
12084
  this.rgb = this.hsvToRgb.apply(this, this.hsv);
12079
12085
  const cValue = this.rgbToHex(this.rgb);
12080
12086
  const rgba = this.convertToRgbString(this.rgb);
12081
12087
  this.updatePreview(rgba);
12082
12088
  this.updateInput(cValue);
12083
- this.triggerEvent(cValue, pValue, rgba, isKey);
12089
+ this.triggerEvent(cValue, pValue, rgba, isKey, e);
12084
12090
  }
12085
12091
  updateInput(value) {
12086
12092
  const wrapper = this.getWrapper();
@@ -12312,10 +12318,10 @@ let ColorPicker = class ColorPicker extends Component {
12312
12318
  }
12313
12319
  });
12314
12320
  }
12315
- triggerChangeEvent(value) {
12321
+ triggerChangeEvent(value, e) {
12316
12322
  const hex = value.slice(0, 7);
12317
12323
  this.trigger('change', {
12318
- currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) },
12324
+ currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) }, event: e,
12319
12325
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
12320
12326
  value: this.enableOpacity ? value : hex
12321
12327
  });
@@ -12334,7 +12340,7 @@ let ColorPicker = class ColorPicker extends Component {
12334
12340
  this.hsv[prob] = 0;
12335
12341
  }
12336
12342
  this.updateHsv();
12337
- this.convertToOtherFormat(true);
12343
+ this.convertToOtherFormat(true, e);
12338
12344
  }
12339
12345
  handlerDown(e) {
12340
12346
  e.preventDefault();
@@ -12351,7 +12357,7 @@ let ColorPicker = class ColorPicker extends Component {
12351
12357
  this.setHsv(this.clientX, this.clientY);
12352
12358
  this.getDragHandler().style.transition = 'left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)';
12353
12359
  this.updateHsv();
12354
- this.convertToOtherFormat();
12360
+ this.convertToOtherFormat(false, e);
12355
12361
  this.getDragHandler().focus();
12356
12362
  EventHandler.add(document, 'mousemove touchmove', this.handlerMove, this);
12357
12363
  EventHandler.add(document, 'mouseup touchend', this.handlerEnd, this);
@@ -12373,7 +12379,7 @@ let ColorPicker = class ColorPicker extends Component {
12373
12379
  this.setHsv(x, y);
12374
12380
  const dragHandler = this.getDragHandler();
12375
12381
  this.updateHsv();
12376
- this.convertToOtherFormat();
12382
+ this.convertToOtherFormat(false, e);
12377
12383
  this.getTooltipInst().refresh(dragHandler);
12378
12384
  if (!this.tooltipEle.style.transform) {
12379
12385
  if (Math.abs(this.clientX - x) > 8 || Math.abs(this.clientY - y) > 8) {
@@ -12517,7 +12523,7 @@ let ColorPicker = class ColorPicker extends Component {
12517
12523
  this.setHandlerPosition();
12518
12524
  this.updateInput(cValue);
12519
12525
  select('.' + PREVIEW + ' .' + CURRENT, this.container).style.backgroundColor = this.convertToRgbString(this.rgb);
12520
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12526
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12521
12527
  }
12522
12528
  paletteClickHandler(e) {
12523
12529
  e.preventDefault();
@@ -12536,7 +12542,7 @@ let ColorPicker = class ColorPicker extends Component {
12536
12542
  if (this.getWrapper().classList.contains(SHOWVALUE)) {
12537
12543
  this.updateInput(cValue);
12538
12544
  }
12539
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12545
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12540
12546
  }
12541
12547
  if (!this.inline && !this.showButtons) {
12542
12548
  this.closePopup(e);
@@ -12594,7 +12600,7 @@ let ColorPicker = class ColorPicker extends Component {
12594
12600
  ctrlBtnClick(ele, e) {
12595
12601
  if (ele.classList.contains(APPLY)) {
12596
12602
  const cValue = this.rgbToHex(this.rgb);
12597
- this.triggerChangeEvent(cValue);
12603
+ this.triggerChangeEvent(cValue, e);
12598
12604
  }
12599
12605
  if (!this.inline) {
12600
12606
  this.closePopup(e);
@@ -12702,7 +12708,7 @@ let ColorPicker = class ColorPicker extends Component {
12702
12708
  if (value.length === 9) {
12703
12709
  pValue = this.rgbToHex(this.rgb);
12704
12710
  this.rgb = this.hexToRgb(value + value.substr(-2));
12705
- this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value);
12711
+ this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value, e);
12706
12712
  }
12707
12713
  else {
12708
12714
  return;
@@ -12714,7 +12720,7 @@ let ColorPicker = class ColorPicker extends Component {
12714
12720
  pValue = this.rgbToHex(this.rgb);
12715
12721
  this.rgb[0] = Number(target.value);
12716
12722
  hsv = this.rgbToHsv.apply(this, this.rgb);
12717
- this.inputValueChange(hsv, pValue);
12723
+ this.inputValueChange(hsv, pValue, null, e);
12718
12724
  }
12719
12725
  break;
12720
12726
  case 'G':
@@ -12722,7 +12728,7 @@ let ColorPicker = class ColorPicker extends Component {
12722
12728
  pValue = this.rgbToHex(this.rgb);
12723
12729
  this.rgb[1] = Number(target.value);
12724
12730
  hsv = this.rgbToHsv.apply(this, this.rgb);
12725
- this.inputValueChange(hsv, pValue);
12731
+ this.inputValueChange(hsv, pValue, null, e);
12726
12732
  }
12727
12733
  break;
12728
12734
  case 'B':
@@ -12730,7 +12736,7 @@ let ColorPicker = class ColorPicker extends Component {
12730
12736
  pValue = this.rgbToHex(this.rgb);
12731
12737
  this.rgb[2] = Number(target.value);
12732
12738
  hsv = this.rgbToHsv.apply(this, this.rgb);
12733
- this.inputValueChange(hsv, pValue);
12739
+ this.inputValueChange(hsv, pValue, null, e);
12734
12740
  }
12735
12741
  break;
12736
12742
  case 'H':
@@ -12740,14 +12746,14 @@ let ColorPicker = class ColorPicker extends Component {
12740
12746
  if (this.hsv[1] !== Number(target.value)) {
12741
12747
  this.hsv[1] = Number(target.value);
12742
12748
  this.updateHsv();
12743
- this.convertToOtherFormat();
12749
+ this.convertToOtherFormat(false, e);
12744
12750
  }
12745
12751
  break;
12746
12752
  case 'V':
12747
12753
  if (this.hsv[2] !== Number(target.value)) {
12748
12754
  this.hsv[2] = Number(target.value);
12749
12755
  this.updateHsv();
12750
- this.convertToOtherFormat();
12756
+ this.convertToOtherFormat(false, e);
12751
12757
  }
12752
12758
  break;
12753
12759
  case 'A':
@@ -12755,7 +12761,7 @@ let ColorPicker = class ColorPicker extends Component {
12755
12761
  break;
12756
12762
  }
12757
12763
  }
12758
- inputValueChange(hsv, pValue, value) {
12764
+ inputValueChange(hsv, pValue, value, e) {
12759
12765
  if (hsv[0] !== this.hsv[0]) {
12760
12766
  this.hueSlider.setProperties({ 'value': hsv[0] }, true);
12761
12767
  this.hueSlider.refresh();
@@ -12767,12 +12773,15 @@ let ColorPicker = class ColorPicker extends Component {
12767
12773
  this.updateInput(value ? value : cValue);
12768
12774
  const rgba = this.convertToRgbString(this.rgb);
12769
12775
  this.updatePreview(rgba);
12770
- this.triggerEvent(cValue, pValue, rgba);
12776
+ this.triggerEvent(cValue, pValue, rgba, false, e);
12771
12777
  }
12772
- triggerEvent(cValue, pValue, rgba, isKey = false) {
12778
+ triggerEvent(cValue, pValue, rgba, isKey = false, e) {
12773
12779
  const hex = cValue.slice(0, 7);
12780
+ if (isNullOrUndefined(e)) {
12781
+ e = new MouseEvent('click', { bubbles: true, cancelable: false });
12782
+ }
12774
12783
  if (!this.showButtons && !isKey) {
12775
- this.trigger('change', { currentValue: { hex: hex, rgba: rgba },
12784
+ this.trigger('change', { currentValue: { hex: hex, rgba: rgba }, event: e,
12776
12785
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) }, value: cValue });
12777
12786
  if (this.enableOpacity) {
12778
12787
  this.setProperties({ 'value': cValue }, true);
@@ -12784,7 +12793,7 @@ let ColorPicker = class ColorPicker extends Component {
12784
12793
  }
12785
12794
  else {
12786
12795
  this.trigger('select', {
12787
- currentValue: { hex: hex, rgba: rgba },
12796
+ currentValue: { hex: hex, rgba: rgba }, event: e,
12788
12797
  previousValue: { hex: pValue.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(pValue)) }
12789
12798
  });
12790
12799
  }
@@ -15012,6 +15021,10 @@ class SignatureBase extends Component {
15012
15021
  this.lastWidth = newWidth;
15013
15022
  }
15014
15023
  endDraw() {
15024
+ if (isNullOrUndefined(this.pointColl)) {
15025
+ return;
15026
+ }
15027
+
15015
15028
  const canDrawCurve = this.pointColl.length > 2;
15016
15029
  const point = this.pointColl[0];
15017
15030
  if (!canDrawCurve && point) {
@@ -15281,7 +15294,7 @@ class SignatureBase extends Component {
15281
15294
  const args = { actionName: 'clear' };
15282
15295
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
15283
15296
  this.tempContext.clearRect(0, 0, this.tempContext.canvas.width, this.tempContext.canvas.height);
15284
- if (this.saveWithBackground) {
15297
+ if (this.saveWithBackground && this.backgroundImage) {
15285
15298
  this.setBackgroundImage(this.backgroundImage, 'temp');
15286
15299
  }
15287
15300
  this.internalRefresh();