vsn 0.1.96 → 0.1.97
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/demo/vsn.js +2 -2
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/List.d.ts +1 -1
- package/dist/attributes/List.js +11 -5
- package/dist/attributes/List.js.map +1 -1
- package/dist/attributes/ListItem.js +1 -1
- package/dist/attributes/ListItem.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vsn.min.js +3 -0
- package/dist/vsn.min.js.LICENSE.txt +9 -0
- package/package.json +1 -1
- package/src/Tag.ts +0 -1
- package/src/attributes/List.ts +8 -5
- package/src/attributes/ListItem.ts +1 -1
- package/src/version.ts +1 -1
- package/test/attributes/ListItem.spec.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
+
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
+
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
+
* Code distributed by Google as part of the polymer project is also
|
|
8
|
+
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
+
*/
|
package/package.json
CHANGED
package/src/Tag.ts
CHANGED
package/src/attributes/List.ts
CHANGED
|
@@ -51,7 +51,7 @@ export class List extends Attribute {
|
|
|
51
51
|
await this.addExistingItems(items);
|
|
52
52
|
|
|
53
53
|
listScope.on(`change:${listKey}`, (e) => {
|
|
54
|
-
if (e
|
|
54
|
+
if (e?.oldValue) {
|
|
55
55
|
if (e.oldValue instanceof WrappedArray) {
|
|
56
56
|
e.oldValue.map((item) => {
|
|
57
57
|
this.remove(item);
|
|
@@ -147,17 +147,17 @@ export class List extends Attribute {
|
|
|
147
147
|
|
|
148
148
|
// Setup new tag
|
|
149
149
|
const tag = await this.tag.dom.buildTag(element, true);
|
|
150
|
-
|
|
151
|
-
await this.setupTag(tag, obj);
|
|
150
|
+
await this.setupTagScope(tag, obj);
|
|
152
151
|
|
|
153
152
|
// Add to DOM & build
|
|
154
153
|
this.tag.element.appendChild(element);
|
|
154
|
+
await this.tag.dom.setupTags([tag]);
|
|
155
155
|
await this.tag.dom.buildFrom(this.tag.element);
|
|
156
156
|
this.tags.push(tag);
|
|
157
157
|
this.tag.dispatch('add', obj);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
async
|
|
160
|
+
async setupTagScope(tag: Tag, obj: any) {
|
|
161
161
|
tag.createScope(true);
|
|
162
162
|
|
|
163
163
|
// Setup new scope & class, if defined
|
|
@@ -172,8 +172,11 @@ export class List extends Attribute {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
// Check if the class is set up already
|
|
175
|
-
if (!cls || (!(tag.scope.data instanceof cls) && !(tag.scope.wrapped instanceof cls)))
|
|
175
|
+
if (!cls || (!(tag.scope.data instanceof cls) && !(tag.scope.wrapped instanceof cls))) {
|
|
176
|
+
if (tag.scope.wrapped)
|
|
177
|
+
tag.scope.unwrap();
|
|
176
178
|
tag.wrap(obj);
|
|
179
|
+
}
|
|
177
180
|
|
|
178
181
|
tag.scope.set(this.listItemName, tag.scope);
|
|
179
182
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.97';
|
|
2
2
|
|
|
@@ -107,7 +107,6 @@ describe('ListItem', () => {
|
|
|
107
107
|
</ul>
|
|
108
108
|
`;
|
|
109
109
|
|
|
110
|
-
console.log('################# building dom');
|
|
111
110
|
const dom = new DOM(document);
|
|
112
111
|
dom.once('built', async () => {
|
|
113
112
|
const listItem = await dom.getTagForElement(document.getElementById('test-item'));
|