@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
|
@@ -296,7 +296,7 @@ var Input;
|
|
|
296
296
|
}
|
|
297
297
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
298
298
|
function wireClearBtnEvents(element, button, container) {
|
|
299
|
-
if (isBindClearAction
|
|
299
|
+
if (isBindClearAction === undefined || isBindClearAction) {
|
|
300
300
|
button.addEventListener('click', (event) => {
|
|
301
301
|
if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
|
|
302
302
|
event.preventDefault();
|
|
@@ -425,7 +425,7 @@ var Input;
|
|
|
425
425
|
* @param {HTMLElement} container - The parent element which is need to get the label span to calculate width
|
|
426
426
|
*/
|
|
427
427
|
function calculateWidth(element, container, moduleName) {
|
|
428
|
-
|
|
428
|
+
const elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'), 10);
|
|
429
429
|
if (!isNullOrUndefined(container.getElementsByClassName('e-float-text-content')[0])) {
|
|
430
430
|
if (container.getElementsByClassName('e-float-text-content')[0].classList.contains('e-float-text-overflow')) {
|
|
431
431
|
container.getElementsByClassName('e-float-text-content')[0].classList.remove('e-float-text-overflow');
|
|
@@ -625,10 +625,10 @@ var Input;
|
|
|
625
625
|
parentElement.classList.add(CLASSNAMES.DISABLE);
|
|
626
626
|
}
|
|
627
627
|
if (key === 'placeholder' && parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
|
|
628
|
-
parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[key];
|
|
628
|
+
parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[`${key}`];
|
|
629
629
|
}
|
|
630
630
|
else {
|
|
631
|
-
element.setAttribute(key, attrs[key]);
|
|
631
|
+
element.setAttribute(key, attrs[`${key}`]);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
}
|
|
@@ -730,7 +730,7 @@ var Input;
|
|
|
730
730
|
*/
|
|
731
731
|
function setRipple(isRipple, inputObj) {
|
|
732
732
|
for (let i = 0; i < inputObj.length; i++) {
|
|
733
|
-
_internalRipple(isRipple, inputObj[i].container);
|
|
733
|
+
_internalRipple(isRipple, inputObj[parseInt(i.toString())].container);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
Input.setRipple = setRipple;
|
|
@@ -741,14 +741,14 @@ var Input;
|
|
|
741
741
|
container.querySelectorAll('.e-input-group-icon') : argsButton;
|
|
742
742
|
if (isRipple && buttons.length > 0) {
|
|
743
743
|
for (let index = 0; index < buttons.length; index++) {
|
|
744
|
-
buttons[index].addEventListener('mousedown', _onMouseDownRipple, false);
|
|
745
|
-
buttons[index].addEventListener('mouseup', _onMouseUpRipple, false);
|
|
744
|
+
buttons[parseInt(index.toString())].addEventListener('mousedown', _onMouseDownRipple, false);
|
|
745
|
+
buttons[parseInt(index.toString())].addEventListener('mouseup', _onMouseUpRipple, false);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
else if (buttons.length > 0) {
|
|
749
749
|
for (let index = 0; index < buttons.length; index++) {
|
|
750
|
-
buttons[index].removeEventListener('mousedown', _onMouseDownRipple, this);
|
|
751
|
-
buttons[index].removeEventListener('mouseup', _onMouseUpRipple, this);
|
|
750
|
+
buttons[parseInt(index.toString())].removeEventListener('mousedown', _onMouseDownRipple, this);
|
|
751
|
+
buttons[parseInt(index.toString())].removeEventListener('mouseup', _onMouseUpRipple, this);
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
}
|
|
@@ -834,7 +834,7 @@ var Input;
|
|
|
834
834
|
const result = container.querySelectorAll(inputElement.tagName + ' ~ *');
|
|
835
835
|
innerWrapper.appendChild(inputElement);
|
|
836
836
|
for (let i = 0; i < result.length; i++) {
|
|
837
|
-
innerWrapper.appendChild(result[i]);
|
|
837
|
+
innerWrapper.appendChild(result[parseInt(i.toString())]);
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
innerWrapper.parentNode.insertBefore(button, innerWrapper);
|
|
@@ -1022,7 +1022,7 @@ let NumericTextBox = class NumericTextBox extends Component {
|
|
|
1022
1022
|
if (this.element.hasAttribute('data-val')) {
|
|
1023
1023
|
this.element.setAttribute('data-val', 'false');
|
|
1024
1024
|
}
|
|
1025
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
1025
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
1026
1026
|
this.enabled = false;
|
|
1027
1027
|
}
|
|
1028
1028
|
this.renderComplete();
|
|
@@ -1709,8 +1709,8 @@ let NumericTextBox = class NumericTextBox extends Component {
|
|
|
1709
1709
|
return true;
|
|
1710
1710
|
}
|
|
1711
1711
|
let currentChar = String.fromCharCode(event.which);
|
|
1712
|
-
|
|
1713
|
-
|
|
1712
|
+
const decimalSeparator = getValue('decimal', getNumericObject(this.locale));
|
|
1713
|
+
const isAlterNumPadDecimalChar = event.code === 'NumpadDecimal' && currentChar !== decimalSeparator;
|
|
1714
1714
|
//EJ2-59813-replace the culture decimal separator value with numberpad decimal separator value when culture decimal separator and numberpad decimal separator are different
|
|
1715
1715
|
if (isAlterNumPadDecimalChar) {
|
|
1716
1716
|
currentChar = decimalSeparator;
|
|
@@ -1747,7 +1747,7 @@ let NumericTextBox = class NumericTextBox extends Component {
|
|
|
1747
1747
|
if (this.decimals && this.validateDecimalOnType) {
|
|
1748
1748
|
fractionRule = '{0,' + this.decimals + '}';
|
|
1749
1749
|
}
|
|
1750
|
-
|
|
1750
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
1751
1751
|
return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
|
|
1752
1752
|
')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
|
|
1753
1753
|
}
|
|
@@ -1857,8 +1857,8 @@ let NumericTextBox = class NumericTextBox extends Component {
|
|
|
1857
1857
|
}
|
|
1858
1858
|
touchMoveOnSpinner(event) {
|
|
1859
1859
|
let target;
|
|
1860
|
-
if (event.type ===
|
|
1861
|
-
|
|
1860
|
+
if (event.type === 'touchmove') {
|
|
1861
|
+
const touchEvent = event.touches;
|
|
1862
1862
|
target = touchEvent.length && document.elementFromPoint(touchEvent[0].pageX, touchEvent[0].pageY);
|
|
1863
1863
|
}
|
|
1864
1864
|
else {
|
|
@@ -2318,7 +2318,7 @@ function createMask() {
|
|
|
2318
2318
|
if (!isNullOrUndefined(this.customCharacters)) {
|
|
2319
2319
|
for (let i = 0; i < this.promptMask.length; i++) {
|
|
2320
2320
|
if (!isNullOrUndefined(this.customCharacters[this.promptMask[i]])) {
|
|
2321
|
-
|
|
2321
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
2322
2322
|
this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
@@ -2617,7 +2617,7 @@ function maskInputBlurHandler(event) {
|
|
|
2617
2617
|
event: event,
|
|
2618
2618
|
value: this.value,
|
|
2619
2619
|
maskedValue: this.element.value,
|
|
2620
|
-
container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
|
|
2620
|
+
container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
|
|
2621
2621
|
};
|
|
2622
2622
|
this.trigger('blur', this.blurEventArgs);
|
|
2623
2623
|
if (this.mask) {
|
|
@@ -3078,13 +3078,13 @@ function validateValue(key, isCtrlKey, event) {
|
|
|
3078
3078
|
const customValStr = this.customCharacters[`${curMask}`];
|
|
3079
3079
|
const customValArr = customValStr.split(',');
|
|
3080
3080
|
for (let i = 0; i < customValArr.length; i++) {
|
|
3081
|
-
|
|
3081
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3082
3082
|
if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
|
|
3083
3083
|
allowText = true;
|
|
3084
3084
|
break;
|
|
3085
3085
|
}
|
|
3086
3086
|
}
|
|
3087
|
-
|
|
3087
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3088
3088
|
}
|
|
3089
3089
|
else if (!isNullOrUndefined(this.regExpCollec[`${curMask}`]) && keyValue.match(new RegExp(this.regExpCollec[`${curMask}`]))
|
|
3090
3090
|
&& this.promptMask[startIndex] === this.promptChar) {
|
|
@@ -3092,7 +3092,7 @@ function validateValue(key, isCtrlKey, event) {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
|
|
3094
3094
|
&& this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
|
|
3095
|
-
|
|
3095
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3096
3096
|
&& keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
|
|
3097
3097
|
allowText = true;
|
|
3098
3098
|
}
|
|
@@ -3744,13 +3744,13 @@ let MaskedTextBox = class MaskedTextBox extends Component {
|
|
|
3744
3744
|
else {
|
|
3745
3745
|
this.promptChar = '_';
|
|
3746
3746
|
}
|
|
3747
|
-
|
|
3747
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3748
3748
|
let value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3749
3749
|
if (this.promptMask === this.element.value) {
|
|
3750
|
-
|
|
3750
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3751
3751
|
value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3752
3752
|
}
|
|
3753
|
-
|
|
3753
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
3754
3754
|
this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
|
|
3755
3755
|
this.undoCollec = this.redoCollec = [];
|
|
3756
3756
|
setElementValue.call(this, value);
|
|
@@ -4155,6 +4155,7 @@ let Slider = class Slider extends Component {
|
|
|
4155
4155
|
}
|
|
4156
4156
|
/**
|
|
4157
4157
|
* To Initialize the control rendering
|
|
4158
|
+
*
|
|
4158
4159
|
* @private
|
|
4159
4160
|
*/
|
|
4160
4161
|
render() {
|
|
@@ -4164,7 +4165,7 @@ let Slider = class Slider extends Component {
|
|
|
4164
4165
|
this.setZindex();
|
|
4165
4166
|
this.renderComplete();
|
|
4166
4167
|
if (this.element.tagName === 'EJS-SLIDER') {
|
|
4167
|
-
if (this.getTheme(this.sliderContainer) ==
|
|
4168
|
+
if (this.getTheme(this.sliderContainer) == 'none') {
|
|
4168
4169
|
setTimeout(() => {
|
|
4169
4170
|
this.refresh();
|
|
4170
4171
|
}, 0);
|
|
@@ -4215,6 +4216,7 @@ let Slider = class Slider extends Component {
|
|
|
4215
4216
|
}
|
|
4216
4217
|
/**
|
|
4217
4218
|
* Initialize the rendering
|
|
4219
|
+
*
|
|
4218
4220
|
* @private
|
|
4219
4221
|
*/
|
|
4220
4222
|
initRender() {
|
|
@@ -4807,7 +4809,6 @@ let Slider = class Slider extends Component {
|
|
|
4807
4809
|
this.sliderContainer.classList.add(classNames.materialSlider);
|
|
4808
4810
|
this.tooltipValue();
|
|
4809
4811
|
this.tooltipObj.animation.close.effect = 'None';
|
|
4810
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
|
|
4811
4812
|
this.tooltipObj.open(this.firstHandle);
|
|
4812
4813
|
}
|
|
4813
4814
|
}
|
|
@@ -5632,6 +5633,7 @@ let Slider = class Slider extends Component {
|
|
|
5632
5633
|
}
|
|
5633
5634
|
/**
|
|
5634
5635
|
* It is used to reposition slider.
|
|
5636
|
+
*
|
|
5635
5637
|
* @returns void
|
|
5636
5638
|
*/
|
|
5637
5639
|
reposition() {
|
|
@@ -5881,7 +5883,12 @@ let Slider = class Slider extends Component {
|
|
|
5881
5883
|
focusedElement.classList.remove(classNames.sliderTabHandle);
|
|
5882
5884
|
}
|
|
5883
5885
|
let handle = this.activeHandle === 1 ? this.firstHandle : this.secondHandle;
|
|
5884
|
-
|
|
5886
|
+
let behindElement;
|
|
5887
|
+
if ((evt.type === 'click' || evt.type === 'mousedown') && evt.target === handle) {
|
|
5888
|
+
const { clientX: eventX, clientY: eventY } = evt;
|
|
5889
|
+
behindElement = document.elementFromPoint(eventX, eventY);
|
|
5890
|
+
}
|
|
5891
|
+
if (evt.target === handle && behindElement != handle) {
|
|
5885
5892
|
if (this.isMaterial && !this.tooltip.isVisible &&
|
|
5886
5893
|
!this.getHandle().classList.contains(classNames.sliderTabHandle)) {
|
|
5887
5894
|
this.materialChange();
|
|
@@ -6131,7 +6138,6 @@ let Slider = class Slider extends Component {
|
|
|
6131
6138
|
openTooltip(target) {
|
|
6132
6139
|
if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
|
|
6133
6140
|
this.tooltipValue();
|
|
6134
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
|
|
6135
6141
|
this.tooltipObj.open(target);
|
|
6136
6142
|
this.tooltipTarget = target;
|
|
6137
6143
|
}
|
|
@@ -6450,6 +6456,7 @@ let Slider = class Slider extends Component {
|
|
|
6450
6456
|
}
|
|
6451
6457
|
/**
|
|
6452
6458
|
* Get the properties to be maintained in the persisted state.
|
|
6459
|
+
*
|
|
6453
6460
|
* @private
|
|
6454
6461
|
*/
|
|
6455
6462
|
getPersistData() {
|
|
@@ -6459,6 +6466,7 @@ let Slider = class Slider extends Component {
|
|
|
6459
6466
|
/**
|
|
6460
6467
|
* Removes the component from the DOM and detaches all its related event handlers.
|
|
6461
6468
|
* Also it removes the attributes and classes.
|
|
6469
|
+
*
|
|
6462
6470
|
* @method destroy
|
|
6463
6471
|
* @return {void}
|
|
6464
6472
|
*/
|
|
@@ -6480,6 +6488,7 @@ let Slider = class Slider extends Component {
|
|
|
6480
6488
|
}
|
|
6481
6489
|
/**
|
|
6482
6490
|
* Calls internally if any of the property value is changed.
|
|
6491
|
+
*
|
|
6483
6492
|
* @private
|
|
6484
6493
|
*/
|
|
6485
6494
|
// tslint:disable-next-line
|
|
@@ -6695,6 +6704,7 @@ let Slider = class Slider extends Component {
|
|
|
6695
6704
|
}
|
|
6696
6705
|
/**
|
|
6697
6706
|
* Gets the component name
|
|
6707
|
+
*
|
|
6698
6708
|
* @private
|
|
6699
6709
|
*/
|
|
6700
6710
|
getModuleName() {
|
|
@@ -6796,6 +6806,7 @@ const regex = {
|
|
|
6796
6806
|
/* eslint-disable no-useless-escape */
|
|
6797
6807
|
EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +
|
|
6798
6808
|
'|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),
|
|
6809
|
+
/* eslint-disable-next-line security/detect-unsafe-regex */
|
|
6799
6810
|
URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,
|
|
6800
6811
|
DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),
|
|
6801
6812
|
DIGITS: new RegExp('^[0-9]*$'),
|
|
@@ -6910,10 +6921,10 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
6910
6921
|
if (name) {
|
|
6911
6922
|
// eslint-disable-next-line no-prototype-builtins
|
|
6912
6923
|
if (this.rules.hasOwnProperty(name)) {
|
|
6913
|
-
extend(this.rules[name], rules, {});
|
|
6924
|
+
extend(this.rules[`${name}`], rules, {});
|
|
6914
6925
|
}
|
|
6915
6926
|
else {
|
|
6916
|
-
this.rules[name] = rules;
|
|
6927
|
+
this.rules[`${name}`] = rules;
|
|
6917
6928
|
}
|
|
6918
6929
|
}
|
|
6919
6930
|
}
|
|
@@ -6929,12 +6940,12 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
6929
6940
|
if (!name && !rules) {
|
|
6930
6941
|
this.rules = {};
|
|
6931
6942
|
}
|
|
6932
|
-
else if (this.rules[name] && !rules) {
|
|
6933
|
-
delete this.rules[name];
|
|
6943
|
+
else if (this.rules[`${name}`] && !rules) {
|
|
6944
|
+
delete this.rules[`${name}`];
|
|
6934
6945
|
}
|
|
6935
|
-
else if (!isNullOrUndefined(this.rules[name] && rules)) {
|
|
6946
|
+
else if (!isNullOrUndefined(this.rules[`${name}`] && rules)) {
|
|
6936
6947
|
for (let i = 0; i < rules.length; i++) {
|
|
6937
|
-
delete this.rules[name][rules[i]];
|
|
6948
|
+
delete this.rules[`${name}`][rules[parseInt(i.toString())]];
|
|
6938
6949
|
}
|
|
6939
6950
|
}
|
|
6940
6951
|
else {
|
|
@@ -7028,7 +7039,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7028
7039
|
for (const key of Object.keys(this.defaultMessages)) {
|
|
7029
7040
|
this.l10n.setLocale(this.locale);
|
|
7030
7041
|
const value = this.l10n.getConstant(key);
|
|
7031
|
-
this.localyMessage[key] = value;
|
|
7042
|
+
this.localyMessage[`${key}`] = value;
|
|
7032
7043
|
}
|
|
7033
7044
|
}
|
|
7034
7045
|
/**
|
|
@@ -7174,7 +7185,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7174
7185
|
let customMessage;
|
|
7175
7186
|
if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {
|
|
7176
7187
|
this.getInputElement(input.name);
|
|
7177
|
-
customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);
|
|
7188
|
+
customMessage = this.getErrorMessage(this.rules[input.name][`${ruleName}`], ruleName);
|
|
7178
7189
|
}
|
|
7179
7190
|
if (message) {
|
|
7180
7191
|
value = [value, message];
|
|
@@ -7185,7 +7196,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7185
7196
|
else if (customMessage) {
|
|
7186
7197
|
value = [value, customMessage];
|
|
7187
7198
|
}
|
|
7188
|
-
ruleCon[ruleName] = value;
|
|
7199
|
+
ruleCon[`${ruleName}`] = value;
|
|
7189
7200
|
}
|
|
7190
7201
|
// Wire events to the form elements
|
|
7191
7202
|
wireEvents() {
|
|
@@ -7276,10 +7287,10 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7276
7287
|
}
|
|
7277
7288
|
// Validate each rule based on input element name
|
|
7278
7289
|
validateRules(name) {
|
|
7279
|
-
if (!this.rules[name]) {
|
|
7290
|
+
if (!this.rules[`${name}`]) {
|
|
7280
7291
|
return;
|
|
7281
7292
|
}
|
|
7282
|
-
const rules = Object.keys(this.rules[name]);
|
|
7293
|
+
const rules = Object.keys(this.rules[`${name}`]);
|
|
7283
7294
|
let hiddenType = false;
|
|
7284
7295
|
let validateHiddenType = false;
|
|
7285
7296
|
const vhPos = rules.indexOf('validateHidden');
|
|
@@ -7300,7 +7311,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7300
7311
|
}
|
|
7301
7312
|
this.getErrorElement(name);
|
|
7302
7313
|
for (const rule of rules) {
|
|
7303
|
-
const errorMessage = this.getErrorMessage(this.rules[name][rule], rule);
|
|
7314
|
+
const errorMessage = this.getErrorMessage(this.rules[`${name}`][`${rule}`], rule);
|
|
7304
7315
|
const errorRule = { name: name, message: errorMessage };
|
|
7305
7316
|
const eventArgs = {
|
|
7306
7317
|
inputName: name,
|
|
@@ -7346,7 +7357,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7346
7357
|
}
|
|
7347
7358
|
// Update the optional validation status
|
|
7348
7359
|
optionalValidationStatus(name, refer) {
|
|
7349
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7360
|
+
if (!this.rules[`${name}`][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7350
7361
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7351
7362
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7352
7363
|
refer.status = '';
|
|
@@ -7355,9 +7366,9 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7355
7366
|
}
|
|
7356
7367
|
// Check the input element whether it's value satisfy the validation rule or not
|
|
7357
7368
|
isValid(name, rule) {
|
|
7358
|
-
const params = this.rules[name][rule];
|
|
7369
|
+
const params = this.rules[`${name}`][`${rule}`];
|
|
7359
7370
|
const param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
|
|
7360
|
-
const currentRule = this.rules[name][rule];
|
|
7371
|
+
const currentRule = this.rules[`${name}`][`${rule}`];
|
|
7361
7372
|
const args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };
|
|
7362
7373
|
this.trigger('validationBegin', args);
|
|
7363
7374
|
if (!args.param && rule === 'required') {
|
|
@@ -7374,7 +7385,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7374
7385
|
return selectAll('input[name="' + name + '"]:checked', this.element).length > 0;
|
|
7375
7386
|
}
|
|
7376
7387
|
else {
|
|
7377
|
-
return FormValidator_1.checkValidator[rule](args);
|
|
7388
|
+
return FormValidator_1.checkValidator[`${rule}`](args);
|
|
7378
7389
|
}
|
|
7379
7390
|
}
|
|
7380
7391
|
// Return default error message or custom error message
|
|
@@ -7382,12 +7393,12 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7382
7393
|
let message = this.inputElement.getAttribute('data-' + rule + '-message') ?
|
|
7383
7394
|
this.inputElement.getAttribute('data-' + rule + '-message') :
|
|
7384
7395
|
(ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :
|
|
7385
|
-
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];
|
|
7396
|
+
(Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[`${rule}`] : this.defaultMessages[`${rule}`];
|
|
7386
7397
|
const formats = message.match(/{(\d)}/g);
|
|
7387
7398
|
if (!isNullOrUndefined(formats)) {
|
|
7388
7399
|
for (let i = 0; i < formats.length; i++) {
|
|
7389
|
-
const value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;
|
|
7390
|
-
message = message.replace(formats[i], value);
|
|
7400
|
+
const value = ruleValue instanceof Array ? ruleValue[parseInt(i.toString())] : ruleValue;
|
|
7401
|
+
message = message.replace(formats[parseInt(i.toString())], value);
|
|
7391
7402
|
}
|
|
7392
7403
|
}
|
|
7393
7404
|
return message;
|
|
@@ -7439,7 +7450,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7439
7450
|
// Remove existing rule from errorRules object
|
|
7440
7451
|
removeErrorRules(name) {
|
|
7441
7452
|
for (let i = 0; i < this.errorRules.length; i++) {
|
|
7442
|
-
const rule = this.errorRules[i];
|
|
7453
|
+
const rule = this.errorRules[parseInt(i.toString())];
|
|
7443
7454
|
if (rule.name === name) {
|
|
7444
7455
|
this.errorRules.splice(i, 1);
|
|
7445
7456
|
}
|
|
@@ -7463,7 +7474,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
|
|
|
7463
7474
|
}
|
|
7464
7475
|
// Check whether the input element have required rule and its value is not empty
|
|
7465
7476
|
checkRequired(name) {
|
|
7466
|
-
if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7477
|
+
if (!this.rules[`${name}`][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
|
|
7467
7478
|
this.infoElement.innerHTML = this.inputElement.value;
|
|
7468
7479
|
this.infoElement.setAttribute('aria-invalid', 'false');
|
|
7469
7480
|
this.hideMessage(name);
|
|
@@ -7541,6 +7552,7 @@ FormValidator.checkValidator = {
|
|
|
7541
7552
|
}
|
|
7542
7553
|
},
|
|
7543
7554
|
regex: (option) => {
|
|
7555
|
+
/* eslint-disable-next-line security/detect-non-literal-regexp */
|
|
7544
7556
|
return new RegExp(option.param).test(option.value);
|
|
7545
7557
|
},
|
|
7546
7558
|
equalTo: (option) => {
|
|
@@ -8472,7 +8484,7 @@ let Uploader = class Uploader extends Component {
|
|
|
8472
8484
|
/* istanbul ignore next */
|
|
8473
8485
|
onPasteFile(event) {
|
|
8474
8486
|
const item = event.clipboardData.items;
|
|
8475
|
-
if (event.type
|
|
8487
|
+
if (event.type === 'paste' && this.browserName !== 'msie' && this.browserName !== 'edge' && this.browserName !== 'safari') {
|
|
8476
8488
|
this.element.files = event.clipboardData.files;
|
|
8477
8489
|
}
|
|
8478
8490
|
if (item.length !== 1) {
|
|
@@ -8830,15 +8842,15 @@ let Uploader = class Uploader extends Component {
|
|
|
8830
8842
|
}
|
|
8831
8843
|
if (this.enableHtmlSanitizer) {
|
|
8832
8844
|
for (let i = 0; i < fileData.length; i++) {
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
if (sanitizeFileName
|
|
8836
|
-
|
|
8845
|
+
const sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
|
|
8846
|
+
const sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[parseInt(i.toString())].name);
|
|
8847
|
+
if (sanitizeFileName !== fileData[parseInt(i.toString())].name) {
|
|
8848
|
+
const encodedFileName = targetFiles[parseInt(i.toString())].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
|
|
8837
8849
|
return '&#' + i.charCodeAt(0) + ';';
|
|
8838
8850
|
});
|
|
8839
|
-
fileData[i].name = encodedFileName;
|
|
8840
|
-
fileData[i].status = this.localizedTexts('invalidFileName');
|
|
8841
|
-
fileData[i].statusCode = '0';
|
|
8851
|
+
fileData[parseInt(i.toString())].name = encodedFileName;
|
|
8852
|
+
fileData[parseInt(i.toString())].status = this.localizedTexts('invalidFileName');
|
|
8853
|
+
fileData[parseInt(i.toString())].statusCode = '0';
|
|
8842
8854
|
}
|
|
8843
8855
|
}
|
|
8844
8856
|
}
|
|
@@ -10058,13 +10070,13 @@ let Uploader = class Uploader extends Component {
|
|
|
10058
10070
|
this.updateStatus(metaData.file, this.localizedTexts('fileUploadCancel'), '5');
|
|
10059
10071
|
this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
|
|
10060
10072
|
this.removeProgressbar(liElement, 'failure');
|
|
10061
|
-
deleteIcon && deleteIcon.classList.remove(ABORT_ICON);
|
|
10062
|
-
deleteIcon && deleteIcon.classList.add(REMOVE_ICON);
|
|
10063
|
-
deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove'));
|
|
10073
|
+
(deleteIcon && deleteIcon.classList.remove(ABORT_ICON));
|
|
10074
|
+
(deleteIcon && deleteIcon.classList.add(REMOVE_ICON));
|
|
10075
|
+
(deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove')));
|
|
10064
10076
|
const pauseIcon = liElement.querySelector('.' + PAUSE_UPLOAD);
|
|
10065
|
-
pauseIcon && pauseIcon.classList.add(RETRY_ICON);
|
|
10066
|
-
pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD);
|
|
10067
|
-
pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry'));
|
|
10077
|
+
(pauseIcon && pauseIcon.classList.add(RETRY_ICON));
|
|
10078
|
+
(pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD));
|
|
10079
|
+
(pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry')));
|
|
10068
10080
|
if (!isNullOrUndefined(liElement) && !isNullOrUndefined(deleteIcon)
|
|
10069
10081
|
&& !isNullOrUndefined(liElement.querySelector('.e-spinner-pane'))) {
|
|
10070
10082
|
hideSpinner(spinnerTarget);
|
|
@@ -10321,7 +10333,7 @@ let Uploader = class Uploader extends Component {
|
|
|
10321
10333
|
}
|
|
10322
10334
|
if (!isNaN(Math.round((e.loaded / e.total) * 100)) && isNullOrUndefined(this.template) && metaData.file.statusCode !== '4') {
|
|
10323
10335
|
let progressVal;
|
|
10324
|
-
|
|
10336
|
+
const totalChunks = Math.ceil(metaData.file.size / this.asyncSettings.chunkSize) - 1;
|
|
10325
10337
|
if (this.asyncSettings.chunkSize && totalChunks) {
|
|
10326
10338
|
progressVal = Math.round(metaData.chunkIndex / totalChunks * 100);
|
|
10327
10339
|
this.changeProgressValue(liElement, progressVal.toString() + '%');
|
|
@@ -11142,7 +11154,7 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
11142
11154
|
wrapper.classList.add(RTL$1);
|
|
11143
11155
|
}
|
|
11144
11156
|
if (this.cssClass) {
|
|
11145
|
-
addClass([wrapper], this.cssClass.split(' '));
|
|
11157
|
+
addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11146
11158
|
}
|
|
11147
11159
|
this.tileRipple = rippleEffect(this.container, { selector: '.' + TILE });
|
|
11148
11160
|
this.ctrlBtnRipple = rippleEffect(this.container, { selector: '.e-btn' });
|
|
@@ -11201,7 +11213,7 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
11201
11213
|
const popupEle = this.getPopupEle();
|
|
11202
11214
|
addClass([popupEle], 'e-colorpicker-popup');
|
|
11203
11215
|
if (this.cssClass) {
|
|
11204
|
-
addClass([popupEle], this.cssClass.split(' '));
|
|
11216
|
+
addClass([popupEle], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
11205
11217
|
}
|
|
11206
11218
|
if (Browser.isDevice) {
|
|
11207
11219
|
const popupInst = this.getPopupInst();
|
|
@@ -11834,6 +11846,10 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
11834
11846
|
if (this.isPicker()) {
|
|
11835
11847
|
const dragHandler = this.getDragHandler();
|
|
11836
11848
|
EventHandler.add(dragHandler, 'keydown', this.pickerKeyDown, this);
|
|
11849
|
+
const ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
11850
|
+
if (ctrlBtn) {
|
|
11851
|
+
EventHandler.add(ctrlBtn, 'keydown', this.ctrlBtnKeyDown, this);
|
|
11852
|
+
}
|
|
11837
11853
|
EventHandler.add(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown, this);
|
|
11838
11854
|
if (this.modeSwitcher || this.showButtons) {
|
|
11839
11855
|
this.addCtrlSwitchEvent();
|
|
@@ -11855,6 +11871,16 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
11855
11871
|
EventHandler.add(ctrlSwitchBtn, 'click', this.btnClickHandler, this);
|
|
11856
11872
|
}
|
|
11857
11873
|
}
|
|
11874
|
+
ctrlBtnKeyDown(e) {
|
|
11875
|
+
if (e.keyCode === 13) {
|
|
11876
|
+
const applyBtn = select('.' + APPLY, this.container);
|
|
11877
|
+
if (applyBtn) {
|
|
11878
|
+
const cValue = this.rgbToHex(this.rgb);
|
|
11879
|
+
this.triggerChangeEvent(cValue);
|
|
11880
|
+
}
|
|
11881
|
+
this.splitBtn.element.focus();
|
|
11882
|
+
}
|
|
11883
|
+
}
|
|
11858
11884
|
pickerKeyDown(e) {
|
|
11859
11885
|
switch (e.keyCode) {
|
|
11860
11886
|
case 39:
|
|
@@ -11879,7 +11905,6 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
11879
11905
|
enterKeyHandler(value, e) {
|
|
11880
11906
|
this.triggerChangeEvent(value);
|
|
11881
11907
|
if (!this.inline) {
|
|
11882
|
-
this.closePopup(e);
|
|
11883
11908
|
this.splitBtn.element.focus();
|
|
11884
11909
|
}
|
|
11885
11910
|
}
|
|
@@ -12403,6 +12428,10 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
12403
12428
|
if (this.isPicker()) {
|
|
12404
12429
|
const dragHandler = this.getDragHandler();
|
|
12405
12430
|
EventHandler.remove(dragHandler, 'keydown', this.pickerKeyDown);
|
|
12431
|
+
const ctrlBtn = select('.' + CTRLBTN, this.container);
|
|
12432
|
+
if (ctrlBtn) {
|
|
12433
|
+
EventHandler.remove(ctrlBtn, 'keydown', this.ctrlBtnKeyDown);
|
|
12434
|
+
}
|
|
12406
12435
|
EventHandler.remove(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown);
|
|
12407
12436
|
if (this.modeSwitcher || this.showButtons) {
|
|
12408
12437
|
EventHandler.remove(select('.' + CTRLSWITCH, this.container), 'click', this.btnClickHandler);
|
|
@@ -12644,7 +12673,7 @@ let ColorPicker = class ColorPicker extends Component {
|
|
|
12644
12673
|
removeClass([wrapper, popupWrapper], oldProp.split(' '));
|
|
12645
12674
|
}
|
|
12646
12675
|
if (newProp) {
|
|
12647
|
-
addClass([wrapper, popupWrapper], newProp.split(' '));
|
|
12676
|
+
addClass([wrapper, popupWrapper], newProp.replace(/\s+/g, ' ').trim().split(' '));
|
|
12648
12677
|
}
|
|
12649
12678
|
}
|
|
12650
12679
|
changeRtlProps(newProp) {
|
|
@@ -13072,7 +13101,9 @@ let TextBox = class TextBox extends Component {
|
|
|
13072
13101
|
if (this.element.tagName !== 'TEXTAREA') {
|
|
13073
13102
|
this.element.setAttribute('type', this.type);
|
|
13074
13103
|
}
|
|
13075
|
-
this.
|
|
13104
|
+
if (this.type === 'text') {
|
|
13105
|
+
this.element.setAttribute('role', 'textbox');
|
|
13106
|
+
}
|
|
13076
13107
|
this.globalize = new Internationalization(this.locale);
|
|
13077
13108
|
const localeText = { placeholder: this.placeholder };
|
|
13078
13109
|
this.l10n = new L10n('textbox', localeText, this.locale);
|
|
@@ -13204,7 +13235,7 @@ let TextBox = class TextBox extends Component {
|
|
|
13204
13235
|
this.inputPreviousValue = this.value;
|
|
13205
13236
|
this.respectiveElement.defaultValue = this.respectiveElement.value;
|
|
13206
13237
|
Input.setWidth(this.width, this.textboxWrapper.container);
|
|
13207
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
13238
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
13208
13239
|
this.enabled = false;
|
|
13209
13240
|
}
|
|
13210
13241
|
this.renderComplete();
|
|
@@ -13399,8 +13430,8 @@ let TextBox = class TextBox extends Component {
|
|
|
13399
13430
|
this.inputPreviousValue = this.respectiveElement.value;
|
|
13400
13431
|
this.raiseChangeEvent(event, true);
|
|
13401
13432
|
if (closest(this.element, 'form')) {
|
|
13402
|
-
|
|
13403
|
-
|
|
13433
|
+
const element = this.element;
|
|
13434
|
+
const keyupEvent = document.createEvent('KeyboardEvent');
|
|
13404
13435
|
keyupEvent.initEvent('keyup', false, true);
|
|
13405
13436
|
element.dispatchEvent(keyupEvent);
|
|
13406
13437
|
}
|
|
@@ -13693,6 +13724,10 @@ class SignatureBase extends Component {
|
|
|
13693
13724
|
this.element.width = this.element.offsetWidth;
|
|
13694
13725
|
this.isResponsive = true;
|
|
13695
13726
|
}
|
|
13727
|
+
else if (this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1) {
|
|
13728
|
+
this.element.height = this.element.offsetHeight;
|
|
13729
|
+
this.element.width = this.element.offsetWidth;
|
|
13730
|
+
}
|
|
13696
13731
|
this.canvasContext.scale(1, 1);
|
|
13697
13732
|
this.canvasContext.fillStyle = this.strokeColor;
|
|
13698
13733
|
if (this.backgroundImage) {
|
|
@@ -13785,7 +13820,6 @@ class SignatureBase extends Component {
|
|
|
13785
13820
|
this.canvasContext.canvas.width = this.element.offsetWidth;
|
|
13786
13821
|
this.canvasContext.canvas.height = this.element.offsetHeight;
|
|
13787
13822
|
this.canvasContext.scale(1, 1);
|
|
13788
|
-
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
13789
13823
|
const pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
|
|
13790
13824
|
for (let i = 0; i < this.signRatioPointsColl.length; i++) {
|
|
13791
13825
|
this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
|
|
@@ -14019,11 +14053,11 @@ class SignatureBase extends Component {
|
|
|
14019
14053
|
enableOrDisable(isDisable) {
|
|
14020
14054
|
this.disabled = isDisable;
|
|
14021
14055
|
if (isDisable) {
|
|
14022
|
-
this.canvasContext.canvas.style.filter =
|
|
14056
|
+
this.canvasContext.canvas.style.filter = 'opacity(0.5)';
|
|
14023
14057
|
this.isRead(true);
|
|
14024
14058
|
}
|
|
14025
14059
|
else {
|
|
14026
|
-
this.canvasContext.canvas.style.filter =
|
|
14060
|
+
this.canvasContext.canvas.style.filter = '';
|
|
14027
14061
|
this.isRead(false);
|
|
14028
14062
|
}
|
|
14029
14063
|
}
|
|
@@ -14797,7 +14831,6 @@ let Rating = class Rating extends Component {
|
|
|
14797
14831
|
constructor(options, element) {
|
|
14798
14832
|
super(options, element);
|
|
14799
14833
|
this.itemElements = [];
|
|
14800
|
-
this.tooltipOpen = false;
|
|
14801
14834
|
}
|
|
14802
14835
|
preRender() {
|
|
14803
14836
|
if (!this.element.id) {
|
|
@@ -14810,13 +14843,14 @@ let Rating = class Rating extends Component {
|
|
|
14810
14843
|
uparrow: 'uparrow',
|
|
14811
14844
|
space: 'space'
|
|
14812
14845
|
};
|
|
14846
|
+
this.tooltipOpen = false;
|
|
14813
14847
|
}
|
|
14814
14848
|
render() {
|
|
14815
14849
|
this.initialize();
|
|
14816
14850
|
this.updateMinValue();
|
|
14817
14851
|
this.updateTemplateFunction();
|
|
14852
|
+
this.triggerChange(null, this.value, false);
|
|
14818
14853
|
this.renderItems();
|
|
14819
|
-
this.updatePrecision();
|
|
14820
14854
|
this.displayLabel();
|
|
14821
14855
|
}
|
|
14822
14856
|
initialize() {
|
|
@@ -14829,35 +14863,41 @@ let Rating = class Rating extends Component {
|
|
|
14829
14863
|
attributes(this.element, { 'aria-label': 'rating' });
|
|
14830
14864
|
this.renderItemList();
|
|
14831
14865
|
this.updateReset();
|
|
14832
|
-
this.
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
this.
|
|
14836
|
-
|
|
14866
|
+
if (this.readOnly) {
|
|
14867
|
+
this.wrapper.classList.add(READONLY);
|
|
14868
|
+
}
|
|
14869
|
+
if (!this.visible) {
|
|
14870
|
+
this.wrapper.classList.add(HIDDEN);
|
|
14871
|
+
}
|
|
14872
|
+
if (this.enableRtl) {
|
|
14873
|
+
this.wrapper.classList.add(RTL$2);
|
|
14874
|
+
}
|
|
14875
|
+
if (this.enableAnimation) {
|
|
14876
|
+
this.wrapper.classList.add(ANIMATION);
|
|
14877
|
+
}
|
|
14837
14878
|
if (this.cssClass) {
|
|
14838
14879
|
addClass([this.wrapper], this.cssClass.split(' '));
|
|
14839
14880
|
}
|
|
14840
14881
|
this.updateTooltip();
|
|
14841
14882
|
this.wireKeyboardEvent();
|
|
14883
|
+
this.updateDisabled();
|
|
14842
14884
|
}
|
|
14843
14885
|
updateDisabled() {
|
|
14844
14886
|
this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
|
|
14845
14887
|
attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
|
|
14846
|
-
|
|
14847
|
-
this.updateResetButton();
|
|
14848
|
-
}
|
|
14888
|
+
this.updateResetButton();
|
|
14849
14889
|
}
|
|
14850
14890
|
updateResetButton() {
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
14891
|
+
if (this.allowReset) {
|
|
14892
|
+
const isDisabled = (this.value <= this.min) || this.disabled;
|
|
14893
|
+
this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
|
|
14894
|
+
attributes(this.resetElement, { 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
|
|
14895
|
+
}
|
|
14855
14896
|
}
|
|
14856
14897
|
renderItemList() {
|
|
14857
14898
|
this.ratingItemList = this.createElement('div', {
|
|
14858
14899
|
className: ITEMLIST,
|
|
14859
|
-
id: this.element.id + '_item-list'
|
|
14860
|
-
attrs: { 'tabindex': '0' }
|
|
14900
|
+
id: this.element.id + '_item-list'
|
|
14861
14901
|
});
|
|
14862
14902
|
attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
|
|
14863
14903
|
this.wrapper.appendChild(this.ratingItemList);
|
|
@@ -14905,7 +14945,7 @@ let Rating = class Rating extends Component {
|
|
|
14905
14945
|
const ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
|
|
14906
14946
|
const spanItem = this.createElement('span', { className: 'e-rating-item' });
|
|
14907
14947
|
const ratingValue = this.getRatingValue(this.value, i);
|
|
14908
|
-
this.renderItemContent(spanItem, ratingValue, i);
|
|
14948
|
+
this.renderItemContent(spanItem, ratingValue, i, false);
|
|
14909
14949
|
ratingItemContainer.appendChild(spanItem);
|
|
14910
14950
|
this.wireItemsEvents(ratingItemContainer, i + 1);
|
|
14911
14951
|
this.itemElements.push(ratingItemContainer);
|
|
@@ -14915,11 +14955,9 @@ let Rating = class Rating extends Component {
|
|
|
14915
14955
|
});
|
|
14916
14956
|
}
|
|
14917
14957
|
attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
|
|
14918
|
-
|
|
14919
|
-
attributes(this.ratingItemList, { 'tabindex': '-1' });
|
|
14920
|
-
}
|
|
14958
|
+
this.updateItemValue(false);
|
|
14921
14959
|
}
|
|
14922
|
-
renderItemContent(spanEle, val, index, isrerender
|
|
14960
|
+
renderItemContent(spanEle, val, index, isrerender) {
|
|
14923
14961
|
if (isrerender) {
|
|
14924
14962
|
this.removeItemContent(spanEle);
|
|
14925
14963
|
}
|
|
@@ -14958,17 +14996,12 @@ let Rating = class Rating extends Component {
|
|
|
14958
14996
|
}
|
|
14959
14997
|
}
|
|
14960
14998
|
updateMinValue() {
|
|
14961
|
-
this.min
|
|
14999
|
+
this.setProperties({ min: this.validateValue(this.min) }, true);
|
|
14962
15000
|
if (this.min > 0 && this.value < this.min) {
|
|
14963
15001
|
this.triggerChange(null, this.min, false);
|
|
14964
15002
|
}
|
|
14965
15003
|
attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
|
|
14966
15004
|
}
|
|
14967
|
-
updatePrecision() {
|
|
14968
|
-
this.min = this.validateValue(this.min);
|
|
14969
|
-
this.triggerChange(null, this.validateValue(this.value), false);
|
|
14970
|
-
this.updateItemValue();
|
|
14971
|
-
}
|
|
14972
15005
|
validateValue(currentValue) {
|
|
14973
15006
|
if (currentValue > this.itemsCount) {
|
|
14974
15007
|
currentValue = this.itemsCount;
|
|
@@ -14987,7 +15020,10 @@ let Rating = class Rating extends Component {
|
|
|
14987
15020
|
return (this.enableSingleSelection) ? (((value > i) && (value <= i + 1)) ? 1 : 0) :
|
|
14988
15021
|
(value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
|
|
14989
15022
|
}
|
|
14990
|
-
updateItemValue() {
|
|
15023
|
+
updateItemValue(isUpdate = true) {
|
|
15024
|
+
if (isUpdate && this.isReact) {
|
|
15025
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15026
|
+
}
|
|
14991
15027
|
for (let i = 0; i < this.itemsCount; i++) {
|
|
14992
15028
|
const itemElement = this.itemElements[parseInt(i.toString(), 10)];
|
|
14993
15029
|
itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
|
|
@@ -15001,13 +15037,16 @@ let Rating = class Rating extends Component {
|
|
|
15001
15037
|
else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
|
|
15002
15038
|
itemElement.classList.add(SELECTEDVALUE);
|
|
15003
15039
|
}
|
|
15004
|
-
|
|
15040
|
+
if (isUpdate) {
|
|
15041
|
+
this.updateItemContent(ratingValue, i);
|
|
15042
|
+
}
|
|
15005
15043
|
itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
|
|
15006
15044
|
itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
|
|
15007
15045
|
}
|
|
15008
|
-
if (
|
|
15009
|
-
this.
|
|
15046
|
+
if (isUpdate) {
|
|
15047
|
+
this.renderReactTemplates();
|
|
15010
15048
|
}
|
|
15049
|
+
this.updateResetButton();
|
|
15011
15050
|
attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
|
|
15012
15051
|
attributes(this.element, { 'value': this.value.toString() });
|
|
15013
15052
|
}
|
|
@@ -15017,26 +15056,31 @@ let Rating = class Rating extends Component {
|
|
|
15017
15056
|
}
|
|
15018
15057
|
const spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
|
|
15019
15058
|
if (this.fullTemplate && ratingValue === 1) {
|
|
15020
|
-
if (spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15059
|
+
if (!this.isReact && spanEle.classList.contains(FULLTEMPLATE)) {
|
|
15021
15060
|
return;
|
|
15022
15061
|
}
|
|
15023
15062
|
this.removeItemContent(spanEle);
|
|
15024
15063
|
spanEle.classList.add(FULLTEMPLATE);
|
|
15025
|
-
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
|
|
15064
|
+
spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate' + index), this.isStringTemplate)[0]);
|
|
15026
15065
|
}
|
|
15027
15066
|
else if (this.emptyTemplate) {
|
|
15067
|
+
if (!this.isReact && spanEle.classList.contains(EMPTYTEMPLATE)) {
|
|
15068
|
+
return;
|
|
15069
|
+
}
|
|
15028
15070
|
this.removeItemContent(spanEle);
|
|
15029
15071
|
spanEle.classList.add(EMPTYTEMPLATE);
|
|
15030
|
-
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, '
|
|
15072
|
+
spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate' + index), this.isStringTemplate)[0]);
|
|
15031
15073
|
}
|
|
15032
15074
|
else {
|
|
15033
15075
|
this.removeItemContent(spanEle);
|
|
15034
15076
|
addClass([spanEle], ICONCSS.split(' '));
|
|
15035
15077
|
}
|
|
15036
|
-
this.renderReactTemplates();
|
|
15037
15078
|
}
|
|
15038
15079
|
updateTooltipContent(isChange) {
|
|
15039
15080
|
if (this.showTooltip) {
|
|
15081
|
+
if (this.isReact) {
|
|
15082
|
+
this.clearTemplate(['ratingTooltipTemplate']);
|
|
15083
|
+
}
|
|
15040
15084
|
let content;
|
|
15041
15085
|
if (this.tooltipTemplate) {
|
|
15042
15086
|
const templateFunction = this.getTemplateString(this.tooltipTemplate);
|
|
@@ -15082,21 +15126,27 @@ let Rating = class Rating extends Component {
|
|
|
15082
15126
|
updateLabel() {
|
|
15083
15127
|
if (this.showLabel) {
|
|
15084
15128
|
if (this.labelTemplate) {
|
|
15129
|
+
if (this.isReact) {
|
|
15130
|
+
this.clearTemplate(['ratingLabelTemplate']);
|
|
15131
|
+
}
|
|
15085
15132
|
if (this.spanLabel.firstChild) {
|
|
15086
15133
|
this.spanLabel.removeChild(this.spanLabel.firstChild);
|
|
15087
15134
|
}
|
|
15088
15135
|
const templateFunction = this.getTemplateString(this.labelTemplate);
|
|
15089
15136
|
this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
|
|
15137
|
+
this.renderReactTemplates();
|
|
15090
15138
|
}
|
|
15091
15139
|
else {
|
|
15092
15140
|
this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
|
|
15093
15141
|
}
|
|
15094
|
-
this.renderReactTemplates();
|
|
15095
15142
|
}
|
|
15096
15143
|
}
|
|
15097
15144
|
updateReset() {
|
|
15098
15145
|
if (this.allowReset) {
|
|
15099
|
-
this.resetElement = this.createElement('span', {
|
|
15146
|
+
this.resetElement = this.createElement('span', {
|
|
15147
|
+
className: RESET,
|
|
15148
|
+
attrs: { 'aria-label': 'resetbutton', 'role': 'button' }
|
|
15149
|
+
});
|
|
15100
15150
|
this.updateResetButton();
|
|
15101
15151
|
EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
|
|
15102
15152
|
this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
|
|
@@ -15134,9 +15184,7 @@ let Rating = class Rating extends Component {
|
|
|
15134
15184
|
this.triggerChange(e, this.currentValue);
|
|
15135
15185
|
this.updateItemValue();
|
|
15136
15186
|
this.updateLabel();
|
|
15137
|
-
|
|
15138
|
-
this.updateResetButton();
|
|
15139
|
-
}
|
|
15187
|
+
this.updateResetButton();
|
|
15140
15188
|
}
|
|
15141
15189
|
updateValueChange(e, val, isInteracted = true) {
|
|
15142
15190
|
this.triggerChange(e, val, isInteracted);
|
|
@@ -15212,6 +15260,8 @@ let Rating = class Rating extends Component {
|
|
|
15212
15260
|
/**
|
|
15213
15261
|
* Reset’s the value to minimum.
|
|
15214
15262
|
*
|
|
15263
|
+
* {% codeBlock src='rating/reset/index.md' %}{% endcodeBlock %}
|
|
15264
|
+
*
|
|
15215
15265
|
* @returns {void}
|
|
15216
15266
|
*/
|
|
15217
15267
|
reset() {
|
|
@@ -15263,12 +15313,13 @@ let Rating = class Rating extends Component {
|
|
|
15263
15313
|
Math.round(0.1 * 10) / 10;
|
|
15264
15314
|
currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
|
|
15265
15315
|
this.updateValueChange(e, (currentValue));
|
|
15266
|
-
|
|
15267
|
-
this.updateResetButton();
|
|
15268
|
-
}
|
|
15316
|
+
this.updateResetButton();
|
|
15269
15317
|
}
|
|
15270
15318
|
}
|
|
15271
15319
|
updateContent() {
|
|
15320
|
+
if (this.isReact) {
|
|
15321
|
+
this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
|
|
15322
|
+
}
|
|
15272
15323
|
for (let i = 0; i < this.itemsCount; i++) {
|
|
15273
15324
|
const itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
|
|
15274
15325
|
this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
|
|
@@ -15306,6 +15357,7 @@ let Rating = class Rating extends Component {
|
|
|
15306
15357
|
super.destroy();
|
|
15307
15358
|
// unwires the events and detach the li elements
|
|
15308
15359
|
this.removeItemElements();
|
|
15360
|
+
this.clearTemplate();
|
|
15309
15361
|
if (this.spanLabel) {
|
|
15310
15362
|
remove(this.spanLabel);
|
|
15311
15363
|
this.spanLabel = null;
|
|
@@ -15324,6 +15376,7 @@ let Rating = class Rating extends Component {
|
|
|
15324
15376
|
remove(this.wrapper);
|
|
15325
15377
|
this.wrapper = null;
|
|
15326
15378
|
this.keyboardModuleRating.destroy();
|
|
15379
|
+
this.keyboardModuleRating = null;
|
|
15327
15380
|
['value', 'aria-label', 'name'].forEach((attr) => {
|
|
15328
15381
|
this.element.removeAttribute(attr);
|
|
15329
15382
|
});
|
|
@@ -15383,7 +15436,9 @@ let Rating = class Rating extends Component {
|
|
|
15383
15436
|
this.updateTooltip();
|
|
15384
15437
|
break;
|
|
15385
15438
|
case 'precision':
|
|
15386
|
-
this.
|
|
15439
|
+
this.updateMinValue();
|
|
15440
|
+
this.triggerChange(null, this.value, false);
|
|
15441
|
+
this.updateItemValue();
|
|
15387
15442
|
this.updateLabel();
|
|
15388
15443
|
break;
|
|
15389
15444
|
case 'enableSingleSelection':
|
|
@@ -15404,7 +15459,6 @@ let Rating = class Rating extends Component {
|
|
|
15404
15459
|
case 'itemsCount':
|
|
15405
15460
|
this.removeItemElements();
|
|
15406
15461
|
this.renderItems();
|
|
15407
|
-
this.updateItemValue();
|
|
15408
15462
|
this.updateLabel();
|
|
15409
15463
|
break;
|
|
15410
15464
|
}
|