|
|
|
|
@ -117,12 +117,22 @@ export class NumberFieldProvider {
|
|
|
|
|
private constructor(opts: NumberFieldOpts) {
|
|
|
|
|
this.opts = opts;
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(numberFieldMorfo, {});
|
|
|
|
|
this.runtime = this.soma.runtime(numberFieldMorfo, {
|
|
|
|
|
props: {
|
|
|
|
|
disabled: () => this.isDisabled,
|
|
|
|
|
readonly: () => this.isReadonly,
|
|
|
|
|
required: () => this.isRequired,
|
|
|
|
|
invalid: () => this.isInvalid,
|
|
|
|
|
focused: () => this.focused,
|
|
|
|
|
scrubbing: () => this.scrubbing
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.runtimePart = this.runtime.part('provider', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
context: NumberFieldProvider.ctx
|
|
|
|
|
context: NumberFieldProvider.ctx,
|
|
|
|
|
syncAttrs: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.locale = readableActive(() => opts.locale.current ?? this.soma.langs.getLocale() ?? 'en');
|
|
|
|
|
@ -424,13 +434,7 @@ export class NumberFieldProvider {
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
|
|
|
|
dir: this.opts.dir.current,
|
|
|
|
|
'data-disabled': boolToEmptyStrOrUndef(this.isDisabled),
|
|
|
|
|
'data-readonly': boolToEmptyStrOrUndef(this.isReadonly),
|
|
|
|
|
'data-required': boolToEmptyStrOrUndef(this.isRequired),
|
|
|
|
|
'data-invalid': boolToEmptyStrOrUndef(this.isInvalid),
|
|
|
|
|
'data-focused': boolToEmptyStrOrUndef(this.focused),
|
|
|
|
|
'data-scrubbing': boolToEmptyStrOrUndef(this.scrubbing)
|
|
|
|
|
dir: this.opts.dir.current
|
|
|
|
|
} as const)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|