@nocobase/plugin-graph-collection-manager 0.11.1-alpha.5 → 0.12.0-alpha.2

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.
Files changed (100) hide show
  1. package/client.d.ts +2 -3
  2. package/client.js +1 -1
  3. package/dist/client/index.js +65917 -0
  4. package/{lib → dist}/client/utils.d.ts +4 -3
  5. package/{lib → dist}/index.d.ts +1 -0
  6. package/dist/index.js +18 -0
  7. package/dist/locale/en-US.js +19 -0
  8. package/dist/locale/es-ES.js +19 -0
  9. package/dist/locale/fr-FR.js +19 -0
  10. package/dist/locale/ja-JP.js +17 -0
  11. package/dist/locale/pt-BR.js +19 -0
  12. package/dist/locale/zh-CN.js +20 -0
  13. package/dist/server/collections/graphPositions.js +26 -0
  14. package/dist/server/index.js +23 -0
  15. package/package.json +17 -28
  16. package/server.d.ts +2 -3
  17. package/server.js +1 -1
  18. package/lib/client/GraphCollectionProvider.js +0 -51
  19. package/lib/client/GraphCollectionShortcut.js +0 -169
  20. package/lib/client/GraphDrawPage.js +0 -1546
  21. package/lib/client/action-hooks.js +0 -318
  22. package/lib/client/components/AddCollectionAction.js +0 -58
  23. package/lib/client/components/AddFieldAction.js +0 -69
  24. package/lib/client/components/CollectionNodeProvder.js +0 -34
  25. package/lib/client/components/EditCollectionAction.js +0 -47
  26. package/lib/client/components/EditFieldAction.js +0 -63
  27. package/lib/client/components/Entity.js +0 -529
  28. package/lib/client/components/FieldSummary.js +0 -69
  29. package/lib/client/components/OverrideFieldAction.js +0 -64
  30. package/lib/client/components/ViewFieldAction.js +0 -45
  31. package/lib/client/components/ViewNode.js +0 -33
  32. package/lib/client/index.js +0 -27
  33. package/lib/client/locale/index.js +0 -4
  34. package/lib/client/style.js +0 -233
  35. package/lib/client/utils.js +0 -540
  36. package/lib/index.js +0 -13
  37. package/lib/locale/en-US.js +0 -22
  38. package/lib/locale/es-ES.js +0 -22
  39. package/lib/locale/fr-FR.js +0 -22
  40. package/lib/locale/ja-JP.js +0 -20
  41. package/lib/locale/pt-BR.js +0 -22
  42. package/lib/locale/zh-CN.js +0 -23
  43. package/lib/server/collections/graphPositions.js +0 -30
  44. package/lib/server/index.js +0 -37
  45. package/src/client/GraphCollectionProvider.tsx +0 -33
  46. package/src/client/GraphCollectionShortcut.tsx +0 -141
  47. package/src/client/GraphDrawPage.tsx +0 -1382
  48. package/src/client/action-hooks.tsx +0 -237
  49. package/src/client/components/AddCollectionAction.tsx +0 -28
  50. package/src/client/components/AddFieldAction.tsx +0 -37
  51. package/src/client/components/CollectionNodeProvder.tsx +0 -28
  52. package/src/client/components/EditCollectionAction.tsx +0 -21
  53. package/src/client/components/EditFieldAction.tsx +0 -30
  54. package/src/client/components/Entity.tsx +0 -495
  55. package/src/client/components/FieldSummary.tsx +0 -42
  56. package/src/client/components/OverrideFieldAction.tsx +0 -30
  57. package/src/client/components/ViewFieldAction.tsx +0 -12
  58. package/src/client/components/ViewNode.tsx +0 -22
  59. package/src/client/index.tsx +0 -10
  60. package/src/client/locale/index.ts +0 -3
  61. package/src/client/style.tsx +0 -227
  62. package/src/client/utils.tsx +0 -548
  63. package/src/index.ts +0 -1
  64. package/src/locale/en-US.ts +0 -15
  65. package/src/locale/es-ES.ts +0 -15
  66. package/src/locale/fr-FR.ts +0 -15
  67. package/src/locale/ja-JP.ts +0 -13
  68. package/src/locale/pt-BR.ts +0 -15
  69. package/src/locale/zh-CN.ts +0 -16
  70. package/src/server/actions/.gitkeep +0 -0
  71. package/src/server/collections/.gitkeep +0 -0
  72. package/src/server/collections/graphPositions.ts +0 -22
  73. package/src/server/index.ts +0 -13
  74. package/src/server/models/.gitkeep +0 -0
  75. package/src/server/repositories/.gitkeep +0 -0
  76. /package/{lib → dist}/client/GraphCollectionProvider.d.ts +0 -0
  77. /package/{lib → dist}/client/GraphCollectionShortcut.d.ts +0 -0
  78. /package/{lib → dist}/client/GraphDrawPage.d.ts +0 -0
  79. /package/{lib → dist}/client/action-hooks.d.ts +0 -0
  80. /package/{lib → dist}/client/components/AddCollectionAction.d.ts +0 -0
  81. /package/{lib → dist}/client/components/AddFieldAction.d.ts +0 -0
  82. /package/{lib → dist}/client/components/CollectionNodeProvder.d.ts +0 -0
  83. /package/{lib → dist}/client/components/EditCollectionAction.d.ts +0 -0
  84. /package/{lib → dist}/client/components/EditFieldAction.d.ts +0 -0
  85. /package/{lib → dist}/client/components/Entity.d.ts +0 -0
  86. /package/{lib → dist}/client/components/FieldSummary.d.ts +0 -0
  87. /package/{lib → dist}/client/components/OverrideFieldAction.d.ts +0 -0
  88. /package/{lib → dist}/client/components/ViewFieldAction.d.ts +0 -0
  89. /package/{lib → dist}/client/components/ViewNode.d.ts +0 -0
  90. /package/{lib → dist}/client/index.d.ts +0 -0
  91. /package/{lib → dist}/client/locale/index.d.ts +0 -0
  92. /package/{lib → dist}/client/style.d.ts +0 -0
  93. /package/{lib → dist}/locale/en-US.d.ts +0 -0
  94. /package/{lib → dist}/locale/es-ES.d.ts +0 -0
  95. /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
  96. /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
  97. /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
  98. /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
  99. /package/{lib → dist}/server/collections/graphPositions.d.ts +0 -0
  100. /package/{lib → dist}/server/index.d.ts +0 -0
