protected override void SetClasses() { base.SetClasses(); //ant-input-password-large ant-input-affix-wrapper ant-input-affix-wrapper-lg ClassMapper .If($"{PrefixCls}-password-large", () => Size == InputSize.Large) .If($"{PrefixCls}-password-small", () => Size == InputSize.Small); AffixWrapperClass = string.Join(" ", AffixWrapperClass, $"{PrefixCls}-password"); if (VisibilityToggle) { Suffix = new RenderFragment((builder) => { int i = 0; builder.OpenElement(i++, "span"); builder.AddAttribute(i++, "class", $"{PrefixCls}-suffix"); builder.OpenComponent <AntIcon>(i++); builder.AddAttribute(i++, "class", $"{PrefixCls}-password-icon"); builder.AddAttribute(i++, "type", _eyeIcon); builder.AddAttribute(i++, "onclick", CallbackFactory.Create(this, ToggleVisibility)); builder.CloseComponent(); builder.CloseElement(); }); } }
protected override void OnInitialized() { base.OnInitialized(); if (!Sortable) { Sortable = SorterMultiple != default || SorterCompare != default || Sort != default; } if (IsHeader) { if (FieldExpression != null) { _propertyReflector = PropertyReflector.Create(FieldExpression); if (Sortable) { SortModel = new SortModel <TData>(_propertyReflector.Value.PropertyInfo, SorterMultiple, Sort, SorterCompare); } } else { (GetValue, SortModel) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } } else if (IsBody) { SortModel = Context.HeaderColumns[ColIndex] is IFieldColumn fieldColumn ? fieldColumn.SortModel : null; (GetValue, _) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } ClassMapper .If("ant-table-column-has-sorters", () => Sortable) .If($"ant-table-column-sort", () => Sortable && SortModel != null && SortModel.SortType.IsIn(SortType.Ascending, SortType.Descending)); }
/// <inheritdoc /> protected override void OnInitialized() { // We'll consider re-rendering on each location change NavigationManger.LocationChanged += OnLocationChanged; ClassMapper.If(ActiveClass, () => _isActive) .If(DefaultActiveClass, () => _isActive && string.IsNullOrWhiteSpace(ActiveClass)); }
protected override void OnInitialized() { base.OnInitialized(); Sortable = Sortable || SorterMultiple != default || SorterCompare != default || DefaultSortOrder != default || SortDirections?.Any() == true; if (IsHeader) { if (FieldExpression != null) { var paramExp = Expression.Parameter(ItemType); var member = ColumnExpressionHelper.GetReturnMemberInfo(FieldExpression); var bodyExp = Expression.MakeMemberAccess(paramExp, member); GetFieldExpression = Expression.Lambda(bodyExp, paramExp); } else if (DataIndex != null) { (_, GetFieldExpression) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } if (Sortable && GetFieldExpression != null) { SortModel = new SortModel <TData>(GetFieldExpression, SorterMultiple, DefaultSortOrder, SorterCompare); } if (GetFieldExpression != null) { var member = ColumnExpressionHelper.GetReturnMemberInfo(GetFieldExpression); DisplayName = member.GetCustomAttribute <DisplayNameAttribute>(true)?.DisplayName ?? member.Name; FieldName = member.Name; } } else if (IsBody) { SortModel = Context.HeaderColumns[ColIndex] is IFieldColumn fieldColumn ? fieldColumn.SortModel : null; (GetValue, _) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } SortDirections ??= Table.SortDirections; Sortable = Sortable || SortModel != null; _sortDirection = SortModel?.SortDirection ?? DefaultSortOrder ?? SortDirection.None; ClassMapper .If("ant-table-column-has-sorters", () => Sortable) .If($"ant-table-column-sort", () => Sortable && SortModel != null && SortModel.SortDirection.IsIn(SortDirection.Ascending, SortDirection.Descending)); }
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) ; }
protected override void OnInitialized() { base.OnInitialized(); if (FieldExpression != null) { _propertyReflector = PropertyReflector.Create(FieldExpression); if (Sortable) { SortModel = new SortModel <TData>(_propertyReflector.Value.PropertyInfo, 1, Sort); } } ClassMapper .If("ant-table-column-has-sorters", () => Sortable) .If($"ant-table-column-sort", () => Sortable && SortModel.SortType.IsIn(SortType.Ascending, SortType.Descending)); }
protected override void OnInitialized() { base.OnInitialized(); Sortable = Sortable || SorterMultiple != default || SorterCompare != default || DefaultSortOrder != default || SortDirections?.Any() == true; if (IsHeader) { if (FieldExpression != null) { _propertyReflector = PropertyReflector.Create(FieldExpression); } if (Sortable) { if (_propertyReflector.HasValue) { SortModel = new SortModel <TData>(_propertyReflector.Value.PropertyInfo, SorterMultiple, DefaultSortOrder, SorterCompare); } else { (GetValue, SortModel) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } } } else if (IsBody) { SortModel = Context.HeaderColumns[ColIndex] is IFieldColumn fieldColumn ? fieldColumn.SortModel : null; (GetValue, _) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } SortDirections ??= Table.SortDirections; Sortable = Sortable || SortModel != null; _sortDirection = SortModel?.SortDirection ?? DefaultSortOrder ?? SortDirection.None; ClassMapper .If("ant-table-column-has-sorters", () => Sortable) .If($"ant-table-column-sort", () => Sortable && SortModel != null && SortModel.SortDirection.IsIn(SortDirection.Ascending, SortDirection.Descending)); }
protected override void SetClasses() { base.SetClasses(); //ant-input-password-large ant-input-affix-wrapper ant-input-affix-wrapper-lg ClassMapper .If($"{PrefixCls}-password-large", () => Size == InputSize.Large) .If($"{PrefixCls}-password-small", () => Size == InputSize.Small) .If($"{PrefixCls}-password-rtl", () => RTL); AffixWrapperClass = string.Join(" ", AffixWrapperClass, $"{PrefixCls}-password"); if (VisibilityToggle) { Suffix = new RenderFragment((builder) => { int i = 0; builder.OpenElement(i++, "span"); builder.AddAttribute(i++, "class", $"{PrefixCls}-suffix"); builder.OpenComponent <Icon>(i++); builder.AddAttribute(i++, "class", $"{PrefixCls}-password-icon"); builder.AddAttribute(i++, "type", _eyeIcon); builder.AddAttribute(i++, "onclick", CallbackFactory.Create <MouseEventArgs>(this, async args => { var element = await JsInvokeAsync <HtmlElement>(JSInteropConstants.GetDomInfo, Ref); IsFocused = true; await this.FocusAsync(Ref); ToggleVisibility(args); if (element.SelectionStart != 0) { await Js.SetSelectionStartAsync(Ref, element.SelectionStart); } })); builder.CloseComponent(); builder.CloseElement(); }); } }
protected override void OnInitialized() { base.OnInitialized(); Sortable = Sortable || SorterMultiple != default || SorterCompare != default || DefaultSortOrder != default || SortDirections?.Any() == true; if (IsHeader) { if (FieldExpression != null) { var paramExp = Expression.Parameter(ItemType); var member = ColumnExpressionHelper.GetReturnMemberInfo(FieldExpression); var bodyExp = Expression.MakeMemberAccess(paramExp, member); GetFieldExpression = Expression.Lambda(bodyExp, paramExp); } else if (DataIndex != null) { (_, GetFieldExpression) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } if (GetFieldExpression != null) { var member = ColumnExpressionHelper.GetReturnMemberInfo(GetFieldExpression); DisplayName = member.GetCustomAttribute <DisplayNameAttribute>(true)?.DisplayName ?? member.GetCustomAttribute <DisplayAttribute>(true)?.GetName() ?? member.Name; FieldName = DataIndex ?? member.Name; } if (Sortable && GetFieldExpression != null) { SortModel = new SortModel <TData>(GetFieldExpression, FieldName, SorterMultiple, DefaultSortOrder, SorterCompare); } } else if (IsBody) { SortModel = Context.HeaderColumns[ColIndex] is IFieldColumn fieldColumn ? fieldColumn.SortModel : null; (GetValue, _) = ColumnDataIndexHelper <TData> .GetDataIndexConfig(this); } SortDirections ??= Table.SortDirections; Sortable = Sortable || SortModel != null; _sortDirection = SortModel?.SortDirection ?? DefaultSortOrder ?? SortDirection.None; if (Filters?.Any() == true) { Filterable = true; _columnFilterType = TableFilterType.List; } else if (Filterable) { _columnDataType = THelper.GetUnderlyingType <TData>(); if (_columnDataType == typeof(bool)) { _columnFilterType = TableFilterType.List; Filters = new List <TableFilter <TData> >(); var trueFilterOption = GetNewFilter(); trueFilterOption.Text = Table.Locale.FilterOptions.True; trueFilterOption.Value = THelper.ChangeType <TData>(true); ((List <TableFilter <TData> >)Filters).Add(trueFilterOption); var falseFilterOption = GetNewFilter(); falseFilterOption.Text = Table.Locale.FilterOptions.False; falseFilterOption.Value = THelper.ChangeType <TData>(false); ((List <TableFilter <TData> >)Filters).Add(falseFilterOption); } else { _columnFilterType = TableFilterType.FeildType; InitFilters(); } } ClassMapper .If("ant-table-column-has-sorters", () => Sortable) .If($"ant-table-column-sort", () => Sortable && SortModel != null && SortModel.SortDirection.IsIn(SortDirection.Ascending, SortDirection.Descending)); }
private void SetClass() { ClassMapper .If("ant-table-cell", () => IsHeader) ; }