@oinone/kunlun-meta 6.2.0
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/dist/oinone-kunlun-meta.esm.js +496 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/src/element/ActionElement.d.ts +15 -0
- package/dist/types/src/element/ApiElement.d.ts +21 -0
- package/dist/types/src/element/ClearElement.d.ts +9 -0
- package/dist/types/src/element/ConfigElement.d.ts +6 -0
- package/dist/types/src/element/ContextElement.d.ts +9 -0
- package/dist/types/src/element/CustomElement.d.ts +7 -0
- package/dist/types/src/element/FieldElement.d.ts +25 -0
- package/dist/types/src/element/IBaseElement.d.ts +5 -0
- package/dist/types/src/element/PropElement.d.ts +6 -0
- package/dist/types/src/element/RequestElement.d.ts +9 -0
- package/dist/types/src/element/ResponseElement.d.ts +9 -0
- package/dist/types/src/element/SubscribeElement.d.ts +9 -0
- package/dist/types/src/element/ValidationElement.d.ts +12 -0
- package/dist/types/src/element/ViewElement.d.ts +15 -0
- package/dist/types/src/element/WidgetElement.d.ts +23 -0
- package/dist/types/src/element/index.d.ts +14 -0
- package/dist/types/src/global-config/index.d.ts +2 -0
- package/dist/types/src/global-config/runtime-config.d.ts +14 -0
- package/dist/types/src/global-config/type.d.ts +26 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/metadata/constant/config.d.ts +1 -0
- package/dist/types/src/metadata/constant/index.d.ts +2 -0
- package/dist/types/src/metadata/constant/module-name.d.ts +20 -0
- package/dist/types/src/metadata/fragment/action.d.ts +6 -0
- package/dist/types/src/metadata/fragment/field.d.ts +2 -0
- package/dist/types/src/metadata/fragment/func.d.ts +2 -0
- package/dist/types/src/metadata/fragment/index.d.ts +13 -0
- package/dist/types/src/metadata/fragment/menu.d.ts +2 -0
- package/dist/types/src/metadata/fragment/model.d.ts +2 -0
- package/dist/types/src/metadata/fragment/page.d.ts +2 -0
- package/dist/types/src/metadata/index.d.ts +4 -0
- package/dist/types/src/metadata/runtime-fragment/action.d.ts +8 -0
- package/dist/types/src/metadata/runtime-fragment/function.d.ts +3 -0
- package/dist/types/src/metadata/runtime-fragment/index.d.ts +20 -0
- package/dist/types/src/metadata/runtime-fragment/model.d.ts +2 -0
- package/dist/types/src/metadata/runtime-fragment/module.d.ts +2 -0
- package/dist/types/src/metadata/runtime-fragment/view.d.ts +6 -0
- package/dist/types/src/metadata/types/dsl-node.d.ts +12 -0
- package/dist/types/src/metadata/types/enumeration.d.ts +18 -0
- package/dist/types/src/metadata/types/index.d.ts +8 -0
- package/dist/types/src/metadata/types/layout.d.ts +4 -0
- package/dist/types/src/metadata/types/model.d.ts +573 -0
- package/dist/types/src/metadata/types/tag.d.ts +23 -0
- package/dist/types/src/metadata/types/user.d.ts +22 -0
- package/dist/types/src/metadata/types/value.d.ts +3 -0
- package/dist/types/src/metadata/types/view.d.ts +170 -0
- package/dist/types/src/plugin-loader/factory/PluginLoaderFactory.d.ts +4 -0
- package/dist/types/src/plugin-loader/factory/index.d.ts +1 -0
- package/dist/types/src/plugin-loader/index.d.ts +5 -0
- package/dist/types/src/plugin-loader/loader/CJSPluginLoader.d.ts +7 -0
- package/dist/types/src/plugin-loader/loader/CSSPluginLoader.d.ts +7 -0
- package/dist/types/src/plugin-loader/loader/ESMPluginLoader.d.ts +7 -0
- package/dist/types/src/plugin-loader/loader/IIFEPluginLoader.d.ts +7 -0
- package/dist/types/src/plugin-loader/loader/LoadedEvent.d.ts +4 -0
- package/dist/types/src/plugin-loader/loader/PluginLoader.d.ts +5 -0
- package/dist/types/src/plugin-loader/loader/RemotePluginLoader.d.ts +5 -0
- package/dist/types/src/plugin-loader/loader/UMDPluginLoader.d.ts +6 -0
- package/dist/types/src/plugin-loader/loader/index.d.ts +1 -0
- package/dist/types/src/plugin-loader/typing/index.d.ts +2 -0
- package/dist/types/src/plugin-loader/typing/load-option.d.ts +48 -0
- package/dist/types/src/plugin-loader/typing/loader-config.d.ts +38 -0
- package/dist/types/src/plugin-loader/util/PluginLoadHelper.d.ts +7 -0
- package/dist/types/src/plugin-loader/util/index.d.ts +1 -0
- package/dist/types/src/util/element.d.ts +16 -0
- package/dist/types/src/util/field.d.ts +7 -0
- package/dist/types/src/util/helper.d.ts +2 -0
- package/dist/types/src/util/index.d.ts +6 -0
- package/dist/types/src/util/ke-common.d.ts +6 -0
- package/dist/types/src/util/lang.d.ts +4 -0
- package/dist/types/src/util/validation-utils.d.ts +3 -0
- package/index.ts +1 -0
- package/package.json +17 -0
- package/rollup.config.js +4 -0
- package/src/element/ActionElement.ts +20 -0
- package/src/element/ApiElement.ts +22 -0
- package/src/element/ClearElement.ts +10 -0
- package/src/element/ConfigElement.ts +7 -0
- package/src/element/ContextElement.ts +10 -0
- package/src/element/CustomElement.ts +22 -0
- package/src/element/FieldElement.ts +41 -0
- package/src/element/IBaseElement.ts +5 -0
- package/src/element/PropElement.ts +7 -0
- package/src/element/RequestElement.ts +10 -0
- package/src/element/ResponseElement.ts +10 -0
- package/src/element/SubscribeElement.ts +10 -0
- package/src/element/ValidationElement.ts +17 -0
- package/src/element/ViewElement.ts +23 -0
- package/src/element/WidgetElement.ts +33 -0
- package/src/element/index.ts +14 -0
- package/src/global-config/index.ts +2 -0
- package/src/global-config/runtime-config.ts +83 -0
- package/src/global-config/type.ts +48 -0
- package/src/index.ts +5 -0
- package/src/metadata/constant/config.ts +1 -0
- package/src/metadata/constant/index.ts +2 -0
- package/src/metadata/constant/module-name.ts +21 -0
- package/src/metadata/fragment/action.ts +119 -0
- package/src/metadata/fragment/field.ts +42 -0
- package/src/metadata/fragment/func.ts +21 -0
- package/src/metadata/fragment/index.ts +20 -0
- package/src/metadata/fragment/menu.ts +35 -0
- package/src/metadata/fragment/model.ts +76 -0
- package/src/metadata/fragment/page.ts +17 -0
- package/src/metadata/index.ts +4 -0
- package/src/metadata/runtime-fragment/action.ts +159 -0
- package/src/metadata/runtime-fragment/function.ts +25 -0
- package/src/metadata/runtime-fragment/index.ts +36 -0
- package/src/metadata/runtime-fragment/model.ts +18 -0
- package/src/metadata/runtime-fragment/module.ts +11 -0
- package/src/metadata/runtime-fragment/view.ts +44 -0
- package/src/metadata/types/dsl-node.ts +14 -0
- package/src/metadata/types/enumeration.ts +19 -0
- package/src/metadata/types/index.ts +8 -0
- package/src/metadata/types/layout.ts +4 -0
- package/src/metadata/types/model.ts +823 -0
- package/src/metadata/types/tag.ts +24 -0
- package/src/metadata/types/user.ts +27 -0
- package/src/metadata/types/value.ts +3 -0
- package/src/metadata/types/view.ts +194 -0
- package/src/plugin-loader/factory/PluginLoaderFactory.ts +23 -0
- package/src/plugin-loader/factory/index.ts +1 -0
- package/src/plugin-loader/index.ts +33 -0
- package/src/plugin-loader/loader/CJSPluginLoader.ts +18 -0
- package/src/plugin-loader/loader/CSSPluginLoader.ts +29 -0
- package/src/plugin-loader/loader/ESMPluginLoader.ts +53 -0
- package/src/plugin-loader/loader/IIFEPluginLoader.ts +18 -0
- package/src/plugin-loader/loader/LoadedEvent.ts +24 -0
- package/src/plugin-loader/loader/PluginLoader.ts +12 -0
- package/src/plugin-loader/loader/RemotePluginLoader.ts +54 -0
- package/src/plugin-loader/loader/UMDPluginLoader.ts +50 -0
- package/src/plugin-loader/loader/index.ts +1 -0
- package/src/plugin-loader/typing/index.ts +2 -0
- package/src/plugin-loader/typing/load-option.ts +51 -0
- package/src/plugin-loader/typing/loader-config.ts +38 -0
- package/src/plugin-loader/util/PluginLoadHelper.ts +70 -0
- package/src/plugin-loader/util/index.ts +1 -0
- package/src/util/element.ts +154 -0
- package/src/util/field.ts +63 -0
- package/src/util/helper.ts +6 -0
- package/src/util/index.ts +6 -0
- package/src/util/ke-common.ts +25 -0
- package/src/util/lang.ts +8 -0
- package/src/util/validation-utils.ts +17 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { BIGINT, EntityId } from './value';
|
|
2
|
+
export declare type ViewId = EntityId;
|
|
3
|
+
export declare enum DataClass {
|
|
4
|
+
List = "LIST",
|
|
5
|
+
Object = "OBJECT"
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 视图客户端类型
|
|
9
|
+
*/
|
|
10
|
+
export declare enum ViewClientType {
|
|
11
|
+
/**
|
|
12
|
+
* PC端
|
|
13
|
+
*/
|
|
14
|
+
PC = "PC",
|
|
15
|
+
/**
|
|
16
|
+
* 移动端
|
|
17
|
+
*/
|
|
18
|
+
MOBILE = "MOBILE"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* <h3>视图类型</h3>
|
|
22
|
+
* <p>
|
|
23
|
+
* 视图类型是描述数据类型、数据传递、数据交互的基本属性
|
|
24
|
+
* </p>
|
|
25
|
+
*/
|
|
26
|
+
export declare enum ViewType {
|
|
27
|
+
/**
|
|
28
|
+
* 表格
|
|
29
|
+
*/
|
|
30
|
+
Table = "TABLE",
|
|
31
|
+
/**
|
|
32
|
+
* 表单
|
|
33
|
+
*/
|
|
34
|
+
Form = "FORM",
|
|
35
|
+
/**
|
|
36
|
+
* 详情
|
|
37
|
+
*/
|
|
38
|
+
Detail = "DETAIL",
|
|
39
|
+
/**
|
|
40
|
+
* 搜索
|
|
41
|
+
*/
|
|
42
|
+
Search = "SEARCH",
|
|
43
|
+
/**
|
|
44
|
+
* 画廊
|
|
45
|
+
*/
|
|
46
|
+
Gallery = "GALLERY",
|
|
47
|
+
/**
|
|
48
|
+
* 树
|
|
49
|
+
*/
|
|
50
|
+
Tree = "TREE",
|
|
51
|
+
/**
|
|
52
|
+
* 多视图
|
|
53
|
+
*/
|
|
54
|
+
Multiple = "MULTIPLE",
|
|
55
|
+
/**
|
|
56
|
+
* 自定义
|
|
57
|
+
*/
|
|
58
|
+
Custom = "CUSTOM"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* <h3>视图模式</h3>
|
|
62
|
+
* <p>
|
|
63
|
+
* 视图模式是视图类型更具备操作性的定义,相同的视图类型会有不同模式进行描述。
|
|
64
|
+
* <p>例如:</p>
|
|
65
|
+
* <ul>
|
|
66
|
+
* <li>【表单】视图类型可能会存在【创建】和【编辑】两种不同的模式</li>
|
|
67
|
+
* <li>【表单】视图类型可能会在某些情况下手动修改为【只读】状态</li>
|
|
68
|
+
* </ul>
|
|
69
|
+
* </p>
|
|
70
|
+
*/
|
|
71
|
+
export declare enum ViewMode {
|
|
72
|
+
/**
|
|
73
|
+
* 创建
|
|
74
|
+
*/
|
|
75
|
+
Create = "CREATE",
|
|
76
|
+
/**
|
|
77
|
+
* 编辑
|
|
78
|
+
*/
|
|
79
|
+
Editor = "EDITOR",
|
|
80
|
+
/**
|
|
81
|
+
* 查看
|
|
82
|
+
*/
|
|
83
|
+
Lookup = "LOOKUP"
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 跳转动作路由类型
|
|
87
|
+
*/
|
|
88
|
+
export declare enum ViewActionTarget {
|
|
89
|
+
/**
|
|
90
|
+
* 页面路由
|
|
91
|
+
*/
|
|
92
|
+
Router = "ROUTER",
|
|
93
|
+
/**
|
|
94
|
+
* 页面弹窗
|
|
95
|
+
*/
|
|
96
|
+
Dialog = "DIALOG",
|
|
97
|
+
/**
|
|
98
|
+
* 页面抽屉
|
|
99
|
+
*/
|
|
100
|
+
Drawer = "DRAWER",
|
|
101
|
+
/**
|
|
102
|
+
* 页内路由
|
|
103
|
+
*/
|
|
104
|
+
Inner = "INNER",
|
|
105
|
+
/**
|
|
106
|
+
* 打开新窗口
|
|
107
|
+
*/
|
|
108
|
+
OpenWindow = "OPEN_WINDOW",
|
|
109
|
+
/**
|
|
110
|
+
* 页面嵌入
|
|
111
|
+
*/
|
|
112
|
+
Frame = "iframe"
|
|
113
|
+
}
|
|
114
|
+
export declare enum SystemSource {
|
|
115
|
+
SYSTEM = "SYSTEM",
|
|
116
|
+
BASE = "BASE",
|
|
117
|
+
MANUAL = "MANUAL",
|
|
118
|
+
UI = "UI",
|
|
119
|
+
RELATION = "RELATION",
|
|
120
|
+
ABSTRACT_INHERITED = "ABSTRACT_INHERITED",
|
|
121
|
+
TRANSIENT_INHERITED = "TRANSIENT_INHERITED",
|
|
122
|
+
EXTEND_INHERITED = "EXTEND_INHERITED",
|
|
123
|
+
MULTI_TABLE_INHERITED = "MULTI_TABLE_INHERITED",
|
|
124
|
+
PROXY_INHERITED = "PROXY_INHERITED"
|
|
125
|
+
}
|
|
126
|
+
export interface IView {
|
|
127
|
+
id: ViewId;
|
|
128
|
+
name: string;
|
|
129
|
+
type: ViewType;
|
|
130
|
+
model: string;
|
|
131
|
+
priority: BIGINT;
|
|
132
|
+
template: string;
|
|
133
|
+
active?: any;
|
|
134
|
+
title?: string;
|
|
135
|
+
systemSource?: SystemSource;
|
|
136
|
+
moduleDisplayName?: SystemSource;
|
|
137
|
+
extension?: Record<string, string>;
|
|
138
|
+
modelDefinition?: {
|
|
139
|
+
model?: string;
|
|
140
|
+
name?: string;
|
|
141
|
+
moduleName?: string;
|
|
142
|
+
module?: string;
|
|
143
|
+
};
|
|
144
|
+
baseLayoutName?: string;
|
|
145
|
+
baseLayoutDefinition?: {
|
|
146
|
+
name: string;
|
|
147
|
+
template: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* 组件的标签内的 <config /> 配置
|
|
152
|
+
*/
|
|
153
|
+
export interface IBaseWidgetConfig {
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 视图组件基础配置
|
|
157
|
+
*/
|
|
158
|
+
export interface IViewWidgetConfig extends IBaseWidgetConfig {
|
|
159
|
+
submit?: string;
|
|
160
|
+
excludedActions?: string;
|
|
161
|
+
validateTip?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* select组件配置
|
|
165
|
+
*/
|
|
166
|
+
export interface IBaseSelectWidgetConfig extends IBaseWidgetConfig {
|
|
167
|
+
searchField?: string;
|
|
168
|
+
labelField?: string;
|
|
169
|
+
separator?: string;
|
|
170
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PluginLoaderFactory';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginLoader, PluginLoadOption } from '../typing';
|
|
2
|
+
export declare class CJSPluginLoader implements PluginLoader {
|
|
3
|
+
static readonly INSTANCE: CJSPluginLoader;
|
|
4
|
+
private constructor();
|
|
5
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
6
|
+
loadDependencies(dependencies: Record<string, unknown>): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginLoader, PluginLoadOption } from '../typing';
|
|
2
|
+
export declare class CSSPluginLoader implements PluginLoader {
|
|
3
|
+
static readonly INSTANCE: CSSPluginLoader;
|
|
4
|
+
private constructor();
|
|
5
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
6
|
+
loadDependencies(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginLoader, PluginLoadOption } from '../typing';
|
|
2
|
+
export declare class ESMPluginLoader implements PluginLoader {
|
|
3
|
+
static readonly INSTANCE: ESMPluginLoader;
|
|
4
|
+
private constructor();
|
|
5
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
6
|
+
loadDependencies(dependencies: Record<string, unknown>): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginLoader, PluginLoadOption } from '../typing';
|
|
2
|
+
export declare class IIFEPluginLoader implements PluginLoader {
|
|
3
|
+
static readonly INSTANCE: IIFEPluginLoader;
|
|
4
|
+
private constructor();
|
|
5
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
6
|
+
loadDependencies(dependencies: Record<string, unknown>): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginLoader, PluginLoadOption } from '../typing';
|
|
2
|
+
export declare class UMDPluginLoader implements PluginLoader {
|
|
3
|
+
static readonly INSTANCE: UMDPluginLoader;
|
|
4
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
5
|
+
loadDependencies(dependencies: Record<string, unknown>): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PluginLoader';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件加载类型
|
|
3
|
+
*/
|
|
4
|
+
export declare type PluginLoadType = 'esm' | 'cjs' | 'umd' | 'iife' | 'css';
|
|
5
|
+
/**
|
|
6
|
+
* Javascript插件
|
|
7
|
+
* default type: umd
|
|
8
|
+
*/
|
|
9
|
+
export declare type JavascriptPlugin = string | {
|
|
10
|
+
type: PluginLoadType;
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* CSS插件
|
|
15
|
+
* type: css
|
|
16
|
+
*/
|
|
17
|
+
export declare type CSSPlugin = string;
|
|
18
|
+
/**
|
|
19
|
+
* key: module
|
|
20
|
+
* value: global name or module
|
|
21
|
+
*/
|
|
22
|
+
declare type PluginLoadDependencies = Record<string, unknown>;
|
|
23
|
+
export interface PluginLoadOption {
|
|
24
|
+
id: string;
|
|
25
|
+
type: PluginLoadType;
|
|
26
|
+
path: string;
|
|
27
|
+
dependencies?: PluginLoadDependencies;
|
|
28
|
+
}
|
|
29
|
+
export interface RemoteLoadOption {
|
|
30
|
+
javascript?: JavascriptPlugin[];
|
|
31
|
+
css?: CSSPlugin[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 加载器
|
|
35
|
+
*/
|
|
36
|
+
export interface PluginLoader {
|
|
37
|
+
/**
|
|
38
|
+
* 通过加载可选项进行加载
|
|
39
|
+
* @param option
|
|
40
|
+
*/
|
|
41
|
+
load(option: PluginLoadOption): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* 依赖加载
|
|
44
|
+
* @param dependencies 加载依赖
|
|
45
|
+
*/
|
|
46
|
+
loadDependencies(dependencies: PluginLoadDependencies): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CSSPlugin, JavascriptPlugin, PluginLoadType } from './load-option';
|
|
2
|
+
/**
|
|
3
|
+
* 插件加载依赖
|
|
4
|
+
*/
|
|
5
|
+
export declare type PluginLoadDependency = {
|
|
6
|
+
/**
|
|
7
|
+
* 插件加载类型
|
|
8
|
+
*/
|
|
9
|
+
type: PluginLoadType;
|
|
10
|
+
/**
|
|
11
|
+
* 依赖项
|
|
12
|
+
*/
|
|
13
|
+
dependencies: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 插件加载依赖
|
|
17
|
+
*/
|
|
18
|
+
export declare type PluginLoadDependencies = Record<string, unknown> | PluginLoadDependency[];
|
|
19
|
+
/**
|
|
20
|
+
* 插件加载配置
|
|
21
|
+
*/
|
|
22
|
+
export interface PluginsLoaderConfig {
|
|
23
|
+
/**
|
|
24
|
+
* 动态指定依赖(未实现)
|
|
25
|
+
*/
|
|
26
|
+
dependencies?: PluginLoadDependencies;
|
|
27
|
+
/**
|
|
28
|
+
* 挂载指定外部js和css;数组默认使用js加载
|
|
29
|
+
*/
|
|
30
|
+
mounted?: JavascriptPlugin[] | {
|
|
31
|
+
js?: JavascriptPlugin[];
|
|
32
|
+
css?: CSSPlugin[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 使用低无一体组件;默认为false
|
|
36
|
+
*/
|
|
37
|
+
usingRemote?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CSSPlugin, JavascriptPlugin, PluginLoadDependencies } from '../typing';
|
|
2
|
+
export declare class PluginLoadHelper {
|
|
3
|
+
private constructor();
|
|
4
|
+
static loadDependencies(dependencies: PluginLoadDependencies): Promise<void>;
|
|
5
|
+
static loadJavascript(plugins: JavascriptPlugin[]): Promise<void>;
|
|
6
|
+
static loadCSS(paths: CSSPlugin[]): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PluginLoadHelper';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionElement, ApiElement, FieldElement, PropElement, ViewElement } from '../element';
|
|
2
|
+
import { IModelField, IDslNode } from '../metadata';
|
|
3
|
+
declare const createViewElement: (dslNode: IDslNode | undefined) => ViewElement | null;
|
|
4
|
+
declare const createPropElements: (parentNode: IDslNode | undefined) => PropElement[];
|
|
5
|
+
declare const createFieldElement: (fieldNode: IDslNode | undefined) => FieldElement;
|
|
6
|
+
declare const createFieldElements: (parentNode: IDslNode | undefined) => FieldElement[];
|
|
7
|
+
/**
|
|
8
|
+
* 创建action元素
|
|
9
|
+
* @param actionNode
|
|
10
|
+
* @param parentDslNode actionNode所在的父节点
|
|
11
|
+
*/
|
|
12
|
+
declare const createActionElement: (actionNode: IDslNode, parentDslNode: IDslNode) => ActionElement;
|
|
13
|
+
declare const createApiElement: (parentDslNode: IDslNode, apiName: string, dslFields?: IModelField[] | undefined) => ApiElement | null;
|
|
14
|
+
declare const fieldElement2ModelField: (fieldElement: FieldElement) => IModelField;
|
|
15
|
+
declare const modelField2fieldElement: (modelField: IModelField) => FieldElement;
|
|
16
|
+
export { createViewElement, createApiElement, createPropElements, createFieldElements, createActionElement, createFieldElement, fieldElement2ModelField, modelField2fieldElement };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IModelField, ModelFieldType } from '../metadata/types';
|
|
2
|
+
declare const isSimpleField: (field: IModelField) => boolean;
|
|
3
|
+
declare const isComplexTtype: (ttype: ModelFieldType) => boolean;
|
|
4
|
+
declare const isDateTtype: (ttype: ModelFieldType) => boolean;
|
|
5
|
+
declare const isNumberTtype: (ttype: ModelFieldType) => boolean;
|
|
6
|
+
declare const isStringTtype: (ttype: ModelFieldType) => boolean;
|
|
7
|
+
export { isSimpleField, isComplexTtype, isDateTtype, isNumberTtype, isStringTtype };
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oinone/kunlun-meta",
|
|
3
|
+
"version": "6.2.0",
|
|
4
|
+
"main": "index.ts",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prebuild": "rimraf dist",
|
|
7
|
+
"build": "rollup -c",
|
|
8
|
+
"dist": "npm run prepublishOnly",
|
|
9
|
+
"index": "npm run postpublish",
|
|
10
|
+
"x-prepublishOnly": "node ../../scripts/prepublish-only.js",
|
|
11
|
+
"x-postpublish": "node ../../scripts/postpublish.js"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@oinone/kunlun-request": "6.2.0"
|
|
15
|
+
},
|
|
16
|
+
"gitHead": "b65bbf1d649da1017810c5608473d5daa1a41f94"
|
|
17
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IBaseElement } from './IBaseElement';
|
|
2
|
+
import { ApiElement } from './ApiElement';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 动作按钮
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface ActionElement extends IBaseElement {
|
|
9
|
+
displayName: string;
|
|
10
|
+
model: string;
|
|
11
|
+
refs: string;
|
|
12
|
+
// 生效规则
|
|
13
|
+
rule: string;
|
|
14
|
+
// view
|
|
15
|
+
type: string;
|
|
16
|
+
// 提交数据的处理api
|
|
17
|
+
submitApi: string;
|
|
18
|
+
api: ApiElement;
|
|
19
|
+
}
|
|
20
|
+
export { ActionElement };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IBaseElement } from './IBaseElement';
|
|
2
|
+
import { LoadType } from '../metadata';
|
|
3
|
+
import { ContextElement } from './ContextElement';
|
|
4
|
+
import { RequestElement } from './RequestElement';
|
|
5
|
+
import { ResponseElement } from './ResponseElement';
|
|
6
|
+
import { ClearElement } from './ClearElement';
|
|
7
|
+
import { ValidationElement } from './ValidationElement';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 自定义api
|
|
11
|
+
*/
|
|
12
|
+
interface ApiElement extends IBaseElement {
|
|
13
|
+
model: string;
|
|
14
|
+
fun: string;
|
|
15
|
+
type: LoadType;
|
|
16
|
+
context: ContextElement;
|
|
17
|
+
request: RequestElement;
|
|
18
|
+
response: ResponseElement;
|
|
19
|
+
clear: ClearElement;
|
|
20
|
+
validation: ValidationElement;
|
|
21
|
+
}
|
|
22
|
+
export { ApiElement };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IBaseElement } from './IBaseElement';
|
|
2
|
+
|
|
3
|
+
export abstract class CustomElement {
|
|
4
|
+
private static nameMap: Map<string, IBaseElement> = new Map();
|
|
5
|
+
|
|
6
|
+
private static attributeMap: Map<string, string[]> = new Map();
|
|
7
|
+
|
|
8
|
+
public static Name(elementName: string) {
|
|
9
|
+
return <T extends IBaseElement>(target: T, name: string) => {
|
|
10
|
+
CustomElement.nameMap.set(elementName, target);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static AttributeName(attributeName: string) {
|
|
15
|
+
return <T extends IBaseElement>(target: T, name: string) => {
|
|
16
|
+
const attrs: string[] = CustomElement.attributeMap.get('elementName') as string[];
|
|
17
|
+
if (!attrs.includes(attributeName)) {
|
|
18
|
+
attrs.push(attributeName);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DataType, LoadType, QueryType } from '../metadata';
|
|
2
|
+
import { WidgetElement } from './WidgetElement';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 字段
|
|
6
|
+
*/
|
|
7
|
+
interface FieldElement extends WidgetElement {
|
|
8
|
+
// 内容数据的类型
|
|
9
|
+
dataType: DataType;
|
|
10
|
+
|
|
11
|
+
// 绑定内容数据加载函数。
|
|
12
|
+
load: string;
|
|
13
|
+
loadType: LoadType;
|
|
14
|
+
// 列表查询不使用queryPage接口,直传当前选中行数据
|
|
15
|
+
queryType: QueryType;
|
|
16
|
+
|
|
17
|
+
// load函数api定义,可裁剪请求报文 loadApi优先级最高,没有的情况下再找load和loadType
|
|
18
|
+
loadApi: string;
|
|
19
|
+
|
|
20
|
+
// 页面加载时,从页面加载数据load data中获取组件所需可选项数据
|
|
21
|
+
options: string;
|
|
22
|
+
optionsLoad: string;
|
|
23
|
+
optionsLoadType: LoadType;
|
|
24
|
+
optionsLoadApi: string;
|
|
25
|
+
// list类型组件调用options-load函数加载数据时作为追加数量限制
|
|
26
|
+
optionsLimit: number;
|
|
27
|
+
|
|
28
|
+
// 正则校验
|
|
29
|
+
pattern: string;
|
|
30
|
+
// 校验表达式
|
|
31
|
+
validation: string;
|
|
32
|
+
// 校验结果提示
|
|
33
|
+
tips: string;
|
|
34
|
+
// 对齐方式
|
|
35
|
+
align: string;
|
|
36
|
+
width: string;
|
|
37
|
+
height: string;
|
|
38
|
+
// children和textContext只能二选一存在,主要是用再requestElement/responseElement/ClearElement内
|
|
39
|
+
children: FieldElement[];
|
|
40
|
+
}
|
|
41
|
+
export { FieldElement };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IBaseElement } from './IBaseElement';
|
|
2
|
+
import { ValidationScope } from '../metadata';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 验证器
|
|
6
|
+
*/
|
|
7
|
+
interface ValidationElement extends IBaseElement {
|
|
8
|
+
// 校验类型
|
|
9
|
+
scope: ValidationScope;
|
|
10
|
+
// 函数校验,出入参为视图当前模型数据
|
|
11
|
+
fun: string;
|
|
12
|
+
// 校验表达式
|
|
13
|
+
expression: string;
|
|
14
|
+
// 校验结果提示信息
|
|
15
|
+
tips: string;
|
|
16
|
+
}
|
|
17
|
+
export { ValidationElement };
|