Example #1
0
        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);
            });
        }
Example #2
0
        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); });
        }
Example #3
0
        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);
        }
Example #4
0
        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();
                },
            };
        }
Example #5
0
        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);
        }
Example #7
0
        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); });
        }
Example #8
0
        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);
            });
        }
Example #10
0
 public BaseMatMenu()
 {
     ClassMapper.Add("mdc-menu mdc-menu-surface");
 }
Example #11
0
 public BaseMatCard()
 {
     ClassMapper
     .Add("mdc-card")
     .If("mdc-card--stroked", () => this.Stroke);
 }
Example #12
0
 public BaseMatTable()
 {
     ClassMapper
     .Add("mdc-table")
     .If("mdc-table--striped", () => this.Striped);
 }
Example #13
0
 public BaseMatNavItem()
 {
     ClassMapper
     .Add("mdc-nav-item")
     .If("mdc-list-item--selected", () => (Selected && AllowSelection));
 }
Example #14
0
 public BaseMatListGroup()
 {
     ClassMapper
     .Add("mdc-list-group");
 }
 public BaseMatToastContainer()
 {
     ClassMapper
     .Add("mat-toast-container")
     .Get(() => MatToatsPositionConvertor.Convert(Toaster.Configuration.Position));
 }
Example #16
0
 public BaseMatIconButton()
 {
     ClassMapper
     .Add("mdc-icon-button");
 }
Example #17
0
 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");
 }
Example #20
0
 public BaseMatSortHeader()
 {
     ClassMapper.Add("mat-sort-header");
 }
Example #21
0
 public BaseMatListItem()
 {
     ClassMapper
     .Add("mdc-list-item")
     .If("mdc-list-item--disabled", () => Disabled);
 }
Example #22
0
 public BaseMatDrawerContainer()
 {
     ClassMapper
     .Add("mdc-drawer-app-content");
 }
Example #23
0
 public BaseMatNavMenu()
 {
     ClassMapper.Add("mat-accordion");
 }
Example #24
0
 public BaseMatList()
 {
     ClassMapper
     .Add("mdc-list")
     .If("mdc-list--two-line", () => TwoLine);
 }
Example #25
0
 public BaseMatAccordion()
 {
     ClassMapper.Add("mat-accordion");
 }
Example #26
0
 public BaseMatNavItem()
 {
     ClassMapper
     .Add("mdc-nav-item")
     .If("mdc-list-item--selected", () => Selected);
 }
Example #27
0
 public BaseMatCheckbox()
 {
     ClassMapper.Add("mdc-checkbox");
 }
Example #28
0
 public BaseMatChip()
 {
     ClassMapper
     .Add("mdc-chip")
     .If("mdc-chip--activated", () => this.Active);
 }
Example #29
0
 public BaseMatTabGroup()
 {
     ClassMapper.Add("mat-tab-group");
 }
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            ClassMapper.Add("mdc-card__primary-action");
        }