using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using OneOf; using System; using System.Threading.Tasks; namespace AntDesign { public partial class Search : Input { private bool _isSearching; [Parameter] public EventCallback OnSearch { get; set; } [Parameter] public OneOf EnterButton { get; set; } = false; private int _sequence = 0; protected override void OnInitialized() { base.OnInitialized(); if (EnterButton.IsT0 && !EnterButton.AsT0) { Suffix = builder => { var i = 0; builder.OpenComponent(i++); builder.AddAttribute(i++, "Class", $"{PrefixCls}-search-icon"); builder.AddAttribute(i++, "Type", "search"); builder.AddAttribute(i++, "OnClick", CallbackFactory.Create(this, HandleSearch)); builder.CloseComponent(); }; } else { AddOnAfter = builder => { builder.OpenComponent