-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui5-table): add label component for the header cell
- Loading branch information
Showing
11 changed files
with
245 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/website/docs/_components_pages/main/Table/TableHeaderCellActionAI.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
slug: ../../TableHeaderCellActionAI | ||
sidebar_class_name: expComponentBadge | ||
--- | ||
|
||
import HeaderCellActionAI from "../../../_samples/main/Table/HeaderCellActionAI/HeaderCellActionAI.md"; | ||
|
||
<%COMPONENT_OVERVIEW%> | ||
|
||
<%COMPONENT_METADATA%> | ||
|
||
## Basic Sample | ||
|
||
<HeaderCellActionAI/> |
6 changes: 6 additions & 0 deletions
6
packages/website/docs/_samples/main/Table/HeaderCellActionAI/HeaderCellActionAI.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import html from '!!raw-loader!./sample.html'; | ||
import js from '!!raw-loader!./main.js'; | ||
|
||
To indicate that the column is generated by an AI model, you can add an action to the header cell. This is done by adding a `ui5-table-header-cell-action-ai` component to the `action` slot of the `ui5-table-header-cell`. | ||
|
||
<Editor html={html} js={js} /> |
21 changes: 21 additions & 0 deletions
21
packages/website/docs/_samples/main/Table/HeaderCellActionAI/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import "@ui5/webcomponents/dist/Table.js"; | ||
import "@ui5/webcomponents/dist/TableRow.js"; | ||
import "@ui5/webcomponents/dist/TableCell.js"; | ||
import "@ui5/webcomponents/dist/TableHeaderRow.js"; | ||
import "@ui5/webcomponents/dist/TableHeaderCell.js"; | ||
import "@ui5/webcomponents/dist/TableHeaderCellActionAI.js"; | ||
import "@ui5/webcomponents/dist/Text.js"; | ||
import "@ui5/webcomponents/dist/Label.js"; | ||
import "@ui5/webcomponents/dist/Popover.js"; | ||
|
||
function showGeneratedByAIPopover(e) { | ||
const popover = document.getElementById("generatedByAIPopover"); | ||
popover.opener = e.detail.targetRef; | ||
popover.open = true; | ||
} | ||
|
||
const aiActionProduct = document.getElementById("aiActionProduct"); | ||
const aiActionPrice = document.getElementById("aiActionPrice"); | ||
|
||
aiActionProduct.addEventListener("click", showGeneratedByAIPopover); | ||
aiActionPrice.addEventListener("click", showGeneratedByAIPopover); |
66 changes: 66 additions & 0 deletions
66
packages/website/docs/_samples/main/Table/HeaderCellActionAI/sample.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!-- playground-fold --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sample</title> | ||
</head> | ||
|
||
<body style="background-color: var(--sapBackgroundColor)"> | ||
<div class="section"> | ||
<ui5-table id="table" overflow-mode="Popin"> | ||
<ui5-table-header-row slot="headerRow"> | ||
<!-- playground-fold-end --> | ||
<ui5-table-header-cell id="produtCol" width="200px"> | ||
<ui5-label required>Product</ui5-label> | ||
<ui5-table-header-cell-action-ai slot="action" id="aiActionProduct"></ui5-table-header-cell-action-ai> | ||
</ui5-table-header-cell> | ||
<!-- playground-fold --> | ||
<ui5-table-header-cell id="supplierCol">Supplier</ui5-table-header-cell> | ||
<ui5-table-header-cell id="dimensionsCol" importance="-1">Dimensions</ui5-table-header-cell> | ||
<ui5-table-header-cell id="weightCol" popin-text="Weight">Weight</ui5-table-header-cell> | ||
<!-- playground-fold-end --> | ||
<ui5-table-header-cell id="priceCol" min-width="100px" horizontal-align="End" popin-text="Price in Popin" sort-indicator="Descending"> | ||
<ui5-label>Price</ui5-label> | ||
<ui5-table-header-cell-action-ai slot="action" id="aiActionPrice"></ui5-table-header-cell-action-ai> | ||
</ui5-table-header-cell> | ||
<!-- playground-fold --> | ||
</ui5-table-header-row> | ||
<ui5-table-row row-key="0"> | ||
<ui5-table-cell><ui5-label><b>Notebook Basic 17</b><br>HT-1001</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>Smartcards</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>29 x 17 x 3.1 cm</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label style="color: #2b7c2b"><b>4.5</b> KG</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label><b>1249</b> EUR</ui5-label></ui5-table-cell> | ||
</ui5-table-row> | ||
<ui5-table-row row-key="1"> | ||
<ui5-table-cell><ui5-label><b>Notebook Basic 15</b><br>HT-1000</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>Very Best Screens</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>30 x 18 x 3 cm</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label style="color: #2b7c2b"><b>4.2</b> KG</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label><b>956</b> EUR</ui5-label></ui5-table-cell> | ||
</ui5-table-row> | ||
<ui5-table-row row-key="2"> | ||
<ui5-table-cell><ui5-label><b>Notebook Basic 18</b><br>HT-1002</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>Technocom</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label>32 x 21 x 4 cm</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label style="color: #2b7c2b"><b>3.7</b> KG</ui5-label></ui5-table-cell> | ||
<ui5-table-cell><ui5-label><b>290</b> EUR</ui5-label></ui5-table-cell> | ||
</ui5-table-row> | ||
</ui5-table> | ||
<!-- playground-fold-end --> | ||
<ui5-popover id="generatedByAIPopover" style="width: 25rem;"> | ||
<ui5-text> | ||
This content was partially or fully generated by artificial intelligence (AI) technologies.<br><br> | ||
The AI-generated content may contain inaccuracies due to using multiple information sources. Verify results before use. | ||
</ui5-text> | ||
</ui5-popover> | ||
<!-- playground-fold --> | ||
</div> | ||
<script type="module" src="main.js"></script> | ||
</body> | ||
|
||
</html> | ||
<!-- playground-fold-end --> |