Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This Will Make Package Better #1356

Closed
wisamidris7 opened this issue Jun 3, 2023 · 79 comments
Closed

This Will Make Package Better #1356

wisamidris7 opened this issue Jun 3, 2023 · 79 comments
Labels
component/Autocomplete component/ExpansionPanels mobile type/enhancement New feature or request Vuetify3 Vuetify3 solves this problem, but Vuetify2 doesn't

Comments

@wisamidris7
Copy link

Your Tabs And Expansion Is To Slow Cause There Animations And It Load All Once I Want Like Viruiztion When Dom Does Not Take Big Big Objects Cause I Have 8 Tabs In My App And I Wait For Page 10 seconds For It To Load Cause Each Tab Has Big Content I Think You Have To Make Somthing Like {LoadAllTab = false or DontLoadAllTab} For Package And

Auto MCol To Make MInput Takes Cols ,Sm and Md And Make It As Class In Object And Make AutoTranslate For Label And This Will Make 1.0.0 rc-4 Better Version And It Will Save 2 Lines For Every TextField And Thanks

@capdiem
Copy link
Contributor

capdiem commented Jun 5, 2023

Your Tabs And Expansion Is To Slow ...

Do you mean the MTab component? It's just a title, and it doesn't usually contain much logic.
The MExpansions component does not use delayed loading, so it does have an optimization direction.

Auto MCol To Make MInput Takes Cols ,Sm and Md And Make It As Class In Object And Make AutoTranslate For Label ...

I don't quite understand. Maybe you can do it yourself with a secondary encapsulation.

public class TextField: MTextFIeld {
    protected override void OnParametersSet() {
        Label = ...
    }
}

@wisamidris7
Copy link
Author

Tab Item

@capdiem
Copy link
Contributor

capdiem commented Jun 6, 2023

@wisamidris7 MTabsItems is already lazy to load and does not load all the DOM at once

@wisamidris7
Copy link
Author

How to make this scrollable Cause Like This Is Not Right Specially In Mobile

Screenshot 2023-06-06 154634

Screenshot 2023-06-06 154722

The Same Template In Yours Modal Docs Form

@wisamidris7
Copy link
Author

I Want Some thing Like Make It Scrollable I Tried To Make It But I Did't Get Result

@wisamidris7
Copy link
Author

I Mean You Can Also Provide Me A CSS Code

@capdiem
Copy link
Contributor

capdiem commented Jun 7, 2023

There are some problems with Autocomplete in Dialog... Thanks for your feedback.

If you just want the content scrollable:

@inject MasaBlazor MasaBlazor

<MAutocomplete MenuProps="MenuProps">
</Autocomplete>

@code {
    private void MenuProps(BMenuProps props) {
        if (MasaBlazor.Breakpoint.SmAndDown) {
           props.MaxHeight = 150;
        }
    }
}

@wisamidris7
Copy link
Author

But About Lazy Loading Is I Used Expansion
And It Load All Once

Screenshot 2023-06-07 150828

If There Some Option You Can Provide Me With It

@wisamidris7
Copy link
Author

MTextField Is Call ValueChanged For Every Character I Wrote

And When I Make It On OnParameterSet It's Render In Just 4 Chars

Somtimes 27 to 47 Cause For Every Char I Wrote The Parameter Change Cause
ValueChanged Set Value And When Value Set The OnParameterSet Got Called

And What I Think Of That I Might Make It On OnInit...
And Also Did't Cause Label Will Set Every Time Cause He Compair The CurruntValue And SettedValue

And I Maked Name Prop
And I Make It Like This {Name="firstname"}
And I Tired To Change All App From Label To Name
Cause If I CHange Label I Have Some Components That Like Modal
I Have Label In Top Like This So I Don't Know What I Do
And When I Run It Webassebly It Laggggged So Much
I Click At TextField And I Wrote A Char And I Wait One Second

