Ejemplo n.º 1
0
 public BaseMatButton()
 {
     ClassMapper
     .Add("mdc-button")
     .If("mdc-button--raised", () => this.Raised)
     .If("mdc-button--unelevated", () => this.Unelevated)
     .If("mdc-button--outlined", () => this.Outlined)
     .If("mdc-button--dense", () => this.Dense);
 }
Ejemplo n.º 2
0
        public BaseMatExpansionPanel()
        {
            ClassMapper
            .Add("mat-expansion-panel")
            .Add("mdc-elevation--z3")
            .If("mat-expansion-panel--expanded", () => Expanded);

            HideToggle = HideToggle || (Accordion?.HideToggle ?? false);
        }
Ejemplo n.º 3
0
 public BaseMatButtonLink()
 {
     ClassMapper
     .Add("mdc-button")
     .Add("mat-button-link")
     .If("mdc-button--raised", () => Raised)
     .If("mdc-button--unelevated", () => Unelevated)
     .If("mdc-button--outlined", () => Outlined)
     .If("mdc-button--dense", () => Dense);
 }
Ejemplo n.º 4
0
        public BaseMatCheckboxInternal()
        {
            ClassMapper
            .Add("mat-checkbox")
            .Add("mdc-form-field");

            CallAfterRender(async() =>
            {
                await JsInvokeAsync <object>("matBlazor.matCheckbox.init", Ref, ComponentRef);
            });
        }
Ejemplo n.º 5
0
 public BaseMatSlideToggle()
 {
     ClassMapper
     .Add("mat-switch")
     .Add("mdc-switch")
     .If("mdc-switch--disabled", () => Disabled)
     .If("mdc-switch--checked", () => Checked);
     CallAfterRender(async() =>
     {
         await JsInvokeAsync <object>("matBlazor.matSlideToggle.init", Ref);
     });
 }
Ejemplo n.º 6
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); });
        }
Ejemplo n.º 7
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);
            });
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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();
                },
            };
        }
Ejemplo n.º 10
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);
                }
            });
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
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); });
        }
Ejemplo n.º 13
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);
            });
        }
Ejemplo n.º 15
0
 public BaseMatCheckbox()
 {
     ClassMapper.Add("mdc-checkbox");
 }
Ejemplo n.º 16
0
 public BaseMatAccordion()
 {
     ClassMapper.Add("mat-accordion");
 }
Ejemplo n.º 17
0
 public BaseMatToastContainer()
 {
     ClassMapper
     .Add("mat-toast-container")
     .Get(() => MatToatsPositionConvertor.Convert(Toaster.Configuration.Position));
 }
Ejemplo n.º 18
0
 public BaseMatNavMenu()
 {
     ClassMapper.Add("mat-accordion");
 }
Ejemplo n.º 19
0
 public BaseMatDrawerContainer()
 {
     ClassMapper
     .Add("mdc-drawer-app-content");
 }
Ejemplo n.º 20
0
 public BaseMatMenu()
 {
     ClassMapper.Add("mdc-menu mdc-menu-surface");
 }
Ejemplo n.º 21
0
 public BaseMatTable()
 {
     ClassMapper
     .Add("mdc-table")
     .If("mdc-table--striped", () => this.Striped);
 }
Ejemplo n.º 22
0
 public BaseMatNavItem()
 {
     ClassMapper
     .Add("mdc-nav-item")
     .If("mdc-list-item--selected", () => Selected);
 }
Ejemplo n.º 23
0
 public BaseMatChip()
 {
     ClassMapper
     .Add("mdc-chip")
     .If("mdc-chip--activated", () => this.Active);
 }
Ejemplo n.º 24
0
 public BaseMatListItem()
 {
     ClassMapper
     .Add("mdc-list-item")
     .If("mdc-list-item--disabled", () => Disabled);
 }
Ejemplo n.º 25
0
 public BaseMatSortHeader()
 {
     ClassMapper.Add("mat-sort-header");
 }
Ejemplo n.º 26
0
 public BaseMatListGroup()
 {
     ClassMapper
     .Add("mdc-list-group");
 }
Ejemplo n.º 27
0
 public BaseMatIconButton()
 {
     ClassMapper
     .Add("mdc-icon-button");
 }
Ejemplo n.º 28
0
 public BaseMatDataTable()
 {
     ClassMapper
     .Add("mat-data-table")
     .Add("mdc-data-table");
 }
Ejemplo n.º 29
0
 public BaseMatTabGroup()
 {
     ClassMapper.Add("mat-tab-group");
 }
Ejemplo n.º 30
0
 public BaseMatList()
 {
     ClassMapper
     .Add("mdc-list")
     .If("mdc-list--two-line", () => TwoLine);
 }