@syncfusion/ej2-inputs 22.1.38 → 22.2.5

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 22.1.38
3
+ * version : 22.2.5
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-inputs@*",
3
- "_id": "@syncfusion/ej2-inputs@22.1.34",
3
+ "_id": "@syncfusion/ej2-inputs@22.1.39",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-o2Nopbha5lcyDmUtuPpvMXo9Vx4OM7aTsP1xjJxXEe1dWYxLW/2ipq7WVDzfHlJehKT9pvrYtQsUi086ZX/x7Q==",
5
+ "_integrity": "sha512-Ktw+lY6NdO0Nlc92tQ+HO2fDPo5Uz86+rE7w9tAyBBehxxwAx6xqnM342AEKfqNajEdd9ln3+GqSlwykBlpHbw==",
6
6
  "_location": "/@syncfusion/ej2-inputs",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -39,8 +39,8 @@
39
39
  "/@syncfusion/ej2-schedule",
40
40
  "/@syncfusion/ej2-vue-inputs"
41
41
  ],
42
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-inputs/-/ej2-inputs-22.1.34.tgz",
43
- "_shasum": "a573802b1b034c419475817445a6b8706263cfc9",
42
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-inputs/-/ej2-inputs-22.1.39.tgz",
43
+ "_shasum": "bc3c93fe2b2c1aff8d5a05f2ea96cbf62f9b052d",
44
44
  "_spec": "@syncfusion/ej2-inputs@*",
45
45
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
46
46
  "author": {
@@ -48,10 +48,10 @@
48
48
  },
49
49
  "bundleDependencies": false,
50
50
  "dependencies": {
51
- "@syncfusion/ej2-base": "~22.1.38",
52
- "@syncfusion/ej2-buttons": "~22.1.38",
53
- "@syncfusion/ej2-popups": "~22.1.38",
54
- "@syncfusion/ej2-splitbuttons": "~22.1.37"
51
+ "@syncfusion/ej2-base": "~22.2.5",
52
+ "@syncfusion/ej2-buttons": "~22.2.5",
53
+ "@syncfusion/ej2-popups": "~22.2.5",
54
+ "@syncfusion/ej2-splitbuttons": "~22.2.5"
55
55
  },
56
56
  "deprecated": false,
57
57
  "description": "A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.",
@@ -119,7 +119,7 @@
119
119
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/inputs"
120
120
  },
121
121
  "typings": "index.d.ts",
122
- "version": "22.1.38",
122
+ "version": "22.2.5",
123
123
  "sideEffects": false,
124
124
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
125
125
  }
@@ -176,10 +176,12 @@ export declare abstract class SignatureBase extends Component<HTMLCanvasElement>
176
176
  * @param {string} text - specify text to be drawn as signature.
177
177
  * @param {string} fontFamily - specify font family of a signature.
178
178
  * @param {number} fontSize - specify font size of a signature.
179
+ * @param {number} x- Specifies the x-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
180
+ * @param {number} y - Specifies the y-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
179
181
  *
180
182
  * @returns {void}.
181
183
  */