@@ -1,12 +1,13 @@
1
+ import lodash from 'lodash';
1
2
  export declare const useGCMTranslation: () => import("react-i18next").UseTranslationResponse<"graph-collection-manager", undefined>;
2
- export declare const getInheritCollections: (collections: any, name: any) => any;
3
+ export declare const getInheritCollections: (collections: any, name: any) => any[];
3
4
  export declare const getChildrenCollections: (collections: any, name: any) => any[];
4
5
  export declare const formatData: (data: any) => {
5
6
  nodesData: any;
6
- edgesData: any;
7
+ edgesData: any[];
7
8
  inheritEdges: any[];
8
9
  };
9
- export declare const formatPortData: (ports: any) => any;
10
+ export declare const formatPortData: (ports: any) => lodash.Dictionary<any[]>;
10
11
  export declare const formatInheritEdgeData: (collections: any) => any[];
11
12
  export declare const getDiffNode: (newNodes: any, oldNodes: any) => any[];
12
13
  export declare const getDiffEdge: (newEdges: any, oldEdges: any) => any[];
@@ -1 +1,2 @@
1
+ export * from './server';
1
2
  export { default } from './server';
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var server = require('./server');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'default', {
10
+ enumerable: true,
11
+ get: function () { return server__namespace.default; }
12
+ });
13
+ Object.keys(server).forEach(function (k) {
14
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
15
+ enumerable: true,
16
+ get: function () { return server[k]; }
17
+ });
18
+ });
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var en_US_default = {
4
+ "Graph Collection": "Graph Collection",
5
+ "Collection List": "Collection List",
6
+ "Full Screen": "Full Screen",
7
+ "Collection Search": "Collection Search",
8
+ "Create Collection": "Create Collection",
9
+ "All Fields": "All Fields",
10
+ "Association Fields": "Association Fields",
11
+ "Choices fields": "Choices fields",
12
+ "All relationships": "All relationships",
13
+ "Entity relationship only": "Entity relationship only",
14
+ "Inheritance relationship only": "Inheritance relationship only",
15
+ "Graphical interface": "Graphical interface",
16
+ Selection: "Selection"
17
+ };
18
+
19
+ module.exports = en_US_default;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var es_ES_default = {
4
+ "Graph Collection": "Colecci\xF3n de gr\xE1ficos",
5
+ "Collection List": "Lista de colecciones",
6
+ "Full Screen": "Vista completa",
7
+ "Collection Search": "B\xFAsqueda de colecciones",
8
+ "Create Collection": "Crear colecci\xF3n",
9
+ "All Fields": "Todos los campos",
10
+ "Association Fields": "Campos de asociaci\xF3n",
11
+ "Optional fields": "Campos opcionales",
12
+ "All relationships": "Todas las relaciones",
13
+ "Entity relationship only": "S\xF3lo relaciones de entidad",
14
+ "Inheritance relationship only": "S\xF3lo relaciones de herencia",
15
+ "Graphical interface": "Interfaz gr\xE1fica",
16
+ "Selection": "Selecci\xF3n"
17
+ };
18
+
19
+ module.exports = es_ES_default;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var fr_FR_default = {
4
+ "Graph Collection": "Collection de graphiques",
5
+ "Collection List": "Liste des collections",
6
+ "Full Screen": "Plein \xE9cran",
7
+ "Collection Search": "Recherche de collection",
8
+ "Create Collection": "Cr\xE9er une collection",
9
+ "All Fields": "Tous les champs",
10
+ "Association Fields": "Champs d'association",
11
+ "Choices fields": "Champs de choix",
12
+ "All relationships": "Toutes les relations",
13
+ "Entity relationship only": "Uniquement les relations d'entit\xE9",
14
+ "Inheritance relationship only": "Uniquement les relations d'h\xE9ritage",
15
+ "Graphical interface": "Interface graphique",
16
+ Selection: "S\xE9lection"
17
+ };
18
+
19
+ module.exports = fr_FR_default;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var ja_JP_default = {
4
+ "Graph Collection": "\u30B0\u30E9\u30D5\u5316\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB",
5
+ "Collection List": "\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB\u30EA\u30B9\u30C8",
6
+ "Full Screen": "\u30D5\u30EB\u30B9\u30AF\u30EA\u30FC\u30F3",
7
+ "Collection Search": "\u8868\u30D5\u30A3\u30EB\u30BF",
8
+ "Create Collection": "\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB\u306E\u4F5C\u6210",
9
+ "All Fields": "\u3059\u3079\u3066",
10
+ "Associations Fields": "\u95A2\u4FC2\u30D5\u30A3\u30FC\u30EB\u30C9",
11
+ "All relationships": "\u3059\u3079\u3066\u306E\u95A2\u4FC2",
12
+ "Entity relationship only": "\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u95A2\u4FC2",
13
+ "Inheritance relationship only": "\u7D99\u627F\u95A2\u4FC2",
14
+ Selection: "\u305B\u3093\u305F\u304F"
15
+ };
16
+
17
+ module.exports = ja_JP_default;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var pt_BR_default = {
4
+ "Graph Collection": "Cole\xE7\xE3o de Gr\xE1ficos",
5
+ "Collection List": "Lista de Cole\xE7\xF5es",
6
+ "Full Screen": "Tela Cheia",
7
+ "Collection Search": "Busca de Cole\xE7\xE3o",
8
+ "Create Collection": "Criar Cole\xE7\xE3o",
9
+ "All Fields": "Todos os Campos",
10
+ "Association Fields": "Campos de Associa\xE7\xE3o",
11
+ "Choices fields": "Campos de op\xE7\xF5es",
12
+ "All relationships": "Todos os relacionamentos",
13
+ "Entity relationship only": "Somente rela\xE7\xE3o de Entidade",
14
+ "Inheritance relationship only": "Somente rela\xE7\xE3o de Heran\xE7a",
15
+ "Graphical interface": "Interface Gr\xE1fica",
16
+ Selection: "Sele\xE7\xE3o"
17
+ };
18
+
19
+ module.exports = pt_BR_default;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var zh_CN_default = {
4
+ "Graph Collection": "\u56FE\u5F62\u5316\u6570\u636E\u8868",
5
+ "Collection List": "\u6570\u636E\u8868\u5217\u8868",
6
+ "Full Screen": "\u5168\u5C4F",
7
+ "Collection Search": "\u8868\u7B5B\u9009",
8
+ "Create Collection": "\u521B\u5EFA\u6570\u636E\u8868",
9
+ "All Fields": "\u5168\u90E8",
10
+ "Association Fields": "\u5173\u7CFB\u5B57\u6BB5",
11
+ "Choices fields": "\u9009\u9879\u5B57\u6BB5",
12
+ "All relationships": "\u6240\u6709\u5173\u7CFB",
13
+ "Entity relationship only": "\u5B9E\u4F53\u5173\u7CFB",
14
+ "Inheritance relationship only": "\u7EE7\u627F\u5173\u7CFB",
15
+ "Graphical interface": "\u56FE\u5F62\u5316\u754C\u9762",
16
+ "Auto layout": "\u81EA\u52A8\u5E03\u5C40",
17
+ Selection: "\u9009\u62E9\u6A21\u5F0F"
18
+ };
19
+
20
+ module.exports = zh_CN_default;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var database = require('@nocobase/database');
4
+
5
+ var graphPositions_default = database.defineCollection({
6
+ namespace: "graph-collection-manager.graphCollectionPositions",
7
+ duplicator: "required",
8
+ name: "graphPositions",
9
+ fields: [
10
+ {
11
+ type: "string",
12
+ name: "collectionName",
13
+ unique: true
14
+ },
15
+ {
16
+ type: "double",
17
+ name: "x"
18
+ },
19
+ {
20
+ type: "double",
21
+ name: "y"
22
+ }
23
+ ]
24
+ });
25
+
26
+ module.exports = graphPositions_default;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var server = require('@nocobase/server');
6
+ var path = require('path');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var path__default = /*#__PURE__*/_interopDefault(path);
11
+
12
+ class GraphCollectionManagerPlugin extends server.Plugin {
13
+ async load() {
14
+ await this.db.import({
15
+ directory: path__default.default.resolve(__dirname, "collections")
16
+ });
17
+ this.app.acl.allow("graphPositions", "*");
18
+ }
19
+ }
20
+ var server_default = GraphCollectionManagerPlugin;
21
+
22
+ exports.GraphCollectionManagerPlugin = GraphCollectionManagerPlugin;
23
+ exports.default = server_default;
package/package.json CHANGED
@@ -4,39 +4,28 @@
4
4
  "displayName.zh-CN": "数据库可视化管理",
