From 21d61e107d5b937abe2ba22fc1b66cfb3b86c018 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Fri, 3 Jan 2025 16:18:22 +0100 Subject: [PATCH] fix types --- .../prefabs/tpk-table-generic-prefab.gts | 26 +++++++++++-------- .../src/components/tpk-table-generic/body.gts | 4 +-- .../tpk-table-generic/body/cell.gts | 8 ++++-- .../components/tpk-table-generic/header.gts | 5 ++-- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/packages/ember-ui/src/components/prefabs/tpk-table-generic-prefab.gts b/packages/ember-ui/src/components/prefabs/tpk-table-generic-prefab.gts index 8a9f9738..5c68fddc 100644 --- a/packages/ember-ui/src/components/prefabs/tpk-table-generic-prefab.gts +++ b/packages/ember-ui/src/components/prefabs/tpk-table-generic-prefab.gts @@ -2,8 +2,8 @@ import Component from '@glimmer/component'; import type { TableGenericComponentSignature } from "../tpk-table-generic.gts"; import TableGenericComponent from "../tpk-table-generic.gts"; import TpkTableGeneric from "../tpk-table-generic.gts"; -import type { WithBoundArgs } from '@glint/template'; -import t from 'ember-intl/helpers/t'; +import type { ContentValue, WithBoundArgs } from '@glint/template'; +import { get } from '@ember/object'; export interface TableGenericPrefabComponentSignature { Args: TableGenericComponentSignature["Args"] & { @@ -38,14 +38,18 @@ export default class TableGenericPrefabComponent extends Component { + const value = get(element, field); + return String(value); + } + -} \ No newline at end of file +} diff --git a/packages/ember-ui/src/components/tpk-table-generic/body.gts b/packages/ember-ui/src/components/tpk-table-generic/body.gts index 8160456d..d520ee7e 100644 --- a/packages/ember-ui/src/components/tpk-table-generic/body.gts +++ b/packages/ember-ui/src/components/tpk-table-generic/body.gts @@ -1,7 +1,7 @@ import Component from '@glimmer/component'; import { tracked } from 'tracked-built-ins'; import { action } from '@ember/object'; -import type { ComponentLike, WithBoundArgs } from '@glint/template'; +import type { WithBoundArgs } from '@glint/template'; import TableGenericBodyCellComponent from './body/cell.gts'; import TableGenericBodyActionMenuComponent from './body/action-menu.gts'; import { fn, hash } from '@ember/helper'; @@ -20,7 +20,7 @@ export interface TableGenericBodyComponentSignature { Blocks: { default: [ { - Cell: ComponentLike; + Cell: WithBoundArgs; ActionMenu: WithBoundArgs< typeof TableGenericBodyActionMenuComponent, 'registerActionMenu' diff --git a/packages/ember-ui/src/components/tpk-table-generic/body/cell.gts b/packages/ember-ui/src/components/tpk-table-generic/body/cell.gts index edba2215..a8ae02cd 100644 --- a/packages/ember-ui/src/components/tpk-table-generic/body/cell.gts +++ b/packages/ember-ui/src/components/tpk-table-generic/body/cell.gts @@ -1,10 +1,12 @@ import type { TOC } from '@ember/component/template-only'; +import type { ComponentLike } from '@glint/template'; + export interface TableGenericBodyCellComponentSignature { Args: { // eslint-disable-next-line @typescript-eslint/no-explicit-any - row: any; + row: ComponentLike; }; - Element: HTMLDivElement; + Element: HTMLElement; Blocks: { default: []; }; @@ -12,8 +14,10 @@ export interface TableGenericBodyCellComponentSignature { const TableGenericBodyCellComponent: TOC = ; diff --git a/packages/ember-ui/src/components/tpk-table-generic/header.gts b/packages/ember-ui/src/components/tpk-table-generic/header.gts index d7649d8b..6f434ed4 100644 --- a/packages/ember-ui/src/components/tpk-table-generic/header.gts +++ b/packages/ember-ui/src/components/tpk-table-generic/header.gts @@ -1,4 +1,4 @@ -import type { ComponentLike } from '@glint/template'; +import type { WithBoundArgs } from '@glint/template'; import TableGenericHeaderCellComponent from './header/cell.gts'; import type { TOC } from '@ember/component/template-only'; import { hash } from '@ember/helper'; @@ -9,11 +9,10 @@ export interface TableGenericHeaderComponentSignature { table: any; hasActionMenu: boolean; }; - Element: HTMLDivElement; Blocks: { default: [ { - Cell: ComponentLike; + Cell: WithBoundArgs; }, ]; };