Beispiel #1
0
        public void SetClassSet()
        {
            string prefixName = "anticon";

            ClassMapper.Add(prefixName)
            .If($"{prefixName}-spin", () => Spin || this.Type == "loading");

            SvgStyle = $"focusable=\"false\" width=\"{Width}\" height=\"{Height}\" fill=\"{Fill}\"";
        }
Beispiel #2
0
 private void SetClassMap()
 {
     ClassMapper
     .Add("ant-collapse")
     .If("ant-collapse-icon-position-left", () => ExpandIconPosition == CollapseExpandIconPosition.Left)
     .If("ant-collapse-icon-position-right", () => ExpandIconPosition == CollapseExpandIconPosition.Right)
     .If("ant-collapse-borderless", () => !this.Bordered)
     .If("ant-collapse-rtl", () => RTL);;
 }
 private void SetClass()
 {
     ClassMapper
     .Add("ant-table-cell")
     .If($"ant-table-cell-fix-{Fixed}", () => Fixed.IsIn("right", "left"))
     .If($"ant-table-cell-fix-right-first", () => Fixed == "right" && Context?.Columns.FirstOrDefault(x => x.Fixed == "right")?.ColIndex == this.ColIndex)
     .If($"ant-table-cell-fix-left-last", () => Fixed == "left" && Context?.Columns.LastOrDefault(x => x.Fixed == "left")?.ColIndex == this.ColIndex)
     ;
 }
Beispiel #4
0
        protected void SetClassMap()
        {
            string prefixName = "ant-typography";

            ClassMapper
            .Add("ant-typography")
            .GetIf(() => $"{prefixName}-{Type}", () => !string.IsNullOrEmpty(Type))
            .If($"{prefixName}-disabled", () => Disabled)
            .If($"{prefixName}-rtl", () => RTL);
        }
 private void SetClassMapper()
 {
     ClassMapper
     .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)
     .If("ant-tree-rtl", () => RTL);
 }
Beispiel #6
0
        private void SetClass()
        {
            var prefixCls = "ant-layout-sider";

            ClassMapper.Add(prefixCls)
            .If($"{prefixCls}-zero-width", () => Collapsed && CollapsedWidth == 0)
            .If($"{prefixCls}-light", () => Theme == "light")
            .If($"{prefixCls}-collapsed", () => Collapsed)
            .If($"{prefixCls}-has-trigger", () => IsSiderTrigger)
            ;
        }
Beispiel #7
0
        protected override void OnInitialized()
        {
            string prefixCls = "ant-radio-group";

            ClassMapper.Add(prefixCls)
            .If($"{prefixCls}-large", () => Size == "large")
            .If($"{prefixCls}-small", () => Size == "small")
            .If($"{prefixCls}-{ButtonStyle}", () => ButtonStyle.IsIn("outline", "solid"));

            base.OnInitialized();
        }
 private void SetClass()
 {
     ClassMapper
     .Add("ant-table-cell")
     .GetIf(() => $"ant-table-cell-fix-{Fixed}", () => Fixed.IsIn("right", "left"))
     .If($"ant-table-cell-fix-right-first", () => Fixed == "right" && Context?.Columns.FirstOrDefault(x => x.Fixed == "right")?.ColIndex == this.ColIndex)
     .If($"ant-table-cell-fix-left-last", () => Fixed == "left" && Context?.Columns.LastOrDefault(x => x.Fixed == "left")?.ColIndex == this.ColIndex)
     .If($"ant-table-cell-with-append", () => ColIndex == 1 && Table.TreeMode)
     .If($"ant-table-cell-ellipsis", () => Ellipsis)
     ;
 }
        private void SetClass()
        {
            var clsPrefix = "ant-pagination";

            ClassMapper
            .Add(clsPrefix)
            .If($"{clsPrefix}-simple", () => Simple)
            .If($"{clsPrefix}-disabled", () => Disabled)
            .If($"mini", () => !Simple && Size == "small")
            ;
        }
Beispiel #10
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper
            .Add(_prefixCls)
            .If($"{_prefixCls}-rtl", () => RTL);

            _popoverClassMapper
            .Add($"{_prefixCls}-popover")
            .If($"{_prefixCls}-popover-rtl", () => RTL);
        }
Beispiel #11
0
        private void SetClass()
        {
            WrapperClassMapper
            .If(WrapperClassName, () => !string.IsNullOrWhiteSpace(WrapperClassName))
            .If($"{PrefixCls}-nested-loading", () => !Simple);

            ClassMapper.Add(PrefixCls)
            .If($"{PrefixCls}-spinning", () => _isLoading)
            .If($"{PrefixCls}-lg", () => Size == "large")
            .If($"{PrefixCls}-sm", () => Size == "small")
            .If($"{PrefixCls}-show-text", () => string.IsNullOrWhiteSpace(Tip));
        }
Beispiel #12
0
        protected override void OnInitialized()
        {
            if (MessageService != null)
            {
                MessageService.OnOpening += NotifyAsync;;
                MessageService.OnDestroy += Destroy;
                MessageService.OnConfig  += Config;
            }

            ClassMapper
            .Add(PrefixCls)
            .If($"{PrefixCls}-rtl", () => RTL);
        }
