A proposal trying to solve the JSON data-attributes parsing issue.
Merging this PR, components will be able to parse JSON string values from element data attributes as configuration values.
Edit: As an experimental add on, component elements can have a data-bs-config
attribute that can house all the component config as JSON string. In case an element has data-bs-config='{"foo":123}'
and data-bs-foo="456"
attributes, final foo
value will be 456
, as the separate data attributes will override values given on data-bs-config
So the final config for each components will be a result of:
- Defaults
- data-bs-config
- rest data attributes
- configuration object given during instance initialization
I would appreciate any thoughts or doubts on it
Refs #34259, refs #34321, refs #35880 closes #34465 (closed)
TODO:
-
Document it