MCPcopy Index your code
hub / github.com/UI5/webcomponents / TableSelection

Class TableSelection

packages/main/src/TableSelection.ts:53–406  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

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
64class 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();

Callers

nothing calls this directly

Calls 3

customElementFunction · 0.85
propertyFunction · 0.85
eventFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…