vasille 1.2.8 → 2.0.2
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/.gitlab-ci.yml +20 -0
- package/LICENSE.md +21 -0
- package/README.md +160 -119
- package/cdn/es2015.js +3221 -0
- package/cdn/es5.js +3673 -0
- package/flow-typed/vasille.js +837 -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 +178 -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 +38 -0
- package/lib/node/interceptor.js +83 -0
- package/lib/node/node.js +1202 -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 +23 -0
- package/lib/views/base-view.js +49 -0
- package/lib/views/map-view.js +20 -0
- package/lib/views/object-view.js +20 -0
- package/lib/views/repeat-node.js +106 -0
- package/lib/views/repeater.js +63 -0
- package/lib/views/set-view.js +23 -0
- package/package.json +27 -19
- 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 +140 -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 +37 -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/src/attribute.js +0 -70
- package/src/bind.js +0 -285
- package/src/class.js +0 -96
- package/src/executor.js +0 -165
- package/src/index.js +0 -20
- package/src/interfaces/core.js +0 -248
- package/src/interfaces/destroyable.js +0 -37
- package/src/interfaces/errors.js +0 -47
- package/src/interfaces/ibind.js +0 -29
- package/src/interfaces/idefinition.js +0 -62
- package/src/interfaces/ivalue.js +0 -58
- package/src/models.js +0 -577
- package/src/node.js +0 -2162
- package/src/property.js +0 -36
- package/src/style.js +0 -65
- package/src/value.js +0 -201
- package/src/views.js +0 -686
- 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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Listener } from "./listener";
|
|
2
|
+
import type { IModel } from "./model";
|
|
3
|
+
/**
|
|
4
|
+
* A Map based memory
|
|
5
|
+
* @class MapModel
|
|
6
|
+
* @extends Map
|
|
7
|
+
* @implements IModel
|
|
8
|
+
*/
|
|
9
|
+
export declare class MapModel<K, T> extends Map<K, T> implements IModel<K, T> {
|
|
10
|
+
listener: Listener<T, K>;
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a map model
|
|
13
|
+
* @param map {[*, *][]} input data
|
|
14
|
+
*/
|
|
15
|
+
constructor(map?: [K, T][]);
|
|
16
|
+
/**
|
|
17
|
+
* Calls Map.clear and notify abut changes
|
|
18
|
+
*/
|
|
19
|
+
clear(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Calls Map.delete and notify abut changes
|
|
22
|
+
* @param key {*} key
|
|
23
|
+
* @return {boolean} true if removed something, otherwise false
|
|
24
|
+
*/
|
|
25
|
+
delete(key: any): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Calls Map.set and notify abut changes
|
|
28
|
+
* @param key {*} key
|
|
29
|
+
* @param value {*} value
|
|
30
|
+
* @return {MapModel} a pointer to this
|
|
31
|
+
*/
|
|
32
|
+
set(key: K, value: T): this;
|
|
33
|
+
enableReactivity(): void;
|
|
34
|
+
disableReactivity(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Listener } from "./listener";
|
|
2
|
+
/**
|
|
3
|
+
* @interface IModel
|
|
4
|
+
*/
|
|
5
|
+
export interface IModel<K, T> {
|
|
6
|
+
/**
|
|
7
|
+
* Enable the reactivity of model
|
|
8
|
+
*/
|
|
9
|
+
enableReactivity(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Disable the reactivity of model
|
|
12
|
+
*/
|
|
13
|
+
disableReactivity(): void;
|
|
14
|
+
/**
|
|
15
|
+
* The listener of model
|
|
16
|
+
* @type Listener
|
|
17
|
+
*/
|
|
18
|
+
listener: Listener<T, K>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Listener } from "./listener";
|
|
2
|
+
import type { IModel } from "./model";
|
|
3
|
+
/**
|
|
4
|
+
* Object based model
|
|
5
|
+
* @extends Object
|
|
6
|
+
*/
|
|
7
|
+
export declare class ObjectModel<T> extends Object implements IModel<string, T> {
|
|
8
|
+
listener: Listener<T, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a object model
|
|
11
|
+
* @param obj {Object} input data
|
|
12
|
+
*/
|
|
13
|
+
constructor(obj?: {
|
|
14
|
+
[p: string]: T;
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Gets a value of a field
|
|
18
|
+
* @param key {string}
|
|
19
|
+
* @return {*}
|
|
20
|
+
*/
|
|
21
|
+
get(key: string): T;
|
|
22
|
+
/**
|
|
23
|
+
* Sets an object property value
|
|
24
|
+
* @param key {string} property name
|
|
25
|
+
* @param v {*} property value
|
|
26
|
+
* @return {ObjectModel} a pointer to this
|
|
27
|
+
*/
|
|
28
|
+
set(key: string, v: T): this;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes an object property
|
|
31
|
+
* @param key {string} property name
|
|
32
|
+
*/
|
|
33
|
+
delete(key: string): void;
|
|
34
|
+
enableReactivity(): void;
|
|
35
|
+
disableReactivity(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Listener } from "./listener";
|
|
2
|
+
import type { IModel } from "./model";
|
|
3
|
+
/**
|
|
4
|
+
* A Set based model
|
|
5
|
+
* @class SetModel
|
|
6
|
+
* @extends Set
|
|
7
|
+
* @implements IModel
|
|
8
|
+
*/
|
|
9
|
+
export declare class SetModel<T> extends Set<T> implements IModel<T, T> {
|
|
10
|
+
listener: Listener<T, T>;
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a set model based on a set
|
|
13
|
+
* @param set {Set} input data
|
|
14
|
+
*/
|
|
15
|
+
constructor(set?: T[]);
|
|
16
|
+
/**
|
|
17
|
+
* Calls Set.add and notify abut changes
|
|
18
|
+
* @param value {*} value
|
|
19
|
+
* @return {this} a pointer to this
|
|
20
|
+
*/
|
|
21
|
+
add(value: T): this;
|
|
22
|
+
/**
|
|
23
|
+
* Calls Set.clear and notify abut changes
|
|
24
|
+
*/
|
|
25
|
+
clear(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Calls Set.delete and notify abut changes
|
|
28
|
+
* @param value {*}
|
|
29
|
+
* @return {boolean} true if a value was deleted, otherwise false
|
|
30
|
+
*/
|
|
31
|
+
delete(value: T): boolean;
|
|
32
|
+
enableReactivity(): void;
|
|
33
|
+
disableReactivity(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Executor } from "../core/executor";
|
|
2
|
+
import { INode } from "./node";
|
|
3
|
+
declare type AppOptions = {
|
|
4
|
+
freezeUi?: boolean;
|
|
5
|
+
executor?: Executor;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Application Node
|
|
9
|
+
* @class AppNode
|
|
10
|
+
* @extends INode
|
|
11
|
+
*/
|
|
12
|
+
export declare class AppNode extends INode {
|
|
13
|
+
/**
|
|
14
|
+
* Executor is used to optimize the page creation/update
|
|
15
|
+
* @type {Executor}
|
|
16
|
+
*/
|
|
17
|
+
$run: Executor;
|
|
18
|
+
/**
|
|
19
|
+
* @param options {Object} Application options
|
|
20
|
+
*/
|
|
21
|
+
constructor(options?: AppOptions);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Represents a Vasille.js application
|
|
25
|
+
* @class App
|
|
26
|
+
* @extends AppNode
|
|
27
|
+
*/
|
|
28
|
+
export declare class App extends AppNode {
|
|
29
|
+
/**
|
|
30
|
+
* Constructs an app node
|
|
31
|
+
* @param node {Element} The root of application
|
|
32
|
+
* @param options {Object} Application options
|
|
33
|
+
*/
|
|
34
|
+
constructor(node: Element, options?: AppOptions);
|
|
35
|
+
$$appendNode(node: Node): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fragment } from "./node";
|
|
2
|
+
import { Destroyable } from "../core/destroyable";
|
|
3
|
+
import { Signal } from "../core/signal";
|
|
4
|
+
import { Slot } from "../core/slot";
|
|
5
|
+
/**
|
|
6
|
+
* Interceptor is designed to connect signals & methods of children elements
|
|
7
|
+
* @class Interceptor
|
|
8
|
+
* @extends Destroyable
|
|
9
|
+
*/
|
|
10
|
+
export declare class Interceptor<t1 = void, t2 = void, t3 = void, t4 = void, t5 = void, t6 = void, t7 = void, t8 = void, t9 = void> extends Destroyable {
|
|
11
|
+
/**
|
|
12
|
+
* Set of signals
|
|
13
|
+
* @type Set
|
|
14
|
+
*/
|
|
15
|
+
signals: Set<Signal<t1, t2, t3, t4, t5, t6, t7, t8, t9>>;
|
|
16
|
+
/**
|
|
17
|
+
* Set of handlers
|
|
18
|
+
* @type Set
|
|
19
|
+
*/
|
|
20
|
+
handlers: Set<(a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void>;
|
|
21
|
+
/**
|
|
22
|
+
* Connect a signal or a handler
|
|
23
|
+
* @param thing {Signal | function}
|
|
24
|
+
*/
|
|
25
|
+
connect(thing: Signal<t1, t2, t3, t4, t5, t6, t7, t8, t9> | ((a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void)): void;
|
|
26
|
+
/**
|
|
27
|
+
* Disconnect a handler from signals
|
|
28
|
+
* @param handler {function}
|
|
29
|
+
*/
|
|
30
|
+
disconnect(handler: (a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void): void;
|
|
31
|
+
$destroy(): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Interceptor node to implement directly to vasille DOM
|
|
35
|
+
* @class InterceptorNode
|
|
36
|
+
* @extends Extension
|
|
37
|
+
*/
|
|
38
|
+
export declare class InterceptorNode<t1 = void, t2 = void, t3 = void, t4 = void, t5 = void, t6 = void, t7 = void, t8 = void, t9 = void> extends Fragment {
|
|
39
|
+
/**
|
|
40
|
+
* Internal interceptor
|
|
41
|
+
* @type Interceptor
|
|
42
|
+
*/
|
|
43
|
+
interceptor: Interceptor<t1, t2, t3, t4, t5, t6, t7, t8, t9>;
|
|
44
|
+
/**
|
|
45
|
+
* The default slot of node
|
|
46
|
+
* @type Slot
|
|
47
|
+
*/
|
|
48
|
+
slot: Slot<Interceptor<t1, t2, t3, t4, t5, t6, t7, t8, t9>>;
|
|
49
|
+
$compose(): void;
|
|
50
|
+
}
|