@ui5/webcomponents-compat 0.0.0-0dd36ca4b → 0.0.0-38f83ffef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.testing +4 -0
- package/CHANGELOG.md +613 -0
- package/README.md +1 -4
- package/cypress.config.js +3 -0
- package/dist/Table.d.ts +22 -27
- package/dist/Table.js +128 -76
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.d.ts +0 -1
- package/dist/TableCell.js +21 -6
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCellTemplate.d.ts +2 -0
- package/dist/TableCellTemplate.js +5 -0
- package/dist/TableCellTemplate.js.map +1 -0
- package/dist/TableColumn.d.ts +3 -3
- package/dist/TableColumn.js +47 -7
- package/dist/TableColumn.js.map +1 -1
- package/dist/TableColumnTemplate.d.ts +2 -0
- package/dist/TableColumnTemplate.js +5 -0
- package/dist/TableColumnTemplate.js.map +1 -0
- package/dist/TableGroupRow.d.ts +6 -4
- package/dist/TableGroupRow.js +26 -21
- package/dist/TableGroupRow.js.map +1 -1
- package/dist/TableGroupRowTemplate.d.ts +2 -0
- package/dist/TableGroupRowTemplate.js +5 -0
- package/dist/TableGroupRowTemplate.js.map +1 -0
- package/dist/TableRow.d.ts +14 -9
- package/dist/TableRow.js +101 -43
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRowTemplate.d.ts +2 -0
- package/dist/TableRowTemplate.js +15 -0
- package/dist/TableRowTemplate.js.map +1 -0
- package/dist/TableTemplate.d.ts +2 -0
- package/dist/TableTemplate.js +20 -0
- package/dist/TableTemplate.js.map +1 -0
- package/dist/bundle.esm.d.ts +1 -1
- package/dist/bundle.esm.js +13 -7
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.scoped.config.d.ts +1 -0
- package/dist/bundle.scoped.config.js +5 -0
- package/dist/bundle.scoped.config.js.map +1 -0
- package/dist/bundle.scoped.esm.d.ts +1 -0
- package/dist/bundle.scoped.esm.js +1 -4
- package/dist/bundle.scoped.esm.js.map +1 -1
- package/dist/css/themes/GrowingButton.css +1 -1
- package/dist/css/themes/Table.css +1 -1
- package/dist/css/themes/TableCell.css +1 -1
- package/dist/css/themes/TableColumn.css +1 -1
- package/dist/css/themes/TableGroupRow.css +1 -1
- package/dist/css/themes/TableRow.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +2462 -154
- package/dist/custom-elements.json +2312 -58
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +1 -1
- package/dist/generated/i18n/i18n-defaults.js +2 -3
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/json-imports/Themes-fetch.d.ts +1 -0
- package/dist/generated/json-imports/Themes-fetch.js +25 -0
- package/dist/generated/json-imports/Themes-fetch.js.map +1 -0
- package/dist/generated/json-imports/Themes-node.d.ts +1 -0
- package/dist/generated/json-imports/Themes-node.js +25 -0
- package/dist/generated/json-imports/Themes-node.js.map +1 -0
- package/dist/generated/json-imports/Themes.js.map +1 -1
- package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +120 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
- package/dist/generated/json-imports/i18n-node.d.ts +1 -0
- package/dist/generated/json-imports/i18n-node.js +120 -0
- package/dist/generated/json-imports/i18n-node.js.map +1 -0
- package/dist/generated/json-imports/i18n.js +2 -2
- package/dist/generated/json-imports/i18n.js.map +1 -1
- package/dist/generated/themes/GrowingButton.css.d.ts +2 -3
- package/dist/generated/themes/GrowingButton.css.js +2 -3
- package/dist/generated/themes/GrowingButton.css.js.map +1 -1
- package/dist/generated/themes/Table.css.d.ts +2 -3
- package/dist/generated/themes/Table.css.js +2 -3
- package/dist/generated/themes/Table.css.js.map +1 -1
- package/dist/generated/themes/TableCell.css.d.ts +2 -3
- package/dist/generated/themes/TableCell.css.js +2 -3
- package/dist/generated/themes/TableCell.css.js.map +1 -1
- package/dist/generated/themes/TableColumn.css.d.ts +2 -3
- package/dist/generated/themes/TableColumn.css.js +2 -3
- package/dist/generated/themes/TableColumn.css.js.map +1 -1
- package/dist/generated/themes/TableGroupRow.css.d.ts +2 -3
- package/dist/generated/themes/TableGroupRow.css.js +2 -3
- package/dist/generated/themes/TableGroupRow.css.js.map +1 -1
- package/dist/generated/themes/TableRow.css.d.ts +2 -3
- package/dist/generated/themes/TableRow.css.js +2 -3
- package/dist/generated/themes/TableRow.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +2 -3
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +2 -3
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/web-types.json +11 -11
- package/package-scripts.cjs +4 -0
- package/package.json +13 -8
- package/src/TableCellTemplate.tsx +13 -0
- package/src/TableColumnTemplate.tsx +13 -0
- package/src/TableGroupRowTemplate.tsx +17 -0
- package/src/TableRowTemplate.tsx +92 -0
- package/src/TableTemplate.tsx +129 -0
- package/src/i18n/messagebundle_ca.properties +1 -1
- package/src/i18n/messagebundle_cs.properties +1 -1
- package/src/i18n/messagebundle_cy.properties +1 -1
- package/src/i18n/messagebundle_en_US_sappsd.properties +5 -296
- package/src/i18n/messagebundle_en_US_saptrc.properties +10 -301
- package/src/i18n/messagebundle_fi.properties +2 -2
- package/src/i18n/messagebundle_fr.properties +3 -3
- package/src/i18n/messagebundle_fr_CA.properties +3 -3
- package/src/i18n/messagebundle_it.properties +1 -1
- package/src/i18n/messagebundle_lv.properties +1 -1
- package/src/themes/GrowingButton.css +12 -12
- package/src/themes/Table.css +15 -22
- package/src/themes/TableGroupRow.css +1 -1
- package/src/themes/TableRow.css +37 -2
- package/src/themes/base/Table-parameters.css +1 -0
- package/src/themes/base/sizes-parameters.css +0 -1
- package/src/themes/sap_horizon/Table-parameters.css +1 -2
- package/src/themes/sap_horizon/parameters-bundle.css +0 -1
- package/src/themes/sap_horizon_dark/Table-parameters.css +1 -2
- package/src/themes/sap_horizon_dark/parameters-bundle.css +0 -1
- package/src/themes/sap_horizon_hcb/Table-parameters.css +1 -2
- package/src/themes/sap_horizon_hcw/Table-parameters.css +1 -2
- package/tsconfig.json +34 -26
- package/dist/generated/assets/i18n/messagebundle_in.json +0 -1
- package/dist/generated/templates/TableCellTemplate.lit.d.ts +0 -4
- package/dist/generated/templates/TableCellTemplate.lit.js +0 -5
- package/dist/generated/templates/TableCellTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableColumnTemplate.lit.d.ts +0 -4
- package/dist/generated/templates/TableColumnTemplate.lit.js +0 -5
- package/dist/generated/templates/TableColumnTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableGroupRowTemplate.lit.d.ts +0 -4
- package/dist/generated/templates/TableGroupRowTemplate.lit.js +0 -5
- package/dist/generated/templates/TableGroupRowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableRowTemplate.lit.d.ts +0 -4
- package/dist/generated/templates/TableRowTemplate.lit.js +0 -16
- package/dist/generated/templates/TableRowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableTemplate.lit.d.ts +0 -4
- package/dist/generated/templates/TableTemplate.lit.js +0 -15
- package/dist/generated/templates/TableTemplate.lit.js.map +0 -1
- package/src/Table.hbs +0 -121
- package/src/TableCell.hbs +0 -7
- package/src/TableColumn.hbs +0 -7
- package/src/TableGroupRow.hbs +0 -11
- package/src/TableRow.hbs +0 -85
- package/src/i18n/messagebundle_in.properties +0 -172
- package/src/themes/sap_horizon/TableColumn-parameters.css +0 -5
- package/src/themes/sap_horizon_dark/TableColumn-parameters.css +0 -5
package/dist/Table.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import type { ChangeInfo } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
3
|
import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
3
4
|
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
|
4
5
|
import type { ITabbable } from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
|
@@ -13,13 +14,13 @@ import TableMode from "./types/TableMode.js";
|
|
13
14
|
* Interface for components that may be slotted inside a `ui5-table` as rows
|
14
15
|
* @public
|
15
16
|
*/
|
16
|
-
interface ITableRow extends
|
17
|
+
interface ITableRow extends UI5Element, ITabbable {
|
17
18
|
mode: `${TableMode}`;
|
18
19
|
selected: boolean;
|
19
20
|
forcedBusy: boolean;
|
20
|
-
forcedAriaPosition
|
21
|
+
forcedAriaPosition?: string;
|
21
22
|
_columnsInfoString: string;
|
22
|
-
_columnsInfo
|
23
|
+
_columnsInfo?: Array<TableColumnInfo>;
|
23
24
|
tabbableElements: Array<HTMLElement>;
|
24
25
|
}
|
25
26
|
type TableColumnInfo = {
|
@@ -109,12 +110,18 @@ declare enum TableFocusTargetElement {
|
|
109
110
|
* @public
|
110
111
|
*/
|
111
112
|
declare class Table extends UI5Element {
|
113
|
+
eventDetails: {
|
114
|
+
"row-click": TableRowClickEventDetail;
|
115
|
+
"popin-change": TablePopinChangeEventDetail;
|
116
|
+
"load-more": void;
|
117
|
+
"selection-change": TableSelectionChangeEventDetail;
|
118
|
+
};
|
112
119
|
/**
|
113
120
|
* Defines the text that will be displayed when there is no data and `hideNoData` is not present.
|
114
|
-
* @default
|
121
|
+
* @default undefined
|
115
122
|
* @public
|
116
123
|
*/
|
117
|
-
noDataText
|
124
|
+
noDataText?: string;
|
118
125
|
/**
|
119
126
|
* Defines the text that will be displayed inside the growing button at the bottom of the table,
|
120
127
|
* meant for loading more rows upon press.
|
@@ -122,20 +129,20 @@ declare class Table extends UI5Element {
|
|
122
129
|
* **Note:** If not specified a built-in text will be displayed.
|
123
130
|
*
|
124
131
|
* **Note:** This property takes effect if `growing` is set to `Button`.
|
125
|
-
* @default
|
132
|
+
* @default undefined
|
126
133
|
* @since 2.0.0
|
127
134
|
* @public
|
128
135
|
*/
|
129
|
-
growingButtonText
|
136
|
+
growingButtonText?: string;
|
130
137
|
/**
|
131
138
|
* Defines the subtext that will be displayed under the `growingButtonText`.
|
132
139
|
*
|
133
140
|
* **Note:** This property takes effect if `growing` is set to `Button`.
|
134
|
-
* @default
|
141
|
+
* @default undefined
|
135
142
|
* @since 2.0.0
|
136
143
|
* @public
|
137
144
|
*/
|
138
|
-
growingButtonSubtext
|
145
|
+
growingButtonSubtext?: string;
|
139
146
|
/**
|
140
147
|
* Defines if the value of `noDataText` will be diplayed when there is no rows present in the table.
|
141
148
|
* @default false
|
@@ -215,12 +222,12 @@ declare class Table extends UI5Element {
|
|
215
222
|
accessibleName?: string;
|
216
223
|
/**
|
217
224
|
* Receives id(or many ids) of the elements that label the component.
|
218
|
-
* @default
|
225
|
+
* @default undefined
|
219
226
|
* @public
|
220
227
|
* @since 2.0.0
|
221
228
|
*/
|
222
|
-
accessibleNameRef
|
223
|
-
_hiddenColumns
|
229
|
+
accessibleNameRef?: string;
|
230
|
+
_hiddenColumns?: Array<TableColumnInfo>;
|
224
231
|
_noDataDisplayed: boolean;
|
225
232
|
/**
|
226
233
|
* Defines the active state of the `More` button.
|
@@ -232,11 +239,6 @@ declare class Table extends UI5Element {
|
|
232
239
|
* @private
|
233
240
|
*/
|
234
241
|
_columnHeader: TableColumnHeaderInfo;
|
235
|
-
/**
|
236
|
-
* Defines if the entire table is in view port.
|
237
|
-
* @private
|
238
|
-
*/
|
239
|
-
_inViewport: boolean;
|
240
242
|
/**
|
241
243
|
* Defines whether all rows are selected or not when table is in MultiSelect mode.
|
242
244
|
* @default false
|
@@ -258,12 +260,10 @@ declare class Table extends UI5Element {
|
|
258
260
|
* @public
|
259
261
|
*/
|
260
262
|
columns: Array<TableColumn>;
|
261
|
-
static onDefine(): Promise<void>;
|
262
263
|
static i18nBundle: I18nBundle;
|
263
264
|
fnHandleF7: (e: CustomEvent) => void;
|
264
265
|
fnOnRowFocused: (e: CustomEvent) => void;
|
265
266
|
_handleResize: ResizeObserverCallback;
|
266
|
-
moreDataText?: string;
|
267
267
|
tableEndObserved: boolean;
|
268
268
|
visibleColumns: Array<TableColumn>;
|
269
269
|
visibleColumnsCount?: number;
|
@@ -291,7 +291,7 @@ declare class Table extends UI5Element {
|
|
291
291
|
* Switches focus between column header, last focused item, and "More" button (if applicable).
|
292
292
|
* @private
|
293
293
|
*/
|
294
|
-
_handleArrowAlt(e: KeyboardEvent): void
|
294
|
+
_handleArrowAlt(e: KeyboardEvent): void | Promise<void>;
|
295
295
|
/**
|
296
296
|
* Determines the type of the currently focused element.
|
297
297
|
* @private
|
@@ -311,11 +311,13 @@ declare class Table extends UI5Element {
|
|
311
311
|
_getAfterForwardElement(): HTMLElement;
|
312
312
|
_getBeforeForwardElement(): HTMLElement;
|
313
313
|
onRowFocused(e: CustomEvent): void;
|
314
|
+
onRowKeyDown(e: KeyboardEvent): void;
|
314
315
|
_onColumnHeaderFocused(): void;
|
315
316
|
_onColumnHeaderClick(e: MouseEvent | KeyboardEvent): void;
|
316
317
|
_onColumnHeaderKeydown(e: KeyboardEvent): void;
|
317
318
|
_onLoadMoreKeydown(e: KeyboardEvent): void;
|
318
319
|
_onLoadMoreKeyup(e: KeyboardEvent): void;
|
320
|
+
onInvalidation(change: ChangeInfo): void;
|
319
321
|
_onLoadMoreClick(): void;
|
320
322
|
observeTableEnd(): void;
|
321
323
|
onInteresection(entries: Array<IntersectionObserverEntry>): void;
|
@@ -328,18 +330,12 @@ declare class Table extends UI5Element {
|
|
328
330
|
get columnHeader(): HTMLElement | null;
|
329
331
|
get morеBtn(): HTMLElement | null;
|
330
332
|
handleResize(): void;
|
331
|
-
checkTableInViewport(): void;
|
332
333
|
popinContent(): void;
|
333
334
|
/**
|
334
335
|
* Gets settings to be propagated from columns to rows.
|
335
336
|
*/
|
336
337
|
getColumnPropagationSettings(): Array<TableColumnInfo>;
|
337
338
|
getIntersectionObserver(): IntersectionObserver;
|
338
|
-
get styles(): {
|
339
|
-
busy: {
|
340
|
-
position: string;
|
341
|
-
};
|
342
|
-
};
|
343
339
|
get growsWithButton(): boolean;
|
344
340
|
get growsOnScroll(): boolean;
|
345
341
|
get _growingButtonText(): string;
|
@@ -348,7 +344,6 @@ declare class Table extends UI5Element {
|
|
348
344
|
get ariaLabelSelectAllText(): string;
|
349
345
|
get loadMoreAriaLabelledBy(): string;
|
350
346
|
get tableEndDOM(): Element;
|
351
|
-
get busyIndPosition(): string;
|
352
347
|
get isMultiSelect(): boolean;
|
353
348
|
get isSingleSelect(): boolean;
|
354
349
|
get selectedRows(): Array<ITableRow>;
|
package/dist/Table.js
CHANGED
@@ -8,29 +8,25 @@ var Table_1;
|
|
8
8
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
9
9
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
10
10
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
11
|
-
import event from "@ui5/webcomponents-base/dist/decorators/event.js";
|
11
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
12
12
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
13
|
-
import
|
13
|
+
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
14
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
14
15
|
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
15
16
|
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
|
16
|
-
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
17
17
|
import NavigationMode from "@ui5/webcomponents-base/dist/types/NavigationMode.js";
|
18
|
-
import { isTabNext, isTabPrevious, isSpace, isEnter, isCtrlA, isUpAlt, isDownAlt, isUpShift, isDownShift, isHomeCtrl, isEndCtrl, isHomeShift, isEndShift, } from "@ui5/webcomponents-base/dist/Keys.js";
|
18
|
+
import { isTabNext, isTabPrevious, isSpace, isEnter, isDown, isCtrlA, isUpAlt, isDownAlt, isUpShift, isDownShift, isHomeCtrl, isEndCtrl, isHomeShift, isEndShift, } from "@ui5/webcomponents-base/dist/Keys.js";
|
19
19
|
import getNormalizedTarget from "@ui5/webcomponents-base/dist/util/getNormalizedTarget.js";
|
20
20
|
import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js";
|
21
21
|
import { getLastTabbableElement, getTabbableElements } from "@ui5/webcomponents-base/dist/util/TabbableElements.js";
|
22
|
-
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/
|
23
|
-
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
22
|
+
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js";
|
24
23
|
import debounce from "@ui5/webcomponents-base/dist/util/debounce.js";
|
25
|
-
import isElementInView from "@ui5/webcomponents-base/dist/util/isElementInView.js";
|
26
|
-
import BusyIndicator from "@ui5/webcomponents/dist/BusyIndicator.js";
|
27
|
-
import CheckBox from "@ui5/webcomponents/dist/CheckBox.js";
|
28
24
|
import TableGrowingMode from "./types/TableGrowingMode.js";
|
29
25
|
import TableMode from "./types/TableMode.js";
|
30
26
|
// Texts
|
31
27
|
import { LOAD_MORE_TEXT, ARIA_LABEL_SELECT_ALL_CHECKBOX, TABLE_HEADER_ROW_INFORMATION, TABLE_ROW_POSITION, } from "./generated/i18n/i18n-defaults.js";
|
32
28
|
// Template
|
33
|
-
import TableTemplate from "./
|
29
|
+
import TableTemplate from "./TableTemplate.js";
|
34
30
|
// Styles
|
35
31
|
import tableStyles from "./generated/themes/Table.css.js";
|
36
32
|
const GROWING_WITH_SCROLL_DEBOUNCE_RATE = 250; // ms
|
@@ -103,11 +99,91 @@ var TableFocusTargetElement;
|
|
103
99
|
* @public
|
104
100
|
*/
|
105
101
|
let Table = Table_1 = class Table extends UI5Element {
|
106
|
-
static async onDefine() {
|
107
|
-
Table_1.i18nBundle = await getI18nBundle("@ui5/webcomponents");
|
108
|
-
}
|
109
102
|
constructor() {
|
110
103
|
super();
|
104
|
+
/**
|
105
|
+
* Defines if the value of `noDataText` will be diplayed when there is no rows present in the table.
|
106
|
+
* @default false
|
107
|
+
* @public
|
108
|
+
* @since 2.0.0
|
109
|
+
*/
|
110
|
+
this.hideNoData = false;
|
111
|
+
/**
|
112
|
+
* Defines whether the table will have growing capability either by pressing a `More` button,
|
113
|
+
* or via user scroll. In both cases `load-more` event is fired.
|
114
|
+
*
|
115
|
+
* Available options:
|
116
|
+
*
|
117
|
+
* `Button` - Shows a `More` button at the bottom of the table, pressing of which triggers the `load-more` event.
|
118
|
+
*
|
119
|
+
* `Scroll` - The `load-more` event is triggered when the user scrolls to the bottom of the table;
|
120
|
+
*
|
121
|
+
* `None` (default) - The growing is off.
|
122
|
+
*
|
123
|
+
* **Restrictions:** `growing="Scroll"` is not supported for Internet Explorer,
|
124
|
+
* and the component will fallback to `growing="Button"`.
|
125
|
+
* @default "None"
|
126
|
+
* @since 2.0.0
|
127
|
+
* @public
|
128
|
+
*/
|
129
|
+
this.growing = "None";
|
130
|
+
/**
|
131
|
+
* Defines if the table is in busy state.
|
132
|
+
*
|
133
|
+
* In this state the component's opacity is reduced
|
134
|
+
* and busy indicator is displayed at the bottom of the table.
|
135
|
+
* @default false
|
136
|
+
* @since 2.0.0
|
137
|
+
* @public
|
138
|
+
*/
|
139
|
+
this.busy = false;
|
140
|
+
/**
|
141
|
+
* Defines the delay in milliseconds, after which the busy indicator will show up for this component.
|
142
|
+
* @default 1000
|
143
|
+
* @public
|
144
|
+
*/
|
145
|
+
this.busyDelay = 1000;
|
146
|
+
/**
|
147
|
+
* Determines whether the column headers remain fixed at the top of the page during
|
148
|
+
* vertical scrolling as long as the Web Component is in the viewport.
|
149
|
+
*
|
150
|
+
* **Restrictions:**
|
151
|
+
*
|
152
|
+
* - Browsers that do not support this feature:
|
153
|
+
*
|
154
|
+
* - Internet Explorer
|
155
|
+
* - Microsoft Edge lower than version 41 (EdgeHTML 16)
|
156
|
+
* - Mozilla Firefox lower than version 59
|
157
|
+
*
|
158
|
+
* - Scrolling behavior:
|
159
|
+
*
|
160
|
+
* - If the Web Component is placed in layout containers that have the `overflow: hidden`
|
161
|
+
* or `overflow: auto` style definition, this can
|
162
|
+
* prevent the sticky elements of the Web Component from becoming fixed at the top of the viewport.
|
163
|
+
* @default false
|
164
|
+
* @public
|
165
|
+
*/
|
166
|
+
this.stickyColumnHeader = false;
|
167
|
+
/**
|
168
|
+
* Defines the mode of the component.
|
169
|
+
* @default "None"
|
170
|
+
* @since 2.0.0
|
171
|
+
* @public
|
172
|
+
*/
|
173
|
+
this.mode = "None";
|
174
|
+
this._noDataDisplayed = false;
|
175
|
+
/**
|
176
|
+
* Defines the active state of the `More` button.
|
177
|
+
* @private
|
178
|
+
*/
|
179
|
+
this._loadMoreActive = false;
|
180
|
+
/**
|
181
|
+
* Defines whether all rows are selected or not when table is in MultiSelect mode.
|
182
|
+
* @default false
|
183
|
+
* @since 2.0.0
|
184
|
+
* @private
|
185
|
+
*/
|
186
|
+
this._allRowsSelected = false;
|
111
187
|
this.visibleColumns = []; // template loop should always have a defined array
|
112
188
|
// The ItemNavigation requires each item to 1) have a "forcedTabIndex" property and 2) be either a UI5Element, or have an id property (to find it in the component's shadow DOM by)
|
113
189
|
this._columnHeader = {
|
@@ -153,7 +229,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
153
229
|
row.mode = this.mode;
|
154
230
|
});
|
155
231
|
this.visibleColumns = this.columns.filter((column, index) => {
|
156
|
-
return !this._hiddenColumns[index];
|
232
|
+
return !this._hiddenColumns?.[index];
|
157
233
|
});
|
158
234
|
this._noDataDisplayed = !this.rows.length && !this.hideNoData;
|
159
235
|
this.visibleColumnsCount = this.visibleColumns.length;
|
@@ -168,7 +244,6 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
168
244
|
if (this.growsOnScroll) {
|
169
245
|
this.observeTableEnd();
|
170
246
|
}
|
171
|
-
this.checkTableInViewport();
|
172
247
|
}
|
173
248
|
onEnterDOM() {
|
174
249
|
this.growingIntersectionObserver = this.getIntersectionObserver();
|
@@ -277,7 +352,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
277
352
|
nextItem.focus();
|
278
353
|
}
|
279
354
|
const selectedRows = this.selectedRows;
|
280
|
-
this.
|
355
|
+
this.fireDecoratorEvent("selection-change", {
|
281
356
|
selectedRows,
|
282
357
|
previouslySelectedRows,
|
283
358
|
});
|
@@ -303,7 +378,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
303
378
|
rows[rows.length - 1].focus();
|
304
379
|
}
|
305
380
|
const selectedRows = this.selectedRows;
|
306
|
-
this.
|
381
|
+
this.fireDecoratorEvent("selection-change", {
|
307
382
|
selectedRows,
|
308
383
|
previouslySelectedRows,
|
309
384
|
});
|
@@ -450,6 +525,11 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
450
525
|
onRowFocused(e) {
|
451
526
|
this._itemNavigation.setCurrentItem(e.target);
|
452
527
|
}
|
528
|
+
onRowKeyDown(e) {
|
529
|
+
if (this.growing === "Scroll" && isDown(e) && this.currentItemIdx === this.rows.length - 1) {
|
530
|
+
debounce(this.loadMore.bind(this), GROWING_WITH_SCROLL_DEBOUNCE_RATE);
|
531
|
+
}
|
532
|
+
}
|
453
533
|
_onColumnHeaderFocused() {
|
454
534
|
this._itemNavigation.setCurrentItem(this._columnHeader);
|
455
535
|
}
|
@@ -485,8 +565,14 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
485
565
|
}
|
486
566
|
this._loadMoreActive = false;
|
487
567
|
}
|
568
|
+
onInvalidation(change) {
|
569
|
+
if (change.type === "property" && change.name === "growing") {
|
570
|
+
this.tableEndObserved = false;
|
571
|
+
this.getIntersectionObserver().disconnect();
|
572
|
+
}
|
573
|
+
}
|
488
574
|
_onLoadMoreClick() {
|
489
|
-
this.
|
575
|
+
this.fireDecoratorEvent("load-more");
|
490
576
|
}
|
491
577
|
observeTableEnd() {
|
492
578
|
if (!this.tableEndObserved) {
|
@@ -504,7 +590,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
504
590
|
}
|
505
591
|
}
|
506
592
|
loadMore() {
|
507
|
-
this.
|
593
|
+
this.fireDecoratorEvent("load-more");
|
508
594
|
}
|
509
595
|
_handleSingleSelect(e) {
|
510
596
|
const row = this.getRowParent(e.target);
|
@@ -519,7 +605,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
519
605
|
}
|
520
606
|
});
|
521
607
|
row.selected = true;
|
522
|
-
this.
|
608
|
+
this.fireDecoratorEvent("selection-change", {
|
523
609
|
selectedRows: [row],
|
524
610
|
previouslySelectedRows,
|
525
611
|
});
|
@@ -539,7 +625,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
539
625
|
else {
|
540
626
|
this._allRowsSelected = false;
|
541
627
|
}
|
542
|
-
this.
|
628
|
+
this.fireDecoratorEvent("selection-change", {
|
543
629
|
selectedRows,
|
544
630
|
previouslySelectedRows,
|
545
631
|
});
|
@@ -561,7 +647,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
561
647
|
row.selected = bAllSelected;
|
562
648
|
});
|
563
649
|
const selectedRows = bAllSelected ? this.rows : [];
|
564
|
-
this.
|
650
|
+
this.fireDecoratorEvent("selection-change", {
|
565
651
|
selectedRows,
|
566
652
|
previouslySelectedRows,
|
567
653
|
});
|
@@ -591,12 +677,8 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
591
677
|
return null;
|
592
678
|
}
|
593
679
|
handleResize() {
|
594
|
-
this.checkTableInViewport();
|
595
680
|
this.popinContent();
|
596
681
|
}
|
597
|
-
checkTableInViewport() {
|
598
|
-
this._inViewport = isElementInView(this.getDomRef());
|
599
|
-
}
|
600
682
|
popinContent() {
|
601
683
|
const clientRect = this.getDomRef().getBoundingClientRect();
|
602
684
|
const tableWidth = clientRect.width;
|
@@ -621,12 +703,12 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
621
703
|
}
|
622
704
|
this.columns[visibleColumnsIndexes[visibleColumnsIndexes.length - 1]].last = true;
|
623
705
|
}
|
624
|
-
const hiddenColumnsChange = (this._hiddenColumns
|
706
|
+
const hiddenColumnsChange = (this._hiddenColumns?.length !== hiddenColumns.length) || this._hiddenColumns?.some((column, index) => column !== hiddenColumns[index]);
|
625
707
|
const shownColumnsChange = hiddenColumns.length === 0;
|
626
708
|
// invalidate if hidden columns count has changed or columns are shown
|
627
709
|
if (hiddenColumnsChange || shownColumnsChange) {
|
628
710
|
this._hiddenColumns = hiddenColumns;
|
629
|
-
this.
|
711
|
+
this.fireDecoratorEvent("popin-change", {
|
630
712
|
poppedColumns: this._hiddenColumns,
|
631
713
|
});
|
632
714
|
}
|
@@ -643,7 +725,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
643
725
|
text: column.textContent,
|
644
726
|
popinText: column.popinText,
|
645
727
|
popinDisplay: column.popinDisplay,
|
646
|
-
visible: !this._hiddenColumns[index],
|
728
|
+
visible: !this._hiddenColumns?.[index],
|
647
729
|
};
|
648
730
|
}, this);
|
649
731
|
}
|
@@ -657,13 +739,6 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
657
739
|
}
|
658
740
|
return this.growingIntersectionObserver;
|
659
741
|
}
|
660
|
-
get styles() {
|
661
|
-
return {
|
662
|
-
busy: {
|
663
|
-
position: this.busyIndPosition,
|
664
|
-
},
|
665
|
-
};
|
666
|
-
}
|
667
742
|
get growsWithButton() {
|
668
743
|
return this.growing === TableGrowingMode.Button;
|
669
744
|
}
|
@@ -688,7 +763,7 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
688
763
|
return Table_1.i18nBundle.getText(ARIA_LABEL_SELECT_ALL_CHECKBOX);
|
689
764
|
}
|
690
765
|
get loadMoreAriaLabelledBy() {
|
691
|
-
if (this.
|
766
|
+
if (this.growingButtonSubtext) {
|
692
767
|
return `${this._id}-growingButton-text ${this._id}-growingButton-subtext`;
|
693
768
|
}
|
694
769
|
return `${this._id}-growingButton-text`;
|
@@ -696,9 +771,6 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
696
771
|
get tableEndDOM() {
|
697
772
|
return this.shadowRoot.querySelector(".ui5-table-end-marker");
|
698
773
|
}
|
699
|
-
get busyIndPosition() {
|
700
|
-
return this._inViewport ? "absolute" : "sticky";
|
701
|
-
}
|
702
774
|
get isMultiSelect() {
|
703
775
|
return this.mode === TableMode.MultiSelect;
|
704
776
|
}
|
@@ -737,28 +809,28 @@ __decorate([
|
|
737
809
|
property({ type: Boolean })
|
738
810
|
], Table.prototype, "hideNoData", void 0);
|
739
811
|
__decorate([
|
740
|
-
property(
|
812
|
+
property()
|
741
813
|
], Table.prototype, "growing", void 0);
|
742
814
|
__decorate([
|
743
815
|
property({ type: Boolean })
|
744
816
|
], Table.prototype, "busy", void 0);
|
745
817
|
__decorate([
|
746
|
-
property({
|
818
|
+
property({ type: Number })
|
747
819
|
], Table.prototype, "busyDelay", void 0);
|
748
820
|
__decorate([
|
749
821
|
property({ type: Boolean })
|
750
822
|
], Table.prototype, "stickyColumnHeader", void 0);
|
751
823
|
__decorate([
|
752
|
-
property(
|
824
|
+
property()
|
753
825
|
], Table.prototype, "mode", void 0);
|
754
826
|
__decorate([
|
755
|
-
property(
|
827
|
+
property()
|
756
828
|
], Table.prototype, "accessibleName", void 0);
|
757
829
|
__decorate([
|
758
|
-
property(
|
830
|
+
property()
|
759
831
|
], Table.prototype, "accessibleNameRef", void 0);
|
760
832
|
__decorate([
|
761
|
-
property({ type:
|
833
|
+
property({ type: Array })
|
762
834
|
], Table.prototype, "_hiddenColumns", void 0);
|
763
835
|
__decorate([
|
764
836
|
property({ type: Boolean })
|
@@ -769,9 +841,6 @@ __decorate([
|
|
769
841
|
__decorate([
|
770
842
|
property({ type: Object })
|
771
843
|
], Table.prototype, "_columnHeader", void 0);
|
772
|
-
__decorate([
|
773
|
-
property({ type: Boolean })
|
774
|
-
], Table.prototype, "_inViewport", void 0);
|
775
844
|
__decorate([
|
776
845
|
property({ type: Boolean })
|
777
846
|
], Table.prototype, "_allRowsSelected", void 0);
|
@@ -793,14 +862,16 @@ __decorate([
|
|
793
862
|
},
|
794
863
|
})
|
795
864
|
], Table.prototype, "columns", void 0);
|
865
|
+
__decorate([
|
866
|
+
i18n("@ui5/webcomponents")
|
867
|
+
], Table, "i18nBundle", void 0);
|
796
868
|
Table = Table_1 = __decorate([
|
797
869
|
customElement({
|
798
870
|
tag: "ui5-table",
|
799
871
|
fastNavigation: true,
|
800
872
|
styles: tableStyles,
|
801
|
-
renderer:
|
873
|
+
renderer: jsxRenderer,
|
802
874
|
template: TableTemplate,
|
803
|
-
dependencies: [BusyIndicator, CheckBox],
|
804
875
|
})
|
805
876
|
/** Fired when a row in `Active` mode is clicked or `Enter` key is pressed.
|
806
877
|
* @param {HTMLElement} row the activated row.
|
@@ -808,12 +879,7 @@ Table = Table_1 = __decorate([
|
|
808
879
|
*/
|
809
880
|
,
|
810
881
|
event("row-click", {
|
811
|
-
|
812
|
-
/**
|
813
|
-
* @public
|
814
|
-
*/
|
815
|
-
row: { type: HTMLElement },
|
816
|
-
},
|
882
|
+
bubbles: true,
|
817
883
|
})
|
818
884
|
/**
|
819
885
|
* Fired when `ui5-table-column` is shown as a pop-in instead of hiding it.
|
@@ -823,14 +889,7 @@ Table = Table_1 = __decorate([
|
|
823
889
|
*/
|
824
890
|
,
|
825
891
|
event("popin-change", {
|
826
|
-
|
827
|
-
/**
|
828
|
-
* @public
|
829
|
-
*/
|
830
|
-
poppedColumns: {
|
831
|
-
type: Array,
|
832
|
-
},
|
833
|
-
},
|
892
|
+
bubbles: true,
|
834
893
|
})
|
835
894
|
/**
|
836
895
|
* Fired when the user presses the `More` button or scrolls to the table's end.
|
@@ -840,7 +899,9 @@ Table = Table_1 = __decorate([
|
|
840
899
|
* @since 2.0.0
|
841
900
|
*/
|
842
901
|
,
|
843
|
-
event("load-more"
|
902
|
+
event("load-more", {
|
903
|
+
bubbles: true,
|
904
|
+
})
|
844
905
|
/**
|
845
906
|
* Fired when selection is changed by user interaction
|
846
907
|
* in `SingleSelect` and `MultiSelect` modes.
|
@@ -851,16 +912,7 @@ Table = Table_1 = __decorate([
|
|
851
912
|
*/
|
852
913
|
,
|
853
914
|
event("selection-change", {
|
854
|
-
|
855
|
-
/**
|
856
|
-
* @public
|
857
|
-
*/
|
858
|
-
selectedRows: { type: Array },
|
859
|
-
/**
|
860
|
-
* @public
|
861
|
-
*/
|
862
|
-
previouslySelectedRows: { type: Array },
|
863
|
-
},
|
915
|
+
bubbles: true,
|
864
916
|
})
|
865
917
|
], Table);
|
866
918
|
Table.define();
|