rename claviature package to widgets
This commit is contained in:
parent
82c4926f19
commit
708675077f
9 changed files with 59 additions and 57 deletions
|
|
@ -1,32 +0,0 @@
|
|||
import { For } from 'solid-js';
|
||||
import { customElement } from 'solid-element';
|
||||
import { getClaviature } from 'claviature';
|
||||
import { Dynamic } from 'solid-js/web';
|
||||
|
||||
let defaultOptions = {
|
||||
range: ['A1', 'C6'],
|
||||
};
|
||||
|
||||
customElement('strudel-claviature', { options: JSON.stringify(defaultOptions) }, (props, { element }) => {
|
||||
let svg = () => {
|
||||
let c = getClaviature({
|
||||
options: JSON.parse(props.options),
|
||||
});
|
||||
return c;
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<svg {...svg().attributes}>
|
||||
<For each={svg().children}>
|
||||
{(el) => {
|
||||
return (
|
||||
<Dynamic component={el.name} {...el.attributes}>
|
||||
{el.value}
|
||||
</Dynamic>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
</svg>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue