From ae5b4b12f97aec65076f187389d130b3faaf6973 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 12 May 2025 10:41:51 +0200 Subject: [PATCH 1/2] add V2 table components without ui5wc imports --- .../main/src/webComponents/Table/TableV2.ts | 24 +++++++++++++++++ .../webComponents/TableCell/TableCellV2.ts | 20 ++++++++++++++ .../src/webComponents/TableRow/TableRowV2.ts | 26 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 packages/main/src/webComponents/Table/TableV2.ts create mode 100644 packages/main/src/webComponents/TableCell/TableCellV2.ts create mode 100644 packages/main/src/webComponents/TableRow/TableRowV2.ts diff --git a/packages/main/src/webComponents/Table/TableV2.ts b/packages/main/src/webComponents/Table/TableV2.ts new file mode 100644 index 00000000000..c68bc08bac5 --- /dev/null +++ b/packages/main/src/webComponents/Table/TableV2.ts @@ -0,0 +1,24 @@ +'use client'; + +import TableV2 from '@ui5/webcomponents/dist/Table.js'; +import { withWebComponent } from '@ui5/webcomponents-react-base'; + +// change tag +TableV2._metadata.metadata.tag = 'ui5-table-v2'; +// run define again to register with new tag +TableV2.define(); + +/** + * This component is not meant for public consumption! + */ +const _TableV2 = withWebComponent( + 'ui5-table-v2', + ['accessibleName', 'accessibleNameRef', 'loadingDelay', 'noDataText', 'overflowMode', 'rowActionCount'], + ['loading'], + ['features', 'headerRow', 'noData'], + ['move-over', 'move', 'row-action-click', 'row-click'] +); + +_TableV2.displayName = '_TableV2'; + +export { _TableV2 }; diff --git a/packages/main/src/webComponents/TableCell/TableCellV2.ts b/packages/main/src/webComponents/TableCell/TableCellV2.ts new file mode 100644 index 00000000000..7e0ce3018e5 --- /dev/null +++ b/packages/main/src/webComponents/TableCell/TableCellV2.ts @@ -0,0 +1,20 @@ +'use client'; + +import TableCellV2 from '@ui5/webcomponents/dist/TableCell.js'; +import { withWebComponent } from '@ui5/webcomponents-react-base'; + +customElements.whenDefined('ui5-table-cell').then(() => { + // change tag + TableCellV2._metadata.metadata.tag = 'ui5-table-cell-v2'; + // run define again to register with new tag + TableCellV2.define(); +}); + +/** + * This component is not meant for public consumption! + */ +const _TableCellV2 = withWebComponent('ui5-table-cell-v2', ['horizontalAlign'], [], [], []); + +_TableCellV2.displayName = '_TableCellV2'; + +export { _TableCellV2 }; diff --git a/packages/main/src/webComponents/TableRow/TableRowV2.ts b/packages/main/src/webComponents/TableRow/TableRowV2.ts new file mode 100644 index 00000000000..b01a7d02f27 --- /dev/null +++ b/packages/main/src/webComponents/TableRow/TableRowV2.ts @@ -0,0 +1,26 @@ +'use client'; + +import TableRowV2 from '@ui5/webcomponents/dist/TableRow.js'; +import { withWebComponent } from '@ui5/webcomponents-react-base'; + +customElements.whenDefined('ui5-table-row').then(() => { + // change tag + TableRowV2._metadata.metadata.tag = 'ui5-table-row-v2'; + // run define again to register with new tag + TableRowV2.define(); +}); + +/** + * This component is not meant for public consumption! + */ +const _TableRowV2 = withWebComponent( + 'ui5-table-row-v2', + ['position', 'rowKey'], + ['interactive', 'movable', 'navigated'], + ['actions'], + [] +); + +_TableRowV2.displayName = '_TableRowV2'; + +export { _TableRowV2 }; From 8146529d7f8f46d065148d71068ddead1bf0ec9f Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 12 May 2025 10:48:19 +0200 Subject: [PATCH 2/2] remove `whenDefined` --- .../main/src/webComponents/TableCell/TableCellV2.ts | 10 ++++------ packages/main/src/webComponents/TableRow/TableRowV2.ts | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/main/src/webComponents/TableCell/TableCellV2.ts b/packages/main/src/webComponents/TableCell/TableCellV2.ts index 7e0ce3018e5..505b0e66483 100644 --- a/packages/main/src/webComponents/TableCell/TableCellV2.ts +++ b/packages/main/src/webComponents/TableCell/TableCellV2.ts @@ -3,12 +3,10 @@ import TableCellV2 from '@ui5/webcomponents/dist/TableCell.js'; import { withWebComponent } from '@ui5/webcomponents-react-base'; -customElements.whenDefined('ui5-table-cell').then(() => { - // change tag - TableCellV2._metadata.metadata.tag = 'ui5-table-cell-v2'; - // run define again to register with new tag - TableCellV2.define(); -}); +// change tag +TableCellV2._metadata.metadata.tag = 'ui5-table-cell-v2'; +// run define again to register with new tag +TableCellV2.define(); /** * This component is not meant for public consumption! diff --git a/packages/main/src/webComponents/TableRow/TableRowV2.ts b/packages/main/src/webComponents/TableRow/TableRowV2.ts index b01a7d02f27..45884b3ec65 100644 --- a/packages/main/src/webComponents/TableRow/TableRowV2.ts +++ b/packages/main/src/webComponents/TableRow/TableRowV2.ts @@ -3,12 +3,10 @@ import TableRowV2 from '@ui5/webcomponents/dist/TableRow.js'; import { withWebComponent } from '@ui5/webcomponents-react-base'; -customElements.whenDefined('ui5-table-row').then(() => { - // change tag - TableRowV2._metadata.metadata.tag = 'ui5-table-row-v2'; - // run define again to register with new tag - TableRowV2.define(); -}); +// change tag +TableRowV2._metadata.metadata.tag = 'ui5-table-row-v2'; +// run define again to register with new tag +TableRowV2.define(); /** * This component is not meant for public consumption! pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy