@syncfusion/ej2-inputs 20.4.54 → 21.1.37
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 +3 -30
- package/README.md +196 -119
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +174 -120
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +168 -114
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/color-picker/color-picker.d.ts +6 -1
- package/src/color-picker/color-picker.js +21 -4
- package/src/common/signature-base.js +6 -3
- package/src/form-validator/form-validator.js +23 -21
- package/src/input/input.js +10 -10
- package/src/maskedtextbox/base/mask-base.js +5 -5
- package/src/maskedtextbox/maskedtextbox/maskedtextbox.js +3 -3
- package/src/numerictextbox/numerictextbox.js +4 -4
- package/src/rating/rating-model.d.ts +33 -11
- package/src/rating/rating.d.ts +25 -1
- package/src/rating/rating.js +65 -45
- package/src/slider/slider-model.d.ts +41 -6
- package/src/slider/slider.d.ts +113 -8
- package/src/slider/slider.js +14 -4
- package/src/textbox/textbox.js +4 -2
- package/src/uploader/uploader-model.d.ts +1 -1
- package/src/uploader/uploader.js +13 -13
- package/styles/bootstrap-dark.css +14 -0
- package/styles/bootstrap.css +14 -0
- package/styles/bootstrap4.css +14 -0
- package/styles/bootstrap5-dark.css +18 -4
- package/styles/bootstrap5.css +18 -4
- package/styles/color-picker/_layout.scss +78 -6
- package/styles/color-picker/_theme.scss +3 -0
- package/styles/color-picker/bootstrap-dark.css +6 -0
- package/styles/color-picker/bootstrap.css +6 -0
- package/styles/color-picker/bootstrap4.css +6 -0
- package/styles/color-picker/bootstrap5-dark.css +6 -0
- package/styles/color-picker/bootstrap5.css +6 -0
- package/styles/color-picker/fabric-dark.css +6 -0
- package/styles/color-picker/fabric.css +6 -0
- package/styles/color-picker/fluent-dark.css +6 -0
- package/styles/color-picker/fluent.css +6 -0
- package/styles/color-picker/highcontrast-light.css +6 -0
- package/styles/color-picker/highcontrast.css +6 -0
- package/styles/color-picker/material-dark.css +6 -0
- package/styles/color-picker/material.css +6 -0
- package/styles/color-picker/tailwind-dark.css +6 -0
- package/styles/color-picker/tailwind.css +6 -0
- package/styles/fabric-dark.css +14 -0
- package/styles/fabric.css +14 -0
- package/styles/fluent-dark.css +14 -0
- package/styles/fluent.css +14 -0
- package/styles/highcontrast-light.css +14 -0
- package/styles/highcontrast.css +14 -0
- package/styles/input/_bootstrap5-definition.scss +2 -2
- package/styles/input/_fluent-definition.scss +5 -5
- package/styles/input/_layout.scss +445 -445
- package/styles/input/_tailwind-definition.scss +14 -14
- package/styles/input/_theme.scss +218 -199
- package/styles/input/material-dark.css +1 -1
- package/styles/input/material.css +1 -1
- package/styles/maskedtextbox/_bootstrap5-definition.scss +2 -2
- package/styles/maskedtextbox/_fluent-definition.scss +2 -2
- package/styles/material-dark.css +15 -5
- package/styles/material.css +15 -1
- package/styles/numerictextbox/icons/_material3.scss +3 -3
- package/styles/rating/_bootstrap-dark-definition.scss +4 -3
- package/styles/rating/_bootstrap-definition.scss +4 -3
- package/styles/rating/_bootstrap4-definition.scss +4 -3
- package/styles/rating/_bootstrap5-definition.scss +16 -15
- package/styles/rating/_fabric-dark-definition.scss +4 -3
- package/styles/rating/_fabric-definition.scss +4 -3
- package/styles/rating/_fluent-definition.scss +16 -15
- package/styles/rating/_fusionnew-definition.scss +4 -3
- package/styles/rating/_highcontrast-definition.scss +4 -3
- package/styles/rating/_highcontrast-light-definition.scss +4 -3
- package/styles/rating/_layout.scss +8 -0
- package/styles/rating/_material-dark-definition.scss +4 -3
- package/styles/rating/_material-definition.scss +4 -3
- package/styles/rating/_tailwind-definition.scss +16 -15
- package/styles/rating/_theme.scss +14 -2
- package/styles/rating/bootstrap-dark.css +8 -0
- package/styles/rating/bootstrap.css +8 -0
- package/styles/rating/bootstrap4.css +8 -0
- package/styles/rating/bootstrap5-dark.css +8 -0
- package/styles/rating/bootstrap5.css +8 -0
- package/styles/rating/fabric-dark.css +8 -0
- package/styles/rating/fabric.css +8 -0
- package/styles/rating/fluent-dark.css +8 -0
- package/styles/rating/fluent.css +8 -0
- package/styles/rating/highcontrast-light.css +8 -0
- package/styles/rating/highcontrast.css +8 -0
- package/styles/rating/material-dark.css +8 -0
- package/styles/rating/material.css +8 -0
- package/styles/rating/tailwind-dark.css +9 -1
- package/styles/rating/tailwind.css +9 -1
- package/styles/slider/_layout.scss +44 -25
- package/styles/slider/_theme.scss +6 -1
- package/styles/tailwind-dark.css +16 -2
- package/styles/tailwind.css +16 -2
- package/styles/uploader/_bootstrap5-definition.scss +12 -12
- package/styles/uploader/_fluent-definition.scss +10 -10
- package/styles/uploader/_layout.scss +7 -2
- package/styles/uploader/_tailwind-definition.scss +10 -10
- package/styles/uploader/_theme.scss +13 -3
- package/styles/uploader/bootstrap5-dark.css +4 -4
- package/styles/uploader/bootstrap5.css +4 -4
- package/styles/uploader/material-dark.css +0 -4
- package/styles/uploader/tailwind-dark.css +1 -1
- package/styles/uploader/tailwind.css +1 -1
- package/styles/color-picker/_material3-definition.scss +0 -133
- package/styles/input/_material3-definition.scss +0 -336
- package/styles/maskedtextbox/_material3-definition.scss +0 -7
- package/styles/numerictextbox/_material3-definition.scss +0 -3
- package/styles/rating/_material3-definition.scss +0 -46
- package/styles/signature/_material3-definition.scss +0 -3
- package/styles/slider/_material3-definition.scss +0 -90
- package/styles/textbox/_material3-definition.scss +0 -1
- package/styles/uploader/_material3-definition.scss +0 -216
|
@@ -298,7 +298,7 @@ var Input;
|
|
|
298
298
|
}
|
|
299
299
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
300
300
|
function wireClearBtnEvents(element, button, container) {
|
|
301
|
-
if (isBindClearAction
|
|
301
|
+
if (isBindClearAction === undefined || isBindClearAction) {
|
|
302
302
|
button.addEventListener('click', function (event) {
|
|
303
303
|
if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
|
|
304
304
|
event.preventDefault();
|
|
@@ -427,7 +427,7 @@ var Input;
|
|
|
427
427
|
* @param {HTMLElement} container - The parent element which is need to get the label span to calculate width
|
|
428
428
|
*/
|
|
429
429
|
function calculateWidth(element, container, moduleName) {
|
|
430
|
-
var elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'));
|
|
430
|
+
var elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'), 10);
|
|
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');
|
|
@@ -629,10 +629,10 @@ var Input;
|
|
|
629
629
|
parentElement.classList.add(CLASSNAMES.DISABLE);
|
|
630
630
|
}
|
|
631
631
|
if (key === 'placeholder' && parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
|
|
632
|
-
parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[key];
|
|
632
|
+
parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs["" + key];
|
|
633
633
|
}
|
|
634
634
|
else {
|
|
635
|
-
element.setAttribute(key, attrs[key]);
|
|
635
|
+
element.setAttribute(key, attrs["" + key]);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
}
|
|
@@ -734,7 +734,7 @@ var Input;
|
|
|
734
734
|
*/
|
|
735
735
|
function setRipple(isRipple, inputObj) {
|
|
736
736
|
for (var i = 0; i < inputObj.length; i++) {
|
|
737
|
-
_internalRipple(isRipple, inputObj[i].container);
|
|
737
|
+
_internalRipple(isRipple, inputObj[parseInt(i.toString())].container);
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
Input.setRipple = setRipple;
|
|
@@ -745,14 +745,14 @@ var Input;
|
|
|
745
745
|
container.querySelectorAll('.e-input-group-icon') : argsButton;
|
|
746
746
|
if (isRipple && buttons.length > 0) {
|
|
747
747
|
for (var index = 0; index < buttons.length; index++) {
|
|
748
|
-
buttons[index].addEventListener('mousedown', _onMouseDownRipple, false);
|
|
749
|
-
buttons[index].addEventListener('mouseup', _onMouseUpRipple, false);
|
|
748
|
+
buttons[parseInt(index.toString())].addEventListener('mousedown', _onMouseDownRipple, false);
|
|
749
|
+
buttons[parseInt(index.toString())].addEventListener('mouseup', _onMouseUpRipple, false);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
else if (buttons.length > 0) {
|
|
753
753
|
for (var index = 0; index < buttons.length; index++) {
|
|
754
|
-
buttons[index].removeEventListener('mousedown', _onMouseDownRipple, this);
|
|
755
|
-
buttons[index].removeEventListener('mouseup', _onMouseUpRipple, this);
|
|
754
|
+
buttons[parseInt(index.toString())].removeEventListener('mousedown', _onMouseDownRipple, this);
|
|
755
|
+
buttons[parseInt(index.toString())].removeEventListener('mouseup', _onMouseUpRipple, this);
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
}
|
|
@@ -840,7 +840,7 @@ var Input;
|
|
|
840
840
|
var result = container.querySelectorAll(inputElement.tagName + ' ~ *');
|
|
841
841
|
innerWrapper.appendChild(inputElement);
|
|
842
842
|
for (var i = 0; i < result.length; i++) {
|
|
843
|
-
innerWrapper.appendChild(result[i]);
|
|
843
|
+
innerWrapper.appendChild(result[parseInt(i.toString())]);
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
innerWrapper.parentNode.insertBefore(button, innerWrapper);
|
|
@@ -1043,7 +1043,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1043
1043
|
if (this.element.hasAttribute('data-val')) {
|
|
1044
1044
|
this.element.setAttribute('data-val', 'false');
|
|
1045
1045
|
}
|
|
1046
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
1046
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
1047
1047
|
this.enabled = false;
|
|
1048
1048
|
}
|
|
1049
1049
|
this.renderComplete();
|
|
@@ -1737,7 +1737,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
var currentChar = String.fromCharCode(event.which);
|
|
1739
1739
|
var decimalSeparator = getValue('decimal', getNumericObject(this.locale));
|
|
1740
|
-
var isAlterNumPadDecimalChar = event.code ===
|
|
1740
|
+
var isAlterNumPadDecimalChar = event.code === 'NumpadDecimal' && currentChar !== decimalSeparator;
|
|
1741
1741
|
//EJ2-59813-replace the culture decimal separator value with numberpad decimal separator value when culture decimal separator and numberpad decimal separator are different
|
|
1742
1742
|
if (isAlterNumPadDecimalChar) {
|
|
1743
1743
|
currentChar = decimalSeparator;
|
|
@@ -1774,7 +1774,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1774
1774
|
if (this.decimals && this.validateDecimalOnType) {
|
|
1775
1775
|
fractionRule = '{0,' + this.decimals + '}';
|
|
1776
1776
|
}
|
|
1777
|
-
|
|
1777
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
1778
1778
|
return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
|
|
1779
1779
|
')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
|
|
1780
1780
|
};
|
|
@@ -1887,7 +1887,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1887
1887
|
};
|
|
1888
1888
|
NumericTextBox.prototype.touchMoveOnSpinner = function (event) {
|
|
1889
1889
|
var target;
|
|
1890
|
-
if (event.type ===
|
|
1890
|
+
if (event.type === 'touchmove') {
|
|
1891
1891
|
var touchEvent = event.touches;
|
|
1892
1892
|
target = touchEvent.length && document.elementFromPoint(touchEvent[0].pageX, touchEvent[0].pageY);
|
|
1893
1893
|
}
|
|
@@ -2352,7 +2352,7 @@ function createMask() {
|
|
|
2352
2352
|
if (!isNullOrUndefined(this.customCharacters)) {
|
|
2353
2353
|
for (var i = 0; i < this.promptMask.length; i++) {
|
|
2354
2354
|
if (!isNullOrUndefined(this.customCharacters[this.promptMask[i]])) {
|
|
2355
|
-
|
|
2355
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
2356
2356
|
this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
@@ -2652,7 +2652,7 @@ function maskInputBlurHandler(event) {
|
|
|
2652
2652
|
event: event,
|
|
2653
2653
|
value: this.value,
|
|
2654
2654
|
maskedValue: this.element.value,
|
|
2655
|
-
container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
|
|
2655
|
+
container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
|
|
2656
2656
|
};
|
|
2657
2657
|
this.trigger('blur', this.blurEventArgs);
|
|
2658
2658
|
if (this.mask) {
|
|
@@ -3115,13 +3115,13 @@ function validateValue(key, isCtrlKey, event) {
|
|
|
3115
3115
|
var customValStr = this.customCharacters["" + curMask];
|
|
3116
3116
|
var customValArr = customValStr.split(',');
|
|
3117
3117
|
for (var i = 0; i < customValArr.length; i++) {
|
|
3118
|
-
|
|
3118
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3119
3119
|
if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
|
|
3120
3120
|
allowText = true;
|
|
3121
3121
|
break;
|
|
3122
3122
|
}
|
|
3123
3123
|
}
|
|
3124
|
-
|
|
3124
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3125
3125
|
}
|
|
3126
3126
|
else if (!isNullOrUndefined(this.regExpCollec["" + curMask]) && keyValue.match(new RegExp(this.regExpCollec["" + curMask]))
|
|
3127
3127
|
&& this.promptMask[startIndex] === this.promptChar) {
|
|
@@ -3129,7 +3129,7 @@ function validateValue(key, isCtrlKey, event) {
|
|
|
3129
3129
|
}
|
|
3130
3130
|
else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
|
|
3131
3131
|
&& this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
|
|
3132
|
-
|
|
3132
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3133
3133
|
&& keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
|
|
3134
3134
|
allowText = true;
|
|
3135
3135
|
}
|
|
@@ -3804,13 +3804,13 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
3804
3804
|
else {
|
|
3805
3805
|
this.promptChar = '_';
|
|
3806
3806
|
}
|
|
3807
|
-
|
|
3807
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3808
3808
|
var value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3809
3809
|
if (this.promptMask === this.element.value) {
|
|
3810
|
-
|
|
3810
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3811
3811
|
value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3812
3812
|
}
|
|
3813
|
-
|
|
3813
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3814
3814
|
this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3815
3815
|
this.undoCollec = this.redoCollec = [];
|
|
3816
3816
|
setElementValue.call(this, value);
|
|
@@ -4251,6 +4251,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
4251
4251
|
};
|
|
4252
4252
|
/**
|
|
4253
4253
|
* To Initialize the control rendering
|
|
4254
|
+
*
|
|
4254
4255
|
* @private
|
|
4255
4256
|
*/
|
|
4256
4257
|
Slider.prototype.render = function () {
|
|
@@ -4261,7 +4262,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
4261
4262
|
this.setZindex();
|
|
4262
4263
|
this.renderComplete();
|
|
4263
4264
|
if (this.element.tagName === 'EJS-SLIDER') {
|
|
4264
|
-
if (this.getTheme(this.sliderContainer) ==
|
|
4265
|
+
if (this.getTheme(this.sliderContainer) == 'none') {
|
|
4265
4266
|
setTimeout(function () {
|
|
4266
4267
|
_this.refresh();
|
|
4267
4268
|
}, 0);
|
|
@@ -4312,6 +4313,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
4312
4313
|
};
|
|
4313
4314
|
/**
|
|
4314
4315
|
* Initialize the rendering
|
|
4316
|
+
*
|
|
4315
4317
|
* @private
|
|
4316
4318
|
*/
|
|
4317
4319
|
Slider.prototype.initRender = function () {
|
|
@@ -4908,7 +4910,6 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
4908
4910
|
this.sliderContainer.classList.add(classNames.materialSlider);
|
|
4909
4911
|
this.tooltipValue();
|
|
4910
4912
|
this.tooltipObj.animation.close.effect = 'None';
|
|
4911
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
|
|
4912
4913
|
this.tooltipObj.open(this.firstHandle);
|
|
4913
4914
|
}
|
|
4914
4915
|
};
|
|
@@ -5736,6 +5737,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
5736
5737
|
};
|
|
5737
5738
|
/**
|
|
5738
5739
|
* It is used to reposition slider.
|
|
5740
|
+
*
|
|
5739
5741
|
* @returns void
|
|
5740
5742
|
*/
|
|
5741
5743
|
Slider.prototype.reposition = function () {
|
|
@@ -5986,7 +5988,12 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
5986
5988
|
focusedElement.classList.remove(classNames.sliderTabHandle);
|
|
5987
5989
|
}
|
|
5988
5990
|
var handle = this.activeHandle === 1 ? this.firstHandle : this.secondHandle;
|
|
5989
|
-
|
|
5991
|
+
var behindElement;
|
|
5992
|
+
if ((evt.type === 'click' || evt.type === 'mousedown') && evt.target === handle) {
|
|
5993
|
+
var eventX = evt.clientX, eventY = evt.clientY;
|
|
5994
|
+
behindElement = document.elementFromPoint(eventX, eventY);
|
|
5995
|
+
}
|
|
5996
|
+
if (evt.target === handle && behindElement != handle) {
|
|
5990
5997
|
if (this.isMaterial && !this.tooltip.isVisible &&
|
|
5991
5998
|
!this.getHandle().classList.contains(classNames.sliderTabHandle)) {
|
|
5992
5999
|
this.materialChange();
|
|
@@ -6237,7 +6244,6 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6237
6244
|
Slider.prototype.openTooltip = function (target) {
|
|
6238
6245
|
if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
|
|
6239
6246
|
this.tooltipValue();
|
|
6240
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
|
|
6241
6247
|
this.tooltipObj.open(target);
|
|
6242
6248
|
this.tooltipTarget = target;
|
|
6243
6249
|
}
|
|
@@ -6557,6 +6563,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6557
6563
|
};
|
|
6558
6564
|
/**
|
|
6559
6565
|
* Get the properties to be maintained in the persisted state.
|
|
6566
|
+
*
|
|
6560
6567
|
* @private
|
|
6561
6568
|
*/
|
|
6562
6569
|
Slider.prototype.getPersistData = function () {
|
|
@@ -6566,6 +6573,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6566
6573
|
/**
|
|
6567
6574
|
* Removes the component from the DOM and detaches all its related event handlers.
|
|
6568
6575
|
* Also it removes the attributes and classes.
|
|
6576
|
+
*
|
|
6569
6577
|
* @method destroy
|
|
6570
6578
|
* @return {void}
|
|
6571
6579
|
*/
|
|
@@ -6587,6 +6595,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6587
6595
|
};
|
|
6588
6596
|
/**
|
|
6589
6597
|
* Calls internally if any of the property value is changed.
|
|
6598
|
+
*
|
|
6590
6599
|
* @private
|
|
6591
6600
|
*/
|
|
6592
6601
|
// tslint:disable-next-line
|
|
@@ -6805,6 +6814,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6805
6814
|
};
|
|
6806
6815
|
/**
|
|
6807
6816
|
* Gets the component name
|
|
6817
|
+
*
|
|
6808
6818
|
* @private
|
|
6809
6819
|
*/
|
|
6810
6820
|
Slider.prototype.getModuleName = function () {
|
|
@@ -6919,6 +6929,7 @@ var regex = {
|
|
|
6919
6929
|
/* eslint-disable no-useless-escape */
|
|
6920
6930
|
EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +
|
|
6921
6931
|
'|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),
|
|
6932
|
+
/* eslint-disable-next-line security/detect-unsafe-regex */
|
|
6922
6933
|
URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,
|
|
6923
6934
|
DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),
|
|
6924
6935
|
DIGITS: new RegExp('^[0-9]*$'),
|
|
@@ -7036,10 +7047,10 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7036
7047
|
if (name) {
|
|
7037
7048
|
// eslint-disable-next-line no-prototype-builtins
|
|
7038
7049
|
if (this.rules.hasOwnProperty(name)) {
|
|
7039
|
-
extend(this.rules[name], rules, {});
|
|
7050
|
+
extend(this.rules["" + name], rules, {});
|
|
7040
7051
|
}
|
|
7041
7052
|
else {
|
|
7042
|
-
this.rules[name] = rules;
|
|
7053
|
+
this.rules["" + name] = rules;
|
|
7043
7054
|
}
|
|
7044
7055
|
}
|
|
7045
7056
|
};
|
|
@@ -7055,12 +7066,12 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7055
7066
|
if (!name && !rules) {
|
|
7056
7067
|
this.rules = {};
|
|
7057
7068
|
}
|
|
7058
|
-
else if (this.rules[name] && !rules) {
|
|
7059
|
-
delete this.rules[name];
|
|
7069
|
+
else if (this.rules["" + name] && !rules) {
|
|
7070
|
+
delete this.rules["" + name];
|
|
7060
7071
|
}
|
|
7061
|
-
else if (!isNullOrUndefined(this.rules[name] && rules)) {
|
|
7072
|
+
else if (!isNullOrUndefined(this.rules["" + name] && rules)) {
|
|
7062
7073
|
for (var i = 0; i < rules.length; i++) {
|
|
7063
|
-
delete this.rules[name][rules[i]];
|
|
7074
|
+
delete this.rules["" + name][rules[parseInt(i.toString())]];
|
|
7064
7075
|
}
|
|
7065
7076
|
}
|
|
7066
7077
|
else {
|
|
@@ -7158,7 +7169,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7158
7169
|
var key = _a[_i];
|
|
7159
7170
|
this.l10n.setLocale(this.locale);
|
|
7160
7171
|
var value = this.l10n.getConstant(key);
|
|
7161
|
-
this.localyMessage[key] = value;
|
|
7172
|
+
this.localyMessage["" + key] = value;
|
|
7162
7173
|
}
|
|
7163
7174
|
};
|
|
7164
7175
|
/**
|
|
@@ -7307,7 +7318,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7307
7318
|
var customMessage;
|
|
7308
7319
|
if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {
|
|
7309
7320
|
this.getInputElement(input.name);
|
|
7310
|
-
customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);
|
|
7321
|
+
customMessage = this.getErrorMessage(this.rules[input.name]["" + ruleName], ruleName);
|
|
7311
7322
|
}
|
|
7312
7323
|
if (message) {
|
|
7313
7324
|
value = [value, message];
|
|
@@ -7318,7 +7329,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7318
7329
|
else if (customMessage) {
|
|
7319
7330
|
value = [value, customMessage];
|
|
7320
7331
|
}
|
|
7321
|
-
ruleCon[ruleName] = value;
|
|
7332
|
+
ruleCon["" + ruleName] = value;
|
|
7322
7333
|
};
|
|
7323
7334
|
// Wire events to the form elements
|
|
7324
7335
|
FormValidator.prototype.wireEvents = function () {
|
|
@@ -7411,10 +7422,10 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7411
7422
|
};
|
|
7412
7423
|
// Validate each rule based on input element name
|
|
7413
7424
|
FormValidator.prototype.validateRules = function (name) {
|
|
7414
|
-
if (!this.rules[name]) {
|
|
7425
|
+
if (!this.rules["" + name]) {
|
|
7415
7426
|
return;
|
|
7416
7427
|
}
|
|
7417
|
-
var rules = Object.keys(this.rules[name]);
|
|
7428
|
+
var rules = Object.keys(this.rules["" + name]);
|
|
7418
7429
|
var hiddenType = false;
|
|
7419
7430
|
var validateHiddenType = false;
|
|
7420
7431
|
var vhPos = rules.indexOf('validateHidden');
|
|
@@ -7436,7 +7447,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7436
7447
|
this.getErrorElement(name);
|
|
7437
7448
|
for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) {
|
|
7438
7449
|
var rule = rules_2[_i];
|
|
7439
|
-
var errorMessage = this.getErrorMessage(this.rules[name][rule], rule);
|
|
7450
|
+
var errorMessage = this.getErrorMessage(this.rules["" + name]["" + rule], rule);
|
|
7440
7451
|
var errorRule = { name: name, message: errorMessage };
|
|
7441
7452
|
var eventArgs = {
|
|
7442
7453
|
inputName: name,
|
|
@@ -7482,7 +7493,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7482
7493
|
};
|
|
7483
7494
|
// Update the optional validation status
|
|
7484
7495
|
FormValidator.prototype.optionalValidationStatus = function (name, refer) {
|
|
7485
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7496
|
+
if (!this.rules["" + name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7486
7497
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7487
7498
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7488
7499
|
refer.status = '';
|
|
@@ -7491,9 +7502,9 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7491
7502
|
};
|
|
7492
7503
|
// Check the input element whether it's value satisfy the validation rule or not
|
|
7493
7504
|
FormValidator.prototype.isValid = function (name, rule) {
|
|
7494
|
-
var params = this.rules[name][rule];
|
|
7505
|
+
var params = this.rules["" + name]["" + rule];
|
|
7495
7506
|
var param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
|
|
7496
|
-
var currentRule = this.rules[name][rule];
|
|
7507
|
+
var currentRule = this.rules["" + name]["" + rule];
|
|
7497
7508
|
var args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };
|
|
7498
7509
|
this.trigger('validationBegin', args);
|
|
7499
7510
|
if (!args.param && rule === 'required') {
|
|
@@ -7510,7 +7521,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7510
7521
|
return selectAll('input[name="' + name + '"]:checked', this.element).length > 0;
|
|
7511
7522
|
}
|
|
7512
7523
|
else {
|
|
7513
|
-
return FormValidator_1.checkValidator[rule](args);
|
|
7524
|
+
return FormValidator_1.checkValidator["" + rule](args);
|
|
7514
7525
|
}
|
|
7515
7526
|
};
|
|
7516
7527
|
// Return default error message or custom error message
|
|
@@ -7518,12 +7529,12 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7518
7529
|
var message = this.inputElement.getAttribute('data-' + rule + '-message') ?
|
|
7519
7530
|
this.inputElement.getAttribute('data-' + rule + '-message') :
|
|
7520
7531
|
(ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :
|
|
7521
|
-
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];
|
|
7532
|
+
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage["" + rule] : this.defaultMessages["" + rule];
|
|
7522
7533
|
var formats = message.match(/{(\d)}/g);
|
|
7523
7534
|
if (!isNullOrUndefined(formats)) {
|
|
7524
7535
|
for (var i = 0; i < formats.length; i++) {
|
|
7525
|
-
var value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;
|
|
7526
|
-
message = message.replace(formats[i], value);
|
|
7536
|
+
var value = ruleValue instanceof Array ? ruleValue[parseInt(i.toString())] : ruleValue;
|
|
7537
|
+
message = message.replace(formats[parseInt(i.toString())], value);
|
|
7527
7538
|
}
|
|
7528
7539
|
}
|
|
7529
7540
|
return message;
|
|
@@ -7575,7 +7586,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7575
7586
|
// Remove existing rule from errorRules object
|
|
7576
7587
|
FormValidator.prototype.removeErrorRules = function (name) {
|
|
7577
7588
|
for (var i = 0; i < this.errorRules.length; i++) {
|
|
7578
|
-
var rule = this.errorRules[i];
|
|
7589
|
+
var rule = this.errorRules[parseInt(i.toString())];
|
|
7579
7590
|
if (rule.name === name) {
|
|
7580
7591
|
this.errorRules.splice(i, 1);
|
|
7581
7592
|
}
|
|
@@ -7599,7 +7610,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7599
7610
|
};
|
|
7600
7611
|
// Check whether the input element have required rule and its value is not empty
|
|
7601
7612
|
FormValidator.prototype.checkRequired = function (name) {
|
|
7602
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7613
|
+
if (!this.rules["" + name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7603
7614
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7604
7615
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7605
7616
|
this.hideMessage(name);
|
|
@@ -7677,6 +7688,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7677
7688
|
}
|
|
7678
7689
|
},
|
|
7679
7690
|
regex: function (option) {
|
|
7691
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
7680
7692
|
return new RegExp(option.param).test(option.value);
|
|
7681
7693
|
},
|
|
7682
7694
|
equalTo: function (option) {
|
|
@@ -8645,7 +8657,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
8645
8657
|
/* istanbul ignore next */
|
|
8646
8658
|
Uploader.prototype.onPasteFile = function (event) {
|
|
8647
8659
|
var item = event.clipboardData.items;
|
|
8648
|
-
if (event.type
|
|
8660
|
+
if (event.type === 'paste' && this.browserName !== 'msie' && this.browserName !== 'edge' && this.browserName !== 'safari') {
|
|
8649
8661
|
this.element.files = event.clipboardData.files;
|
|
8650
8662
|
}
|
|
8651
8663
|
if (item.length !== 1) {
|
|
@@ -9022,14 +9034,14 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9022
9034
|
if (this.enableHtmlSanitizer) {
|
|
9023
9035
|
for (var i = 0; i < fileData.length; i++) {
|
|
9024
9036
|
var sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
|
|
9025
|
-
var sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[i].name);
|
|
9026
|
-
if (sanitizeFileName
|
|
9027
|
-
var encodedFileName = targetFiles[i].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
|
|
9037
|
+
var sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[parseInt(i.toString())].name);
|
|
9038
|
+
if (sanitizeFileName !== fileData[parseInt(i.toString())].name) {
|
|
9039
|
+
var encodedFileName = targetFiles[parseInt(i.toString())].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
|
|
9028
9040
|
return '&#' + i.charCodeAt(0) + ';';
|
|
9029
9041
|
});
|
|
9030
|
-
fileData[i].name = encodedFileName;
|
|
9031
|
-
fileData[i].status = this.localizedTexts('invalidFileName');
|
|
9032
|
-
fileData[i].statusCode = '0';
|
|
9042
|
+
fileData[parseInt(i.toString())].name = encodedFileName;
|
|
9043
|
+
fileData[parseInt(i.toString())].status = this.localizedTexts('invalidFileName');
|
|
9044
|
+
fileData[parseInt(i.toString())].statusCode = '0';
|
|
9033
9045
|
}
|
|
9034
9046
|
}
|
|
9035
9047
|
}
|
|
@@ -10269,13 +10281,13 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10269
10281
|
this.updateStatus(metaData.file, this.localizedTexts('fileUploadCancel'), '5');
|
|
10270
10282
|
this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
|
|
10271
10283
|
this.removeProgressbar(liElement, 'failure');
|
|
10272
|
-
deleteIcon && deleteIcon.classList.remove(ABORT_ICON);
|
|
10273
|
-
deleteIcon && deleteIcon.classList.add(REMOVE_ICON);
|
|
10274
|
-
deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove'));
|
|
10284
|
+
(deleteIcon && deleteIcon.classList.remove(ABORT_ICON));
|
|
10285
|
+
(deleteIcon && deleteIcon.classList.add(REMOVE_ICON));
|
|
10286
|
+
(deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove')));
|
|
10275
10287
|
var pauseIcon = liElement.querySelector('.' + PAUSE_UPLOAD);
|
|
10276
|
-
pauseIcon && pauseIcon.classList.add(RETRY_ICON);
|
|
10277
|
-
pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD);
|
|
10278
|
-
pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry'));
|
|
10288
|
+
(pauseIcon && pauseIcon.classList.add(RETRY_ICON));
|
|
10289
|
+
(pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD));
|
|
10290
|
+
(pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry')));
|
|
10279
10291
|
if (!isNullOrUndefined(liElement) && !isNullOrUndefined(deleteIcon)
|
|
10280
10292
|
&& !isNullOrUndefined(liElement.querySelector('.e-spinner-pane'))) {
|
|
10281
10293
|
hideSpinner(spinnerTarget);
|
|
@@ -11382,7 +11394,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11382
11394
|
wrapper.classList.add(RTL$1);
|
|
11383
11395
|
}
|
|
11384
11396
|
if (this.cssClass) {
|
|
11385
|
-
addClass([wrapper], this.cssClass.split(' '));
|
|
11397
|
+
addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11386
11398
|
}
|
|
11387
11399
|
this.tileRipple = rippleEffect(this.container, { selector: '.' + TILE });
|
|
11388
11400
|
this.ctrlBtnRipple = rippleEffect(this.container, { selector: '.e-btn' });
|
|
@@ -11442,7 +11454,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11442
11454
|
var popupEle = this.getPopupEle();
|
|
11443
11455
|
addClass([popupEle], 'e-colorpicker-popup');
|
|
11444
11456
|
if (this.cssClass) {
|
|
11445
|
-
addClass([popupEle], this.cssClass.split(' '));
|
|
11457
|
+
addClass([popupEle], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11446
11458
|
}
|
|
11447
11459
|
if (Browser.isDevice) {
|
|
11448
11460
|
var popupInst = this.getPopupInst();
|
|
@@ -12081,6 +12093,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12081
12093
|
if (this.isPicker()) {
|
|
12082
12094
|
var dragHandler = this.getDragHandler();
|
|
12083
12095
|
EventHandler.add(dragHandler, 'keydown', this.pickerKeyDown, this);
|
|
12096
|
+
var ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
12097
|
+
if (ctrlBtn) {
|
|
12098
|
+
EventHandler.add(ctrlBtn, 'keydown', this.ctrlBtnKeyDown, this);
|
|
12099
|
+
}
|
|
12084
12100
|
EventHandler.add(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown, this);
|
|
12085
12101
|
if (this.modeSwitcher || this.showButtons) {
|
|
12086
12102
|
this.addCtrlSwitchEvent();
|
|
@@ -12102,6 +12118,16 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12102
12118
|
EventHandler.add(ctrlSwitchBtn, 'click', this.btnClickHandler, this);
|
|
12103
12119
|
}
|
|
12104
12120
|
};
|
|
12121
|
+
ColorPicker.prototype.ctrlBtnKeyDown = function (e) {
|
|
12122
|
+
if (e.keyCode === 13) {
|
|
12123
|
+
var applyBtn = select('.' + APPLY, this.container);
|
|
12124
|
+
if (applyBtn) {
|
|
12125
|
+
var cValue = this.rgbToHex(this.rgb);
|
|
12126
|
+
this.triggerChangeEvent(cValue);
|
|
12127
|
+
}
|
|
12128
|
+
this.splitBtn.element.focus();
|
|
12129
|
+
}
|
|
12130
|
+
};
|
|
12105
12131
|
ColorPicker.prototype.pickerKeyDown = function (e) {
|
|
12106
12132
|
switch (e.keyCode) {
|
|
12107
12133
|
case 39:
|
|
@@ -12126,7 +12152,6 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12126
12152
|
ColorPicker.prototype.enterKeyHandler = function (value, e) {
|
|
12127
12153
|
this.triggerChangeEvent(value);
|
|
12128
12154
|
if (!this.inline) {
|
|
12129
|
-
this.closePopup(e);
|
|
12130
12155
|
this.splitBtn.element.focus();
|
|
12131
12156
|
}
|
|
12132
12157
|
};
|
|
@@ -12654,6 +12679,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12654
12679
|
if (this.isPicker()) {
|
|
12655
12680
|
var dragHandler = this.getDragHandler();
|
|
12656
12681
|
EventHandler.remove(dragHandler, 'keydown', this.pickerKeyDown);
|
|
12682
|
+
var ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
12683
|
+
if (ctrlBtn) {
|
|
12684
|
+
EventHandler.remove(ctrlBtn, 'keydown', this.ctrlBtnKeyDown);
|
|
12685
|
+
}
|
|
12657
12686
|
EventHandler.remove(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown);
|
|
12658
12687
|
if (this.modeSwitcher || this.showButtons) {
|
|
12659
12688
|
EventHandler.remove(select('.' + CTRLSWITCH, this.container), 'click', this.btnClickHandler);
|
|
@@ -12895,7 +12924,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12895
12924
|
removeClass([wrapper, popupWrapper], oldProp.split(' '));
|
|
12896
12925
|
}
|
|
12897
12926
|
if (newProp) {
|
|
12898
|
-
addClass([wrapper, popupWrapper], newProp.split(' '));
|
|
12927
|
+
addClass([wrapper, popupWrapper], newProp.replace(/\s+/g, ' ').trim().split(' '));
|
|
12899
12928
|
}
|
|
12900
12929
|
};
|
|
12901
12930
|
ColorPicker.prototype.changeRtlProps = function (newProp) {
|
|
@@ -13346,7 +13375,9 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13346
13375
|
if (this.element.tagName !== 'TEXTAREA') {
|
|
13347
13376
|
this.element.setAttribute('type', this.type);
|
|
13348
13377
|
}
|
|
13349
|
-
this.
|
|
13378
|
+
if (this.type === 'text') {
|
|
13379
|
+
this.element.setAttribute('role', 'textbox');
|
|
13380
|
+
}
|
|
13350
13381
|
this.globalize = new Internationalization(this.locale);
|
|
13351
13382
|
var localeText = { placeholder: this.placeholder };
|
|
13352
13383
|
this.l10n = new L10n('textbox', localeText, this.locale);
|
|
@@ -13479,7 +13510,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13479
13510
|
this.inputPreviousValue = this.value;
|
|
13480
13511
|
this.respectiveElement.defaultValue = this.respectiveElement.value;
|
|
13481
13512
|
Input.setWidth(this.width, this.textboxWrapper.container);
|
|
13482
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
13513
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
13483
13514
|
this.enabled = false;
|
|
13484
13515
|
}
|
|
13485
13516
|
this.renderComplete();
|
|
@@ -13988,6 +14019,10 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
13988
14019
|
this.element.width = this.element.offsetWidth;
|
|
13989
14020
|
this.isResponsive = true;
|
|
13990
14021
|
}
|
|
14022
|
+
else if (this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1) {
|
|
14023
|
+
this.element.height = this.element.offsetHeight;
|
|
14024
|
+
this.element.width = this.element.offsetWidth;
|
|
14025
|
+
}
|
|
13991
14026
|
this.canvasContext.scale(1, 1);
|
|
13992
14027
|
this.canvasContext.fillStyle = this.strokeColor;
|
|
13993
14028
|
if (this.backgroundImage) {
|
|
@@ -14081,7 +14116,6 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14081
14116
|
this.canvasContext.canvas.width = this.element.offsetWidth;
|
|
14082
14117
|
this.canvasContext.canvas.height = this.element.offsetHeight;
|
|
14083
14118
|
this.canvasContext.scale(1, 1);
|
|
14084
|
-
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
14085
14119
|
var pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
|
|
14086
14120
|
for (var i = 0; i < this.signRatioPointsColl.length; i++) {
|
|
14087
14121
|
this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
|
|
@@ -14315,11 +14349,11 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14315
14349
|
SignatureBase.prototype.enableOrDisable = function (isDisable) {
|
|
14316
14350
|
this.disabled = isDisable;
|
|
14317
14351
|
if (isDisable) {
|
|
14318
|
-
this.canvasContext.canvas.style.filter =
|
|
14352
|
+
this.canvasContext.canvas.style.filter = 'opacity(0.5)';
|
|
14319
14353
|
this.isRead(true);
|
|
14320
14354
|
}
|
|
14321
14355
|
else {
|
|
14322
|
-
this.canvasContext.canvas.style.filter =
|
|
14356
|
+
this.canvasContext.canvas.style.filter = '';
|
|
14323
14357
|
this.isRead(false);
|
|
14324
14358
|
}
|
|
14325
14359
|
};
|
|
@@ -15125,7 +15159,6 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15125
15159
|
function Rating(options, element) {
|
|
15126
15160
|
var _this = _super.call(this, options, element) || this;
|
|
15127
15161
|
_this.itemElements = [];
|
|
15128
|
-
_this.tooltipOpen = false;
|
|
15129
15162
|
return _this;
|
|
15130
15163
|
}
|
|
15131
15164
|
Rating.prototype.preRender = function () {
|
|
@@ -15139,13 +15172,14 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15139
15172
|
uparrow: 'uparrow',
|
|
15140
15173
|
space: 'space'
|
|
15141
15174
|
};
|
|
15175
|
+
this.tooltipOpen = false;
|
|
15142
15176
|
};
|
|
15143
15177
|
Rating.prototype.render = function () {
|
|
15144
15178
|
this.initialize();
|
|
15145
15179
|
this.updateMinValue();
|
|
15146
15180
|
this.updateTemplateFunction();
|
|
15181
|
+
this.triggerChange(null, this.value, false);
|
|
15147
15182
|
this.renderItems();
|
|
15148
|
-
this.updatePrecision();
|
|
15149
15183
|
this.displayLabel();
|
|
15150
15184
|
};
|
|
15151
15185
|
Rating.prototype.initialize = function () {
|
|
@@ -15158,36 +15192,42 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15158
15192
|
attributes(this.element, { 'aria-label': 'rating' });
|
|
15159
15193
|
this.renderItemList();
|
|
15160
15194
|
this.updateReset();
|
|
15161
|
-
this.
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
this.
|
|
15165
|
-
|
|
15195
|
+
if (this.readOnly) {
|
|
15196
|
+
this.wrapper.classList.add(READONLY);
|
|
15197
|
+
}
|
|
15198
|
+
if (!this.visible) {
|
|
15199
|
+
this.wrapper.classList.add(HIDDEN);
|
|
15200
|
+
}
|
|
15201
|
+
if (this.enableRtl) {
|
|
15202
|
+
this.wrapper.classList.add(RTL$2);
|
|
15203
|
+
}
|
|
15204
|
+
if (this.enableAnimation) {
|
|
15205
|
+
this.wrapper.classList.add(ANIMATION);
|
|
15206
|
+
}
|
|
15166
15207
|
if (this.cssClass) {
|
|
15167
15208
|
addClass([this.wrapper], this.cssClass.split(' '));
|
|
15168
15209
|
}
|
|
15169
15210
|
this.updateTooltip();
|
|
15170
15211
|
this.wireKeyboardEvent();
|
|
15212
|
+
this.updateDisabled();
|
|
15171
15213
|
};
|
|
15172
15214
|
Rating.prototype.updateDisabled = function () {
|
|
15173
15215
|
this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
|
|
15174
15216
|
attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
|
|
15175
|
-
|
|
15176
|
-
this.updateResetButton();
|
|
15177
|
-
}
|
|
15217
|
+
this.updateResetButton();
|
|
15178
15218
|
};
|
|
15179
15219
|
Rating.prototype.updateResetButton = function () {
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
15220
|
+
if (this.allowReset) {
|
|
15221
|
+
var isDisabled = (this.value <= this.min) || this.disabled;
|
|
15222
|
+
this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
|
|
15223
|
+
attributes(this.resetElement, { 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
15224
|
+
}
|
|
15184
15225
|
};
|
|
15185
15226
|
Rating.prototype.renderItemList = function () {
|
|
15186
15227
|
var _this = this;
|
|
15187
15228
|
this.ratingItemList = this.createElement('div', {
|
|
15188
15229
|
className: ITEMLIST,
|
|
15189
|
-
id: this.element.id + '_item-list'
|
|
15190
|
-
attrs: { 'tabindex': '0' }
|
|
15230
|
+
id: this.element.id + '_item-list'
|
|
15191
15231
|
});
|
|
15192
15232
|
attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
|
|
15193
15233
|
this.wrapper.appendChild(this.ratingItemList);
|
|
@@ -15236,7 +15276,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15236
15276
|
var ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
|
|
15237
15277
|
var spanItem = this.createElement('span', { className: 'e-rating-item' });
|
|
15238
15278
|
var ratingValue = this.getRatingValue(this.value, i);
|
|
15239
|
-
this.renderItemContent(spanItem, ratingValue, i);
|
|
15279
|
+
this.renderItemContent(spanItem, ratingValue, i, false);
|
|
15240
15280
|
ratingItemContainer.appendChild(spanItem);
|
|
15241
15281
|
this.wireItemsEvents(ratingItemContainer, i + 1);
|
|
15242
15282
|
this.itemElements.push(ratingItemContainer);
|
|
@@ -15246,12 +15286,9 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15246
15286
|
});
|
|
15247
15287
|
}
|
|
15248
15288
|
attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
|
|
15249
|
-
|
|
15250
|
-
attributes(this.ratingItemList, { 'tabindex': '-1' });
|
|
15251
|
-
}
|
|
15289
|
+
this.updateItemValue(false);
|
|
15252
15290
|
};
|
|
15253
15291
|
Rating.prototype.renderItemContent = function (spanEle, val, index, isrerender) {
|
|
15254
|
-
if (isrerender === void 0) { isrerender = false; }
|
|
15255
15292
|
if (isrerender) {
|
|
15256
15293
|
this.removeItemContent(spanEle);
|
|
15257
15294
|
}
|
|
@@ -15290,17 +15327,12 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15290
15327
|
}
|
|
15291
15328
|
};
|
|
15292
15329
|
Rating.prototype.updateMinValue = function () {
|
|
15293
|
-
this.min
|
|
15330
|
+
this.setProperties({ min: this.validateValue(this.min) }, true);
|
|
15294
15331
|
if (this.min > 0 && this.value < this.min) {
|
|
15295
15332
|
this.triggerChange(null, this.min, false);
|
|
15296
15333
|
}
|
|
15297
15334
|
attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
|
|
15298
15335
|
};
|
|
15299
|
-
Rating.prototype.updatePrecision = function () {
|
|
15300
|
-
this.min = this.validateValue(this.min);
|
|
15301
|
-
this.triggerChange(null, this.validateValue(this.value), false);
|
|
15302
|
-
this.updateItemValue();
|
|
15303
|
-
};
|
|
15304
15336
|
Rating.prototype.validateValue = function (currentValue) {
|
|
15305
15337
|
if (currentValue > this.itemsCount) {
|
|
15306
15338
|
currentValue = this.itemsCount;
|
|
@@ -15319,7 +15351,11 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15319
15351
|
return (this.enableSingleSelection) ? (((value > i) && (value <= i + 1)) ? 1 : 0) :
|
|
15320
15352
|
(value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
|
|
15321
15353
|
};
|
|
15322
|
-
Rating.prototype.updateItemValue = function () {
|
|
15354
|
+
Rating.prototype.updateItemValue = function (isUpdate) {
|
|
15355
|
+
if (isUpdate === void 0) { isUpdate = true; }
|
|
15356
|
+
if (isUpdate && this.isReact) {
|
|
15357
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15358
|
+
}
|
|
15323
15359
|
for (var i = 0; i < this.itemsCount; i++) {
|
|
15324
15360
|
var itemElement = this.itemElements[parseInt(i.toString(), 10)];
|
|
15325
15361
|
itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
|
|
@@ -15333,13 +15369,16 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15333
15369
|
else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
|
|
15334
15370
|
itemElement.classList.add(SELECTEDVALUE);
|
|
15335
15371
|
}
|
|
15336
|
-
|
|
15372
|
+
if (isUpdate) {
|
|
15373
|
+
this.updateItemContent(ratingValue, i);
|
|
15374
|
+
}
|
|
15337
15375
|
itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
|
|
15338
15376
|
itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
|
|
15339
15377
|
}
|
|
15340
|
-
if (
|
|
15341
|
-
this.
|
|
15378
|
+
if (isUpdate) {
|
|
15379
|
+
this.renderReactTemplates();
|
|
15342
15380
|
}
|
|
15381
|
+
this.updateResetButton();
|
|
15343
15382
|
attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
|
|
15344
15383
|
attributes(this.element, { 'value': this.value.toString() });
|
|
15345
15384
|
};
|
|
@@ -15349,26 +15388,31 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15349
15388
|
}
|
|
15350
15389
|
var spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
|
|
15351
15390
|
if (this.fullTemplate && ratingValue === 1) {
|
|
15352
|
-
if (spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15391
|
+
if (!this.isReact && spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15353
15392
|
return;
|
|
15354
15393
|
}
|
|
15355
15394
|
this.removeItemContent(spanEle);
|
|
15356
15395
|
spanEle.classList.add(FULLTEMPLATE);
|
|
15357
|
-
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
|
|
15396
|
+
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate' + index), this.isStringTemplate)[0]);
|
|
15358
15397
|
}
|
|
15359
15398
|
else if (this.emptyTemplate) {
|
|
15399
|
+
if (!this.isReact && spanEle.classList.contains(EMPTYTEMPLATE)) {
|
|
15400
|
+
return;
|
|
15401
|
+
}
|
|
15360
15402
|
this.removeItemContent(spanEle);
|
|
15361
15403
|
spanEle.classList.add(EMPTYTEMPLATE);
|
|
15362
|
-
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, '
|
|
15404
|
+
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate' + index), this.isStringTemplate)[0]);
|
|
15363
15405
|
}
|
|
15364
15406
|
else {
|
|
15365
15407
|
this.removeItemContent(spanEle);
|
|
15366
15408
|
addClass([spanEle], ICONCSS.split(' '));
|
|
15367
15409
|
}
|
|
15368
|
-
this.renderReactTemplates();
|
|
15369
15410
|
};
|
|
15370
15411
|
Rating.prototype.updateTooltipContent = function (isChange) {
|
|
15371
15412
|
if (this.showTooltip) {
|
|
15413
|
+
if (this.isReact) {
|
|
15414
|
+
this.clearTemplate(['ratingTooltipTemplate']);
|
|
15415
|
+
}
|
|
15372
15416
|
var content = void 0;
|
|
15373
15417
|
if (this.tooltipTemplate) {
|
|
15374
15418
|
var templateFunction = this.getTemplateString(this.tooltipTemplate);
|
|
@@ -15414,21 +15458,27 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15414
15458
|
Rating.prototype.updateLabel = function () {
|
|
15415
15459
|
if (this.showLabel) {
|
|
15416
15460
|
if (this.labelTemplate) {
|
|
15461
|
+
if (this.isReact) {
|
|
15462
|
+
this.clearTemplate(['ratingLabelTemplate']);
|
|
15463
|
+
}
|
|
15417
15464
|
if (this.spanLabel.firstChild) {
|
|
15418
15465
|
this.spanLabel.removeChild(this.spanLabel.firstChild);
|
|
15419
15466
|
}
|
|
15420
15467
|
var templateFunction = this.getTemplateString(this.labelTemplate);
|
|
15421
15468
|
this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
|
|
15469
|
+
this.renderReactTemplates();
|
|
15422
15470
|
}
|
|
15423
15471
|
else {
|
|
15424
15472
|
this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
|
|
15425
15473
|
}
|
|
15426
|
-
this.renderReactTemplates();
|
|
15427
15474
|
}
|
|
15428
15475
|
};
|
|
15429
15476
|
Rating.prototype.updateReset = function () {
|
|
15430
15477
|
if (this.allowReset) {
|
|
15431
|
-
this.resetElement = this.createElement('span', {
|
|
15478
|
+
this.resetElement = this.createElement('span', {
|
|
15479
|
+
className: RESET,
|
|
15480
|
+
attrs: { 'aria-label': 'resetbutton', 'role': 'button' }
|
|
15481
|
+
});
|
|
15432
15482
|
this.updateResetButton();
|
|
15433
15483
|
EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
|
|
15434
15484
|
this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
|
|
@@ -15467,9 +15517,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15467
15517
|
this.triggerChange(e, this.currentValue);
|
|
15468
15518
|
this.updateItemValue();
|
|
15469
15519
|
this.updateLabel();
|
|
15470
|
-
|
|
15471
|
-
this.updateResetButton();
|
|
15472
|
-
}
|
|
15520
|
+
this.updateResetButton();
|
|
15473
15521
|
};
|
|
15474
15522
|
Rating.prototype.updateValueChange = function (e, val, isInteracted) {
|
|
15475
15523
|
if (isInteracted === void 0) { isInteracted = true; }
|
|
@@ -15547,6 +15595,8 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15547
15595
|
/**
|
|
15548
15596
|
* Reset’s the value to minimum.
|
|
15549
15597
|
*
|
|
15598
|
+
* {% codeBlock src='rating/reset/index.md' %}{% endcodeBlock %}
|
|
15599
|
+
*
|
|
15550
15600
|
* @returns {void}
|
|
15551
15601
|
*/
|
|
15552
15602
|
Rating.prototype.reset = function () {
|
|
@@ -15599,12 +15649,13 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15599
15649
|
Math.round(0.1 * 10) / 10;
|
|
15600
15650
|
currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
|
|
15601
15651
|
this.updateValueChange(e, (currentValue));
|
|
15602
|
-
|
|
15603
|
-
this.updateResetButton();
|
|
15604
|
-
}
|
|
15652
|
+
this.updateResetButton();
|
|
15605
15653
|
}
|
|
15606
15654
|
};
|
|
15607
15655
|
Rating.prototype.updateContent = function () {
|
|
15656
|
+
if (this.isReact) {
|
|
15657
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15658
|
+
}
|
|
15608
15659
|
for (var i = 0; i < this.itemsCount; i++) {
|
|
15609
15660
|
var itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
|
|
15610
15661
|
this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
|
|
@@ -15643,6 +15694,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15643
15694
|
_super.prototype.destroy.call(this);
|
|
15644
15695
|
// unwires the events and detach the li elements
|
|
15645
15696
|
this.removeItemElements();
|
|
15697
|
+
this.clearTemplate();
|
|
15646
15698
|
if (this.spanLabel) {
|
|
15647
15699
|
remove(this.spanLabel);
|
|
15648
15700
|
this.spanLabel = null;
|
|
@@ -15661,6 +15713,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15661
15713
|
remove(this.wrapper);
|
|
15662
15714
|
this.wrapper = null;
|
|
15663
15715
|
this.keyboardModuleRating.destroy();
|
|
15716
|
+
this.keyboardModuleRating = null;
|
|
15664
15717
|
['value', 'aria-label', 'name'].forEach(function (attr) {
|
|
15665
15718
|
_this.element.removeAttribute(attr);
|
|
15666
15719
|
});
|
|
@@ -15721,7 +15774,9 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15721
15774
|
this.updateTooltip();
|
|
15722
15775
|
break;
|
|
15723
15776
|
case 'precision':
|
|
15724
|
-
this.
|
|
15777
|
+
this.updateMinValue();
|
|
15778
|
+
this.triggerChange(null, this.value, false);
|
|
15779
|
+
this.updateItemValue();
|
|
15725
15780
|
this.updateLabel();
|
|
15726
15781
|
break;
|
|
15727
15782
|
case 'enableSingleSelection':
|
|
@@ -15742,7 +15797,6 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15742
15797
|
case 'itemsCount':
|
|
15743
15798
|
this.removeItemElements();
|
|
15744
15799
|
this.renderItems();
|
|
15745
|
-
this.updateItemValue();
|
|
15746
15800
|
this.updateLabel();
|
|
15747
15801
|
break;
|
|
15748
15802
|
}
|