diff --git a/CHANGELOG.md b/CHANGELOG.md index 230ee049f..690ef8eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v14.8.8 (2023-08-11) +* **suggest** add custom tooltip +* **a11y** make columns reset button focusable +* **chore** bump version to v14.8.7 + # v14.8.7 (2023-07-20) * **grid** arrow cursor on grid header text diff --git a/package-lock.json b/package-lock.json index 49ae3f5eb..99117f4b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "angular-components", - "version": "14.8.7", + "version": "14.8.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "angular-components", - "version": "14.8.7", + "version": "14.8.8", "license": "MIT", "dependencies": { "@angular/animations": "14.2.12", diff --git a/package.json b/package.json index e5079ce14..797a68f14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-components", - "version": "14.8.7", + "version": "14.8.8", "author": { "name": "UiPath Inc", "url": "https://uipath.com" diff --git a/projects/angular/components/ui-suggest/src/models/suggestValue.ts b/projects/angular/components/ui-suggest/src/models/suggestValue.ts index 0882e747e..5989f3131 100644 --- a/projects/angular/components/ui-suggest/src/models/suggestValue.ts +++ b/projects/angular/components/ui-suggest/src/models/suggestValue.ts @@ -53,4 +53,9 @@ export interface ISuggestValue extends VirtualScrollItem { svgIcon?: string; matIcon?: string; }; + + /** + * Tooltip associated to the entry. + */ + tooltip?: string; } diff --git a/projects/angular/components/ui-suggest/src/ui-suggest.component.html b/projects/angular/components/ui-suggest/src/ui-suggest.component.html index 70acfba0a..5ce9017e9 100644 --- a/projects/angular/components/ui-suggest/src/ui-suggest.component.html +++ b/projects/angular/components/ui-suggest/src/ui-suggest.component.html @@ -100,28 +100,31 @@ (keydown.esc)="preventDefault($event)" (keydown.tab)="close(false)" (keydown.shift.tab)="close()"> - - - - - {{option?.icon?.matIcon}} - - - {{ intl.translateLabel(option.text) }} - - - + + + + + + {{option?.icon?.matIcon}} + + + {{ intl.translateLabel(option.text) }} + + + + -
diff --git a/projects/angular/components/ui-suggest/src/ui-suggest.component.spec.ts b/projects/angular/components/ui-suggest/src/ui-suggest.component.spec.ts index b152dc0d1..54512b9b4 100644 --- a/projects/angular/components/ui-suggest/src/ui-suggest.component.spec.ts +++ b/projects/angular/components/ui-suggest/src/ui-suggest.component.spec.ts @@ -1456,7 +1456,7 @@ const sharedSpecifications = ( discardPeriodicTasks(); })); - it('should NOT be able to remove chip if readonly', fakeAsync(() => { + it('should NOT show remove button if chip is readonly', fakeAsync(() => { const items = component.items!.slice(0, 3); component.value = items; component.readonly = true; @@ -1466,19 +1466,7 @@ const sharedSpecifications = ( const initialChips = fixture.debugElement.queryAll(By.css('.mat-chip')); expect(initialChips.length).toBe(3); - const chipRemoveButton = getNativeElement(initialChips[1].query(By.css('button'))); - chipRemoveButton.click(); - - fixture.detectChanges(); - tick(5000); - - const updatedChips = fixture.debugElement - .queryAll(By.css('.mat-chip span')) - .map(el => getNativeElement(el)); - - expect(updatedChips.length).toEqual(3); - expect(updatedChips.map(chip => chip.innerText)).toEqual(items.map(item => item.text)); - + expect(initialChips[1].query(By.css('button'))).toBeFalsy(); discardPeriodicTasks(); })); }); diff --git a/projects/angular/components/ui-suggest/src/ui-suggest.component.ts b/projects/angular/components/ui-suggest/src/ui-suggest.component.ts index 7297f9bfb..1a7670527 100644 --- a/projects/angular/components/ui-suggest/src/ui-suggest.component.ts +++ b/projects/angular/components/ui-suggest/src/ui-suggest.component.ts @@ -331,7 +331,7 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective !this.isOpen && this._hasValue ) { - return this._getValueSummary(); + return this._getValueSummary(true); } return null; @@ -1719,11 +1719,12 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective }); } - private _getValueSummary() { - return (this.displayValueFactory ?? this._defaultDisplayValueFactory)(this.value); + private _getValueSummary(fromTooltip = false) { + return (this.displayValueFactory ?? this._defaultDisplayValueFactory)(this.value, fromTooltip); } - private _defaultDisplayValueFactory = (value?: ISuggestValue[]) => (value ?? []).map(v => this.intl.translateLabel(v.text)).join(', '); + private _defaultDisplayValueFactory = (value?: ISuggestValue[], fromTooltip = false) => + (value ?? []).map(v => this.intl.translateLabel((fromTooltip && v.tooltip) || v.text)).join(', '); private _cantNavigate(increment: number) { return (!this.items.length && diff --git a/projects/angular/package.json b/projects/angular/package.json index 34643a748..c0f38b575 100644 --- a/projects/angular/package.json +++ b/projects/angular/package.json @@ -1,6 +1,6 @@ { "name": "@uipath/angular", - "version": "14.8.7", + "version": "14.8.8", "license": "MIT", "author": { "name": "UiPath Inc",