private void SetClass()
        {
            ClassMapper.Add(PrefixCls)
            .Add($"{PrefixCls}-{RootMenu.InternalMode}")
            .If($"{PrefixCls}-open", () => IsOpen);

            SubMenuMapper.Add("ant-menu")
            .Add("ant-menu-sub")
            .Add($"ant-menu-{(RootMenu.InternalMode == AntMenuMode.Horizontal ? AntMenuMode.Vertical : RootMenu.InternalMode)}")
            .If($"ant-menu-submenu-popup", () => RootMenu.InternalMode != AntMenuMode.Inline)
            .If($"ant-menu-disabled", () => Disabled)
            .If($"ant-menu-hidden", () => !IsOpen);
        }
Esempio n. 2
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)
            ;
        }
Esempio n. 3
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);
        }
Esempio n. 4
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)
            ;
        }
Esempio n. 5
0
        private void SetClassMap()
        {
            var cls = "ant-pagination";

            ClassMapper
            .If($"{cls}-prev", () => Type == "prev")
            .If($"{cls}-next", () => Type == "next")
            .If($"{cls}-item", () => Type == "page")
            .If($"{cls}-jump-prev", () => Type == "prev_5")
            .If($"{cls}-jump-prev-custom-icon", () => Type == "prev_5")
            .If($"{cls}-jump-next", () => Type == "next_5")
            .If($"{cls}-jump-next-custom-icon", () => Type == "next_5")
            .If($"{cls}-disabled", () => Disabled)
            .If($"{cls}-item-active", () => Active)
            ;
        }
Esempio n. 6
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");
            }
        }
Esempio n. 7
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);
        }
Esempio n. 9
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)
            ;
        }
Esempio n. 10
0
 protected override void OnInitialized()
 {
     ClassMapper.Add($"{RootMenu.PrefixCls}-item-group");
 }
Esempio n. 11
0
 protected void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(_prefixName);
 }
 protected override void OnInitialized()
 {
     ClassMapper.Add(_prefixCls);
 }
Esempio n. 13
0
 public CheckboxGroup()
 {
     ClassMapper.Add("ant-checkbox-group");
 }
Esempio n. 14
0
 public AntCheckboxGroupBase()
 {
     ClassMapper.Add("ant-checkbox-group");
 }
 protected void SetClassMap()
 {
     ClassMapper.Clear()
     .Add(PrefixName)
     .If($"{PrefixName}-no-flex", () => !IsFlexMode());
 }