@syncfusion/ej2-inputs 23.1.36 → 23.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.
- package/CHANGELOG.md +11 -0
- package/dist/ej2-inputs.min.js +3 -3
- package/dist/ej2-inputs.umd.min.js +3 -3
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +56 -36
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +56 -36
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +3 -3
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +8 -8
- package/src/common/signature-base.d.ts +3 -1
- package/src/common/signature-base.js +53 -34
- package/src/numerictextbox/numerictextbox.js +1 -1
- package/src/uploader/uploader.js +2 -1
|
@@ -1177,7 +1177,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1177
1177
|
attributes(this.element, { 'aria-readonly': 'true' });
|
|
1178
1178
|
}
|
|
1179
1179
|
this.hiddenInput = (this.createElement('input', { attrs: { type: 'text',
|
|
1180
|
-
'validateHidden': 'true', 'class': HIDDENELEMENT } }));
|
|
1180
|
+
'validateHidden': 'true', 'aria-label': 'hidden', 'class': HIDDENELEMENT } }));
|
|
1181
1181
|
this.inputName = this.inputName !== null ? this.inputName : this.element.id;
|
|
1182
1182
|
this.element.removeAttribute('name');
|
|
1183
1183
|
if (this.isAngular && this.angularTagName === 'EJS-NUMERICTEXTBOX' && this.cloneElement.id.length > 0) {
|
|
@@ -9149,7 +9149,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9149
9149
|
targetFiles = [].slice.call(args.target.files);
|
|
9150
9150
|
this.renderSelectedFiles(args, targetFiles);
|
|
9151
9151
|
}
|
|
9152
|
-
if (this.isAngular) {
|
|
9152
|
+
if (this.isAngular || this.isReact) {
|
|
9153
9153
|
args.stopPropagation();
|
|
9154
9154
|
}
|
|
9155
9155
|
};
|
|
@@ -9188,6 +9188,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9188
9188
|
var fileData = [];
|
|
9189
9189
|
if (!this.multiple) {
|
|
9190
9190
|
this.clearData(true);
|
|
9191
|
+
this.actionCompleteCount = 0;
|
|
9191
9192
|
targetFiles = [targetFiles[0]];
|
|
9192
9193
|
}
|
|
9193
9194
|
for (var i = 0; i < targetFiles.length; i++) {
|
|
@@ -14211,20 +14212,28 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14211
14212
|
}
|
|
14212
14213
|
};
|
|
14213
14214
|
SignatureBase.prototype.setHTMLProperties = function () {
|
|
14214
|
-
if (this.element.height === 150 && this.element.width === 300) {
|
|
14215
|
+
if (this.element.height === 150 && this.element.width === 300 && this.element.offsetHeight !== 0 && this.element.offsetWidth !== 0) {
|
|
14215
14216
|
this.element.height = this.element.offsetHeight;
|
|
14216
14217
|
this.element.width = this.element.offsetWidth;
|
|
14217
14218
|
this.isResponsive = true;
|
|
14218
14219
|
}
|
|
14219
|
-
else if (this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1)
|
|
14220
|
+
else if ((this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1)
|
|
14221
|
+
&& this.element.offsetHeight !== 0 && this.element.offsetWidth !== 0) {
|
|
14220
14222
|
this.element.height = this.element.offsetHeight;
|
|
14221
14223
|
this.element.width = this.element.offsetWidth;
|
|
14222
14224
|
}
|
|
14223
14225
|
this.canvasContext.scale(1, 1);
|
|
14224
14226
|
this.canvasContext.fillStyle = this.strokeColor;
|
|
14227
|
+
this.tempCanvas = this.createElement('canvas', { className: 'e-' + this.getModuleName() + '-temp' });
|
|
14228
|
+
this.tempContext = this.tempCanvas.getContext('2d');
|
|
14229
|
+
this.tempCanvas.width = this.element.width;
|
|
14230
|
+
this.tempCanvas.height = this.element.height;
|
|
14225
14231
|
if (this.backgroundImage) {
|
|
14226
14232
|
this.canvasContext.canvas.style.backgroundImage = 'url(' + this.backgroundImage + ')';
|
|
14227
14233
|
this.canvasContext.canvas.style.backgroundRepeat = 'no-repeat';
|
|
14234
|
+
if (this.saveWithBackground) {
|
|
14235
|
+
this.setBackgroundImage(this.backgroundImage, 'temp');
|
|
14236
|
+
}
|
|
14228
14237
|
}
|
|
14229
14238
|
else if (this.backgroundColor) {
|
|
14230
14239
|
this.canvasContext.canvas.style.backgroundColor = this.backgroundColor;
|
|
@@ -14331,7 +14340,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14331
14340
|
}
|
|
14332
14341
|
};
|
|
14333
14342
|
SignatureBase.prototype.beginStroke = function (e) {
|
|
14334
|
-
this.
|
|
14343
|
+
this.internalRefresh();
|
|
14335
14344
|
this.updateStroke(e);
|
|
14336
14345
|
};
|
|
14337
14346
|
SignatureBase.prototype.updateStroke = function (e) {
|
|
@@ -14582,19 +14591,27 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14582
14591
|
this.clearArray.push(this.incStep);
|
|
14583
14592
|
}
|
|
14584
14593
|
};
|
|
14585
|
-
SignatureBase.prototype.setBackgroundImage = function (imageSrc) {
|
|
14594
|
+
SignatureBase.prototype.setBackgroundImage = function (imageSrc, type) {
|
|
14586
14595
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
14587
14596
|
var proxy = this;
|
|
14588
14597
|
var imageObj = new Image();
|
|
14589
14598
|
imageObj.crossOrigin = 'anonymous';
|
|
14590
14599
|
imageObj.src = imageSrc;
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
}
|
|
14597
|
-
|
|
14600
|
+
if (type == 'temp') {
|
|
14601
|
+
imageObj.onload = function () {
|
|
14602
|
+
proxy.tempContext.globalCompositeOperation = 'source-over';
|
|
14603
|
+
proxy.tempContext.drawImage(imageObj, 0, 0, proxy.element.width, proxy.element.height);
|
|
14604
|
+
};
|
|
14605
|
+
}
|
|
14606
|
+
else {
|
|
14607
|
+
imageObj.onload = function () {
|
|
14608
|
+
proxy.canvasContext.globalCompositeOperation = 'source-over';
|
|
14609
|
+
proxy.canvasContext.drawImage(imageObj, 0, 0, proxy.element.width, proxy.element.height);
|
|
14610
|
+
proxy.updateSnapCollection();
|
|
14611
|
+
proxy.saveBackground(true);
|
|
14612
|
+
};
|
|
14613
|
+
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
14614
|
+
}
|
|
14598
14615
|
};
|
|
14599
14616
|
SignatureBase.prototype.setBackgroundColor = function (color) {
|
|
14600
14617
|
var canvasEle = this.canvasContext;
|
|
@@ -14650,16 +14667,21 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14650
14667
|
a.click();
|
|
14651
14668
|
a.parentNode.removeChild(a);
|
|
14652
14669
|
};
|
|
14670
|
+
SignatureBase.prototype.internalRefresh = function () {
|
|
14671
|
+
this.pointColl = [];
|
|
14672
|
+
this.lastVelocity = 0;
|
|
14673
|
+
this.lastWidth = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
|
|
14674
|
+
};
|
|
14653
14675
|
/**
|
|
14654
14676
|
* To refresh the signature.
|
|
14655
14677
|
*
|
|
14656
|
-
* @private
|
|
14657
14678
|
* @returns {void}.
|
|
14658
14679
|
*/
|
|
14659
14680
|
SignatureBase.prototype.refresh = function () {
|
|
14660
|
-
this.
|
|
14661
|
-
this.
|
|
14662
|
-
this.
|
|
14681
|
+
this.isResponsive = false;
|
|
14682
|
+
this.setHTMLProperties();
|
|
14683
|
+
this.resizeHandler();
|
|
14684
|
+
this.internalRefresh();
|
|
14663
14685
|
};
|
|
14664
14686
|
/**
|
|
14665
14687
|
* Erases all the signature strokes signed by user.
|
|
@@ -14669,7 +14691,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14669
14691
|
SignatureBase.prototype.clear = function () {
|
|
14670
14692
|
var args = { actionName: 'clear' };
|
|
14671
14693
|
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
14672
|
-
this.
|
|
14694
|
+
this.internalRefresh();
|
|
14673
14695
|
this.signRatioPointsColl = [];
|
|
14674
14696
|
this.updateSnapCollection(true);
|
|
14675
14697
|
this.isSignatureEmpty = true;
|
|
@@ -14944,8 +14966,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14944
14966
|
this.snapColl.pop();
|
|
14945
14967
|
this.incStep--;
|
|
14946
14968
|
};
|
|
14947
|
-
SignatureBase.prototype.toSVG = function (fileName) {
|
|
14948
|
-
var dataUrl = this.canvasContext.canvas.toDataURL();
|
|
14969
|
+
SignatureBase.prototype.toSVG = function (fileName, dataUrl) {
|
|
14949
14970
|
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
14950
14971
|
svg.setAttribute('width', this.canvasContext.canvas.width.toString());
|
|
14951
14972
|
svg.setAttribute('height', this.canvasContext.canvas.height.toString());
|
|
@@ -14986,27 +15007,23 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14986
15007
|
* @returns {string}.
|
|
14987
15008
|
*/
|
|
14988
15009
|
SignatureBase.prototype.getSignature = function (type) {
|
|
15010
|
+
if (this.saveWithBackground && this.backgroundColor && !this.backgroundImage) {
|
|
15011
|
+
this.tempContext.fillStyle = this.backgroundColor;
|
|
15012
|
+
this.tempContext.fillRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
15013
|
+
}
|
|
15014
|
+
else if (!this.backgroundColor && !this.backgroundImage && type === 'Jpeg') {
|
|
15015
|
+
this.tempContext.fillStyle = "#fff";
|
|
15016
|
+
this.tempContext.fillRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
15017
|
+
}
|
|
15018
|
+
this.tempContext.drawImage(this.element, 0, 0);
|
|
14989
15019
|
if (type === 'Jpeg') {
|
|
14990
|
-
|
|
14991
|
-
var data = imgData.data;
|
|
14992
|
-
for (var i = 0; i < data.length; i += 4) {
|
|
14993
|
-
if (data[i + 3] < 255) {
|
|
14994
|
-
data[i] = 255 - data[i];
|
|
14995
|
-
data[i + 1] = 255 - data[i + 1];
|
|
14996
|
-
data[i + 2] = 255 - data[i + 2];
|
|
14997
|
-
data[i + 3] = 255 - data[i + 3];
|
|
14998
|
-
}
|
|
14999
|
-
}
|
|
15000
|
-
this.canvasContext.putImageData(imgData, 0, 0);
|
|
15001
|
-
var dataURL = this.canvasContext.canvas.toDataURL('image/jpeg');
|
|
15002
|
-
this.resizeHandler();
|
|
15003
|
-
return dataURL;
|
|
15020
|
+
return this.tempCanvas.toDataURL('image/jpeg');
|
|
15004
15021
|
}
|
|
15005
15022
|
else if (type === 'Svg') {
|
|
15006
|
-
return this.toSVG(null);
|
|
15023
|
+
return this.toSVG(null, this.tempCanvas.toDataURL('image/png'));
|
|
15007
15024
|
}
|
|
15008
15025
|
else {
|
|
15009
|
-
return this.
|
|
15026
|
+
return this.tempCanvas.toDataURL('image/png');
|
|
15010
15027
|
}
|
|
15011
15028
|
};
|
|
15012
15029
|
/**
|
|
@@ -15061,6 +15078,9 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
15061
15078
|
case 'backgroundImage':
|
|
15062
15079
|
canvasNew.canvas.style.backgroundImage = 'url(' + value + ')';
|
|
15063
15080
|
this.backgroundImage = value;
|
|
15081
|
+
if (this.saveWithBackground) {
|
|
15082
|
+
this.setBackgroundImage(this.backgroundImage, 'temp');
|
|
15083
|
+
}
|
|
15064
15084
|
break;
|
|
15065
15085
|
case 'strokeColor':
|
|
15066
15086
|
canvasNew.fillStyle = value;
|