Skip to content

Commit

Permalink
feat(table): update TableHeader interface and examples to use WithNor…
Browse files Browse the repository at this point in the history
…malizedProps
  • Loading branch information
WinkeeFace committed Jan 2, 2025
1 parent b767d14 commit 21f9d1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/components/ebay-table/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { WithNormalizedProps } from "../../global";
import { CheckboxEvent } from "../ebay-checkbox/component-browser";

export type TableSort = "asc" | "desc" | "none";
interface TableHeaderProps {
export interface TableHeader extends Omit<Marko.Input<"th">, `on${string}`> {
"column-type"?: "normal" | "numeric" | "layout" | "icon-action";
"row-header"?: boolean;
}
export interface TableHeader extends WithNormalizedProps<TableHeaderProps>, Omit<Marko.Input<"th">, `on${string}`> {
name?: string;
sort?: TableSort | boolean;
href?: AttrString;
Expand All @@ -24,7 +22,7 @@ export interface TableRow extends Omit<Marko.Input<"tr">, `on${string}`> {
cell: Marko.AttrTag<TableCell>;
}
export interface TableInput extends Omit<Marko.Input<"div">, `on${string}`> {
header: Marko.AttrTag<TableHeader>;
header: Marko.AttrTag<WithNormalizedProps<TableHeader>>;
mode?: "none" | "selection";
allSelected?: AttrTriState;
row?: Marko.AttrTag<TableRow>;
Expand Down
8 changes: 4 additions & 4 deletions src/components/ebay-table/examples/default.marko
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import data from "./data.json";
</@header>
<@header>Item</@header>
<@header>Status</@header>
<@header column-type="numeric">
<@header column-type="numeric" as const>
List Price
</@header>
<@header column-type="numeric">
<@header column-type="numeric" as const>
Quantity Available
</@header>
<@header>Orders</@header>
<@header column-type="numeric">
<@header column-type="numeric" as const>
Watchers
</@header>
<@header column-type="numeric">
<@header column-type="numeric" as const>
Protection
</@header>
<@header>Shipping</@header>
Expand Down

0 comments on commit 21f9d1b

Please sign in to comment.