();
get dotCls(): string {
return this.checked ? 'ui-radio-dot on' : 'ui-radio-dot';
}
}
@Component({
selector: 'vsp-radio-group',
imports: [VspRadio],
template: `
@for (o of options; track val(o)) {
}
`,
})
export class VspRadioGroup {
@Input() value?: string;
@Output() valueChange = new EventEmitter();
@Input() options: NativeSelectOption[] = [];
@Input() name = 'vsp-radio';
@Input() disabled = false;
@Input() orientation: 'vertical' | 'horizontal' = 'vertical';
val = val;
lbl = lbl;
subOf = subOf;
disOf(o: NativeSelectOption): boolean {
return typeof o === 'object' && !!o.disabled;
}
pick(v: string): void {
this.value = v;
this.valueChange.emit(v);
}
}
@Component({
selector: 'vsp-slider',
template: ``,
})
export class VspSlider {
@Input() value = 0;
@Output() valueChange = new EventEmitter();
@Input() min = 0;
@Input() max = 100;
@Input() step = 1;
@Input() disabled = false;
@Input() id?: string;
@Input('aria-label') ariaLabel?: string;
onInput(e: Event): void {
this.value = Number((e.target as HTMLInputElement).value);
this.valueChange.emit(this.value);
}
}
@Component({
selector: 'vsp-native-select',
template: ``,
})
export class VspNativeSelect {
@Input() value?: string;
@Output() valueChange = new EventEmitter();
@Input() options: NativeSelectOption[] = [];
val = val;
lbl = lbl;
onChange(e: Event): void {
this.value = (e.target as HTMLSelectElement).value;
this.valueChange.emit(this.value);
}
}