@@ -21,6 +21,7 @@ import "@elixir-cloud/design/components/skeleton/index.js";
2121 * @property {boolean } search - Determines if the search field should be rendered
2222 * @property {DrsProvider } provider - Custom data provider (optional, overrides baseUrl)
2323 *
24+ * @fires ecc-objects-changed - Fired when objects data changes
2425 * @fires ecc-objects-selected - Fired when an object is selected
2526 */
2627export class ECCClientGa4ghDrsObjects extends LitElement {
@@ -104,7 +105,17 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
104105 // If we get no results and we're not on the first page, go back a page
105106 this . currentPage -= 1 ;
106107 this . loadData ( ) ;
108+ return ;
107109 }
110+
111+ // Emit an event with the updated objects
112+ this . dispatchEvent (
113+ new CustomEvent ( "ecc-objects-changed" , {
114+ detail : { objects : this . objects } ,
115+ bubbles : true ,
116+ composed : true ,
117+ } )
118+ ) ;
108119 } catch ( err ) {
109120 this . error =
110121 err instanceof Error ? err . message : "Failed to load objects" ;
@@ -388,9 +399,6 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
388399 < ecc-utils-design-table-head class ="w-6/12 "
389400 > Object Info</ ecc-utils-design-table-head
390401 >
391- < ecc-utils-design-table-head class ="w-2/12 "
392- > Type</ ecc-utils-design-table-head
393- >
394402 < ecc-utils-design-table-head class ="w-2/12 "
395403 > Size</ ecc-utils-design-table-head
396404 >
@@ -419,10 +427,8 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
419427 </ ecc-utils-design-table-row >
420428 ` ;
421429 }
422- return this . objects . map ( ( object ) => {
423- const objectType =
424- ECCClientGa4ghDrsObjects . getObjectType ( object ) ;
425- return html `
430+ return this . objects . map (
431+ ( object ) => html `
426432 < ecc-utils-design-table-row >
427433 < ecc-utils-design-table-cell class ="w-6/12 ">
428434 < div class ="flex flex-col w-full ">
@@ -447,11 +453,6 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
447453 : "" }
448454 </ div >
449455 </ ecc-utils-design-table-cell >
450- < ecc-utils-design-table-cell class ="w-2/12 ">
451- < ecc-utils-design-badge variant =${ objectType . variant } >
452- ${ objectType . label }
453- </ ecc-utils-design-badge >
454- </ ecc-utils-design-table-cell >
455456 < ecc-utils-design-table-cell class ="w-2/12 ">
456457 < span class ="text-sm "
457458 > ${ ECCClientGa4ghDrsObjects . formatFileSize (
@@ -467,16 +468,18 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
467468 >
468469 </ ecc-utils-design-table-cell >
469470 < ecc-utils-design-table-cell class ="w-2/12 ">
470- < ecc-utils-design-button
471- size ="sm "
472- @click =${ ( ) => this . handleObjectSelect ( object . id ) }
473- >
474- View Details
475- </ ecc-utils-design-button >
471+ < slot name =${ `actions-${ object . id } ` } >
472+ < ecc-utils-design-button
473+ size ="sm "
474+ @click =${ ( ) => this . handleObjectSelect ( object . id ) }
475+ >
476+ View Details
477+ </ ecc-utils-design-button >
478+ </ slot >
476479 </ ecc-utils-design-table-cell >
477480 </ ecc-utils-design-table-row >
478- ` ;
479- } ) ;
481+ `
482+ ) ;
480483 } ) ( ) }
481484 </ ecc-utils-design-table-body >
482485 </ ecc-utils-design-table >
0 commit comments