correct implementation

This commit is contained in:
Niels Lyngsø
2024-04-17 23:22:51 +02:00
parent 6360eea016
commit 92063573ca
3 changed files with 9 additions and 6 deletions

View File

@@ -9,7 +9,10 @@ function getNumberOrUndefined(value: string) {
}
@customElement('umb-input-number-range')
export class UmbInputNumberRangeElement extends UmbFormControlMixin<string>(UmbLitElement, '') {
export class UmbInputNumberRangeElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
UmbLitElement,
'',
) {
@property({ type: String, attribute: 'min-label' })
minLabel = 'Low value';

View File

@@ -13,9 +13,9 @@ export class UmbBindValidationMessageToFormControl extends UmbControllerBase {
#context?: typeof UMB_VALIDATION_CONTEXT.TYPE;
#control: UmbFormControlMixinInterface<unknown, unknown>;
#control: UmbFormControlMixinInterface<unknown>;
#controlValidator?: ReturnType<UmbFormControlMixinInterface<unknown, unknown>['addValidator']>;
#controlValidator?: ReturnType<UmbFormControlMixinInterface<unknown>['addValidator']>;
#messages: Array<UmbValidationMessage> = [];
#isValid = false;
@@ -38,7 +38,7 @@ export class UmbBindValidationMessageToFormControl extends UmbControllerBase {
}
}
constructor(host: UmbControllerHost, formControl: UmbFormControlMixinInterface<unknown, unknown>, dataPath: string) {
constructor(host: UmbControllerHost, formControl: UmbFormControlMixinInterface<unknown>, dataPath: string) {
super(host, ctrlSymbol);
this.#control = formControl;
this.consumeContext(UMB_VALIDATION_CONTEXT, (context) => {

View File

@@ -12,12 +12,12 @@ export class UmbFormControlValidator extends UmbControllerBase implements UmbVal
#context?: typeof UMB_VALIDATION_CONTEXT.TYPE;
#control: UmbFormControlMixinInterface<unknown, unknown>;
#control: UmbFormControlMixinInterface<unknown>;
readonly controllerAlias: UmbControllerAlias;
#isValid = true;
constructor(host: UmbControllerHost, formControl: UmbFormControlMixinInterface<unknown, unknown>, dataPath?: string) {
constructor(host: UmbControllerHost, formControl: UmbFormControlMixinInterface<unknown>, dataPath?: string) {
super(host);
this.#dataPath = dataPath;
this.consumeContext(UMB_VALIDATION_CONTEXT, (context) => {