@nokecy/qc-ui 0.0.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 (128) hide show
  1. package/README.md +23 -0
  2. package/dist/cjs/ag-grid-plus/ag-gridPlus.d.ts +5 -0
  3. package/dist/cjs/ag-grid-plus/ag-gridPlus.js +191 -0
  4. package/dist/cjs/ag-grid-plus/global.scss +65 -0
  5. package/dist/cjs/ag-grid-plus/gridManager/index.d.ts +8 -0
  6. package/dist/cjs/ag-grid-plus/gridManager/index.js +51 -0
  7. package/dist/cjs/ag-grid-plus/index.d.ts +3 -0
  8. package/dist/cjs/ag-grid-plus/index.js +23 -0
  9. package/dist/cjs/ag-grid-plus/interface.d.ts +25 -0
  10. package/dist/cjs/ag-grid-plus/interface.js +17 -0
  11. package/dist/cjs/ag-grid-plus/queryForm/index.d.ts +10 -0
  12. package/dist/cjs/ag-grid-plus/queryForm/index.js +210 -0
  13. package/dist/cjs/ag-grid-plus/queryForm/index.less +48 -0
  14. package/dist/cjs/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
  15. package/dist/cjs/ag-grid-plus/queryForm/queryForm.js +110 -0
  16. package/dist/cjs/array-table/index.d.ts +10 -0
  17. package/dist/cjs/array-table/index.js +205 -0
  18. package/dist/cjs/dashboard/dashboard/components/index.d.ts +2 -0
  19. package/dist/cjs/dashboard/dashboard/components/index.js +15 -0
  20. package/dist/cjs/dashboard/dashboard/components/modal/index.d.ts +3 -0
  21. package/dist/cjs/dashboard/dashboard/components/modal/index.js +26 -0
  22. package/dist/cjs/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
  23. package/dist/cjs/dashboard/dashboard/components/toolbar/index.js +37 -0
  24. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
  25. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.js +3 -0
  26. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.less +49 -0
  27. package/dist/cjs/dashboard/dashboard/index.d.ts +62 -0
  28. package/dist/cjs/dashboard/dashboard/index.js +603 -0
  29. package/dist/cjs/dashboard/dashboard/index.less +173 -0
  30. package/dist/cjs/dashboard/dashboard/service.d.ts +8 -0
  31. package/dist/cjs/dashboard/dashboard/service.js +114 -0
  32. package/dist/cjs/dashboard/dashboard/utils.d.ts +9 -0
  33. package/dist/cjs/dashboard/dashboard/utils.js +126 -0
  34. package/dist/cjs/dashboard/index.d.ts +3 -0
  35. package/dist/cjs/dashboard/index.js +30 -0
  36. package/dist/cjs/dashboard/utils.d.ts +24 -0
  37. package/dist/cjs/dashboard/utils.js +162 -0
  38. package/dist/cjs/dashboard/widget/index.d.ts +13 -0
  39. package/dist/cjs/dashboard/widget/index.js +79 -0
  40. package/dist/cjs/dashboard/widget/index.less +7 -0
  41. package/dist/cjs/dashboard/widget/selector/index.d.ts +4 -0
  42. package/dist/cjs/dashboard/widget/selector/index.js +271 -0
  43. package/dist/cjs/dashboard/widget/selector/index.less +434 -0
  44. package/dist/cjs/dashboard/widget/utils.d.ts +4 -0
  45. package/dist/cjs/dashboard/widget/utils.js +116 -0
  46. package/dist/cjs/elsaFlow/config-graph.d.ts +1 -0
  47. package/dist/cjs/elsaFlow/config-graph.js +57 -0
  48. package/dist/cjs/elsaFlow/index.d.ts +6 -0
  49. package/dist/cjs/elsaFlow/index.js +199 -0
  50. package/dist/cjs/elsaFlow/react-edge/edge1.d.ts +4 -0
  51. package/dist/cjs/elsaFlow/react-edge/edge1.js +31 -0
  52. package/dist/cjs/elsaFlow/react-edge/edge1.less +0 -0
  53. package/dist/cjs/elsaFlow/react-edge/edge2.d.ts +4 -0
  54. package/dist/cjs/elsaFlow/react-edge/edge2.js +31 -0
  55. package/dist/cjs/elsaFlow/react-edge/edge2.less +0 -0
  56. package/dist/cjs/elsaFlow/react-node/node1.d.ts +4 -0
  57. package/dist/cjs/elsaFlow/react-node/node1.js +28 -0
  58. package/dist/cjs/elsaFlow/react-node/node1.less +11 -0
  59. package/dist/cjs/elsaFlow/react-node/node2.d.ts +4 -0
  60. package/dist/cjs/elsaFlow/react-node/node2.js +28 -0
  61. package/dist/cjs/elsaFlow/react-node/node2.less +11 -0
  62. package/dist/cjs/index.d.ts +4 -0
  63. package/dist/cjs/index.js +37 -0
  64. package/dist/esm/ag-grid-plus/ag-gridPlus.d.ts +5 -0
  65. package/dist/esm/ag-grid-plus/ag-gridPlus.js +169 -0
  66. package/dist/esm/ag-grid-plus/global.scss +65 -0
  67. package/dist/esm/ag-grid-plus/gridManager/index.d.ts +8 -0
  68. package/dist/esm/ag-grid-plus/gridManager/index.js +44 -0
  69. package/dist/esm/ag-grid-plus/index.d.ts +3 -0
  70. package/dist/esm/ag-grid-plus/index.js +3 -0
  71. package/dist/esm/ag-grid-plus/interface.d.ts +25 -0
  72. package/dist/esm/ag-grid-plus/interface.js +9 -0
  73. package/dist/esm/ag-grid-plus/queryForm/index.d.ts +10 -0
  74. package/dist/esm/ag-grid-plus/queryForm/index.js +189 -0
  75. package/dist/esm/ag-grid-plus/queryForm/index.less +48 -0
  76. package/dist/esm/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
  77. package/dist/esm/ag-grid-plus/queryForm/queryForm.js +92 -0
  78. package/dist/esm/array-table/index.d.ts +10 -0
  79. package/dist/esm/array-table/index.js +179 -0
  80. package/dist/esm/dashboard/dashboard/components/index.d.ts +2 -0
  81. package/dist/esm/dashboard/dashboard/components/index.js +2 -0
  82. package/dist/esm/dashboard/dashboard/components/modal/index.d.ts +3 -0
  83. package/dist/esm/dashboard/dashboard/components/modal/index.js +17 -0
  84. package/dist/esm/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
  85. package/dist/esm/dashboard/dashboard/components/toolbar/index.js +24 -0
  86. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
  87. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.js +1 -0
  88. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.less +49 -0
  89. package/dist/esm/dashboard/dashboard/index.d.ts +62 -0
  90. package/dist/esm/dashboard/dashboard/index.js +571 -0
  91. package/dist/esm/dashboard/dashboard/index.less +173 -0
  92. package/dist/esm/dashboard/dashboard/service.d.ts +8 -0
  93. package/dist/esm/dashboard/dashboard/service.js +102 -0
  94. package/dist/esm/dashboard/dashboard/utils.d.ts +9 -0
  95. package/dist/esm/dashboard/dashboard/utils.js +106 -0
  96. package/dist/esm/dashboard/index.d.ts +3 -0
  97. package/dist/esm/dashboard/index.js +3 -0
  98. package/dist/esm/dashboard/utils.d.ts +24 -0
  99. package/dist/esm/dashboard/utils.js +142 -0
  100. package/dist/esm/dashboard/widget/index.d.ts +13 -0
  101. package/dist/esm/dashboard/widget/index.js +59 -0
  102. package/dist/esm/dashboard/widget/index.less +7 -0
  103. package/dist/esm/dashboard/widget/selector/index.d.ts +4 -0
  104. package/dist/esm/dashboard/widget/selector/index.js +249 -0
  105. package/dist/esm/dashboard/widget/selector/index.less +434 -0
  106. package/dist/esm/dashboard/widget/utils.d.ts +4 -0
  107. package/dist/esm/dashboard/widget/utils.js +88 -0
  108. package/dist/esm/elsaFlow/config-graph.d.ts +1 -0
  109. package/dist/esm/elsaFlow/config-graph.js +42 -0
  110. package/dist/esm/elsaFlow/index.d.ts +6 -0
  111. package/dist/esm/elsaFlow/index.js +189 -0
  112. package/dist/esm/elsaFlow/react-edge/edge1.d.ts +4 -0
  113. package/dist/esm/elsaFlow/react-edge/edge1.js +18 -0
  114. package/dist/esm/elsaFlow/react-edge/edge1.less +0 -0
  115. package/dist/esm/elsaFlow/react-edge/edge2.d.ts +4 -0
  116. package/dist/esm/elsaFlow/react-edge/edge2.js +18 -0
  117. package/dist/esm/elsaFlow/react-edge/edge2.less +0 -0
  118. package/dist/esm/elsaFlow/react-node/node1.d.ts +4 -0
  119. package/dist/esm/elsaFlow/react-node/node1.js +16 -0
  120. package/dist/esm/elsaFlow/react-node/node1.less +11 -0
  121. package/dist/esm/elsaFlow/react-node/node2.d.ts +4 -0
  122. package/dist/esm/elsaFlow/react-node/node2.js +16 -0
  123. package/dist/esm/elsaFlow/react-node/node2.less +11 -0
  124. package/dist/esm/index.d.ts +4 -0
  125. package/dist/esm/index.js +5 -0
  126. package/dist/umd/qc-ui.min.css +1 -0
  127. package/dist/umd/qc-ui.min.js +1 -0
  128. package/package.json +61 -0