You Should See What Makes Webassembly Laggged Cause
The Browser Not So Powerfully To Get From 100 to 200 Item To Translate One Word

@capdiem
Copy link
Contributor

capdiem commented Jun 8, 2023

@wisamidris7 ExpansionPanelContent will support for lazy loading in 1.0.0-rc.4. Use Eager parameter to force load all.

@capdiem
Copy link
Contributor

capdiem commented Jun 8, 2023

MTextField Is Call ValueChanged For Every Character I Wrote

And When I Make It On OnParameterSet It's Render In Just 4 Chars

Somtimes 27 to 47 Cause For Every Char I Wrote The Parameter Change Cause ValueChanged Set Value And When Value Set The OnParameterSet Got Called

And What I Think Of That I Might Make It On OnInit... And Also Did't Cause Label Will Set Every Time Cause He Compair The CurruntValue And SettedValue

And I Maked Name Prop And I Make It Like This {Name="firstname"} And I Tired To Change All App From Label To Name Cause If I CHange Label I Have Some Components That Like Modal I Have Label In Top Like This So I Don't Know What I Do And When I Run It Webassebly It Laggggged So Much I Click At TextField And I Wrote A Char And I Wait One Second

You Should See What Makes Webassembly Laggged Cause The Browser Not So Powerfully To Get From 100 to 200 Item To Translate One Word

Sorry, I only understand a little bit. Is MTextField Slow? Maybe provide the TEST code?

If you want to know how to automatically generate Label, you refer to the following code:

public class TextField : MTextField<string>
{
    protected override void OnParametersSet()
    {
        base.OnParametersSet();

        if (Label is null && ValueExpression is not null)
        {
            var accessorBody = ValueExpression.Body;

            if (accessorBody is UnaryExpression unaryExpression
                && unaryExpression.NodeType == ExpressionType.Convert
                && unaryExpression.Type == typeof(object))
            {
                accessorBody = unaryExpression.Operand;
            }

            var fieldName = (accessorBody as MemberExpression)!.Member.Name;
            Label = fieldName;
        }
    }
}

@wisamidris7
Copy link
Author

wisamidris7 commented Jun 8, 2023

About TextField I Mean That It Slow When I Make This
@
1 public class TextField: MTextFIeld {
2 protected override void OnParametersSet() {
3 Label = i18n.T(Label); // This Line It Lagged Cause He Search In Directory About This Word
4 }
5 }
@
I Readed You i18n code i found that you make all words in Dictionary And This Good
But Every Word I Wrote It Load From Dictionary 2 times and this make textfield slow in webassembly
but in server-side my server will be also slow or attacked as i name it

Your MTextFIeld Is Good
But New TextField Is Bad Becuase Line 3

@capdiem
Copy link
Contributor

capdiem commented Jun 8, 2023

@wisamidris7 I seem to have reproduced the problem, I will investigate this tomorrow. Thanks!

@wisamidris7
Copy link
Author

ok thanks

@wisamidris7
Copy link
Author

I Just Want To Tell You To Not Use Many Dicentory
Here Example
WSM

sScreenshot 2023-06-07 121223

@capdiem
Copy link
Contributor

capdiem commented Jun 9, 2023

@wisamidris7 Twice for every word you type? I guess there are two TextFields on your page.

There seems to be no way to improve the performance of I18n.T. I do not feel slow when using it. Avoid to search from dictionary when you type:

private string? _i18nLabel;
private string? _prevLabel;

protected override void OnParametersSet()
{
    base.OnParametersSet();

    if (_prevLabel != Label)
    {
        _prevLabel = Label;
        _i18nLabel = I18n.T(Label);
    }

    Label = _i18nLabel;
}

@capdiem
Copy link
Contributor

capdiem commented Jun 9, 2023

<TextField @bind-Value="value1" />
<TextField @bind-Value="value2" />
<TextField Value="value3" />

