@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,667 @@
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: aggridlowdefy
16
+ type: Box
17
+
18
+ blocks:
19
+ # ============================================
20
+ # BASIC RENDERING
21
+ # ============================================
22
+
23
+ - id: aggridlowdefy_basic
24
+ type: AgGridLowdefy
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: aggridlowdefy_height
44
+ type: AgGridLowdefy
45
+ properties:
46
+ height: 300
47
+ columnDefs:
48
+ - headerName: Name
49
+ field: name
50
+ rowData:
51
+ - name: Alice
52
+ - name: Bob
53
+
54
+ - id: aggridlowdefy_default_col_def
55
+ type: AgGridLowdefy
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: aggridlowdefy_empty
73
+ type: AgGridLowdefy
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: aggridlowdefy_onrowclick
87
+ type: AgGridLowdefy
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
+ aggridlowdefy_row_clicked:
105
+ _event: row.name
106
+
107
+ - id: aggridlowdefy_row_click_display
108
+ type: Span
109
+ properties:
110
+ content:
111
+ _if:
112
+ test:
113
+ _ne:
114
+ - _state: aggridlowdefy_row_clicked
115
+ - null
116
+ then:
117
+ _string.concat:
118
+ - 'Row: '
119
+ - _state: aggridlowdefy_row_clicked
120
+ else: ''
121
+
122
+ - id: aggridlowdefy_oncellclick
123
+ type: AgGridLowdefy
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
+ aggridlowdefy_cell_clicked:
141
+ _event: cell.value
142
+
143
+ - id: aggridlowdefy_cell_click_display
144
+ type: Span
145
+ properties:
146
+ content:
147
+ _if:
148
+ test:
149
+ _ne:
150
+ - _state: aggridlowdefy_cell_clicked
151
+ - null
152
+ then:
153
+ _string.concat:
154
+ - 'Cell: '
155
+ - _state: aggridlowdefy_cell_clicked
156
+ else: ''
157
+
158
+ - id: aggridlowdefy_onrowselected
159
+ type: AgGridLowdefy
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
+ aggridlowdefy_row_selected:
181
+ _event: row.name
182
+
183
+ - id: aggridlowdefy_row_selected_display
184
+ type: Span
185
+ properties:
186
+ content:
187
+ _if:
188
+ test:
189
+ _ne:
190
+ - _state: aggridlowdefy_row_selected
191
+ - null
192
+ then:
193
+ _string.concat:
194
+ - 'Selected: '
195
+ - _state: aggridlowdefy_row_selected
196
+ else: ''
197
+
198
+ # ============================================
199
+ # SORTING & FILTERING
200
+ # ============================================
201
+
202
+ - id: aggridlowdefy_sortable
203
+ type: AgGridLowdefy
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
+ aggridlowdefy_sort_changed: true
225
+
226
+ - id: aggridlowdefy_sort_changed_display
227
+ type: Span
228
+ properties:
229
+ content:
230
+ _if:
231
+ test:
232
+ _eq:
233
+ - _state: aggridlowdefy_sort_changed
234
+ - true
235
+ then: Sort changed
236
+ else: ''
237
+
238
+ - id: aggridlowdefy_filterable
239
+ type: AgGridLowdefy
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
+ aggridlowdefy_filter_changed: true
261
+
262
+ - id: aggridlowdefy_filter_changed_display
263
+ type: Span
264
+ properties:
265
+ content:
266
+ _if:
267
+ test:
268
+ _eq:
269
+ - _state: aggridlowdefy_filter_changed
270
+ - true
271
+ then: Filter changed
272
+ else: ''
273
+
274
+ # ============================================
275
+ # BUILT-IN CELL RENDERERS — cell.type
276
+ # ============================================
277
+
278
+ - id: aggridlowdefy_cell_tag
279
+ type: AgGridLowdefy
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: aggridlowdefy_cell_tag_from
298
+ type: AgGridLowdefy
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: aggridlowdefy_cell_tag_array
313
+ type: AgGridLowdefy
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: aggridlowdefy_cell_tag_seeded
334
+ type: AgGridLowdefy
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: aggridlowdefy_cell_avatar
347
+ type: AgGridLowdefy
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: aggridlowdefy_cell_avatar_link
371
+ type: AgGridLowdefy
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
+ aggridlowdefy_avatar_link_event:
393
+ _event: link.pageId
394
+
395
+ - id: aggridlowdefy_avatar_link_display
396
+ type: Span
397
+ properties:
398
+ content:
399
+ _if:
400
+ test:
401
+ _ne:
402
+ - _state: aggridlowdefy_avatar_link_event
403
+ - null
404
+ then:
405
+ _string.concat:
406
+ - 'Link: '
407
+ - _state: aggridlowdefy_avatar_link_event
408
+ else: ''
409
+
410
+ - id: aggridlowdefy_cell_link
411
+ type: AgGridLowdefy
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
+ aggridlowdefy_link_event:
430
+ _event: link.urlQuery._id
431
+
432
+ - id: aggridlowdefy_link_display
433
+ type: Span
434
+ properties:
435
+ content:
436
+ _if:
437
+ test:
438
+ _ne:
439
+ - _state: aggridlowdefy_link_event
440
+ - null
441
+ then:
442
+ _string.concat:
443
+ - 'Linked to: '
444
+ - _state: aggridlowdefy_link_event
445
+ else: ''
446
+
447
+ - id: aggridlowdefy_cell_date
448
+ type: AgGridLowdefy
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: aggridlowdefy_cell_boolean
466
+ type: AgGridLowdefy
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: aggridlowdefy_cell_progress
488
+ type: AgGridLowdefy
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: aggridlowdefy_cell_number
502
+ type: AgGridLowdefy
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: aggridlowdefy_cell_align_override
547
+ type: AgGridLowdefy
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: aggridlowdefy_ellipsis
561
+ type: AgGridLowdefy
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
+ # The buttons cell reaches components.Icon through the components prop the block
576
+ # forwards to the shared core — an icon here proves that forwarding.
577
+ - id: aggridlowdefy_cell_buttons
578
+ type: AgGridLowdefy
579
+ properties:
580
+ columnDefs:
581
+ - headerName: Actions
582
+ field: _id
583
+ cell:
584
+ type: buttons
585
+ buttons:
586
+ - eventName: onEditClick
587
+ title: Edit
588
+ icon: AiOutlineEdit
589
+ rowData:
590
+ - _id: TSK-001
591
+ events:
592
+ onEditClick:
593
+ - id: capture_button_click
594
+ type: SetState
595
+ params:
596
+ aggridlowdefy_button_event:
597
+ _event: row._id
598
+
599
+ - id: aggridlowdefy_button_display
600
+ type: Span
601
+ properties:
602
+ content:
603
+ _if:
604
+ test:
605
+ _ne:
606
+ - _state: aggridlowdefy_button_event
607
+ - null
608
+ then:
609
+ _string.concat:
610
+ - 'Edit: '
611
+ - _state: aggridlowdefy_button_event
612
+ else: ''
613
+
614
+ # ============================================
615
+ # SIZE — avatar CSS custom properties
616
+ # ============================================
617
+
618
+ - id: aggridlowdefy_avatar_small
619
+ type: AgGridLowdefy
620
+ properties:
621
+ size: small
622
+ columnDefs:
623
+ - headerName: Assignee
624
+ field: name
625
+ cell:
626
+ type: avatar
627
+ nameField: name
628
+ idField: id
629
+ rowData:
630
+ - id: u1
631
+ name: Alice Johnson
632
+
633
+ - id: aggridlowdefy_avatar_large
634
+ type: AgGridLowdefy
635
+ properties:
636
+ size: large
637
+ columnDefs:
638
+ - headerName: Assignee
639
+ field: name
640
+ cell:
641
+ type: avatar
642
+ nameField: name
643
+ idField: id
644
+ rowData:
645
+ - id: u1
646
+ name: Alice Johnson
647
+
648
+ # ============================================
649
+ # LOADING FLAG — runtime toggle
650
+ # ============================================
651
+
652
+ - id: aggridlowdefy_loading_toggle
653
+ type: Switch
654
+ properties:
655
+ title: Loading
656
+
657
+ - id: aggridlowdefy_loading_grid
658
+ type: AgGridLowdefy
659
+ loading:
660
+ _state: aggridlowdefy_loading_toggle
661
+ properties:
662
+ columnDefs:
663
+ - headerName: Name
664
+ field: name
665
+ rowData:
666
+ - name: Alice
667
+ - name: Bob