adapt typescript to strict mode

This commit is contained in:
imperosol
2026-08-20 16:17:23 +02:00
parent 3291a78d2b
commit 236860d0f5
40 changed files with 386 additions and 242 deletions
@@ -59,7 +59,7 @@ export class CounterProductSelect extends AutoCompleteSelectBase {
return onOptionSelect.call(
this.widget,
evt,
this.widget.getOption(value, true),
this.widget.getOption(value, true) as HTMLElement,
);
},
);
@@ -70,12 +70,15 @@ export class CounterProductSelect extends AutoCompleteSelectBase {
...super.tomSelectSettings(),
openOnFocus: false,
// We make searching on exact code matching a higher priority
// We need to manually set weights or it results on an inconsistent
// We need to manually set weights, or it results on an inconsistent
// behavior between production and development environment
//
// SearchField can be an object array (according to the docs),
// but it is unproperly typed, so we must force-cast to trick TS
searchField: [
{ field: "code", weight: 2 },
{ field: "text", weight: 0.5 },
],
] as unknown as string[],
};
}
}