示例#1
0
        public TypeaheadProxy(IJSRuntime runtime, ElementReference element, TypeaheadOptions <T> options)
        {
            _Runtime = runtime;
            _Element = element;

            _Source              = options.Source?.ToArray();
            _SourceCallback      = options.SourceCallback;
            _Items               = options.Items;
            _MinLength           = options.MinLength;
            _ShowHintOnFocus     = options.ShowHintOnFocus;
            _ScrollHeight        = options.ScrollHeight;
            _Highlighter         = options.Highlighter;
            _DisplayText         = options.DisplayText;
            _AutoSelect          = options.AutoSelect;
            _AfterSelect         = options.AfterSelect;
            _Delay               = options.Delay;
            _AppendTo            = options.AppendTo;
            _AppendToSelector    = options.AppendToSelector;
            _FitToElement        = options.FitToElement;
            _ChangeInputOnSelect = options.ChangeInputOnSelect;
            _ChangeInputOnMove   = options.ChangeInputOnMove;
            _OpenLinkInNewTab    = options.OpenLinkInNewTab;
            _SelectOnBlur        = options.SelectOnBlur;
            _ShowCategoryHeader  = options.ShowCategoryHeader;

            _History        = new List <ItemList>();
            _MaximumHistory = 16;
        }
示例#2
0
        public static async Task <TypeaheadProxy <T> > TypeaheadAsync <T>(this IJSRuntime runtime, ElementReference element, TypeaheadOptions <T> options)
        {
            var proxy = new TypeaheadProxy <T>(runtime, element, options);
            await proxy.InitializeAsync().ConfigureAwait(false);

            return(proxy);
        }