@syncfusion/ej2-inputs 20.4.51 → 20.4.54

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.
@@ -2910,7 +2910,7 @@ function removeMaskInputValues(event) {
2910
2910
  function maskInputKeyPressHandler(event) {
2911
2911
  if (this.mask && !this.readonly) {
2912
2912
  const oldValue = this.element.value;
2913
- if ((!event.ctrlKey) || (event.ctrlKey && event.code !== 'KeyA' && event.code !== 'KeyY'
2913
+ if (!(event.ctrlKey || event.metaKey) || ((event.ctrlKey || event.metaKey) && event.code !== 'KeyA' && event.code !== 'KeyY'
2914
2914
  && event.code !== 'KeyZ' && event.code !== 'KeyX' && event.code !== 'KeyC' && event.code !== 'KeyV')) {
2915
2915
  this.maskKeyPress = true;
2916
2916
  let key = event.key;
@@ -8527,7 +8527,6 @@ let Uploader = class Uploader extends Component {
8527
8527
  else if (!closest(args.target, '.' + SPINNER_PANE)) {
8528
8528
  this.remove(fileData, false, false, true, args);
8529
8529
  }
8530
- this.element.value = '';
8531
8530
  this.checkActionButtonStatus();
8532
8531
  }
8533
8532
  removeFilesData(file, customTemplate) {
@@ -8543,6 +8542,7 @@ let Uploader = class Uploader extends Component {
8543
8542
  if (isNullOrUndefined(selectedElement)) {
8544
8543
  return;
8545
8544
  }
8545
+ this.element.value = '';
8546
8546
  detach(selectedElement);
8547
8547
  index = this.fileList.indexOf(selectedElement);
8548
8548
  this.fileList.splice(index, 1);
@@ -9730,7 +9730,7 @@ let Uploader = class Uploader extends Component {
9730
9730
  for (let selectFileIndex = 0; selectFileIndex < selectedFiles.length; selectFileIndex++) {
9731
9731
  const selectedFileData = selectedFiles[selectFileIndex];
9732
9732
  for (let fileDataIndex = 0; fileDataIndex < this.filesData.length; fileDataIndex++) {
9733
- if (this.filesData[fileDataIndex].name === selectedFileData.name) {
9733
+ if (this.filesData[fileDataIndex].name === selectedFileData.name && this.filesData[fileDataIndex].status === selectedFileData.status) {
9734
9734
  matchFiles[matchFilesIndex] = this.filesData[fileDataIndex];
9735
9735
  ++matchFilesIndex;
9736
9736
  }
@@ -13632,7 +13632,8 @@ class SignatureBase extends Component {
13632
13632
  this.clearArray = [];
13633
13633
  this.isBlazor = false;
13634
13634
  this.isResponsive = false;
13635
- this.imageEditorPointsColl = [];
13635
+ this.signPointsColl = [];
13636
+ this.signRatioPointsColl = [];
13636
13637
  }
13637
13638
  /**
13638
13639
  * To Initialize the component rendering
@@ -13703,17 +13704,12 @@ class SignatureBase extends Component {
13703
13704
  }
13704
13705
  }
13705
13706
  // eslint-disable-next-line
13706
- mouseDownHandler(e, canvas, panStart, zoomState) {
13707
+ mouseDownHandler(e) {
13707
13708
  if (e.buttons === 1 || e.buttons === 2 || e.type === 'touchstart') {
13708
13709
  if (e.type === 'touchstart') {
13709
13710
  e.preventDefault();
13710
13711
  e.stopPropagation();
13711
13712
  }
13712
- if (canvas) {
13713
- this.canvasContext = canvas.getContext('2d');
13714
- this.scale = zoomState;
13715
- this.panStart = panStart;
13716
- }
13717
13713
  this.beginStroke(e);
13718
13714
  this.wireEvents();
13719
13715
  }
@@ -13748,6 +13744,11 @@ class SignatureBase extends Component {
13748
13744
  this.dotnetRef.invokeMethodAsync('TriggerEventAsync', 'mouseUp');
13749
13745
  }
13750
13746
  this.signatureValue = this.snapColl[this.incStep];
13747
+ for (let i = 0; i < this.signPointsColl.length; i++) {
13748
+ this.signRatioPointsColl.push({ x: (this.signPointsColl[i].x / this.canvasContext.canvas.width),
13749
+ y: (this.signPointsColl[i].y / this.canvasContext.canvas.height) });
13750
+ }
13751
+ this.signPointsColl = [];
13751
13752
  }
13752
13753
  keyboardHandler(e) {
13753
13754
  const args = { fileName: 'Signature', type: 'Png', cancel: false };
@@ -13784,13 +13785,23 @@ class SignatureBase extends Component {
13784
13785
  this.canvasContext.canvas.width = this.element.offsetWidth;
13785
13786
  this.canvasContext.canvas.height = this.element.offsetHeight;
13786
13787
  this.canvasContext.scale(1, 1);
13788
+ this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
13789
+ const pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
13790
+ for (let i = 0; i < this.signRatioPointsColl.length; i++) {
13791
+ this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
13792
+ }
13793
+ this.signPointsColl = [];
13794
+ this.canvasContext.closePath();
13795
+ this.canvasContext.fill();
13796
+ }
13797
+ else {
13798
+ const restoreImg = new Image();
13799
+ restoreImg.src = this.snapColl[this.incStep];
13800
+ restoreImg.onload = () => {
13801
+ proxy.canvasContext.clearRect(0, 0, proxy.element.width, proxy.element.height);
13802
+ proxy.canvasContext.drawImage(restoreImg, 0, 0, proxy.element.width, proxy.element.height);
13803
+ };
13787
13804
  }
13788
- const restoreImg = new Image();
13789
- restoreImg.src = this.snapColl[this.incStep];
13790
- restoreImg.onload = () => {
13791
- proxy.canvasContext.clearRect(0, 0, proxy.element.width, proxy.element.height);
13792
- proxy.canvasContext.drawImage(restoreImg, 0, 0, proxy.element.width, proxy.element.height);
13793
- };
13794
13805
  }
13795
13806
  beginStroke(e) {
13796
13807
  this.refresh();
@@ -13830,34 +13841,10 @@ class SignatureBase extends Component {
13830
13841
  createPoint(e) {
13831
13842
  const rect = this.canvasContext.canvas.getBoundingClientRect();
13832
13843
  if (e.type === 'mousedown' || e.type === 'mousemove') {
13833
- // signature
13834
- if (this.canvasRatio === undefined) {
13835
- return this.point(e.clientX - rect.left, e.clientY - rect.top, new Date().getTime());
13836
- }
13837
- // image editor
13838
- else if (this.scale === 1) {
13839
- return this.point(((e.clientX - rect.left) * this.canvasRatio.width) / this.scale, ((e.clientY - rect.top) * this.canvasRatio.height) / this.scale, new Date().getTime());
13840
- }
13841
- else {
13842
- return this.point((((e.clientX - rect.left) + ((this.panStart.startX) / this.canvasRatio.width
13843
- * this.scale)) / this.scale) * this.canvasRatio.width, (((e.clientY - rect.top) + ((this.panStart.startY) / this.canvasRatio.height
13844
- * this.scale)) / this.scale) * this.canvasRatio.height, new Date().getTime());
13845
- }
13844
+ return this.point(e.clientX - rect.left, e.clientY - rect.top, new Date().getTime());
13846
13845
  }
13847
13846
  else {
13848
- // signature
13849
- if (this.canvasRatio === undefined) {
13850
- return this.point(e.touches[0].clientX - rect.left, e.touches[0].clientY - rect.top, new Date().getTime());
13851
- }
13852
- // image editor
13853
- else if (this.scale === 1) {
13854
- return this.point(((e.touches[0].clientX - rect.left) * this.canvasRatio.width) / this.scale, ((e.touches[0].clientY - rect.top) * this.canvasRatio.height) / this.scale, new Date().getTime());
13855
- }
13856
- else {
13857
- return this.point((e.touches[0].clientX - rect.left) + this.panStart.startX / (this.canvasRatio.width
13858
- * this.scale), (e.touches[0].clientY - rect.top) + this.panStart.startY / (this.canvasRatio.height
13859
- * this.scale), new Date().getTime());
13860
- }
13847
+ return this.point(e.touches[0].clientX - rect.left, e.touches[0].clientY - rect.top, new Date().getTime());
13861
13848
  }
13862
13849
  }
13863
13850
  /* Returns the current point corrdinates(x, y) and time.*/
@@ -13875,7 +13862,6 @@ class SignatureBase extends Component {
13875
13862
  const isLastPointTooClose = lastPoint ? this.distanceTo(lastPoint) <= this.minDistance : false;
13876
13863
  if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
13877
13864
  points.push(point);
13878
- this.imageEditorPointsColl.push(point);
13879
13865
  if (points.length > 2) {
13880
13866
  if (points.length === 3) {
13881
13867
  points.unshift(points[0]);
@@ -13956,6 +13942,7 @@ class SignatureBase extends Component {
13956
13942
  this.isSignatureEmpty = false;
13957
13943
  }
13958
13944
  arcDraw(x, y, size) {
13945
+ this.signPointsColl.push({ x: x, y: y });
13959
13946
  const context = this.canvasContext;
13960
13947
  context.moveTo(x, y);
13961
13948
  context.arc(x, y, size, 0, 2 * Math.PI, false);
@@ -14156,6 +14143,7 @@ class SignatureBase extends Component {
14156
14143
  const args = { actionName: 'clear' };
14157
14144
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
14158
14145
  this.refresh();
14146
+ this.signRatioPointsColl = [];
14159
14147
  this.updateSnapCollection(true);
14160
14148
  this.isSignatureEmpty = true;
14161
14149
  if (!this.isBlazor) {