// eslint-disable-next-line @typescript-eslint/no-unused-vars namespace Providers.OSUI.Dropdown.VirtualSelect.Search { // eslint-disable-next-line @typescript-eslint/naming-convention export class OSUIVirtualSelectSearch extends AbstractVirtualSelect { constructor(uniqueId: string, configs: JSON) { super(uniqueId, new VirtualSelectSearchConfig(configs)); } /** * Get the selected values options that will be used to pass into platform as a JSON string * * @protected */ protected getSelectedOptionsStructure(): DropDownOption[] { // Store the options selected let optionsSelected = []; // Check if it's multiple type if (this.configs.AllowMultipleSelection) { optionsSelected = this.virtualselectConfigs.getSelectedOptions(); // It returns an array of selected options } else { // It's single option type // Check if there are any selected option if (this.virtualselectConfigs.getSelectedOptions()) { optionsSelected.push(this.virtualselectConfigs.getSelectedOptions()); // It returns an single object of selected option } } return optionsSelected; } /** * Update property value from a given property name at OnParametersChange * * @param propertyName the name of the property that will be changed * @param propertyValue the new value that should be assigned to the given property name */ public changeProperty(propertyName: string, propertyValue: unknown): void { super.changeProperty(propertyName, propertyValue); if (this.isBuilt) { switch (propertyName) { case Enum.Properties.AllowMultipleSelection: this.redraw(); break; } } } } }