when input the first TextField, a StateHasChanged would be invoked, so the secondary TextField will re-render and it's OnParametersSet will be invoked. @bind-Value contains a ValueChanged parameter, it's not a value type, so secondary textfield will be rendered. The third TextField would not re-render.

@wisamidris7
Copy link
Author

Thanks 👍

In Any Date 1.0.0-rc4 Will Reaslse

@capdiem
Copy link
Contributor

capdiem commented Jun 10, 2023

@wisamidris7 next week

@wisamidris7
Copy link
Author

Can You Make Helper Or Vaildation Text Doesn't Take Space In Form
Just When Message Are Not Empty

You Can Make IsPopup For Popup For Vaildation Text To Be position: absoulte

Or You Can Show Helper Text Or Vaildation Text If There Text

And Now What I Maked HideDetails For Message But

And This Is My Suggestion Cause I Want Users Know What Problem

@capdiem
Copy link
Contributor

capdiem commented Jun 19, 2023

@wisamidris7

Drawer In My Computer Is Closed When I Using Computer My Screen Size Down

Do you mean that drawers close automatically when the browser widths narrow? I tried the demo of the document and it didn't work. But I found another bug: When on the mobile side, the width of the Drawer is too long, exceeding the width of the screen.

NavigationDrawer.razor: error CS1503: Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback' to 'Microsoft.AspNetCore.Components.EventCallback'

It's a breaking change of 1.0.0-rc.4.

animation cuts and the dialog closed fast

It's been 256 ms:

protected async Task ClosePopupAsync(object? returnVal = null)
{
if (PopupItem != null)
{
await Task.Delay(256);
PopupItem.Discard(returnVal);
}
}

There No MenuProps In MSelect

image

Also This Happen On Computer I Want To Make MaxHeghit For All Devices

Use DefaultsProvider or use global CSS

@wisamidris7
Copy link
Author

It's been 256 ms:

// Here You Have To Make This
 if (PopupItem != null) 
     { 
Visible = false;
         await Task.Delay(256); 
         PopupItem.Discard(returnVal); 
     } 

Or

// Here You Have To Make This
 if (PopupItem != null) 
     { 
         Visible = false;
         InvokeAsync(StateHasChanged);
         await Task.Delay(256); 
         PopupItem.Discard(returnVal); 
     } 

@wisamidris7
Copy link
Author

 Visible = false;

It's Change

@wisamidris7
Copy link
Author

Also Check RTL Issue There I Maked Somthings

#1369

@wisamidris7
Copy link
Author

Also Can You Make Virtuize For DataTable

@capdiem
Copy link
Contributor

capdiem commented Jun 20, 2023

 Visible = false;

It's Change

if (args.IsCanceled is false)
{
Visible = false;
await ClosePopupAsync(_promptValue.Value);
}

I see, you want the method ClosePopupAsync to set Visible = false internally. It's a good idea, I will change it. But the StateHasChanged doesn't seem to require an explicit call.

@capdiem
Copy link
Contributor

capdiem commented Jun 20, 2023

Also Can You Make Virtuize For DataTable

We received the same request #1075.

@wisamidris7
Copy link
Author

wisamidris7 commented Jun 21, 2023

In Select You Can Write '8 Items Selected'

And Make It With i18n Don't Forgot Also When There Just 2 Or You Can Make Max Items

When There Two Names Displayed
When There Many Names '8 Items Selected'
This Will Be Soultion For That Cause This

Screenshot 2023-06-21 150853
Screenshot 2023-06-21 151521

@capdiem
Copy link
Contributor

capdiem commented Jun 24, 2023

@wisamidris7 You can use SelectionContent slot to implement it. There is a demo.

@wisamidris7
Copy link
Author

I Want To Make This On Masa Table Or MDataTable

Screenshot 2023-06-24 093341

What I Want To Do Some Details Has Details
And Who Not Has Details There Not Expand Button

Cause I Has Products
And This Products Are Normal
And There One Product That Has Many Products Inside
Or You Can Name It Aggregate Product Or Assembly Product

