예제 #1
0
        private static bool DefaultFilterOption(string value, SelectOption option)
        {
            if (option.Children == null)
            {
                return(false);
            }

            var optionContent = option.Children.ToUpperInvariant();

            return(optionContent.Contains(value, StringComparison.OrdinalIgnoreCase));
        }
예제 #2
0
        protected Properties GetProperties(SelectOption option)
        {
            return(new Properties
            {
                Closable = true,
                Value = option.Value,
                Label = option.Label,
                OnClose = Action
            });

            void Action(MouseEventArgs e) => OnRemoveSelected(option);
        }
예제 #3
0
        protected OneOf <string, RenderFragment> GetShowValue(SelectOption option)
        {
            if (option.IsSearch || option.IsTag)
            {
                return(option.Value);
            }

            return(OptionLabelProp switch
            {
                "children" => option?.ChildContent,
                "value" => option?.Value ?? option.Label,
                "label" => option?.Label ?? option.Value,
                _ => SelectMode == SelectMode.Default ? OneOf <string, RenderFragment> .FromT1((option?.ChildContent)) : option?.Label ?? option.Value,
            });
예제 #4
0
 protected string GetAriaSelected(SelectOption selectOption)
 {
     return(SelectedOptions.Contains(selectOption) ? "true" : "false");
 }
예제 #5
0
 public void RemoveOption(SelectOption option)
 {
     SelectOptions.Remove(option);
     Parent.RemoveOption(option);
 }
예제 #6
0
 public void AddOption(SelectOption option)
 {
     SelectOptions.Add(option);
     Parent.AddOption(option);
 }