private void SetClass()
 {
     ClassMapper.Clear()
     .Add(PrefixCls)
     .If($"{PrefixCls}-lg", () => size == AntInputSize.Large)
     .If($"{PrefixCls}-sm", () => size == AntInputSize.Small)
     .If($"{PrefixCls}-disabled", () => Attributes.TryGetValue("disabled", out object disabled) && disabled.ToString() == true.ToString());
 }
 private void SetClass()
 {
     ClassMapper.Clear()
     .Add(PrefixCls)
     .If($"{PrefixCls}-lg", () => size == AntInputSize.Large)
     .If($"{PrefixCls}-sm", () => size == AntInputSize.Small)
     .If($"{PrefixCls}-disabled", () => Attributes != null && Attributes["disabled"].ToString() == true.ToString());
 }
Example #3
0
 private void SetClass()
 {
     ClassMapper.Clear()
     .Add(PrefixCls)
     .If($"{PrefixCls}-lg", () => Size == AntInputSize.Large)
     .If($"{PrefixCls}-sm", () => Size == AntInputSize.Small)
     .If($"{PrefixCls}-disabled", () => this.Disabled);
 }
Example #4
0
        private void SetClassMap()
        {
            string prefixName = $"{Menu.PrefixCls}-item";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-selected", () => Selected)
            .If($"{prefixName}-disabled", () => Disabled);
        }
        private void SetClassMap()
        {
            string prefixName = Menu.isInDropDown ? "ant-dropdown-menu-item" : "ant-menu-item";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-selected", () => selected)
            .If($"{prefixName}-disabled", () => disabled);
        }
Example #6
0
        protected void SetClassMap()
        {
            string prefixName = "ant-typography";

            ClassMapper.Clear()
            .Add("ant-typography")
            .If($"{prefixName}-{type}", () => !string.IsNullOrEmpty(type))
            .If($"{prefixName}-disabled", () => disabled);
        }
Example #7
0
        protected override void OnParametersSet()
        {
            base.OnParametersSet();

            ClassMapper.Clear().
            Add(PrefixCls)
            .If($"{PrefixCls}-active", () => IsActive)
            .If($"{PrefixCls}-disabled", () => Disabled);
        }
        protected void setClass()
        {
            var prefixName = "ant-checkbox";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-checked", () => @checked && !indeterminate)
            .If($"{prefixName}-disabled", () => disabled)
            .If($"{prefixName}-indeterminate", () => indeterminate);
        }
        /// <summary>
        /// Sets the default CSS classes.
        /// </summary>
        protected void SetClassMap()
        {
            string prefixName = "ant-badge";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-status", () => !string.IsNullOrEmpty(Status) || !string.IsNullOrEmpty(Color))
            .If($"{prefixName}-not-a-wrapper", () => ChildContent == null)
            ;
        }
Example #10
0
        protected void SetClass()
        {
            string prefixName = "ant-checkbox";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-checked", () => Checked && !Indeterminate)
            .If($"{prefixName}-disabled", () => Disabled)
            .If($"{prefixName}-indeterminate", () => Indeterminate);
        }
Example #11
0
 private void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(prefixCls)
     .If($"{prefixCls}-{this.sizeMap[this.size]}", () => sizeMap.ContainsKey(size))
     .If($"{prefixCls}-{this.shape}", () => !string.IsNullOrEmpty(shape))
     .If($"{prefixCls}-icon", () => !string.IsNullOrEmpty(icon))
     .If($"{prefixCls}-image", () => hasSrc)
     ;
 }
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-lg", () => size == AntInputSize.Large)
            .If($"{PrefixCls}-sm", () => size == AntInputSize.Small)
            .If($"{PrefixCls}-compact", () => Attributes != null && Attributes.ContainsKey("compact"));
        }
Example #13
0
 private void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(_prefixCls)
     .If($"{_prefixCls}-{this._sizeMap[this.Size]}", () => _sizeMap.ContainsKey(Size))
     .If($"{_prefixCls}-{this.Shape}", () => !string.IsNullOrEmpty(Shape))
     .If($"{_prefixCls}-icon", () => !string.IsNullOrEmpty(Icon))
     .If($"{_prefixCls}-image", () => _hasSrc)
     ;
 }
