vsn 0.1.102 → 0.1.103
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 +1 -0
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/If.js +0 -3
- package/dist/attributes/If.js.map +1 -1
- package/dist/attributes/List.js +5 -0
- package/dist/attributes/List.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vsn.min.js +2 -2
- package/package.json +1 -1
- package/src/Tag.ts +1 -0
- package/src/attributes/If.ts +0 -3
- package/src/attributes/List.ts +4 -0
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/Tag.ts
CHANGED
|
@@ -561,6 +561,7 @@ export class Tag extends DOMObject {
|
|
|
561
561
|
public async finalize() {
|
|
562
562
|
this._state = TagState.Built;
|
|
563
563
|
this.callOnWrapped('$built', this, this.scope, this.element);
|
|
564
|
+
this.dispatch('$built', this);
|
|
564
565
|
VisionHelper.nice(this.setupDeferredAttributes.bind(this));
|
|
565
566
|
}
|
|
566
567
|
|
package/src/attributes/If.ts
CHANGED
|
@@ -9,7 +9,6 @@ export class If extends Attribute {
|
|
|
9
9
|
|
|
10
10
|
public async compile() {
|
|
11
11
|
const statement: string = this.getAttributeValue();
|
|
12
|
-
console.log('if statement for', this.tag.element, statement);
|
|
13
12
|
this.tree = new Tree(statement);
|
|
14
13
|
await this.tree.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
15
14
|
await super.compile();
|
|
@@ -34,10 +33,8 @@ export class If extends Attribute {
|
|
|
34
33
|
const result: boolean = await this.tree.evaluate(this.tag.scope, this.tag.dom, this.tag);
|
|
35
34
|
if (result) {
|
|
36
35
|
this.tag.show();
|
|
37
|
-
console.log('show', this.tag.element);
|
|
38
36
|
} else {
|
|
39
37
|
this.tag.hide();
|
|
40
|
-
console.log('hide', this.tag.element);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
package/src/attributes/List.ts
CHANGED
|
@@ -189,6 +189,10 @@ export class List extends Attribute {
|
|
|
189
189
|
if (cls) {
|
|
190
190
|
if (!obj || !(obj instanceof cls)) {
|
|
191
191
|
obj = new cls(obj);
|
|
192
|
+
this.tag.once('$built', () => {
|
|
193
|
+
if (obj['$built'])
|
|
194
|
+
obj['$built'](this.tag, this.tag.scope, this.tag.element);
|
|
195
|
+
});
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.103';
|
|
2
2
|
|