* @class * * ### Overview * * The `ui5-table-virtualizer` component is used inside the `ui5-table` to virtualize the table rows, if the `overflowMode` property of the table is set to 'Scroll'. * It is responsible for rendering only the rows that are visible in the viewport and updating them on
| 64 | * @experimental This component is not intended to be used in a productive enviroment. The API is under development and may be changed in the future. |
| 65 | */ |
| 66 | @customElement({ tag: "ui5-table-virtualizer" }) |
| 67 | |
| 68 | /** |
| 69 | * Fired when the virtualizer is changed by user interaction e.g. on scrolling. |
| 70 | * |
| 71 | * @param {number} first The 0-based index of the first children currently rendered |
| 72 | * @param {number} last The 0-based index of the last children currently rendered |
| 73 | * @public |
| 74 | */ |
| 75 | @event("range-change") |
| 76 | |
| 77 | class TableVirtualizer extends UI5Element implements ITableFeature { |
| 78 | eventDetails!: { |
| 79 | "range-change": RangeChangeEventDetail |
| 80 | } |
| 81 | /** |
| 82 | * Defines the height of the rows in the table. |
| 83 | * |
| 84 | * **Note:** For virtualization to work properly, this property is mandatory. |
| 85 | * |
| 86 | * @default 45 |
| 87 | * @public |
| 88 | */ |
| 89 | @property({ type: Number }) |
| 90 | rowHeight = 45; |
| 91 | |
| 92 | /** |
| 93 | * Defines the total count of rows in the table. |
| 94 | * |
| 95 | * **Note:** For virtualization to work properly, this property is mandatory. |
| 96 | * |
| 97 | * @default 100 |
| 98 | * @public |
| 99 | */ |
| 100 | @property({ type: Number }) |
| 101 | rowCount = 100; |
| 102 | |
| 103 | /** |
| 104 | * Defines the count of extra rows to be rendered at the top and bottom of the table. |
| 105 | * |
| 106 | * **Note:** This property is experimental and may be changed or deleted in the future. |
| 107 | * |
| 108 | * @default 0 |
| 109 | * @public |
| 110 | */ |
| 111 | @property({ type: Number }) |
| 112 | extraRows = 0; |
| 113 | |
| 114 | readonly identifier = "TableVirtualizer"; |
| 115 | |
| 116 | _table?: Table; |
| 117 | _lastRowPosition: number = 0; |
| 118 | _firstRowPosition: number = 0; |
| 119 | _visibleRowCount: number = 0; |
| 120 | _tabBlockingState: TabBlocking = TabBlocking.None; |
| 121 | _onRowInvalidateBound: (invalidationInfo: InvalidationInfo) => void; |
| 122 | _onScrollBound: () => void; |
| 123 |
nothing calls this directly
no test coverage detected