joomla-projects / custom-elements

A compilation of Joomla 4 Custom Elements.
GNU General Public License v2.0
33 stars 29 forks source link

Standardized format for custom elements #80

Open minitek opened 6 years ago

minitek commented 6 years ago

It would be great to have a standardized format so that we can implement an installer/manager for web components/custom elements. This will offer the possibility to create an ecosystem of Joomla elements.

dgrammatiko commented 6 years ago

It would be great to have a standardized format

Can you elaborate on this idea?

Just to explain what we try to achieve here: this repo's purpose is to provide a replacement for the bootstrap components (modals, dropdowns, accordion, tabs etc) so that Joomla 4 can satisfy the need for a11y compliance. That is the main purpose as a side effect but also important reason is that we drop the jQuery dependency and also we simplify and reduce the needed code (eg tabs include the tabs-state script). So this repo will not cover every aspect of the Joomla's UI, just the basic interactive UI components. Then again the work is not ending in this repo, so in the main repo, our target is to replace all the Form Fields scripts (https://github.com/joomla/joomla-cms/tree/4.0-dev/media/system/js/fields) with custom elements and we already started this process with the media field: https://github.com/joomla/joomla-cms/tree/4.0-dev/build/webcomponents/js/field-media

PHP wise there is an API for webcomponents: https://github.com/joomla/joomla-cms/blob/e9c36a847c5c04390dad590d71226804a2c05286/libraries/src/HTML/HTMLHelper.php#L826-L896 which should be very easy to use: https://github.com/joomla/joomla-cms/blob/e9c36a847c5c04390dad590d71226804a2c05286/administrator/templates/atum/index.php#L48-L49

Anyways, new ideas and contributors are always welcome