@nocobase/plugin-graph-collection-manager 0.10.1-alpha.1 → 0.11.1-alpha.1

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 (51) hide show
  1. package/client.d.ts +2 -3
  2. package/client.js +1 -30
  3. package/lib/client/GraphCollectionProvider.js +1 -14
  4. package/lib/client/GraphCollectionShortcut.js +2 -9
  5. package/lib/client/GraphDrawPage.js +53 -47
  6. package/lib/client/action-hooks.d.ts +14 -1
  7. package/lib/client/action-hooks.js +12 -11
  8. package/lib/client/components/EditCollectionAction.d.ts +2 -1
  9. package/lib/client/components/EditCollectionAction.js +3 -19
  10. package/lib/client/components/Entity.js +28 -47
  11. package/lib/client/components/FieldSummary.d.ts +1 -1
  12. package/lib/client/components/FieldSummary.js +9 -16
  13. package/lib/client/index.d.ts +5 -1
  14. package/lib/client/index.js +21 -6
  15. package/lib/client/style.d.ts +12 -9
  16. package/lib/client/style.js +211 -196
  17. package/lib/client/utils.d.ts +3 -3
  18. package/lib/client/utils.js +15 -11
  19. package/package.json +27 -6
  20. package/server.d.ts +2 -3
  21. package/server.js +1 -30
  22. package/src/client/GraphCollectionProvider.tsx +33 -0
  23. package/src/client/GraphCollectionShortcut.tsx +141 -0
  24. package/src/client/GraphDrawPage.tsx +1382 -0
  25. package/src/client/action-hooks.tsx +237 -0
  26. package/src/client/components/AddCollectionAction.tsx +28 -0
  27. package/src/client/components/AddFieldAction.tsx +37 -0
  28. package/src/client/components/CollectionNodeProvder.tsx +28 -0
  29. package/src/client/components/EditCollectionAction.tsx +21 -0
  30. package/src/client/components/EditFieldAction.tsx +30 -0
  31. package/src/client/components/Entity.tsx +495 -0
  32. package/src/client/components/FieldSummary.tsx +42 -0
  33. package/src/client/components/OverrideFieldAction.tsx +30 -0
  34. package/src/client/components/ViewFieldAction.tsx +12 -0
  35. package/src/client/components/ViewNode.tsx +22 -0
  36. package/src/client/index.tsx +10 -0
  37. package/src/client/locale/en-US.ts +15 -0
  38. package/src/client/locale/es-ES.ts +15 -0
  39. package/src/client/locale/index.ts +3 -0
  40. package/src/client/locale/ja-JP.ts +13 -0
  41. package/src/client/locale/pt-BR.ts +15 -0
  42. package/src/client/locale/zh-CN.ts +16 -0
  43. package/src/client/style.tsx +227 -0
  44. package/src/client/utils.tsx +548 -0
  45. package/src/index.ts +1 -0
  46. package/src/server/actions/.gitkeep +0 -0
  47. package/src/server/collections/.gitkeep +0 -0
  48. package/src/server/collections/graphPositions.ts +22 -0
  49. package/src/server/index.ts +13 -0
  50. package/src/server/models/.gitkeep +0 -0
  51. package/src/server/repositories/.gitkeep +0 -0
