* @class * * ### Overview * * The `ui5-table-selection` component is used inside the `ui5-table` to add key-based selection capabilities to the `ui5-table`. * * The component offers three selection modes: * * Single - select a single row. * * Multiple - select multiple rows. * * None - no s
| 51 | * @experimental This web component is available since 2.0 with an experimental flag and its API and behavior are subject to change. |
| 52 | */ |
| 53 | @customElement({ tag: "ui5-table-selection" }) |
| 54 | |
| 55 | /** |
| 56 | * Fired when the selection is changed by user interaction. |
| 57 | * |
| 58 | * @public |
| 59 | */ |
| 60 | @event("change", { |
| 61 | bubbles: true, |
| 62 | }) |
| 63 | |
| 64 | class TableSelection extends UI5Element implements ITableFeature { |
| 65 | eventDetails!: { |
| 66 | change: void, |
| 67 | } |
| 68 | /** |
| 69 | * Defines the selection mode. |
| 70 | * |
| 71 | * @default "Multiple" |
| 72 | * @public |
| 73 | */ |
| 74 | @property() |
| 75 | mode: `${TableSelectionMode}` = "Multiple"; |
| 76 | |
| 77 | /** |
| 78 | * Defines the selected rows separated by a space. |
| 79 | * |
| 80 | * @default "" |
| 81 | * @public |
| 82 | */ |
| 83 | @property() |
| 84 | selected = ""; |
| 85 | |
| 86 | readonly identifier = "TableSelection"; |
| 87 | _table?: Table; |
| 88 | _rowsLength = 0; |
| 89 | _rangeSelection?: {selected: boolean, isUp: boolean | null, rows: TableRow[], isMouse: boolean, shiftPressed: boolean} | null; |
| 90 | |
| 91 | onClickCaptureBound: (e: MouseEvent) => void; |
| 92 | |
| 93 | constructor() { |
| 94 | super(); |
| 95 | this.onClickCaptureBound = this._onClickCapture.bind(this); |
| 96 | } |
| 97 | |
| 98 | onTableActivate(table: Table) { |
| 99 | this._table = table; |
| 100 | this._invalidateTableAndRows(); |
| 101 | } |
| 102 | |
| 103 | onExitDOM() { |
| 104 | this.mode = TableSelectionMode.None; |
| 105 | this._invalidateTableAndRows(); |
| 106 | this._table = undefined; |
| 107 | } |
| 108 | |
| 109 | onBeforeRendering() { |
| 110 | this._invalidateTableAndRows(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…