5
5
  "description": "database collection manage",
6
6
  "description.zh-CN": "数据库管理。",
7
- "version": "0.11.1-alpha.5",
7
+ "version": "0.12.0-alpha.2",
8
8
  "license": "AGPL-3.0",
9
- "main": "./lib/server/index.js",
10
- "files": [
11
- "lib",
12
- "src",
13
- "README.md",
14
- "README.zh-CN.md",
15
- "CHANGELOG.md",
16
- "server.js",
17
- "server.d.ts",
18
- "client.js",
19
- "client.d.ts"
20
- ],
21
- "dependencies": {
9
+ "main": "./dist/server/index.js",
10
+ "devDependencies": {
11
+ "@ant-design/icons": "5.x",
22
12
  "@antv/x6": "^1.9.0",
23
13
  "@antv/x6-react-shape": "^1.6.2",
14
+ "@formily/react": "2.x",
15
+ "@formily/reactive": "2.x",
16
+ "@formily/shared": "2.x",
24
17
  "ahooks": "^3.7.2",
25
- "dagre": "^0.8.5"
26
- },
27
- "devDependencies": {
28
- "@ant-design/icons": "^5.1.4",
29
- "@formily/react": "^2.2.27",
30
- "@formily/reactive": "^2.2.27",
31
- "@formily/shared": "^2.2.27",
32
- "@nocobase/client": "0.11.1-alpha.5",
33
- "@nocobase/database": "0.11.1-alpha.5",
34
- "@nocobase/server": "0.11.1-alpha.5",
35
- "@nocobase/test": "0.11.1-alpha.5",
36
- "@nocobase/utils": "0.11.1-alpha.5",
37
- "antd": "^5.6.4",
18
+ "antd": "5.x",
19
+ "dagre": "^0.8.5",
38
20
  "react": "^18.2.0",
39
21
  "react-i18next": "^11.15.1"
40
22
  },
41
- "gitHead": "1dcfd15a7d95a40b0a2f60e1de19ec574066fb20"
23
+ "peerDependencies": {
24
+ "@nocobase/client": "0.x",
25
+ "@nocobase/database": "0.x",
26
+ "@nocobase/server": "0.x",
27
+ "@nocobase/test": "0.x",
28
+ "@nocobase/utils": "0.x"
29
+ },
30
+ "gitHead": "a95e9e2666f0318c955113a4735bc005a2c9a767"
42
31
  }
