refactor: rework the ColorPaletteMoreColors feature #10505
+53
−81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Component Features concept is no longer needed. Features can now be implemented natively in UI5 Web Components by just using JSX and dynamic imports.
Changes:
ColorPalette.ts
dynamically loads the extra template, only if theshowMoreColors
property is set. When the module loads, the component is invalidated and will render the extra dialog (but in reality the module is always fetched before people have clicked the "More colors" button so it doesn't degrade user experience)features/ColorPaletteMoreColors.js
is not deleted for compatibility, and now serves as a "preload" of the template. Apps no longer need to import this module, but if they do, they can get the extra template bundled along with the component.ColorPalette.ts
is made fully declarative - it used to query the shadow DOM for the dialog/color picker, which may not be there yet (if the dynamic import is not fetched yet). Now, it just updates the state and the template is invalidated and updated whenever it's fetched.