Ejemplo n.º 1
0
 private void SetClassMap()
 {
     ClassMapper.Clear().Add("ant-tree-checkbox")
     .If("ant-tree-checkbox-checked", () => SelfNode.Checked)
     .If("ant-tree-checkbox-indeterminate", () => SelfNode.Indeterminate)
     .If("ant-tree-checkbox-disabled", () => SelfNode.Disabled || SelfNode.DisableCheckbox)
     ;
 }
Ejemplo n.º 2
0
 private void SetClassMap()
 {
     ClassMapper.Clear()
     .Add("ant-collapse-item")
     .If("ant-collapse-no-arrow", () => !this.ShowArrow)
     .If("ant-collapse-item-active", () => this.Active)
     .If("ant-collapse-item-disabled", () => this.Disabled);
 }
Ejemplo n.º 3
0
        protected void SetClass()
        {
            var clsPrefix = "ant-rate";

            ClassMapper.Clear()
            .Add(clsPrefix)
            .If("ant-rate-disabled", () => Disabled);
        }
Ejemplo n.º 4
0
 private void SetClass()
 {
     ClassMapper.Clear()
     .Add(PrefixCls)
     .If($"{PrefixCls}-lg", () => Size == InputSize.Large)
     .If($"{PrefixCls}-sm", () => Size == InputSize.Small)
     .If($"{PrefixCls}-disabled", () => this.Disabled);
 }
Ejemplo n.º 5
0
 private void SetClassMapper()
 {
     ClassMapper.Clear().Add("ant-tree")
     .If("ant-tree-show-line", () => ShowLine)
     .If("ant-tree-icon-hide", () => ShowIcon)
     .If("ant-tree-block-node", () => BlockNode)
     .If("draggable-tree", () => Draggable);
 }
Ejemplo n.º 6
0
 private void SetClassMap()
 {
     ClassMapper.Clear().Add("ant-select-item").Add("ant-select-item-option")
     //.If("ant-select-item-option-grouped", () => this.AutocompleteOptgroup)
     .If("ant-select-item-option-selected", () => CalcSelected())
     .If("ant-select-item-option-active", () => CalcActive())
     .If("ant-select-item-option-disabled", () => this.Disabled);
 }
Ejemplo n.º 7
0
 protected void SetClassMap()
 {
     string prefixName = "ant-typography";
     ClassMapper.Clear()
         .Add("ant-typography")
         .If($"{prefixName}-{Type}", () => !string.IsNullOrEmpty(Type))
         .If($"{prefixName}-disabled", () => Disabled);
 }
Ejemplo n.º 8
0
        protected override void OnParametersSet()
        {
            base.OnParametersSet();

            ClassMapper.Clear()
            .Add($"{PreFixCls}-slide")
            .If($"{PreFixCls}-active", () => Active)
            .If($"{PreFixCls}-current", () => Active);
        }
Ejemplo n.º 9
0
        protected override void OnParametersSet()
        {
            base.OnParametersSet();

            _classMapper.Clear().
            Add(PrefixCls)
            .If($"{PrefixCls}-active", () => IsActive)
            .If($"{PrefixCls}-disabled", () => Disabled);
        }
Ejemplo n.º 10
0
        protected void SetClass()
        {
            var clsPrefix = "ant-rate";

            ClassMapper.Clear()
            .Add(clsPrefix)
            .If($"{clsPrefix}-disabled", () => Disabled)
            .If($"{clsPrefix}-rtl", () => RTL);
        }
Ejemplo n.º 11
0
 protected override void OnInitialized()
 {
     base.OnInitialized();
     ClassMapper.Clear()
     .Add(PREFIX_CLS)
     .If($"{PREFIX_CLS}-icon-hide", () => !ShowIcon)
     .If($"{PREFIX_CLS}-show-line", () => ShowLine)
     ;
 }
Ejemplo n.º 12
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)
     ;
 }
Ejemplo n.º 13
0
 protected void SetClass()
 {
     ClassMapper.Clear()
     .Add(_prefixCls)
     .If($"{_prefixCls}-checked", () => CurrentValue)
     .If($"{_prefixCls}-disabled", () => Disabled || Loading)
     .If($"{_prefixCls}-loading", () => Loading)
     .If($"{_prefixCls}-small", () => Size == "small")
     .If($"{_prefixCls}-rtl", () => RTL);
 }
Ejemplo n.º 14
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-lg", () => Size == InputSize.Large)
            .If($"{PrefixCls}-sm", () => Size == InputSize.Small)
            .If($"{PrefixCls}-compact", () => Compact);
        }
Ejemplo n.º 15
0
        private void SetClass()
        {
            SlickSliderClassMapper.Clear()
            .Add("slick-slider slick-initialized")
            .If("slick-vertical", () => !IsHorizontal);

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-vertical", () => !IsHorizontal);
        }
Ejemplo n.º 16
0
        private void SetClass()
        {
            SlickSliderClassMapper.Add("slick-slider slick-initialized")
            .If("slick-vertical", () => DotPosition.IsIn(CarouselDotPosition.Left, CarouselDotPosition.Right))
            ;

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-vertical", () => DotPosition.IsIn(CarouselDotPosition.Left, CarouselDotPosition.Right));
        }
