@vaadin/vaadin-overlay 22.0.0-rc1 → 23.0.0-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-overlay",
3
- "version": "22.0.0-rc1",
3
+ "version": "23.0.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,20 +34,20 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/component-base": "22.0.0-rc1",
38
- "@vaadin/vaadin-lumo-styles": "22.0.0-rc1",
39
- "@vaadin/vaadin-material-styles": "22.0.0-rc1",
40
- "@vaadin/vaadin-themable-mixin": "22.0.0-rc1"
37
+ "@vaadin/component-base": "23.0.0-alpha1",
38
+ "@vaadin/vaadin-lumo-styles": "23.0.0-alpha1",
39
+ "@vaadin/vaadin-material-styles": "23.0.0-alpha1",
40
+ "@vaadin/vaadin-themable-mixin": "23.0.0-alpha1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@esm-bundle/chai": "^4.3.4",
44
44
  "@polymer/iron-overlay-behavior": "^3.0.0",
45
- "@vaadin/button": "22.0.0-rc1",
46
- "@vaadin/radio-group": "22.0.0-rc1",
45
+ "@vaadin/button": "23.0.0-alpha1",
46
+ "@vaadin/radio-group": "23.0.0-alpha1",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
- "@vaadin/text-field": "22.0.0-rc1",
48
+ "@vaadin/text-field": "23.0.0-alpha1",
49
49
  "lit": "^2.0.0",
50
50
  "sinon": "^9.2.1"
51
51
  },
52
- "gitHead": "7b6f44bcd2c0fd415028ace666feeb0fedb1d540"
52
+ "gitHead": "fbcb07328fdf88260e3b461088d207426b21c710"
53
53
  }
@@ -61,8 +61,7 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayElementEventMap;
61
61
  *
62
62
  * The overlay provides `forwardHostProp` when calling
63
63
  * `Polymer.Templatize.templatize` for the template, so that the bindings
64
- * from the parent scope propagate to the content. You can also pass
65
- * custom `instanceProps` object using the `instanceProps` property.
64
+ * from the parent scope propagate to the content.
66
65
  *
67
66
  * ```html
68
67
  * <vaadin-overlay>
@@ -70,10 +69,6 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayElementEventMap;
70
69
  * </vaadin-overlay>
71
70
  * ```
72
71
  *
73
- * **NOTE:** when using `instanceProps`: because of the Polymer limitation,
74
- * every template can only be templatized once, so it is important
75
- * to set `instanceProps` before the `template` is assigned to the overlay.
76
- *
77
72
  * ### Styling
78
73
  *
79
74
  * To style the overlay content, use styles in the parent scope:
@@ -136,11 +131,6 @@ declare class OverlayElement extends ThemableMixin(DirMixin(HTMLElement)) {
136
131
  */
137
132
  template: HTMLTemplateElement | null | undefined;
138
133
 
139
- /**
140
- * Optional argument for `Polymer.Templatize.templatize`.
141
- */
142
- instanceProps: object | null | undefined;
143
-
144
134
  /**
145
135
  * References the content container after the template is stamped.
146
136
  */
@@ -55,18 +55,7 @@ import { FocusablesHelper } from './vaadin-focusables-helper.js';
55
55
  *
56
56
  * The overlay provides `forwardHostProp` when calling
57
57
  * `Polymer.Templatize.templatize` for the template, so that the bindings
58
- * from the parent scope propagate to the content. You can also pass
59
- * custom `instanceProps` object using the `instanceProps` property.
60
- *
61
- * ```html
62
- * <vaadin-overlay>
63
- * <template>Overlay content</template>
64
- * </vaadin-overlay>
65
- * ```
66
- *
67
- * **NOTE:** when using `instanceProps`: because of the Polymer limitation,
68
- * every template can only be templatized once, so it is important
69
- * to set `instanceProps` before the `template` is assigned to the overlay.
58
+ * from the parent scope propagate to the content.
70
59
  *
71
60
  * ### Styling
72
61
  *
@@ -227,13 +216,6 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
227
216
  notify: true
228
217
  },
229
218
 
230
- /**
231
- * Optional argument for `Polymer.Templatize.templatize`.
232
- */
233
- instanceProps: {
234
- type: Object
235
- },
236
-
237
219
  /**
238
220
  * References the content container after the template is stamped.
239
221
  * @type {!HTMLElement | undefined}
@@ -330,9 +312,6 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
330
312
  /** @private */
331
313
  _oldTemplate: Object,
332
314
 
333
- /** @private */
334
- _oldInstanceProps: Object,
335
-
336
315
  /** @private */
337
316
  _oldRenderer: Object,
338
317
 
@@ -342,7 +321,7 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
342
321
  }
343
322
 
344
323
  static get observers() {
345
- return ['_templateOrRendererChanged(template, renderer, owner, model, instanceProps, opened)'];
324
+ return ['_templateOrRendererChanged(template, renderer, owner, model, opened)'];
346
325
  }
347
326
 
348
327
  constructor() {
@@ -825,15 +804,13 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
825
804
 
826
805
  /**
827
806
  * @param {!HTMLTemplateElement} template
828
- * @param {object} instanceProps
829
807
  * @protected
830
808
  */
831
- _stampOverlayTemplate(template, instanceProps) {
809
+ _stampOverlayTemplate(template) {
832
810
  this._removeOldContent();
833
811
 
834
812
  if (!template._Templatizer) {
835
813
  template._Templatizer = templatize(template, this, {
836
- instanceProps: instanceProps,
837
814
  forwardHostProp: function (prop, value) {
838
815
  if (this._instance) {
839
816
  this._instance.forwardHostProp(prop, value);
@@ -886,7 +863,7 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
886
863
  }
887
864
 
888
865
  /** @private */
889
- _templateOrRendererChanged(template, renderer, owner, model, instanceProps, opened) {
866
+ _templateOrRendererChanged(template, renderer, owner, model, opened) {
890
867
  if (template && renderer) {
891
868
  this._removeNewRendererOrTemplate(template, this._oldTemplate, renderer, this._oldRenderer);
892
869
  throw new Error('You should only use either a renderer or a template for overlay content');
@@ -896,8 +873,7 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
896
873
  this._oldModel = model;
897
874
  this._oldOwner = owner;
898
875
 
899
- const templateOrInstancePropsChanged = this._oldInstanceProps !== instanceProps || this._oldTemplate !== template;
900
- this._oldInstanceProps = instanceProps;
876
+ const templateChanged = this._oldTemplate !== template;
901
877
  this._oldTemplate = template;
902
878
 
903
879
  const rendererChanged = this._oldRenderer !== renderer;
@@ -915,8 +891,8 @@ class OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {
915
891
  delete this.content._$litPart$;
916
892
  }
917
893
 
918
- if (template && templateOrInstancePropsChanged) {
919
- this._stampOverlayTemplate(template, instanceProps);
894
+ if (template && templateChanged) {
895
+ this._stampOverlayTemplate(template);
920
896
  } else if (renderer && (rendererChanged || openedChanged || ownerOrModelChanged)) {
921
897
  if (opened) {
922
898
  this.requestContentUpdate();