@wisamidris7
Copy link
Author

In The White Row There No Expand Button Cause There No Children For Him

@capdiem
Copy link
Contributor

capdiem commented Jun 25, 2023

@wisamidris7 https://docs.masastack.com/blazor/components/data-tables#expandablerow Check out this demo. The point is that there is a predefined col (new () { Text="", Value="data-table-expand" }) in headers.

@wisamidris7
Copy link
Author

wisamidris7 commented Jun 25, 2023

can you make me branch name it packagebetterissue and make me as countribter for just branch 'packagebetterissue'
and i will create pull request and you merge

this will save lot of time for me cause somethings or some features i want to add it but i can't
so this will be so great

@capdiem
Copy link
Contributor

capdiem commented Jun 26, 2023

can you make me branch name it packagebetterissue and make me as countribter for just branch 'packagebetterissue' and i will create pull request and you merge

this will save lot of time for me cause somethings or some features i want to add it but i can't so this will be so great

Sorry, I don't have permission to do it. You have to fork and PR.

@wisamidris7
Copy link
Author

wisamidris7 commented Jul 15, 2023

can your masa library contain menustrip as the winform

download

and make it fixed as appbar do or you can make it part of the appbar cause i needed in this week

it's very important for me
cause i need it like drawer structure cause my app requirements to be a menustrip not drawer to navigation

<MMenuStrip>
    <MMenuStripItem Herf="/home">
    Home
    </MMeuStripItem>
    <MMenuStripItem Parent=true>
        <ChildContent>
            Hello World
        </ChildContent>
        <Children>
            <MMenuStripItem Herf="/somthing">
                Something
            </MMeuStripItem>
            <MMenuStripItem Parent=true>
                <ChildContent>
                    Hello World
                </ChildContent>
                <Children>
                    <MMenuStripItem Herf="/somthingother">
                        SomethingOther
                    </MMeuStripItem>
                </Children>
            </MMeuStripItem>
        </Children>
    </MMeuStripItem>
</MMenuStrip>

@wisamidris7
Copy link
Author

in blazor masa.blazor library

@wisamidris7
Copy link
Author

wisamidris7 commented Jul 15, 2023

also don't forgot Required Field For Vaildation

Cause I Want Field To Be Required When COnditional Be
Like Auto Create Somthing CheckBox When True Disible Requrired
But Else The Somthing Be Required

<MCheckBox @bind-Value="Model.AutoCreate" Label.../>
<MTextField @bind-Value="Model.Somthing" Disabled="Model.AutoCreate" Required="@(!Model.AutoCreate)".../>

There's No Required="@(!Model.AutoCreate)"

@capdiem
Copy link
Contributor

capdiem commented Jul 17, 2023

can your masa library contain menustrip as the winform

@wisamidris7 I think you can do the same thing with MMenu and MList.

@wisamidris7
Copy link
Author

@wisamidris7 I think you can do the same thing with MMenu and MList.

Make In Docs Or Anything Cause I'm Not In To Deep In Masa

Can You Make Example

@wisamidris7
Copy link
Author

also in ar-EG or arabic language why not say 'save' - 'انفذ'

why say for 'save' - 'حفظ'

@wisamidris7
Copy link
Author

wrongly you make it in past 'saved'

Screenshot 2023-07-18 043743
Screenshot 2023-07-18 043807

@capdiem
Copy link
Contributor

capdiem commented Jul 18, 2023

wrongly you make it in past 'saved'

@wisamidris7 I got it

@capdiem
Copy link
Contributor

capdiem commented Jul 18, 2023

MenuStrip example

@wisamidris7
MenuStrip

@typeparam TItem
@typeparam TValue