Ejemplo n.º 17
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);
        }
Ejemplo n.º 18
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper.Clear()
            .Add(PrefixCls)
            .If($"{PrefixCls}-lg", () => Size == InputSize.Large)
            .If($"{PrefixCls}-sm", () => Size == InputSize.Small)
            .If($"{PrefixCls}-compact", () => Attributes != null && Attributes.ContainsKey("compact"));
        }
Ejemplo n.º 19
0
 protected void SetClassMap()
 {
     ClassMapper.Clear()
     .Add("ant-select-item")
     .Add(ClassPrefix)
     .If($"{ClassPrefix}-disabled", () => Disabled)
     .If($"{ClassPrefix}-selected", () => IsSelected)
     .If($"{ClassPrefix}-active", () => _isActive)
     .If($"{ClassPrefix}-grouped", () => SelectOptGroupParent != null)
     .If(ClassName, () => !string.IsNullOrWhiteSpace(ClassName));
 }
Ejemplo n.º 20
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);
 }
Ejemplo n.º 21
0
 private void SetClass()
 {
     ClassMapper.Clear()
     .Add("ant-divider")
     .Get(() => $"ant-divider-{this.Type.ToLowerInvariant()}")
     .If("ant-divider-with-text", () => Text != null || ChildContent != null)
     .GetIf(() => $"ant-divider-with-text-{this.Orientation.ToLowerInvariant()}", () => Text != null || ChildContent != null)
     .If($"ant-divider-plain", () => Plain && (Text != null || ChildContent != null))
     .If("ant-divider-dashed", () => Dashed)
     ;
 }
Ejemplo n.º 22
0
        /// <summary>
        /// Sets the default CSS classes.
        /// </summary>
        private void SetClassMap()
        {
            var prefixName = "ant-ribbon";

            ClassMapper.Clear()
            .Add(prefixName)
            .Add($"{prefixName}-placement-{Placement}")
            .If($"{prefixName}-rtl", () => RTL)
            .If($"{prefixName}-color-{PresetColor}", () => Color.IsIn(_badgePresetColors))
            ;
        }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Sets the default CSS classes.
        /// </summary>
        private void SetClassMap()
        {
            var prefixName = "ant-ribbon";

            ClassMapper.Clear()
            .Add(prefixName)
            .Add($"{prefixName}-placement-{Placement}")
            //.If($"{prefixName}-rtl", () => Direction == "RTL" # Placeholder for when RTL support is added
            .If($"{prefixName}-color-{PresetColor}", () => Color.IsIn(_badgePresetColors))
            ;
        }
Ejemplo n.º 25
0
        protected override Task OnParametersSetAsync()
        {
            ClassMapper.Clear()
            .Add(_prefixCls)
            .If($"{_prefixCls}-checked", () => _isChecked)
            .If($"{_prefixCls}-disabled", () => Disabled || Loading)
            .If($"{_prefixCls}-loading", () => Loading)
            .If($"{_prefixCls}-small", () => Size.Equals("small"))
            ;

            return(base.OnParametersSetAsync());
        }
Ejemplo n.º 26
0
        protected void SetClass()
        {
            ClassMapperLabel.Clear()
            .Add($"{_prefixCls}-wrapper")
            .If($"{_prefixCls}-wrapper-checked", () => Checked);

            ClassMapper.Clear()
            .Add(_prefixCls)
            .If($"{_prefixCls}-checked", () => Checked && !Indeterminate)
            .If($"{_prefixCls}-disabled", () => Disabled)
            .If($"{_prefixCls}-indeterminate", () => Indeterminate)
            .If($"{_prefixCls}-rtl", () => RTL);
        }
Ejemplo n.º 27
0
        protected virtual void SetClasses()
        {
            AffixWrapperClass = $"{PrefixCls}-affix-wrapper {(IsFocused ? $"{PrefixCls}-affix-wrapper-focused" : "")}";
            GroupWrapperClass = $"{PrefixCls}-group-wrapper";

            if (!string.IsNullOrWhiteSpace(Class))
            {
                AffixWrapperClass         = string.Join(" ", Class, AffixWrapperClass);
                ClassMapper.OriginalClass = "";
            }

            ClassMapper.Clear()
            .Add($"{PrefixCls}")
            .If($"{PrefixCls}-lg", () => Size == InputSize.Large)
            .If($"{PrefixCls}-sm", () => Size == InputSize.Small)
            .If($"{PrefixCls}-rtl", () => RTL)
            ;

            Attributes ??= new Dictionary <string, object>();

            if (MaxLength >= 0 && !Attributes.ContainsKey("maxlength"))
            {
                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");
            }
        }
Ejemplo n.º 28
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)
            ;
        }
Ejemplo n.º 29
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            this.CurrentValue = this.CurrentValue ? this.CurrentValue : this.Checked;

            ClassMapper.Clear()
            .Add(_prefixCls)
            .If($"{_prefixCls}-checked", () => CurrentValue)
            .If($"{_prefixCls}-disabled", () => Disabled || Loading)
            .If($"{_prefixCls}-loading", () => Loading)
            .If($"{_prefixCls}-small", () => Size == "small")
            ;
        }
Ejemplo n.º 30
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);
        }