@@ -0,0 +1,434 @@
1
+ .react-dashboard-widget-selector{
2
+ position:fixed;
3
+ top:50%;
4
+ left:50%;
5
+ transform:translate(-50%, -50%);
6
+ z-index:1006;
7
+ width:60%;
8
+ height:60%;
9
+ max-width:800px;
10
+ max-height:600px;
11
+ background:var(--component-background);
12
+ }
13
+
14
+ .react-dashboard-widget-wrap {
15
+ display: flex;
16
+ height:100%;
17
+
18
+ .react-dashboard-widget-leftBar {
19
+ padding: 10px;
20
+ width: 180px;
21
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
22
+ background: var(--component-background);
23
+ .react-dashboard-widget-searchIcon {
24
+ color: var(--text-color);
25
+ }
26
+
27
+ .react-dashboard-widget-item {
28
+ display: flex;
29
+ justify-content: space-between;
30
+ padding: 10px;
31
+
32
+ .react-dashboard-widget-Badge {
33
+
34
+ .ant-badge-count {
35
+ color: var(--text-color);
36
+ background-color: var(--component-background-1) !important;
37
+ }
38
+
39
+ }
40
+
41
+ cursor: pointer;
42
+
43
+ &:hover {
44
+ background: var(--component-background-3);
45
+ font-weight: bold;
46
+ }
47
+ }
48
+
49
+ .react-dashboard-widget-active {
50
+ background: rgba(0, 0, 0, 0.03);
51
+ font-weight: bold;
52
+ }
53
+ }
54
+
55
+ .react-dashboard-widget-Layer {
56
+ flex: 1 1;
57
+ overflow-y: auto;
58
+ overflow-x: hidden;
59
+ padding: 10px;
60
+ background: rgba(0, 0, 0, 0.01);
61
+ &::-webkit-scrollbar {
62
+ width: 1px;
63
+ height: 1px;
64
+ overflow: auto;
65
+ }
66
+
67
+ &::-webkit-scrollbar-thumb {
68
+ background-color: var(--primary-color);
69
+ min-height: 25px;
70
+ min-width: 25px;
71
+
72
+ &:hover {
73
+ background-color: #a8a8a8;
74
+ }
75
+
76
+ &:active {
77
+ background-color: #787878;
78
+ }
79
+ }
80
+
81
+ &::-webkit-scrollbar-track {
82
+ background-color: #f7f7f7;
83
+ border: 1px solid #efefef;
84
+ }
85
+
86
+ .react-dashboard-widget-waterfall {
87
+ width: 100%;
88
+ }
89
+
90
+ .ant-popover-inner-content {
91
+ background: rgba(0, 0, 0, 0.01);
92
+ }
93
+
94
+
95
+ .react-dashboard-widget-item {
96
+ cursor: pointer;
97
+ height: auto;
98
+ margin-bottom: 10px;
99
+ width: 100%;
100
+ height: auto;
101
+ border-radius: 5px;
102
+ overflow: hidden;
103
+ // box-shadow: 0 0 0px rgba(255, 255, 255, 1);
104
+ transition: all 0.3s;
105
+ border: 1px solid rgba(0, 0, 0, 0.1);
106
+ -webkit-column-break-inside: avoid;
107
+ position: relative;
108
+ background: var(--component-background);
109
+ .react-dashboard-widget-shortcut {
110
+ width: 100%;
111
+ height: auto;
112
+ }
113
+
114
+ .react-dashboard-widget-mask {
115
+ opacity: 0;
116
+ position: absolute;
117
+ top: 0;
118
+ left: 0;
119
+ width: 100%;
120
+ height: 100%;
121
+ background: rgba(0, 0, 0, 0.5);
122
+ display: flex;
123
+ justify-content: center;
124
+ align-items: center;
125
+ transition: all 0.3s;
126
+ }
127
+
128
+ &:hover {
129
+ transition: all 0.3s;
130
+
131
+ border: 1px solid var(--component-background-3);
132
+
133
+ .react-dashboard-widget-mask {
134
+ opacity: 1;
135
+ transition: all 0.3s;
136
+ }
137
+ }
138
+
139
+ .react-dashboard-widget-bottombar {
140
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
141
+ width: 100%;
142
+
143
+ padding: 5px;
144
+
145
+ .react-dashboard-widget-iconWrap {
146
+ display: inline-block;
147
+ width: 28px;
148
+ height: 28px;
149
+ line-height: 28px;
150
+ text-align: center;
151
+ border-radius: 7px;
152
+ color: #fff;
153
+ margin-right: 5px;
154
+ font-size: 16px;
155
+ }
156
+
157
+ .react-dashboard-widget-name {
158
+ font-size: 16px;
159
+ flex: 1;
160
+ color: var(--text-color);
161
+ line-height: 28px;
162
+ font-weight: bold;
163
+ display: inline;
164
+ }
165
+
166
+ .react-dashboard-widget-description {
167
+ margin-top: 5px;
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
183
+ /* stylelint-disable no-duplicate-selectors */
184
+ /* stylelint-disable */
185
+ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
186
+ .ant-modal {
187
+ box-sizing: border-box;
188
+ margin: 0;
189
+ padding: 0;
190
+ color: rgba(0, 0, 0, 0.85);
191
+ font-size: 14px;
192
+ font-variant: tabular-nums;
193
+ line-height: 1.5715;
194
+ list-style: none;
195
+ font-feature-settings: 'tnum';
196
+ pointer-events: none;
197
+ position: relative;
198
+ top: 100px;
199
+ width: auto;
200
+ max-width: calc(100vw - 32px);
201
+ margin: 0 auto;
202
+ padding-bottom: 24px;
203
+ }
204
+ .ant-modal.ant-zoom-enter,
205
+ .ant-modal.antzoom-appear {
206
+ transform: none;
207
+ opacity: 0;
208
+ -webkit-animation-duration: 0.3s;
209
+ animation-duration: 0.3s;
210
+ -webkit-user-select: none;
211
+ -moz-user-select: none;
212
+ -ms-user-select: none;
213
+ user-select: none;
214
+ }
215
+ .ant-modal-mask {
216
+ position: fixed;
217
+ top: 0;
218
+ right: 0;
219
+ bottom: 0;
220
+ left: 0;
221
+ z-index: 1000;
222
+ height: 100%;
223
+ background-color: rgba(0, 0, 0, 0.45);
224
+ }
225
+ .ant-modal-mask-hidden {
226
+ display: none;
227
+ }
228
+ .ant-modal-wrap {
229
+ position: fixed;
230
+ top: 0;
231
+ right: 0;
232
+ bottom: 0;
233
+ left: 0;
234
+ overflow: auto;
235
+ outline: 0;
236
+ -webkit-overflow-scrolling: touch;
237
+ }
238
+ .ant-modal-wrap {
239
+ z-index: 1000;
240
+ }
241
+ .ant-modal-title {
242
+ margin: 0;
243
+ color: rgba(0, 0, 0, 0.85);
244
+ font-weight: 500;
245
+ font-size: 16px;
246
+ line-height: 22px;
247
+ word-wrap: break-word;
248
+ }
249
+ .ant-modal-content {
250
+ position: relative;
251
+ background-color: #fff;
252
+ background-clip: padding-box;
253
+ border: 0;
254
+ border-radius: 2px;
255
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
256
+ pointer-events: auto;
257
+ }
258
+ .ant-modal-close {
259
+ position: absolute;
260
+ top: 0;
261
+ right: 0;
262
+ z-index: 10;
263
+ padding: 0;
264
+ color: rgba(0, 0, 0, 0.45);
265
+ font-weight: 700;
266
+ line-height: 1;
267
+ text-decoration: none;
268
+ background: transparent;
269
+ border: 0;
270
+ outline: 0;
271
+ cursor: pointer;
272
+ transition: color 0.3s;
273
+ }
274
+ .ant-modal-close-x {
275
+ display: block;
276
+ width: 56px;
277
+ height: 56px;
278
+ font-size: 16px;
279
+ font-style: normal;
280
+ line-height: 56px;
281
+ text-align: center;
282
+ text-transform: none;
283
+ text-rendering: auto;
284
+ }
285
+ .ant-modal-close:focus,
286
+ .ant-modal-close:hover {
287
+ color: rgba(0, 0, 0, 0.75);
288
+ text-decoration: none;
289
+ }
290
+ .ant-modal-header {
291
+ padding: 16px 24px;
292
+ color: rgba(0, 0, 0, 0.85);
293
+ background: #fff;
294
+ border-bottom: 1px solid #f0f0f0;
295
+ border-radius: 2px 2px 0 0;
296
+ }
297
+ .ant-modal-body {
298
+ padding: 24px;
299
+ font-size: 14px;
300
+ line-height: 1.5715;
301
+ word-wrap: break-word;
302
+ }
303
+ .ant-modal-footer {
304
+ padding: 10px 16px;
305
+ text-align: right;
306
+ background: transparent;
307
+ border-top: 1px solid #f0f0f0;
308
+ border-radius: 0 0 2px 2px;
309
+ }
310
+ .ant-modal-footer .ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
311
+ margin-bottom: 0;
312
+ margin-left: 8px;
313
+ }
314
+ .ant-modal-open {
315
+ overflow: hidden;
316
+ }
317
+ .ant-modal-centered {
318
+ text-align: center;
319
+ }
320
+ .ant-modal-centered::before {
321
+ display: inline-block;
322
+ width: 0;
323
+ height: 100%;
324
+ vertical-align: middle;
325
+ content: '';
326
+ }
327
+ .ant-modal-centered .ant-modal {
328
+ top: 0;
329
+ display: inline-block;
330
+ text-align: left;
331
+ vertical-align: middle;
332
+ }
333
+ @media (max-width: 767px) {
334
+ .ant-modal {
335
+ max-width: calc(100vw - 16px);
336
+ margin: 8px auto;
337
+ }
338
+ .ant-modal-centered .ant-modal {
339
+ flex: 1;
340
+ }
341
+ }
342
+ .ant-modal-confirm .ant-modal-header {
343
+ display: none;
344
+ }
345
+ .ant-modal-confirm .ant-modal-body {
346
+ padding: 32px 32px 24px;
347
+ }
348
+ .ant-modal-confirm-body-wrapper::before {
349
+ display: table;
350
+ content: '';
351
+ }
352
+ .ant-modal-confirm-body-wrapper::after {
353
+ display: table;
354
+ clear: both;
355
+ content: '';
356
+ }
357
+ .ant-modal-confirm-body .ant-modal-confirm-title {
358
+ display: block;
359
+ overflow: hidden;
360
+ color: rgba(0, 0, 0, 0.85);
361
+ font-weight: 500;
362
+ font-size: 16px;
363
+ line-height: 1.4;
364
+ }
365
+ .ant-modal-confirm-body .ant-modal-confirm-content {
366
+ margin-top: 8px;
367
+ color: rgba(0, 0, 0, 0.85);
368
+ font-size: 14px;
369
+ }
370
+ .ant-modal-confirm-body > .anticon {
371
+ float: left;
372
+ margin-right: 16px;
373
+ font-size: 22px;
374
+ }
375
+ .ant-modal-confirm-body > .anticon + .ant-modal-confirm-title + .ant-modal-confirm-content {
376
+ margin-left: 38px;
377
+ }
378
+ .ant-modal-confirm .ant-modal-confirm-btns {
379
+ float: right;
380
+ margin-top: 24px;
381
+ }
382
+ .ant-modal-confirm .ant-modal-confirm-btns .ant-btn + .ant-btn {
383
+ margin-bottom: 0;
384
+ margin-left: 8px;
385
+ }
386
+ .ant-modal-confirm-error .ant-modal-confirm-body > .anticon {
387
+ color: #ff4d4f;
388
+ }
389
+ .ant-modal-confirm-warning .ant-modal-confirm-body > .anticon,
390
+ .ant-modal-confirm-confirm .ant-modal-confirm-body > .anticon {
391
+ color: #faad14;
392
+ }
393
+ .ant-modal-confirm-info .ant-modal-confirm-body > .anticon {
394
+ color: #1890ff;
395
+ }
396
+ .ant-modal-confirm-success .ant-modal-confirm-body > .anticon {
397
+ color: #52c41a;
398
+ }
399
+ .ant-modal-wrap-rtl {
400
+ direction: rtl;
401
+ }
402
+ .ant-modal-wrap-rtl .ant-modal-close {
403
+ right: initial;
404
+ left: 0;
405
+ }
406
+ .ant-modal-wrap-rtl .ant-modal-footer {
407
+ text-align: left;
408
+ }
409
+ .ant-modal-wrap-rtl .ant-modal-footer .ant-btn + .ant-btn {
410
+ margin-right: 8px;
411
+ margin-left: 0;
412
+ }
413
+ .ant-modal-wrap-rtl .ant-modal-confirm-body {
414
+ direction: rtl;
415
+ }
416
+ .ant-modal-wrap-rtl .ant-modal-confirm-body > .anticon {
417
+ float: right;
418
+ margin-right: 0;
419
+ margin-left: 16px;
420
+ }
421
+ .ant-modal-wrap-rtl .ant-modal-confirm-body > .anticon + .ant-modal-confirm-title + .ant-modal-confirm-content {
422
+ margin-right: 38px;
423
+ margin-left: 0;
424
+ }
425
+ .ant-modal-wrap-rtl .ant-modal-confirm-btns {
426
+ float: left;
427
+ }
428
+ .ant-modal-wrap-rtl .ant-modal-confirm-btns .ant-btn + .ant-btn {
429
+ margin-right: 8px;
430
+ margin-left: 0;
431
+ }
432
+ .ant-modal-wrap-rtl.ant-modal-centered .ant-modal {
433
+ text-align: right;
434
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const getWidgetType: (i: string, widgets: any) => string;
3
+ export declare const ConfigBar: (props: any) => JSX.Element;
4
+ export declare const ConfigWrap: (props: any, widgets: any) => JSX.Element;
@@ -0,0 +1,88 @@
1
+ import { Drawer } from 'antd';
2
+ import _ from 'lodash';
3
+ import React, { useCallback, useEffect, useMemo } from 'react';
4
+ import { AiOutlineDelete } from 'react-icons/ai';
5
+ import { FaCog } from 'react-icons/fa'; // import allWidgets from '../../widgets';
6
+ //获取widget的类型
7
+
8
+ export var getWidgetType = function getWidgetType(i, widgets) {
9
+ var allWidgets = widgets;
10
+ var widgetType = '';
11
+ Object.keys(allWidgets).map(function (key) {
12
+ if (i.indexOf(key) >= 0) {
13
+ widgetType = key;
14
+ }
15
+ });
16
+ return widgetType;
17
+ }; //widget配置和删除按钮
18
+
19
+ export var ConfigBar = function ConfigBar(props) {
20
+ var widgetKey = props.widgetKey,
21
+ editMode = props.editMode,
22
+ onDeleteWidget = props.onDeleteWidget,
23
+ _props$setConfigShow = props.setConfigShow,
24
+ setConfigShow = _props$setConfigShow === void 0 ? function () {} : _props$setConfigShow,
25
+ widgets = props.widgets;
26
+ var widgetType = getWidgetType(widgetKey, widgets);
27
+ return /*#__PURE__*/React.createElement(React.Fragment, null, editMode && /*#__PURE__*/React.createElement("div", {
28
+ className: 'react-dashboard-mask'
29
+ }), editMode && _.get('widgets', widgetType + '.configComponent') && /*#__PURE__*/React.createElement("div", {
30
+ className: 'react-dashboard-configicon',
31
+ onClick: function onClick() {
32
+ return setConfigShow(true);
33
+ }
34
+ }, /*#__PURE__*/React.createElement(FaCog, null)), editMode && /*#__PURE__*/React.createElement("div", {
35
+ className: 'react-dashboard-deleteicon',
36
+ onClick: function onClick() {
37
+ return onDeleteWidget();
38
+ }
39
+ }, /*#__PURE__*/React.createElement(AiOutlineDelete, null)));
40
+ }; //config的容器
41
+
42
+ export var ConfigWrap = function ConfigWrap(props, widgets) {
43
+ var widgetKey = props.widgetKey,
44
+ visible = props.visible,
45
+ setVisible = props.setVisible,
46
+ width = props.width,
47
+ children = props.children;
48
+ var afterVisibleChange = useCallback(function (visible) {
49
+ if (visible) {
50
+ var widgetConfigPanel = document.getElementsByClassName('widgetConfigPanel')[0];
51
+ widgetConfigPanel && widgetConfigPanel.addEventListener('mousedown', function (e) {
52
+ e.stopPropagation();
53
+ });
54
+ } else {
55
+ var _widgetConfigPanel = document.getElementsByClassName('widgetConfigPanel')[0];
56
+ _widgetConfigPanel && _widgetConfigPanel.removeEventListener('mousedown', function (e) {
57
+ e.stopPropagation();
58
+ });
59
+ }
60
+ }, [visible]);
61
+ var title = useMemo(function () {
62
+ if (!widgetKey) {
63
+ return;
64
+ }
65
+
66
+ var widgetType = getWidgetType(widgetKey, widgets);
67
+ return _.get(widgets, widgetType + '.name') + '设置';
68
+ }, [widgetKey, widgets, getWidgetType]);
69
+ useEffect(function () {
70
+ afterVisibleChange(visible);
71
+ }, [visible]);
72
+ return /*#__PURE__*/React.createElement(React.Fragment, null, visible && /*#__PURE__*/React.createElement(Drawer, {
73
+ className: "react-dashboard-widgetConfigPanel",
74
+ title: title,
75
+ placement: "right",
76
+ closable: true,
77
+ onClose: function onClose() {
78
+ return setVisible(false);
79
+ },
80
+ visible: visible,
81
+ width: width,
82
+ bodyStyle: {
83
+ padding: '0px'
84
+ },
85
+ afterVisibleChange: afterVisibleChange,
86
+ zIndex: 1005
87
+ }, children));
88
+ };
@@ -0,0 +1 @@
1
+ export declare const useGraphConfig: any;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { createGraphConfig } from '@antv/xflow';
3
+ /** 自定义React节点/边 */
4
+
5
+ import Node1 from "./react-node/node1";
6
+ import Node2 from "./react-node/node2";
7
+ import Edge1 from "./react-edge/edge1";
8
+ import Edge2 from "./react-edge/edge2";
9
+ export var useGraphConfig = createGraphConfig(function (config) {
10
+ /** 设置XFlow画布配置项 */
11
+ config.setX6Config({
12
+ /** 画布网格 */
13
+ grid: true,
14
+
15
+ /** 画布缩放等级 */
16
+ scaling: {
17
+ min: 0.2,
18
+ max: 3
19
+ }
20
+ /** 画布滚轮缩放 */
21
+ // mousewheel: {
22
+ // enabled: true,
23
+ // /** 将鼠标位置作为中心缩放 */
24
+ // zoomAtMousePosition: true,
25
+ // },
26
+
27
+ });
28
+ /** 设置XFlow画布需要渲染的React节点/边 */
29
+
30
+ config.setNodeRender('NODE1', function (props) {
31
+ return /*#__PURE__*/React.createElement(Node1, props);
32
+ });
33
+ config.setEdgeRender('EDGE1', function (props) {
34
+ return /*#__PURE__*/React.createElement(Edge1, props);
35
+ });
36
+ config.setNodeRender('NODE2', function (props) {
37
+ return /*#__PURE__*/React.createElement(Node2, props);
38
+ });
39
+ config.setEdgeRender('EDGE2', function (props) {
40
+ return /*#__PURE__*/React.createElement(Edge2, props);
41
+ });
42
+ });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import '@antv/xflow/dist/index.css';
3
+ export interface IProps {
4
+ }
5
+ declare const ElsaFlow: React.FC<IProps>;
6
+ export default ElsaFlow;