ice-entity-designer 0.0.5 → 0.0.8
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/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/{Entity.d.ts → er-component/Entity.d.ts} +24 -0
- package/dist/types/er-component/Relation.d.ts +24 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/utils/camelcase_util.d.ts +4 -0
- package/dist/types/utils/pluralize_util.d.ts +25 -0
- package/dist/types/utils/serialization_util.d.ts +1 -0
- package/package.json +4 -3
- package/dist/types/Relation.d.ts +0 -14
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
import { ICEGroup, ICEPolyLine, ICEText } from 'ice-render';
|
|
9
9
|
/**
|
|
10
10
|
* @class Entity 实体
|
|
11
|
+
*
|
|
12
|
+
* 所有参数按照 typeorm 要求的格式传入。
|
|
13
|
+
*
|
|
14
|
+
* @see https://typeorm.io/#/separating-entity-definition
|
|
11
15
|
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
12
16
|
*/
|
|
13
17
|
export default class Entity extends ICEGroup {
|
|
@@ -26,4 +30,24 @@ export default class Entity extends ICEGroup {
|
|
|
26
30
|
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
27
31
|
*/
|
|
28
32
|
protected doLayout(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 实体类的 JSON 格式描述,与 type-orm 规定的格式对应
|
|
35
|
+
*
|
|
36
|
+
* {
|
|
37
|
+
* name: "category",
|
|
38
|
+
* columns: {
|
|
39
|
+
* id: {
|
|
40
|
+
* type: Number,
|
|
41
|
+
* primary: true,
|
|
42
|
+
* generated: true
|
|
43
|
+
* },
|
|
44
|
+
* name: {
|
|
45
|
+
* type: String
|
|
46
|
+
* }
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* @see https://orkhan.gitbook.io/typeorm/docs/separating-entity-definition
|
|
51
|
+
*/
|
|
52
|
+
toEntityObject(): any;
|
|
29
53
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEVisioLink } from 'ice-render';
|
|
9
|
+
/**
|
|
10
|
+
* @class Relation
|
|
11
|
+
*
|
|
12
|
+
* 用来描述实体类之间的关系,外观是一条带箭头的连接线。
|
|
13
|
+
* 所有参数按照 typeorm 要求的格式传入。
|
|
14
|
+
*
|
|
15
|
+
* @see https://typeorm.io/#/separating-entity-definition
|
|
16
|
+
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
17
|
+
*/
|
|
18
|
+
export default class Relation extends ICEVisioLink {
|
|
19
|
+
constructor(props: any);
|
|
20
|
+
/**
|
|
21
|
+
* 实体类的 JSON 格式描述,与 type-orm 规定的格式对应
|
|
22
|
+
*/
|
|
23
|
+
toEntityObject(): any;
|
|
24
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export { default as Entity } from './Entity';
|
|
9
|
-
export { default as Relation } from './Relation';
|
|
8
|
+
export { default as Entity } from './er-component/Entity';
|
|
9
|
+
export { default as Relation } from './er-component/Relation';
|
|
10
|
+
export { default as toJSONObject } from './utils/serialization_util';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ES 版本的 pluralize ,用来自动获取英文单词的复数形式。
|
|
3
|
+
* 官方没有提供 ES6 版本,导致 rollup 在打包的时候不能很好地处理,这里做了简单的改写,方便打包。
|
|
4
|
+
* @see https://www.npmjs.com/package/pluralize
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Pluralize or singularize a word based on the passed in count.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} word The word to pluralize
|
|
10
|
+
* @param {number} count How many of the word exist
|
|
11
|
+
* @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)
|
|
12
|
+
* @return {string}
|
|
13
|
+
*/
|
|
14
|
+
declare function pluralize(word: any, count?: number, inclusive?: boolean): string;
|
|
15
|
+
declare namespace pluralize {
|
|
16
|
+
var plural: (word: any) => any;
|
|
17
|
+
var isPlural: (word: any) => boolean;
|
|
18
|
+
var singular: (word: any) => any;
|
|
19
|
+
var isSingular: (word: any) => boolean;
|
|
20
|
+
var addPluralRule: (rule: any, replacement: any) => void;
|
|
21
|
+
var addSingularRule: (rule: any, replacement: any) => void;
|
|
22
|
+
var addUncountableRule: (word: any) => void;
|
|
23
|
+
var addIrregularRule: (single: any, plural: any) => void;
|
|
24
|
+
}
|
|
25
|
+
export { pluralize };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function toJSONObject(componentList: any): any;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "大漠穷秋",
|
|
3
3
|
"name": "ice-entity-designer",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "An entity designer based on ice-render.",
|
|
6
|
-
"repository": "https://
|
|
6
|
+
"repository": "https://github.com/ice-render/ice-entity-designer",
|
|
7
7
|
"browser": "dist/index.umd.js",
|
|
8
8
|
"main": "dist/index.cjs.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"types:watch": "npm run types:check -- --watch"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"ice-render": "
|
|
25
|
+
"ice-render": "0.0.42",
|
|
26
26
|
"lodash": "4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@rollup/plugin-commonjs": "21.0.2",
|
|
37
37
|
"@rollup/plugin-json": "4.1.0",
|
|
38
38
|
"@rollup/plugin-node-resolve": "13.1.3",
|
|
39
|
+
"@rollup/plugin-strip": "^2.1.0",
|
|
39
40
|
"@types/jest": "25.2.1",
|
|
40
41
|
"@types/lodash": "4.14.180",
|
|
41
42
|
"@typescript-eslint/eslint-plugin": "2.29.0",
|
package/dist/types/Relation.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @class Relation 关系
|
|
10
|
-
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
11
|
-
*/
|
|
12
|
-
export default class Relation {
|
|
13
|
-
constructor();
|
|
14
|
-
}
|