Skip to content

Commit

Permalink
refactor(hdom-components): update dropdown components
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add hdom context arg as first arg to `dropdown` and
`groupedDropdown`
  • Loading branch information
postspectacular committed Apr 8, 2018
1 parent 4a18e88 commit 0873832
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/hdom-components/src/dropdown.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface DropDownOption extends Array<any> {
[0]: string | number;
[1]: string;
[1]: string | number;
[2]?: boolean
};

Expand All @@ -19,18 +19,18 @@ export const option = ([value, label, disabled]: DropDownOption, sel: string | n
export const optgroup = (attribs: any, options: DropDownOption[], sel?: string | number) =>
[
"optgroup",
(attribs.label = attribs.label || "--", attribs),
{ ...attribs, label: attribs.label || "--" },
...options.map((o) => option(o, sel))
];

export const dropdown = (attribs: any, options: DropDownOption[], sel?: string | number) =>
export const dropdown = (_: any, attribs: any, options: DropDownOption[], sel?: string | number) =>
[
"select",
attribs,
...options.map((o) => option(o, sel))
];

export const groupedDropdown = (attribs: any, groups: DropDownOptionGroup[], sel?: string | number) =>
export const groupedDropdown = (_: any, attribs: any, groups: DropDownOptionGroup[], sel?: string | number) =>
[
"select",
attribs,
Expand Down

0 comments on commit 0873832

Please sign in to comment.