@vaadin/polymer-legacy-adapter 22.0.1 → 23.0.0-alpha3
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/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/polymer-legacy-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0-alpha3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@polymer/polymer": "^3.0.0",
|
|
34
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
34
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-alpha3",
|
|
35
35
|
"lit": "^2.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@esm-bundle/chai": "^4.3.4",
|
|
39
|
-
"@vaadin/checkbox": "
|
|
40
|
-
"@vaadin/grid": "
|
|
41
|
-
"@vaadin/grid-pro": "
|
|
39
|
+
"@vaadin/checkbox": "23.0.0-alpha3",
|
|
40
|
+
"@vaadin/grid": "23.0.0-alpha3",
|
|
41
|
+
"@vaadin/grid-pro": "23.0.0-alpha3",
|
|
42
42
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
43
43
|
"sinon": "^9.2.4"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "490037919a9e054cc002c1b3be0c94a1603e1a44"
|
|
46
46
|
}
|
package/src/style-modules.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 Vaadin Ltd.
|
|
3
|
+
* Copyright (c) 2021 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DomModule } from '@polymer/polymer/lib/elements/dom-module.js';
|
|
@@ -29,7 +29,8 @@ let moduleIdIndex = 0;
|
|
|
29
29
|
* @return {void}
|
|
30
30
|
*/
|
|
31
31
|
function registerStyles(themeFor, styles = [], options = {}) {
|
|
32
|
-
const themeId = options.moduleId || `custom-style-module-${moduleIdIndex
|
|
32
|
+
const themeId = options.moduleId || `custom-style-module-${moduleIdIndex}`;
|
|
33
|
+
moduleIdIndex += 1;
|
|
33
34
|
|
|
34
35
|
/** @type {DomModuleWithCachedStyles} */
|
|
35
36
|
const module = document.createElement('dom-module');
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2022 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
1
6
|
import { Templatizer } from './template-renderer-templatizer.js';
|
|
2
7
|
|
|
3
8
|
export class GridTemplatizer extends Templatizer {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2022 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
1
6
|
import { PolymerElement } from '@polymer/polymer';
|
|
2
7
|
import { templatize } from '@polymer/polymer/lib/utils/templatize.js';
|
|
3
8
|
|
|
@@ -51,7 +56,7 @@ export class Templatizer extends PolymerElement {
|
|
|
51
56
|
// The Polymer uses `===` to check whether a property is changed and should be re-rendered.
|
|
52
57
|
// This means, object properties won't be re-rendered when mutated inside.
|
|
53
58
|
// This workaround forces the `item` property to re-render even
|
|
54
|
-
// the new item is
|
|
59
|
+
// the new item is strictly equal to the old item.
|
|
55
60
|
if (instance.item === properties.item) {
|
|
56
61
|
instance._setPendingProperty('item');
|
|
57
62
|
}
|
|
@@ -94,7 +99,9 @@ export class Templatizer extends PolymerElement {
|
|
|
94
99
|
|
|
95
100
|
/** @private */
|
|
96
101
|
__createTemplateClass(properties) {
|
|
97
|
-
if (this.__TemplateClass)
|
|
102
|
+
if (this.__TemplateClass) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
98
105
|
|
|
99
106
|
const instanceProps = Object.keys(properties).reduce((accum, key) => {
|
|
100
107
|
return { ...accum, [key]: true };
|
package/src/template-renderer.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2022 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
1
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
2
7
|
import { GridTemplatizer } from './template-renderer-grid-templatizer.js';
|
|
3
8
|
import { Templatizer } from './template-renderer-templatizer.js';
|
|
@@ -47,7 +52,6 @@ function processGridTemplate(grid, template) {
|
|
|
47
52
|
if (template.matches('.row-details')) {
|
|
48
53
|
const renderer = createRenderer(grid, template, GridTemplatizer);
|
|
49
54
|
assignRenderer(grid, 'rowDetailsRenderer', renderer);
|
|
50
|
-
return;
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -107,7 +111,9 @@ function processTemplates(component) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
function observeTemplates(component) {
|
|
110
|
-
if (component.__templateObserver)
|
|
114
|
+
if (component.__templateObserver) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
111
117
|
|
|
112
118
|
component.__templateObserver = new FlattenedNodesObserver(component, () => {
|
|
113
119
|
processTemplates(component);
|
package/style-modules.js
CHANGED
package/template-renderer.js
CHANGED