@nocobase/plugin-graph-collection-manager 0.10.0-alpha.5 → 0.11.0-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 (50) 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 +44 -45
  6. package/lib/client/action-hooks.js +6 -7
  7. package/lib/client/components/AddFieldAction.d.ts +2 -1
  8. package/lib/client/components/AddFieldAction.js +3 -1
  9. package/lib/client/components/EditCollectionAction.js +1 -8
  10. package/lib/client/components/Entity.js +19 -24
  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.js +12 -12
  16. package/lib/client/utils.d.ts +2 -1
  17. package/lib/client/utils.js +15 -11
  18. package/package.json +27 -6
  19. package/server.d.ts +2 -3
  20. package/server.js +1 -30
  21. package/src/client/GraphCollectionProvider.tsx +33 -0
  22. package/src/client/GraphCollectionShortcut.tsx +141 -0
  23. package/src/client/GraphDrawPage.tsx +1375 -0
  24. package/src/client/action-hooks.tsx +232 -0
  25. package/src/client/components/AddCollectionAction.tsx +28 -0
  26. package/src/client/components/AddFieldAction.tsx +37 -0
  27. package/src/client/components/CollectionNodeProvder.tsx +28 -0
  28. package/src/client/components/EditCollectionAction.tsx +33 -0
  29. package/src/client/components/EditFieldAction.tsx +30 -0
  30. package/src/client/components/Entity.tsx +510 -0
  31. package/src/client/components/FieldSummary.tsx +42 -0
  32. package/src/client/components/OverrideFieldAction.tsx +30 -0
  33. package/src/client/components/ViewFieldAction.tsx +12 -0
  34. package/src/client/components/ViewNode.tsx +22 -0
  35. package/src/client/index.tsx +10 -0
  36. package/src/client/locale/en-US.ts +15 -0
  37. package/src/client/locale/es-ES.ts +15 -0
  38. package/src/client/locale/index.ts +3 -0
  39. package/src/client/locale/ja-JP.ts +13 -0
  40. package/src/client/locale/pt-BR.ts +15 -0
  41. package/src/client/locale/zh-CN.ts +16 -0
  42. package/src/client/style.tsx +206 -0
  43. package/src/client/utils.tsx +548 -0
  44. package/src/index.ts +1 -0
  45. package/src/server/actions/.gitkeep +0 -0
  46. package/src/server/collections/.gitkeep +0 -0
  47. package/src/server/collections/graphPositions.ts +22 -0
  48. package/src/server/index.ts +13 -0
  49. package/src/server/models/.gitkeep +0 -0
  50. package/src/server/repositories/.gitkeep +0 -0
