sg-lowcode-parser 0.1.29
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/README.md +1 -0
- package/dist/sg-lowcode-parser.js +33301 -0
- package/dist/sg-lowcode-parser.js.map +1 -0
- package/dist/sg-lowcode-parser.umd.cjs +246 -0
- package/dist/sg-lowcode-parser.umd.cjs.map +1 -0
- package/dist/types.d.ts +349 -0
- package/package.json +65 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { ActionType } from '@ant-design/pro-components';
|
|
2
|
+
import { DescriptionsProps } from 'antd';
|
|
3
|
+
import { EditableFormInstance } from '@ant-design/pro-components';
|
|
4
|
+
import { EditableProTableProps } from '@ant-design/pro-components';
|
|
5
|
+
import { FormInstance } from 'antd/lib';
|
|
6
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
7
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
8
|
+
import { MutableRefObject } from 'react';
|
|
9
|
+
import { ReactElement } from 'react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
import { RefAttributes } from 'react';
|
|
12
|
+
|
|
13
|
+
declare interface ButtonCommonExposeBase {
|
|
14
|
+
className: string;
|
|
15
|
+
buttonName: string;
|
|
16
|
+
frontComponent: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
loading: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare interface DictCacheProps {
|
|
22
|
+
dictList: Record<string, any>;
|
|
23
|
+
reqLockList: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare interface FieldCommonProps {
|
|
27
|
+
fieldCode: string;
|
|
28
|
+
labelName: string;
|
|
29
|
+
enLabelName: string;
|
|
30
|
+
sqlFieldName: string;
|
|
31
|
+
htmlType: string;
|
|
32
|
+
dateFormat: string;
|
|
33
|
+
dictType: string;
|
|
34
|
+
frontComponent: string;
|
|
35
|
+
expression: string;
|
|
36
|
+
blackRoles: string[];
|
|
37
|
+
disabledRoles: string[];
|
|
38
|
+
placeholder: string;
|
|
39
|
+
enPlaceholder: string;
|
|
40
|
+
defaultValue: string;
|
|
41
|
+
maxLength: number;
|
|
42
|
+
precision: number;
|
|
43
|
+
showClean: boolean;
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
required: boolean;
|
|
46
|
+
uniqueKey: boolean;
|
|
47
|
+
openComponent: FormOpenComponentProps;
|
|
48
|
+
rules: FieldRule[];
|
|
49
|
+
numMin: number;
|
|
50
|
+
numMax: number;
|
|
51
|
+
/**
|
|
52
|
+
* 关联展示控件对应属性
|
|
53
|
+
关联字段 linkFieldCode
|
|
54
|
+
匹配文本字段 matchTextColumn
|
|
55
|
+
*/
|
|
56
|
+
pagePureText: {
|
|
57
|
+
linkFieldCode: string;
|
|
58
|
+
matchTextColumn: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 链接类型-内链,外链等 linkType
|
|
62
|
+
打开方式 弹出窗口,弹出抽屉,页签,浏览器新窗口 openWay
|
|
63
|
+
链接地址 linkUrl
|
|
64
|
+
*/
|
|
65
|
+
openLink: 'openWay' | 'linkUrl' | ' linkType';
|
|
66
|
+
customKey: string;
|
|
67
|
+
allowFileType: string[];
|
|
68
|
+
customFileType: string;
|
|
69
|
+
fileLimitNum: number;
|
|
70
|
+
fileMaxSize: number;
|
|
71
|
+
storeDay: number;
|
|
72
|
+
hidden: boolean;
|
|
73
|
+
showDeptFullName: boolean;
|
|
74
|
+
treeSelectConfig: TreeSelectConfigProps;
|
|
75
|
+
fieldRatio: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface FieldRule {
|
|
79
|
+
enErrorMsg: string;
|
|
80
|
+
errorMsg: string;
|
|
81
|
+
pattern: string;
|
|
82
|
+
trigger: string;
|
|
83
|
+
validType: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export declare function Flow(props: PTableProps): JSX_2.Element;
|
|
87
|
+
|
|
88
|
+
declare type Form_FormFieldProps = FieldCommonProps & {
|
|
89
|
+
fieldRatio: number;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export declare type FormHeaderButtonExposeProps = {
|
|
93
|
+
getForm: () => FormInstance;
|
|
94
|
+
onClose: () => void;
|
|
95
|
+
getDatas: () => Record<string, any>;
|
|
96
|
+
validates: () => Promise<boolean>;
|
|
97
|
+
} & ButtonCommonExposeBase;
|
|
98
|
+
|
|
99
|
+
declare interface FormOpenComponentProps {
|
|
100
|
+
openPageCode: string;
|
|
101
|
+
matchTableName: string;
|
|
102
|
+
matchValueColumn: string;
|
|
103
|
+
matchTextColumn: string;
|
|
104
|
+
size: 'middle' | 'large';
|
|
105
|
+
hideButton: boolean;
|
|
106
|
+
matchColumns: string[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare interface FormProps {
|
|
110
|
+
buttons: TableButtonProps[];
|
|
111
|
+
enFormName: string;
|
|
112
|
+
enabledFile: boolean;
|
|
113
|
+
formCode: string;
|
|
114
|
+
formFields: Form_FormFieldProps[];
|
|
115
|
+
formName: string;
|
|
116
|
+
htmlClass: Record<string, unknown>;
|
|
117
|
+
primaryKey: string;
|
|
118
|
+
sqlTableName: string;
|
|
119
|
+
tables: FormTableProps[];
|
|
120
|
+
pageFileTags: PageFileTagProps[];
|
|
121
|
+
disabled: boolean;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare type FormTableFieldProps = FieldCommonProps & {
|
|
125
|
+
columnWidth: number;
|
|
126
|
+
isSort: boolean;
|
|
127
|
+
sortWay: string;
|
|
128
|
+
sortNum: number;
|
|
129
|
+
isSearch: boolean;
|
|
130
|
+
defaultField: boolean;
|
|
131
|
+
isHeaderSearch: boolean;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
declare type FormTableProps = TableCommonProps & {
|
|
135
|
+
formTableFields: FormTableFieldProps[];
|
|
136
|
+
foreignKey: string;
|
|
137
|
+
mainTableForeignKey: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
declare const enum FrontLinkOpenWayType {
|
|
141
|
+
popupWindow = "popupWindow",
|
|
142
|
+
popupTag = "popupTag",
|
|
143
|
+
popupDrawer = "popupDrawer",// DrawerForm
|
|
144
|
+
popupModal = "popupModal"
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare const enum FrontLinkType {
|
|
148
|
+
editComponent = "editComponent",
|
|
149
|
+
detailComponent = "detailComponent",
|
|
150
|
+
innerLink = "innerLink",
|
|
151
|
+
outerLink = "outerLink"
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare interface OpenLinkProps {
|
|
155
|
+
linkType: keyof typeof FrontLinkType;
|
|
156
|
+
openWay: keyof typeof FrontLinkOpenWayType;
|
|
157
|
+
linkUrl: string;
|
|
158
|
+
pageCode: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export declare const Page: ForwardRefExoticComponent< {
|
|
162
|
+
context: SGLowCodeContextProps;
|
|
163
|
+
pageJson?: PageProps;
|
|
164
|
+
dictCacheProp?: PageWrapperProps["dictCache"];
|
|
165
|
+
popupSelect?: boolean;
|
|
166
|
+
descriptionItem?: {
|
|
167
|
+
key: string;
|
|
168
|
+
value: string;
|
|
169
|
+
};
|
|
170
|
+
descriptionRow?: Record<string, any>;
|
|
171
|
+
isSub?: boolean;
|
|
172
|
+
} & Partial<EditableProTableProps<any, any>> & Partial<DescriptionsProps> & RefAttributes<unknown>>;
|
|
173
|
+
|
|
174
|
+
declare interface PageFileTagProps {
|
|
175
|
+
allowFileType: string[];
|
|
176
|
+
customFileType: string;
|
|
177
|
+
fileMaxSize: number | null;
|
|
178
|
+
fileTagCode: string;
|
|
179
|
+
fileTagName: string;
|
|
180
|
+
fileLimitNum: number | null;
|
|
181
|
+
required: boolean;
|
|
182
|
+
storeDay: number | null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare const enum PageModel {
|
|
186
|
+
backPage = "backPage",
|
|
187
|
+
frontPage = "frontPage",
|
|
188
|
+
noPage = "noPage"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare interface PageProps {
|
|
192
|
+
dsCode: string;
|
|
193
|
+
enPageName: string;
|
|
194
|
+
form: FormProps;
|
|
195
|
+
id: string;
|
|
196
|
+
pageCode: string;
|
|
197
|
+
pageName: string;
|
|
198
|
+
pageType: string;
|
|
199
|
+
table: TableProps;
|
|
200
|
+
tplCode: string;
|
|
201
|
+
workFlowKey: string;
|
|
202
|
+
workFlowConfig: {
|
|
203
|
+
canEditData: boolean;
|
|
204
|
+
defaultOpinion: string;
|
|
205
|
+
needOpinion: boolean;
|
|
206
|
+
nextCondition: boolean;
|
|
207
|
+
lastNode: boolean;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
declare interface PageWrapperProps {
|
|
212
|
+
pageJson: PageProps;
|
|
213
|
+
context: SGLowCodeContextProps;
|
|
214
|
+
children: ReactElement;
|
|
215
|
+
dictCache: MutableRefObject<DictCacheProps>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare type PTableProps = {
|
|
219
|
+
pageJson: PageProps;
|
|
220
|
+
popupSelect?: boolean;
|
|
221
|
+
editRowKey?: string;
|
|
222
|
+
} & EditableProTableProps<any, any>;
|
|
223
|
+
|
|
224
|
+
declare interface SGLowCodeContextProps {
|
|
225
|
+
appid: string;
|
|
226
|
+
appCnName: string;
|
|
227
|
+
appEnName: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare interface TableButtonProps {
|
|
231
|
+
afterMethods: {
|
|
232
|
+
methodKey: string;
|
|
233
|
+
methodName: string;
|
|
234
|
+
orderNum: number;
|
|
235
|
+
}[];
|
|
236
|
+
beforeMethods: {
|
|
237
|
+
methodKey: string;
|
|
238
|
+
methodName: string;
|
|
239
|
+
orderNum: number;
|
|
240
|
+
}[];
|
|
241
|
+
blackRoles: string[];
|
|
242
|
+
buttonCode: string;
|
|
243
|
+
buttonName: string;
|
|
244
|
+
buttonType: string;
|
|
245
|
+
enButtonName: string;
|
|
246
|
+
executeMethod: {
|
|
247
|
+
methodKey: string;
|
|
248
|
+
methodName: string;
|
|
249
|
+
orderNum: number;
|
|
250
|
+
};
|
|
251
|
+
orderNum: number;
|
|
252
|
+
openLink: OpenLinkProps;
|
|
253
|
+
frontComponent: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
declare interface TableCommonProps {
|
|
257
|
+
tableCode: string;
|
|
258
|
+
tableType: TableEditType;
|
|
259
|
+
tableName: string;
|
|
260
|
+
enTableName: string;
|
|
261
|
+
pageModel: PageModel;
|
|
262
|
+
sqlTableName: string;
|
|
263
|
+
headerButtons: TableButtonProps[];
|
|
264
|
+
rowButtons: TableButtonProps[];
|
|
265
|
+
primaryKey: string;
|
|
266
|
+
selectBeforeMethodKey: any;
|
|
267
|
+
selectMethodKey: any;
|
|
268
|
+
selectAfterMethodKey: any;
|
|
269
|
+
selectPageSize: number[];
|
|
270
|
+
defaultPageSize: number;
|
|
271
|
+
frontLockNum: number;
|
|
272
|
+
backLockNum: number;
|
|
273
|
+
isSub?: boolean;
|
|
274
|
+
disabled?: boolean;
|
|
275
|
+
treeSelectConfig: TreeSelectConfigProps;
|
|
276
|
+
showCheckBox: boolean;
|
|
277
|
+
openHeaderSearch: boolean;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare const enum TableEditType {
|
|
281
|
+
edlin = "edlin",
|
|
282
|
+
popUp = "popupDrawer",// DrawerForm
|
|
283
|
+
modal = "popupModal"
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare type TableFieldProps = FieldCommonProps & {
|
|
287
|
+
columnWidth: number;
|
|
288
|
+
isSort: boolean;
|
|
289
|
+
sortWay: string;
|
|
290
|
+
sortNum: number;
|
|
291
|
+
isSearch: boolean;
|
|
292
|
+
defaultField: boolean;
|
|
293
|
+
sqlTableName: string;
|
|
294
|
+
isHeaderSearch: boolean;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
export declare type TableHeaderButtonExposeProps = {
|
|
298
|
+
getAction: () => ActionType | undefined;
|
|
299
|
+
getSelectedRows: () => any[];
|
|
300
|
+
getSelectedRowKeys: () => string[];
|
|
301
|
+
getEditRows: () => any[];
|
|
302
|
+
getEditRow: (rowIndex: number | string) => any[];
|
|
303
|
+
setEditRow: (rowIndex: number | string, newObj: Record<string, any>) => void;
|
|
304
|
+
getForm: () => EditableFormInstance | undefined;
|
|
305
|
+
} & ButtonCommonExposeBase;
|
|
306
|
+
|
|
307
|
+
export declare type TableInlineButtonExposeProps = {
|
|
308
|
+
isRowEdit: boolean;
|
|
309
|
+
getAction: () => ActionType | null;
|
|
310
|
+
getRow: () => Record<string, any>;
|
|
311
|
+
getEditRow: () => Record<string, any>;
|
|
312
|
+
setEditRow: (newObj: Record<string, any>) => void;
|
|
313
|
+
cancelEditable: () => void;
|
|
314
|
+
startEditable: () => void;
|
|
315
|
+
removeRow: () => void;
|
|
316
|
+
getForm: () => EditableFormInstance | undefined;
|
|
317
|
+
} & ButtonCommonExposeBase;
|
|
318
|
+
|
|
319
|
+
declare type TableProps = TableCommonProps & {
|
|
320
|
+
tableFields: TableFieldProps[];
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export declare interface TableViewFiledProps {
|
|
324
|
+
row: Record<string, any>;
|
|
325
|
+
value: any;
|
|
326
|
+
rowIndex: number;
|
|
327
|
+
node: ReactNode;
|
|
328
|
+
options?: any[];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare interface TreeSelectConfigProps {
|
|
332
|
+
treeFieldCode: string;
|
|
333
|
+
treeFieldType: string;
|
|
334
|
+
cascadeSearch: boolean;
|
|
335
|
+
selectPageCode: string;
|
|
336
|
+
matchTableName: string;
|
|
337
|
+
matchValueColumn: string;
|
|
338
|
+
matchTextColumn: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export { }
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
declare namespace EditLayoutContainer {
|
|
345
|
+
var Form;
|
|
346
|
+
var SubTable;
|
|
347
|
+
var File;
|
|
348
|
+
}
|
|
349
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sg-lowcode-parser",
|
|
3
|
+
"version": "0.1.29",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/sg-lowcode-parser.umd.cjs",
|
|
9
|
+
"module": "./dist/sg-lowcode-parser.js",
|
|
10
|
+
"types": "./dist/types.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
"types": "./dist/types.d.ts",
|
|
13
|
+
"import": "./dist/sg-lowcode-parser.js",
|
|
14
|
+
"require": "./dist/sg-lowcode-parser.umd.cjs"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite",
|
|
18
|
+
"build": "tsc && vite build"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@ant-design/icons": "^5.5.1",
|
|
22
|
+
"@ant-design/pro-components": "^2.8.2",
|
|
23
|
+
"@types/lodash": "^4.17.13",
|
|
24
|
+
"@types/react": "^18.3.3",
|
|
25
|
+
"@types/react-dom": "^18.3.0",
|
|
26
|
+
"ahooks": "^3.8.0",
|
|
27
|
+
"antd": "^5.23.4",
|
|
28
|
+
"autoprefixer": "^10.4.19",
|
|
29
|
+
"clsx": "^2.1.1",
|
|
30
|
+
"dayjs": "^1.11.13",
|
|
31
|
+
"es-toolkit": "^1.20.0",
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
|
+
"postcss": "^8.4.40",
|
|
34
|
+
"react": "^18.3.1",
|
|
35
|
+
"react-dom": "^18.3.1",
|
|
36
|
+
"sggkui": "^2.1.11",
|
|
37
|
+
"tailwindcss": "^3.4.7",
|
|
38
|
+
"typescript": "^5.4.5",
|
|
39
|
+
"vite": "^5.2.10",
|
|
40
|
+
"vite-plugin-dts": "4.0.0-beta.1",
|
|
41
|
+
"vite-plugin-style-inject": "^0.0.1"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@ant-design/pro-components": "^2.8.1",
|
|
45
|
+
"ahooks": "^3.8.0",
|
|
46
|
+
"antd": "^5.22.2",
|
|
47
|
+
"dayjs": "^1.11.13",
|
|
48
|
+
"es-toolkit": "^1.20.0",
|
|
49
|
+
"react": ">=18.2.0",
|
|
50
|
+
"react-dom": ">=18.2.0",
|
|
51
|
+
"lodash": "^4.17.21"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18.0.0"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@wangeditor/editor": "^5.1.23",
|
|
58
|
+
"@wangeditor/editor-for-react": "^1.0.6",
|
|
59
|
+
"@wangeditor/plugin-upload-attachment": "^1.1.0",
|
|
60
|
+
"install": "^0.13.0",
|
|
61
|
+
"mobx": "^6.13.5",
|
|
62
|
+
"mobx-react": "^9.1.1",
|
|
63
|
+
"react-if": "^4.1.5"
|
|
64
|
+
}
|
|
65
|
+
}
|