@@ -0,0 +1,16 @@
1
+ export default {
2
+ 'Graph Collection': '图形化数据表',
3
+ 'Collection List': '数据表列表',
4
+ 'Full Screen': '全屏',
5
+ 'Collection Search': '表筛选',
6
+ 'Create Collection': '创建数据表',
7
+ 'All Fields': '全部',
8
+ 'Association Fields': '关系字段',
9
+ 'Choices fields': '选项字段',
10
+ 'All relationships': '所有关系',
11
+ 'Entity relationship only': '实体关系',
12
+ 'Inheritance relationship only': '继承关系',
13
+ 'Graphical interface': '图形化界面',
14
+ 'Auto layout': '自动布局',
15
+ Selection: '选择模式',
16
+ };
@@ -0,0 +1,227 @@
1
+ import { createStyles } from '@nocobase/client';
2
+
3
+ const useStyles = createStyles(({ token, css }) => {
4
+ return {
5
+ // 右下角的小画布
6
+ graphMinimap: css`
7
+ .x6-widget-minimap {
8
+ background-color: ${token.colorBgContainer};
9
+ }
10
+ `,
11
+
12
+ addButtonClass: css`
13
+ flex-shrink: 0;
14
+ padding: 2em 0;
15
+ `,
16
+
17
+ entityContainer: css`
18
+ .btn-del {
19
+ border-color: transparent;
20
+ background-color: ${token.colorErrorBg};
21
+ color: ${token.colorErrorText};
22
+ height: 20px;
23
+ width: 20px;
24
+ &:hover {
25
+ background-color: ${token.colorErrorBgHover};
26
+ }
27
+ }
28
+ .btn-add {
29
+ background: ${token.colorSuccessBg};
30
+ border-color: transparent;
31
+ color: ${token.colorSuccessText};
32
+ width: 20px;
33
+ &:hover {
34
+ background-color: ${token.colorSuccessBgHover};
35
+ }
36
+ }
37
+ .btn-edit {
38
+ color: ${token.colorText};
39
+ display: flex;
40
+ &:hover {
41
+ background: ${token.colorBgTextHover};
42
+ }
43
+ }
44
+ .btn-edit-in-head {
45
+ border-color: transparent;
46
+ color: ${token.colorText};
47
+ height: 20px;
48
+ width: 22px;
49
+ margin: 0px 5px 4px;
50
+ line-height: 25px;
51
+ &:hover {
52
+ background: ${token.colorBgTextHover};
53
+ }
54
+ }
55
+ width: 250px;
56
+ height: 100%;
57
+ border-radius: ${token.borderRadiusLG}px;
58
+ background-color: ${token.colorBgContainer};
59
+ border: 0;
60
+ overflow: hidden;
61
+ &:hover {
62
+ box-shadow: ${token.boxShadowTertiary};
63
+ }
64
+ .body {
65
+ width: 100%;
66
+ height: 100%;
67
+ background-color: ${token.colorBgContainer};
68
+ cursor: pointer;
69
+ .morePorts {
70
+ max-height: 300px;
71
+ overflow: auto;
72
+ }
73
+ .body-item {
74
+ display: inline-table;
75
+ width: 100%;
76
+ max-width: 250px;
77
+ height: 40px;
78
+ font-size: 14px;
79
+ color: ${token.colorText};
80
+ border-top: 1px solid ${token.colorBorderSecondary};
81
+ text-overflow: ellipsis;
82
+ display: flex;
83
+ flex-direction: row;
84
+ align-items: center;
85
+ justify-content: space-between;
86
+
87
+ .field-operator {
88
+ display: none;
89
+ }
90
+ &:hover {
91
+ .field-operator {
92
+ display: flex;
93
+ flex-direction: row-reverse;
94
+ height: 32px;
95
+ line-height: 32px;
96
+ z-index: 999;
97
+ cursor: pointer;
98
+ text-align: right;
99
+ background: ${token.colorBgContainer};
100
+ padding-right: 3px;
101
+ span {
102
+ margin: 3px;
103
+ margin-left: 4px;
104
+ padding: 3px;
105
+ height: 20px;
106
+ width: 20px;
107
+ }
108
+ .btn-override {
109
+ border-color: transparent;
110
+ width: 20px;
111
+ color: ${token.colorText};
112
+ &:hover {
113
+ background-color: ${token.colorBgTextHover};
114
+ }
115
+ }
116
+ .btn-view {
117
+ border-color: transparent;
118
+ color: ${token.colorText};
119
+ width: 20px;
120
+ }
121
+ .btn-view:hover {
122
+ background: ${token.colorBgTextHover};
123
+ }
124
+ }
125
+ .field_type {
126
+ display: none;
127
+ }
128
+ }
129
+
130
+ .name {
131
+ text-overflow: ellipsis;
132
+ white-space: nowrap;
133
+ overflow: hidden;
134
+ margin-left: 8px;
135
+ }
136
+
137
+ .type {
138
+ color: ${token.colorTextTertiary};
139
+ margin-right: 8px;
140
+ text-overflow: ellipsis;
141
+ white-space: nowrap;
142
+ overflow: hidden;
143
+ }
144
+ }
145
+ }
146
+ `,
147
+
148
+ headClass: css`
149
+ height: 50px;
150
+ font-size: 14px;
151
+ font-weight: 500;
152
+ display: flex;
153
+ flex-direction: row;
154
+ justify-content: space-between;
155
+ align-items: center;
156
+ background: ${token.colorFillAlter};
157
+ color: ${token.colorTextHeading};
158
+ padding: 0 8px;
159
+ `,
160
+
161
+ tableNameClass: css`
162
+ max-width: 80%;
163
+ overflow: hidden;
164
+ text-overflow: ellipsis;
165
+ white-space: nowrap;
166
+ font-weight: 500;
167
+ `,
168
+
169
+ tableBtnClass: css`
170
+ display: flex;
171
+ span {
172
+ cursor: pointer;
173
+ }
174
+ `,
175
+
176
+ collectionPopoverClass: css`
177
+ div.field-content {
178
+ font-size: 14px;
179
+ color: ${token.colorTextSecondary};
180
+ opacity: 0.8;
181
+ display: block;
182
+ .field-type {
183
+ color: ${token.colorText};
184
+ float: right;
185
+ }
186
+ }
187
+ `,
188
+
189
+ collectionListClass: css`
190
+ float: right;
191
+ position: fixed;
192
+ margin-top: 24px;
193
+ right: 24px;
194
+ z-index: 1000;
195
+ .trigger {
196
+ float: right;
197
+ margin: 2px 4px;
198
+ font-size: 16px;
199
+ }
200
+ .ant-input {
201
+ margin: 4px;
202
+ }
203
+ .ant-menu-inline {
204
+ border-top: 1px solid ${token.colorBorderSecondary};
205
+ }
206
+ .ant-layout-sider {
207
+ margin-top: 24px;
208
+ }
209
+ .ant-menu-item {
210
+ height: 32px;
211
+ }
212
+ .ant-btn {
213
+ border: 0;
214
+ }
215
+ `,
216
+
217
+ graphCollectionContainerClass: css`
218
+ overflow: hidden;
219
+ .x6-graph-scroller {
220
+ height: calc(100vh) !important;
221
+ width: calc(100vw) !important;
222
+ }
223
+ `,
224
+ };
225
+ });
226
+
227
+ export default useStyles;