Example #14
0
 private void SetClasses()
 {
     ClassMapper.Clear()
     .Add(PrefixCls)
     .Add($"{PrefixCls}-{Size.Name}")
     .If($"{PrefixCls}-{Type.Name}", () => Type != ProgressType.Dashboard)
     .If($"{PrefixCls}-{ProgressType.Circle.Name}", () => Type == ProgressType.Dashboard)
     .If($"{PrefixCls}-status-{Status.Name}", () => Status != null)
     .If($"{PrefixCls}-show-info", () => ShowInfo)
     .If($"{PrefixCls}-steps", () => Steps > 0);
 }
        protected void SetClassMap()
        {
            var prefix = "ant-timeline";

            ClassMapper.Clear()
            .Add(prefix)
            .If($"{prefix}-right", () => Mode == "right")
            .If($"{prefix}-alternate", () => Mode == "alternate")
            .If($"{prefix}-pending", () => Pending != null)
            .If($"{prefix}-reverse", () => Reverse);
        }
Example #16
0
        /// <summary>
        /// Sets the default classes.
        /// </summary>
        private void SetClassMap()
        {
            string prefixName = "ant-alert";

            ClassMapper.Clear()
            .Add("ant-alert")
            .If($"{prefixName}-{Type}", () => !string.IsNullOrEmpty(Type))
            .If($"{prefixName}-no-icon", () => !ShowIcon)
            .If($"{prefixName}-closable", () => Closable)
            .If($"{prefixName}-banner", () => Banner)
            .If($"{prefixName}-with-description", () => !string.IsNullOrEmpty(Description))
            .If($"{prefixName}-slide-up-leave", () => _isClosing)
            ;
        }
Example #17
0
        internal void SetClassMap()
        {
            var prefix = "ant-timeline-item";

            ClassMapper.Clear().Add(prefix)
            .If($"{prefix}-right", () => Position == "right")
            .If($"{prefix}-left", () => Position == "left")
            .If($"{prefix}-last", () => IsLast);

            var headPrefix = "ant-timeline-item-head";

            _headClassMapper.Clear().Add(headPrefix)
            .If($"{headPrefix}-{Color}", () => _defaultColors.Contains(Color))
            .If($"{headPrefix}-custom", () => Dot != null);
        }
Example #18
0
        private void SetClassMap()
        {
            this.isChildMenuSelected = this.Items.Any(x => x.nzSelected);

            string prefixName = Menu.isInDropDown ? "ant-dropdown-menu-submenu" : "ant-menu-submenu";

            ClassMapper.Clear()
            .Add(prefixName)
            .If($"{prefixName}-disabled", () => nzDisabled)
            .If($"{prefixName}-open", () => this.nzOpen)
            .If($"{prefixName}-selected", () => isChildMenuSelected)
            .Add($"{prefixName}-{Menu.nzMode}")
            .If($"{prefixName}-active", () => isMouseHover && !nzDisabled)
            ;
        }
Example #19
0
        protected virtual void SetClasses()
        {
            ClassMapper.Clear()
            .If($"{PrefixCls}", () => type != "number")
            .If($"{PrefixCls}-lg", () => size == AntInputSize.Large)
            .If($"{PrefixCls}-sm", () => size == AntInputSize.Small);

            if (Attributes is null)
            {
                Attributes = new System.Collections.Generic.Dictionary <string, object>();
            }

            _affixWrapperClass = $"{PrefixCls}-affix-wrapper";
            _groupWrapperClass = $"{PrefixCls}-group-wrapper";

            if (maxLength >= 0)
            {
                Attributes?.Add("maxlength", maxLength);
            }

            if (Attributes.ContainsKey("disabled"))
            {
                // TODO: disable element
                _affixWrapperClass = string.Join(" ", _affixWrapperClass, $"{PrefixCls}-affix-wrapper-disabled");
                ClassMapper.Add($"{PrefixCls}-disabled");
            }

            if (Attributes.ContainsKey("allowClear"))
            {
                _allowClear     = true;
                _clearIconClass = $"{PrefixCls}-clear-icon";
                ToggleClearBtn();
            }

            if (size == AntInputSize.Large)
            {
                _affixWrapperClass = string.Join(" ", _affixWrapperClass, $"{PrefixCls}-affix-wrapper-lg");
                _groupWrapperClass = string.Join(" ", _groupWrapperClass, $"{PrefixCls}-group-wrapper-lg");
            }
            else if (size == AntInputSize.Small)
            {
                _affixWrapperClass = string.Join(" ", _affixWrapperClass, $"{PrefixCls}-affix-wrapper-sm");
                _groupWrapperClass = string.Join(" ", _groupWrapperClass, $"{PrefixCls}-group-wrapper-sm");
            }
        }
