@syncfusion/ej2-inputs 20.4.54 → 21.1.35
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 +0 -35
- 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 +167 -119
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +161 -113
- 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 +64 -45
- package/src/slider/slider-model.d.ts +41 -6
- package/src/slider/slider.d.ts +113 -8
- package/src/slider/slider.js +8 -3
- 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 +6 -0
- package/styles/bootstrap.css +6 -0
- package/styles/bootstrap4.css +6 -0
- package/styles/bootstrap5-dark.css +10 -4
- package/styles/bootstrap5.css +10 -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 +6 -0
- package/styles/fabric.css +6 -0
- package/styles/fluent-dark.css +6 -0
- package/styles/fluent.css +6 -0
- package/styles/highcontrast-light.css +6 -0
- package/styles/highcontrast.css +6 -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 +7 -5
- package/styles/material.css +7 -1
- package/styles/numerictextbox/icons/_material3.scss +3 -3
- package/styles/rating/_bootstrap5-definition.scss +12 -15
- package/styles/rating/_fluent-definition.scss +12 -15
- package/styles/rating/_tailwind-definition.scss +12 -15
- package/styles/rating/_theme.scss +14 -2
- package/styles/rating/tailwind-dark.css +1 -1
- package/styles/rating/tailwind.css +1 -1
- package/styles/slider/_layout.scss +44 -25
- package/styles/slider/_theme.scss +6 -1
- package/styles/tailwind-dark.css +8 -2
- package/styles/tailwind.css +8 -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 () {
|
|
@@ -6237,7 +6239,6 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6237
6239
|
Slider.prototype.openTooltip = function (target) {
|
|
6238
6240
|
if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
|
|
6239
6241
|
this.tooltipValue();
|
|
6240
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
|
|
6241
6242
|
this.tooltipObj.open(target);
|
|
6242
6243
|
this.tooltipTarget = target;
|
|
6243
6244
|
}
|
|
@@ -6557,6 +6558,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6557
6558
|
};
|
|
6558
6559
|
/**
|
|
6559
6560
|
* Get the properties to be maintained in the persisted state.
|
|
6561
|
+
*
|
|
6560
6562
|
* @private
|
|
6561
6563
|
*/
|
|
6562
6564
|
Slider.prototype.getPersistData = function () {
|
|
@@ -6566,6 +6568,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6566
6568
|
/**
|
|
6567
6569
|
* Removes the component from the DOM and detaches all its related event handlers.
|
|
6568
6570
|
* Also it removes the attributes and classes.
|
|
6571
|
+
*
|
|
6569
6572
|
* @method destroy
|
|
6570
6573
|
* @return {void}
|
|
6571
6574
|
*/
|
|
@@ -6587,6 +6590,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6587
6590
|
};
|
|
6588
6591
|
/**
|
|
6589
6592
|
* Calls internally if any of the property value is changed.
|
|
6593
|
+
*
|
|
6590
6594
|
* @private
|
|
6591
6595
|
*/
|
|
6592
6596
|
// tslint:disable-next-line
|
|
@@ -6805,6 +6809,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
|
|
|
6805
6809
|
};
|
|
6806
6810
|
/**
|
|
6807
6811
|
* Gets the component name
|
|
6812
|
+
*
|
|
6808
6813
|
* @private
|
|
6809
6814
|
*/
|
|
6810
6815
|
Slider.prototype.getModuleName = function () {
|
|
@@ -6919,6 +6924,7 @@ var regex = {
|
|
|
6919
6924
|
/* eslint-disable no-useless-escape */
|
|
6920
6925
|
EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +
|
|
6921
6926
|
'|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),
|
|
6927
|
+
/* eslint-disable-next-line security/detect-unsafe-regex */
|
|
6922
6928
|
URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,
|
|
6923
6929
|
DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),
|
|
6924
6930
|
DIGITS: new RegExp('^[0-9]*$'),
|
|
@@ -7036,10 +7042,10 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7036
7042
|
if (name) {
|
|
7037
7043
|
// eslint-disable-next-line no-prototype-builtins
|
|
7038
7044
|
if (this.rules.hasOwnProperty(name)) {
|
|
7039
|
-
extend(this.rules[name], rules, {});
|
|
7045
|
+
extend(this.rules["" + name], rules, {});
|
|
7040
7046
|
}
|
|
7041
7047
|
else {
|
|
7042
|
-
this.rules[name] = rules;
|
|
7048
|
+
this.rules["" + name] = rules;
|
|
7043
7049
|
}
|
|
7044
7050
|
}
|
|
7045
7051
|
};
|
|
@@ -7055,12 +7061,12 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7055
7061
|
if (!name && !rules) {
|
|
7056
7062
|
this.rules = {};
|
|
7057
7063
|
}
|
|
7058
|
-
else if (this.rules[name] && !rules) {
|
|
7059
|
-
delete this.rules[name];
|
|
7064
|
+
else if (this.rules["" + name] && !rules) {
|
|
7065
|
+
delete this.rules["" + name];
|
|
7060
7066
|
}
|
|
7061
|
-
else if (!isNullOrUndefined(this.rules[name] && rules)) {
|
|
7067
|
+
else if (!isNullOrUndefined(this.rules["" + name] && rules)) {
|
|
7062
7068
|
for (var i = 0; i < rules.length; i++) {
|
|
7063
|
-
delete this.rules[name][rules[i]];
|
|
7069
|
+
delete this.rules["" + name][rules[parseInt(i.toString())]];
|
|
7064
7070
|
}
|
|
7065
7071
|
}
|
|
7066
7072
|
else {
|
|
@@ -7158,7 +7164,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7158
7164
|
var key = _a[_i];
|
|
7159
7165
|
this.l10n.setLocale(this.locale);
|
|
7160
7166
|
var value = this.l10n.getConstant(key);
|
|
7161
|
-
this.localyMessage[key] = value;
|
|
7167
|
+
this.localyMessage["" + key] = value;
|
|
7162
7168
|
}
|
|
7163
7169
|
};
|
|
7164
7170
|
/**
|
|
@@ -7307,7 +7313,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7307
7313
|
var customMessage;
|
|
7308
7314
|
if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {
|
|
7309
7315
|
this.getInputElement(input.name);
|
|
7310
|
-
customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);
|
|
7316
|
+
customMessage = this.getErrorMessage(this.rules[input.name]["" + ruleName], ruleName);
|
|
7311
7317
|
}
|
|
7312
7318
|
if (message) {
|
|
7313
7319
|
value = [value, message];
|
|
@@ -7318,7 +7324,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7318
7324
|
else if (customMessage) {
|
|
7319
7325
|
value = [value, customMessage];
|
|
7320
7326
|
}
|
|
7321
|
-
ruleCon[ruleName] = value;
|
|
7327
|
+
ruleCon["" + ruleName] = value;
|
|
7322
7328
|
};
|
|
7323
7329
|
// Wire events to the form elements
|
|
7324
7330
|
FormValidator.prototype.wireEvents = function () {
|
|
@@ -7411,10 +7417,10 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7411
7417
|
};
|
|
7412
7418
|
// Validate each rule based on input element name
|
|
7413
7419
|
FormValidator.prototype.validateRules = function (name) {
|
|
7414
|
-
if (!this.rules[name]) {
|
|
7420
|
+
if (!this.rules["" + name]) {
|
|
7415
7421
|
return;
|
|
7416
7422
|
}
|
|
7417
|
-
var rules = Object.keys(this.rules[name]);
|
|
7423
|
+
var rules = Object.keys(this.rules["" + name]);
|
|
7418
7424
|
var hiddenType = false;
|
|
7419
7425
|
var validateHiddenType = false;
|
|
7420
7426
|
var vhPos = rules.indexOf('validateHidden');
|
|
@@ -7436,7 +7442,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7436
7442
|
this.getErrorElement(name);
|
|
7437
7443
|
for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) {
|
|
7438
7444
|
var rule = rules_2[_i];
|
|
7439
|
-
var errorMessage = this.getErrorMessage(this.rules[name][rule], rule);
|
|
7445
|
+
var errorMessage = this.getErrorMessage(this.rules["" + name]["" + rule], rule);
|
|
7440
7446
|
var errorRule = { name: name, message: errorMessage };
|
|
7441
7447
|
var eventArgs = {
|
|
7442
7448
|
inputName: name,
|
|
@@ -7482,7 +7488,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7482
7488
|
};
|
|
7483
7489
|
// Update the optional validation status
|
|
7484
7490
|
FormValidator.prototype.optionalValidationStatus = function (name, refer) {
|
|
7485
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7491
|
+
if (!this.rules["" + name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7486
7492
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7487
7493
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7488
7494
|
refer.status = '';
|
|
@@ -7491,9 +7497,9 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7491
7497
|
};
|
|
7492
7498
|
// Check the input element whether it's value satisfy the validation rule or not
|
|
7493
7499
|
FormValidator.prototype.isValid = function (name, rule) {
|
|
7494
|
-
var params = this.rules[name][rule];
|
|
7500
|
+
var params = this.rules["" + name]["" + rule];
|
|
7495
7501
|
var param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
|
|
7496
|
-
var currentRule = this.rules[name][rule];
|
|
7502
|
+
var currentRule = this.rules["" + name]["" + rule];
|
|
7497
7503
|
var args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };
|
|
7498
7504
|
this.trigger('validationBegin', args);
|
|
7499
7505
|
if (!args.param && rule === 'required') {
|
|
@@ -7510,7 +7516,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7510
7516
|
return selectAll('input[name="' + name + '"]:checked', this.element).length > 0;
|
|
7511
7517
|
}
|
|
7512
7518
|
else {
|
|
7513
|
-
return FormValidator_1.checkValidator[rule](args);
|
|
7519
|
+
return FormValidator_1.checkValidator["" + rule](args);
|
|
7514
7520
|
}
|
|
7515
7521
|
};
|
|
7516
7522
|
// Return default error message or custom error message
|
|
@@ -7518,12 +7524,12 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7518
7524
|
var message = this.inputElement.getAttribute('data-' + rule + '-message') ?
|
|
7519
7525
|
this.inputElement.getAttribute('data-' + rule + '-message') :
|
|
7520
7526
|
(ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :
|
|
7521
|
-
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];
|
|
7527
|
+
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage["" + rule] : this.defaultMessages["" + rule];
|
|
7522
7528
|
var formats = message.match(/{(\d)}/g);
|
|
7523
7529
|
if (!isNullOrUndefined(formats)) {
|
|
7524
7530
|
for (var i = 0; i < formats.length; i++) {
|
|
7525
|
-
var value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;
|
|
7526
|
-
message = message.replace(formats[i], value);
|
|
7531
|
+
var value = ruleValue instanceof Array ? ruleValue[parseInt(i.toString())] : ruleValue;
|
|
7532
|
+
message = message.replace(formats[parseInt(i.toString())], value);
|
|
7527
7533
|
}
|
|
7528
7534
|
}
|
|
7529
7535
|
return message;
|
|
@@ -7575,7 +7581,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7575
7581
|
// Remove existing rule from errorRules object
|
|
7576
7582
|
FormValidator.prototype.removeErrorRules = function (name) {
|
|
7577
7583
|
for (var i = 0; i < this.errorRules.length; i++) {
|
|
7578
|
-
var rule = this.errorRules[i];
|
|
7584
|
+
var rule = this.errorRules[parseInt(i.toString())];
|
|
7579
7585
|
if (rule.name === name) {
|
|
7580
7586
|
this.errorRules.splice(i, 1);
|
|
7581
7587
|
}
|
|
@@ -7599,7 +7605,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7599
7605
|
};
|
|
7600
7606
|
// Check whether the input element have required rule and its value is not empty
|
|
7601
7607
|
FormValidator.prototype.checkRequired = function (name) {
|
|
7602
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7608
|
+
if (!this.rules["" + name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7603
7609
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7604
7610
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7605
7611
|
this.hideMessage(name);
|
|
@@ -7677,6 +7683,7 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7677
7683
|
}
|
|
7678
7684
|
},
|
|
7679
7685
|
regex: function (option) {
|
|
7686
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
7680
7687
|
return new RegExp(option.param).test(option.value);
|
|
7681
7688
|
},
|
|
7682
7689
|
equalTo: function (option) {
|
|
@@ -8645,7 +8652,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
8645
8652
|
/* istanbul ignore next */
|
|
8646
8653
|
Uploader.prototype.onPasteFile = function (event) {
|
|
8647
8654
|
var item = event.clipboardData.items;
|
|
8648
|
-
if (event.type
|
|
8655
|
+
if (event.type === 'paste' && this.browserName !== 'msie' && this.browserName !== 'edge' && this.browserName !== 'safari') {
|
|
8649
8656
|
this.element.files = event.clipboardData.files;
|
|
8650
8657
|
}
|
|
8651
8658
|
if (item.length !== 1) {
|
|
@@ -9022,14 +9029,14 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9022
9029
|
if (this.enableHtmlSanitizer) {
|
|
9023
9030
|
for (var i = 0; i < fileData.length; i++) {
|
|
9024
9031
|
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) {
|
|
9032
|
+
var sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[parseInt(i.toString())].name);
|
|
9033
|
+
if (sanitizeFileName !== fileData[parseInt(i.toString())].name) {
|
|
9034
|
+
var encodedFileName = targetFiles[parseInt(i.toString())].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
|
|
9028
9035
|
return '&#' + i.charCodeAt(0) + ';';
|
|
9029
9036
|
});
|
|
9030
|
-
fileData[i].name = encodedFileName;
|
|
9031
|
-
fileData[i].status = this.localizedTexts('invalidFileName');
|
|
9032
|
-
fileData[i].statusCode = '0';
|
|
9037
|
+
fileData[parseInt(i.toString())].name = encodedFileName;
|
|
9038
|
+
fileData[parseInt(i.toString())].status = this.localizedTexts('invalidFileName');
|
|
9039
|
+
fileData[parseInt(i.toString())].statusCode = '0';
|
|
9033
9040
|
}
|
|
9034
9041
|
}
|
|
9035
9042
|
}
|
|
@@ -10269,13 +10276,13 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10269
10276
|
this.updateStatus(metaData.file, this.localizedTexts('fileUploadCancel'), '5');
|
|
10270
10277
|
this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
|
|
10271
10278
|
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'));
|
|
10279
|
+
(deleteIcon && deleteIcon.classList.remove(ABORT_ICON));
|
|
10280
|
+
(deleteIcon && deleteIcon.classList.add(REMOVE_ICON));
|
|
10281
|
+
(deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove')));
|
|
10275
10282
|
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'));
|
|
10283
|
+
(pauseIcon && pauseIcon.classList.add(RETRY_ICON));
|
|
10284
|
+
(pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD));
|
|
10285
|
+
(pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry')));
|
|
10279
10286
|
if (!isNullOrUndefined(liElement) && !isNullOrUndefined(deleteIcon)
|
|
10280
10287
|
&& !isNullOrUndefined(liElement.querySelector('.e-spinner-pane'))) {
|
|
10281
10288
|
hideSpinner(spinnerTarget);
|
|
@@ -11382,7 +11389,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11382
11389
|
wrapper.classList.add(RTL$1);
|
|
11383
11390
|
}
|
|
11384
11391
|
if (this.cssClass) {
|
|
11385
|
-
addClass([wrapper], this.cssClass.split(' '));
|
|
11392
|
+
addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11386
11393
|
}
|
|
11387
11394
|
this.tileRipple = rippleEffect(this.container, { selector: '.' + TILE });
|
|
11388
11395
|
this.ctrlBtnRipple = rippleEffect(this.container, { selector: '.e-btn' });
|
|
@@ -11442,7 +11449,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11442
11449
|
var popupEle = this.getPopupEle();
|
|
11443
11450
|
addClass([popupEle], 'e-colorpicker-popup');
|
|
11444
11451
|
if (this.cssClass) {
|
|
11445
|
-
addClass([popupEle], this.cssClass.split(' '));
|
|
11452
|
+
addClass([popupEle], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11446
11453
|
}
|
|
11447
11454
|
if (Browser.isDevice) {
|
|
11448
11455
|
var popupInst = this.getPopupInst();
|
|
@@ -12081,6 +12088,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12081
12088
|
if (this.isPicker()) {
|
|
12082
12089
|
var dragHandler = this.getDragHandler();
|
|
12083
12090
|
EventHandler.add(dragHandler, 'keydown', this.pickerKeyDown, this);
|
|
12091
|
+
var ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
12092
|
+
if (ctrlBtn) {
|
|
12093
|
+
EventHandler.add(ctrlBtn, 'keydown', this.ctrlBtnKeyDown, this);
|
|
12094
|
+
}
|
|
12084
12095
|
EventHandler.add(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown, this);
|
|
12085
12096
|
if (this.modeSwitcher || this.showButtons) {
|
|
12086
12097
|
this.addCtrlSwitchEvent();
|
|
@@ -12102,6 +12113,16 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12102
12113
|
EventHandler.add(ctrlSwitchBtn, 'click', this.btnClickHandler, this);
|
|
12103
12114
|
}
|
|
12104
12115
|
};
|
|
12116
|
+
ColorPicker.prototype.ctrlBtnKeyDown = function (e) {
|
|
12117
|
+
if (e.keyCode === 13) {
|
|
12118
|
+
var applyBtn = select('.' + APPLY, this.container);
|
|
12119
|
+
if (applyBtn) {
|
|
12120
|
+
var cValue = this.rgbToHex(this.rgb);
|
|
12121
|
+
this.triggerChangeEvent(cValue);
|
|
12122
|
+
}
|
|
12123
|
+
this.splitBtn.element.focus();
|
|
12124
|
+
}
|
|
12125
|
+
};
|
|
12105
12126
|
ColorPicker.prototype.pickerKeyDown = function (e) {
|
|
12106
12127
|
switch (e.keyCode) {
|
|
12107
12128
|
case 39:
|
|
@@ -12126,7 +12147,6 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12126
12147
|
ColorPicker.prototype.enterKeyHandler = function (value, e) {
|
|
12127
12148
|
this.triggerChangeEvent(value);
|
|
12128
12149
|
if (!this.inline) {
|
|
12129
|
-
this.closePopup(e);
|
|
12130
12150
|
this.splitBtn.element.focus();
|
|
12131
12151
|
}
|
|
12132
12152
|
};
|
|
@@ -12654,6 +12674,10 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12654
12674
|
if (this.isPicker()) {
|
|
12655
12675
|
var dragHandler = this.getDragHandler();
|
|
12656
12676
|
EventHandler.remove(dragHandler, 'keydown', this.pickerKeyDown);
|
|
12677
|
+
var ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
12678
|
+
if (ctrlBtn) {
|
|
12679
|
+
EventHandler.remove(ctrlBtn, 'keydown', this.ctrlBtnKeyDown);
|
|
12680
|
+
}
|
|
12657
12681
|
EventHandler.remove(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown);
|
|
12658
12682
|
if (this.modeSwitcher || this.showButtons) {
|
|
12659
12683
|
EventHandler.remove(select('.' + CTRLSWITCH, this.container), 'click', this.btnClickHandler);
|
|
@@ -12895,7 +12919,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12895
12919
|
removeClass([wrapper, popupWrapper], oldProp.split(' '));
|
|
12896
12920
|
}
|
|
12897
12921
|
if (newProp) {
|
|
12898
|
-
addClass([wrapper, popupWrapper], newProp.split(' '));
|
|
12922
|
+
addClass([wrapper, popupWrapper], newProp.replace(/\s+/g, ' ').trim().split(' '));
|
|
12899
12923
|
}
|
|
12900
12924
|
};
|
|
12901
12925
|
ColorPicker.prototype.changeRtlProps = function (newProp) {
|
|
@@ -13346,7 +13370,9 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13346
13370
|
if (this.element.tagName !== 'TEXTAREA') {
|
|
13347
13371
|
this.element.setAttribute('type', this.type);
|
|
13348
13372
|
}
|
|
13349
|
-
this.
|
|
13373
|
+
if (this.type === 'text') {
|
|
13374
|
+
this.element.setAttribute('role', 'textbox');
|
|
13375
|
+
}
|
|
13350
13376
|
this.globalize = new Internationalization(this.locale);
|
|
13351
13377
|
var localeText = { placeholder: this.placeholder };
|
|
13352
13378
|
this.l10n = new L10n('textbox', localeText, this.locale);
|
|
@@ -13479,7 +13505,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13479
13505
|
this.inputPreviousValue = this.value;
|
|
13480
13506
|
this.respectiveElement.defaultValue = this.respectiveElement.value;
|
|
13481
13507
|
Input.setWidth(this.width, this.textboxWrapper.container);
|
|
13482
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
13508
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
13483
13509
|
this.enabled = false;
|
|
13484
13510
|
}
|
|
13485
13511
|
this.renderComplete();
|
|
@@ -13988,6 +14014,10 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
13988
14014
|
this.element.width = this.element.offsetWidth;
|
|
13989
14015
|
this.isResponsive = true;
|
|
13990
14016
|
}
|
|
14017
|
+
else if (this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1) {
|
|
14018
|
+
this.element.height = this.element.offsetHeight;
|
|
14019
|
+
this.element.width = this.element.offsetWidth;
|
|
14020
|
+
}
|
|
13991
14021
|
this.canvasContext.scale(1, 1);
|
|
13992
14022
|
this.canvasContext.fillStyle = this.strokeColor;
|
|
13993
14023
|
if (this.backgroundImage) {
|
|
@@ -14081,7 +14111,6 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14081
14111
|
this.canvasContext.canvas.width = this.element.offsetWidth;
|
|
14082
14112
|
this.canvasContext.canvas.height = this.element.offsetHeight;
|
|
14083
14113
|
this.canvasContext.scale(1, 1);
|
|
14084
|
-
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
14085
14114
|
var pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
|
|
14086
14115
|
for (var i = 0; i < this.signRatioPointsColl.length; i++) {
|
|
14087
14116
|
this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
|
|
@@ -14315,11 +14344,11 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
14315
14344
|
SignatureBase.prototype.enableOrDisable = function (isDisable) {
|
|
14316
14345
|
this.disabled = isDisable;
|
|
14317
14346
|
if (isDisable) {
|
|
14318
|
-
this.canvasContext.canvas.style.filter =
|
|
14347
|
+
this.canvasContext.canvas.style.filter = 'opacity(0.5)';
|
|
14319
14348
|
this.isRead(true);
|
|
14320
14349
|
}
|
|
14321
14350
|
else {
|
|
14322
|
-
this.canvasContext.canvas.style.filter =
|
|
14351
|
+
this.canvasContext.canvas.style.filter = '';
|
|
14323
14352
|
this.isRead(false);
|
|
14324
14353
|
}
|
|
14325
14354
|
};
|
|
@@ -15125,7 +15154,6 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15125
15154
|
function Rating(options, element) {
|
|
15126
15155
|
var _this = _super.call(this, options, element) || this;
|
|
15127
15156
|
_this.itemElements = [];
|
|
15128
|
-
_this.tooltipOpen = false;
|
|
15129
15157
|
return _this;
|
|
15130
15158
|
}
|
|
15131
15159
|
Rating.prototype.preRender = function () {
|
|
@@ -15139,13 +15167,14 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15139
15167
|
uparrow: 'uparrow',
|
|
15140
15168
|
space: 'space'
|
|
15141
15169
|
};
|
|
15170
|
+
this.tooltipOpen = false;
|
|
15142
15171
|
};
|
|
15143
15172
|
Rating.prototype.render = function () {
|
|
15144
15173
|
this.initialize();
|
|
15145
15174
|
this.updateMinValue();
|
|
15146
15175
|
this.updateTemplateFunction();
|
|
15176
|
+
this.triggerChange(null, this.value, false);
|
|
15147
15177
|
this.renderItems();
|
|
15148
|
-
this.updatePrecision();
|
|
15149
15178
|
this.displayLabel();
|
|
15150
15179
|
};
|
|
15151
15180
|
Rating.prototype.initialize = function () {
|
|
@@ -15158,36 +15187,42 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15158
15187
|
attributes(this.element, { 'aria-label': 'rating' });
|
|
15159
15188
|
this.renderItemList();
|
|
15160
15189
|
this.updateReset();
|
|
15161
|
-
this.
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
this.
|
|
15165
|
-
|
|
15190
|
+
if (this.readOnly) {
|
|
15191
|
+
this.wrapper.classList.add(READONLY);
|
|
15192
|
+
}
|
|
15193
|
+
if (!this.visible) {
|
|
15194
|
+
this.wrapper.classList.add(HIDDEN);
|
|
15195
|
+
}
|
|
15196
|
+
if (this.enableRtl) {
|
|
15197
|
+
this.wrapper.classList.add(RTL$2);
|
|
15198
|
+
}
|
|
15199
|
+
if (this.enableAnimation) {
|
|
15200
|
+
this.wrapper.classList.add(ANIMATION);
|
|
15201
|
+
}
|
|
15166
15202
|
if (this.cssClass) {
|
|
15167
15203
|
addClass([this.wrapper], this.cssClass.split(' '));
|
|
15168
15204
|
}
|
|
15169
15205
|
this.updateTooltip();
|
|
15170
15206
|
this.wireKeyboardEvent();
|
|
15207
|
+
this.updateDisabled();
|
|
15171
15208
|
};
|
|
15172
15209
|
Rating.prototype.updateDisabled = function () {
|
|
15173
15210
|
this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
|
|
15174
15211
|
attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
|
|
15175
|
-
|
|
15176
|
-
this.updateResetButton();
|
|
15177
|
-
}
|
|
15212
|
+
this.updateResetButton();
|
|
15178
15213
|
};
|
|
15179
15214
|
Rating.prototype.updateResetButton = function () {
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
15215
|
+
if (this.allowReset) {
|
|
15216
|
+
var isDisabled = (this.value <= this.min) || this.disabled;
|
|
15217
|
+
this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
|
|
15218
|
+
attributes(this.resetElement, { 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
15219
|
+
}
|
|
15184
15220
|
};
|
|
15185
15221
|
Rating.prototype.renderItemList = function () {
|
|
15186
15222
|
var _this = this;
|
|
15187
15223
|
this.ratingItemList = this.createElement('div', {
|
|
15188
15224
|
className: ITEMLIST,
|
|
15189
|
-
id: this.element.id + '_item-list'
|
|
15190
|
-
attrs: { 'tabindex': '0' }
|
|
15225
|
+
id: this.element.id + '_item-list'
|
|
15191
15226
|
});
|
|
15192
15227
|
attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
|
|
15193
15228
|
this.wrapper.appendChild(this.ratingItemList);
|
|
@@ -15236,7 +15271,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15236
15271
|
var ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
|
|
15237
15272
|
var spanItem = this.createElement('span', { className: 'e-rating-item' });
|
|
15238
15273
|
var ratingValue = this.getRatingValue(this.value, i);
|
|
15239
|
-
this.renderItemContent(spanItem, ratingValue, i);
|
|
15274
|
+
this.renderItemContent(spanItem, ratingValue, i, false);
|
|
15240
15275
|
ratingItemContainer.appendChild(spanItem);
|
|
15241
15276
|
this.wireItemsEvents(ratingItemContainer, i + 1);
|
|
15242
15277
|
this.itemElements.push(ratingItemContainer);
|
|
@@ -15246,12 +15281,9 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15246
15281
|
});
|
|
15247
15282
|
}
|
|
15248
15283
|
attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
|
|
15249
|
-
|
|
15250
|
-
attributes(this.ratingItemList, { 'tabindex': '-1' });
|
|
15251
|
-
}
|
|
15284
|
+
this.updateItemValue(false);
|
|
15252
15285
|
};
|
|
15253
15286
|
Rating.prototype.renderItemContent = function (spanEle, val, index, isrerender) {
|
|
15254
|
-
if (isrerender === void 0) { isrerender = false; }
|
|
15255
15287
|
if (isrerender) {
|
|
15256
15288
|
this.removeItemContent(spanEle);
|
|
15257
15289
|
}
|
|
@@ -15290,17 +15322,12 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15290
15322
|
}
|
|
15291
15323
|
};
|
|
15292
15324
|
Rating.prototype.updateMinValue = function () {
|
|
15293
|
-
this.min
|
|
15325
|
+
this.setProperties({ min: this.validateValue(this.min) }, true);
|
|
15294
15326
|
if (this.min > 0 && this.value < this.min) {
|
|
15295
15327
|
this.triggerChange(null, this.min, false);
|
|
15296
15328
|
}
|
|
15297
15329
|
attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
|
|
15298
15330
|
};
|
|
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
15331
|
Rating.prototype.validateValue = function (currentValue) {
|
|
15305
15332
|
if (currentValue > this.itemsCount) {
|
|
15306
15333
|
currentValue = this.itemsCount;
|
|
@@ -15319,7 +15346,11 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15319
15346
|
return (this.enableSingleSelection) ? (((value > i) && (value <= i + 1)) ? 1 : 0) :
|
|
15320
15347
|
(value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
|
|
15321
15348
|
};
|
|
15322
|
-
Rating.prototype.updateItemValue = function () {
|
|
15349
|
+
Rating.prototype.updateItemValue = function (isUpdate) {
|
|
15350
|
+
if (isUpdate === void 0) { isUpdate = true; }
|
|
15351
|
+
if (isUpdate && this.isReact) {
|
|
15352
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15353
|
+
}
|
|
15323
15354
|
for (var i = 0; i < this.itemsCount; i++) {
|
|
15324
15355
|
var itemElement = this.itemElements[parseInt(i.toString(), 10)];
|
|
15325
15356
|
itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
|
|
@@ -15333,13 +15364,16 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15333
15364
|
else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
|
|
15334
15365
|
itemElement.classList.add(SELECTEDVALUE);
|
|
15335
15366
|
}
|
|
15336
|
-
|
|
15367
|
+
if (isUpdate) {
|
|
15368
|
+
this.updateItemContent(ratingValue, i);
|
|
15369
|
+
}
|
|
15337
15370
|
itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
|
|
15338
15371
|
itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
|
|
15339
15372
|
}
|
|
15340
|
-
if (
|
|
15341
|
-
this.
|
|
15373
|
+
if (isUpdate) {
|
|
15374
|
+
this.renderReactTemplates();
|
|
15342
15375
|
}
|
|
15376
|
+
this.updateResetButton();
|
|
15343
15377
|
attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
|
|
15344
15378
|
attributes(this.element, { 'value': this.value.toString() });
|
|
15345
15379
|
};
|
|
@@ -15349,26 +15383,31 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15349
15383
|
}
|
|
15350
15384
|
var spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
|
|
15351
15385
|
if (this.fullTemplate && ratingValue === 1) {
|
|
15352
|
-
if (spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15386
|
+
if (!this.isReact && spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15353
15387
|
return;
|
|
15354
15388
|
}
|
|
15355
15389
|
this.removeItemContent(spanEle);
|
|
15356
15390
|
spanEle.classList.add(FULLTEMPLATE);
|
|
15357
|
-
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
|
|
15391
|
+
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate' + index), this.isStringTemplate)[0]);
|
|
15358
15392
|
}
|
|
15359
15393
|
else if (this.emptyTemplate) {
|
|
15394
|
+
if (!this.isReact && spanEle.classList.contains(EMPTYTEMPLATE)) {
|
|
15395
|
+
return;
|
|
15396
|
+
}
|
|
15360
15397
|
this.removeItemContent(spanEle);
|
|
15361
15398
|
spanEle.classList.add(EMPTYTEMPLATE);
|
|
15362
|
-
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, '
|
|
15399
|
+
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate' + index), this.isStringTemplate)[0]);
|
|
15363
15400
|
}
|
|
15364
15401
|
else {
|
|
15365
15402
|
this.removeItemContent(spanEle);
|
|
15366
15403
|
addClass([spanEle], ICONCSS.split(' '));
|
|
15367
15404
|
}
|
|
15368
|
-
this.renderReactTemplates();
|
|
15369
15405
|
};
|
|
15370
15406
|
Rating.prototype.updateTooltipContent = function (isChange) {
|
|
15371
15407
|
if (this.showTooltip) {
|
|
15408
|
+
if (this.isReact) {
|
|
15409
|
+
this.clearTemplate(['ratingTooltipTemplate']);
|
|
15410
|
+
}
|
|
15372
15411
|
var content = void 0;
|
|
15373
15412
|
if (this.tooltipTemplate) {
|
|
15374
15413
|
var templateFunction = this.getTemplateString(this.tooltipTemplate);
|
|
@@ -15414,21 +15453,27 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15414
15453
|
Rating.prototype.updateLabel = function () {
|
|
15415
15454
|
if (this.showLabel) {
|
|
15416
15455
|
if (this.labelTemplate) {
|
|
15456
|
+
if (this.isReact) {
|
|
15457
|
+
this.clearTemplate(['ratingLabelTemplate']);
|
|
15458
|
+
}
|
|
15417
15459
|
if (this.spanLabel.firstChild) {
|
|
15418
15460
|
this.spanLabel.removeChild(this.spanLabel.firstChild);
|
|
15419
15461
|
}
|
|
15420
15462
|
var templateFunction = this.getTemplateString(this.labelTemplate);
|
|
15421
15463
|
this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
|
|
15464
|
+
this.renderReactTemplates();
|
|
15422
15465
|
}
|
|
15423
15466
|
else {
|
|
15424
15467
|
this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
|
|
15425
15468
|
}
|
|
15426
|
-
this.renderReactTemplates();
|
|
15427
15469
|
}
|
|
15428
15470
|
};
|
|
15429
15471
|
Rating.prototype.updateReset = function () {
|
|
15430
15472
|
if (this.allowReset) {
|
|
15431
|
-
this.resetElement = this.createElement('span', {
|
|
15473
|
+
this.resetElement = this.createElement('span', {
|
|
15474
|
+
className: RESET,
|
|
15475
|
+
attrs: { 'aria-label': 'resetbutton', 'role': 'button' }
|
|
15476
|
+
});
|
|
15432
15477
|
this.updateResetButton();
|
|
15433
15478
|
EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
|
|
15434
15479
|
this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
|
|
@@ -15467,9 +15512,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15467
15512
|
this.triggerChange(e, this.currentValue);
|
|
15468
15513
|
this.updateItemValue();
|
|
15469
15514
|
this.updateLabel();
|
|
15470
|
-
|
|
15471
|
-
this.updateResetButton();
|
|
15472
|
-
}
|
|
15515
|
+
this.updateResetButton();
|
|
15473
15516
|
};
|
|
15474
15517
|
Rating.prototype.updateValueChange = function (e, val, isInteracted) {
|
|
15475
15518
|
if (isInteracted === void 0) { isInteracted = true; }
|
|
@@ -15547,6 +15590,8 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15547
15590
|
/**
|
|
15548
15591
|
* Reset’s the value to minimum.
|
|
15549
15592
|
*
|
|
15593
|
+
* {% codeBlock src='rating/reset/index.md' %}{% endcodeBlock %}
|
|
15594
|
+
*
|
|
15550
15595
|
* @returns {void}
|
|
15551
15596
|
*/
|
|
15552
15597
|
Rating.prototype.reset = function () {
|
|
@@ -15599,12 +15644,13 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15599
15644
|
Math.round(0.1 * 10) / 10;
|
|
15600
15645
|
currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
|
|
15601
15646
|
this.updateValueChange(e, (currentValue));
|
|
15602
|
-
|
|
15603
|
-
this.updateResetButton();
|
|
15604
|
-
}
|
|
15647
|
+
this.updateResetButton();
|
|
15605
15648
|
}
|
|
15606
15649
|
};
|
|
15607
15650
|
Rating.prototype.updateContent = function () {
|
|
15651
|
+
if (this.isReact) {
|
|
15652
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15653
|
+
}
|
|
15608
15654
|
for (var i = 0; i < this.itemsCount; i++) {
|
|
15609
15655
|
var itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
|
|
15610
15656
|
this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
|
|
@@ -15643,6 +15689,7 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15643
15689
|
_super.prototype.destroy.call(this);
|
|
15644
15690
|
// unwires the events and detach the li elements
|
|
15645
15691
|
this.removeItemElements();
|
|
15692
|
+
this.clearTemplate();
|
|
15646
15693
|
if (this.spanLabel) {
|
|
15647
15694
|
remove(this.spanLabel);
|
|
15648
15695
|
this.spanLabel = null;
|
|
@@ -15721,7 +15768,9 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15721
15768
|
this.updateTooltip();
|
|
15722
15769
|
break;
|
|
15723
15770
|
case 'precision':
|
|
15724
|
-
this.
|
|
15771
|
+
this.updateMinValue();
|
|
15772
|
+
this.triggerChange(null, this.value, false);
|
|
15773
|
+
this.updateItemValue();
|
|
15725
15774
|
this.updateLabel();
|
|
15726
15775
|
break;
|
|
15727
15776
|
case 'enableSingleSelection':
|
|
@@ -15742,7 +15791,6 @@ var Rating = /** @__PURE__ @class */ (function (_super) {
|
|
|
15742
15791
|
case 'itemsCount':
|
|
15743
15792
|
this.removeItemElements();
|
|
15744
15793
|
this.renderItems();
|
|
15745
|
-
this.updateItemValue();
|
|
15746
15794
|
this.updateLabel();
|
|
15747
15795
|
break;
|
|
15748
15796
|
}
|