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()); }
private void SetClass() { ClassMapper.Clear() .Add(PrefixCls) .If($"{PrefixCls}-lg", () => Size == AntInputSize.Large) .If($"{PrefixCls}-sm", () => Size == AntInputSize.Small) .If($"{PrefixCls}-disabled", () => this.Disabled); }
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); }
protected void SetClassMap() { string prefixName = "ant-typography"; ClassMapper.Clear() .Add("ant-typography") .If($"{prefixName}-{type}", () => !string.IsNullOrEmpty(type)) .If($"{prefixName}-disabled", () => disabled); }
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) ; }
protected void SetClass() { string prefixName = "ant-checkbox"; ClassMapper.Clear() .Add(prefixName) .If($"{prefixName}-checked", () => Checked && !Indeterminate) .If($"{prefixName}-disabled", () => Disabled) .If($"{prefixName}-indeterminate", () => Indeterminate); }
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")); }
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) ; }
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); }
/// <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) ; }
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); }
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) ; }
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"); } }
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); }
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) ; }
protected void SetClassMap() { ClassMapper.Clear() .Add(_prefixName); }
protected void SetClassMap() { ClassMapper.Clear() .Add(PrefixName) .If($"{PrefixName}-no-flex", () => !IsFlexMode()); }