@syncfusion/ej2-inputs 25.1.37 → 25.1.40

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') {
@@ -9803,7 +9803,10 @@ let Uploader = class Uploader extends Component {
9803
9803
  let li;
9804
9804
  for (let i = 0; i < files.length; i++) {
9805
9805
  li = this.getLiElement(files[i]);
9806
- if (!li.classList.contains(UPLOAD_SUCCESS)) {
9806
+ if (!isNullOrUndefined(li) && !li.classList.contains(UPLOAD_SUCCESS)) {
9807
+ filterFiles.push(files[i]);
9808
+ }
9809
+ else if (!this.showFileList && files[i].status !== "File uploaded successfully") {
9807
9810
  filterFiles.push(files[i]);
9808
9811
  }
9809
9812
  }
@@ -10005,7 +10008,7 @@ let Uploader = class Uploader extends Component {
10005
10008
  const status = e.target;
10006
10009
  if (status.readyState === 4 && status.status >= 200 && status.status <= 299) {
10007
10010
  const li = this.getLiElement(file);
10008
- if (isNullOrUndefined(li) && (!customUI || isNullOrUndefined(customUI))) {
10011
+ if (isNullOrUndefined(li) && (!customUI || isNullOrUndefined(customUI)) && this.showFileList) {
10009
10012
  return;
10010
10013
  }
10011
10014
  if (!isNullOrUndefined(li)) {
@@ -11580,9 +11583,10 @@ let ColorPicker = class ColorPicker extends Component {
11580
11583
  createPopupOnClick: this.createPopupOnClick,
11581
11584
  open: this.onOpen.bind(this),
11582
11585
  click: () => {
11586
+ const ev = new MouseEvent('click', { bubbles: true, cancelable: false });
11583
11587
  this.trigger('change', {
11584
11588
  currentValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
11585
- previousValue: { hex: null, rgba: null }, value: this.value
11589
+ previousValue: { hex: null, rgba: null }, value: this.value, event: ev
11586
11590
  });
11587
11591
  }
11588
11592
  });
@@ -12078,14 +12082,14 @@ let ColorPicker = class ColorPicker extends Component {
12078
12082
  this.hsv[2] = this.hsv[2] > 100 ? 100 : this.hsv[2];
12079
12083
  this.setHandlerPosition();
12080
12084
  }
12081
- convertToOtherFormat(isKey = false) {
12085
+ convertToOtherFormat(isKey = false, e) {
12082
12086
  const pValue = this.rgbToHex(this.rgb);
12083
12087
  this.rgb = this.hsvToRgb.apply(this, this.hsv);
12084
12088
  const cValue = this.rgbToHex(this.rgb);
12085
12089
  const rgba = this.convertToRgbString(this.rgb);
12086
12090
  this.updatePreview(rgba);
12087
12091
  this.updateInput(cValue);
12088
- this.triggerEvent(cValue, pValue, rgba, isKey);
12092
+ this.triggerEvent(cValue, pValue, rgba, isKey, e);
12089
12093
  }
12090
12094
  updateInput(value) {
12091
12095
  const wrapper = this.getWrapper();
@@ -12317,10 +12321,10 @@ let ColorPicker = class ColorPicker extends Component {
12317
12321
  }
12318
12322
  });
12319
12323
  }
12320
- triggerChangeEvent(value) {
12324
+ triggerChangeEvent(value, e) {
12321
12325
  const hex = value.slice(0, 7);
12322
12326
  this.trigger('change', {
12323
- currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) },
12327
+ currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) }, event: e,
12324
12328
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
12325
12329
  value: this.enableOpacity ? value : hex
12326
12330
  });
@@ -12339,7 +12343,7 @@ let ColorPicker = class ColorPicker extends Component {
12339
12343
  this.hsv[prob] = 0;
12340
12344
  }
12341
12345
  this.updateHsv();
12342
- this.convertToOtherFormat(true);
12346
+ this.convertToOtherFormat(true, e);
12343
12347
  }
12344
12348
  handlerDown(e) {
12345
12349
  e.preventDefault();
@@ -12356,7 +12360,7 @@ let ColorPicker = class ColorPicker extends Component {
12356
12360
  this.setHsv(this.clientX, this.clientY);
12357
12361
  this.getDragHandler().style.transition = 'left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)';
12358
12362
  this.updateHsv();
12359
- this.convertToOtherFormat();
12363
+ this.convertToOtherFormat(false, e);
12360
12364
  this.getDragHandler().focus();
12361
12365
  EventHandler.add(document, 'mousemove touchmove', this.handlerMove, this);
12362
12366
  EventHandler.add(document, 'mouseup touchend', this.handlerEnd, this);
@@ -12378,7 +12382,7 @@ let ColorPicker = class ColorPicker extends Component {
12378
12382
  this.setHsv(x, y);
12379
12383
  const dragHandler = this.getDragHandler();
12380
12384
  this.updateHsv();
12381
- this.convertToOtherFormat();
12385
+ this.convertToOtherFormat(false, e);
12382
12386
  this.getTooltipInst().refresh(dragHandler);
12383
12387
  if (!this.tooltipEle.style.transform) {
12384
12388
  if (Math.abs(this.clientX - x) > 8 || Math.abs(this.clientY - y) > 8) {
@@ -12522,7 +12526,7 @@ let ColorPicker = class ColorPicker extends Component {
12522
12526
  this.setHandlerPosition();
12523
12527
  this.updateInput(cValue);
12524
12528
  select('.' + PREVIEW + ' .' + CURRENT, this.container).style.backgroundColor = this.convertToRgbString(this.rgb);
12525
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12529
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12526
12530
  }
12527
12531
  paletteClickHandler(e) {
12528
12532
  e.preventDefault();
@@ -12541,7 +12545,7 @@ let ColorPicker = class ColorPicker extends Component {
12541
12545
  if (this.getWrapper().classList.contains(SHOWVALUE)) {
12542
12546
  this.updateInput(cValue);
12543
12547
  }
12544
- this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
12548
+ this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), false, e);
12545
12549
  }
12546
12550
  if (!this.inline && !this.showButtons) {
12547
12551
  this.closePopup(e);
@@ -12599,7 +12603,7 @@ let ColorPicker = class ColorPicker extends Component {
12599
12603
  ctrlBtnClick(ele, e) {
12600
12604
  if (ele.classList.contains(APPLY)) {
12601
12605
  const cValue = this.rgbToHex(this.rgb);
12602
- this.triggerChangeEvent(cValue);
12606
+ this.triggerChangeEvent(cValue, e);
12603
12607
  }
12604
12608
  if (!this.inline) {
12605
12609
  this.closePopup(e);
@@ -12707,7 +12711,7 @@ let ColorPicker = class ColorPicker extends Component {
12707
12711
  if (value.length === 9) {
12708
12712
  pValue = this.rgbToHex(this.rgb);
12709
12713
  this.rgb = this.hexToRgb(value + value.substr(-2));
12710
- this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value);
12714
+ this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value, e);
12711
12715
  }
12712
12716
  else {
12713
12717
  return;
@@ -12719,7 +12723,7 @@ let ColorPicker = class ColorPicker extends Component {
12719
12723
  pValue = this.rgbToHex(this.rgb);
12720
12724
  this.rgb[0] = Number(target.value);
12721
12725
  hsv = this.rgbToHsv.apply(this, this.rgb);
12722
- this.inputValueChange(hsv, pValue);
12726
+ this.inputValueChange(hsv, pValue, null, e);
12723
12727
  }
12724
12728
  break;
12725
12729
  case 'G':
@@ -12727,7 +12731,7 @@ let ColorPicker = class ColorPicker extends Component {
12727
12731
  pValue = this.rgbToHex(this.rgb);
12728
12732
  this.rgb[1] = Number(target.value);
12729
12733
  hsv = this.rgbToHsv.apply(this, this.rgb);
12730
- this.inputValueChange(hsv, pValue);
12734
+ this.inputValueChange(hsv, pValue, null, e);
12731
12735
  }
12732
12736
  break;
12733
12737
  case 'B':
@@ -12735,7 +12739,7 @@ let ColorPicker = class ColorPicker extends Component {
12735
12739
  pValue = this.rgbToHex(this.rgb);
12736
12740
  this.rgb[2] = Number(target.value);
12737
12741
  hsv = this.rgbToHsv.apply(this, this.rgb);
12738
- this.inputValueChange(hsv, pValue);
12742
+ this.inputValueChange(hsv, pValue, null, e);
12739
12743
  }
12740
12744
  break;
12741
12745
  case 'H':
@@ -12745,14 +12749,14 @@ let ColorPicker = class ColorPicker extends Component {
12745
12749
  if (this.hsv[1] !== Number(target.value)) {
12746
12750
  this.hsv[1] = Number(target.value);
12747
12751
  this.updateHsv();
12748
- this.convertToOtherFormat();
12752
+ this.convertToOtherFormat(false, e);
12749
12753
  }
12750
12754
  break;
12751
12755
  case 'V':
12752
12756
  if (this.hsv[2] !== Number(target.value)) {
12753
12757
  this.hsv[2] = Number(target.value);
12754
12758
  this.updateHsv();
12755
- this.convertToOtherFormat();
12759
+ this.convertToOtherFormat(false, e);
12756
12760
  }
12757
12761
  break;
12758
12762
  case 'A':
@@ -12760,7 +12764,7 @@ let ColorPicker = class ColorPicker extends Component {
12760
12764
  break;
12761
12765
  }
12762
12766
  }
12763
- inputValueChange(hsv, pValue, value) {
12767
+ inputValueChange(hsv, pValue, value, e) {
12764
12768
  if (hsv[0] !== this.hsv[0]) {
12765
12769
  this.hueSlider.setProperties({ 'value': hsv[0] }, true);
12766
12770
  this.hueSlider.refresh();
@@ -12772,12 +12776,15 @@ let ColorPicker = class ColorPicker extends Component {
12772
12776
  this.updateInput(value ? value : cValue);
12773
12777
  const rgba = this.convertToRgbString(this.rgb);
12774
12778
  this.updatePreview(rgba);
12775
- this.triggerEvent(cValue, pValue, rgba);
12779
+ this.triggerEvent(cValue, pValue, rgba, false, e);
12776
12780
  }
12777
- triggerEvent(cValue, pValue, rgba, isKey = false) {
12781
+ triggerEvent(cValue, pValue, rgba, isKey = false, e) {
12778
12782
  const hex = cValue.slice(0, 7);
12783
+ if (isNullOrUndefined(e)) {
12784
+ e = new MouseEvent('click', { bubbles: true, cancelable: false });
12785
+ }
12779
12786
  if (!this.showButtons && !isKey) {
12780
- this.trigger('change', { currentValue: { hex: hex, rgba: rgba },
12787
+ this.trigger('change', { currentValue: { hex: hex, rgba: rgba }, event: e,
12781
12788
  previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) }, value: cValue });
12782
12789
  if (this.enableOpacity) {
12783
12790
  this.setProperties({ 'value': cValue }, true);
@@ -12789,7 +12796,7 @@ let ColorPicker = class ColorPicker extends Component {
12789
12796
  }
12790
12797
  else {
12791
12798
  this.trigger('select', {
12792
- currentValue: { hex: hex, rgba: rgba },
12799
+ currentValue: { hex: hex, rgba: rgba }, event: e,
12793
12800
  previousValue: { hex: pValue.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(pValue)) }
12794
12801
  });
12795
12802
  }
@@ -15017,6 +15024,10 @@ class SignatureBase extends Component {
15017
15024
  this.lastWidth = newWidth;
15018
15025
  }
15019
15026
  endDraw() {
15027
+ if (isNullOrUndefined(this.pointColl)) {
15028
+ return;
15029
+ }
15030
+
15020
15031
  const canDrawCurve = this.pointColl.length > 2;
15021
15032
  const point = this.pointColl[0];
15022
15033
  if (!canDrawCurve && point) {
@@ -15286,7 +15297,7 @@ class SignatureBase extends Component {
15286
15297
  const args = { actionName: 'clear' };
15287
15298
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
15288
15299
  this.tempContext.clearRect(0, 0, this.tempContext.canvas.width, this.tempContext.canvas.height);
15289
- if (this.saveWithBackground) {
15300
+ if (this.saveWithBackground && this.backgroundImage) {
15290
15301
  this.setBackgroundImage(this.backgroundImage, 'temp');
15291
15302
  }
15292
15303
  this.internalRefresh();