@lowdefy/blocks-aggrid 5.6.0 → 6.0.0

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.
@@ -0,0 +1,594 @@
1
+ # Copyright 2020-2026 Lowdefy, Inc
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ id: aggridbalham
16
+ type: Box
17
+
18
+ blocks:
19
+ # ============================================
20
+ # BASIC RENDERING
21
+ # ============================================
22
+
23
+ - id: aggridbalham_basic
24
+ type: AgGridBalham
25
+ properties:
26
+ columnDefs:
27
+ - headerName: Name
28
+ field: name
29
+ - headerName: Age
30
+ field: age
31
+ rowData:
32
+ - name: Alice
33
+ age: 25
34
+ - name: Bob
35
+ age: 30
36
+ - name: Charlie
37
+ age: 35
38
+
39
+ # ============================================
40
+ # PROPERTY TESTS
41
+ # ============================================
42
+
43
+ - id: aggridbalham_height
44
+ type: AgGridBalham
45
+ properties:
46
+ height: 300
47
+ columnDefs:
48
+ - headerName: Name
49
+ field: name
50
+ rowData:
51
+ - name: Alice
52
+ - name: Bob
53
+
54
+ - id: aggridbalham_default_col_def
55
+ type: AgGridBalham
56
+ properties:
57
+ defaultColDef:
58
+ sortable: true
59
+ resizable: true
60
+ filter: true
61
+ columnDefs:
62
+ - headerName: Name
63
+ field: name
64
+ - headerName: Age
65
+ field: age
66
+ rowData:
67
+ - name: Alice
68
+ age: 25
69
+ - name: Bob
70
+ age: 30
71
+
72
+ - id: aggridbalham_empty
73
+ type: AgGridBalham
74
+ properties:
75
+ columnDefs:
76
+ - headerName: Name
77
+ field: name
78
+ - headerName: Age
79
+ field: age
80
+ rowData: []
81
+
82
+ # ============================================
83
+ # EVENT TESTS
84
+ # ============================================
85
+
86
+ - id: aggridbalham_onrowclick
87
+ type: AgGridBalham
88
+ properties:
89
+ columnDefs:
90
+ - headerName: Name
91
+ field: name
92
+ - headerName: Age
93
+ field: age
94
+ rowData:
95
+ - name: Alice
96
+ age: 25
97
+ - name: Bob
98
+ age: 30
99
+ events:
100
+ onRowClick:
101
+ - id: set_row_click
102
+ type: SetState
103
+ params:
104
+ aggridbalham_row_clicked:
105
+ _event: row.name
106
+
107
+ - id: aggridbalham_row_click_display
108
+ type: Span
109
+ properties:
110
+ content:
111
+ _if:
112
+ test:
113
+ _ne:
114
+ - _state: aggridbalham_row_clicked
115
+ - null
116
+ then:
117
+ _string.concat:
118
+ - 'Row: '
119
+ - _state: aggridbalham_row_clicked
120
+ else: ''
121
+
122
+ - id: aggridbalham_oncellclick
123
+ type: AgGridBalham
124
+ properties:
125
+ columnDefs:
126
+ - headerName: Name
127
+ field: name
128
+ - headerName: Age
129
+ field: age
130
+ rowData:
131
+ - name: Alice
132
+ age: 25
133
+ - name: Bob
134
+ age: 30
135
+ events:
136
+ onCellClick:
137
+ - id: set_cell_click
138
+ type: SetState
139
+ params:
140
+ aggridbalham_cell_clicked:
141
+ _event: cell.value
142
+
143
+ - id: aggridbalham_cell_click_display
144
+ type: Span
145
+ properties:
146
+ content:
147
+ _if:
148
+ test:
149
+ _ne:
150
+ - _state: aggridbalham_cell_clicked
151
+ - null
152
+ then:
153
+ _string.concat:
154
+ - 'Cell: '
155
+ - _state: aggridbalham_cell_clicked
156
+ else: ''
157
+
158
+ - id: aggridbalham_onrowselected
159
+ type: AgGridBalham
160
+ properties:
161
+ rowSelection:
162
+ mode: singleRow
163
+ checkboxes: false
164
+ enableClickSelection: true
165
+ columnDefs:
166
+ - headerName: Name
167
+ field: name
168
+ - headerName: Age
169
+ field: age
170
+ rowData:
171
+ - name: Alice
172
+ age: 25
173
+ - name: Bob
174
+ age: 30
175
+ events:
176
+ onRowSelected:
177
+ - id: set_row_selected
178
+ type: SetState
179
+ params:
180
+ aggridbalham_row_selected:
181
+ _event: row.name
182
+
183
+ - id: aggridbalham_row_selected_display
184
+ type: Span
185
+ properties:
186
+ content:
187
+ _if:
188
+ test:
189
+ _ne:
190
+ - _state: aggridbalham_row_selected
191
+ - null
192
+ then:
193
+ _string.concat:
194
+ - 'Selected: '
195
+ - _state: aggridbalham_row_selected
196
+ else: ''
197
+
198
+ # ============================================
199
+ # SORTING & FILTERING
200
+ # ============================================
201
+
202
+ - id: aggridbalham_sortable
203
+ type: AgGridBalham
204
+ properties:
205
+ columnDefs:
206
+ - headerName: Name
207
+ field: name
208
+ sortable: true
209
+ - headerName: Age
210
+ field: age
211
+ sortable: true
212
+ rowData:
213
+ - name: Charlie
214
+ age: 35
215
+ - name: Alice
216
+ age: 25
217
+ - name: Bob
218
+ age: 30
219
+ events:
220
+ onSortChanged:
221
+ - id: set_sort_changed
222
+ type: SetState
223
+ params:
224
+ aggridbalham_sort_changed: true
225
+
226
+ - id: aggridbalham_sort_changed_display
227
+ type: Span
228
+ properties:
229
+ content:
230
+ _if:
231
+ test:
232
+ _eq:
233
+ - _state: aggridbalham_sort_changed
234
+ - true
235
+ then: Sort changed
236
+ else: ''
237
+
238
+ - id: aggridbalham_filterable
239
+ type: AgGridBalham
240
+ properties:
241
+ columnDefs:
242
+ - headerName: Name
243
+ field: name
244
+ filter: true
245
+ - headerName: Age
246
+ field: age
247
+ filter: true
248
+ rowData:
249
+ - name: Alice
250
+ age: 25
251
+ - name: Bob
252
+ age: 30
253
+ - name: Charlie
254
+ age: 35
255
+ events:
256
+ onFilterChanged:
257
+ - id: set_filter_changed
258
+ type: SetState
259
+ params:
260
+ aggridbalham_filter_changed: true
261
+
262
+ - id: aggridbalham_filter_changed_display
263
+ type: Span
264
+ properties:
265
+ content:
266
+ _if:
267
+ test:
268
+ _eq:
269
+ - _state: aggridbalham_filter_changed
270
+ - true
271
+ then: Filter changed
272
+ else: ''
273
+
274
+ # ============================================
275
+ # BUILT-IN CELL RENDERERS — cell.type
276
+ # ============================================
277
+
278
+ - id: aggridbalham_cell_tag
279
+ type: AgGridBalham
280
+ properties:
281
+ columnDefs:
282
+ - headerName: Status
283
+ field: status
284
+ cell:
285
+ type: tag
286
+ colorMap:
287
+ Active: green
288
+ Blocked: red
289
+ Pending: blue
290
+ rowData:
291
+ - status: Active
292
+ - status: Blocked
293
+ - status: Pending
294
+ - status: Unknown
295
+ - status: null
296
+
297
+ - id: aggridbalham_cell_tag_from
298
+ type: AgGridBalham
299
+ properties:
300
+ columnDefs:
301
+ - headerName: Status
302
+ field: label
303
+ cell:
304
+ type: tag
305
+ colorFrom: color
306
+ rowData:
307
+ - label: A
308
+ color: green
309
+ - label: B
310
+ color: '#ff4d4f'
311
+
312
+ - id: aggridbalham_cell_tag_array
313
+ type: AgGridBalham
314
+ properties:
315
+ columnDefs:
316
+ - headerName: Roles
317
+ field: roles
318
+ cell:
319
+ type: tag
320
+ colorMap:
321
+ admin: red
322
+ editor: blue
323
+ viewer: green
324
+ rowData:
325
+ - roles:
326
+ - admin
327
+ - editor
328
+ - roles:
329
+ - viewer
330
+ - roles: []
331
+ - roles: null
332
+
333
+ - id: aggridbalham_cell_tag_seeded
334
+ type: AgGridBalham
335
+ properties:
336
+ columnDefs:
337
+ - headerName: Tag
338
+ field: tag
339
+ cell:
340
+ type: tag
341
+ rowData:
342
+ - tag: frontend
343
+ - tag: frontend
344
+ - tag: backend
345
+
346
+ - id: aggridbalham_cell_avatar
347
+ type: AgGridBalham
348
+ properties:
349
+ columnDefs:
350
+ - headerName: Assignee
351
+ field: name
352
+ cell:
353
+ type: avatar
354
+ nameField: name
355
+ srcField: picture
356
+ idField: id
357
+ rowData:
358
+ - id: u1
359
+ name: Alice Johnson
360
+ # antd Avatar drops the <img> when the src fails to load, so the
361
+ # fixture must always resolve — a data URI never touches the network.
362
+ picture: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=
363
+ - id: u2
364
+ name: Bob Smith
365
+ picture: null
366
+ - id: u3
367
+ name: null
368
+ picture: null
369
+
370
+ - id: aggridbalham_cell_avatar_link
371
+ type: AgGridBalham
372
+ properties:
373
+ columnDefs:
374
+ - headerName: Assignee
375
+ field: name
376
+ cell:
377
+ type: avatar
378
+ nameField: name
379
+ idField: id
380
+ link:
381
+ pageId: user
382
+ urlQuery:
383
+ userId: id
384
+ rowData:
385
+ - id: u1
386
+ name: Alice Johnson
387
+ events:
388
+ onCellLink:
389
+ - id: capture_avatar_link
390
+ type: SetState
391
+ params:
392
+ aggridbalham_avatar_link_event:
393
+ _event: link.pageId
394
+
395
+ - id: aggridbalham_avatar_link_display
396
+ type: Span
397
+ properties:
398
+ content:
399
+ _if:
400
+ test:
401
+ _ne:
402
+ - _state: aggridbalham_avatar_link_event
403
+ - null
404
+ then:
405
+ _string.concat:
406
+ - 'Link: '
407
+ - _state: aggridbalham_avatar_link_event
408
+ else: ''
409
+
410
+ - id: aggridbalham_cell_link
411
+ type: AgGridBalham
412
+ properties:
413
+ columnDefs:
414
+ - headerName: ID
415
+ field: _id
416
+ cell:
417
+ type: link
418
+ pageId: detail
419
+ urlQuery:
420
+ _id: _id
421
+ rowData:
422
+ - _id: TSK-001
423
+ - _id: TSK-002
424
+ events:
425
+ onCellLink:
426
+ - id: capture_link
427
+ type: SetState
428
+ params:
429
+ aggridbalham_link_event:
430
+ _event: link.urlQuery._id
431
+
432
+ - id: aggridbalham_link_display
433
+ type: Span
434
+ properties:
435
+ content:
436
+ _if:
437
+ test:
438
+ _ne:
439
+ - _state: aggridbalham_link_event
440
+ - null
441
+ then:
442
+ _string.concat:
443
+ - 'Linked to: '
444
+ - _state: aggridbalham_link_event
445
+ else: ''
446
+
447
+ - id: aggridbalham_cell_date
448
+ type: AgGridBalham
449
+ properties:
450
+ columnDefs:
451
+ - headerName: Created
452
+ field: created_at
453
+ cell:
454
+ type: date
455
+ - headerName: Custom
456
+ field: created_at
457
+ cell:
458
+ type: date
459
+ format: YYYY/MM/DD
460
+ rowData:
461
+ - created_at: '2025-01-15T09:30:00Z'
462
+ - created_at: null
463
+ - created_at: invalid-date
464
+
465
+ - id: aggridbalham_cell_boolean
466
+ type: AgGridBalham
467
+ properties:
468
+ columnDefs:
469
+ - headerName: Verified
470
+ field: verified
471
+ cell:
472
+ type: boolean
473
+ - headerName: Active
474
+ field: active
475
+ cell:
476
+ type: boolean
477
+ trueLabel: Yes!
478
+ falseLabel: Nope
479
+ rowData:
480
+ - verified: true
481
+ active: true
482
+ - verified: false
483
+ active: false
484
+ - verified: null
485
+ active: null
486
+
487
+ - id: aggridbalham_cell_progress
488
+ type: AgGridBalham
489
+ properties:
490
+ columnDefs:
491
+ - headerName: Progress
492
+ field: progress
493
+ cell:
494
+ type: progress
495
+ rowData:
496
+ - progress: 10
497
+ - progress: 55
498
+ - progress: 100
499
+ - progress: null
500
+
501
+ - id: aggridbalham_cell_number
502
+ type: AgGridBalham
503
+ properties:
504
+ columnDefs:
505
+ - headerName: Revenue
506
+ field: revenue
507
+ cell:
508
+ type: number
509
+ format: currency
510
+ currency: USD
511
+ decimals: 0
512
+ - headerName: Delta
513
+ field: delta
514
+ cell:
515
+ type: number
516
+ format: currency
517
+ currency: USD
518
+ decimals: 2
519
+ negative: parentheses
520
+ signColor: true
521
+ - headerName: Margin
522
+ field: margin
523
+ cell:
524
+ type: number
525
+ format: percent
526
+ decimals: 1
527
+ - headerName: Views
528
+ field: views
529
+ cell:
530
+ type: number
531
+ format: compact
532
+ rowData:
533
+ - revenue: 1245000
534
+ delta: 12500
535
+ margin: 0.184
536
+ views: 12340
537
+ - revenue: 825500
538
+ delta: -44250.5
539
+ margin: 0.072
540
+ views: 1050000
541
+ - revenue: null
542
+ delta: null
543
+ margin: null
544
+ views: null
545
+
546
+ - id: aggridbalham_cell_align_override
547
+ type: AgGridBalham
548
+ properties:
549
+ columnDefs:
550
+ - headerName: Revenue
551
+ field: revenue
552
+ cell:
553
+ type: number
554
+ format: currency
555
+ currency: USD
556
+ align: left
557
+ rowData:
558
+ - revenue: 1000
559
+
560
+ - id: aggridbalham_ellipsis
561
+ type: AgGridBalham
562
+ properties:
563
+ columnDefs:
564
+ - headerName: Notes
565
+ field: notes
566
+ ellipsis: 2
567
+ rowData:
568
+ - notes: >-
569
+ Quite a long piece of text that should wrap across multiple lines
570
+ and then be clamped to two lines via the built-in line-clamp class
571
+ so that the rest is hidden.
572
+ - notes: Short.
573
+ - notes: null
574
+
575
+ # ============================================
576
+ # LOADING FLAG — runtime toggle
577
+ # ============================================
578
+
579
+ - id: aggridbalham_loading_toggle
580
+ type: Switch
581
+ properties:
582
+ title: Loading
583
+
584
+ - id: aggridbalham_loading_grid
585
+ type: AgGridBalham
586
+ loading:
587
+ _state: aggridbalham_loading_toggle
588
+ properties:
589
+ columnDefs:
590
+ - headerName: Name
591
+ field: name
592
+ rowData:
593
+ - name: Alice
594
+ - name: Bob