ronds-metadata 1.2.10 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. package/es/api/index.js +249 -0
  2. package/es/comps/DynamicPorts/comps/ContextMenu.js +44 -0
  3. package/es/comps/DynamicPorts/comps/DragNode.js +55 -0
  4. package/es/comps/DynamicPorts/comps/GraphHandler/index.js +51 -0
  5. package/es/comps/DynamicPorts/comps/NodeElement.js +30 -0
  6. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +42 -0
  7. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +40 -0
  8. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +55 -0
  9. package/es/comps/DynamicPorts/comps/shape/connector.js +19 -0
  10. package/es/comps/DynamicPorts/comps/shape/edge.js +91 -0
  11. package/es/comps/DynamicPorts/comps/shape/node.js +190 -0
  12. package/es/comps/DynamicPorts/constant/index.js +19 -0
  13. package/es/comps/DynamicPorts/graph.js +697 -0
  14. package/es/comps/DynamicPorts/index.js +143 -0
  15. package/es/comps/DynamicPorts/interface.js +6 -0
  16. package/es/comps/DynamicPorts/utils.js +127 -0
  17. package/es/comps/Editable/DataCell/ButtonCell.js +45 -0
  18. package/es/comps/Editable/DataCell/ColorPicker.js +33 -0
  19. package/es/comps/Editable/DataCell/Input.js +54 -0
  20. package/es/comps/Editable/DataCell/Number.js +44 -0
  21. package/es/comps/Editable/DataCell/Select.js +48 -0
  22. package/es/comps/Editable/DataCell/Switch.js +33 -0
  23. package/es/comps/Editable/comps/EditableAction.js +110 -0
  24. package/es/comps/Editable/comps/EditableCell.js +108 -0
  25. package/es/comps/Editable/comps/EditableHeardCell.js +172 -0
  26. package/es/comps/Editable/comps/EditableRow.js +118 -0
  27. package/es/comps/Editable/comps/Texty.js +277 -0
  28. package/es/comps/Editable/index.js +386 -0
  29. package/es/comps/Editable/interface.js +8 -0
  30. package/es/comps/Editable/utils.js +46 -0
  31. package/es/comps/FileView/index.js +198 -0
  32. package/es/comps/FormGenerator/Provider.js +8 -0
  33. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +69 -0
  34. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +17 -0
  35. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +16 -0
  36. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +17 -0
  37. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.js +50 -0
  38. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +55 -0
  39. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +14 -0
  40. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +50 -0
  41. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +17 -0
  42. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +69 -0
  43. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +55 -0
  44. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +13 -0
  45. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.js +50 -0
  46. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +14 -0
  47. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.js +27 -0
  48. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +261 -0
  49. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +62 -0
  50. package/es/comps/FormGenerator/comps/Canvas/core/index.js +315 -0
  51. package/es/comps/FormGenerator/comps/Canvas/index.js +120 -0
  52. package/es/comps/FormGenerator/comps/Settings/index.js +150 -0
  53. package/es/comps/FormGenerator/comps/Sidebar/Elements.js +48 -0
  54. package/es/comps/FormGenerator/comps/Sidebar/index.js +37 -0
  55. package/es/comps/FormGenerator/index.js +68 -0
  56. package/es/comps/FormGenerator/settings/index.js +367 -0
  57. package/es/comps/FormGenerator/settings/ruleConfig.js +557 -0
  58. package/es/comps/FormGenerator/transformer.js +300 -0
  59. package/es/comps/Icons/index.js +23 -0
  60. package/es/comps/JsonEdit/constant/index.js +87 -0
  61. package/es/comps/JsonEdit/index.js +221 -0
  62. package/es/comps/JsonView/index.js +109 -0
  63. package/es/comps/MdEdit/index.js +41 -0
  64. package/es/comps/MdNavbar/index.js +180 -0
  65. package/es/comps/MdNavbar/utils.js +34 -0
  66. package/es/comps/MdView/index.js +70 -0
  67. package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +419 -0
  68. package/es/comps/MetadataEdit/components/MetaPropsEdit.js +368 -0
  69. package/es/comps/MetadataEdit/constant/index.js +69 -0
  70. package/es/comps/MetadataEdit/hooks/index.js +43 -0
  71. package/es/comps/MetadataEdit/index.js +255 -0
  72. package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +237 -0
  73. package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +367 -0
  74. package/es/comps/MetadataEditV2/constant/index.js +69 -0
  75. package/es/comps/MetadataEditV2/hooks/index.js +43 -0
  76. package/es/comps/MetadataEditV2/index.js +298 -0
  77. package/es/comps/MetadataForm/DataCell/Array.js +148 -0
  78. package/es/comps/MetadataForm/DataCell/Input.js +199 -0
  79. package/es/comps/MetadataForm/DataCell/Number.js +131 -0
  80. package/es/comps/MetadataForm/DataCell/Ref.js +326 -0
  81. package/es/comps/MetadataForm/DataCell/Select.js +558 -0
  82. package/es/comps/MetadataForm/DataCell/Switch.js +116 -0
  83. package/es/comps/MetadataForm/DataCell/layout/TableArray.js +359 -0
  84. package/es/comps/MetadataForm/HOC/index.js +126 -0
  85. package/es/comps/MetadataForm/constants.js +11 -0
  86. package/es/comps/MetadataForm/hooks/index.js +139 -0
  87. package/es/comps/MetadataForm/index.js +268 -0
  88. package/es/comps/MetadataForm/interface.d.ts +2 -1
  89. package/es/comps/MetadataForm/interface.js +8 -0
  90. package/es/comps/MetadataForm/utils.js +112 -0
  91. package/es/comps/locales/en-US.js +24 -0
  92. package/es/comps/locales/index.js +8 -0
  93. package/es/comps/locales/zh-CN.js +24 -0
  94. package/es/config.js +50 -0
  95. package/es/framework/graph/index.js +515 -0
  96. package/es/framework/hooks/use-async-memo.js +32 -0
  97. package/es/framework/hooks/use-sync-scroll.js +106 -0
  98. package/es/framework/http/cache.js +137 -0
  99. package/es/framework/http/cancel.js +44 -0
  100. package/es/framework/http/index.js +392 -0
  101. package/es/framework/http/msgpack.js +34 -0
  102. package/es/framework/http/msgpack5/index.js +84 -0
  103. package/es/framework/http/msgpack5/lib/codecs/DateCodec.js +71 -0
  104. package/es/framework/http/msgpack5/lib/decoder.js +287 -0
  105. package/es/framework/http/msgpack5/lib/encoder.js +252 -0
  106. package/es/framework/http/msgpack5/lib/helpers.js +23 -0
  107. package/es/framework/http/msgpack5/lib/streams.js +93 -0
  108. package/es/framework/http/types.js +1 -0
  109. package/es/framework/libs/jquery.min.js +4022 -0
  110. package/es/framework/locale/dil8/di18n.js +132 -0
  111. package/es/framework/locale/dil8/index.js +3 -0
  112. package/es/framework/locale/dil8/translate.js +76 -0
  113. package/es/framework/locale/dil8/util.js +17 -0
  114. package/es/framework/locale/index.js +26 -0
  115. package/es/framework/metadata/MetadataService.js +169 -0
  116. package/es/framework/metadata/index.js +384 -0
  117. package/es/framework/rxjs-hooks/useMemoSubject.js +16 -0
  118. package/es/framework/rxjs-hooks/useObservable.js +22 -0
  119. package/es/framework/rxjs-hooks/useObservableState.js +45 -0
  120. package/es/index.js +27 -0
  121. package/es/utils.js +138 -0
  122. package/package.json +1 -1