<MMenu @bind-Value="@_menuValue"
       CloseOnContentClick="false"
       OffsetY
       ActivatorContent="@ActivatorContent">
    <ChildContent>
        <div class="m-cascader__columns">
            <MCascaderColumn Dense
                             Items="@Items"
                             ItemValue="@ItemValue"
                             ItemText="@ItemText"
                             ItemChildren="@ItemChildren"
                             TItem="TItem"
                             TValue="TValue"
                             OnSelect="(u) => HandleOnSelect(u.item)">
            </MCascaderColumn>
        </div>
    </ChildContent>
</MMenu>

@code {

    [Parameter]
    public RenderFragment<ActivatorProps>? ActivatorContent { get; set; }

    [Parameter]
    [EditorRequired]
    public IList<TItem> Items { get; set; } = null!;

    [Parameter]
    [EditorRequired]
    public Func<TItem, string> ItemText { get; set; } = null!;

    [Parameter]
    public Func<TItem, TValue>? ItemValue { get; set; }

    [Parameter]
    [EditorRequired]
    public Func<TItem, List<TItem>?> ItemChildren { get; set; } = null!;

    [Parameter]
    public EventCallback<TItem> OnSelect { get; set; }

    private bool _menuValue;

    private async Task HandleOnSelect(TItem item)
    {
        if (ItemChildren?.Invoke(item)?.Any() is true)
        {
            return;
        }

        if (OnSelect.HasDelegate)
        {
            await OnSelect.InvokeAsync(item);
        }

        _menuValue = false;
    }

}

Use:

<MenuStrip Items="_items"
          ItemText="u => u.Name"
          ItemValue="u => u.Code"
          ItemChildren="u => u.Children"
          TItem="Item"
          TValue="string"
          OnSelect="HandleOnSelect">
    <ActivatorContent>
        <span @attributes="@context.Attrs">File</span>
    </ActivatorContent>
</MenuStrip>

@code {

    record Item(string Name, string Code, List<Item>? Children = null);

    private List<Item> _items = new()
    {
        new("Item 1", "1"),
        new("Item 2", "2"),
        new("Item 3", "3"),
        new("Item 4", "4", new List<Item>()
        {
            new Item("Sub item 1", "s-1"),
            new Item("Sub item 2", "s-2"),
            new Item("Sub item 3", "s-3"),
        }),
        new("Item 5", "5"),
    };

    private void HandleOnSelect(Item item)
    {
        Console.WriteLine($"Selected item: {item.Name} ({item.Code})");
    }

}

@wisamidris7
Copy link
Author

ar-EG Is RTL Why you don't Make If ar-EG Is Currunt Make It RTL

Also I Want To Make ar-EG default rather than english so provide me code

// somthing like this
config.DefaultLanguage = "ar-EG";

and make if drawer is app make it in right auto

@capdiem
Copy link
Contributor

capdiem commented Jul 20, 2023

@wisamidris7

@using BlazorComponent

services.AddMasaBlazor(options => {
    // new Locale(current, fallback);
    options.Locale = new Locale("ar-EG", "en-US");
    options.RTL = true;
})

@wisamidris7
Copy link
Author

I Mean My App Is Mulilanguage But Arabic Is Default Cause Who Will Use Is Arab

Also When RTL Is Supported This Mean To Make Drawer Right
Also It Have Be A Auto To Check Just Arabic What Is RTL

@capdiem
Copy link
Contributor

capdiem commented Jul 25, 2023

@wisamidris7 Do you mean changing RTL automatically when the language changes to Arabic? This is a good idea, but not a high priority. You can inject MasaBlazor and set MasaBlazor.RTL = true/false when you update language.

private void ToggleRTL(bool rtl)
{
if (rtl == MasaBlazor.RTL)
{
return;
}
MasaBlazor.RTL = rtl;
_ = LocalStorage.SetItemAsync("masablazor@rtl", rtl ? "rtl" : "ltr");
}

@wisamidris7
Copy link
Author

end story

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/Autocomplete component/ExpansionPanels mobile type/enhancement New feature or request Vuetify3 Vuetify3 solves this problem, but Vuetify2 doesn't
Projects
None yet
Development

No branches or pull requests

2 participants