@cloudbase/cals 1.0.3-alpha.10 → 1.0.3-alpha.12
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/lib/parser/cals/index.d.ts +417 -366
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +90 -25
- package/lib/parser/cals/utils/block/index.d.ts +14 -14
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/index.js +3 -7
- package/lib/parser/cals/utils/code/index.d.ts +30 -30
- package/lib/parser/cals/utils/code/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/code/index.js +12 -18
- package/lib/parser/cals/utils/common.d.ts +11 -11
- package/lib/parser/cals/utils/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/common.js +0 -0
- package/lib/parser/cals/utils/runtime.d.ts +13 -13
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +2 -5
- package/lib/parser/cals/utils/spinoff/index.d.ts +9 -9
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/spinoff/index.js +0 -0
- package/lib/parser/cals/utils/style.d.ts +42 -42
- package/lib/parser/cals/utils/style.d.ts.map +1 -1
- package/lib/parser/cals/utils/style.js +3 -7
- package/lib/parser/cals/utils/template.d.ts +5 -5
- package/lib/parser/cals/utils/template.d.ts.map +0 -0
- package/lib/parser/cals/utils/template.js +0 -0
- package/lib/parser/cals/utils/version/common.d.ts +4 -4
- package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/common.js +33 -16
- package/lib/parser/cals/utils/version/config.d.ts +13 -13
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/config.js +0 -0
- package/lib/parser/cals/utils/version/index.d.ts +2 -2
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/index.js +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts +15 -15
- package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/parses.js +36 -18
- package/lib/parser/cals/utils/version/utils.d.ts +13 -13
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/utils.js +2 -5
- package/lib/parser/constants.d.ts +2 -0
- package/lib/parser/constants.d.ts.map +1 -0
- package/lib/parser/constants.js +4 -0
- package/lib/parser/expression/index.d.ts +122 -122
- package/lib/parser/expression/index.d.ts.map +0 -0
- package/lib/parser/expression/index.js +0 -0
- package/lib/parser/index.d.ts +8 -8
- package/lib/parser/index.d.ts.map +0 -0
- package/lib/parser/index.js +0 -0
- package/lib/parser/plugins/postcss-rpx2clac.d.ts +17 -17
- package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
- package/lib/types/basic/app.d.ts +72 -72
- package/lib/types/basic/app.d.ts.map +0 -0
- package/lib/types/basic/app.js +0 -0
- package/lib/types/basic/common.d.ts +88 -88
- package/lib/types/basic/common.d.ts.map +1 -1
- package/lib/types/basic/common.js +0 -0
- package/lib/types/basic/component.d.ts +213 -208
- package/lib/types/basic/component.d.ts.map +1 -1
- package/lib/types/basic/component.js +0 -0
- package/lib/types/basic/datasource.d.ts +49 -49
- package/lib/types/basic/datasource.d.ts.map +0 -0
- package/lib/types/basic/datasource.js +0 -0
- package/lib/types/index.d.ts +10 -9
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -14
- package/lib/types/lcds.d.ts +334 -447
- package/lib/types/lcds.d.ts.map +1 -1
- package/lib/types/lcds.js +0 -0
- package/lib/types/platform/app.d.ts +176 -176
- package/lib/types/platform/app.d.ts.map +0 -0
- package/lib/types/platform/app.js +0 -0
- package/lib/types/platform/common.d.ts +147 -137
- package/lib/types/platform/common.d.ts.map +1 -1
- package/lib/types/platform/common.js +0 -0
- package/lib/types/platform/component.d.ts +145 -140
- package/lib/types/platform/component.d.ts.map +1 -1
- package/lib/types/platform/component.js +0 -0
- package/lib/types/platform/datasource.d.ts +466 -466
- package/lib/types/platform/datasource.d.ts.map +0 -0
- package/lib/types/platform/datasource.js +0 -0
- package/lib/types/platform/eventFlow.d.ts +20 -0
- package/lib/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/types/platform/eventFlow.js +2 -0
- package/lib/types/platform/query.d.ts +58 -0
- package/lib/types/platform/query.d.ts.map +1 -0
- package/lib/types/platform/query.js +2 -0
- package/lib/types/platform/widget/form.d.ts +89 -89
- package/lib/types/platform/widget/form.d.ts.map +0 -0
- package/lib/types/platform/widget/form.js +0 -0
- package/lib/types/platform/widget/meta.d.ts +59 -59
- package/lib/types/platform/widget/meta.d.ts.map +0 -0
- package/lib/types/platform/widget/meta.js +0 -0
- package/lib/utils/CSSProperty.d.ts +63 -63
- package/lib/utils/CSSProperty.d.ts.map +0 -0
- package/lib/utils/CSSProperty.js +0 -0
- package/lib/utils/build.d.ts +1 -1
- package/lib/utils/build.d.ts.map +0 -0
- package/lib/utils/build.js +3 -3
- package/lib/utils/constant.d.ts +40 -40
- package/lib/utils/constant.d.ts.map +0 -0
- package/lib/utils/constant.js +0 -0
- package/lib/utils/dts/auto-generated.d.ts +1 -1
- package/lib/utils/dts/auto-generated.d.ts.map +1 -1
- package/lib/utils/dts/auto-generated.js +35 -1227
- package/lib/utils/dts/build.d.ts +1 -1
- package/lib/utils/dts/build.js +4 -1
- package/lib/utils/dts/index.d.ts +93 -130
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +66 -361
- package/lib/utils/index.d.ts +7 -7
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/version/common.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts.map +1 -1
- package/lib/utils/version/migrations/version4.d.ts +2 -2
- package/lib/utils/version/migrations/version4.js +2 -2
- package/lib/utils/version-migrations/common.d.ts +5 -0
- package/lib/utils/version-migrations/common.d.ts.map +1 -0
- package/lib/utils/version-migrations/common.js +29 -0
- package/lib/utils/version-migrations/version4.d.ts +3 -0
- package/lib/utils/version-migrations/version4.d.ts.map +1 -0
- package/lib/utils/version-migrations/version4.js +199 -0
- package/package.json +1 -11
- package/lib/cloudbase.cals.umd.min.js +0 -5
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import { Node, Options } from 'acorn';
|
|
2
|
-
export declare const PARSE_CONFIG: Options;
|
|
3
|
-
export declare const AST_TYPE: {
|
|
4
|
-
Literal: string;
|
|
5
|
-
ExpressionStatement: string;
|
|
6
|
-
LogicalExpression: string;
|
|
7
|
-
BinaryExpression: string;
|
|
8
|
-
UnaryExpression: string;
|
|
9
|
-
MemberExpression: string;
|
|
10
|
-
Identifier: string;
|
|
11
|
-
ArrayExpression: string;
|
|
12
|
-
CallExpression: string;
|
|
13
|
-
TemplateLiteral: string;
|
|
14
|
-
TemplateElement: string;
|
|
15
|
-
ConditionalExpression: string;
|
|
16
|
-
SequenceExpression: string;
|
|
17
|
-
};
|
|
18
|
-
export declare enum PropBindType {
|
|
19
|
-
static = "static",
|
|
20
|
-
state = "rematch",
|
|
21
|
-
computed = "computed",
|
|
22
|
-
forItem = "for-item",
|
|
23
|
-
expression = "expression",
|
|
24
|
-
prop = "prop",
|
|
25
|
-
slot = "slot",
|
|
26
|
-
dataVar = "dataVar",
|
|
27
|
-
stateData = "state",
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated
|
|
30
|
-
*/
|
|
31
|
-
paramData = "params",
|
|
32
|
-
params = "params",
|
|
33
|
-
scope = "scope"
|
|
34
|
-
}
|
|
35
|
-
export declare enum ActionType {
|
|
36
|
-
Rematch = "rematch",
|
|
37
|
-
Material = "material",
|
|
38
|
-
GeneralFunc = "general-func",
|
|
39
|
-
LifeCycle = "lifecycle",
|
|
40
|
-
PropEvent = "prop-event",
|
|
41
|
-
HandlerFn = "handler-fn",
|
|
42
|
-
Inline = "inline",
|
|
43
|
-
Platform = "platform",
|
|
44
|
-
DataSource = "dataSource"
|
|
45
|
-
}
|
|
46
|
-
export interface IDynamicValue {
|
|
47
|
-
type: PropBindType;
|
|
48
|
-
value: any;
|
|
49
|
-
extra?: any;
|
|
50
|
-
}
|
|
51
|
-
export interface IDataBind {
|
|
52
|
-
propertyPath: string;
|
|
53
|
-
bindDataPath: string;
|
|
54
|
-
type?: PropBindType;
|
|
55
|
-
extra?: any;
|
|
56
|
-
}
|
|
57
|
-
interface NodeEx extends Node {
|
|
58
|
-
$parent: NodeEx;
|
|
59
|
-
$path: any[];
|
|
60
|
-
expressions: NodeEx[];
|
|
61
|
-
/**
|
|
62
|
-
* LogicalExpression
|
|
63
|
-
*/
|
|
64
|
-
left: NodeEx;
|
|
65
|
-
right: NodeEx;
|
|
66
|
-
/**
|
|
67
|
-
* UnaryExpression
|
|
68
|
-
*/
|
|
69
|
-
operator: string;
|
|
70
|
-
prefix: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* MemberExpression
|
|
73
|
-
*/
|
|
74
|
-
property: NodeEx;
|
|
75
|
-
object: NodeEx;
|
|
76
|
-
computed: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Literal
|
|
79
|
-
*/
|
|
80
|
-
name: string;
|
|
81
|
-
value: any;
|
|
82
|
-
regex: any;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* 检查全局变量静态访问是否符合要求
|
|
86
|
-
* @export
|
|
87
|
-
* @param {*} expression
|
|
88
|
-
*/
|
|
89
|
-
export declare function parseMemberProperty(expression: NodeEx, checkMemberProperty?: (path: any[]) => void): (string | number)[];
|
|
90
|
-
interface IDynamicValueParserOptions {
|
|
91
|
-
type: PropBindType;
|
|
92
|
-
value?: string;
|
|
93
|
-
expression?: any;
|
|
94
|
-
pageId?: string;
|
|
95
|
-
}
|
|
96
|
-
export declare class DynamicValueParser {
|
|
97
|
-
expression: NodeEx;
|
|
98
|
-
expressionString: string;
|
|
99
|
-
options: IDynamicValueParserOptions;
|
|
100
|
-
constructor(expressionString: string, options?: Partial<IDynamicValueParserOptions>);
|
|
101
|
-
/**
|
|
102
|
-
* parser
|
|
103
|
-
*/
|
|
104
|
-
parse(): IDynamicValueParserOptions;
|
|
105
|
-
linkBinaryExpression(expression: NodeEx): void;
|
|
106
|
-
parseBinaryExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
|
|
107
|
-
parseSimpleExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
|
|
108
|
-
parseItemAliseExpression(expression: NodeEx, options: this['options']): this["options"];
|
|
109
|
-
_generatePrefix(memberProperty: (number | string)[], index: number): string;
|
|
110
|
-
_replaceExpression(meta: {
|
|
111
|
-
memberProperty: (number | string)[];
|
|
112
|
-
index: number;
|
|
113
|
-
replacer: string;
|
|
114
|
-
expressionString?: string;
|
|
115
|
-
}): string;
|
|
116
|
-
parseDataset(expression: NodeEx, meta: {
|
|
117
|
-
memberProperty: (number | string)[];
|
|
118
|
-
index: number;
|
|
119
|
-
replacer: string;
|
|
120
|
-
}, options: this['options']): IDynamicValueParserOptions;
|
|
121
|
-
}
|
|
122
|
-
export {};
|
|
1
|
+
import { Node, Options } from 'acorn';
|
|
2
|
+
export declare const PARSE_CONFIG: Options;
|
|
3
|
+
export declare const AST_TYPE: {
|
|
4
|
+
Literal: string;
|
|
5
|
+
ExpressionStatement: string;
|
|
6
|
+
LogicalExpression: string;
|
|
7
|
+
BinaryExpression: string;
|
|
8
|
+
UnaryExpression: string;
|
|
9
|
+
MemberExpression: string;
|
|
10
|
+
Identifier: string;
|
|
11
|
+
ArrayExpression: string;
|
|
12
|
+
CallExpression: string;
|
|
13
|
+
TemplateLiteral: string;
|
|
14
|
+
TemplateElement: string;
|
|
15
|
+
ConditionalExpression: string;
|
|
16
|
+
SequenceExpression: string;
|
|
17
|
+
};
|
|
18
|
+
export declare enum PropBindType {
|
|
19
|
+
static = "static",
|
|
20
|
+
state = "rematch",
|
|
21
|
+
computed = "computed",
|
|
22
|
+
forItem = "for-item",
|
|
23
|
+
expression = "expression",
|
|
24
|
+
prop = "prop",
|
|
25
|
+
slot = "slot",
|
|
26
|
+
dataVar = "dataVar",
|
|
27
|
+
stateData = "state",
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
paramData = "params",
|
|
32
|
+
params = "params",
|
|
33
|
+
scope = "scope"
|
|
34
|
+
}
|
|
35
|
+
export declare enum ActionType {
|
|
36
|
+
Rematch = "rematch",
|
|
37
|
+
Material = "material",
|
|
38
|
+
GeneralFunc = "general-func",
|
|
39
|
+
LifeCycle = "lifecycle",
|
|
40
|
+
PropEvent = "prop-event",
|
|
41
|
+
HandlerFn = "handler-fn",
|
|
42
|
+
Inline = "inline",
|
|
43
|
+
Platform = "platform",
|
|
44
|
+
DataSource = "dataSource"
|
|
45
|
+
}
|
|
46
|
+
export interface IDynamicValue {
|
|
47
|
+
type: PropBindType;
|
|
48
|
+
value: any;
|
|
49
|
+
extra?: any;
|
|
50
|
+
}
|
|
51
|
+
export interface IDataBind {
|
|
52
|
+
propertyPath: string;
|
|
53
|
+
bindDataPath: string;
|
|
54
|
+
type?: PropBindType;
|
|
55
|
+
extra?: any;
|
|
56
|
+
}
|
|
57
|
+
interface NodeEx extends Node {
|
|
58
|
+
$parent: NodeEx;
|
|
59
|
+
$path: any[];
|
|
60
|
+
expressions: NodeEx[];
|
|
61
|
+
/**
|
|
62
|
+
* LogicalExpression
|
|
63
|
+
*/
|
|
64
|
+
left: NodeEx;
|
|
65
|
+
right: NodeEx;
|
|
66
|
+
/**
|
|
67
|
+
* UnaryExpression
|
|
68
|
+
*/
|
|
69
|
+
operator: string;
|
|
70
|
+
prefix: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* MemberExpression
|
|
73
|
+
*/
|
|
74
|
+
property: NodeEx;
|
|
75
|
+
object: NodeEx;
|
|
76
|
+
computed: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Literal
|
|
79
|
+
*/
|
|
80
|
+
name: string;
|
|
81
|
+
value: any;
|
|
82
|
+
regex: any;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 检查全局变量静态访问是否符合要求
|
|
86
|
+
* @export
|
|
87
|
+
* @param {*} expression
|
|
88
|
+
*/
|
|
89
|
+
export declare function parseMemberProperty(expression: NodeEx, checkMemberProperty?: (path: any[]) => void): (string | number)[];
|
|
90
|
+
interface IDynamicValueParserOptions {
|
|
91
|
+
type: PropBindType;
|
|
92
|
+
value?: string;
|
|
93
|
+
expression?: any;
|
|
94
|
+
pageId?: string;
|
|
95
|
+
}
|
|
96
|
+
export declare class DynamicValueParser {
|
|
97
|
+
expression: NodeEx;
|
|
98
|
+
expressionString: string;
|
|
99
|
+
options: IDynamicValueParserOptions;
|
|
100
|
+
constructor(expressionString: string, options?: Partial<IDynamicValueParserOptions>);
|
|
101
|
+
/**
|
|
102
|
+
* parser
|
|
103
|
+
*/
|
|
104
|
+
parse(): IDynamicValueParserOptions;
|
|
105
|
+
linkBinaryExpression(expression: NodeEx): void;
|
|
106
|
+
parseBinaryExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
|
|
107
|
+
parseSimpleExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
|
|
108
|
+
parseItemAliseExpression(expression: NodeEx, options: this['options']): this["options"];
|
|
109
|
+
_generatePrefix(memberProperty: (number | string)[], index: number): string;
|
|
110
|
+
_replaceExpression(meta: {
|
|
111
|
+
memberProperty: (number | string)[];
|
|
112
|
+
index: number;
|
|
113
|
+
replacer: string;
|
|
114
|
+
expressionString?: string;
|
|
115
|
+
}): string;
|
|
116
|
+
parseDataset(expression: NodeEx, meta: {
|
|
117
|
+
memberProperty: (number | string)[];
|
|
118
|
+
index: number;
|
|
119
|
+
replacer: string;
|
|
120
|
+
}, options: this['options']): IDynamicValueParserOptions;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
123
123
|
//# sourceMappingURL=index.d.ts.map
|
|
File without changes
|
|
File without changes
|
package/lib/parser/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './cals/index';
|
|
2
|
-
export { upgrageToVersion2 } from './cals/utils/version';
|
|
3
|
-
export { processComponentModule } from './cals/utils/spinoff';
|
|
4
|
-
export { calsToCode, codeToCals, ICodeItem, checkForConflicts, autoResolveConflicts } from './cals/utils/code';
|
|
5
|
-
export { parseComponentCals } from './cals/utils/block';
|
|
6
|
-
export { ActionType, IDataBind, PropBindType } from './expression/index';
|
|
7
|
-
export { processCommonStyle2CSSProperties, processCSSProperties2Rem, processCSSPropertiesUnit, } from './cals/utils/style';
|
|
8
|
-
export { default as PostcssRpx2Calc } from './plugins/postcss-rpx2clac';
|
|
1
|
+
export * from './cals/index';
|
|
2
|
+
export { upgrageToVersion2 } from './cals/utils/version';
|
|
3
|
+
export { processComponentModule } from './cals/utils/spinoff';
|
|
4
|
+
export { calsToCode, codeToCals, ICodeItem, checkForConflicts, autoResolveConflicts } from './cals/utils/code';
|
|
5
|
+
export { parseComponentCals } from './cals/utils/block';
|
|
6
|
+
export { ActionType, IDataBind, PropBindType } from './expression/index';
|
|
7
|
+
export { processCommonStyle2CSSProperties, processCSSProperties2Rem, processCSSPropertiesUnit, } from './cals/utils/style';
|
|
8
|
+
export { default as PostcssRpx2Calc } from './plugins/postcss-rpx2clac';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
File without changes
|
package/lib/parser/index.js
CHANGED
|
File without changes
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
declare function Plugin(opt?: {
|
|
2
|
-
root?: string;
|
|
3
|
-
zoom?: number;
|
|
4
|
-
precision?: number;
|
|
5
|
-
outUnit?: string;
|
|
6
|
-
exclude?: string;
|
|
7
|
-
}): {
|
|
8
|
-
postcssPlugin: string;
|
|
9
|
-
Once(root: any, { result }: {
|
|
10
|
-
result: any;
|
|
11
|
-
}): void;
|
|
12
|
-
};
|
|
13
|
-
declare namespace Plugin {
|
|
14
|
-
var postcss: boolean;
|
|
15
|
-
var CALC_RPX_ROOT_VAL_NAME: string;
|
|
16
|
-
}
|
|
17
|
-
export default Plugin;
|
|
1
|
+
declare function Plugin(opt?: {
|
|
2
|
+
root?: string;
|
|
3
|
+
zoom?: number;
|
|
4
|
+
precision?: number;
|
|
5
|
+
outUnit?: string;
|
|
6
|
+
exclude?: string;
|
|
7
|
+
}): {
|
|
8
|
+
postcssPlugin: string;
|
|
9
|
+
Once(root: any, { result }: {
|
|
10
|
+
result: any;
|
|
11
|
+
}): void;
|
|
12
|
+
};
|
|
13
|
+
declare namespace Plugin {
|
|
14
|
+
var postcss: boolean;
|
|
15
|
+
var CALC_RPX_ROOT_VAL_NAME: string;
|
|
16
|
+
}
|
|
17
|
+
export default Plugin;
|
|
18
18
|
//# sourceMappingURL=postcss-rpx2clac.d.ts.map
|
|
@@ -50,11 +50,11 @@ function Plugin(opt) {
|
|
|
50
50
|
return str;
|
|
51
51
|
if (num1 == '0')
|
|
52
52
|
return '0';
|
|
53
|
-
const v = +num1 /
|
|
53
|
+
const v = +num1 / zoom;
|
|
54
54
|
if (isNaN(v)) {
|
|
55
55
|
return str;
|
|
56
56
|
}
|
|
57
|
-
const value = Number.isInteger(v) ? v.toString() : toFixed(v, precision
|
|
57
|
+
const value = Number.isInteger(v) ? v.toString() : toFixed(v, precision);
|
|
58
58
|
return `calc(${value}${outUnit}/${rootValue})`;
|
|
59
59
|
});
|
|
60
60
|
}
|
package/lib/types/basic/app.d.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { IListener, IResource } from './common';
|
|
2
|
-
import { IDataSource } from './datasource';
|
|
3
|
-
import { IComponent } from './component';
|
|
4
|
-
export interface IApp {
|
|
5
|
-
/**
|
|
6
|
-
* 必填, 应用名称, 标识
|
|
7
|
-
* @maxLength 214
|
|
8
|
-
* @minLength 1
|
|
9
|
-
* @pattern ^(?:\x40[a-z0-9-*~][a-z0-9-*._~]*\x47)?[a-z0-9-~][a-z0-9-._~]*$
|
|
10
|
-
*/
|
|
11
|
-
name?: string;
|
|
12
|
-
/**
|
|
13
|
-
* 选填, 应用别名
|
|
14
|
-
*/
|
|
15
|
-
label?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 选填, 应用版本
|
|
18
|
-
* version 值应该能够被 node-semver 解析
|
|
19
|
-
*
|
|
20
|
-
* @default 0.1.0
|
|
21
|
-
*/
|
|
22
|
-
version?: string;
|
|
23
|
-
/**
|
|
24
|
-
* 协议版本 semer version
|
|
25
|
-
* x.x.x | latest
|
|
26
|
-
*/
|
|
27
|
-
schemaVersion?: string;
|
|
28
|
-
/**
|
|
29
|
-
* 选填, 应用简介
|
|
30
|
-
*/
|
|
31
|
-
description?: string;
|
|
32
|
-
/**
|
|
33
|
-
* 选填, 应用的入口组件
|
|
34
|
-
*
|
|
35
|
-
* @default home
|
|
36
|
-
*/
|
|
37
|
-
main?: string;
|
|
38
|
-
/**
|
|
39
|
-
* 选填, 应用的作者
|
|
40
|
-
*/
|
|
41
|
-
author?: string;
|
|
42
|
-
/**
|
|
43
|
-
* 可选, 应用的控制属性
|
|
44
|
-
*/
|
|
45
|
-
attributes?: Record<string, any>;
|
|
46
|
-
/**
|
|
47
|
-
* 可选, 应用事件信息
|
|
48
|
-
*/
|
|
49
|
-
events?: any;
|
|
50
|
-
/**
|
|
51
|
-
* 必填, 应用的组件集合
|
|
52
|
-
*/
|
|
53
|
-
items: IComponent[];
|
|
54
|
-
/**
|
|
55
|
-
* 可选, 数据源集合
|
|
56
|
-
*/
|
|
57
|
-
dataSources?: IDataSource[];
|
|
58
|
-
/**
|
|
59
|
-
* 可选, 应用的资源集合
|
|
60
|
-
*
|
|
61
|
-
* 例如, 代码片段、组件库、静态资源
|
|
62
|
-
*/
|
|
63
|
-
resources?: IResource[];
|
|
64
|
-
/**
|
|
65
|
-
* 可选, 应用绑定的监听器
|
|
66
|
-
*/
|
|
67
|
-
listeners?: IListener[];
|
|
68
|
-
/**
|
|
69
|
-
* 可选, 扩展字段, 尽量避免用
|
|
70
|
-
*/
|
|
71
|
-
extra?: any;
|
|
72
|
-
}
|
|
1
|
+
import { IListener, IResource } from './common';
|
|
2
|
+
import { IDataSource } from './datasource';
|
|
3
|
+
import { IComponent } from './component';
|
|
4
|
+
export interface IApp {
|
|
5
|
+
/**
|
|
6
|
+
* 必填, 应用名称, 标识
|
|
7
|
+
* @maxLength 214
|
|
8
|
+
* @minLength 1
|
|
9
|
+
* @pattern ^(?:\x40[a-z0-9-*~][a-z0-9-*._~]*\x47)?[a-z0-9-~][a-z0-9-._~]*$
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 选填, 应用别名
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 选填, 应用版本
|
|
18
|
+
* version 值应该能够被 node-semver 解析
|
|
19
|
+
*
|
|
20
|
+
* @default 0.1.0
|
|
21
|
+
*/
|
|
22
|
+
version?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 协议版本 semer version
|
|
25
|
+
* x.x.x | latest
|
|
26
|
+
*/
|
|
27
|
+
schemaVersion?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 选填, 应用简介
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 选填, 应用的入口组件
|
|
34
|
+
*
|
|
35
|
+
* @default home
|
|
36
|
+
*/
|
|
37
|
+
main?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 选填, 应用的作者
|
|
40
|
+
*/
|
|
41
|
+
author?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 可选, 应用的控制属性
|
|
44
|
+
*/
|
|
45
|
+
attributes?: Record<string, any>;
|
|
46
|
+
/**
|
|
47
|
+
* 可选, 应用事件信息
|
|
48
|
+
*/
|
|
49
|
+
events?: any;
|
|
50
|
+
/**
|
|
51
|
+
* 必填, 应用的组件集合
|
|
52
|
+
*/
|
|
53
|
+
items: IComponent[];
|
|
54
|
+
/**
|
|
55
|
+
* 可选, 数据源集合
|
|
56
|
+
*/
|
|
57
|
+
dataSources?: IDataSource[];
|
|
58
|
+
/**
|
|
59
|
+
* 可选, 应用的资源集合
|
|
60
|
+
*
|
|
61
|
+
* 例如, 代码片段、组件库、静态资源
|
|
62
|
+
*/
|
|
63
|
+
resources?: IResource[];
|
|
64
|
+
/**
|
|
65
|
+
* 可选, 应用绑定的监听器
|
|
66
|
+
*/
|
|
67
|
+
listeners?: IListener[];
|
|
68
|
+
/**
|
|
69
|
+
* 可选, 扩展字段, 尽量避免用
|
|
70
|
+
*/
|
|
71
|
+
extra?: any;
|
|
72
|
+
}
|
|
73
73
|
//# sourceMappingURL=app.d.ts.map
|
|
File without changes
|
package/lib/types/basic/app.js
CHANGED
|
File without changes
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
export interface IResource extends Record<string, any> {
|
|
2
|
-
/**
|
|
3
|
-
* 必填,资源名
|
|
4
|
-
*/
|
|
5
|
-
name: string;
|
|
6
|
-
/**
|
|
7
|
-
* 必填,资源类型
|
|
8
|
-
*/
|
|
9
|
-
type: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* 应用/组件 绑定的监听器
|
|
13
|
-
*/
|
|
14
|
-
export interface IListener {
|
|
15
|
-
/**
|
|
16
|
-
* 可选,listener id
|
|
17
|
-
*/
|
|
18
|
-
id?: string;
|
|
19
|
-
/**
|
|
20
|
-
* 可选,是否在捕获阶段响应
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
isCapturePhase?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 可选, 监听器类型
|
|
26
|
-
*/
|
|
27
|
-
type?: string;
|
|
28
|
-
/**
|
|
29
|
-
* 可选, 绑定的处理器
|
|
30
|
-
*/
|
|
31
|
-
handler?: IHandler;
|
|
32
|
-
/**
|
|
33
|
-
* 必填, 监听的事件名, 来源于 IEvents 定义的事件
|
|
34
|
-
*/
|
|
35
|
-
eventName: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 监听器触发的处理器
|
|
39
|
-
*/
|
|
40
|
-
export interface IHandler {
|
|
41
|
-
/**
|
|
42
|
-
* 必填, 处理器的名称
|
|
43
|
-
*/
|
|
44
|
-
name: string;
|
|
45
|
-
/**
|
|
46
|
-
* 可选, 处理器所属的模块
|
|
47
|
-
*/
|
|
48
|
-
module?: string;
|
|
49
|
-
/**
|
|
50
|
-
* 可选, 处理器的入参
|
|
51
|
-
*/
|
|
52
|
-
params?: object;
|
|
53
|
-
}
|
|
54
|
-
/** 变量 */
|
|
55
|
-
export interface IDataset {
|
|
56
|
-
/** 状态 */
|
|
57
|
-
state?: Record<string, IStateVariable | any>;
|
|
58
|
-
/** 页面/应用 参数 */
|
|
59
|
-
params?: Record<string, IParamsVariable>;
|
|
60
|
-
/**
|
|
61
|
-
* 可选,页面配置名称
|
|
62
|
-
* @deprecated 请使用页面 attributes.title 代替
|
|
63
|
-
*/
|
|
64
|
-
pageName?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface IStateVariable {
|
|
67
|
-
/** 中文名 */
|
|
68
|
-
label?: string;
|
|
69
|
-
/** 变量类型 */
|
|
70
|
-
varType: 'state';
|
|
71
|
-
/**
|
|
72
|
-
* 原始数据类型
|
|
73
|
-
* string, number, object, array, boolean
|
|
74
|
-
*/
|
|
75
|
-
dataType: string;
|
|
76
|
-
/** 初始值 */
|
|
77
|
-
initialValue: any;
|
|
78
|
-
}
|
|
79
|
-
/** 页面参数定义 */
|
|
80
|
-
export interface IParamsVariable {
|
|
81
|
-
/** 中文名 */
|
|
82
|
-
label: string;
|
|
83
|
-
/** 是否必填, 默认 false */
|
|
84
|
-
required?: boolean;
|
|
85
|
-
/** 无需类型, 默认数据类型均为 string */
|
|
86
|
-
/** 示例值, ide 开发时使用 */
|
|
87
|
-
sampleValue?: string;
|
|
88
|
-
}
|
|
1
|
+
export interface IResource extends Record<string, any> {
|
|
2
|
+
/**
|
|
3
|
+
* 必填,资源名
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* 必填,资源类型
|
|
8
|
+
*/
|
|
9
|
+
type: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 应用/组件 绑定的监听器
|
|
13
|
+
*/
|
|
14
|
+
export interface IListener {
|
|
15
|
+
/**
|
|
16
|
+
* 可选,listener id
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 可选,是否在捕获阶段响应
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
isCapturePhase?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 可选, 监听器类型
|
|
26
|
+
*/
|
|
27
|
+
type?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 可选, 绑定的处理器
|
|
30
|
+
*/
|
|
31
|
+
handler?: IHandler;
|
|
32
|
+
/**
|
|
33
|
+
* 必填, 监听的事件名, 来源于 IEvents 定义的事件
|
|
34
|
+
*/
|
|
35
|
+
eventName: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 监听器触发的处理器 handler中可查询 诸如数据源信息以及各种事件信息
|
|
39
|
+
*/
|
|
40
|
+
export interface IHandler {
|
|
41
|
+
/**
|
|
42
|
+
* 必填, 处理器的名称
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* 可选, 处理器所属的模块
|
|
47
|
+
*/
|
|
48
|
+
module?: string;
|
|
49
|
+
/**
|
|
50
|
+
* 可选, 处理器的入参
|
|
51
|
+
*/
|
|
52
|
+
params?: object;
|
|
53
|
+
}
|
|
54
|
+
/** 变量 */
|
|
55
|
+
export interface IDataset {
|
|
56
|
+
/** 状态 */
|
|
57
|
+
state?: Record<string, IStateVariable | any>;
|
|
58
|
+
/** 页面/应用 参数 */
|
|
59
|
+
params?: Record<string, IParamsVariable>;
|
|
60
|
+
/**
|
|
61
|
+
* 可选,页面配置名称
|
|
62
|
+
* @deprecated 请使用页面 attributes.title 代替
|
|
63
|
+
*/
|
|
64
|
+
pageName?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IStateVariable {
|
|
67
|
+
/** 中文名 */
|
|
68
|
+
label?: string;
|
|
69
|
+
/** 变量类型 */
|
|
70
|
+
varType: 'state';
|
|
71
|
+
/**
|
|
72
|
+
* 原始数据类型
|
|
73
|
+
* string, number, object, array, boolean
|
|
74
|
+
*/
|
|
75
|
+
dataType: string;
|
|
76
|
+
/** 初始值 */
|
|
77
|
+
initialValue: any;
|
|
78
|
+
}
|
|
79
|
+
/** 页面参数定义 */
|
|
80
|
+
export interface IParamsVariable {
|
|
81
|
+
/** 中文名 */
|
|
82
|
+
label: string;
|
|
83
|
+
/** 是否必填, 默认 false */
|
|
84
|
+
required?: boolean;
|
|
85
|
+
/** 无需类型, 默认数据类型均为 string */
|
|
86
|
+
/** 示例值, ide 开发时使用 */
|
|
87
|
+
sampleValue?: string;
|
|
88
|
+
}
|
|
89
89
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/basic/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/basic/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,SAAS;AACT,MAAM,WAAW,QAAQ;IACvB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;IAC7C,eAAe;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU;IACV,YAAY,EAAE,GAAG,CAAC;CACnB;AAED,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,UAAU;IACV,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAE5B,qBAAqB;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
File without changes
|