@steedos-widgets/ag-grid 6.3.11 → 6.3.12-beta.10

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.
package/dist/meta.js CHANGED
@@ -30,7 +30,7 @@
30
30
  return __assign.apply(this, arguments);
31
31
  };
32
32
 
33
- var config = {
33
+ var config$1 = {
34
34
  group: "华炎魔方-原子组件",
35
35
  componentName: "AmisAgGrid",
36
36
  title: "AG-Grid",
@@ -54,32 +54,32 @@
54
54
  icon: "fa-fw fa fa-list-alt"
55
55
  }
56
56
  };
57
- var AgGrid = __assign(__assign({}, config), { snippets: [
57
+ var AgGrid = __assign(__assign({}, config$1), { snippets: [
58
58
  {
59
- title: config.title,
59
+ title: config$1.title,
60
60
  screenshot: "",
61
61
  schema: {
62
- componentName: config.componentName,
63
- props: config.preview
62
+ componentName: config$1.componentName,
63
+ props: config$1.preview
64
64
  }
65
65
  }
66
66
  ], amis: {
67
67
  render: {
68
- type: config.amis.name,
68
+ type: config$1.amis.name,
69
69
  usage: "renderer",
70
70
  weight: 1,
71
71
  framework: "react"
72
72
  },
73
73
  plugin: {
74
- rendererName: config.amis.name,
74
+ rendererName: config$1.amis.name,
75
75
  $schema: '/schemas/UnkownSchema.json',
76
- name: config.title,
77
- description: config.title,
78
- tags: [config.group],
76
+ name: config$1.title,
77
+ description: config$1.title,
78
+ tags: [config$1.group],
79
79
  order: -9999,
80
- icon: config.amis.icon,
80
+ icon: config$1.amis.icon,
81
81
  scaffold: {
82
- type: config.amis.name,
82
+ type: config$1.amis.name,
83
83
  className: "h-80",
84
84
  config: {
85
85
  // Row Data: The data to be displayed.
@@ -98,7 +98,7 @@
98
98
  },
99
99
  },
100
100
  previewSchema: {
101
- type: config.amis.name,
101
+ type: config$1.amis.name,
102
102
  },
103
103
  panelTitle: "设置",
104
104
  panelControls: [
@@ -139,16 +139,411 @@
139
139
  /*
140
140
  * @Author: baozhoutao@steedos.com
141
141
  * @Date: 2022-08-31 16:32:35
142
- * @LastEditors: baozhoutao@steedos.com
143
- * @LastEditTime: 2022-09-01 18:46:29
142
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
143
+ * @LastEditTime: 2024-12-25 15:15:17
144
+ * @Description:
145
+ */
146
+ var config = {
147
+ componentType: 'amisSchema',
148
+ group: "华炎魔方",
149
+ componentName: "AmisTablesGrid",
150
+ title: "Tables Grid",
151
+ docUrl: "",
152
+ screenshot: "",
153
+ npm: {
154
+ package: "@steedos-widgets/ag-grid",
155
+ version: "{{version}}",
156
+ exportName: "AmisTablesGrid",
157
+ main: "",
158
+ destructuring: true,
159
+ subName: ""
160
+ },
161
+ props: [
162
+ {
163
+ name: "tableId",
164
+ propType: "string",
165
+ description: '表格ID',
166
+ },
167
+ {
168
+ name: "columns",
169
+ propType: "array",
170
+ description: '显示列',
171
+ },
172
+ {
173
+ name: "amisCondition",
174
+ propType: "object",
175
+ description: '过滤条件',
176
+ },
177
+ {
178
+ name: "sortField",
179
+ propType: "string",
180
+ description: '排序字段',
181
+ },
182
+ {
183
+ name: "sortOrder",
184
+ propType: "string",
185
+ description: '排序顺序',
186
+ },
187
+ {
188
+ name: "top",
189
+ propType: "number",
190
+ description: '显示的记录数量',
191
+ },
192
+ {
193
+ name: "requestAdaptor",
194
+ propType: "string",
195
+ description: '发送适配器',
196
+ },
197
+ {
198
+ name: "adaptor",
199
+ propType: "string",
200
+ description: '接收适配器',
201
+ }
202
+ ],
203
+ preview: {},
204
+ targets: ["steedos__RecordPage", "steedos__AppPage", "steedos__HomePage"],
205
+ engines: ["amis"],
206
+ // settings for amis.
207
+ amis: {
208
+ name: 'steedos-tables-grid',
209
+ icon: "fa-fw fa fa-list-alt"
210
+ }
211
+ };
212
+ var AmisTablesGrid = __assign(__assign({}, config), { snippets: [
213
+ {
214
+ title: config.title,
215
+ screenshot: "",
216
+ schema: {
217
+ componentName: config.componentName,
218
+ props: config.preview
219
+ }
220
+ }
221
+ ], amis: {
222
+ render: {
223
+ type: config.amis.name,
224
+ usage: "renderer",
225
+ weight: 1,
226
+ framework: "react"
227
+ },
228
+ plugin: {
229
+ rendererName: config.amis.name,
230
+ $schema: '/schemas/UnkownSchema.json',
231
+ name: config.title,
232
+ description: config.title,
233
+ tags: [config.group],
234
+ order: -9999,
235
+ icon: config.amis.icon,
236
+ scaffold: {
237
+ type: config.amis.name,
238
+ label: config.title,
239
+ objectApiName: "${objectName}",
240
+ fields: ["name"],
241
+ // className: "sm:border sm:rounded sm:border-gray-300"
242
+ },
243
+ previewSchema: {
244
+ type: config.amis.name,
245
+ objectApiName: 'space_users',
246
+ fields: ["name"]
247
+ },
248
+ panelTitle: "设置",
249
+ panelControls: [
250
+ {
251
+ "type": "tabs",
252
+ tabsMode: 'line',
253
+ className: 'editor-prop-config-tabs',
254
+ linksClassName: 'editor-prop-config-tabs-links',
255
+ contentClassName: 'no-border editor-prop-config-tabs-cont',
256
+ tabs: [
257
+ {
258
+ "title": "属性",
259
+ className: 'p-none',
260
+ "body": [
261
+ {
262
+ "type": "collapse-group",
263
+ expandIconPosition: 'right',
264
+ expandIcon: {
265
+ type: 'icon',
266
+ icon: 'chevron-right'
267
+ },
268
+ className: 'ae-formItemControl',
269
+ "activeKey": [
270
+ "1",
271
+ ],
272
+ "body": [
273
+ {
274
+ "type": "collapse",
275
+ headingClassName: 'ae-formItemControl-header',
276
+ bodyClassName: 'ae-formItemControl-body',
277
+ "key": "1",
278
+ "header": "基本",
279
+ "body": [
280
+ {
281
+ "type": "select",
282
+ "label": "对象",
283
+ "name": "objectApiName",
284
+ "searchable": true,
285
+ "multiple": false,
286
+ "source": {
287
+ "method": "get",
288
+ "url": "/service/api/amis-design/objects",
289
+ "requestAdaptor": "api.url = Builder.settings.rootUrl + api.url; if(!api.headers){api.headers = {}};api.headers.Authorization='Bearer ' + Builder.settings.tenantId + ',' + Builder.settings.authToken ;return api;",
290
+ "adaptor": "\n let data = payload.data;\n payload.unshift({\n label: \"\u5F53\u524D\u5BF9\u8C61\",\n name: \"${objectName}\",\n NAME_FIELD_KEY: \"name\"\n });\n return payload;\n "
291
+ },
292
+ "labelField": "label",
293
+ "valueField": "name",
294
+ "menuTpl": "",
295
+ "onEvent": {
296
+ "change": {
297
+ "actions": [
298
+ {
299
+ "componentId": "transfer-picker-fields",
300
+ "actionType": "setValue",
301
+ "args": {
302
+ "value": "${(NAME_FIELD_KEY || 'name')|asArray}"
303
+ }
304
+ }
305
+ ]
306
+ }
307
+ }
308
+ },
309
+ {
310
+ type: "transfer-picker",
311
+ name: "fields",
312
+ label: "显示的字段",
313
+ id: "transfer-picker-fields",
314
+ // mode: 'horizontal',
315
+ // horizontal: {
316
+ // left: 4,
317
+ // right: 8,
318
+ // justify: true
319
+ // },
320
+ // visibleOn: "this.fieldsControl === 'excluded'",
321
+ "options": [],
322
+ "multiple": true,
323
+ "source": {
324
+ "method": "get",
325
+ "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${objectApiName}/fields/options",
326
+ "headers": {
327
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
328
+ },
329
+ "data": {
330
+ "objectName": "${objectName || 'space_users'}"
331
+ },
332
+ "requestAdaptor": "api.url = api.url.replaceAll('${objectName}',api.body.objectName); return api;",
333
+ "adaptor": "",
334
+ "sendOn": "this.objectApiName"
335
+ },
336
+ "className": "col-span-2 m-0",
337
+ "checkAll": true,
338
+ "searchable": true,
339
+ "sortable": true,
340
+ "joinValues": false,
341
+ "extractValue": true,
342
+ },
343
+ {
344
+ type: "editor",
345
+ name: "fieldsExtend",
346
+ label: "重写字段配置",
347
+ "options": {
348
+ "lineNumbers": "off"
349
+ },
350
+ // mode: 'horizontal',
351
+ // horizontal: {
352
+ // left: 4,
353
+ // right: 8,
354
+ // justify: true
355
+ // },
356
+ language: "json",
357
+ // visibleOn: "this.fieldsControl === 'included'"
358
+ },
359
+ {
360
+ type: "button-group-select",
361
+ name: "crudMode",
362
+ label: "显示模式",
363
+ value: "table",
364
+ options: [
365
+ {
366
+ "label": "表格",
367
+ "value": "table"
368
+ },
369
+ {
370
+ "label": "卡片",
371
+ "value": "cards"
372
+ }
373
+ ]
374
+ }
375
+ ]
376
+ },
377
+ {
378
+ "type": "collapse",
379
+ headingClassName: 'ae-formItemControl-header',
380
+ bodyClassName: 'ae-formItemControl-body',
381
+ "key": "2",
382
+ "header": "数据接口",
383
+ "body": [
384
+ {
385
+ type: "editor",
386
+ name: "requestAdaptor",
387
+ label: "发送适配器",
388
+ language: "javascript",
389
+ description: "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。"
390
+ },
391
+ {
392
+ type: "editor",
393
+ name: "adaptor",
394
+ label: "接收适配器",
395
+ language: "javascript",
396
+ description: "函数签名: (payload, response, api) => payload"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "type": "collapse",
402
+ headingClassName: 'ae-formItemControl-header',
403
+ bodyClassName: 'ae-formItemControl-body',
404
+ "key": "3",
405
+ "header": "高级",
406
+ "body": [
407
+ {
408
+ type: "editor",
409
+ name: "crudDataFilter",
410
+ label: "CRUD",
411
+ description: ""
412
+ },
413
+ {
414
+ "type": "markdown",
415
+ "value": "如果需要对组件原始返回的crud进行加工,可以自己写一段函数脚本来实现。\n\n函数签名:(crud, env, data) => crud\n\n参数说明:\n\ncrud 组件原始返回的crud schema\n\nenv amis env,可以调用env.fetcher函数实现异步请求\n\ndata 数据域中的data\n\n返回值:\n\n最后需要返回加工后的crud schema\n\n示例:\n\n```\nconsole.log('data===>', data);\nconst api = ...;\nreturn env.fetcher(api, {}).then((result) => {\n console.log(result);\n crud.columns.push({'label': 'xxx', name: 'xxx'});\n return crud;\n});\n\n```\n",
416
+ "className": "text-gray-500"
417
+ }
418
+ ]
419
+ }
420
+ ]
421
+ }
422
+ ]
423
+ },
424
+ {
425
+ "title": "外观",
426
+ className: 'p-none',
427
+ "body": [
428
+ {
429
+ "type": "collapse-group",
430
+ expandIconPosition: 'right',
431
+ expandIcon: {
432
+ type: 'icon',
433
+ icon: 'chevron-right'
434
+ },
435
+ className: 'ae-formItemControl',
436
+ "activeKey": [
437
+ "1"
438
+ ],
439
+ "body": [
440
+ {
441
+ "type": "collapse",
442
+ headingClassName: 'ae-formItemControl-header',
443
+ bodyClassName: 'ae-formItemControl-body',
444
+ "key": "1",
445
+ "header": "CSS 类名",
446
+ "body": [
447
+ {
448
+ type: "input-text",
449
+ name: "className",
450
+ mode: 'horizontal',
451
+ horizontal: {
452
+ left: 4,
453
+ right: 8,
454
+ justify: true
455
+ },
456
+ label: "表格",
457
+ value: "my-2"
458
+ }
459
+ ]
460
+ },
461
+ ]
462
+ }
463
+ ]
464
+ },
465
+ {
466
+ "title": "过滤",
467
+ className: '',
468
+ "body": [
469
+ {
470
+ "type": "condition-builder",
471
+ "name": "amisCondition",
472
+ "label": "过滤条件",
473
+ "source": {
474
+ "method": "get",
475
+ "url": "/service/api/amis-metadata-listviews/getFilterFields?objectName=${objectApiName === '${objectName}' ? 'space_users' : objectApiName}",
476
+ "requestAdaptor": "api.url = Builder.settings.rootUrl + api.url; if(!api.headers){api.headers = {}};api.headers.Authorization='Bearer ' + Builder.settings.tenantId + ',' + Builder.settings.authToken ;return api;",
477
+ "dataType": "json"
478
+ },
479
+ "en-US": {
480
+ "label": "Filters Conditions"
481
+ }
482
+ }
483
+ ]
484
+ },
485
+ {
486
+ "title": "其他",
487
+ className: '',
488
+ "body": [
489
+ {
490
+ "type": "select",
491
+ "label": "排序字段",
492
+ "name": "sortField",
493
+ "searchable": true,
494
+ "multiple": false,
495
+ "source": {
496
+ "method": "get",
497
+ "data": {
498
+ "objectName": "${objectName || 'space_users'}",
499
+ },
500
+ "sendOn": "this.objectApiName",
501
+ "url": "/service/api/amis-metadata-objects/objects/${objectApiName}/fields/options",
502
+ "requestAdaptor": "api.url = Builder.settings.rootUrl + api.url.replaceAll('${objectName}',api.body.objectName); if(!api.headers){api.headers = {}};api.headers.Authorization='Bearer ' + Builder.settings.tenantId + ',' + Builder.settings.authToken ;return api;"
503
+ },
504
+ "labelField": "label",
505
+ "valueField": "value",
506
+ "menuTpl": ""
507
+ },
508
+ {
509
+ "type": "select",
510
+ "name": "sortOrder",
511
+ "label": "排序顺序",
512
+ "options": [{
513
+ "label": "升序",
514
+ "value": "asc"
515
+ }, {
516
+ "label": "倒序",
517
+ "value": "desc"
518
+ }]
519
+ },
520
+ {
521
+ "type": "input-number",
522
+ "name": "top",
523
+ "label": "显示的记录数量",
524
+ "labelRemark": "即TOP,配置该属性后不再支持翻页,始终显示该属性值配置的记录数"
525
+ }
526
+ ]
527
+ }
528
+ ]
529
+ }
530
+ ]
531
+ }
532
+ } });
533
+
534
+ /*
535
+ * @Author: baozhoutao@steedos.com
536
+ * @Date: 2022-08-31 16:32:35
537
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
538
+ * @LastEditTime: 2024-12-25 14:59:55
144
539
  * @Description:
145
540
  */
146
- var components = [AgGrid];
541
+ var components = [AgGrid, AmisTablesGrid];
147
542
  var componentList = [
148
543
  {
149
544
  title: "华炎魔方",
150
545
  icon: "",
151
- children: [AgGrid]
546
+ children: components
152
547
  }
153
548
  ];
154
549
  var meta = {
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import './TablesGrid.less';
2
+ export declare const AmisTablesGrid: (props: any) => Promise<any>;
@@ -0,0 +1 @@
1
+ export * from './TablesGrid';