Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/main/src/ColorPaletteItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ class ColorPaletteItem extends UI5Element implements IColorPaletteItem {
@property({ type: Boolean })
selected = false;

/**
* Defines the tooltip of the component. If not provided, a default tooltip will be set to the color value.
*
* @default ""
* @public
* @since 2.1x.0
*/
@property()
tooltip = ""

/**
* Defines the tab-index of the element, helper information for the ItemNavigation.
* @private
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/ColorPaletteItemTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function ColorPaletteItemTemplate(this: ColorPaletteItem) {
role="button"
aria-label={`${this.colorLabel} - ${this.index}: ${this.value}`}
aria-pressed={this.selected}
title={`${this.colorLabel} - ${this.index}: ${this.value}`}
title={`${this.colorLabel} - ${this.index}: ${this.tooltip ? this.tooltip : this.value}`}
></div>
);
}
4 changes: 2 additions & 2 deletions packages/main/test/pages/ColorPalette.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ui5-color-palette id="cp1SelectedTest">
<ui5-color-palette-item value="darkblue" selected></ui5-color-palette-item>
<ui5-color-palette-item value="pink" selected></ui5-color-palette-item>
<ui5-color-palette-item value="#444444" selected></ui5-color-palette-item>
<ui5-color-palette-item value="#444444" tooltip="charcoal" selected></ui5-color-palette-item>
<ui5-color-palette-item value="rgb(0,200,0)" selected></ui5-color-palette-item>
<ui5-color-palette-item value="green"></ui5-color-palette-item>
<ui5-color-palette-item value="darkred"></ui5-color-palette-item>
Expand All @@ -32,7 +32,7 @@
<ui5-color-palette-item value="cyan"></ui5-color-palette-item>
<ui5-color-palette-item value="orange"></ui5-color-palette-item>
<ui5-color-palette-item value="#5480e7"></ui5-color-palette-item>
<ui5-color-palette-item value="#ff6699"></ui5-color-palette-item>
<ui5-color-palette-item value="#ff6699" tooltip="brilliant rose"></ui5-color-palette-item>
</ui5-color-palette>
<br/>
<br/>
Expand Down
Loading