@next-bricks/advanced 0.1.6 → 0.1.8

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 (31) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/{3494.19c575cb.js → 3494.1c07d0cf.js} +2 -2
  3. package/dist/chunks/{3494.19c575cb.js.map → 3494.1c07d0cf.js.map} +1 -1
  4. package/dist/chunks/4131.1c3d2509.js +2 -0
  5. package/dist/chunks/4131.1c3d2509.js.map +1 -0
  6. package/dist/chunks/{4991.bf91c270.js → 4991.2917f2f4.js} +2 -2
  7. package/dist/chunks/{4991.bf91c270.js.map → 4991.2917f2f4.js.map} +1 -1
  8. package/dist/chunks/{6205.48061ae8.js → 6205.11bde3db.js} +2 -2
  9. package/dist/chunks/{6205.48061ae8.js.map → 6205.11bde3db.js.map} +1 -1
  10. package/dist/chunks/{7164.6d634367.js → 7164.95c39448.js} +2 -2
  11. package/dist/chunks/{7164.6d634367.js.map → 7164.95c39448.js.map} +1 -1
  12. package/dist/chunks/{7822.9f535e3b.js → 7822.f2e90091.js} +2 -2
  13. package/dist/chunks/{7822.9f535e3b.js.map → 7822.f2e90091.js.map} +1 -1
  14. package/dist/chunks/9079.636199a0.js +2 -0
  15. package/dist/chunks/9079.636199a0.js.map +1 -0
  16. package/dist/chunks/general-table.48f298d6.js +2 -0
  17. package/dist/chunks/general-table.48f298d6.js.map +1 -0
  18. package/dist/chunks/{main.fa2baef1.js → main.5f90e5fe.js} +2 -2
  19. package/dist/chunks/{main.fa2baef1.js.map → main.5f90e5fe.js.map} +1 -1
  20. package/dist/{index.43f728f6.js → index.0df7e8b1.js} +2 -2
  21. package/dist/{index.43f728f6.js.map → index.0df7e8b1.js.map} +1 -1
  22. package/dist/manifest.json +58 -136
  23. package/dist-types/table/index.d.ts +51 -151
  24. package/docs/general-table.md +622 -0
  25. package/package.json +2 -2
  26. package/dist/chunks/2255.9dcb87b1.js +0 -2
  27. package/dist/chunks/2255.9dcb87b1.js.map +0 -1
  28. package/dist/chunks/9079.7d7df911.js +0 -2
  29. package/dist/chunks/9079.7d7df911.js.map +0 -1
  30. package/dist/chunks/general-table.617af895.js +0 -2
  31. package/dist/chunks/general-table.617af895.js.map +0 -1
