web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[upload] Create slotted elements in light DOM instead of using fallback content

Open web-padawan opened this issue 3 years ago • 0 comments

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

  1. Update vaadin-upload to use SlotMixin or preferably SlotController (we should eventually only have one)
  2. 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

web-padawan avatar Aug 02 '22 07:08 web-padawan