Skip to content

Commit

Permalink
refactor!: remove template support from overlay (#4753)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Oct 17, 2022
1 parent 519263e commit 1386314
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 735 deletions.
2 changes: 1 addition & 1 deletion packages/field-highlighter/src/vaadin-user-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class UserTags extends PolymerElement {
}

get wrapper() {
return this.$.overlay.content.querySelector('[part="tags"]');
return this.$.overlay.querySelector('[part="tags"]');
}

createUserTag(user) {
Expand Down
1 change: 1 addition & 0 deletions packages/overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@esm-bundle/chai": "^4.3.4",
"@polymer/iron-overlay-behavior": "^3.0.0",
"@vaadin/button": "24.0.0-alpha0",
"@vaadin/polymer-legacy-adapter": "24.0.0-alpha0",
"@vaadin/radio-group": "24.0.0-alpha0",
"@vaadin/testing-helpers": "^0.3.2",
"@vaadin/text-field": "24.0.0-alpha0",
Expand Down
47 changes: 2 additions & 45 deletions packages/overlay/src/vaadin-overlay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,10 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayCustomEventMap;

/**
* `<vaadin-overlay>` is a Web Component for creating overlays. The content of the overlay
* can be populated in two ways: imperatively by using renderer callback function and
* declaratively by using Polymer's Templates.
* can be populated imperatively by using `renderer` callback function.
*
* ### Rendering
*
* By default, the overlay uses the content provided by using the renderer callback function.
*
* The renderer function provides `root`, `owner`, `model` arguments when applicable.
* Generate DOM content by using `model` object properties if needed, append it to the `root`
* element and control the state of the host element by accessing `owner`. Before generating new
Expand All @@ -82,39 +79,9 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayCustomEventMap;
* in the next renderer call and will be provided with the `root` argument.
* On first call it will be empty.
*
* **NOTE:** when the renderer property is defined, the `<template>` content is not used.
*
* ### Templating
*
* Alternatively, the content can be provided with Polymer Template.
* Overlay finds the first child template and uses that in case renderer callback function
* is not provided. You can also set a custom template using the `template` property.
*
* After the content from the template is stamped, the `content` property
* points to the content container.
*
* The overlay provides `forwardHostProp` when calling
* `Polymer.Templatize.templatize` for the template, so that the bindings
* from the parent scope propagate to the content.
*
* ```html
* <vaadin-overlay>
* <template>Overlay content</template>
* </vaadin-overlay>
* ```
*
* ### Styling
*
* To style the overlay content, use styles in the parent scope:
*
* - If the overlay is used in a component, then the component styles
* apply the overlay content.
* - If the overlay is used in the global DOM scope, then global styles
* apply to the overlay content.
*
* See examples for styling the overlay content in the live demos.
*
* The following Shadow DOM parts are available for styling the overlay component itself:
* The following Shadow DOM parts are available for styling:
*
* Part name | Description
* -----------|---------------------------------------------------------|
Expand Down Expand Up @@ -165,16 +132,6 @@ declare class Overlay extends ThemableMixin(DirMixin(ControllerMixin(HTMLElement
*/
renderer: OverlayRenderer | null | undefined;

/**
* The template of the overlay content.
*/
template: HTMLTemplateElement | null | undefined;

/**
* References the content container after the template is stamped.
*/
content: HTMLElement | undefined;

/**
* When true the overlay has backdrop on top of content when opened.
*/
Expand Down
Loading

0 comments on commit 1386314

Please sign in to comment.