@syncfusion/ej2-inputs 26.1.39 → 26.1.41
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/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 +34 -9
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +34 -9
- 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 +7 -7
- package/src/form-validator/form-validator.d.ts +4 -0
- package/src/form-validator/form-validator.js +22 -3
- package/src/input/input.js +3 -3
- package/src/uploader/uploader.js +9 -3
- package/styles/input/_tailwind-definition.scss +1 -1
- package/styles/input/tailwind-dark.css +1 -1
- package/styles/input/tailwind.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -143,7 +143,7 @@ var Input;
|
|
|
143
143
|
function checkInputValue(floatLabelType, inputElement) {
|
|
144
144
|
var inputValue = inputElement.value;
|
|
145
145
|
var inputParent = inputElement.parentElement;
|
|
146
|
-
var grandParent = inputParent.parentElement;
|
|
146
|
+
var grandParent = inputParent && inputParent.parentElement;
|
|
147
147
|
if (inputValue !== '' && !isNullOrUndefined(inputValue)) {
|
|
148
148
|
if (inputParent && inputParent.classList.contains('e-input-group')) {
|
|
149
149
|
inputParent.classList.add('e-valid-input');
|
|
@@ -567,7 +567,7 @@ var Input;
|
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
var elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'), 10);
|
|
570
|
-
if (!isNullOrUndefined(container.getElementsByClassName('e-float-text-content')[0])) {
|
|
570
|
+
if (!isNullOrUndefined(container) && !isNullOrUndefined(container.getElementsByClassName('e-float-text-content')[0])) {
|
|
571
571
|
if (container.getElementsByClassName('e-float-text-content')[0].classList.contains('e-float-text-overflow')) {
|
|
572
572
|
container.getElementsByClassName('e-float-text-content')[0].classList.remove('e-float-text-overflow');
|
|
573
573
|
}
|
|
@@ -611,7 +611,7 @@ var Input;
|
|
|
611
611
|
if (parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
|
|
612
612
|
if (!isNullOrUndefined(placeholder) && placeholder !== '') {
|
|
613
613
|
var floatTextContent = parentElement.getElementsByClassName('e-float-text-content')[0];
|
|
614
|
-
if (floatTextContent) {
|
|
614
|
+
if (floatTextContent && floatTextContent.children[0]) {
|
|
615
615
|
floatTextContent.children[0].textContent = placeholder;
|
|
616
616
|
}
|
|
617
617
|
else {
|
|
@@ -7920,7 +7920,8 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7920
7920
|
var params = this.rules["" + name]["" + rule];
|
|
7921
7921
|
var param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
|
|
7922
7922
|
var currentRule = this.rules["" + name]["" + rule];
|
|
7923
|
-
var
|
|
7923
|
+
var dateFormat = ((rule === 'min' || rule === 'max') && this.rules["" + name].date && typeof (this.rules["" + name].date) === 'string') ? this.rules["" + name].date : null;
|
|
7924
|
+
var args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element, format: dateFormat };
|
|
7924
7925
|
this.trigger('validationBegin', args);
|
|
7925
7926
|
if (!args.param && rule === 'required') {
|
|
7926
7927
|
return true;
|
|
@@ -8117,7 +8118,16 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
8117
8118
|
return +option.value <= +option.param;
|
|
8118
8119
|
}
|
|
8119
8120
|
// Maximum rule validation for date
|
|
8120
|
-
|
|
8121
|
+
if (option.format && option.format !== '') {
|
|
8122
|
+
var globalize = new Internationalization;
|
|
8123
|
+
var dateOptions = { format: option.format.toString(), type: 'dateTime', skeleton: 'yMd' };
|
|
8124
|
+
var dateValue = globalize.parseDate(option.value, dateOptions);
|
|
8125
|
+
var maxValue = (typeof (option.param) === 'string') ? globalize.parseDate(JSON.parse(JSON.stringify(option.param)), dateOptions) : option.param;
|
|
8126
|
+
return new Date(dateValue).getTime() <= new Date(maxValue).getTime();
|
|
8127
|
+
}
|
|
8128
|
+
else {
|
|
8129
|
+
return new Date(option.value).getTime() <= new Date(JSON.parse(JSON.stringify(option.param))).getTime();
|
|
8130
|
+
}
|
|
8121
8131
|
},
|
|
8122
8132
|
min: function (option) {
|
|
8123
8133
|
if (!isNaN(Number(option.value))) {
|
|
@@ -8130,7 +8140,16 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
8130
8140
|
}
|
|
8131
8141
|
else {
|
|
8132
8142
|
// Minimum rule validation for date
|
|
8133
|
-
|
|
8143
|
+
if (option.format && option.format !== '') {
|
|
8144
|
+
var globalize = new Internationalization;
|
|
8145
|
+
var dateOptions = { format: option.format.toString(), type: 'dateTime', skeleton: 'yMd' };
|
|
8146
|
+
var dateValue = globalize.parseDate(option.value, dateOptions);
|
|
8147
|
+
var minValue = (typeof (option.param) === 'string') ? globalize.parseDate(JSON.parse(JSON.stringify(option.param)), dateOptions) : option.param;
|
|
8148
|
+
return new Date(dateValue).getTime() >= new Date(minValue).getTime();
|
|
8149
|
+
}
|
|
8150
|
+
else {
|
|
8151
|
+
return new Date(option.value).getTime() >= new Date(JSON.parse(JSON.stringify(option.param))).getTime();
|
|
8152
|
+
}
|
|
8134
8153
|
}
|
|
8135
8154
|
},
|
|
8136
8155
|
regex: function (option) {
|
|
@@ -8642,9 +8661,9 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
8642
8661
|
this.element.setAttribute('tabindex', '-1');
|
|
8643
8662
|
this.actionButtons = this.createElement('div', { className: ACTION_BUTTONS });
|
|
8644
8663
|
this.uploadButton = this.createElement('button', { className: UPLOAD_BUTTONS,
|
|
8645
|
-
attrs: { 'type': 'button', 'tabindex': this.btnTabIndex } });
|
|
8664
|
+
attrs: { 'type': 'button', 'tabindex': this.btnTabIndex, 'aria-label': this.localizedTexts('Upload') } });
|
|
8646
8665
|
this.clearButton = this.createElement('button', { className: CLEAR_BUTTONS,
|
|
8647
|
-
attrs: { 'type': 'button', 'tabindex': this.btnTabIndex } });
|
|
8666
|
+
attrs: { 'type': 'button', 'tabindex': this.btnTabIndex, 'aria-label': this.localizedTexts('Clear') } });
|
|
8648
8667
|
this.actionButtons.appendChild(this.clearButton);
|
|
8649
8668
|
this.actionButtons.appendChild(this.uploadButton);
|
|
8650
8669
|
this.renderButtonTemplates();
|
|
@@ -9159,6 +9178,9 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9159
9178
|
else if (!closest(args.target, '.' + SPINNER_PANE)) {
|
|
9160
9179
|
this.remove(fileData, false, false, true, args);
|
|
9161
9180
|
}
|
|
9181
|
+
if (this.isForm && liElement && liElement.classList.contains(INVALID_FILE)) {
|
|
9182
|
+
this.element.value = '';
|
|
9183
|
+
}
|
|
9162
9184
|
this.checkActionButtonStatus();
|
|
9163
9185
|
};
|
|
9164
9186
|
Uploader.prototype.removeFilesData = function (file, customTemplate) {
|
|
@@ -10013,6 +10035,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10013
10035
|
}
|
|
10014
10036
|
if (!iconElement.classList.contains(DELETE_ICON)) {
|
|
10015
10037
|
iconElement.classList.add(REMOVE_ICON);
|
|
10038
|
+
iconElement.setAttribute('aria-label', this.localizedTexts('remove'));
|
|
10016
10039
|
}
|
|
10017
10040
|
var index = fileData.indexOf(listItem);
|
|
10018
10041
|
var eventArgs = {
|
|
@@ -10270,6 +10293,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10270
10293
|
this.pauseButton = this.createElement('span', { className: 'e-icons e-file-reload-btn', attrs: { 'tabindex': this.btnTabIndex } });
|
|
10271
10294
|
deleteIcon.parentElement.insertBefore(this.pauseButton, deleteIcon);
|
|
10272
10295
|
this.pauseButton.setAttribute('title', this.localizedTexts('retry'));
|
|
10296
|
+
this.pauseButton.setAttribute('aria-label', this.localizedTexts('retry'));
|
|
10273
10297
|
var retryElement = liElement.querySelector('.' + RETRY_ICON);
|
|
10274
10298
|
/* istanbul ignore next */
|
|
10275
10299
|
retryElement.addEventListener('click', function (e) {
|
|
@@ -10309,6 +10333,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10309
10333
|
if (!isNullOrUndefined(iconEle)) {
|
|
10310
10334
|
iconEle.classList.add(DELETE_ICON);
|
|
10311
10335
|
iconEle.setAttribute('title', this.localizedTexts('delete'));
|
|
10336
|
+
iconEle.setAttribute('aria-label', this.localizedTexts('delete'));
|
|
10312
10337
|
iconEle.classList.remove(ABORT_ICON);
|
|
10313
10338
|
iconEle.classList.remove(UPLOAD_INPROGRESS);
|
|
10314
10339
|
}
|
|
@@ -10347,7 +10372,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
10347
10372
|
}
|
|
10348
10373
|
this.trigger('success', args, function (args) {
|
|
10349
10374
|
_this.updateStatus(file, args.statusText, '2');
|
|
10350
|
-
_this.uploadedFilesData.push(file);
|
|
10375
|
+
_this.multiple ? _this.uploadedFilesData.push(file) : _this.uploadedFilesData = [file];
|
|
10351
10376
|
_this.trigger('change', { file: _this.uploadedFilesData });
|
|
10352
10377
|
_this.checkActionButtonStatus();
|
|
10353
10378
|
if (_this.fileList.length > 0) {
|