@@ -0,0 +1,622 @@
1
+ 通用表格构件。
2
+
3
+ ```yaml preveiw
4
+ - brick: advanced.general-table
5
+ events:
6
+ filter.update:
7
+ action: console.log
8
+ page.update:
9
+ action: console.log
10
+ select.update:
11
+ action: console.log
12
+ select.update.args:
13
+ action: console.log
14
+ properties:
15
+ columns:
16
+ - dataIndex: name
17
+ key: name
18
+ title: Name
19
+ - dataIndex: age
20
+ key: age
21
+ title: Age
22
+ - dataIndex: address
23
+ key: address
24
+ title: Address
25
+ - dataIndex: tags
26
+ key: tags
27
+ title: Tags
28
+ dataSource:
29
+ list:
30
+ - address: New York No. 1 Lake Park
31
+ age: 32
32
+ id: "1"
33
+ name: John Brown
34
+ tags:
35
+ - nice
36
+ - good
37
+ - address: London No. 1 Lake Park
38
+ age: 42
39
+ id: "2"
40
+ name: Jim Green
41
+ tags:
42
+ - loser
43
+ - bad
44
+ page: 1
45
+ pageSize: 10
46
+ total: 2
47
+ hiddenColumns:
48
+ - name
49
+ rowKey: id
50
+ rowSelection: true
51
+ showCard: false
52
+ ```
53
+
54
+ ## Examples
55
+
56
+ ### Expand & Sort
57
+
58
+ ```yaml preveiw
59
+ - brick: advanced.general-table
60
+ events:
61
+ expand.rows.change:
62
+ action: console.log
63
+ row.expand:
64
+ action: console.log
65
+ sort.update:
66
+ - properties:
67
+ expandedRowKeys: []
68
+ target: "#expandable-and-sortable-demo"
69
+ properties:
70
+ columns:
71
+ - dataIndex: name
72
+ sorter: true
73
+ title: Pod 名称
74
+ - dataIndex: status
75
+ title: 状态
76
+ - dataIndex: ip
77
+ title: 实例 IP
78
+ dataSource:
79
+ list:
80
+ - containerList:
81
+ - name: container-1
82
+ number: 1
83
+ - name: container-2
84
+ number: 2
85
+ id: "1"
86
+ ip: 192.168.100.1
87
+ name: RG-deployment-1
88
+ status: 运行中
89
+ - containerList:
90
+ - name: container-5
91
+ number: 5
92
+ id: "3"
93
+ ip: 192.168.100.3
94
+ name: RG-deployment-3
95
+ status: 推出成功
96
+ - containerList:
97
+ - name: container-3
98
+ number: 3
99
+ - name: container-4
100
+ number: 4
101
+ id: "2"
102
+ ip: 192.168.100.2
103
+ name: RG-deployment-2
104
+ status: 准备中
105
+ page: 1
106
+ pageSize: 10
107
+ total: 3
108
+ expandedRowBrick:
109
+ useBrick:
110
+ brick: advanced.general-table
111
+ properties:
112
+ columns:
113
+ - dataIndex: name
114
+ title: 容器名称
115
+ - dataIndex: number
116
+ title: 重启次数
117
+ - dataIndex: operate
118
+ key: operate
119
+ title: 操作
120
+ useBrick:
121
+ brick: basic.general-link
122
+ events:
123
+ click:
124
+ action: console.log
125
+ args:
126
+ - <% DATA.rowData %>
127
+ properties:
128
+ icon:
129
+ icon: tools
130
+ lib: fa
131
+ prefix: fas
132
+ configProps:
133
+ bordered: false
134
+ dataSource:
135
+ list: <% DATA.rowData.containerList %>
136
+ pagination: false
137
+ showCard: false
138
+ style:
139
+ background: "#f5f5f5"
140
+ rowKey: id
141
+ ```
142
+
143
+ ### Custom Expand Icon
144
+
145
+ ```yaml preview
146
+ - brick: advanced.general-table
147
+ events:
148
+ expand.rows.change:
149
+ action: console.log
150
+ row.expand:
151
+ action: console.log
152
+ properties:
153
+ columns:
154
+ - dataIndex: name
155
+ title: 名称
156
+ - dataIndex: resourcePool
157
+ title: 所属资源池
158
+ - dataIndex: ip
159
+ title: 路由地址
160
+ - dataIndex: rulesDesc
161
+ title: 转发规则
162
+ dataSource:
163
+ list:
164
+ - id: "1"
165
+ ip: 105.33.44.123
166
+ name: 构建任务1
167
+ resourcePool: pool1
168
+ rules:
169
+ - path: /cmdb
170
+ port: 80
171
+ service: cmdb-service
172
+ - path: /tool
173
+ port: 80
174
+ service: tool
175
+ rulesDesc: 点击查看两条转发规则
176
+ - id: "2"
177
+ ip: 105.33.44.122
178
+ name: 构建任务2
179
+ resourcePool: pool2
180
+ rules:
181
+ - path: /topboard
182
+ port: 80
183
+ service: topboard
184
+ rulesDesc: 点击查看一条转发规则
185
+ page: 1
186
+ pageSize: 10
187
+ total: 2
188
+ expandIcon:
189
+ collapsedIcon:
190
+ icon: angle-double-up
191
+ lib: fa
192
+ prefix: fas
193
+ expandedIcon:
194
+ icon: angle-double-down
195
+ lib: fa
196
+ prefix: fas
197
+ expandIconAsCell: false
198
+ expandIconColumnIndex: 3
199
+ expandedRowBrick:
200
+ useBrick:
201
+ - brick: presentational.general-descriptions
202
+ properties:
203
+ list:
204
+ - label: "协议:"
205
+ text: HTTP
206
+ - label: "监听端口:"
207
+ text: 8080
208
+ - label: 系统
209
+ text: Linus
210
+ - label: 线程
211
+ text: 8
212
+ rowKey: id
213
+ ```
214
+
215
+ ### Cell Status
216
+
217
+ ```yaml preview
218
+ - brick: advanced.general-table
219
+ events:
220
+ filter.update:
221
+ action: console.log
222
+ page.update:
223
+ action: console.log
224
+ select.update:
225
+ action: console.log
226
+ select.update.args:
227
+ action: console.log
228
+ properties:
229
+ columns:
230
+ - cellStatus:
231
+ dataIndex: status
232
+ mapping:
233
+ - leftBorderColor: green
234
+ value: success
235
+ - leftBorderColor: red
236
+ value: failed
237
+ - leftBorderColor: orange
238
+ value: warning
239
+ dataIndex: branch
240
+ title: 分支
241
+ useBrick:
242
+ brick: basic.general-link
243
+ properties:
244
+ textContent: <% DATA.cellData %>
245
+ - dataIndex: id
246
+ title: 编号
247
+ - dataIndex: pipeline
248
+ title: 流水线
249
+ - dataIndex: status
250
+ title: 状态
251
+ useBrick:
252
+ brick: basic.general-tag
253
+ properties:
254
+ textContent: <% DATA.cellData %>
255
+ dataSource:
256
+ list:
257
+ - branch: develop
258
+ id: "#7220"
259
+ pipeline: contract-center / build_giraffe_sdk
260
+ status: success
261
+ - branch: master
262
+ id: "#7221"
263
+ pipeline: container / demo
264
+ status: failed
265
+ - branch: feature
266
+ id: "#7222"
267
+ pipeline: container / table
268
+ status: warning
269
+ page: 1
270
+ pageSize: 10
271
+ total: 3
272
+ dataset:
273
+ testid: cell-status-and-filter-demo
274
+ filters:
275
+ status:
276
+ - failed
277
+ - warning
278
+ frontSearch: true
279
+ rowKey: id
280
+ shouldUpdateUrlParams: false
281
+ ```
282
+
283
+ ### Tree DataSource
284
+
285
+ ```yaml preview
286
+ - brick: advanced.general-table
287
+ events:
288
+ select.update:
289
+ action: console.log
290
+ properties:
291
+ columns:
292
+ - dataIndex: name
293
+ key: name
294
+ title: Name
295
+ - dataIndex: age
296
+ key: age
297
+ title: Age
298
+ - dataIndex: address
299
+ key: address
300
+ title: Address
301
+ - dataIndex: tags
302
+ key: tags
303
+ title: Tags
304
+ useBrick:
305
+ brick: basic.general-tag-list
306
+ properties:
307
+ showCard: false
308
+ list: <% DATA.cellData %>
309
+ color: var(--color-brand)
310
+ - dataIndex: operate
311
+ key: operate
312
+ title: 操作
313
+ useBrick:
314
+ - brick: basic.general-link
315
+ events:
316
+ link.click:
317
+ action: console.log
318
+ properties:
319
+ dataSource: <% DATA.rowData %>
320
+ textContent: 查看
321
+ - brick: basic.general-link
322
+ events:
323
+ link.click:
324
+ action: console.log
325
+ properties:
326
+ dataSource: <% DATA.rowData %>
327
+ textContent: 订阅警报
328
+ style:
329
+ marginLeft: 8px
330
+ - brick: basic.general-link
331
+ events:
332
+ link.click:
333
+ action: console.log
334
+ properties:
335
+ dataSource: <% DATA.rowData %>
336
+ textContent: 删除
337
+ labelColor: red
338
+ style:
339
+ marginLeft: 8px
340
+ dataSource:
341
+ list:
342
+ - address: New York No. 1 Lake Park
343
+ age: 60
344
+ children:
345
+ - address: New York No. 2 Lake Park
346
+ age: 50
347
+ children:
348
+ - address: New York No. 3 Lake Park
349
+ age: 25
350
+ id: "111"
351
+ name: John Brown jr.
352
+ tags:
353
+ - nice
354
+ - good
355
+ id: "11"
356
+ name: John Brown
357
+ tags:
358
+ - nice
359
+ - good
360
+ - address: New York No. 3 Lake Park
361
+ age: 45
362
+ id: "22"
363
+ name: Jimmy Brown
364
+ tags:
365
+ - nice
366
+ - good
367
+ id: "1"
368
+ name: John Brown sr.
369
+ tags:
370
+ - nice
371
+ - good
372
+ - address: London No. 1 Lake Park
373
+ age: 72
374
+ children:
375
+ - address: London No. 1 Lake Park
376
+ age: 42
377
+ id: dd
378
+ name: Jim Green
379
+ tags:
380
+ - nice
381
+ - good
382
+ id: "2"
383
+ name: Jim Green sr.
384
+ tags:
385
+ - loser
386
+ - bad
387
+ - address: Sidney No. 1 Lake Park
388
+ age: 32
389
+ id: "3"
390
+ name: Joe Black
391
+ tags:
392
+ - teacher
393
+ - lucky
394
+ - lay
395
+ page: 1
396
+ pageSize: 10
397
+ total: 7
398
+ defaultExpandAllRows: true
399
+ rowKey: id
400
+ rowSelection: true
401
+ ```
402
+
403
+ ### Drag to Sort
404
+
405
+ ```yaml preview
406
+ - brick: advanced.general-table
407
+ events:
408
+ row.drag:
409
+ action: console.log
410
+ select.update:
411
+ action: console.log
412
+ properties:
413
+ columns:
414
+ - dataIndex: packageName
415
+ title: 包名称
416
+ - dataIndex: installPath
417
+ title: 部署路径
418
+ - dataIndex: version
419
+ title: 版本
420
+ dataSource:
421
+ list:
422
+ - id: "1"
423
+ installPath: /usr/local/easyops/container
424
+ packageName: container
425
+ version: 1.10.0
426
+ - id: "2"
427
+ installPath: /usr/local/easyops/webshell
428
+ packageName: webshell
429
+ version: 1.0.0
430
+ - id: "3"
431
+ installPath: /usr/local/easyops/nginx
432
+ packageName: nginx
433
+ version: 3.6.0
434
+ dataset:
435
+ testid: draggable-sort-demo
436
+ pagination: false
437
+ rowKey: id
438
+ rowSelection: true
439
+ showCard: false
440
+ tableDraggable: true
441
+ ```
442
+
443
+ ### Frontend Search
444
+
445
+ ```yaml preview
446
+ - brick: containers.general-card
447
+ slots:
448
+ "":
449
+ bricks:
450
+ - brick: form.general-input
451
+ events:
452
+ change:
453
+ - action: console.log
454
+ - method: filterSourceData
455
+ target: "#front-search-table"
456
+ args:
457
+ - detail:
458
+ q: <% EVENT.detail %>
459
+ properties:
460
+ placeholder: 输入关键字搜索
461
+ - brick: advanced.general-table
462
+ events:
463
+ select.update:
464
+ action: console.log
465
+ properties:
466
+ columns:
467
+ - dataIndex: packageName
468
+ title: 包名称
469
+ - dataIndex: installPath
470
+ title: 部署路径
471
+ - dataIndex: version
472
+ title: 版本
473
+ dataSource:
474
+ list:
475
+ - id: "1"
476
+ installPath: /usr/local/easyops/container
477
+ packageName: container
478
+ version: 1.10.0
479
+ - id: "2"
480
+ installPath: /usr/local/easyops/webshell
481
+ packageName: webshell
482
+ version: 1.0.0
483
+ - id: "3"
484
+ installPath: /usr/local/easyops/nginx
485
+ packageName: nginx
486
+ version: 3.6.0
487
+ dataset:
488
+ testid: front-search-table
489
+ frontSearch: true
490
+ frontSearchFilterKeys:
491
+ - packageName
492
+ id: front-search-table
493
+ pagination: false
494
+ rowKey: id
495
+ rowSelection: true
496
+ shouldUpdateUrlParams: false
497
+ showCard: false
498
+ ```
499
+
500
+ ### Content Scroll
501
+
502
+ ```yaml preview
503
+ - brick: advanced.general-table
504
+ events:
505
+ select.update:
506
+ action: console.log
507
+ properties:
508
+ columns:
509
+ - dataIndex: packageName
510
+ title: 包名称
511
+ - dataIndex: installPath
512
+ title: 部署路径
513
+ - dataIndex: version
514
+ title: 版本
515
+ - dataIndex: description
516
+ title: 描述
517
+ dataSource:
518
+ list:
519
+ - description: >-
520
+ some
521
+ lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
522
+ content
523
+ id: "1"
524
+ installPath: /usr/local/easyops/container
525
+ packageName: container
526
+ version: 1.10.0
527
+ - description: some content
528
+ id: "2"
529
+ installPath: /usr/local/easyops/webshell
530
+ packageName: webshell
531
+ version: 1.0.0
532
+ - description: some content
533
+ id: "3"
534
+ installPath: /usr/local/easyops/nginx
535
+ packageName: nginx
536
+ version: 3.6.0
537
+ dataset:
538
+ testid: scroll-demo
539
+ rowKey: id
540
+ scrollConfigs:
541
+ x: true
542
+ ```
543
+
544
+ ### Checked
545
+
546
+ ```yaml preview
547
+ - brick: advanced.general-table
548
+ events:
549
+ select.update:
550
+ - action: console.log
551
+ args:
552
+ - "${EVENT.detail}"
553
+ properties:
554
+ columns:
555
+ - dataIndex: name
556
+ key: name
557
+ title: 规则名称
558
+ dataSource:
559
+ list:
560
+ - name: 用户测试
561
+ - name: 账号测试
562
+ - name: 安全测试
563
+ rowKey: name
564
+ rowSelection: true
565
+ shouldRenderWhenUrlParamsUpdate: false
566
+ shouldUpdateUrlParams: true
567
+ showSelectInfo: true
568
+ ```
569
+
570
+ ### Merge Columns
571
+
572
+ ```yaml preview
573
+ - brick: advanced.general-table
574
+ properties:
575
+ childrenColumnName: packages
576
+ columns:
577
+ - colSpanKey: ipColSpan
578
+ dataIndex: ip
579
+ rowSpanKey: ipRowSpan
580
+ title: IP
581
+ useBrick:
582
+ brick: span
583
+ properties:
584
+ textContent: <% DATA.cellData || DATA.rowData.clusterName %>
585
+ - colSpanKey: nameColSpan
586
+ dataIndex: packageName
587
+ title: 包名称
588
+ - colSpanKey: pathColSpan
589
+ dataIndex: installPath
590
+ title: 部署路径
591
+ - colSpanKey: versionColSpan
592
+ dataIndex: version
593
+ title: 版本
594
+ dataSource:
595
+ list:
596
+ - clusterName: Lonnnnnnnnnnnnnnnnnnnnnnnnnng Cluster Name
597
+ id: "1"
598
+ ipColSpan: 4
599
+ nameColSpan: 0
600
+ packages:
601
+ - id: 1-1
602
+ installPath: /usr/local/easyops/container
603
+ ip: 192.168.100.162
604
+ packageName: container
605
+ version: 1.10.0
606
+ - id: 1-2
607
+ installPath: /usr/local/easyops/webshell
608
+ ip: 192.168.100.163
609
+ ipRowSpan: 2
610
+ packageName: webshell
611
+ version: 1.0.0
612
+ - id: 1-3
613
+ installPath: /usr/local/easyops/nginx
614
+ ip: 192.168.100.163
615
+ ipRowSpan: 0
616
+ packageName: nginx
617
+ version: 3.6.0
618
+ pathColSpan: 0
619
+ versionColSpan: 0
620
+ defaultExpandAllRows: true
621
+ rowKey: id
622
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/advanced",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/basic",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,5 +37,5 @@
37
37
  "@next-core/build-next-bricks": "^1.7.2",
38
38
  "@next-core/test-next": "^1.0.6"
39
39
  },
40
- "gitHead": "66f40f3eff556846c449ad72ba0607890668f8d0"
40
+ "gitHead": "8d1311247a4b4cfe6a06e269c1acc358e06b4cd0"
41
41
  }