vasille 1.2.9 → 2.0.3
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/LICENSE.md +21 -0
- package/README.md +195 -129
- package/cdn/es2015.js +3231 -0
- package/cdn/es5.js +3675 -0
- package/flow-typed/vasille.js +839 -0
- package/lib/binding/attribute.js +32 -0
- package/lib/binding/binding.js +39 -0
- package/lib/binding/class.js +51 -0
- package/lib/binding/style.js +29 -0
- package/lib/core/core.js +186 -0
- package/lib/core/destroyable.js +45 -0
- package/lib/core/errors.js +16 -0
- package/lib/core/executor.js +154 -0
- package/lib/core/ivalue.js +56 -0
- package/lib/core/signal.js +50 -0
- package/lib/core/slot.js +47 -0
- package/lib/index.js +27 -22
- package/lib/models/array-model.js +208 -0
- package/lib/models/listener.js +130 -0
- package/lib/models/map-model.js +66 -0
- package/lib/models/model.js +1 -0
- package/lib/models/object-model.js +78 -0
- package/lib/models/set-model.js +62 -0
- package/lib/node/app.js +39 -0
- package/lib/node/interceptor.js +83 -0
- package/lib/node/node.js +1204 -0
- package/lib/node/watch.js +27 -0
- package/lib/value/expression.js +83 -0
- package/lib/value/mirror.js +58 -0
- package/lib/value/pointer.js +26 -0
- package/lib/value/reference.js +55 -0
- package/lib/views/array-view.js +21 -0
- package/lib/views/base-view.js +49 -0
- package/lib/views/map-view.js +19 -0
- package/lib/views/object-view.js +19 -0
- package/lib/views/repeat-node.js +106 -0
- package/lib/views/repeater.js +63 -0
- package/lib/views/set-view.js +22 -0
- package/package.json +26 -18
- package/types/binding/attribute.d.ts +23 -0
- package/types/binding/binding.d.ts +30 -0
- package/types/binding/class.d.ts +23 -0
- package/types/binding/style.d.ts +23 -0
- package/types/core/core.d.ts +144 -0
- package/types/core/destroyable.d.ts +15 -0
- package/types/core/errors.d.ts +4 -0
- package/types/core/executor.d.ts +87 -0
- package/types/core/ivalue.d.ts +45 -0
- package/types/core/signal.d.ts +35 -0
- package/types/core/slot.d.ts +45 -0
- package/types/index.d.ts +27 -21
- package/types/models/array-model.d.ts +103 -0
- package/types/models/listener.d.ts +74 -0
- package/types/models/map-model.d.ts +35 -0
- package/types/models/model.d.ts +19 -0
- package/types/models/object-model.d.ts +36 -0
- package/types/models/set-model.d.ts +34 -0
- package/types/node/app.d.ts +42 -0
- package/types/node/interceptor.d.ts +50 -0
- package/types/node/node.d.ts +741 -0
- package/types/node/watch.d.ts +23 -0
- package/types/value/expression.d.ts +60 -0
- package/types/value/mirror.d.ts +35 -0
- package/types/value/pointer.d.ts +19 -0
- package/types/value/reference.d.ts +30 -0
- package/types/views/array-view.d.ts +13 -0
- package/types/views/base-view.d.ts +43 -0
- package/types/views/map-view.d.ts +11 -0
- package/types/views/object-view.d.ts +11 -0
- package/types/views/repeat-node.d.ts +35 -0
- package/types/views/repeater.d.ts +38 -0
- package/types/views/set-view.d.ts +11 -0
- package/CHANGELOG.md +0 -23
- package/img/favicon.svg +0 -441
- package/img/getLocus.svg +0 -18
- package/img/logo.png +0 -0
- package/img/logo.svg +0 -550
- package/img/scores-o-log.png +0 -0
- package/img/scores-o.png +0 -0
- package/img/scores-wo-log.png +0 -0
- package/img/scores-wo.png +0 -0
- package/img/x1-x32.png +0 -0
- package/lib/attribute.js +0 -71
- package/lib/attribute.js.map +0 -1
- package/lib/bind.js +0 -286
- package/lib/bind.js.map +0 -1
- package/lib/class.js +0 -97
- package/lib/class.js.map +0 -1
- package/lib/executor.js +0 -167
- package/lib/executor.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interfaces/core.js +0 -247
- package/lib/interfaces/core.js.map +0 -1
- package/lib/interfaces/destroyable.js +0 -39
- package/lib/interfaces/destroyable.js.map +0 -1
- package/lib/interfaces/errors.js +0 -49
- package/lib/interfaces/errors.js.map +0 -1
- package/lib/interfaces/ibind.js +0 -31
- package/lib/interfaces/ibind.js.map +0 -1
- package/lib/interfaces/idefinition.js +0 -64
- package/lib/interfaces/idefinition.js.map +0 -1
- package/lib/interfaces/ivalue.js +0 -60
- package/lib/interfaces/ivalue.js.map +0 -1
- package/lib/models.js +0 -579
- package/lib/models.js.map +0 -1
- package/lib/node.js +0 -2155
- package/lib/node.js.map +0 -1
- package/lib/property.js +0 -38
- package/lib/property.js.map +0 -1
- package/lib/style.js +0 -66
- package/lib/style.js.map +0 -1
- package/lib/value.js +0 -203
- package/lib/value.js.map +0 -1
- package/lib/views.js +0 -688
- package/lib/views.js.map +0 -1
- package/types/attribute.d.ts +0 -18
- package/types/bind.d.ts +0 -72
- package/types/class.d.ts +0 -19
- package/types/data.d.ts +0 -11
- package/types/event.d.ts +0 -10
- package/types/executor.d.ts +0 -57
- package/types/interfaces/core.d.ts +0 -129
- package/types/interfaces/destroyable.d.ts +0 -11
- package/types/interfaces/errors.d.ts +0 -24
- package/types/interfaces/ibind.d.ts +0 -19
- package/types/interfaces/idefinition.d.ts +0 -29
- package/types/interfaces/ivalue.d.ts +0 -40
- package/types/models.d.ts +0 -179
- package/types/node.d.ts +0 -906
- package/types/property.d.ts +0 -9
- package/types/style.d.ts +0 -28
- package/types/value.d.ts +0 -43
- package/types/views.d.ts +0 -135
package/types/property.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constructs a property field value
|
|
3
|
-
* @param value {?any} is the initial value of field
|
|
4
|
-
* @param func {?Callable} is the function to calc filed value
|
|
5
|
-
* @return {IValue} Given value or new generated
|
|
6
|
-
*/
|
|
7
|
-
export function propertify(value?: any | null, func?: Callable | null): IValue;
|
|
8
|
-
import { Callable } from "./interfaces/idefinition.js";
|
|
9
|
-
import { IValue } from "./interfaces/ivalue.js";
|
package/types/style.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constructs a style attribute value
|
|
3
|
-
* @param rt {INode} The root node
|
|
4
|
-
* @param ts {INode} The this node
|
|
5
|
-
* @param name {String} The style attribute name
|
|
6
|
-
* @param value {String | IValue | null} A value for attribute
|
|
7
|
-
* @param func {?Callable} A getter of attribute value
|
|
8
|
-
* @return {StyleBinding} A ready style binding
|
|
9
|
-
*/
|
|
10
|
-
export function stylify(rt: any, ts: any, name: string, value?: string | IValue | null, func?: Callable | null): StyleBinding;
|
|
11
|
-
/**
|
|
12
|
-
* Describes a style attribute binding
|
|
13
|
-
* @extends Binding
|
|
14
|
-
*/
|
|
15
|
-
export class StyleBinding extends Binding {
|
|
16
|
-
/**
|
|
17
|
-
* Constructs a style binding attribute
|
|
18
|
-
* @param rt {INode} is root component
|
|
19
|
-
* @param ts {INode} is this component
|
|
20
|
-
* @param name {string} is the name of style property
|
|
21
|
-
* @param func {function} is the function to calc style value
|
|
22
|
-
* @param values is the value to be synced
|
|
23
|
-
*/
|
|
24
|
-
constructor(rt: any, ts: any, name: string, func: Function, ...values: any[]);
|
|
25
|
-
}
|
|
26
|
-
import { IValue } from "./interfaces/ivalue.js";
|
|
27
|
-
import { Callable } from "./interfaces/idefinition.js";
|
|
28
|
-
import { Binding } from "./bind.js";
|
package/types/value.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Declares a notifiable value
|
|
3
|
-
* @implements IValue
|
|
4
|
-
*/
|
|
5
|
-
export class Reference extends IValue implements IValue {
|
|
6
|
-
/**
|
|
7
|
-
* Constructs a notifiable value
|
|
8
|
-
* @param value {any} is initial value
|
|
9
|
-
*/
|
|
10
|
-
constructor(value: any);
|
|
11
|
-
/**
|
|
12
|
-
* The encapsulated value
|
|
13
|
-
* @type {*}
|
|
14
|
-
*/
|
|
15
|
-
value: any;
|
|
16
|
-
/**
|
|
17
|
-
* Array of handlers
|
|
18
|
-
* @type {Set<Function>}
|
|
19
|
-
*/
|
|
20
|
-
onchange: Set<Function>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Declares a notifiable bind to a value
|
|
24
|
-
* @extends IValue
|
|
25
|
-
*/
|
|
26
|
-
export class Pointer extends IValue {
|
|
27
|
-
/**
|
|
28
|
-
* Constructs a notifiable bind to a value
|
|
29
|
-
* @param value {IValue} is initial value
|
|
30
|
-
*/
|
|
31
|
-
constructor(value: IValue);
|
|
32
|
-
/**
|
|
33
|
-
* value of pointer
|
|
34
|
-
* @type {IValue<*>}
|
|
35
|
-
*/
|
|
36
|
-
value: any;
|
|
37
|
-
/**
|
|
38
|
-
* Collection of handlers
|
|
39
|
-
* @type {Set<Function>}
|
|
40
|
-
*/
|
|
41
|
-
onchange: Set<Function>;
|
|
42
|
-
}
|
|
43
|
-
import { IValue } from "./interfaces/ivalue.js";
|
package/types/views.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
export class RepeatNodePrivate extends BaseNodePrivate {
|
|
2
|
-
/**
|
|
3
|
-
* Children node hash
|
|
4
|
-
* @type {Map<*, Extension>}
|
|
5
|
-
*/
|
|
6
|
-
nodes: Map<any, Extension>;
|
|
7
|
-
/**
|
|
8
|
-
* Call-back function to create a children pack
|
|
9
|
-
* @type {function(RepeatNodeItem, ?*) : void}
|
|
10
|
-
*/
|
|
11
|
-
cb: (arg0: RepeatNodeItem, arg1: any | null) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Repeat node repeats its children
|
|
15
|
-
*/
|
|
16
|
-
export class RepeatNode extends Extension {
|
|
17
|
-
/**
|
|
18
|
-
* Sets call-back function
|
|
19
|
-
* @param cb {function(RepeatNodeItem, ?*) : void}
|
|
20
|
-
*/
|
|
21
|
-
setCallback(cb: (arg0: RepeatNodeItem, arg1: any | null) => void): void;
|
|
22
|
-
/**
|
|
23
|
-
* Create a children pack
|
|
24
|
-
* @param id {*} id of child pack
|
|
25
|
-
* @param item {IValue<*>} value for children pack
|
|
26
|
-
* @param before {VasilleNode} Node to insert before it
|
|
27
|
-
*/
|
|
28
|
-
createChild(id: any, item: any, before: VasilleNode): void;
|
|
29
|
-
/**
|
|
30
|
-
* Destroy a old child
|
|
31
|
-
* @param id {*} id of children pack
|
|
32
|
-
* @param item {IValue<*>} value of children pack
|
|
33
|
-
*/
|
|
34
|
-
destroyChild(id: any, item: any): void;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Private part of repeater
|
|
38
|
-
*/
|
|
39
|
-
export class RepeaterPrivate extends RepeatNodePrivate {
|
|
40
|
-
/**
|
|
41
|
-
* Handler to catch count updates
|
|
42
|
-
* @type {Function}
|
|
43
|
-
*/
|
|
44
|
-
updateHandler: Function;
|
|
45
|
-
/**
|
|
46
|
-
* Current count of child nodes
|
|
47
|
-
* @type {number}
|
|
48
|
-
*/
|
|
49
|
-
currentCount: number;
|
|
50
|
-
/**
|
|
51
|
-
* Order number is used like children pack value
|
|
52
|
-
* @type {Array<IValue<number>>}
|
|
53
|
-
*/
|
|
54
|
-
orderNumber: Array<IValue<number>>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The simplest repeat $node interpretation, repeat children pack a several times
|
|
58
|
-
*/
|
|
59
|
-
export class Repeater extends RepeatNode {
|
|
60
|
-
/**
|
|
61
|
-
* The count of children
|
|
62
|
-
* @type {IValue<number>}
|
|
63
|
-
*/
|
|
64
|
-
count: any;
|
|
65
|
-
/**
|
|
66
|
-
* Changes the children count
|
|
67
|
-
* @param number {number} The new children count
|
|
68
|
-
*/
|
|
69
|
-
changeCount(number: number): void;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Private part of BaseView
|
|
73
|
-
*/
|
|
74
|
-
export class BaseViewPrivate extends RepeatNodePrivate {
|
|
75
|
-
/**
|
|
76
|
-
* Handler to catch values addition
|
|
77
|
-
* @type {Function}
|
|
78
|
-
*/
|
|
79
|
-
addHandler: Function;
|
|
80
|
-
/**
|
|
81
|
-
* Handler to catch values removes
|
|
82
|
-
* @type {Function}
|
|
83
|
-
*/
|
|
84
|
-
removeHandler: Function;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Base class of default views
|
|
88
|
-
*/
|
|
89
|
-
export class BaseView extends RepeatNode {
|
|
90
|
-
/**
|
|
91
|
-
* Property which will contain a model
|
|
92
|
-
* @type {IValue<*>}
|
|
93
|
-
*/
|
|
94
|
-
model: any;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Private part of array view
|
|
98
|
-
*/
|
|
99
|
-
export class ArrayViewPrivate extends BaseViewPrivate {
|
|
100
|
-
/**
|
|
101
|
-
* Contains handlers of each child
|
|
102
|
-
* @type {Map<IValue<*>, Function>}
|
|
103
|
-
*/
|
|
104
|
-
handlers: Map<IValue<any>, Function>;
|
|
105
|
-
/**
|
|
106
|
-
* Contains buffered children
|
|
107
|
-
* @type {Array<string>}
|
|
108
|
-
*/
|
|
109
|
-
buffer: Array<string>;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Represents a view of a array model
|
|
113
|
-
*/
|
|
114
|
-
export class ArrayView extends BaseView {
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Create a children pack for each object field
|
|
118
|
-
*/
|
|
119
|
-
export class ObjectView extends BaseView {
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Create a children pack for each map value
|
|
123
|
-
*/
|
|
124
|
-
export class MapView extends BaseView {
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Create a children pack for each set value
|
|
128
|
-
*/
|
|
129
|
-
export class SetView extends BaseView {
|
|
130
|
-
}
|
|
131
|
-
import { BaseNodePrivate } from "./node.js";
|
|
132
|
-
import { Extension } from "./node.js";
|
|
133
|
-
import { RepeatNodeItem } from "./node.js";
|
|
134
|
-
import { VasilleNode } from "./interfaces/core";
|
|
135
|
-
import { IValue } from "./interfaces/ivalue.js";
|