@@ -0,0 +1,367 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+
3
+ /*
4
+ * @Author: wangxian
5
+ * @Date: 2023-02-06 08:24:17
6
+ * @LastEditTime: 2023-02-27 10:08:44
7
+ */
8
+ import { RefRule, Rule } from './ruleConfig';
9
+ export var inputSchema = [{
10
+ id: 'inputSchema',
11
+ type: 'object',
12
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
13
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
14
+ }];
15
+ export var textareaSchema = [{
16
+ id: 'textareaSchema',
17
+ type: 'object',
18
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
19
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
20
+ }];
21
+ export var dateSchema = [{
22
+ id: 'dateSchema',
23
+ type: 'object',
24
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
25
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.text.types), _toConsumableArray(RefRule.common.rules.types))
26
+ }];
27
+ export var numberSchema = [{
28
+ id: 'numberSchema',
29
+ type: 'object',
30
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
31
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
32
+ }];
33
+ export var switchSchema = [{
34
+ id: 'switchSchema',
35
+ type: 'object',
36
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
37
+ types: _toConsumableArray(RefRule.common.depend.types)
38
+ }];
39
+ export var selectSchema = [{
40
+ id: 'selectSchema',
41
+ type: 'object',
42
+ properties: [Rule.common.id, Rule.common.label, RefRule.enum.props, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
43
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.enum.types))
44
+ }];
45
+ export var colorSchema = [{
46
+ id: 'colorSchema',
47
+ type: 'object',
48
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
49
+ types: _toConsumableArray(RefRule.common.depend.types)
50
+ }];
51
+ export var passwordSchema = [{
52
+ id: 'passwordSchema',
53
+ type: 'object',
54
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
55
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
56
+ }];
57
+ export var uploadSchema = [{
58
+ id: 'uploadSchema',
59
+ type: 'object',
60
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, RefRule.common.depend.props],
61
+ types: _toConsumableArray(RefRule.common.depend.types)
62
+ }];
63
+ export var checkboxSchema = [{
64
+ id: 'checkboxSchema',
65
+ type: 'object',
66
+ properties: [Rule.common.id, Rule.common.label, RefRule.enum.props, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
67
+ types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.enum.types))
68
+ }];
69
+ export var settingSchema = {
70
+ input: inputSchema,
71
+ textarea: textareaSchema,
72
+ date: dateSchema,
73
+ numebr: numberSchema,
74
+ switch: switchSchema,
75
+ select: selectSchema,
76
+ color: colorSchema,
77
+ password: passwordSchema,
78
+ upload: uploadSchema
79
+ };
80
+ export var inputParam = {
81
+ type: 'text',
82
+ schema: settingSchema.input
83
+ };
84
+ export var textareaParam = {
85
+ type: 'text',
86
+ schema: settingSchema.textarea,
87
+ rule: {
88
+ type: 'textarea'
89
+ }
90
+ };
91
+ export var dateParam = {
92
+ type: 'text',
93
+ schema: settingSchema.date,
94
+ rule: {
95
+ type: 'datePicker'
96
+ }
97
+ };
98
+ export var numberParam = {
99
+ type: 'number',
100
+ schema: settingSchema.numebr
101
+ };
102
+ export var switchParam = {
103
+ type: 'bool',
104
+ schema: settingSchema.switch
105
+ };
106
+ export var selectParam = {
107
+ type: 'enum',
108
+ schema: settingSchema.select
109
+ };
110
+ export var mutiSelectParam = {
111
+ type: 'enum',
112
+ schema: settingSchema.select,
113
+ rule: {
114
+ isMutiple: true
115
+ }
116
+ }; // 基础组件列表渲染
117
+
118
+ export var basicComps = [{
119
+ id: 'input',
120
+ name: '输入框',
121
+ type: 'input',
122
+ param: inputParam
123
+ }, {
124
+ id: 'textarea',
125
+ name: '文本框',
126
+ type: 'textarea',
127
+ param: textareaParam
128
+ }, {
129
+ id: 'date',
130
+ name: '日期选择',
131
+ type: 'date',
132
+ param: dateParam
133
+ }, {
134
+ id: 'number',
135
+ name: '数字输入框',
136
+ type: 'number',
137
+ param: numberParam
138
+ }, {
139
+ id: 'switch',
140
+ name: '开关',
141
+ type: 'switch',
142
+ param: switchParam
143
+ }, {
144
+ id: 'select',
145
+ name: '下拉单选',
146
+ type: 'select',
147
+ param: selectParam
148
+ }, {
149
+ id: 'mutiSelect',
150
+ name: '下拉多选',
151
+ type: 'mutiSelect',
152
+ param: mutiSelectParam
153
+ }];
154
+ export var colorParam = {
155
+ type: 'text',
156
+ schema: settingSchema.color,
157
+ rule: {
158
+ type: 'colorPicker'
159
+ }
160
+ };
161
+ export var passwordParam = {
162
+ type: 'text',
163
+ schema: settingSchema.password,
164
+ rule: {
165
+ type: 'password'
166
+ }
167
+ };
168
+ export var uploadParam = {
169
+ type: 'text',
170
+ schema: settingSchema.upload,
171
+ rule: {
172
+ type: 'upload'
173
+ }
174
+ };
175
+ export var checkboxParam = {
176
+ type: 'enum',
177
+ schema: settingSchema.select,
178
+ rule: {
179
+ type: 'checkbox'
180
+ }
181
+ };
182
+ export var radioParam = {
183
+ type: 'enum',
184
+ schema: settingSchema.select,
185
+ rule: {
186
+ type: 'checkbox'
187
+ }
188
+ }; // 基础组件列表渲染
189
+
190
+ export var complexComps = [{
191
+ id: 'color',
192
+ name: '颜色选择',
193
+ type: 'color',
194
+ param: colorParam
195
+ }, {
196
+ id: 'password',
197
+ name: '密码框',
198
+ type: 'password',
199
+ param: passwordParam
200
+ }, {
201
+ id: 'upload',
202
+ name: '上传',
203
+ type: 'upload',
204
+ param: uploadParam
205
+ }, {
206
+ id: 'checkbox',
207
+ name: '多选框',
208
+ type: 'checkbox',
209
+ param: checkboxParam
210
+ }, {
211
+ id: 'radio',
212
+ name: '单选框',
213
+ type: 'radio',
214
+ param: radioParam
215
+ }];
216
+ export var objParam = {
217
+ type: 'ref',
218
+ schema: settingSchema.input
219
+ };
220
+ export var listParam = {
221
+ type: 'array',
222
+ schema: settingSchema.input
223
+ };
224
+ export var tableParam = {
225
+ type: 'array',
226
+ schema: settingSchema.input,
227
+ rule: {
228
+ layout: 'table'
229
+ }
230
+ }; // 布局组件列表渲染
231
+
232
+ export var layoutComps = [{
233
+ id: 'obj',
234
+ name: '对象',
235
+ type: 'obj',
236
+ param: objParam
237
+ }, {
238
+ id: 'list',
239
+ name: '常规列表',
240
+ type: 'list',
241
+ param: listParam
242
+ }, {
243
+ id: 'table',
244
+ name: '表格',
245
+ type: 'table',
246
+ param: tableParam
247
+ }]; // Sidebar 内容配置
248
+
249
+ export var sidebarCtx = [{
250
+ name: '基础组件',
251
+ children: basicComps
252
+ }, {
253
+ name: '高级组件',
254
+ children: complexComps
255
+ }, {
256
+ name: '布局组件',
257
+ children: layoutComps
258
+ }];
259
+ export var dragItemType = 'fg-drag';
260
+ export var formSettingSchema = [{
261
+ id: 'formSettingSchema',
262
+ type: 'object',
263
+ properties: [{
264
+ id: 'colSpan',
265
+ type: 'enum',
266
+ fields: [{
267
+ id: 'Rule.Form',
268
+ refId: 'com.ronds.schema.default.Rule.Form',
269
+ type: 'ref',
270
+ value: {
271
+ 'common-en-US': {
272
+ depend: {}
273
+ },
274
+ common: {
275
+ label: '整体布局',
276
+ placeholder: '默认布局(一行一列)',
277
+ depend: {}
278
+ },
279
+ enum: {
280
+ value: [{
281
+ key: 24,
282
+ value: '一行一列'
283
+ }, {
284
+ key: 12,
285
+ value: '一行两列'
286
+ }, {
287
+ key: 8,
288
+ value: '一行三列'
289
+ }, {
290
+ key: 6,
291
+ value: '一行四列'
292
+ }],
293
+ http: {}
294
+ }
295
+ }
296
+ }]
297
+ }, {
298
+ id: 'layout',
299
+ type: 'enum',
300
+ fields: [{
301
+ id: 'Rule.Form',
302
+ refId: 'com.ronds.schema.default.Rule.Form',
303
+ type: 'ref',
304
+ value: {
305
+ 'common-en-US': {
306
+ depend: {}
307
+ },
308
+ common: {
309
+ label: '标签展示模式',
310
+ depend: {}
311
+ },
312
+ enum: {
313
+ value: [{
314
+ value: '同行',
315
+ key: 'horizontal'
316
+ }, {
317
+ value: '单独一行',
318
+ key: 'vertical'
319
+ }],
320
+ type: 'checkbox',
321
+ http: {}
322
+ }
323
+ }
324
+ }]
325
+ }, {
326
+ id: 'labelSpan',
327
+ type: 'number',
328
+ fields: [{
329
+ id: 'Rule.Form',
330
+ refId: 'com.ronds.schema.default.Rule.Form',
331
+ type: 'ref',
332
+ value: {
333
+ 'common-en-US': {
334
+ depend: {}
335
+ },
336
+ common: {
337
+ label: '标签宽度',
338
+ help: '不填自适应默认宽度',
339
+ depend: {}
340
+ }
341
+ }
342
+ }]
343
+ }]
344
+ }];
345
+ export var formSetting = {
346
+ id: 'formSetting',
347
+ name: '表单配置',
348
+ type: 'form',
349
+ param: {
350
+ type: 'form',
351
+ schema: formSettingSchema,
352
+ defaultValue: {
353
+ colSpan: 24,
354
+ layout: 'vertical'
355
+ }
356
+ }
357
+ };
358
+ export var streamEventType = {
359
+ onNodeSelect: 'onNodeSelect',
360
+ onNodeDelete: 'onNodeDelete',
361
+ onNodeCopy: 'onNodeCopy',
362
+ onClearCanvas: 'onClearCanvas',
363
+ onSettingValueChange: 'onSettingValueChange',
364
+ onTypesChange: 'onTypesChange',
365
+ onDropOver: 'onDropOver',
366
+ onDefaultValue: 'onDefaultValue'
367
+ };