@syncfusion/ej2-dropdowns 34.1.32 → 34.2.2
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/.eslintrc.json +263 -0
- package/aceconfig.js +17 -0
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +183 -6
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +191 -6
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/drop-down-tree/drop-down-tree.d.ts +5 -0
- package/src/drop-down-tree/drop-down-tree.js +142 -0
- package/src/list-box/list-box.js +5 -5
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +44 -1
- package/styles/auto-complete/_variables.scss +1 -1
- package/styles/bds-lite.css +4 -1
- package/styles/bds.css +4 -1
- package/styles/bootstrap-dark-lite.css +4 -0
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap-lite.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4-lite.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark-lite.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5-lite.css +4 -1
- package/styles/bootstrap5.3-lite.css +4 -1
- package/styles/bootstrap5.3.css +4 -1
- package/styles/bootstrap5.css +4 -1
- package/styles/combo-box/_variables.scss +1 -1
- package/styles/drop-down-base/_variables.scss +1 -1
- package/styles/drop-down-list/_variables.scss +1 -1
- package/styles/drop-down-tree/_variables.scss +1 -1
- package/styles/fabric-dark-lite.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric-lite.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/fluent-dark-lite.css +4 -0
- package/styles/fluent-dark.css +4 -0
- package/styles/fluent-lite.css +4 -1
- package/styles/fluent.css +4 -1
- package/styles/fluent2-lite.css +4 -1
- package/styles/fluent2.css +4 -1
- package/styles/highcontrast-light-lite.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast-lite.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/list-box/_variables.scss +1 -1
- package/styles/material-dark-lite.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material-lite.css +4 -0
- package/styles/material.css +4 -0
- package/styles/material3-dark-lite.css +4 -0
- package/styles/material3-dark.css +4 -0
- package/styles/material3-lite.css +4 -1
- package/styles/material3.css +4 -1
- package/styles/mention/_layout.scss +3 -4
- package/styles/mention/_variables.scss +1 -1
- package/styles/mention/bds.css +5 -0
- package/styles/mention/bootstrap-dark.css +3 -0
- package/styles/mention/bootstrap.css +3 -0
- package/styles/mention/bootstrap4.css +3 -0
- package/styles/mention/bootstrap5-dark.css +3 -0
- package/styles/mention/bootstrap5.3.css +4 -1
- package/styles/mention/bootstrap5.css +4 -1
- package/styles/mention/fabric-dark.css +3 -0
- package/styles/mention/fabric.css +3 -0
- package/styles/mention/fluent-dark.css +3 -0
- package/styles/mention/fluent.css +4 -1
- package/styles/mention/fluent2.css +5 -0
- package/styles/mention/highcontrast-light.css +3 -0
- package/styles/mention/highcontrast.css +3 -0
- package/styles/mention/material-dark.css +3 -0
- package/styles/mention/material.css +3 -0
- package/styles/mention/material3-dark.css +4 -1
- package/styles/mention/material3.css +5 -0
- package/styles/mention/tailwind-dark.css +3 -0
- package/styles/mention/tailwind.css +4 -1
- package/styles/mention/tailwind3.css +5 -0
- package/styles/multi-select/_variables.scss +1 -1
- package/styles/tailwind-dark-lite.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind-lite.css +4 -1
- package/styles/tailwind.css +4 -1
- package/styles/tailwind3-lite.css +4 -1
- package/styles/tailwind3.css +4 -1
- package/tslint.json +111 -0
|
@@ -8144,6 +8144,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8144
8144
|
this.windowResizeContext = this.windowResize.bind(this);
|
|
8145
8145
|
// Specifies if the checkAll method has been called
|
|
8146
8146
|
this.isCheckAllCalled = false;
|
|
8147
|
+
this.isNodeChecked = false;
|
|
8147
8148
|
this.isFromFilterChange = false;
|
|
8148
8149
|
this.fallbackValue = [];
|
|
8149
8150
|
}
|
|
@@ -10158,6 +10159,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10158
10159
|
onNodeChecked(args) {
|
|
10159
10160
|
const eventArgs = this.getEventArgs(args);
|
|
10160
10161
|
this.trigger('select', eventArgs);
|
|
10162
|
+
this.isNodeChecked = args.action === 'check';
|
|
10161
10163
|
if (this.isFilteredData && args.action === 'uncheck') {
|
|
10162
10164
|
const id = getValue('id', args.data[0]).toString();
|
|
10163
10165
|
this.removeSelectedData(id, true);
|
|
@@ -10481,6 +10483,135 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10481
10483
|
}
|
|
10482
10484
|
}
|
|
10483
10485
|
}
|
|
10486
|
+
getFilteredTreeData() {
|
|
10487
|
+
return this.treeData;
|
|
10488
|
+
}
|
|
10489
|
+
getChildren(parentId, result) {
|
|
10490
|
+
const treeData = this.getFilteredTreeData();
|
|
10491
|
+
treeData.forEach((item) => {
|
|
10492
|
+
if (!isNullOrUndefined(item) && !isNullOrUndefined(item.pid) && !isNullOrUndefined(item.id) && item.pid.toString() === parentId.toString()) {
|
|
10493
|
+
const childId = item.id.toString();
|
|
10494
|
+
if (result.indexOf(childId) === -1) {
|
|
10495
|
+
result.push(childId);
|
|
10496
|
+
this.getChildren(childId, result);
|
|
10497
|
+
}
|
|
10498
|
+
}
|
|
10499
|
+
});
|
|
10500
|
+
}
|
|
10501
|
+
getDirectChildren(parentId) {
|
|
10502
|
+
return this.getFilteredTreeData()
|
|
10503
|
+
.filter((childNode) => !isNullOrUndefined(childNode) && !isNullOrUndefined(childNode.pid) && !isNullOrUndefined(childNode.id) && childNode.pid.toString() === parentId)
|
|
10504
|
+
.map((childNode) => childNode.id.toString());
|
|
10505
|
+
}
|
|
10506
|
+
updateFilteredAutoCheckValues() {
|
|
10507
|
+
const treeData = this.getFilteredTreeData();
|
|
10508
|
+
let currentValues = Array.isArray(this.value) ? this.value.map((item) => item.toString()) : [];
|
|
10509
|
+
const removeParent = (parentId) => {
|
|
10510
|
+
this.value = this.value.filter((value) => value.toString() !== parentId);
|
|
10511
|
+
};
|
|
10512
|
+
if (this.isNodeChecked) {
|
|
10513
|
+
this.treeObj.checkedNodes.map((item) => item.toString()).forEach((value) => {
|
|
10514
|
+
if (this.value.indexOf(value) === -1) {
|
|
10515
|
+
this.value.push(value);
|
|
10516
|
+
}
|
|
10517
|
+
});
|
|
10518
|
+
treeData.forEach((node) => {
|
|
10519
|
+
if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
|
|
10520
|
+
return;
|
|
10521
|
+
}
|
|
10522
|
+
const parentId = node.id.toString();
|
|
10523
|
+
if (node.haschild && this.value.indexOf(parentId) !== -1) {
|
|
10524
|
+
const childValues = [];
|
|
10525
|
+
this.getChildren(parentId, childValues);
|
|
10526
|
+
if (this.value.indexOf(parentId) === -1) {
|
|
10527
|
+
this.value.push(parentId);
|
|
10528
|
+
}
|
|
10529
|
+
childValues.forEach((value) => {
|
|
10530
|
+
if (this.value.indexOf(value) === -1) {
|
|
10531
|
+
this.value.push(value);
|
|
10532
|
+
}
|
|
10533
|
+
});
|
|
10534
|
+
}
|
|
10535
|
+
currentValues = this.value.map((item) => item.toString());
|
|
10536
|
+
});
|
|
10537
|
+
treeData.forEach((node) => {
|
|
10538
|
+
if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
|
|
10539
|
+
return;
|
|
10540
|
+
}
|
|
10541
|
+
if (!node.haschild) {
|
|
10542
|
+
return;
|
|
10543
|
+
}
|
|
10544
|
+
const parentId = node.id.toString();
|
|
10545
|
+
const directChildren = this.getDirectChildren(parentId);
|
|
10546
|
+
if (!directChildren.length) {
|
|
10547
|
+
return;
|
|
10548
|
+
}
|
|
10549
|
+
const allChildrenSelected = directChildren.every((childId) => this.value.indexOf(childId) !== -1);
|
|
10550
|
+
if (allChildrenSelected) {
|
|
10551
|
+
const childValues = [];
|
|
10552
|
+
this.getChildren(parentId, childValues);
|
|
10553
|
+
if (this.value.indexOf(parentId) === -1) {
|
|
10554
|
+
this.value.push(parentId);
|
|
10555
|
+
}
|
|
10556
|
+
childValues.forEach((value) => {
|
|
10557
|
+
if (this.value.indexOf(value) === -1) {
|
|
10558
|
+
this.value.push(value);
|
|
10559
|
+
}
|
|
10560
|
+
});
|
|
10561
|
+
}
|
|
10562
|
+
else {
|
|
10563
|
+
removeParent(parentId);
|
|
10564
|
+
}
|
|
10565
|
+
currentValues = this.value.map((item) => item.toString());
|
|
10566
|
+
});
|
|
10567
|
+
this.selectedData.forEach((item) => {
|
|
10568
|
+
const value = getValue(this.treeSettings.loadOnDemand ? this.fields.value : 'id', item).toString();
|
|
10569
|
+
if (this.value.indexOf(value) === -1) {
|
|
10570
|
+
this.selectedData = this.selectedData.filter((data) => getValue(this.treeSettings.loadOnDemand ? this.fields.value : 'id', data).toString() !== value);
|
|
10571
|
+
}
|
|
10572
|
+
});
|
|
10573
|
+
return;
|
|
10574
|
+
}
|
|
10575
|
+
const removeValues = [];
|
|
10576
|
+
treeData.forEach((node) => {
|
|
10577
|
+
if (isNullOrUndefined(node.id)) {
|
|
10578
|
+
return;
|
|
10579
|
+
}
|
|
10580
|
+
if (!node.haschild) {
|
|
10581
|
+
return;
|
|
10582
|
+
}
|
|
10583
|
+
const parentId = node.id.toString();
|
|
10584
|
+
if (currentValues.indexOf(parentId) === -1) {
|
|
10585
|
+
const childValues = [];
|
|
10586
|
+
this.getChildren(parentId, childValues);
|
|
10587
|
+
if (childValues.some((child) => currentValues.indexOf(child) !== -1)) {
|
|
10588
|
+
removeValues.push(...childValues);
|
|
10589
|
+
}
|
|
10590
|
+
}
|
|
10591
|
+
});
|
|
10592
|
+
if (removeValues.length) {
|
|
10593
|
+
this.value = this.value.filter((value) => removeValues.indexOf(value.toString()) === -1);
|
|
10594
|
+
currentValues = this.value.map((item) => item.toString());
|
|
10595
|
+
}
|
|
10596
|
+
treeData.forEach((node) => {
|
|
10597
|
+
if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
|
|
10598
|
+
return;
|
|
10599
|
+
}
|
|
10600
|
+
if (!node.haschild) {
|
|
10601
|
+
return;
|
|
10602
|
+
}
|
|
10603
|
+
const parentId = node.id.toString();
|
|
10604
|
+
if (currentValues.indexOf(parentId) === -1) {
|
|
10605
|
+
return;
|
|
10606
|
+
}
|
|
10607
|
+
const hasDirectChild = treeData.some((childNode) => !isNullOrUndefined(childNode) && !isNullOrUndefined(childNode.pid) && !isNullOrUndefined(childNode.id) && childNode.pid.toString() === parentId &&
|
|
10608
|
+
currentValues.indexOf(childNode.id.toString()) !== -1);
|
|
10609
|
+
if (!hasDirectChild) {
|
|
10610
|
+
removeParent(parentId);
|
|
10611
|
+
currentValues = this.value.map((item) => item.toString());
|
|
10612
|
+
}
|
|
10613
|
+
});
|
|
10614
|
+
}
|
|
10484
10615
|
updateSelectedValues() {
|
|
10485
10616
|
this.dataValue = '';
|
|
10486
10617
|
let temp;
|
|
@@ -10495,6 +10626,9 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10495
10626
|
if (!this.isFilteredData) {
|
|
10496
10627
|
this.selectedData = [];
|
|
10497
10628
|
}
|
|
10629
|
+
if (this.treeSettings.autoCheck && this.isFilteredData && !isNullOrUndefined(this.value)) {
|
|
10630
|
+
this.updateFilteredAutoCheckValues();
|
|
10631
|
+
}
|
|
10498
10632
|
if (!isNullOrUndefined(this.value)) {
|
|
10499
10633
|
const compiledString = this.initializeValueTemplate();
|
|
10500
10634
|
for (let i = 0, len = this.value.length; i < len; i++) {
|
|
@@ -13467,6 +13601,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13467
13601
|
this.isBlurDispatching = false;
|
|
13468
13602
|
this.isFilterPrevented = false;
|
|
13469
13603
|
this.isFilteringAction = false;
|
|
13604
|
+
this.isPropertyChanged = false;
|
|
13470
13605
|
this.isValidKey = false;
|
|
13471
13606
|
this.selectAllEventData = [];
|
|
13472
13607
|
this.selectAllEventEle = [];
|
|
@@ -14173,7 +14308,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14173
14308
|
}
|
|
14174
14309
|
}
|
|
14175
14310
|
else if (!(this.dataSource instanceof DataManager)) {
|
|
14176
|
-
this.
|
|
14311
|
+
if (!this.isRemoveSelection) {
|
|
14312
|
+
this.initialValueUpdate(this.listData, true);
|
|
14313
|
+
}
|
|
14314
|
+
else {
|
|
14315
|
+
this.initialValueUpdate();
|
|
14316
|
+
}
|
|
14177
14317
|
}
|
|
14178
14318
|
this.initialUpdate();
|
|
14179
14319
|
this.refreshPlaceHolder();
|
|
@@ -17487,6 +17627,33 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17487
17627
|
this.unwireListEvents();
|
|
17488
17628
|
this.wireListEvents();
|
|
17489
17629
|
}
|
|
17630
|
+
getTextByValueFromDataSource(value) {
|
|
17631
|
+
const dataSource = this.dataSource;
|
|
17632
|
+
if (isNullOrUndefined(dataSource) || !dataSource.length) {
|
|
17633
|
+
return null;
|
|
17634
|
+
}
|
|
17635
|
+
if (this.isPrimitiveData) {
|
|
17636
|
+
for (let i = 0; i < dataSource.length; i++) {
|
|
17637
|
+
if (dataSource[i] === value) {
|
|
17638
|
+
return dataSource[i];
|
|
17639
|
+
}
|
|
17640
|
+
}
|
|
17641
|
+
return null;
|
|
17642
|
+
}
|
|
17643
|
+
const fields = this.fields;
|
|
17644
|
+
const valueField = fields.value ? fields.value : 'value';
|
|
17645
|
+
const textField = fields.text ? fields.text : 'text';
|
|
17646
|
+
for (let i = 0; i < dataSource.length; i++) {
|
|
17647
|
+
const item = dataSource[i];
|
|
17648
|
+
if (!isNullOrUndefined(item) && getValue(valueField, item) === value) {
|
|
17649
|
+
const resolvedText = getValue(textField, item);
|
|
17650
|
+
if (!isNullOrUndefined(resolvedText)) {
|
|
17651
|
+
return resolvedText;
|
|
17652
|
+
}
|
|
17653
|
+
}
|
|
17654
|
+
}
|
|
17655
|
+
return null;
|
|
17656
|
+
}
|
|
17490
17657
|
initialValueUpdate(listItems, isInitialVirtualData, isInitialRender) {
|
|
17491
17658
|
if (this.list) {
|
|
17492
17659
|
let text;
|
|
@@ -17536,6 +17703,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17536
17703
|
}
|
|
17537
17704
|
}
|
|
17538
17705
|
}
|
|
17706
|
+
if (this.isPropertyChanged && isNullOrUndefined(text) && !this.allowCustomValue &&
|
|
17707
|
+
!(this.dataSource instanceof DataManager)) {
|
|
17708
|
+
text = this.getTextByValueFromDataSource(value);
|
|
17709
|
+
}
|
|
17539
17710
|
if ((isNullOrUndefined(text) && this.allowCustomValue) &&
|
|
17540
17711
|
((!(this.dataSource instanceof DataManager)) ||
|
|
17541
17712
|
(this.dataSource instanceof DataManager && isInitialVirtualData))) {
|
|
@@ -19164,6 +19335,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19164
19335
|
* @returns {void}
|
|
19165
19336
|
*/
|
|
19166
19337
|
onPropertyChanged(newProp, oldProp) {
|
|
19338
|
+
this.isPropertyChanged = true;
|
|
19167
19339
|
if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
|
|
19168
19340
|
|| newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
|
|
19169
19341
|
this.mainList = null;
|
|
@@ -19208,6 +19380,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19208
19380
|
&& !this.validateValues(newProp.value, oldProp.value)) {
|
|
19209
19381
|
return;
|
|
19210
19382
|
}
|
|
19383
|
+
if (this.isVue && this.mode === 'CheckBox' && !this.changeOnBlur && !isNullOrUndefined(oldProp.value) && !isNullOrUndefined(newProp.value)
|
|
19384
|
+
&& !this.validateValues(newProp.value, oldProp.value)) {
|
|
19385
|
+
return;
|
|
19386
|
+
}
|
|
19211
19387
|
this.updateVal(this.value, oldProp.value, 'value', this.enableVirtualization);
|
|
19212
19388
|
this.addValidInputClass();
|
|
19213
19389
|
if (!this.closePopupOnSelect && this.isPopupOpen()) {
|
|
@@ -19331,6 +19507,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
19331
19507
|
break;
|
|
19332
19508
|
}
|
|
19333
19509
|
}
|
|
19510
|
+
this.isPropertyChanged = false;
|
|
19334
19511
|
}
|
|
19335
19512
|
reInitializePoup() {
|
|
19336
19513
|
if (this.popupObj) {
|
|
@@ -23339,11 +23516,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
23339
23516
|
e.preventDefault();
|
|
23340
23517
|
return;
|
|
23341
23518
|
}
|
|
23342
|
-
const
|
|
23343
|
-
|
|
23344
|
-
const isWordCharacter =
|
|
23345
|
-
const isWordAccentCharacter =
|
|
23346
|
-
if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter)) {
|
|
23519
|
+
const isSpecialKey = e.keyCode >= 186 && e.keyCode <= 192;
|
|
23520
|
+
const isNumericKeyPadSpecialKey = e.keyCode === 107 || e.keyCode === 109 || e.keyCode === 111;
|
|
23521
|
+
const isWordCharacter = e.key && e.key.match(/\w/);
|
|
23522
|
+
const isWordAccentCharacter = e.key && e.key.match(/[A-Za-z0-9\u00C0-\u024F ,>/:;\-+=]/);
|
|
23523
|
+
if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter) || isSpecialKey || isNumericKeyPadSpecialKey) {
|
|
23347
23524
|
this.isValidKey = true;
|
|
23348
23525
|
}
|
|
23349
23526
|
this.isBackSpace = e.keyCode === 8;
|