@@ -23,9 +23,11 @@ import { Bar } from '../../webComponents/Bar/index.js';
23
23
import { Button } from '../../webComponents/Button/index.js' ;
24
24
import type { DialogPropTypes } from '../../webComponents/Dialog/index.js' ;
25
25
import { Dialog } from '../../webComponents/Dialog/index.js' ;
26
- import type { InputDomRef } from '../../webComponents/index.js' ;
27
- import { Icon , Input } from '../../webComponents/index.js' ;
26
+ import { Icon } from '../../webComponents/Icon/index.js' ;
27
+ import type { InputDomRef } from '../../webComponents/Input/index.js' ;
28
+ import { Input } from '../../webComponents/Input/index.js' ;
28
29
import { Table } from '../../webComponents/Table/index.js' ;
30
+ import type { TablePropTypes } from '../../webComponents/Table/index.js' ;
29
31
import { TableHeaderCell } from '../../webComponents/TableHeaderCell/index.js' ;
30
32
import { TableHeaderRow } from '../../webComponents/TableHeaderRow/index.js' ;
31
33
import { FlexBox } from '../FlexBox/index.js' ;
@@ -90,7 +92,7 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
90
92
const headerRow = (
91
93
< TableHeaderRow sticky >
92
94
{ showOnlyFavorites && < TableHeaderCell key = "favorite-variant-item" /> }
93
- < TableHeaderCell importance = { 10 } min-width = "18rem ">
95
+ < TableHeaderCell importance = { 10 } minWidth = "14rem ">
94
96
{ viewHeaderText }
95
97
</ TableHeaderCell >
96
98
{ showShare && (
@@ -104,12 +106,11 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
104
106
</ TableHeaderCell >
105
107
) }
106
108
{ showApplyAutomatically && (
107
- < TableHeaderCell minWidth = { hasApplyAutomaticallyText ? '25rem ' : '5rem' } >
109
+ < TableHeaderCell minWidth = { hasApplyAutomaticallyText ? '12.5rem ' : '5rem' } >
108
110
{ applyAutomaticallyHeaderText }
109
111
</ TableHeaderCell >
110
112
) }
111
- { showCreatedBy && < TableHeaderCell minWidth = "10rem" > { createdByHeaderText } </ TableHeaderCell > }
112
- < TableHeaderCell importance = { 9 } width = "3rem" key = "delete-variant-item" />
113
+ { showCreatedBy && < TableHeaderCell minWidth = "7.125rem" > { createdByHeaderText } </ TableHeaderCell > }
113
114
</ TableHeaderRow >
114
115
) ;
115
116
@@ -155,11 +156,12 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
155
156
}
156
157
} ;
157
158
const deletedTableRows = useRef ( new Set ( [ ] ) ) ;
158
- const handleDelete = ( e ) => {
159
- deletedTableRows . current . add ( e . target . dataset . children ) ;
159
+ const handleDelete : TablePropTypes [ 'onRowActionClick' ] = ( e ) => {
160
+ const variantChild = e . detail . row . dataset . id ;
161
+ deletedTableRows . current . add ( variantChild ) ;
160
162
setChildrenProps ( ( prev ) =>
161
163
prev
162
- . filter ( ( item ) => item . children !== e . target . dataset . children )
164
+ . filter ( ( item ) => item . children !== variantChild )
163
165
. map ( ( item ) => {
164
166
if ( Object . prototype . hasOwnProperty . call ( changedTableRows . current , item . children ) ) {
165
167
return { ...item , ...changedTableRows . current [ item . children ] } ;
@@ -260,7 +262,12 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
260
262
/>
261
263
}
262
264
>
263
- < Table headerRow = { headerRow } role = "table" overflowMode = { TableOverflowMode . Popin } >
265
+ < Table
266
+ headerRow = { headerRow }
267
+ overflowMode = { TableOverflowMode . Popin }
268
+ rowActionCount = { 1 }
269
+ onRowActionClick = { handleDelete }
270
+ >
264
271
{ filteredProps . map ( ( itemProps ) => {
265
272
return (
266
273
< ManageViewsTableRows
@@ -270,7 +277,6 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
270
277
changedVariantNames = { changedVariantNames }
271
278
variantNames = { variantNames }
272
279
handleRowChange = { handleTableRowChange }
273
- handleDelete = { handleDelete }
274
280
defaultView = { defaultView }
275
281
setDefaultView = { setDefaultView }
276
282
showShare = { showShare }
0 commit comments