@syncfusion/ej2-inputs 20.4.48 → 20.4.52

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.
@@ -426,8 +426,8 @@ var Input;
426
426
  * @param {any} element - Input element which is need to add.
427
427
  * @param {HTMLElement} container - The parent element which is need to get the label span to calculate width
428
428
  */
429
- function calculateWidth(element, container) {
430
- var elementWidth = element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'));
429
+ function calculateWidth(element, container, moduleName) {
430
+ var elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'));
431
431
  if (!isNullOrUndefined(container.getElementsByClassName('e-float-text-content')[0])) {
432
432
  if (container.getElementsByClassName('e-float-text-content')[0].classList.contains('e-float-text-overflow')) {
433
433
  container.getElementsByClassName('e-float-text-content')[0].classList.remove('e-float-text-overflow');
@@ -2947,7 +2947,7 @@ function removeMaskInputValues(event) {
2947
2947
  function maskInputKeyPressHandler(event) {
2948
2948
  if (this.mask && !this.readonly) {
2949
2949
  var oldValue = this.element.value;
2950
- if ((!event.ctrlKey) || (event.ctrlKey && event.code !== 'KeyA' && event.code !== 'KeyY'
2950
+ if (!(event.ctrlKey || event.metaKey) || ((event.ctrlKey || event.metaKey) && event.code !== 'KeyA' && event.code !== 'KeyY'
2951
2951
  && event.code !== 'KeyZ' && event.code !== 'KeyX' && event.code !== 'KeyC' && event.code !== 'KeyV')) {
2952
2952
  this.maskKeyPress = true;
2953
2953
  var key = event.key;
@@ -8073,7 +8073,12 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8073
8073
  var inputElement = this.createElement('input', { attrs: { type: 'file' } });
8074
8074
  var index = 0;
8075
8075
  for (index; index < this.element.attributes.length; index++) {
8076
- inputElement.setAttribute(this.element.attributes[index].nodeName, this.element.attributes[index].nodeValue);
8076
+ if (this.element.attributes[index].nodeName !== 'id') {
8077
+ inputElement.setAttribute(this.element.attributes[index].nodeName, this.element.attributes[index].nodeValue);
8078
+ }
8079
+ else if (this.element.attributes[index].nodeName === 'id') {
8080
+ inputElement.setAttribute(this.element.attributes[index].nodeName, getUniqueID('uploader'));
8081
+ }
8077
8082
  inputElement.innerHTML = this.element.innerHTML;
8078
8083
  }
8079
8084
  if (!inputElement.hasAttribute('name')) {
@@ -9931,7 +9936,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
9931
9936
  for (var selectFileIndex = 0; selectFileIndex < selectedFiles.length; selectFileIndex++) {
9932
9937
  var selectedFileData = selectedFiles[selectFileIndex];
9933
9938
  for (var fileDataIndex = 0; fileDataIndex < this.filesData.length; fileDataIndex++) {
9934
- if (this.filesData[fileDataIndex].name === selectedFileData.name) {
9939
+ if (this.filesData[fileDataIndex].name === selectedFileData.name && this.filesData[fileDataIndex].status === selectedFileData.status) {
9935
9940
  matchFiles[matchFilesIndex] = this.filesData[fileDataIndex];
9936
9941
  ++matchFilesIndex;
9937
9942
  }
@@ -13921,7 +13926,8 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
13921
13926
  _this.clearArray = [];
13922
13927
  _this.isBlazor = false;
13923
13928
  _this.isResponsive = false;
13924
- _this.imageEditorPointsColl = [];
13929
+ _this.signPointsColl = [];
13930
+ _this.signRatioPointsColl = [];
13925
13931
  return _this;
13926
13932
  }
13927
13933
  /**
@@ -13993,17 +13999,12 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
13993
13999
  }
13994
14000
  };
13995
14001
  // eslint-disable-next-line
13996
- SignatureBase.prototype.mouseDownHandler = function (e, canvas, panStart, zoomState) {
14002
+ SignatureBase.prototype.mouseDownHandler = function (e) {
13997
14003
  if (e.buttons === 1 || e.buttons === 2 || e.type === 'touchstart') {
13998
14004
  if (e.type === 'touchstart') {
13999
14005
  e.preventDefault();
14000
14006
  e.stopPropagation();
14001
14007
  }
14002
- if (canvas) {
14003
- this.canvasContext = canvas.getContext('2d');
14004
- this.scale = zoomState;
14005
- this.panStart = panStart;
14006
- }
14007
14008
  this.beginStroke(e);
14008
14009
  this.wireEvents();
14009
14010
  }
@@ -14038,6 +14039,11 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14038
14039
  this.dotnetRef.invokeMethodAsync('TriggerEventAsync', 'mouseUp');
14039
14040
  }
14040
14041
  this.signatureValue = this.snapColl[this.incStep];
14042
+ for (var i = 0; i < this.signPointsColl.length; i++) {
14043
+ this.signRatioPointsColl.push({ x: (this.signPointsColl[i].x / this.canvasContext.canvas.width),
14044
+ y: (this.signPointsColl[i].y / this.canvasContext.canvas.height) });
14045
+ }
14046
+ this.signPointsColl = [];
14041
14047
  };
14042
14048
  SignatureBase.prototype.keyboardHandler = function (e) {
14043
14049
  var _this = this;
@@ -14075,13 +14081,23 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14075
14081
  this.canvasContext.canvas.width = this.element.offsetWidth;
14076
14082
  this.canvasContext.canvas.height = this.element.offsetHeight;
14077
14083
  this.canvasContext.scale(1, 1);
14084
+ this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
14085
+ var pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
14086
+ for (var i = 0; i < this.signRatioPointsColl.length; i++) {
14087
+ this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
14088
+ }
14089
+ this.signPointsColl = [];
14090
+ this.canvasContext.closePath();
14091
+ this.canvasContext.fill();
14092
+ }
14093
+ else {
14094
+ var restoreImg_1 = new Image();
14095
+ restoreImg_1.src = this.snapColl[this.incStep];
14096
+ restoreImg_1.onload = function () {
14097
+ proxy.canvasContext.clearRect(0, 0, proxy.element.width, proxy.element.height);
14098
+ proxy.canvasContext.drawImage(restoreImg_1, 0, 0, proxy.element.width, proxy.element.height);
14099
+ };
14078
14100
  }
14079
- var restoreImg = new Image();
14080
- restoreImg.src = this.snapColl[this.incStep];
14081
- restoreImg.onload = function () {
14082
- proxy.canvasContext.clearRect(0, 0, proxy.element.width, proxy.element.height);
14083
- proxy.canvasContext.drawImage(restoreImg, 0, 0, proxy.element.width, proxy.element.height);
14084
- };
14085
14101
  };
14086
14102
  SignatureBase.prototype.beginStroke = function (e) {
14087
14103
  this.refresh();
@@ -14121,34 +14137,10 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14121
14137
  SignatureBase.prototype.createPoint = function (e) {
14122
14138
  var rect = this.canvasContext.canvas.getBoundingClientRect();
14123
14139
  if (e.type === 'mousedown' || e.type === 'mousemove') {
14124
- // signature
14125
- if (this.canvasRatio === undefined) {
14126
- return this.point(e.clientX - rect.left, e.clientY - rect.top, new Date().getTime());
14127
- }
14128
- // image editor
14129
- else if (this.scale === 1) {
14130
- return this.point(((e.clientX - rect.left) * this.canvasRatio.width) / this.scale, ((e.clientY - rect.top) * this.canvasRatio.height) / this.scale, new Date().getTime());
14131
- }
14132
- else {
14133
- return this.point((((e.clientX - rect.left) + ((this.panStart.startX) / this.canvasRatio.width
14134
- * this.scale)) / this.scale) * this.canvasRatio.width, (((e.clientY - rect.top) + ((this.panStart.startY) / this.canvasRatio.height
14135
- * this.scale)) / this.scale) * this.canvasRatio.height, new Date().getTime());
14136
- }
14140
+ return this.point(e.clientX - rect.left, e.clientY - rect.top, new Date().getTime());
14137
14141
  }
14138
14142
  else {
14139
- // signature
14140
- if (this.canvasRatio === undefined) {
14141
- return this.point(e.touches[0].clientX - rect.left, e.touches[0].clientY - rect.top, new Date().getTime());
14142
- }
14143
- // image editor
14144
- else if (this.scale === 1) {
14145
- 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());
14146
- }
14147
- else {
14148
- return this.point((e.touches[0].clientX - rect.left) + this.panStart.startX / (this.canvasRatio.width
14149
- * this.scale), (e.touches[0].clientY - rect.top) + this.panStart.startY / (this.canvasRatio.height
14150
- * this.scale), new Date().getTime());
14151
- }
14143
+ return this.point(e.touches[0].clientX - rect.left, e.touches[0].clientY - rect.top, new Date().getTime());
14152
14144
  }
14153
14145
  };
14154
14146
  /* Returns the current point corrdinates(x, y) and time.*/
@@ -14166,7 +14158,6 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14166
14158
  var isLastPointTooClose = lastPoint ? this.distanceTo(lastPoint) <= this.minDistance : false;
14167
14159
  if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
14168
14160
  points.push(point);
14169
- this.imageEditorPointsColl.push(point);
14170
14161
  if (points.length > 2) {
14171
14162
  if (points.length === 3) {
14172
14163
  points.unshift(points[0]);
@@ -14247,6 +14238,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14247
14238
  this.isSignatureEmpty = false;
14248
14239
  };
14249
14240
  SignatureBase.prototype.arcDraw = function (x, y, size) {
14241
+ this.signPointsColl.push({ x: x, y: y });
14250
14242
  var context = this.canvasContext;
14251
14243
  context.moveTo(x, y);
14252
14244
  context.arc(x, y, size, 0, 2 * Math.PI, false);
@@ -14447,6 +14439,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14447
14439
  var args = { actionName: 'clear' };
14448
14440
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
14449
14441
  this.refresh();
14442
+ this.signRatioPointsColl = [];
14450
14443
  this.updateSnapCollection(true);
14451
14444
  this.isSignatureEmpty = true;
14452
14445
  if (!this.isBlazor) {