compelem 0.2.6-beta → 0.3.0-b1
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/CompElem.d.ts +3 -2
- package/constants.d.ts +11 -0
- package/decorators/computed.d.ts +1 -2
- package/decorators/watch.d.ts +1 -8
- package/events/event.d.ts +2 -1
- package/events/extends.d.ts +2 -1
- package/index.js +3644 -2
- package/package.json +8 -8
- package/reactive.d.ts +22 -11
- package/types.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compelem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-b1",
|
|
4
4
|
"description": "A modern, reactive, fast, lightweight and flexible lib for building web components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"test": "rollup --config rollup.config.test.js --watch"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/preset-typescript": "^7.
|
|
27
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
28
28
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
29
29
|
"@rollup/plugin-json": "4.1.0",
|
|
30
30
|
"@rollup/plugin-node-resolve": "14.1.0",
|
|
31
31
|
"@rollup/plugin-terser": "0.4.1",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "
|
|
33
|
-
"@typescript-eslint/parser": "^
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "8.23.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
34
34
|
"autoprefixer": "^10.4.19",
|
|
35
35
|
"bootstrap-icons": "^1.11.3",
|
|
36
|
-
"eslint": "
|
|
37
|
-
"eslint-config-prettier": "^
|
|
36
|
+
"eslint": "9.19.0",
|
|
37
|
+
"eslint-config-prettier": "^10.0.1",
|
|
38
38
|
"myfx": "^1.7.0",
|
|
39
39
|
"postcss": "^8.4.38",
|
|
40
40
|
"prettier": "^2.8.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"rollup-plugin-serve": "^2.0.1",
|
|
47
47
|
"rollup-plugin-typescript2": "0.33.0",
|
|
48
48
|
"sass": "^1.72.0",
|
|
49
|
-
"tslib": "^2.
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"tslib": "^2.8.1",
|
|
50
|
+
"typescript": "^5.7.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/reactive.d.ts
CHANGED
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
* @author holyhigh2
|
|
4
4
|
*/
|
|
5
5
|
import { CompElem } from "./CompElem";
|
|
6
|
+
import { CollectorType } from "./constants";
|
|
6
7
|
import { IView } from "./render/RenderContext";
|
|
7
|
-
import { Getter } from "./types";
|
|
8
|
+
import { Getter, Updater } from "./types";
|
|
8
9
|
export declare const Collector: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
endCompute(): void;
|
|
14
|
-
setComputedProp(updater: Getter): void;
|
|
15
|
-
__computeCollecting: null;
|
|
16
|
-
__computeUpdater: null;
|
|
17
|
-
__cssCollecting: null;
|
|
18
|
-
__cssUpdater: null;
|
|
10
|
+
collectWatch(comp: CompElem, updater: Getter, subPath: string): void;
|
|
11
|
+
startCollect(comp: CompElem, type: CollectorType): void;
|
|
12
|
+
setUpdater(updater: Getter): void;
|
|
13
|
+
endCollect(): void;
|
|
19
14
|
__directiveQ: any[][];
|
|
20
15
|
setDirectiveQ(val: any[]): void;
|
|
21
16
|
popDirectiveQ(): any[];
|
|
@@ -23,6 +18,9 @@ export declare const Collector: {
|
|
|
23
18
|
endRender(component: CompElem): void;
|
|
24
19
|
collect(prop: string): void;
|
|
25
20
|
clear(): void;
|
|
21
|
+
__updater: null;
|
|
22
|
+
__collecting: null;
|
|
23
|
+
__collectType: number;
|
|
26
24
|
__renderCollection: Set<string>;
|
|
27
25
|
__renderContext: null;
|
|
28
26
|
__renderCollecting: boolean;
|
|
@@ -37,3 +35,16 @@ export declare const Collector: {
|
|
|
37
35
|
* @returns
|
|
38
36
|
*/
|
|
39
37
|
export declare function reactive(obj: Record<string, any>, context: any): any;
|
|
38
|
+
export declare class Queue {
|
|
39
|
+
static watchSet: Set<Updater>;
|
|
40
|
+
static computedSet: Set<Updater>;
|
|
41
|
+
static cssSet: Set<Updater>;
|
|
42
|
+
static nextSet: Set<Updater>;
|
|
43
|
+
static nextPending: boolean;
|
|
44
|
+
static next: () => void;
|
|
45
|
+
static flush(): void;
|
|
46
|
+
static pushWatch(updater: Getter): void;
|
|
47
|
+
static pushComputed(updater: Getter): void;
|
|
48
|
+
static pushCss(updater: Getter): void;
|
|
49
|
+
static pushNext(updater: () => void): void;
|
|
50
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Template } from "./render/Template";
|
|
5
5
|
export type Constructor<T> = new (...args: any[]) => T;
|
|
6
6
|
export type Getter = () => any;
|
|
7
|
+
export type Updater = (...args: any[]) => any;
|
|
7
8
|
/**
|
|
8
9
|
* 插槽配置对象
|
|
9
10
|
*/
|
|
@@ -20,6 +21,11 @@ export declare enum DirectiveUpdateTag {
|
|
|
20
21
|
UPDATE = "UPDATE",//对比更新
|
|
21
22
|
APPEND = "APPEND"
|
|
22
23
|
}
|
|
24
|
+
export type DefaultProps = Partial<{
|
|
25
|
+
css: Array<string | CSSStyleSheet>;
|
|
26
|
+
global: Record<string, any>;
|
|
27
|
+
[key: string]: Record<string, any>;
|
|
28
|
+
}>;
|
|
23
29
|
/**
|
|
24
30
|
* 视图更新点
|
|
25
31
|
*/
|