Beispiel #13
0
        protected void SetClass()
        {
            this.ClassMapper
            .Add(_prefixCls)
            .If($"{_prefixCls}-with-help {_prefixCls}-has-error", () => _isValid == false)
            .If($"{_prefixCls}-rtl", () => RTL)
            ;

            _labelClassMapper
            .Add($"{_prefixCls}-label")
            .If($"{_prefixCls}-label-left", () => FormLabelAlign == AntLabelAlignType.Left)
            ;
        }
Beispiel #14
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            var prefixCls = "ant-upload";

            _listClassMapper
            .Add($"{prefixCls}-list")
            .Get(() => $"{prefixCls}-list-{ListType}")
            .If($"{prefixCls}-list-rtl", () => RTL);

            FileList.InsertRange(0, DefaultFileList);
        }
        protected void SetClass()
        {
            string prefixCls = "ant-back-top";

            ClassMapper.Add(prefixCls);

            BackTopContentClassMapper
            .If($"{prefixCls}-content", () => ChildContent == null)
            .If("ant-fade ant-fade-leave ant-fade-leave-active", () => !_visible)
            .If("ant-fade ant-fade-enter ant-fade-enter-active", () => _visible)
            ;

            BackTopIconClassMapper.Add($"{prefixCls}-icon");
        }
Beispiel #16
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");
            }
        }
Beispiel #17
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper.Add("ant-cascader-picker")
            .GetIf(() => $"ant-cascader-picker-{Size}", () => _sizeMap.ContainsKey(Size))
            .GetIf(() => $"ant-input-{_sizeMap[Size]}", () => _sizeMap.ContainsKey(Size))
            ;

            _inputClassMapper
            .Add("ant-input")
            .Add("ant-cascader-input")
            .GetIf(() => $"ant-input-{_sizeMap[Size]}", () => _sizeMap.ContainsKey(Size));
        }
Beispiel #18
0
        protected override void OnInitialized()
        {
            ClassMapper.Add(PrefixName);

            _targetKeys = TargetKeys.ToList();
            var selectedKeys = SelectedKeys.ToList();

            _sourceSelectedKeys = selectedKeys.Where(key => !_targetKeys.Contains(key)).ToList();
            _targetSelectedKeys = selectedKeys.Where(key => _targetKeys.Contains(key)).ToList();
            var count = _sourceSelectedKeys.Count;

            InitData();

            MathTitleCount();
        }
Beispiel #19
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            var prefixCls = "ant-upload";

            ClassMapper
            .Add(prefixCls)
            .If($"{prefixCls}-rtl", () => RTL);

            _listClassMapper
            .Add($"{prefixCls}-list")
            .Get(() => $"{prefixCls}-list-{ListType}")
            .If($"{prefixCls}-list-rtl", () => RTL);
        }
Beispiel #20
0
        protected override async Task OnInitializedAsync()
        {
            if (Type == "loading")
            {
                Spin = true;
            }

            await SetupSvgImg();

            Button?.Icons.Add(this);

            ClassMapper.Add($"anticon")
            .GetIf(() => $"anticon-{Type}", () => !string.IsNullOrWhiteSpace(Type));

            await base.OnInitializedAsync();
        }
Beispiel #21
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");
            }
        }
Beispiel #22
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            if (!string.IsNullOrWhiteSpace(Width))
            {
                Style = $"width:{(CssSizeLength)Width};" + Style;
            }

            if (!string.IsNullOrWhiteSpace(Height))
            {
                Style     = $"height:{(CssSizeLength)Height};" + Style;
                _imgStyle = $"height:{(CssSizeLength)Height};" + _imgStyle;
            }

            ClassMapper.Add("ant-image")
            .If("ant-image-error", () => _isError);
        }
        protected override async Task OnInitializedAsync()
        {
            if (Type == "loading")
            {
                Spin = true;
            }

            await SetupSvgImg();

            if (this is Icon icon)
            {
                Button?.Icons.Add(icon);
            }

            ClassMapper.Add("anticon anticon-sync");

            await base.OnInitializedAsync();
        }
        protected override void OnInitialized()
        {
            base.OnInitialized();

            ClassMapper
            .Add("ant-cascader-picker")
            .GetIf(() => $"ant-cascader-picker-{Size}", () => _sizeMap.ContainsKey(Size))
            .If("ant-cascader-picker-rtl", () => RTL);

            _inputClassMapper
            .Add("ant-input")
            .Add("ant-cascader-input")
            .GetIf(() => $"ant-input-{_sizeMap[Size]}", () => _sizeMap.ContainsKey(Size))
            .If("ant-cascader-input-rtl", () => RTL);

            _menuClassMapper
            .Add("ant-cascader-menu")
            .If($"ant-cascader-menu-rtl", () => RTL);

            SetDefaultValue(Value ?? DefaultValue);
        }
 public CheckboxGroup()
 {
     ClassMapper
     .Add("ant-checkbox-group")
     .If("ant-checkbox-group-rtl", () => RTL);
 }
Beispiel #26
0
 public CheckboxGroup()
 {
     ClassMapper.Add("ant-checkbox-group");
 }
Beispiel #27
0
 protected override void OnInitialized()
 {
     ClassMapper.Add($"{RootMenu.PrefixCls}-item-group");
 }