Esempio n. 1
0
 protected override void OnParametersSet()
 {
     base.OnParametersSet();
     if (string.IsNullOrWhiteSpace(showingImage) && !string.IsNullOrWhiteSpace(Image))
     {
         showingImage = Image;
     }
     if (IsLoading)
     {
         IsDisabled = true;
     }
     cssClassBuilder = HtmlPropertyBuilder.CreateCssClassBuilder();
     if (string.IsNullOrWhiteSpace(Cls) || AppendCustomCls)
     {
         cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}", Cls)
         .AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
         .AddIf(IsPlain, "is-plain")
         .AddIf(IsRound, "is-round")
         .AddIf(IsDisabled, "is-disabled")
         .AddIf(IsLoading, "is-loading")
         .AddIf(IsCircle, "is-circle");
         return;
     }
     cssClassBuilder.AddIf(!string.IsNullOrWhiteSpace(Cls), Cls);
     if (string.IsNullOrWhiteSpace(Cls))
     {
         cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}")
         .AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
         .AddIf(IsPlain, "is-plain")
         .AddIf(IsRound, "is-round")
         .AddIf(IsDisabled, "is-disabled")
         .AddIf(IsLoading, "is-loading")
         .AddIf(IsCircle, "is-circle");
     }
 }
Esempio n. 2
0
 protected override void OnParametersSet()
 {
     base.OnParametersSet();
     layoutCssBuilder = HtmlPropertyBuilder.CreateCssStyleBuilder();
     if (North != null)
     {
         layoutCssBuilder = layoutCssBuilder.AddIf(Fit, $"height:calc(100vh - {NorthHeight}px)");
     }
     else
     {
         layoutCssBuilder = layoutCssBuilder.AddIf(Fit, "height:calc(100vh)");
     }
     layoutCssBuilder = layoutCssBuilder.Add(Style);
 }
Esempio n. 3
0
        private async Task AnimationElementLoadAsync()
        {
            if (paths == null || !paths.Any())
            {
                return;
            }
            if (AutoAdjustPosition)
            {
                var rect = await animationElement.Dom(JSRuntime).GetBoundingClientRectAsync();

                var screenWidth = await Document.GetClientWidthAsync();

                var left = screenWidth / 2 - rect.Width / 2;
                styleBuilder.Add($"left:{left}px");
            }
            currentPath = paths.Dequeue();
            await Task.Delay(currentPath.Delay);

            ExecuteAnimation(currentPath.Style, currentPath.Increment);
        }