182
- draw(text: string, fontFamily?: string, fontSize?: number): void;
184
+ draw(text: string, fontFamily?: string, fontSize?: number, x?: number, y?: number): void;
183
185
  /**
184
186
  * To load the signature with the given base 64 string, height and width.
185
187
  *
@@ -650,18 +650,28 @@ var SignatureBase = /** @class */ (function (_super) {
650
650
  * @param {string} text - specify text to be drawn as signature.
651
651
  * @param {string} fontFamily - specify font family of a signature.
652
652
  * @param {number} fontSize - specify font size of a signature.
653
+ * @param {number} x- Specifies the x-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
654
+ * @param {number} y - Specifies the y-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
653
655
  *
654
656
  * @returns {void}.
655
657
  */
656
- SignatureBase.prototype.draw = function (text, fontFamily, fontSize) {
658
+ SignatureBase.prototype.draw = function (text, fontFamily, fontSize, x, y) {
657
659
  var args = { actionName: 'draw-text' };
658
660
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
659
661
  fontFamily = fontFamily || 'Arial';
660
662
  fontSize = fontSize || 30;
661
663
  this.canvasContext.font = fontSize + 'px ' + fontFamily;
662
- this.canvasContext.textAlign = 'center';
663
- this.canvasContext.textBaseline = 'middle';
664
- this.canvasContext.fillText(text, this.element.width / 2, this.element.height / 2);
664
+ var startX = this.element.width / 2;
665
+ var startY = this.element.height / 2;
666
+ if (isNullOrUndefined(x) && isNullOrUndefined(y)) {
667
+ this.canvasContext.textAlign = 'center';
668
+ this.canvasContext.textBaseline = 'middle';
669
+ }
670
+ else {
671
+ startX = isNullOrUndefined(x) ? startX : x;
672
+ startY = isNullOrUndefined(y) ? startY + fontSize / 2 : (y + fontSize / 2);
673
+ }
674
+ this.canvasContext.fillText(text, startX, startY);
665
675
  this.updateSnapCollection();
666
676
  this.isSignatureEmpty = false;
667
677
  this.trigger('change', args);
@@ -328,7 +328,7 @@ var Slider = /** @class */ (function (_super) {
328
328
  this.setCSSClass();
329
329
  };
330
330
  Slider.prototype.setElementWidth = function (width) {
331
- if (!isNullOrUndefined(width)) {
331
+ if (!isNullOrUndefined(width) && !isNullOrUndefined(this.sliderContainer)) {
332
332
  if (typeof width === 'number') {
333
333
  this.sliderContainer.style.width = formatUnit(width);
334
334
  }
@@ -891,10 +891,12 @@ var Slider = /** @class */ (function (_super) {
891
891
  this.tooltipElement.style.transform = this.getTooltipTransformProperties(this.previousTooltipClass).rotate;
892
892
  }
893
893
  if (this.type === 'Default') {
894
- setTimeout(function () { _this.tooltipElement.style.transition = _this.transition.handle; }, 2500);
894
+ setTimeout(function () { if (_this.tooltipElement)
895
+ _this.tooltipElement.style.transition = _this.transition.handle; }, 2500);
895
896
  }
896
897
  else {
897
- setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
898
+ setTimeout(function () { if (_this.tooltipElement)
899
+ _this.tooltipElement.style.transition = 'none'; }, 2500);
898
900
  }
899
901
  }
900
902
  };
@@ -913,7 +915,8 @@ var Slider = /** @class */ (function (_super) {
913
915
  this.tooltipElement.classList.remove(classNames.materialTooltipOpen);
914
916
  this.setTooltipTransform();
915
917
  this.tooltipTarget = undefined;
916
- setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
918
+ setTimeout(function () { if (_this.tooltipElement)
919
+ _this.tooltipElement.style.transition = 'none'; }, 2500);
917
920
  }
918
921
  };
919
922
  Slider.prototype.checkTooltipPosition = function (args) {
@@ -939,6 +942,8 @@ var Slider = /** @class */ (function (_super) {
939
942
  };
940
943
  Slider.prototype.setTooltipTransform = function () {
941
944
  var transformProperties = this.getTooltipTransformProperties(this.previousTooltipClass);
945
+ if (isNullOrUndefined(this.tooltipElement))
946
+ return;
942
947
  if (this.tooltipElement.firstElementChild.innerText.length > 4) {
943
948
  this.tooltipElement.style.transform = transformProperties.translate + " scale(0.01)";
944
949
  }
@@ -1483,7 +1488,7 @@ var Slider = /** @class */ (function (_super) {
1483
1488
  }
1484
1489
  };
1485
1490
  Slider.prototype.setRangeBar = function () {
1486
- if (this.orientation === 'Horizontal') {
1491
+ if (this.orientation === 'Horizontal' && !isNullOrUndefined(this.rangeBar)) {
1487
1492
  if (this.type === 'MinRange') {
1488
1493
  // eslint-disable-next-line
1489
1494
  this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
@@ -1496,7 +1501,7 @@ var Slider = /** @class */ (function (_super) {
1496
1501
  setStyleAttribute(this.rangeBar, { 'width': this.handlePos2 - this.handlePos1 + 'px' });
1497
1502
  }
1498
1503
  }
1499
- else {
1504
+ else if (!isNullOrUndefined(this.rangeBar)) {
1500
1505
  if (this.type === 'MinRange') {
1501
1506
  this.rangeBar.style.bottom = this.min > this.max ? this.handlePos1 + 'px' : '0px';
1502
1507
  setStyleAttribute(this.rangeBar, { 'height': isNullOrUndefined(this.handlePos1) ? 0 : this.min > this.max ? this.element.clientHeight - this.handlePos1 + 'px' : this.handlePos1 + 'px' });
@@ -1633,7 +1638,7 @@ var Slider = /** @class */ (function (_super) {
1633
1638
  this.setRangeValue();
1634
1639
  };
1635
1640
  Slider.prototype.modifyZindex = function () {
1636
- if (this.type === 'Range') {
1641
+ if (this.type === 'Range' && !isNullOrUndefined(this.firstHandle) && !isNullOrUndefined(this.secondHandle)) {
1637
1642
  if (this.activeHandle === 1) {
1638
1643
  this.firstHandle.style.zIndex = (this.zIndex + 4) + '';
1639
1644
  this.secondHandle.style.zIndex = (this.zIndex + 3) + '';
@@ -1818,11 +1823,12 @@ var Slider = /** @class */ (function (_super) {
1818
1823
  */
1819
1824
  Slider.prototype.reposition = function () {
1820
1825
  var _this = this;
1821
- this.firstHandle.style.transition = 'none';
1822
- if (this.type !== 'Default') {
1826
+ if (!isNullOrUndefined(this.firstHandle))
1827
+ this.firstHandle.style.transition = 'none';
1828
+ if (this.type !== 'Default' && !isNullOrUndefined(this.rangeBar)) {
1823
1829
  this.rangeBar.style.transition = 'none';
1824
1830
  }
1825
- if (this.type === 'Range') {
1831
+ if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle)) {
1826
1832
  this.secondHandle.style.transition = 'none';
1827
1833
  }
1828
1834
  this.handlePos1 = this.checkHandlePosition(this.handleVal1);
@@ -1833,17 +1839,17 @@ var Slider = /** @class */ (function (_super) {
1833
1839
  // eslint-disable-next-line
1834
1840
  this.enableRtl ? this.firstHandle.style.right =
1835
1841
  this.handlePos1 + "px" : this.firstHandle.style.left = this.handlePos1 + "px";
1836
- if (this.isMaterialTooltip) {
1842
+ if (this.isMaterialTooltip && !isNullOrUndefined(this.materialHandle)) {
1837
1843
  // eslint-disable-next-line
1838
1844
  this.enableRtl ? this.materialHandle.style.right =
1839
1845
  this.handlePos1 + "px" : this.materialHandle.style.left = this.handlePos1 + "px";
1840
1846
  }
1841
- if (this.type === 'MinRange') {
1847
+ if (this.type === 'MinRange' && !isNullOrUndefined(this.rangeBar)) {
1842
1848
  // eslint-disable-next-line
1843
1849
  this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
1844
1850
  setStyleAttribute(this.rangeBar, { 'width': isNullOrUndefined(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
1845
1851
  }
1846
- else if (this.type === 'Range') {
1852
+ else if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle) && !isNullOrUndefined(this.rangeBar)) {
1847
1853
  // eslint-disable-next-line
1848
1854
  this.enableRtl ? this.secondHandle.style.right =
1849
1855
  this.handlePos2 + "px" : this.secondHandle.style.left = this.handlePos2 + "px";
@@ -1879,8 +1885,9 @@ var Slider = /** @class */ (function (_super) {
1879
1885
  this.handleStart();
1880
1886
  if (!this.tooltip.isVisible) {
1881
1887
  setTimeout(function () {
1882
- _this.firstHandle.style.transition = _this.scaleTransform;
1883
- if (_this.type === 'Range') {
1888
+ if (!isNullOrUndefined(_this.firstHandle))
1889
+ _this.firstHandle.style.transition = _this.scaleTransform;
1890
+ if (_this.type === 'Range' && !isNullOrUndefined(_this.secondHandle)) {
1884
1891
  _this.secondHandle.style.transition = _this.scaleTransform;
1885
1892
  }
1886
1893
  });
@@ -2680,6 +2687,24 @@ var Slider = /** @class */ (function (_super) {
2680
2687
  this.tooltipObj.destroy();
2681
2688
  }
2682
2689
  this.element.innerHTML = '';
2690
+ this.hiddenInput = null;
2691
+ this.sliderContainer = null;
2692
+ this.sliderTrack = null;
2693
+ this.rangeBar = null;
2694
+ this.firstHandle = null;
2695
+ this.secondHandle = null;
2696
+ this.tickElementCollection = null;
2697
+ this.ul = null;
2698
+ this.firstBtn = null;
2699
+ this.secondBtn = null;
2700
+ this.materialHandle = null;
2701
+ this.tooltipObj = null;
2702
+ this.tooltipTarget = null;
2703
+ this.limitBarFirst = null;
2704
+ this.limitBarSecond = null;
2705
+ this.firstChild = null;
2706
+ this.lastChild = null;
2707
+ this.tooltipElement = null;
2683
2708
  };
2684
2709
  /**
2685
2710
  * Calls internally if any of the property value is changed.
@@ -2838,15 +2863,16 @@ var Slider = /** @class */ (function (_super) {
2838
2863
  };
2839
2864
  Slider.prototype.setZindex = function () {
2840
2865
  this.zIndex = 6;
2841
- if (!isNullOrUndefined(this.ticks) && this.ticks.placement !== 'None') {
2866
+ if (!isNullOrUndefined(this.ticks) && this.ticks.placement !== 'None' && !isNullOrUndefined(this.ul) && !isNullOrUndefined(this.element)) {
2842
2867
  this.ul.style.zIndex = (this.zIndex + -7) + '';
2843
2868
  this.element.style.zIndex = (this.zIndex + 2) + '';
2844
2869
  }
2845
2870
  if (!this.isMaterial && !this.isMaterial3 && !isNullOrUndefined(this.ticks) && this.ticks.placement === 'Both') {
2846
2871
  this.element.style.zIndex = (this.zIndex + 2) + '';
2847
2872
  }
2848
- this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
2849
- if (this.type === 'Range') {
2873
+ if (!isNullOrUndefined(this.firstHandle))
2874
+ this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
2875
+ if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle)) {
2850
2876
  this.secondHandle.style.zIndex = (this.zIndex + 4) + '';
2851
2877
  }
2852
2878
  };
@@ -1293,7 +1293,17 @@ var Uploader = /** @class */ (function (_super) {
1293
1293
  for (var i = 0; i < fileData.length; i++) {
1294
1294
  var sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
1295
1295
  var sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[parseInt(i.toString())].name);
1296
- if (sanitizeFileName !== fileData[parseInt(i.toString())].name) {
1296
+ var currentFileName = fileData[parseInt(i.toString())].name;
1297
+ var isUTF8 = false;
1298
+ for (var i_1 = 0; i_1 < currentFileName.length; i_1++) {
1299
+ if (currentFileName.charCodeAt(i_1) > 127) {
1300
+ isUTF8 = true;
1301
+ break;
1302
+ }
1303
+ }
1304
+ var htmlTagRegex = /<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i;
1305
+ var hasHTMLString = htmlTagRegex.test(currentFileName);
1306
+ if ((sanitizeFileName !== fileData[parseInt(i.toString())].name) && !(isUTF8 && !hasHTMLString)) {
1297
1307
  var encodedFileName = targetFiles[parseInt(i.toString())].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
1298
1308
  return '&#' + i.charCodeAt(0) + ';';
1299
1309
  });