Zen0x7 / nova-gridder

Customize Nova Resource Details using Tailwind Grid System and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Show Grid Layout in Edit/Create view

yo-mike opened this issue · comments

commented

Hello,

Thanks again for this plugin. Is it possible to retain the gridder formatting within the edit and create view?

NovaTabs did something similar to retain the tabs on the form views.

Thank you!

Best Regards,

Mike

Hi @949mac

I feel it might be a bit complex but I think it can be achievable, I would need help.

This repository uses a methodology that overwrites the default Vue components of nova. To support the currently package features the PanelItem and Panel views have been overwritten.

I checked the Nova source codes and I think I have a list of files that should be overwritten to support the feature you are bringing up.

I think those files, if we implement them in this repository in the same way that it was implemented in:

https://github.com/demency/nova-gridder/blob/master/resources/js/components/PanelItem.vue
https://github.com/demency/nova-gridder/blob/master/resources/js/components/Panel.vue

To clarify how this plugin works:

This plugin add meta to the field using a macro of Field class to merge extra meta attributes. (Done on NovaGridderServiceProvider)

As Panel do a "v-for" of Fields, so, a flex and flex-wrap classes must be added to panel container if the field has gridder attribute defined (Nova gridder installed) and add w-full or panelSize option to field container. i think so

As PanelItem is the per field on view component, if field implements gridder attributes, that attributes will be pushed as classes to the field name, container or w/e.

To move forward with the issue I would like to see if you could identify the lines that should be modified in the next files:

  • src/components/Forms/DefaultField.vue
  • src/components/Forms/FieldWrapper.vue
  • src/components/Forms/HelpText.vue
  • src/components/Forms/Label.vue
  • src/components/Forms/Panel.vue

I think this change would not take more than 30 lines, the complexity is in knowing what each thing does and what classes should be applied to which elements.

Help to ask some questions:
¿Which divs are the panel, label or content?
¿New meta attributes are required? or ¿Default values brokes the display?
¿New way to inject classes to components is possible, instead overwrite?

Probably that feature will be added on this weekend

I will delay this issue a week. I have a little idea how can i do this.