|
|
|
|
@ -58,12 +58,22 @@ export class TagGroupProvider {
|
|
|
|
|
private constructor(opts: TagGroupOpts) {
|
|
|
|
|
this.opts = opts;
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(tagGroupMorfo, {});
|
|
|
|
|
this.runtime = this.soma.runtime(tagGroupMorfo, {
|
|
|
|
|
props: {
|
|
|
|
|
ariaLabel: () => this.resolvedAriaLabel.current,
|
|
|
|
|
ariaLabelledby: () => this.resolvedAriaLabelledby,
|
|
|
|
|
multiple: () => this.opts.selectionMode.current === 'multiple',
|
|
|
|
|
disabled: () => this.opts.disabled.current,
|
|
|
|
|
empty: () => this.isEmpty,
|
|
|
|
|
selectionMode: () => this.opts.selectionMode.current
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.runtimePart = this.runtime.part('provider', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
context: TagGroupProvider.ctx
|
|
|
|
|
context: TagGroupProvider.ctx,
|
|
|
|
|
syncAttrs: true
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -221,15 +231,7 @@ export class TagGroupProvider {
|
|
|
|
|
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
|
|
|
|
role: 'grid' as const,
|
|
|
|
|
'aria-label': this.resolvedAriaLabel.current,
|
|
|
|
|
'aria-labelledby': this.resolvedAriaLabelledby,
|
|
|
|
|
'aria-multiselectable': this.opts.selectionMode.current === 'multiple' ? true : undefined,
|
|
|
|
|
'aria-disabled': this.opts.disabled.current ? true : undefined,
|
|
|
|
|
'data-disabled': boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
|
|
|
'data-empty': boolToEmptyStrOrUndef(this.isEmpty),
|
|
|
|
|
'data-selection-mode': this.opts.selectionMode.current
|
|
|
|
|
...this.runtimePart.props
|
|
|
|
|
} as const)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|