web-components
web-components copied to clipboard
[upload] Create slotted elements in light DOM instead of using fallback content
Describe your motivation
We would like to make it easier for Flow users to access the content of the vaadin-upload named slots:
"add-button""drop-label""drop-label-icon"
This would require using the same approach as we implemented for vaadin-crud in https://github.com/vaadin/web-components/pull/3106 by using SlotMixin to create initial content for all of the corresponding slots, and then propagating i18n strings to set their text content.
Describe the solution you'd like
- Update
vaadin-uploadto useSlotMixinor preferablySlotController(we should eventually only have one) - Make it possible to distinguish the default elements from the custom ones to decide whether to apply
i18n
Note: this is a breaking changes because moving fallback content to light DOM means removing following parts:
https://github.com/vaadin/web-components/blob/2b2e367be4cde5df5dccdddde72552a414276f2d/packages/upload/src/vaadin-upload.js#L93
https://github.com/vaadin/web-components/blob/2b2e367be4cde5df5dccdddde72552a414276f2d/packages/upload/src/vaadin-upload.js#L100
Additional context
See https://github.com/vaadin/flow-components/issues/3542#issuecomment-1200823976