package/server.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './src/server';
2
- export { default } from './src/server';
3
-
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';
package/server.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./lib/server/index.js');
1
+ module.exports = require('./dist/server/index.js');
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.GraphCollectionProvider = void 0;
7
- function _client() {
8
- const data = require("@nocobase/client");
9
- _client = function _client() {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _react() {
15
- const data = _interopRequireWildcard(require("react"));
16
- _react = function _react() {
17
- return data;
18
- };
19
- return data;
20
- }
21
- var _GraphCollectionShortcut = require("./GraphCollectionShortcut");
22
- var _utils = require("./utils");
23
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
29
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
30
- const GraphCollectionProvider = _react().default.memo(props => {
31
- const ctx = (0, _react().useContext)(_client().PluginManagerContext);
32
- // i18n.addResources('en-US', 'graphPositions', enUS);
33
- // i18n.addResources('ja-JP', 'graphPositions', jaJP);
34
- // i18n.addResources('zh-CN', 'graphPositions', zhCN);
35
- const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
36
- t = _useGCMTranslation.t;
37
- const items = (0, _react().useContext)(_client().SettingsCenterContext);
38
- items['collection-manager']['tabs']['graph'] = {
39
- title: t('Graphical interface'),
40
- component: _GraphCollectionShortcut.GraphCollectionPane
41
- };
42
- return _react().default.createElement(_client().SettingsCenterProvider, {
43
- settings: items
44
- }, _react().default.createElement(_client().PluginManagerContext.Provider, {
45
- value: {
46
- components: _objectSpread({}, ctx === null || ctx === void 0 ? void 0 : ctx.components)
47
- }
48
- }, props.children));
49
- });
50
- exports.GraphCollectionProvider = GraphCollectionProvider;
51
- GraphCollectionProvider.displayName = 'GraphCollectionProvider';
@@ -1,169 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.GraphCollectionPane = void 0;
7
- function _icons() {
8
- const data = require("@ant-design/icons");
9
- _icons = function _icons() {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _shared() {
15
- const data = require("@formily/shared");
16
- _shared = function _shared() {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _client() {
22
- const data = require("@nocobase/client");
23
- _client = function _client() {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _react() {
29
- const data = _interopRequireWildcard(require("react"));
30
- _react = function _react() {
31
- return data;
32
- };
33
- return data;
34
- }
35
- var _actionHooks = require("./action-hooks");
36
- var _GraphDrawPage = require("./GraphDrawPage");
37
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
40
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
42
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
43
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
44
- const useCollectionValues = options => {
45
- const _useActionContext = (0, _client().useActionContext)(),
46
- visible = _useActionContext.visible;
47
- const result = (0, _client().useRequest)(() => Promise.resolve({
48
- data: {
49
- name: `t_${(0, _shared().uid)()}`,
50
- createdBy: true,
51
- updatedBy: true,
52
- sortable: true,
53
- logging: true,
54
- fields: [{
55
- name: 'id',
56
- type: 'integer',
57
- autoIncrement: true,
58
- primaryKey: true,
59
- allowNull: false,
60
- uiSchema: {
61
- type: 'number',
62
- title: '{{t("ID")}}',
63
- 'x-component': 'InputNumber',
64
- 'x-read-pretty': true
65
- },
66
- interface: 'id'
67
- }, {
68
- interface: 'createdAt',
69
- type: 'date',
70
- field: 'createdAt',
71
- name: 'createdAt',
72
- uiSchema: {
73
- type: 'datetime',
74
- title: '{{t("Created at")}}',
75
- 'x-component': 'DatePicker',
76
- 'x-component-props': {},
77
- 'x-read-pretty': true
78
- }
79
- }, {
80
- interface: 'createdBy',
81
- type: 'belongsTo',
82
- target: 'users',
83
- foreignKey: 'createdById',
84
- name: 'createdBy',
85
- uiSchema: {
86
- type: 'object',
87
- title: '{{t("Created by")}}',
88
- 'x-component': 'RecordPicker',
89
- 'x-component-props': {
90
- fieldNames: {
91
- value: 'id',
92
- label: 'nickname'
93
- }
94
- },
95
- 'x-read-pretty': true
96
- }
97
- }, {
98
- type: 'date',
99
- field: 'updatedAt',
100
- name: 'updatedAt',
101
- interface: 'updatedAt',
102
- uiSchema: {
103
- type: 'string',
104
- title: '{{t("Last updated at")}}',
105
- 'x-component': 'DatePicker',
106
- 'x-component-props': {},
107
- 'x-read-pretty': true
108
- }
109
- }, {
110
- type: 'belongsTo',
111
- target: 'users',
112
- foreignKey: 'updatedById',
113
- name: 'updatedBy',
114
- interface: 'updatedBy',
115
- uiSchema: {
116
- type: 'object',
117
- title: '{{t("Last updated by")}}',
118
- 'x-component': 'RecordPicker',
119
- 'x-component-props': {
120
- fieldNames: {
121
- value: 'id',
122
- label: 'nickname'
123
- }
124
- },
125
- 'x-read-pretty': true
126
- }
127
- }]
128
- }
129
- }), _objectSpread(_objectSpread({}, options), {}, {
130
- manual: true
131
- }));
132
- (0, _react().useEffect)(() => {
133
- if (visible) {
134
- result.run();
135
- }
136
- }, [visible]);
137
- return result;
138
- };
139
- const GraphCollectionPane = () => {
140
- return _react().default.createElement("div", {
141
- className: (0, _client().css)`
142
- height: calc(100vh - 160px);
143
- overflow: auto;
144
- margin: calc(var(--nb-spacing) * -1);
145
- position: relative;
146
- `,
147
- id: "graph_container"
148
- }, _react().default.createElement(_client().SchemaComponent, {
149
- schema: {
150
- type: 'void',
151
- 'x-component': 'div',
152
- properties: {
153
- editor: {
154
- type: 'void',
155
- 'x-component': 'GraphDrawPage'
156
- }
157
- }
158
- },
159
- components: {
160
- GraphDrawPage: _GraphDrawPage.GraphDrawPage,
161
- DeleteOutlined: _icons().DeleteOutlined
162
- },
163
- scope: {
164
- useCollectionValues,
165
- useCreateActionAndRefreshCM: _actionHooks.useCreateActionAndRefreshCM
166
- }
167
- }));
168
- };
169
- exports.GraphCollectionPane = GraphCollectionPane;