Skip to content

Commit cac45b4

Browse files
committed
chore(combo): rename textValue to displayText
1 parent 90f9868 commit cac45b4

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ All notable changes for each version of this project will be documented in this
8484
- adding `IgxSelectHeaderDirective` and `IgxSelectFooterDirective`. These can be used to provide a custom header, respectively footer templates for the `igxSelect` drop-down list. If there are no templates marked with these directives - no default templates will be used so the drop-down list will not have header nor footer.
8585

8686
- `IgxCombo`:
87-
- Added `textValue` property to the combo's `onSelectionChange` event args. The property contains the text that will be populated in the combo's text box **after** selection completes. This text can be overwritten in order to display a custom message, e.g. "3 items selected":
87+
- Added `displayText` property to the combo's `onSelectionChange` event args. The property contains the text that will be populated in the combo's text box **after** selection completes. This text can be overwritten in order to display a custom message, e.g. "3 items selected":
8888
```html
8989
<igx-combo [data]="people" valueKey="id" displayKey="name" placeholder="Invite friends..." (onSelectionChange)="handleSelection($event)">
9090
```
@@ -94,7 +94,7 @@ All notable changes for each version of this project will be documented in this
9494
...
9595
handleSelection(event: IComboSelectionChangeEventArgs) {
9696
const count = event.newSelection.length;
97-
event.textValue = count > 0 ? `${count} friend(s) invited!` : `No friends invited :(`;
97+
event.displayText = count > 0 ? `${count} friend(s) invited!` : `No friends invited :(`;
9898
}
9999
...
100100
}

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ describe('igxCombo', () => {
10201020
newSelection: [targetItem.itemID],
10211021
added: [targetItem.itemID],
10221022
removed: [],
1023-
textValue: `${targetItem.value[combo.displayKey]}`,
1023+
displayText: `${targetItem.value[combo.displayKey]}`,
10241024
event: undefined,
10251025
cancel: false
10261026
});
@@ -1035,7 +1035,7 @@ describe('igxCombo', () => {
10351035
newSelection: [],
10361036
added: [],
10371037
removed: [targetItem.itemID],
1038-
textValue: '',
1038+
displayText: '',
10391039
event: undefined,
10401040
cancel: false
10411041
});
@@ -1065,7 +1065,7 @@ describe('igxCombo', () => {
10651065
newSelection: newSelectionKeys,
10661066
added: newSelectionKeys,
10671067
removed: [],
1068-
textValue: newSelection.map(entry => entry[combo.valueKey]).join(', '),
1068+
displayText: newSelection.map(entry => entry[combo.valueKey]).join(', '),
10691069
event: undefined,
10701070
cancel: false
10711071
});
@@ -1082,7 +1082,7 @@ describe('igxCombo', () => {
10821082
newSelection: newSelectionKeys,
10831083
removed: [],
10841084
added: [newItem[combo.valueKey]],
1085-
textValue: newSelectionKeys.join(', '),
1085+
displayText: newSelectionKeys.join(', '),
10861086
event: undefined,
10871087
cancel: false
10881088
});
@@ -1098,7 +1098,7 @@ describe('igxCombo', () => {
10981098
newSelection: newSelectionKeys,
10991099
removed: oldSelection,
11001100
added: [combo.data[0][combo.valueKey]],
1101-
textValue: combo.data[0][combo.valueKey],
1101+
displayText: combo.data[0][combo.valueKey],
11021102
event: undefined,
11031103
cancel: false
11041104
});
@@ -1115,7 +1115,7 @@ describe('igxCombo', () => {
11151115
oldSelection: oldSelection,
11161116
newSelection: newSelection,
11171117
removed: [newItem],
1118-
textValue: ``,
1118+
displayText: ``,
11191119
added: [],
11201120
event: undefined,
11211121
cancel: false
@@ -1438,7 +1438,7 @@ describe('igxCombo', () => {
14381438
newSelection: [],
14391439
added: [],
14401440
removed: [],
1441-
textValue: '',
1441+
displayText: '',
14421442
event: mockEvent,
14431443
cancel: false
14441444
};
@@ -1458,14 +1458,14 @@ describe('igxCombo', () => {
14581458

14591459
eventParams.newSelection = [dropdown.items[3].value];
14601460
eventParams.added = [dropdown.items[3].value];
1461-
eventParams.textValue = dropdown.items[3].value;
1461+
eventParams.displayText = dropdown.items[3].value;
14621462
verifyOnSelectionChangeEventIsFired(3);
14631463
timesFired++;
14641464

14651465
eventParams.oldSelection = [dropdown.items[3].value];
14661466
eventParams.newSelection = [dropdown.items[3].value, dropdown.items[7].value];
14671467
eventParams.added = [dropdown.items[7].value];
1468-
eventParams.textValue = `${dropdown.items[3].value}, ${dropdown.items[7].value}`;
1468+
eventParams.displayText = `${dropdown.items[3].value}, ${dropdown.items[7].value}`;
14691469
verifyOnSelectionChangeEventIsFired(7);
14701470
timesFired++;
14711471

@@ -1474,7 +1474,7 @@ describe('igxCombo', () => {
14741474
eventParams.newSelection = [dropdown.items[3].value];
14751475
eventParams.added = [];
14761476
eventParams.removed = [dropdown.items[7].value];
1477-
eventParams.textValue = dropdown.items[3].value;
1477+
eventParams.displayText = dropdown.items[3].value;
14781478
verifyOnSelectionChangeEventIsFired(7);
14791479
}));
14801480
it('Should be able to select item when in grouped state', fakeAsync(() => {
@@ -1614,7 +1614,7 @@ describe('igxCombo', () => {
16141614
added: [combo.data[0][combo.valueKey]],
16151615
removed: [],
16161616
event: undefined,
1617-
textValue: `${combo.data[0][combo.displayKey]}`,
1617+
displayText: `${combo.data[0][combo.displayKey]}`,
16181618
cancel: false
16191619
};
16201620
combo.selectItems([combo.data[0][combo.valueKey]]);
@@ -1623,7 +1623,7 @@ describe('igxCombo', () => {
16231623
newSelection: [],
16241624
oldSelection: [combo.data[0][combo.valueKey]],
16251625
added: [],
1626-
textValue: '',
1626+
displayText: '',
16271627
removed: [combo.data[0][combo.valueKey]]
16281628
});
16291629
combo.deselectItems([combo.data[0][combo.valueKey]]);
@@ -1643,7 +1643,7 @@ describe('igxCombo', () => {
16431643
added: newSelection.map(e => e[combo.valueKey]),
16441644
removed: [],
16451645
event: undefined,
1646-
textValue: `${newSelection.map(entry => entry[combo.displayKey]).join(', ')}`,
1646+
displayText: `${newSelection.map(entry => entry[combo.displayKey]).join(', ')}`,
16471647
cancel: false
16481648
};
16491649
combo.selectItems(newSelection.map(e => e[combo.valueKey]));
@@ -1655,7 +1655,7 @@ describe('igxCombo', () => {
16551655
newSelection: newSelection.map(e => e[combo.valueKey]),
16561656
oldSelection,
16571657
added: [],
1658-
textValue: newSelection.map(e => e[combo.displayKey]).join(', '),
1658+
displayText: newSelection.map(e => e[combo.displayKey]).join(', '),
16591659
removed: [combo.data[0][combo.valueKey]]
16601660
});
16611661
oldSelection = [...newSelection].map(e => e[combo.valueKey]);
@@ -1665,7 +1665,7 @@ describe('igxCombo', () => {
16651665
newSelection: newSelection.map(e => e[combo.valueKey]),
16661666
oldSelection,
16671667
added: newSelection.map(e => e[combo.valueKey]),
1668-
textValue: newSelection.map(e => e[combo.displayKey]).join(', '),
1668+
displayText: newSelection.map(e => e[combo.displayKey]).join(', '),
16691669
removed: oldSelection
16701670
});
16711671
combo.selectItems(newSelection.map(e => e[combo.valueKey]), true);

projects/igniteui-angular/src/lib/combo/combo.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export interface IComboSelectionChangeEventArgs extends CancelableEventArgs, IBa
9494
/** The text that will be displayed in the combo text box
9595
* If the combo is **remote**, this will be empty
9696
*/
97-
textValue: string;
97+
displayText: string;
9898
/** The user interaction that triggered the selection change */
9999
event?: Event;
100100
}
@@ -1387,14 +1387,14 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
13871387
const removed = diffInSets(this.selection.get(this.id), newSelection);
13881388
const added = diffInSets(newSelection, this.selection.get(this.id));
13891389
const newSelectionAsArray = Array.from(newSelection);
1390-
const text = this.concatTextValue(newSelectionAsArray);
1390+
const text = this.concatDisplayText(newSelectionAsArray);
13911391
const args: IComboSelectionChangeEventArgs = {
13921392
newSelection: newSelectionAsArray,
13931393
oldSelection: Array.from(this.selection.get(this.id) || []),
13941394
added,
13951395
removed,
13961396
event,
1397-
textValue: text,
1397+
displayText: text,
13981398
cancel: false
13991399
};
14001400
this.onSelectionChange.emit(args);
@@ -1413,7 +1413,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
14131413
this.registerRemoteEntries(args.oldSelection, false);
14141414
}
14151415
} else {
1416-
value = this.concatTextValue(args.newSelection);
1416+
value = this.concatDisplayText(args.newSelection);
14171417
}
14181418
this._value = value;
14191419
this._onChangeCallback(args.newSelection);
@@ -1423,7 +1423,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
14231423
/** Returns a string that should be populated in the combo's text box
14241424
* If the combo is remote, returns an empty string (as the items may not be loaded yet)
14251425
*/
1426-
private concatTextValue(selection: any[]): string {
1426+
private concatDisplayText(selection: any[]): string {
14271427
if (this.isRemote) { return ''; }
14281428
const value = this.displayKey !== null && this.displayKey !== undefined ?
14291429
this.convertKeysToItems(selection).map(entry => entry[this.displayKey]).join(', ') :

0 commit comments

Comments
 (0)