public BaseMatSlider() { jsHelper = new JsHelper(this); ClassMapper .Add("mdc-slider") .If("mdc-slider--discrete", () => Discrete); CallAfterRender(async() => { dotNetObjectRef = dotNetObjectRef ?? CreateDotNetObjectRef(jsHelper); await Js.InvokeAsync <object>("matBlazor.matSlider.init", Ref, dotNetObjectRef); }); }
public BaseMatDataTableOld() { VirtualScrollHelper = new MatVirtualScrollHelper(this); ClassMapper .Add("mat-data-table") .Add("mdc-data-table") .If("mat-data-table__sticky-header", () => StickyHeader) .Get(() => VirtualScrollHelper.GetClass()); CallAfterRender(async() => { await VirtualScrollHelper.InitAsync(Js, Ref, this.VirtualScroll); }); }
public BaseMatSelect() { ClassMapper .Add("mat-select") .Add("mdc-select") .If("mdc-select--outlined", () => Outlined) .If("mdc-select--disabled", () => Disabled) .If("mdc-select--with-leading-icon", () => Icon != null); HelperTextClassMapper .Add("mdc-text-field-helper-text") .If("mdc-text-field-helper-text--persistent", () => HelperTextPersistent) .If("mdc-text-field-helper-text--validation-msg", () => HelperTextValidation); }
public BaseMatDatePickerInternal() { ClassMapper.Add("mat-date-picker"); ClassMapper.Add("mat-text-field-with-actions-container"); dotNetObject = new MatDatePickerJsHelper() { OnChangeAction = (value) => { var v = value.FirstOrDefault(); CurrentValue = SwitchT.FromDateTimeNull(v); InvokeStateHasChanged(); }, }; }
public BaseMatVirtualScroll() { ClassMapper.Add("mat-virtual-scroll"); CallAfterRender(async() => { if (!Disabled) { JsHelperReference = new MatDotNetObjectReference <MatVirtualScrollJsHelper>(new MatVirtualScrollJsHelper(this)); var scrollView = await Js.InvokeAsync <MatVirtualScrollView>("matBlazor.matVirtualScroll.init", Ref, JsHelperReference.Reference); this.SetScrollView(scrollView); } }); }
protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); ClassMapper .Add("mat-card-media") .Add("mdc-card__media") .If("mdc-card__media--16-9", () => Wide) .If("mdc-card__media--square", () => Square); ContentClassMapper .Add("mat-card-media-content") .Add("mdc-card__media-content") .Get(() => ContentClass); StyleMapper.GetIf(() => $"background-image: url(\"{ImageUrl}\")", () => ImageUrl != null); }
protected BaseMatInputTextComponent() { OnFocusEvent = new MatEventCallback <FocusEventArgs>(this, () => OnFocus); OnFocusOutEvent = new MatEventCallback <FocusEventArgs>(this, () => OnFocusOut); ClassMapper .Add("mat-text-field") .Add("mdc-text-field") .Get(() => this.FieldClass) .If("mdc-text-field--filled", () => !this.Outlined) // .Add("_mdc-text-field--upgraded") .If("mdc-text-field--with-leading-icon", () => this.Icon != null && !this.IconTrailing) .If("mdc-text-field--with-trailing-icon", () => this.Icon != null && this.IconTrailing) .If("mdc-text-field--box", () => !this.FullWidth && this.Box) .If("mdc-text-field--dense", () => Dense) .If("mdc-text-field--outlined", () => !this.FullWidth && this.Outlined) .If("mdc-text-field--disabled", () => this.Disabled) .If("mdc-text-field--fullwidth", () => this.FullWidth) .If("mdc-text-field--fullwidth-with-leading-icon", () => this.FullWidth && this.Icon != null && !this.IconTrailing) .If("mdc-text-field--fullwidth-with-trailing-icon", () => this.FullWidth && this.Icon != null && this.IconTrailing) .If("mdc-text-field--textarea", () => this.TextArea); bool TextOrPlaceHolderVisible() { return(!string.IsNullOrEmpty(CurrentValueAsString) || (!string.IsNullOrWhiteSpace(PlaceHolder) && FullWidth)); } LabelClassMapper .Add("mdc-floating-label") .If("mat-floating-label--float-above-outlined", () => Outlined && TextOrPlaceHolderVisible()) .If("mdc-floating-label--float-above", () => TextOrPlaceHolderVisible()); InputClassMapper .Get(() => this.InputClass) .Add("mat-text-field-input") .Add("mdc-text-field__input") // .If("_mdc-text-field--upgraded", () => !string.IsNullOrEmpty(CurrentValueAsString)) .If("mat-hide-clearbutton", () => this.HideClearButton); CallAfterRender(async() => { await JsInvokeAsync <object>("matBlazor.matTextField.init", Ref); }); }
public BaseMatSlider() { jsHelper = new MatDotNetObjectReference <MatSliderJsHelper>(new MatSliderJsHelper()); jsHelper.Value.OnChangeEvent += Value_OnChangeEvent; ValueMin = SwitchT.Minimum; ValueMax = SwitchT.Maximum; Step = SwitchT.Step; ClassMapper .Add("mat-slider") .Add("mdc-slider") .If("mdc-slider--discrete", () => Discrete); CallAfterRender(async() => { await JsInvokeAsync <object>("matBlazor.matSlider.init", Ref, jsHelper.Reference); }); }
public BaseMatSelectTypeKey() { jsHelper = new MatSelectJsHelper(); jsHelper.SetValueEvent += JsHelper_SetValueEvent; ClassMapper .Add("mat-select") .Add("mdc-select") .If("mdc-select--outlined", () => Outlined) .If("mdc-select--disabled", () => Disabled) .If("mdc-select--with-leading-icon", () => Icon != null); HelperTextClassMapper .Add("mdc-text-field-helper-text") .If("mdc-text-field-helper-text--persistent", () => HelperTextPersistent) .If("mdc-text-field-helper-text--validation-msg", () => HelperTextValidation); CallAfterRender(async() => { jsHelperReference ??= DotNetObjectReference.Create(jsHelper); await JsInvokeAsync <object>("matBlazor.matSelect.init", Ref, jsHelperReference); }); }
public BaseMatMenu() { ClassMapper.Add("mdc-menu mdc-menu-surface"); }
public BaseMatCard() { ClassMapper .Add("mdc-card") .If("mdc-card--stroked", () => this.Stroke); }
public BaseMatTable() { ClassMapper .Add("mdc-table") .If("mdc-table--striped", () => this.Striped); }
public BaseMatNavItem() { ClassMapper .Add("mdc-nav-item") .If("mdc-list-item--selected", () => (Selected && AllowSelection)); }
public BaseMatListGroup() { ClassMapper .Add("mdc-list-group"); }
public BaseMatToastContainer() { ClassMapper .Add("mat-toast-container") .Get(() => MatToatsPositionConvertor.Convert(Toaster.Configuration.Position)); }
public BaseMatIconButton() { ClassMapper .Add("mdc-icon-button"); }
protected BaseMatComponent() { ClassMapper.Get(() => this.Class); }
public BaseMatDataTable() { ClassMapper .Add("mat-data-table") .Add("mdc-data-table"); }
public BaseMatSortHeaderRow() { ClassMapper.Add("mat-sort-header-row"); }
public BaseMatSortHeader() { ClassMapper.Add("mat-sort-header"); }
public BaseMatListItem() { ClassMapper .Add("mdc-list-item") .If("mdc-list-item--disabled", () => Disabled); }
public BaseMatDrawerContainer() { ClassMapper .Add("mdc-drawer-app-content"); }
public BaseMatNavMenu() { ClassMapper.Add("mat-accordion"); }
public BaseMatList() { ClassMapper .Add("mdc-list") .If("mdc-list--two-line", () => TwoLine); }
public BaseMatAccordion() { ClassMapper.Add("mat-accordion"); }
public BaseMatNavItem() { ClassMapper .Add("mdc-nav-item") .If("mdc-list-item--selected", () => Selected); }
public BaseMatCheckbox() { ClassMapper.Add("mdc-checkbox"); }
public BaseMatChip() { ClassMapper .Add("mdc-chip") .If("mdc-chip--activated", () => this.Active); }
public BaseMatTabGroup() { ClassMapper.Add("mat-tab-group"); }
protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); ClassMapper.Add("mdc-card__primary-action"); }