Skip to content

Commit

Permalink
use weave-checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
vilde-barth-adsk committed Nov 6, 2023
1 parent 5895076 commit 0e2eb16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions analyses/dynamo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
type="module"
src="https://app.autodeskforma.eu/design-system/v2/weave/components/input/weave-input.js"
></script>
<script
type="module"
src="https://app.autodeskforma.eu/design-system/v2/weave/components/checkbox/weave-checkbox.js"
></script>
<title>Dynamo Player</title>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ function DynamoInputComponent({
);
} else if (input.type === "BoolSelector") {
return (
<input
type="checkbox"
defaultChecked={value}
// @ts-ignore
onChange={(ev) => setValue(input.id, ev.target.checked)}
<weave-checkbox
checked={value}
onChange={(ev) => setValue(input.id, ev.detail.checked)}
/>
);
} else if (input.type === "DoubleSlider") {
Expand Down
4 changes: 4 additions & 0 deletions analyses/dynamo/src/lib/weave.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export declare module "preact/src/jsx" {
"weave-input": JSXInternal.HTMLAttributes<HTMLInputElement> & {
showlabel?: "true" | "false";
};
"weave-checkbox": Omit<JSX.HTMLAttributes<HTMLElement>, "onChange"> & {
checked?: boolean;
onChange: (e: CustomEvent<{ checked: boolean }>) => void;
};
}
}
}

0 comments on commit 0e2eb16

Please sign in to comment.