mStar
07614e9a6d
Takes an array of objects (name, checked, description) and turns it into a list of checkboxes, one for each element
21 lines
582 B
TypeScript
21 lines
582 B
TypeScript
import { action } from '@ember/object'
|
|
import Component from '@glimmer/component'
|
|
|
|
export interface UtilMultiselectSignature {
|
|
// The arguments accepted by the component
|
|
Args: {
|
|
elements: Array<{ name: string; checked: boolean; description: string }>
|
|
}
|
|
// Any blocks yielded by the component
|
|
Blocks: {
|
|
default: []
|
|
}
|
|
// The element to which `...attributes` is applied in the component template
|
|
Element: null
|
|
}
|
|
|
|
export default class UtilMultiselect extends Component<UtilMultiselectSignature> {
|
|
@action onChange() {
|
|
console.log(this.args.elements)
|
|
}
|
|
}
|