@@ -0,0 +1,15 @@
1
+ export default {
2
+ 'Graph Collection': 'Coleção de Gráficos',
3
+ 'Collection List': 'Lista de Coleções',
4
+ 'Full Screen': 'Tela Cheia',
5
+ 'Collection Search': 'Busca de Coleção',
6
+ 'Create Collection': 'Criar Coleção',
7
+ 'All Fields': 'Todos os Campos',
8
+ 'Association Fields': 'Campos de Associação',
9
+ 'Choices fields': 'Campos de opções',
10
+ 'All relationships': 'Todos os relacionamentos',
11
+ 'Entity relationship only': 'Somente relação de Entidade',
12
+ 'Inheritance relationship only': 'Somente relação de Herança',
13
+ 'Graphical interface': 'Interface Gráfica',
14
+ Selection: 'Seleção',
15
+ };
@@ -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,206 @@
1
+ import { css } from '@nocobase/client';
2
+
3
+ export const nodeSubtreeClass = css`
4
+ display: flex;
5
+ flex-direction: column-reverse;
6
+ align-items: center;
7
+ `;
8
+
9
+ export const addButtonClass = css`
10
+ flex-shrink: 0;
11
+ padding: 2em 0;
12
+ `;
13
+
14
+ export const entityContainer = css`
15
+ width: 250px;
16
+ height: 100%;
17
+ border-radius: 2px;
18
+ background-color: #fff;
19
+ border: 0;
20
+ &:hover {
21
+ box-shadow: 0 1px 2px -2px rgb(0 0 0 / 16%), 0 3px 6px 0 rgb(0 0 0 / 12%), 0 5px 12px 4px rgb(0 0 0 / 9%);
22
+ }
23
+ .body {
24
+ width: 100%;
25
+ height: 100%;
26
+ background-color: #fff;
27
+ cursor: pointer;
28
+ .morePorts {
29
+ max-height: 300px;
30
+ overflow: auto;
31
+ }
32
+ .body-item {
33
+ display: inline-table;
34
+ width: 100%;
35
+ max-width: 250px;
36
+ height: 40px;
37
+ font-size: 14px;
38
+ color: rgba(0, 0, 0, 0.85);
39
+ height: 40px;
40
+ border-top: 1px solid #f0f0f0;
41
+ text-overflow: ellipsis;
42
+ display: flex;
43
+ flex-direction: row;
44
+ align-items: center;
45
+ justify-content: space-between;
46
+
47
+ .field-operator {
48
+ display: none;
49
+ }
50
+ &:hover {
51
+ .field-operator {
52
+ display: flex;
53
+ flex-direction: row-reverse;
54
+ height: 32px;
55
+ line-height: 32px;
56
+ z-index: 999;
57
+ cursor: pointer;
58
+ text-align: right;
59
+ background: #fff;
60
+ padding-right: 3px;
61
+ span {
62
+ margin: 3px;
63
+ margin-left: 4px;
64
+ padding: 3px;
65
+ height: 20px;
66
+ width: 20px;
67
+ }
68
+ .btn-del {
69
+ border-color: transparent;
70
+ color: rgb(78 89 105);
71
+ height: 20px;
72
+ width: 20px;
73
+ &:hover {
74
+ background-color: rgb(229 230 235);
75
+ }
76
+ }
77
+ .btn-add {
78
+ background: rgb(232 255 234);
79
+ border-color: transparent;
80
+ color: rgb(0, 180, 42);
81
+ width: 20px;
82
+ }
83
+ .btn-edit {
84
+ color: rgba(0, 0, 0, 0.85);
85
+ display: flex;
86
+ }
87
+ .btn-edit:hover {
88
+ background: rgb(229 230 235);
89
+ }
90
+ .btn-override {
91
+ border-color: transparent;
92
+ width: 20px;
93
+ color: rgba(0, 0, 0, 0.85);
94
+ &:hover {
95
+ background-color: rgb(229 230 235);
96
+ }
97
+ }
98
+ .btn-view {
99
+ border-color: transparent;
100
+ color: rgba(0, 0, 0, 0.85);
101
+ width: 20px;
102
+ }
103
+ .btn-view:hover {
104
+ background: rgb(229 230 235);
105
+ }
106
+ }
107
+ .field_type {
108
+ display: none;
109
+ }
110
+ }
111
+
112
+ .name {
113
+ text-overflow: ellipsis;
114
+ white-space: nowrap;
115
+ overflow: hidden;
116
+ margin-left: 8px;
117
+ }
118
+
119
+ .type {
120
+ color: rgba(0, 0, 0, 0.45);
121
+ margin-right: 8px;
122
+ text-overflow: ellipsis;
123
+ white-space: nowrap;
124
+ overflow: hidden;
125
+ }
126
+ }
127
+ }
128
+ `;
129
+
130
+ export const headClass = css`
131
+ height: 50px;
132
+ font-size: 14px;
133
+ font-weight: 500;
134
+ display: flex;
135
+ flex-direction: row;
136
+ justify-content: space-between;
137
+ align-items: center;
138
+ background: #fafafa;
139
+ color: rgb(29 33 41);
140
+ padding: 0 8px;
141
+ border-radius: 3px;
142
+ `;
143
+
144
+ export const tableNameClass = css`
145
+ max-width: 80%;
146
+ overflow: hidden;
147
+ text-overflow: ellipsis;
148
+ white-space: nowrap;
149
+ font-weight: 500;
150
+ `;
151
+
152
+ export const tableBtnClass = css`
153
+ display: flex;
154
+ span {
155
+ cursor: pointer;
156
+ }
157
+ `;
158
+
159
+ export const collectiionPopoverClass = css`
160
+ div.field-content {
161
+ font-size: 14px;
162
+ color: rgb(134 144 156);
163
+ opacity: 0.8;
164
+ display: block;
165
+ .field-type {
166
+ color: #333;
167
+ float: right;
168
+ }
169
+ }
170
+ `;
171
+
172
+ export const collectionListClass = css`
173
+ float: right;
174
+ position: fixed;
175
+ margin-top: 24px;
176
+ right: 24px;
177
+ z-index: 1000;
178
+ .trigger {
179
+ float: right;
180
+ margin: 2px 4px;
181
+ font-size: 16px;
182
+ }
183
+ .ant-input {
184
+ margin: 4px;
185
+ }
186
+ .ant-menu-inline {
187
+ border-top: 1px solid #f0f0f0;
188
+ }
189
+ .ant-layout-sider {
190
+ margin-top: 24px;
191
+ }
192
+ .ant-menu-item {
193
+ height: 32px;
194
+ }
195
+ .ant-btn {
196
+ border: 0;
197
+ }
198
+ `;
199
+
200
+ export const graphCollectionContainerClass = css`
201
+ overflow: hidden;
202
+ .x6-graph-scroller {
203
+ height: calc(100vh) !important;
204
+ width: calc(100vw) !important;
205
+ }
206
+ `;