Skip to content

Commit

Permalink
feat(hiccup-html): add inputReset() & inputSubmit()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 23, 2024
1 parent 16686bb commit 2b9cde0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/hiccup-html/src/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ export interface InputNumericAttribs extends InputAttribs {
value: NumericAttrib;
}

export interface InputSubmitAttribs extends InputAttribs {
formaction: StringAttrib;
formenctype: StringAttrib;
formmethod: StringAttrib;
formnovalidate: BooleanAttrib;
formtarget: StringAttrib;
}

export const button = defElement<Partial<InputAttribs>>("button");

export const checkbox = defElement<Partial<InputCheckboxAttribs>, never>(
Expand Down Expand Up @@ -115,13 +123,24 @@ export const inputRange = defElement<Partial<InputNumericAttribs>, never>(
{ type: "range" }
);

export const inputReset = defElement<Partial<InputAttribs>, never>("input", {
type: "reset",
});

export const inputSearch = defElement<Partial<InputTextAttribs>, never>(
"input",
{
type: "search",
}
);

export const inputSubmit = defElement<Partial<InputSubmitAttribs>, never>(
"input",
{
type: "submit",
}
);

export const inputText = defElement<Partial<InputTextAttribs>, never>("input", {
type: "text",
});
Expand Down

0 comments on commit 2b9cde0

Please sign in to comment.