Example #20
0
        protected virtual void SetClasses()
        {
            ClassMapper.Clear()
            .If($"{PrefixCls}", () => Type != "number")
            .If($"{PrefixCls}-lg", () => Size == InputSize.Large)
            .If($"{PrefixCls}-sm", () => Size == InputSize.Small);

            if (Attributes is null)
            {
                Attributes = new Dictionary <string, object>();
            }

            AffixWrapperClass = $"{PrefixCls}-affix-wrapper";
            GroupWrapperClass = $"{PrefixCls}-group-wrapper";

            if (MaxLength >= 0)
            {
                Attributes?.Add("maxlength", MaxLength);
            }

            if (Disabled)
            {
                // TODO: disable element
                AffixWrapperClass = string.Join(" ", AffixWrapperClass, $"{PrefixCls}-affix-wrapper-disabled");
                ClassMapper.Add($"{PrefixCls}-disabled");
            }

            if (AllowClear)
            {
                _allowClear = true;
                //ClearIconClass = $"{PrefixCls}-clear-icon";
                ToggleClearBtn();
            }

            if (Size == InputSize.Large)
            {
                AffixWrapperClass = string.Join(" ", AffixWrapperClass, $"{PrefixCls}-affix-wrapper-lg");
                GroupWrapperClass = string.Join(" ", GroupWrapperClass, $"{PrefixCls}-group-wrapper-lg");
            }
            else if (Size == InputSize.Small)
            {
                AffixWrapperClass = string.Join(" ", AffixWrapperClass, $"{PrefixCls}-affix-wrapper-sm");
                GroupWrapperClass = string.Join(" ", GroupWrapperClass, $"{PrefixCls}-group-wrapper-sm");
            }
        }
        protected override void OnParametersSet()
        {
            base.OnParametersSet();

            if (Effect != AntCarouselEffect.ScrollX && Effect != AntCarouselEffect.Fade)
            {
                throw new ArgumentOutOfRangeException($"{nameof(Effect)} must be one of {nameof(AntCarouselEffect)}.{nameof(AntCarouselEffect.ScrollX)} or {nameof(AntCarouselEffect)}.{nameof(AntCarouselEffect.Fade)}.");
            }

            _timer?.Dispose();
            if (Autoplay != TimeSpan.Zero)
            {
                _timer = new Timer(AutoplaySlick, null, (int)Autoplay.TotalMilliseconds, (int)Autoplay.TotalMilliseconds);
            }

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-vertical", () => DotPosition == AntCarouselDotPosition.Left || DotPosition == AntCarouselDotPosition.Right);
        }
Example #22
0
        protected void SetClassMap()
        {
            string    prefixName = "ant-btn";
            Hashtable sizeMap    = new Hashtable()
            {
                ["large"] = "lg",
                ["small"] = "sm"
            };

            ClassMapper.Clear()
            .Add("ant-btn")
            .If($"{prefixName}-{this.type}", () => !string.IsNullOrEmpty(type))
            .If($"{prefixName}-{shape}", () => !string.IsNullOrEmpty(shape))
            .If($"{prefixName}-{sizeMap[this.size]}", () => sizeMap.ContainsKey(size))
            .If($"{prefixName}-loading", () => loading)
            .If($"{prefixName}-icon-only", () => Icons.Count == 0 && !this.search && !this.isInDropdown && this.ChildContent == null)
            .If($"{prefixName}-background-ghost", () => ghost)
            .If($"{prefixName}-block", () => this.block)
            .If($"ant-input-search-button", () => this.search)
            ;
        }
Example #23
0
 protected void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(_prefixName);
 }
 protected void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(PrefixName)
     .If($"{PrefixName}-no-flex", () => !IsFlexMode());
 }