コード例 #1
0
 private async Task OnBlurAsync(FocusEventArgs e)
 {
     if (OnBlur.HasDelegate)
     {
         await OnBlur.InvokeAsync(e);
     }
 }
コード例 #2
0
 internal virtual async Task OnBlurAsync(FocusEventArgs e)
 {
     if (OnBlur.HasDelegate)
     {
         await OnBlur.InvokeAsync(e);
     }
 }
コード例 #3
0
 public void HandleBlur(string value)
 {
     if (OnBlur.HasDelegate)
     {
         OnBlur.InvokeAsync(value);
     }
 }
コード例 #4
0
 protected void OnBlurEvent(FocusEventArgs?e)
 {
     if (ValidateOnBlur && EditContext != null)
     {
         EditContext.NotifyFieldChanged(FieldIdentifier);
     }
     if (OnBlur.HasDelegate)
     {
         OnBlur.InvokeAsync(e);
     }
 }
コード例 #5
0
ファイル: Input.cs プロジェクト: szmalec/ant-design-blazor
        internal virtual async Task OnBlurAsync(FocusEventArgs e)
        {
            if (_compositionInputting)
            {
                _compositionInputting = false;
            }

            await ChangeValue();

            if (OnBlur.HasDelegate)
            {
                await OnBlur.InvokeAsync(e);
            }
        }
コード例 #6
0
        internal async void Onblur(FocusEventArgs args)
        {
            if (args == null)
            {
                return;
            }
            Focused = false;
            if (OnBlur.HasDelegate)
            {
                await OnBlur.InvokeAsync(args);
            }
            await JsInvokeAsync(JSInteropConstants.blur, Ref);

            StateHasChanged();
        }
コード例 #7
0
ファイル: Input.cs プロジェクト: zhou6572/ant-design-blazor
        internal virtual async Task OnBlurAsync(FocusEventArgs e)
        {
            IsFocused = false;
            if (_hasAffixWrapper)
            {
                SetClasses();
            }
            if (_compositionInputting)
            {
                _compositionInputting = false;
            }

            await ChangeValue(true);

            if (OnBlur.HasDelegate)
            {
                await OnBlur.InvokeAsync(e);
            }
        }
コード例 #8
0
 protected virtual void OnBlurred(FocusEventArgs obj)
 {
     _isFocused = false;
     Touched    = true;
     BeginValidateAfter(OnBlur.InvokeAsync(obj));
 }
コード例 #9
0
 protected virtual Task HandleBlur(FocusEventArgs args)
 {
     return(OnBlur.InvokeAsync(args));
 }
コード例 #10
0
        /// <inheritdoc />
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            // Label
            BuildRenderTreeLabel(builder);

            if (HasInputGroup)
            {
                // <div>
                builder.OpenElement(0, Html.DIV);
                builder.AddAttribute(1, Html.CLASS, Bootstrap.INPUT_GROUP);
            }

            if (HasPrepend)
            {
                // <div>
                builder.OpenElement(2, Html.DIV);
                builder.AddAttribute(3, Html.CLASS, Bootstrap.INPUT_GROUP_PREPEND);

                // <span>
                builder.OpenElement(4, Html.SPAN);
                builder.AddAttribute(5, Html.CLASS, Bootstrap.INPUT_GROUP_TEXT);
                builder.AddContent(6, Prepend);
                builder.CloseElement();
                // </span>

                // </div>
                builder.CloseElement();
            }

            // Input
            builder.OpenElement(7, Html.INPUT);
            builder.AddMultipleAttributes(8, Attributes);
            builder.AddAttribute(9, Html.TYPE, "number");
            builder.AddAttribute(10, Html.VALUE, BindConverter.FormatValue(CurrentValueAsString));
            builder.AddAttribute(11, Html.CLASS, CssClass);             // Overwrite class in Attributes

            // Data Binding & OnChange
            builder.AddAttribute(12, Html.ONCHANGE, EventCallback.Factory.CreateBinder <string>(this, async(__value) =>
            {
                // Bind
                CurrentValueAsString = __value;

                // OnChange
                if (OnChange.HasDelegate)
                {
                    await OnChange.InvokeAsync(new ChangeEventArgs {
                        Value = __value
                    });
                }
            }, CurrentValueAsString));

            // OnBlur
            if (OnBlur.HasDelegate)
            {
                builder.AddAttribute(13, "onblur", EventCallback.Factory.Create(this, async(__value) =>
                {
                    await OnBlur.InvokeAsync(new EventArgs());
                }));
            }

            // OnFocus
            if (OnFocus.HasDelegate)
            {
                builder.AddAttribute(13, "onfocus", EventCallback.Factory.Create(this, async(__value) =>
                {
                    await OnFocus.InvokeAsync(new EventArgs());
                }));
            }

            // Disabled?
            if (Disabled ?? false)
            {
                builder.AddAttribute(20, Html.DISABLED, string.Empty);
            }

            // Help
            if (HasHelp)
            {
                builder.AddAttribute(21, Html.ARIA_DESCRIBEDBY, $"{Id}-help");
            }

            builder.CloseElement();

            if (HasAppend)
            {
                // <div>
                builder.OpenElement(22, Html.DIV);
                builder.AddAttribute(23, Html.CLASS, "input-group-append");

                // <span>
                builder.OpenElement(24, Html.SPAN);
                builder.AddAttribute(25, Html.CLASS, Bootstrap.INPUT_GROUP_TEXT);
                builder.AddContent(26, Append);
                builder.CloseElement();
                // </span>

                // </div>
                builder.CloseElement();
            }

            if (HasInputGroup)
            {
                // </div>
                builder.CloseElement();
            }

            // Help
            BuildRenderTreeHelp(builder);
        }
コード例 #11
0
 private async Task OnOptionBlur(FocusEventArgs focusEventArgs)
 {
     await OnBlur.InvokeAsync(new ChoiceGroupOptionFocusEventArgs { Item = Item, FocusEventArgs = focusEventArgs });
 }
コード例 #12
0
 private void Blur(FocusEventArgs e)
 {
     this._isFocused = false;
     OnBlur.InvokeAsync(e);
 }