@syncfusion/ej2-inputs 35.1.37 → 35.1.42
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 +87 -15
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +87 -15
- 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 +3 -3
- package/src/color-picker/color-picker.js +54 -12
- package/src/input/input.js +33 -10
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 35.1.
|
|
3
|
+
* version : 35.1.42
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-inputs",
|
|
3
|
-
"version": "35.1.
|
|
3
|
+
"version": "35.1.42",
|
|
4
4
|
"description": "A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"es2015": "./dist/es6/ej2-inputs.es5.js",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@syncfusion/ej2-base": "~35.1.37",
|
|
12
|
-
"@syncfusion/ej2-buttons": "~35.1.
|
|
13
|
-
"@syncfusion/ej2-popups": "~35.1.
|
|
12
|
+
"@syncfusion/ej2-buttons": "~35.1.41",
|
|
13
|
+
"@syncfusion/ej2-popups": "~35.1.42",
|
|
14
14
|
"@syncfusion/ej2-splitbuttons": "~35.1.37"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|
|
@@ -399,11 +399,26 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
399
399
|
};
|
|
400
400
|
ColorPicker.prototype.firstPaletteFocus = function () {
|
|
401
401
|
if (!select('.' + SELECT, this.container.children[0])) {
|
|
402
|
-
|
|
402
|
+
var firstTile = select('.' + TILE, this.container);
|
|
403
|
+
if (firstTile) {
|
|
404
|
+
firstTile.focus();
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
selectAll('.' + PALETTES, this.container)[0].focus();
|
|
408
|
+
}
|
|
403
409
|
}
|
|
404
410
|
};
|
|
405
411
|
ColorPicker.prototype.appendPalette = function (colors, key, refEle) {
|
|
406
|
-
var
|
|
412
|
+
var rowCount = Math.ceil(colors.length / this.columns);
|
|
413
|
+
var palette = this.createElement('div', {
|
|
414
|
+
className: PALETTES,
|
|
415
|
+
attrs: {
|
|
416
|
+
'tabindex': '0', 'role': 'grid',
|
|
417
|
+
'aria-label': (key === 'recent-color' ? 'Recent ' : '') + 'Color palette, ' + rowCount +
|
|
418
|
+
(rowCount === 1 ? ' row and ' : ' rows and ') + this.columns +
|
|
419
|
+
(this.columns === 1 ? ' column' : ' columns')
|
|
420
|
+
}
|
|
421
|
+
});
|
|
407
422
|
if (key === 'recent-color') {
|
|
408
423
|
palette.classList.add('e-recent-palette');
|
|
409
424
|
}
|
|
@@ -416,34 +431,51 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
416
431
|
var row;
|
|
417
432
|
var tile;
|
|
418
433
|
var roundedColor;
|
|
434
|
+
var rowIdx = 0;
|
|
435
|
+
var colIdx;
|
|
419
436
|
for (var i = 0, len = colors.length; i < len; i++) {
|
|
420
437
|
if (i === 0 || i % this.columns === 0) {
|
|
438
|
+
rowIdx++;
|
|
439
|
+
colIdx = 0;
|
|
421
440
|
row = this.createElement('div', {
|
|
422
|
-
className: 'e-row',
|
|
441
|
+
className: 'e-row',
|
|
442
|
+
attrs: { 'role': 'row', 'aria-label': 'Row ' + rowIdx }
|
|
423
443
|
});
|
|
424
444
|
palette.appendChild(row);
|
|
425
445
|
}
|
|
446
|
+
colIdx++;
|
|
426
447
|
roundedColor = this.roundValue(colors[i]).toLowerCase();
|
|
427
448
|
tile = this.createElement('span', {
|
|
428
|
-
className: TILE, attrs: {
|
|
449
|
+
className: TILE, attrs: {
|
|
450
|
+
'role': 'gridcell', 'aria-label': roundedColor, 'aria-selected': 'false',
|
|
451
|
+
'tabindex': '-1',
|
|
452
|
+
'aria-rowindex': rowIdx.toString(), 'aria-colindex': colIdx.toString()
|
|
453
|
+
}
|
|
429
454
|
});
|
|
430
455
|
this.trigger('beforeTileRender', { element: tile, presetName: key, value: colors[i] });
|
|
431
456
|
row.appendChild(tile);
|
|
432
457
|
if (this.value === roundedColor && key !== 'recent-color') {
|
|
433
458
|
this.addTileSelection(tile);
|
|
434
|
-
palette.focus();
|
|
435
459
|
}
|
|
436
460
|
tile.style.backgroundColor = this.convertToRgbString(this.hexToRgb(roundedColor));
|
|
437
461
|
}
|
|
462
|
+
var selectedTile = palette.querySelector('.' + TILE + '.' + SELECT);
|
|
463
|
+
if (selectedTile) {
|
|
464
|
+
selectedTile.focus();
|
|
465
|
+
}
|
|
438
466
|
};
|
|
439
467
|
ColorPicker.prototype.setNoColor = function () {
|
|
440
468
|
var noColorEle = this.container.querySelector('.e-row').children[0];
|
|
441
469
|
noColorEle.classList.add(NOCOLOR);
|
|
470
|
+
noColorEle.setAttribute('aria-label', 'No color');
|
|
442
471
|
if (!this.value) {
|
|
443
472
|
noColorEle.classList.add(SELECT);
|
|
444
|
-
|
|
473
|
+
noColorEle.setAttribute('aria-selected', 'true');
|
|
474
|
+
noColorEle.focus();
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
noColorEle.setAttribute('aria-selected', 'false');
|
|
445
478
|
}
|
|
446
|
-
['aria-selected', 'aria-label'].forEach(function (attr) { noColorEle.removeAttribute(attr); });
|
|
447
479
|
noColorEle.style.backgroundColor = '';
|
|
448
480
|
};
|
|
449
481
|
ColorPicker.prototype.appendElement = function (ele, insertPos) {
|
|
@@ -1022,7 +1054,7 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
1022
1054
|
else {
|
|
1023
1055
|
this.setProperties({ 'value': hex }, true);
|
|
1024
1056
|
}
|
|
1025
|
-
this.element.value = hex ? hex : '#000000';
|
|
1057
|
+
this.element.value = hex ? hex : (this.mode === 'Palette' && !this.modeSwitcher && this.noColor ? '' : '#000000');
|
|
1026
1058
|
};
|
|
1027
1059
|
ColorPicker.prototype.handlerDragPosition = function (prob, value, e) {
|
|
1028
1060
|
e.preventDefault();
|
|
@@ -1306,10 +1338,12 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
1306
1338
|
}
|
|
1307
1339
|
};
|
|
1308
1340
|
ColorPicker.prototype.paletteKeyDown = function (e) {
|
|
1309
|
-
var
|
|
1310
|
-
if (!
|
|
1341
|
+
var eventTarget = e.target;
|
|
1342
|
+
if (!eventTarget.classList.contains(PALETTES) && !eventTarget.classList.contains(TILE)) {
|
|
1311
1343
|
return;
|
|
1312
1344
|
}
|
|
1345
|
+
var target = eventTarget.classList.contains(TILE) ?
|
|
1346
|
+
closest(eventTarget, '.' + PALETTES) : eventTarget;
|
|
1313
1347
|
var selectedEle;
|
|
1314
1348
|
var idx;
|
|
1315
1349
|
var tiles = [].slice.call(selectAll('.' + TILE, target));
|
|
@@ -1367,8 +1401,13 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
1367
1401
|
case 13:
|
|
1368
1402
|
e.preventDefault();
|
|
1369
1403
|
if (prevSelectedEle) {
|
|
1370
|
-
|
|
1371
|
-
|
|
1404
|
+
if (prevSelectedEle.classList.contains(NOCOLOR)) {
|
|
1405
|
+
this.enterKeyHandler('');
|
|
1406
|
+
}
|
|
1407
|
+
else {
|
|
1408
|
+
var cValue = prevSelectedEle.getAttribute('aria-label');
|
|
1409
|
+
this.enterKeyHandler(cValue ? cValue : '');
|
|
1410
|
+
}
|
|
1372
1411
|
}
|
|
1373
1412
|
break;
|
|
1374
1413
|
}
|
|
@@ -1389,6 +1428,9 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
1389
1428
|
}
|
|
1390
1429
|
this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), true);
|
|
1391
1430
|
}
|
|
1431
|
+
if (newEle) {
|
|
1432
|
+
newEle.focus();
|
|
1433
|
+
}
|
|
1392
1434
|
};
|
|
1393
1435
|
ColorPicker.prototype.tilePosition = function (items, element, cIdx) {
|
|
1394
1436
|
items = Array.prototype.slice.call(items);
|
package/src/input/input.js
CHANGED
|
@@ -34,14 +34,33 @@ export var TEXTBOX_FOCUS = 'e-input-focus';
|
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
35
35
|
export var Input;
|
|
36
36
|
(function (Input) {
|
|
37
|
-
var privateInputObj = {
|
|
38
|
-
container: null,
|
|
39
|
-
buttons: [],
|
|
40
|
-
clearButton: null
|
|
41
|
-
};
|
|
42
37
|
var floatType;
|
|
43
38
|
var isBindClearAction = true;
|
|
44
39
|
var resizeHandlers = new Map();
|
|
40
|
+
var mutationObservers = new Map();
|
|
41
|
+
var observeElementDetach = function (element, container, resizeHandler) {
|
|
42
|
+
var parent = container.parentElement;
|
|
43
|
+
if (!parent) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
var observer = new MutationObserver(function () {
|
|
47
|
+
if (!document.documentElement.contains(container)) {
|
|
48
|
+
window.removeEventListener('resize', resizeHandler);
|
|
49
|
+
resizeHandlers.delete(element);
|
|
50
|
+
observer.disconnect();
|
|
51
|
+
mutationObservers.delete(element);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var host = parent;
|
|
55
|
+
while (host && host.parentElement && host.parentElement !== document.body) {
|
|
56
|
+
host = host.parentElement;
|
|
57
|
+
}
|
|
58
|
+
observer.observe(host || parent, {
|
|
59
|
+
childList: true,
|
|
60
|
+
subtree: true
|
|
61
|
+
});
|
|
62
|
+
mutationObservers.set(element, observer);
|
|
63
|
+
};
|
|
45
64
|
/**
|
|
46
65
|
* Create a wrapper to input element with multiple span elements and set the basic properties to input based components.
|
|
47
66
|
* ```
|
|
@@ -84,7 +103,6 @@ export var Input;
|
|
|
84
103
|
validateInputType(inputObject.container, args.element);
|
|
85
104
|
inputObject = setPropertyValue(args, inputObject);
|
|
86
105
|
createSpanElement(inputObject.container, makeElement);
|
|
87
|
-
privateInputObj = inputObject;
|
|
88
106
|
return inputObject;
|
|
89
107
|
}
|
|
90
108
|
Input.createInput = createInput;
|
|
@@ -467,8 +485,11 @@ export var Input;
|
|
|
467
485
|
if (!isNullOrUndefined(resizeHandlers)) {
|
|
468
486
|
var resizeHandler = resizeHandlers.get(args.element);
|
|
469
487
|
if (resizeHandler) {
|
|
470
|
-
|
|
471
|
-
|
|
488
|
+
var observer = mutationObservers.get(args.element);
|
|
489
|
+
if (observer) {
|
|
490
|
+
observer.disconnect();
|
|
491
|
+
mutationObservers.delete(args.element);
|
|
492
|
+
}
|
|
472
493
|
if (isReactMode) {
|
|
473
494
|
resizeHandlers = null;
|
|
474
495
|
}
|
|
@@ -480,14 +501,15 @@ export var Input;
|
|
|
480
501
|
args.element.classList.remove(CLASSNAMES.INPUT);
|
|
481
502
|
}
|
|
482
503
|
}
|
|
483
|
-
privateInputObj = null;
|
|
484
504
|
}
|
|
485
505
|
Input.destroy = destroy;
|
|
486
506
|
function validateLabel(element, floatLabelType) {
|
|
487
507
|
var parent = getParentNode(element);
|
|
488
508
|
if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') {
|
|
489
509
|
var label = getParentNode(element).getElementsByClassName('e-float-text')[0];
|
|
490
|
-
|
|
510
|
+
if (label) {
|
|
511
|
+
updateLabelState(element.value, label, element);
|
|
512
|
+
}
|
|
491
513
|
}
|
|
492
514
|
}
|
|
493
515
|
/**
|
|
@@ -610,6 +632,7 @@ export var Input;
|
|
|
610
632
|
};
|
|
611
633
|
resizeHandlers.set(element, resizeHandler_1);
|
|
612
634
|
window.addEventListener('resize', resizeHandler_1);
|
|
635
|
+
observeElementDetach(element, container, resizeHandler_1);
|
|
613
636
|
}
|
|
614
637
|
if (moduleName !== 'multiselect' && !_isElementVisible(element)) {
|
|
615
638
|
return;
|