1
1
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2
- import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js" ;
2
+ import {
3
+ customElement , slot , property , eventStrict , i18n ,
4
+ } from "@ui5/webcomponents-base/dist/decorators.js" ;
3
5
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
4
- import slot from "@ui5/webcomponents-base/dist/decorators/slot.js" ;
5
- import property from "@ui5/webcomponents-base/dist/decorators/property.js" ;
6
- import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js" ;
7
- import { getScopedVarName } from "@ui5/webcomponents-base/dist/CustomElementsScope.js" ;
8
- import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js" ;
9
- import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js" ;
10
- import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js" ;
11
- import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
12
- import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js" ;
13
- import type { MoveEventDetail } from "@ui5/webcomponents-base/dist/util/dragAndDrop/DragRegistry.js" ;
14
6
import TableTemplate from "./generated/templates/TableTemplate.lit.js" ;
15
7
import TableStyles from "./generated/themes/Table.css.js" ;
16
- import TableRow from "./TableRow.js" ;
17
8
import TableHeaderRow from "./TableHeaderRow.js" ;
18
- import type TableHeaderCell from "./TableHeaderCell.js" ;
9
+ import TableRow from "./TableRow.js" ;
10
+ import TableCell from "./TableCell.js" ;
19
11
import TableExtension from "./TableExtension.js" ;
20
- import type TableSelection from "./TableSelection.js" ;
21
- import TableOverflowMode from "./types/TableOverflowMode.js" ;
22
12
import TableNavigation from "./TableNavigation.js" ;
13
+ import TableOverflowMode from "./types/TableOverflowMode.js" ;
14
+ import TableDragAndDrop from "./TableDragAndDrop.js" ;
23
15
import DropIndicator from "./DropIndicator.js" ;
24
- import {
25
- TABLE_NO_DATA ,
26
- } from "./generated/i18n/i18n-defaults.js" ;
27
16
import BusyIndicator from "./BusyIndicator.js" ;
28
- import TableCell from "./TableCell .js" ;
17
+ import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler .js" ;
29
18
import { findVerticalScrollContainer , scrollElementIntoView , isFeature } from "./TableUtils.js" ;
30
- import TableDragAndDrop from "./TableDragAndDrop.js" ;
19
+ import { getScopedVarName } from "@ui5/webcomponents-base/dist/CustomElementsScope.js" ;
20
+ import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js" ;
21
+ import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js" ;
22
+ import type { MoveEventDetail } from "@ui5/webcomponents-base/dist/util/dragAndDrop/DragRegistry.js" ;
23
+ import type TableHeaderCell from "./TableHeaderCell.js" ;
24
+ import type TableSelection from "./TableSelection.js" ;
31
25
import type TableRowActionBase from "./TableRowActionBase.js" ;
32
26
import type TableVirtualizer from "./TableVirtualizer.js" ;
27
+ import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
28
+ import {
29
+ TABLE_NO_DATA ,
30
+ } from "./generated/i18n/i18n-defaults.js" ;
33
31
34
32
/**
35
33
* Interface for components that can be slotted inside the `features` slot of the `ui5-table`.
@@ -70,6 +68,7 @@ interface ITableGrowing extends ITableFeature {
70
68
71
69
/**
72
70
* Fired when an interactive row is clicked.
71
+ *
73
72
* @param {TableRow } row The clicked row instance
74
73
* @public
75
74
*/
@@ -81,6 +80,7 @@ type TableMoveEventDetail = MoveEventDetail;
81
80
82
81
/**
83
82
* Fired when a row action is clicked.
83
+ *
84
84
* @param {TableRowActionBase } action The row action instance
85
85
* @param {TableRow } row The row instance
86
86
* @public
@@ -192,7 +192,7 @@ type TableRowActionClickEventDetail = {
192
192
* @param {TableRow } row The row instance
193
193
* @public
194
194
*/
195
- @event ( "row-click" , {
195
+ @eventStrict ( "row-click" , {
196
196
bubbles : false ,
197
197
} )
198
198
@@ -209,7 +209,7 @@ type TableRowActionClickEventDetail = {
209
209
* @param {object } destination The destination object
210
210
* @public
211
211
*/
212
- @event ( "move-over" , {
212
+ @eventStrict ( "move-over" , {
213
213
cancelable : true ,
214
214
bubbles : true ,
215
215
} )
@@ -229,7 +229,7 @@ type TableRowActionClickEventDetail = {
229
229
* @param {object } destination The destination object
230
230
* @public
231
231
*/
232
- @event ( "move" , {
232
+ @eventStrict ( "move" , {
233
233
bubbles : true ,
234
234
} )
235
235
@@ -241,7 +241,7 @@ type TableRowActionClickEventDetail = {
241
241
* @since 2.6.0
242
242
* @public
243
243
*/
244
- @event ( "row-action-click" , {
244
+ @eventStrict ( "row-action-click" , {
245
245
bubbles : false ,
246
246
} )
247
247
@@ -289,6 +289,7 @@ class Table extends UI5Element {
289
289
290
290
/**
291
291
* Defines the features of the component.
292
+ *
292
293
* @public
293
294
*/
294
295
@slot ( { type : HTMLElement , individualSlots : true } )
@@ -348,6 +349,7 @@ class Table extends UI5Element {
348
349
349
350
/**
350
351
* Defines the delay in milliseconds, after which the loading indicator will show up for this component.
352
+ *
351
353
* @default 1000
352
354
* @public
353
355
*/
@@ -386,13 +388,12 @@ class Table extends UI5Element {
386
388
_onResizeBound : ResizeObserverCallback ;
387
389
_tableNavigation ?: TableNavigation ;
388
390
_tableDragAndDrop ?: TableDragAndDrop ;
389
- _poppedIn : Array < { col : TableHeaderCell , width : float } > ;
390
- _containerWidth : number ;
391
+ _poppedIn : Array < { col : TableHeaderCell , width : float } > = [ ] ;
392
+ _containerWidth = 0 ;
393
+ _rowsLength = 0 ;
391
394
392
395
constructor ( ) {
393
396
super ( ) ;
394
- this . _poppedIn = [ ] ;
395
- this . _containerWidth = 0 ;
396
397
this . _onResizeBound = this . _onResize . bind ( this ) ;
397
398
this . _onEventBound = this . _onEvent . bind ( this ) ;
398
399
}
@@ -420,6 +421,10 @@ class Table extends UI5Element {
420
421
this . _renderNavigated = this . rows . some ( row => row . navigated ) ;
421
422
if ( this . headerRow [ 0 ] ) {
422
423
this . headerRow [ 0 ] . _rowActionCount = this . rowActionCount ;
424
+ if ( this . _getSelection ( ) ?. isMultiSelect ( ) && this . _rowsLength !== this . rows . length ) {
425
+ this . _rowsLength = this . rows . length ;
426
+ this . headerRow [ 0 ] . _invalidate ++ ;
427
+ }
423
428
}
424
429
this . rows . forEach ( row => {
425
430
row . _renderNavigated = this . _renderNavigated ;
0 commit comments