vsn 0.1.123 → 0.1.124
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/demo.html +4 -1
- package/demo/resources/xhr-animations.html +24 -0
- package/demo/resources/xhr-lazy.html +10 -1
- package/demo/silly-animations.html +12 -24
- package/demo/vsn.js +2 -2
- package/dist/AST/ArrayNode.js +70 -18
- package/dist/AST/ArrayNode.js.map +1 -1
- package/dist/AST/AssignmentNode.js +92 -35
- package/dist/AST/AssignmentNode.js.map +1 -1
- package/dist/AST/BlockNode.js +17 -1
- package/dist/AST/BlockNode.js.map +1 -1
- package/dist/AST/ClassNode.js +225 -87
- package/dist/AST/ClassNode.js.map +1 -1
- package/dist/AST/ElementAttributeNode.js +55 -29
- package/dist/AST/ElementAttributeNode.js.map +1 -1
- package/dist/AST/ElementStyleNode.js +48 -22
- package/dist/AST/ElementStyleNode.js.map +1 -1
- package/dist/AST/FunctionArgumentNode.js +57 -15
- package/dist/AST/FunctionArgumentNode.js.map +1 -1
- package/dist/AST/FunctionCallNode.js +120 -52
- package/dist/AST/FunctionCallNode.js.map +1 -1
- package/dist/AST/FunctionNode.js +57 -14
- package/dist/AST/FunctionNode.js.map +1 -1
- package/dist/AST/IfStatementNode.js +52 -12
- package/dist/AST/IfStatementNode.js.map +1 -1
- package/dist/AST/IndexNode.js +24 -3
- package/dist/AST/IndexNode.js.map +1 -1
- package/dist/AST/ModifierNode.js +1 -1
- package/dist/AST/ModifierNode.js.map +1 -1
- package/dist/AST/Node.d.ts +3 -2
- package/dist/AST/Node.js +132 -39
- package/dist/AST/Node.js.map +1 -1
- package/dist/AST/ObjectNode.js +17 -1
- package/dist/AST/ObjectNode.js.map +1 -1
- package/dist/AST/OnNode.js +23 -2
- package/dist/AST/OnNode.js.map +1 -1
- package/dist/AST/ScopeMemberNode.js +40 -16
- package/dist/AST/ScopeMemberNode.js.map +1 -1
- package/dist/AST/ScopeNodeAbstract.js +29 -8
- package/dist/AST/ScopeNodeAbstract.js.map +1 -1
- package/dist/AST/StringFormatNode.js +42 -5
- package/dist/AST/StringFormatNode.js.map +1 -1
- package/dist/AST/WASM/Function.js +20 -4
- package/dist/AST/WASM/Function.js.map +1 -1
- package/dist/AST/WASM.js +26 -10
- package/dist/AST/WASM.js.map +1 -1
- package/dist/AST/WithNode.js +81 -41
- package/dist/AST/WithNode.js.map +1 -1
- package/dist/AST.js +91 -37
- package/dist/AST.js.map +1 -1
- package/dist/Attribute.d.ts +3 -0
- package/dist/Attribute.js +43 -19
- package/dist/Attribute.js.map +1 -1
- package/dist/Bencmark.js +77 -20
- package/dist/Bencmark.js.map +1 -1
- package/dist/Component.js +49 -15
- package/dist/Component.js.map +1 -1
- package/dist/DOM/DOMObject.d.ts +6 -1
- package/dist/DOM/DOMObject.js +22 -1
- package/dist/DOM/DOMObject.js.map +1 -1
- package/dist/DOM.js +450 -193
- package/dist/DOM.js.map +1 -1
- package/dist/EventDispatcher.js +153 -39
- package/dist/EventDispatcher.js.map +1 -1
- package/dist/MessageList.js +37 -6
- package/dist/MessageList.js.map +1 -1
- package/dist/Model.js +27 -6
- package/dist/Model.js.map +1 -1
- package/dist/Modifiers.d.ts +17 -0
- package/dist/Modifiers.js +100 -0
- package/dist/Modifiers.js.map +1 -0
- package/dist/Scope/DynamicScopeData.js +38 -7
- package/dist/Scope/DynamicScopeData.js.map +1 -1
- package/dist/Scope/ScopeData.js +29 -8
- package/dist/Scope/ScopeData.js.map +1 -1
- package/dist/Scope/ScopeDataAbstract.js +103 -27
- package/dist/Scope/ScopeDataAbstract.js.map +1 -1
- package/dist/Scope/WrappedArray.js +112 -26
- package/dist/Scope/WrappedArray.js.map +1 -1
- package/dist/Scope/properties/ArrayProperty.js +17 -1
- package/dist/Scope/properties/ArrayProperty.js.map +1 -1
- package/dist/Scope/properties/Property.js +38 -7
- package/dist/Scope/properties/Property.js.map +1 -1
- package/dist/Scope.js +70 -13
- package/dist/Scope.js.map +1 -1
- package/dist/SimplePromise.js +71 -30
- package/dist/SimplePromise.js.map +1 -1
- package/dist/Tag/TagList.js +22 -1
- package/dist/Tag/TagList.js.map +1 -1
- package/dist/Tag.d.ts +5 -9
- package/dist/Tag.js +512 -195
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/KeyAbstract.js +1 -1
- package/dist/attributes/KeyAbstract.js.map +1 -1
- package/dist/attributes/KeyDown.js +1 -1
- package/dist/attributes/KeyDown.js.map +1 -1
- package/dist/attributes/KeyUp.js +1 -1
- package/dist/attributes/KeyUp.js.map +1 -1
- package/dist/attributes/LazyAttribute.js +4 -2
- package/dist/attributes/LazyAttribute.js.map +1 -1
- package/dist/attributes/List.js +77 -30
- package/dist/attributes/List.js.map +1 -1
- package/dist/attributes/On.d.ts +1 -1
- package/dist/attributes/On.js +10 -10
- package/dist/attributes/On.js.map +1 -1
- package/dist/attributes/RootAttribute.js +29 -8
- package/dist/attributes/RootAttribute.js.map +1 -1
- package/dist/attributes/ScopeAttribute.js +30 -9
- package/dist/attributes/ScopeAttribute.js.map +1 -1
- package/dist/attributes/SetAttribute.js +32 -11
- package/dist/attributes/SetAttribute.js.map +1 -1
- package/dist/attributes/StyleAttribute.js +27 -6
- package/dist/attributes/StyleAttribute.js.map +1 -1
- package/dist/attributes/XHRAttribute.js +28 -7
- package/dist/attributes/XHRAttribute.js.map +1 -1
- package/dist/helpers/ElementHelper.js +25 -4
- package/dist/helpers/ElementHelper.js.map +1 -1
- package/dist/helpers/decorators.js +22 -1
- package/dist/helpers/decorators.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/AST/FunctionNode.ts +2 -0
- package/src/AST/ModifierNode.ts +1 -1
- package/src/AST/Node.ts +10 -5
- package/src/AST/OnNode.ts +1 -1
- package/src/AST/ScopeNodeAbstract.ts +3 -3
- package/src/AST.ts +1 -1
- package/src/Attribute.ts +19 -8
- package/src/DOM/DOMObject.ts +4 -1
- package/src/Modifiers.ts +54 -0
- package/src/Tag.ts +66 -37
- package/src/attributes/KeyAbstract.ts +1 -1
- package/src/attributes/KeyDown.ts +1 -1
- package/src/attributes/KeyUp.ts +1 -1
- package/src/attributes/LazyAttribute.ts +6 -2
- package/src/attributes/On.ts +10 -9
- package/src/attributes/XHRAttribute.ts +2 -2
- package/src/version.ts +1 -1
- package/tsconfig.base.json +2 -1
package/src/Tag.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {Registry} from "./Registry";
|
|
|
9
9
|
import {DOMObject} from "./DOM/DOMObject";
|
|
10
10
|
import {Tree} from "./AST";
|
|
11
11
|
import {StyleAttribute} from "./attributes/StyleAttribute";
|
|
12
|
+
import {Modifiers} from "./Modifiers";
|
|
12
13
|
|
|
13
14
|
export enum TagState {
|
|
14
15
|
Instantiated,
|
|
@@ -27,8 +28,7 @@ export class Tag extends DOMObject {
|
|
|
27
28
|
public readonly deferredAttributes: Attribute[] = [];
|
|
28
29
|
protected _state: TagState;
|
|
29
30
|
protected _meta: { [key: string]: any; };
|
|
30
|
-
protected attributes: Attribute
|
|
31
|
-
protected attributeMap: { [key: string]: Attribute; };
|
|
31
|
+
protected attributes: Map<string, Attribute> = new Map<string, Attribute>();
|
|
32
32
|
protected _nonDeferredAttributes: Attribute[] = [];
|
|
33
33
|
protected _parentTag: Tag;
|
|
34
34
|
protected _children: Tag[] = [];
|
|
@@ -78,8 +78,6 @@ export class Tag extends DOMObject {
|
|
|
78
78
|
element[Tag.TaggedVariable] = this;
|
|
79
79
|
this.rawAttributes = {};
|
|
80
80
|
this.parsedAttributes = {};
|
|
81
|
-
this.attributes = [];
|
|
82
|
-
this.attributeMap = {};
|
|
83
81
|
this.onEventHandlers = {};
|
|
84
82
|
this.analyzeElementAttributes();
|
|
85
83
|
this._state = TagState.Instantiated;
|
|
@@ -97,14 +95,23 @@ export class Tag extends DOMObject {
|
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
public getAttributesWithState(state: AttributeState): Attribute[] {
|
|
100
|
-
|
|
98
|
+
const attrs: Attribute[] = [];
|
|
99
|
+
for (const attr of this.attributes.values()) {
|
|
100
|
+
if (attr.state === state)
|
|
101
|
+
attrs.push(attr);
|
|
102
|
+
}
|
|
103
|
+
return attrs;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
public get nonDeferredAttributes(): Attribute[] {
|
|
104
107
|
if (this._nonDeferredAttributes.length > 0)
|
|
105
108
|
return this._nonDeferredAttributes;
|
|
106
109
|
|
|
107
|
-
const attrs: Attribute[] =
|
|
110
|
+
const attrs: Attribute[] = [];
|
|
111
|
+
for (const attr of this.attributes.values()) {
|
|
112
|
+
if (attr.state !== AttributeState.Deferred)
|
|
113
|
+
attrs.push(attr);
|
|
114
|
+
}
|
|
108
115
|
this._nonDeferredAttributes = attrs;
|
|
109
116
|
return attrs;
|
|
110
117
|
}
|
|
@@ -146,7 +153,7 @@ export class Tag extends DOMObject {
|
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
mutate(mutation: MutationRecord): void {
|
|
149
|
-
this.attributes.
|
|
156
|
+
this.attributes.forEach(attr => attr.mutate(mutation));
|
|
150
157
|
this.dispatch('mutate', mutation);
|
|
151
158
|
}
|
|
152
159
|
|
|
@@ -185,10 +192,6 @@ export class Tag extends DOMObject {
|
|
|
185
192
|
return null;
|
|
186
193
|
}
|
|
187
194
|
|
|
188
|
-
getAttributeModifiers(attr: string): string[] {
|
|
189
|
-
return attr.split('|').splice(1);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
195
|
get isInput(): boolean {
|
|
193
196
|
return this.inputTags.indexOf(this.element.tagName.toLowerCase()) > -1;
|
|
194
197
|
}
|
|
@@ -390,7 +393,7 @@ export class Tag extends DOMObject {
|
|
|
390
393
|
public async getAttribute<T = Attribute>(key: string): Promise<T> {
|
|
391
394
|
const cls: any = await Registry.instance.attributes.get(key);
|
|
392
395
|
if (!cls) return;
|
|
393
|
-
for (const attr of this.attributes)
|
|
396
|
+
for (const attr of this.attributes.values())
|
|
394
397
|
if (attr instanceof cls)
|
|
395
398
|
return attr as any as T;
|
|
396
399
|
}
|
|
@@ -481,8 +484,7 @@ export class Tag extends DOMObject {
|
|
|
481
484
|
const slot: Tag = this.isSlot ? this : null;
|
|
482
485
|
for (const tag of tags) {
|
|
483
486
|
for (let attr in this.rawAttributes) {
|
|
484
|
-
if (tag.
|
|
485
|
-
continue;
|
|
487
|
+
if (tag.attributes.has(attr)) continue;
|
|
486
488
|
|
|
487
489
|
if (this.hasModifier(attr, 'mobile') && !isMobile)
|
|
488
490
|
continue;
|
|
@@ -498,8 +500,7 @@ export class Tag extends DOMObject {
|
|
|
498
500
|
|
|
499
501
|
const attrObj = attrClass.create(tag, attr, attrClass, slot);
|
|
500
502
|
|
|
501
|
-
tag.attributes.
|
|
502
|
-
tag.attributeMap[attr] = attrObj;
|
|
503
|
+
tag.attributes.set(attr, attrObj);
|
|
503
504
|
if (defer && attrClass.canDefer) {
|
|
504
505
|
await attrObj.defer();
|
|
505
506
|
tag.deferredAttributes.push(attrObj);
|
|
@@ -557,7 +558,7 @@ export class Tag extends DOMObject {
|
|
|
557
558
|
const tags: Tag[] = await this.getTagsToBuild() as Tag[];
|
|
558
559
|
for (const tag of tags) {
|
|
559
560
|
if (tag.isInput) {
|
|
560
|
-
tag.addEventHandler('input',
|
|
561
|
+
tag.addEventHandler('input', null, tag.inputMutation, tag);
|
|
561
562
|
}
|
|
562
563
|
|
|
563
564
|
for (const attr of tag.getAttributesWithState(AttributeState.Extracted)) {
|
|
@@ -612,12 +613,42 @@ export class Tag extends DOMObject {
|
|
|
612
613
|
|
|
613
614
|
this.scope.set('$event', e);
|
|
614
615
|
this.scope.set('$value', this.value);
|
|
616
|
+
let preventedDefault = false;
|
|
615
617
|
for (const handler of this.onEventHandlers[eventType]) {
|
|
616
|
-
handler.
|
|
618
|
+
if (!preventedDefault && handler.modifiers.has('preventdefault') && e.cancelable) {
|
|
619
|
+
e.preventDefault();
|
|
620
|
+
preventedDefault = true;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
if (handler.modifiers.has('once'))
|
|
624
|
+
this.removeEventHandler(handler.event, handler.handler, handler.context);
|
|
625
|
+
|
|
626
|
+
if (handler.modifiers.has('throttle')) {
|
|
627
|
+
const modifierArguments = handler.modifiers.get('throttle').getArguments(['1000']);
|
|
628
|
+
const throttleTime = parseInt(modifierArguments[0]);
|
|
629
|
+
const now = Math.floor(Date.now());
|
|
630
|
+
if (!handler.state.lastCalled || handler.state.lastCalled + throttleTime < now) {
|
|
631
|
+
handler.state.lastCalled = now;
|
|
632
|
+
} else {
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (handler.modifiers.has('debounce')) {
|
|
638
|
+
clearTimeout(handler.state.debounceTimeout);
|
|
639
|
+
const modifierArguments = handler.modifiers.get('debounce').getArguments(['1000']);
|
|
640
|
+
const debounceTime = parseInt(modifierArguments[0]);
|
|
641
|
+
handler.state.debounceTimeout = setTimeout(async () => {
|
|
642
|
+
await handler.handler.call(handler.context, e);
|
|
643
|
+
}, debounceTime);
|
|
644
|
+
} else {
|
|
645
|
+
handler.handler.call(handler.context, e);
|
|
646
|
+
}
|
|
617
647
|
}
|
|
618
648
|
}
|
|
619
649
|
|
|
620
650
|
public hasModifier(attribute: string, modifier: string): boolean {
|
|
651
|
+
this.attributes
|
|
621
652
|
return attribute.indexOf(`|${modifier}`) > -1;
|
|
622
653
|
}
|
|
623
654
|
|
|
@@ -625,28 +656,32 @@ export class Tag extends DOMObject {
|
|
|
625
656
|
return attribute.replace(`|${modifier}`, '');
|
|
626
657
|
}
|
|
627
658
|
|
|
628
|
-
public addEventHandler(eventType: string, modifiers:
|
|
659
|
+
public addEventHandler(eventType: string, modifiers: Modifiers, handler, context: any = null) {
|
|
629
660
|
let passiveValue: boolean = null;
|
|
630
|
-
|
|
661
|
+
modifiers = modifiers || new Modifiers();
|
|
662
|
+
|
|
663
|
+
if (modifiers.has('active')) {
|
|
631
664
|
passiveValue = false;
|
|
632
|
-
} else if (modifiers.
|
|
665
|
+
} else if (modifiers.has('passive')) {
|
|
633
666
|
passiveValue = true;
|
|
634
667
|
}
|
|
635
668
|
|
|
636
669
|
if (!this.onEventHandlers[eventType]) {
|
|
637
670
|
this.onEventHandlers[eventType] = [];
|
|
638
671
|
const element: HTMLElement | Window = On.WindowEvents.indexOf(eventType) > -1 && window ? window : this.element;
|
|
639
|
-
const
|
|
672
|
+
const eventListenerOpts: any = {};
|
|
640
673
|
if (eventType.indexOf('touch') > -1 || passiveValue !== null)
|
|
641
|
-
|
|
674
|
+
eventListenerOpts['passive'] = passiveValue === null && true || passiveValue;
|
|
642
675
|
|
|
643
|
-
element.addEventListener(eventType, this.handleEvent.bind(this, eventType),
|
|
676
|
+
element.addEventListener(eventType, this.handleEvent.bind(this, eventType), eventListenerOpts);
|
|
644
677
|
}
|
|
645
678
|
|
|
646
679
|
this.onEventHandlers[eventType].push({
|
|
647
680
|
handler: handler,
|
|
648
681
|
event: eventType,
|
|
649
682
|
context: context,
|
|
683
|
+
modifiers: modifiers,
|
|
684
|
+
state: {}
|
|
650
685
|
});
|
|
651
686
|
}
|
|
652
687
|
|
|
@@ -689,32 +724,26 @@ export class Tag extends DOMObject {
|
|
|
689
724
|
}
|
|
690
725
|
|
|
691
726
|
async watchAttribute(attributeName: string) {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
return attribute;
|
|
695
|
-
}
|
|
727
|
+
if (this.attributes.has(attributeName) && this.attributes.get(attributeName) instanceof StandardAttribute) {
|
|
728
|
+
return this.attributes.get(attributeName);
|
|
696
729
|
}
|
|
697
730
|
|
|
698
731
|
this.createScope(true);
|
|
699
|
-
|
|
700
732
|
const standardAttribute = new StandardAttribute(this, attributeName);
|
|
701
|
-
this.attributes.
|
|
733
|
+
this.attributes.set(attributeName, standardAttribute);
|
|
702
734
|
await this.setupAttribute(standardAttribute);
|
|
703
735
|
|
|
704
736
|
return standardAttribute;
|
|
705
737
|
}
|
|
706
738
|
|
|
707
739
|
async watchStyle(styleName: string) {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
return attribute;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
740
|
+
if (this.attributes.has('style'))
|
|
741
|
+
return this.attributes.get('style');
|
|
713
742
|
|
|
714
743
|
this.createScope(true);
|
|
715
744
|
|
|
716
745
|
const styleAttribute = new StyleAttribute(this, 'style');
|
|
717
|
-
this.attributes.
|
|
746
|
+
this.attributes.set('style', styleAttribute);
|
|
718
747
|
await this.setupAttribute(styleAttribute);
|
|
719
748
|
|
|
720
749
|
return styleAttribute;
|
|
@@ -735,7 +764,7 @@ export class Tag extends DOMObject {
|
|
|
735
764
|
|
|
736
765
|
deconstruct() {
|
|
737
766
|
this.attributes.forEach(attr => attr.deconstruct());
|
|
738
|
-
this.attributes.
|
|
767
|
+
this.attributes.clear();
|
|
739
768
|
this._children.forEach(child => child.deconstruct());
|
|
740
769
|
this._children.length = 0;
|
|
741
770
|
super.deconstruct();
|
|
@@ -9,7 +9,7 @@ export abstract class KeyAbstract extends On {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public async connect() {
|
|
12
|
-
this.tag.addEventHandler('keydown', this.
|
|
12
|
+
this.tag.addEventHandler('keydown', this.modifiers, this.handleEvent, this);
|
|
13
13
|
await super.connect();
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -4,7 +4,7 @@ import {Registry} from "../Registry";
|
|
|
4
4
|
@Registry.attribute('vsn-key-down')
|
|
5
5
|
export class KeyDown extends KeyAbstract {
|
|
6
6
|
public async connect() {
|
|
7
|
-
this.tag.addEventHandler('keydown', this.
|
|
7
|
+
this.tag.addEventHandler('keydown', this.modifiers, this.handleEvent, this);
|
|
8
8
|
await super.connect();
|
|
9
9
|
}
|
|
10
10
|
}
|
package/src/attributes/KeyUp.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {Registry} from "../Registry";
|
|
|
4
4
|
@Registry.attribute('vsn-key-up')
|
|
5
5
|
export class KeyUp extends KeyAbstract {
|
|
6
6
|
public async connect() {
|
|
7
|
-
this.tag.addEventHandler('keyup', this.
|
|
7
|
+
this.tag.addEventHandler('keyup', this.modifiers, this.handleEvent, this);
|
|
8
8
|
await super.connect();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {Registry} from "../Registry";
|
|
2
2
|
import {On} from "./On";
|
|
3
|
+
import {Modifiers} from "../Modifiers";
|
|
3
4
|
|
|
4
5
|
@Registry.attribute('vsn-lazy')
|
|
5
6
|
export class LazyAttribute extends On {
|
|
@@ -12,14 +13,17 @@ export class LazyAttribute extends On {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
public async connect() {
|
|
15
|
-
this.
|
|
16
|
+
if (!this.modifiers.has('active'))
|
|
17
|
+
this.modifiers.add('passive');
|
|
18
|
+
|
|
19
|
+
this.tag.addEventHandler('scroll', this.modifiers, this.handleEvent, this);
|
|
16
20
|
await this.handleEvent();
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
async handleEvent(e?: Event) {
|
|
20
24
|
if (!this.loaded && window.scrollY + window.outerHeight >= this.eleTop) {
|
|
21
25
|
this.loaded = true;
|
|
22
|
-
await
|
|
26
|
+
await super.handleEvent(e);
|
|
23
27
|
this.tag.removeEventHandler('scroll', this.handleEvent, this);
|
|
24
28
|
}
|
|
25
29
|
}
|
package/src/attributes/On.ts
CHANGED
|
@@ -18,21 +18,22 @@ export abstract class On extends Attribute {
|
|
|
18
18
|
'unload',
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
protected async getTree(): Promise<Tree> {
|
|
22
|
+
if (!this.handler) {
|
|
23
|
+
const code: string = this.getAttributeValue();
|
|
24
|
+
this.handler = new Tree(code);
|
|
25
|
+
await this.handler.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
26
|
+
}
|
|
27
|
+
return this.handler;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
async handleEvent(e) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
await this.handler.evaluate(this.tag.scope, this.tag.dom, this.tag);
|
|
31
|
+
const tree = await this.getTree();
|
|
32
|
+
await tree.evaluate(this.tag.scope, this.tag.dom, this.tag);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
public async connect() {
|
|
35
|
-
this.tag.addEventHandler(this.getAttributeBinding(), this.
|
|
36
|
+
this.tag.addEventHandler(this.getAttributeBinding(), this.modifiers, this.handleEvent, this);
|
|
36
37
|
await super.connect();
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -22,9 +22,9 @@ export class XHRAttribute extends Attribute {
|
|
|
22
22
|
|
|
23
23
|
public async connect() {
|
|
24
24
|
if (this.isForm) {
|
|
25
|
-
this.tag.addEventHandler('submit', this.
|
|
25
|
+
this.tag.addEventHandler('submit', this.modifiers, this.handleEvent, this);
|
|
26
26
|
} else if (this.isAnchor) {
|
|
27
|
-
this.tag.addEventHandler('click', this.
|
|
27
|
+
this.tag.addEventHandler('click', this.modifiers, this.handleEvent, this);
|
|
28
28
|
}
|
|
29
29
|
await super.connect();
|
|
30
30
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.124';
|
|
2
2
|
|