@iress-oss/ids-mcp-server 0.0.1-dev.4 → 0.0.1-dev.5

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.
@@ -54,7 +54,104 @@ Page Size:
54
54
 
55
55
  Page 1 of 1
56
56
 
57
- Show code
57
+ Hide code
58
+
59
+ \[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
60
+
61
+ import { useState } from 'react';
62
+ import {
63
+ IressButton,
64
+ IressModal,
65
+ IressText,
66
+ IressToasterProvider,
67
+ useToaster,
68
+ } from '@iress-oss/ids-components';
69
+ import { AG\_THEME\_IRESS\_ICONS, IressAgGridContainer } from '@iress/ids-themes';
70
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
71
+ import { AllCommunityModule, ModuleRegistry, provideGlobalGridOptions, type ColDef, type ICellRendererParams } from 'ag-grid-community';
72
+ import styles from '@iress-storybook/styles.module.scss';
73
+ ModuleRegistry.registerModules(\[AllCommunityModule\]);
74
+ provideGlobalGridOptions({ theme: 'legacy' });
75
+ const OrderCar \= ({ data }: ICellRendererParams) \=> {
76
+ const \[show, setShow\] \= useState(false);
77
+ const { success } \= useToaster();
78
+ return (
79
+ <\>
80
+ <IressButton onClick\={() \=> setShow(true)}\>Order</IressButton\>
81
+ <IressModal show\={show} onShowChange\={setShow}\>
82
+ <IressText\>
83
+ <h2\>Order a car</h2\>
84
+ <p\>
85
+ Car: {data.make} {data.model}
86
+ </p\>
87
+ <p\>
88
+ <IressButton
89
+ onClick\={() \=> {
90
+ success({
91
+ children: 'Order submitted',
92
+ });
93
+ setShow(false);
94
+ }}
95
+ \>
96
+ Submit </IressButton\>
97
+ </p\>
98
+ </IressText\>
99
+ </IressModal\>
100
+ </\>
101
+ );
102
+ };
103
+ export const AgGridSimple \= (args: AgGridReactProps) \=> {
104
+ // Row Data: The data to be displayed.
105
+ const \[rowData\] \= useState(\[
106
+ { make: 'Tesla', model: 'Model Y', price: 64950, electric: true },
107
+ { make: 'Ford', model: 'F-Series', price: 33850, electric: false },
108
+ { make: 'Toyota', model: 'Corolla', price: 29600, electric: false },
109
+ \]);
110
+ // Column Definitions: Defines the columns to be displayed.
111
+ const \[colDefs\] \= useState<ColDef\[\]\>(\[
112
+ {
113
+ field: 'make',
114
+ filter: true,
115
+ floatingFilter: true,
116
+ flex: 2,
117
+ checkboxSelection: true,
118
+ },
119
+ { field: 'model', flex: 1, autoHeight: true },
120
+ {
121
+ field: 'price',
122
+ flex: 1,
123
+ autoHeight: true,
124
+ valueFormatter: (price) \=> \`$${price.value.toLocaleString()}\`,
125
+ },
126
+ { field: 'electric', flex: 1, editable: true, autoHeight: true },
127
+ { field: 'order', flex: 1, cellRenderer: OrderCar },
128
+ \]);
129
+ return (
130
+ <IressToasterProvider\>
131
+ <IressAgGridContainer
132
+ alignMiddle
133
+ style\={{ height: '300px' }}
134
+ \>
135
+ <AgGridReact
136
+ {...args}
137
+ rowData\={rowData}
138
+ rowClassRules\={{
139
+ \[styles.highlightDanger\]: (params) \=> params.data.make \=== 'Toyota',
140
+ }}
141
+ rowSelection\="multiple"
142
+ columnDefs\={colDefs}
143
+ icons\={AG\_THEME\_IRESS\_ICONS}
144
+ pagination
145
+ paginationPageSize\={500}
146
+ paginationPageSizeSelector\={\[200, 500, 1000\]}
147
+ />
148
+ </IressAgGridContainer\>
149
+ </IressToasterProvider\>
150
+ );
151
+ };
152
+ export default AgGridSimple;
153
+
154
+ Copy
58
155
 
59
156
  [](#props-api)Props (API)
60
157
  -------------------------
@@ -157,7 +254,104 @@ Page Size:
157
254
 
158
255
  Page 1 of 1
159
256
 
160
- Show code
257
+ Hide code
258
+
259
+ \[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
260
+
261
+ import { useState } from 'react';
262
+ import {
263
+ IressButton,
264
+ IressModal,
265
+ IressText,
266
+ IressToasterProvider,
267
+ useToaster,
268
+ } from '@iress-oss/ids-components';
269
+ import { AG\_THEME\_IRESS\_ICONS, IressAgGridContainer } from '@iress/ids-themes';
270
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
271
+ import { AllCommunityModule, ModuleRegistry, provideGlobalGridOptions, type ColDef, type ICellRendererParams } from 'ag-grid-community';
272
+ import styles from '@iress-storybook/styles.module.scss';
273
+ ModuleRegistry.registerModules(\[AllCommunityModule\]);
274
+ provideGlobalGridOptions({ theme: 'legacy' });
275
+ const OrderCar \= ({ data }: ICellRendererParams) \=> {
276
+ const \[show, setShow\] \= useState(false);
277
+ const { success } \= useToaster();
278
+ return (
279
+ <\>
280
+ <IressButton onClick\={() \=> setShow(true)}\>Order</IressButton\>
281
+ <IressModal show\={show} onShowChange\={setShow}\>
282
+ <IressText\>
283
+ <h2\>Order a car</h2\>
284
+ <p\>
285
+ Car: {data.make} {data.model}
286
+ </p\>
287
+ <p\>
288
+ <IressButton
289
+ onClick\={() \=> {
290
+ success({
291
+ children: 'Order submitted',
292
+ });
293
+ setShow(false);
294
+ }}
295
+ \>
296
+ Submit </IressButton\>
297
+ </p\>
298
+ </IressText\>
299
+ </IressModal\>
300
+ </\>
301
+ );
302
+ };
303
+ export const AgGridSimple \= (args: AgGridReactProps) \=> {
304
+ // Row Data: The data to be displayed.
305
+ const \[rowData\] \= useState(\[
306
+ { make: 'Tesla', model: 'Model Y', price: 64950, electric: true },
307
+ { make: 'Ford', model: 'F-Series', price: 33850, electric: false },
308
+ { make: 'Toyota', model: 'Corolla', price: 29600, electric: false },
309
+ \]);
310
+ // Column Definitions: Defines the columns to be displayed.
311
+ const \[colDefs\] \= useState<ColDef\[\]\>(\[
312
+ {
313
+ field: 'make',
314
+ filter: true,
315
+ floatingFilter: true,
316
+ flex: 2,
317
+ checkboxSelection: true,
318
+ },
319
+ { field: 'model', flex: 1, autoHeight: true },
320
+ {
321
+ field: 'price',
322
+ flex: 1,
323
+ autoHeight: true,
324
+ valueFormatter: (price) \=> \`$${price.value.toLocaleString()}\`,
325
+ },
326
+ { field: 'electric', flex: 1, editable: true, autoHeight: true },
327
+ { field: 'order', flex: 1, cellRenderer: OrderCar },
328
+ \]);
329
+ return (
330
+ <IressToasterProvider\>
331
+ <IressAgGridContainer
332
+ alignMiddle
333
+ style\={{ height: '300px' }}
334
+ \>
335
+ <AgGridReact
336
+ {...args}
337
+ rowData\={rowData}
338
+ rowClassRules\={{
339
+ \[styles.highlightDanger\]: (params) \=> params.data.make \=== 'Toyota',
340
+ }}
341
+ rowSelection\="multiple"
342
+ columnDefs\={colDefs}
343
+ icons\={AG\_THEME\_IRESS\_ICONS}
344
+ pagination
345
+ paginationPageSize\={500}
346
+ paginationPageSizeSelector\={\[200, 500, 1000\]}
347
+ />
348
+ </IressAgGridContainer\>
349
+ </IressToasterProvider\>
350
+ );
351
+ };
352
+ export default AgGridSimple;
353
+
354
+ Copy
161
355
 
162
356
  ### [](#complex)Complex
163
357
 
@@ -191,9 +385,9 @@ Country
191
385
 
192
386
  Shellie
193
387
 
194
- 55,893
388
+ 96,065
195
389
 
196
- \-£500.66
390
+ £81.12
197
391
 
198
392
  aliquet@purus.com
199
393
 
@@ -203,9 +397,9 @@ French Polynesia
203
397
 
204
398
  Jade
205
399
 
206
- 70,139
400
+ 25,086
207
401
 
208
- £433.86
402
+ \-£791.62
209
403
 
210
404
  mi.pede.nonummy@senectus.org
211
405
 
@@ -215,9 +409,9 @@ Tonga
215
409
 
216
410
  Wyoming
217
411
 
218
- 21,497
412
+ 2,260
219
413
 
220
- £353.82
414
+ \-£653.73
221
415
 
222
416
  Nulla.tempor.augue@aliquamiaculis.org
223
417
 
@@ -227,9 +421,9 @@ Rwanda
227
421
 
228
422
  Christine
229
423
 
230
- 97,687
424
+ 4,719
231
425
 
232
- £119.40
426
+ \-£828.84
233
427
 
234
428
  neque.sed.dictum@ultricesVivamus.ca
235
429
 
@@ -239,9 +433,9 @@ Bahamas
239
433
 
240
434
  Jameson
241
435
 
242
- 87,554
436
+ 38,866
243
437
 
244
- \-£634.67
438
+ £18.79
245
439
 
246
440
  sem.semper@liberoProin.com
247
441
 
@@ -251,9 +445,9 @@ Nauru
251
445
 
252
446
  Driscoll
253
447
 
254
- 45,610
448
+ 44,298
255
449
 
256
- £338.76
450
+ \-£969.27
257
451
 
258
452
  libero.dui@estacfacilisis.edu
259
453
 
@@ -263,9 +457,9 @@ Tajikistan
263
457
 
264
458
  Morgan
265
459
 
266
- 14,480
460
+ 74,232
267
461
 
268
- £477.15
462
+ \-£937.09
269
463
 
270
464
  mauris.eu@ipsum.ca
271
465
 
@@ -275,9 +469,9 @@ Colombia
275
469
 
276
470
  Kylee
277
471
 
278
- 91,901
472
+ 5,346
279
473
 
280
- £470.74
474
+ \-£691.99
281
475
 
282
476
  libero.Proin@malesuadafamesac.com
283
477
 
@@ -287,9 +481,9 @@ Papua New Guinea
287
481
 
288
482
  Cathleen
289
483
 
290
- 76,234
484
+ 28,106
291
485
 
292
- \-£705.99
486
+ \-£752.17
293
487
 
294
488
  risus.Donec@augue.edu
295
489
 
@@ -299,9 +493,9 @@ Guinea-Bissau
299
493
 
300
494
  Sierra
301
495
 
302
- 70,719
496
+ 4,247
303
497
 
304
- £117.34
498
+ £215.01
305
499
 
306
500
  dictum.eleifend.nunc@tellus.net
307
501
 
@@ -311,9 +505,9 @@ Isle of Man
311
505
 
312
506
  Levi
313
507
 
314
- 7,491
508
+ 43,126
315
509
 
316
- \-£945.21
510
+ \-£668.20
317
511
 
318
512
  Nulla.tempor.augue@nibhdolor.ca
319
513
 
@@ -323,9 +517,9 @@ Tuvalu
323
517
 
324
518
  Kyle
325
519
 
326
- 79,958
520
+ 49,251
327
521
 
328
- \-£890.17
522
+ \-£912.75
329
523
 
330
524
  lacinia@senectus.org
331
525
 
@@ -335,9 +529,9 @@ Qatar
335
529
 
336
530
  Emery
337
531
 
338
- 90,476
532
+ 60,799
339
533
 
340
- £166.33
534
+ £381.26
341
535
 
342
536
  Nulla.facilisis@nonummyultriciesornare.co.uk
343
537
 
@@ -347,9 +541,9 @@ Belize
347
541
 
348
542
  Nadine
349
543
 
350
- 50,708
544
+ 66,894
351
545
 
352
- £212.92
546
+ \-£732.58
353
547
 
354
548
  Duis@Sed.ca
355
549
 
@@ -359,9 +553,9 @@ Uruguay
359
553
 
360
554
  Dalton
361
555
 
362
- 86,981
556
+ 93,058
363
557
 
364
- \-£748.63
558
+ \-£595.55
365
559
 
366
560
  nibh.dolor.nonummy@laoreetlibero.org
367
561
 
@@ -371,9 +565,9 @@ Cayman Islands
371
565
 
372
566
  Zeph
373
567
 
374
- 57,495
568
+ 86,011
375
569
 
376
- \-£619.75
570
+ \-£750.64
377
571
 
378
572
  non.dui@felisorci.com
379
573
 
@@ -383,9 +577,9 @@ Niger
383
577
 
384
578
  Shannon
385
579
 
386
- 59,268
580
+ 31,391
387
581
 
388
- \-£566.59
582
+ \-£958.60
389
583
 
390
584
  leo@lobortis.co.uk
391
585
 
@@ -395,9 +589,9 @@ Somalia
395
589
 
396
590
  Erich
397
591
 
398
- 24,529
592
+ 26,014
399
593
 
400
- \-£977.18
594
+ £173.30
401
595
 
402
596
  cursus.non.egestas@aliquet.org
403
597
 
@@ -407,9 +601,9 @@ Sao Tome and Principe
407
601
 
408
602
  Rhiannon
409
603
 
410
- 92,499
604
+ 58,474
411
605
 
412
- \-£932.96
606
+ £281.93
413
607
 
414
608
  arcu.Morbi.sit@cursus.edu
415
609
 
@@ -419,9 +613,9 @@ Croatia
419
613
 
420
614
  Elijah
421
615
 
422
- 20,589
616
+ 22,601
423
617
 
424
- £276.69
618
+ £399.68
425
619
 
426
620
  ipsum.Donec.sollicitudin@leo.co.uk
427
621
 
@@ -431,9 +625,9 @@ San Marino
431
625
 
432
626
  Grady
433
627
 
434
- 59,496
628
+ 39,659
435
629
 
436
- 0.00
630
+ \-£713.98
437
631
 
438
632
  mollis.nec.cursus@malesuadamalesuadaInteger.edu
439
633
 
@@ -443,9 +637,9 @@ Cuba
443
637
 
444
638
  Quentin
445
639
 
446
- 74,931
640
+ 91,881
447
641
 
448
- \-£910.76
642
+ £265.23
449
643
 
450
644
  erat.vel@auctor.net
451
645
 
@@ -455,9 +649,9 @@ Mayotte
455
649
 
456
650
  Samuel
457
651
 
458
- 55,034
652
+ 86,032
459
653
 
460
- \-£645.15
654
+ £319.85
461
655
 
462
656
  tellus@magnaSed.edu
463
657
 
@@ -467,9 +661,9 @@ Lebanon
467
661
 
468
662
  Merritt
469
663
 
470
- 31,896
664
+ 22,614
471
665
 
472
- \-£808.31
666
+ £447.38
473
667
 
474
668
  interdum.Nunc.sollicitudin@elitpellentesque.edu
475
669
 
@@ -569,7 +763,703 @@ to of
569
763
 
570
764
  Page of
571
765
 
572
- Show code
766
+ Hide code
767
+
768
+ \[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
769
+
770
+ import { useCallback, useEffect, useRef, useState } from 'react';
771
+ import { AG\_GRID\_LICENSE\_KEY } from '@iress/ag-grid-license-key';
772
+ import type {
773
+ GridApi,
774
+ GridReadyEvent,
775
+ ValueFormatterParams,
776
+ } from 'ag-grid-community';
777
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
778
+ import { AllEnterpriseModule, LicenseManager, ModuleRegistry, provideGlobalGridOptions } from 'ag-grid-enterprise';
779
+ import { AG\_THEME\_IRESS\_ICONS, IressAgGridContainer } from '@iress/ids-themes';
780
+ import styles from '@iress-storybook/styles.module.scss';
781
+ LicenseManager.setLicenseKey(AG\_GRID\_LICENSE\_KEY);
782
+ ModuleRegistry.registerModules(\[AllEnterpriseModule\]);
783
+ provideGlobalGridOptions({ theme: 'legacy' });
784
+ const formatter2dp \= new Intl.NumberFormat('en-UK', {
785
+ minimumFractionDigits: 2,
786
+ maximumFractionDigits: 2,
787
+ });
788
+ const formatterCurrency \= new Intl.NumberFormat('en-UK', {
789
+ minimumFractionDigits: 2,
790
+ maximumFractionDigits: 2,
791
+ currencySign: 'standard',
792
+ currency: 'GBP',
793
+ style: 'currency',
794
+ });
795
+ const getSales \= (number: number) \=> {
796
+ const no \= number \* 100000;
797
+ return Math.ceil(no);
798
+ };
799
+ const getProfit \= (number: number) \=> {
800
+ const no \= number \> 0.5 ? number \* \-1000 : number \* 1000;
801
+ return formatter2dp.format(no);
802
+ };
803
+ const getRating \= () \=> (Math.random() \> 0.5 ? 'red' : 'green');
804
+ const BIG\_DATA \= \[
805
+ {
806
+ firstName: 'Shellie',
807
+ lastName: 'Cantu',
808
+ email: 'aliquet@purus.com',
809
+ phoneNo: '0828 746 6831',
810
+ street: '639-9644 Eget Street',
811
+ city: 'Weißenfels',
812
+ postcode: '37962',
813
+ country: 'French Polynesia',
814
+ personalID: '16011210 9582',
815
+ },
816
+ {
817
+ firstName: 'Jade',
818
+ lastName: 'Sellers',
819
+ email: 'mi.pede.nonummy@senectus.org',
820
+ phoneNo: '0800 360062',
821
+ street: 'P.O. Box 511, 3099 In Rd.',
822
+ city: 'Cochrane',
823
+ postcode: 'K8I 3RB',
824
+ country: 'Tonga',
825
+ personalID: '16870328 2056',
826
+ },
827
+ {
828
+ firstName: 'Wyoming',
829
+ lastName: 'Fox',
830
+ email: 'Nulla.tempor.augue@aliquamiaculis.org',
831
+ phoneNo: '0800 377 7753',
832
+ street: '7354 Ac Ave',
833
+ city: 'East Kilbride',
834
+ postcode: '233010',
835
+ country: 'Rwanda',
836
+ personalID: '16070816 5048',
837
+ },
838
+ {
839
+ firstName: 'Christine',
840
+ lastName: 'Holcomb',
841
+ email: 'neque.sed.dictum@ultricesVivamus.ca',
842
+ phoneNo: '07578 190673',
843
+ street: 'Ap #121-4421 Iaculis Av.',
844
+ city: 'Etroubles',
845
+ postcode: '6742',
846
+ country: 'Bahamas',
847
+ personalID: '16401211 0773',
848
+ },
849
+ {
850
+ firstName: 'Jameson',
851
+ lastName: 'Sutton',
852
+ email: 'sem.semper@liberoProin.com',
853
+ phoneNo: '07489 442639',
854
+ street: 'Ap #700-1481 Porttitor Ave',
855
+ city: 'Nice',
856
+ postcode: '14655',
857
+ country: 'Nauru',
858
+ personalID: '16301129 4323',
859
+ },
860
+ {
861
+ firstName: 'Driscoll',
862
+ lastName: 'Jenkins',
863
+ email: 'libero.dui@estacfacilisis.edu',
864
+ phoneNo: '0843 298 8205',
865
+ street: 'Ap #775-8090 Sed Avenue',
866
+ city: 'Natales',
867
+ postcode: '622109',
868
+ country: 'Tajikistan',
869
+ personalID: '16430908 1950',
870
+ },
871
+ {
872
+ firstName: 'Morgan',
873
+ lastName: 'Hutchinson',
874
+ email: 'mauris.eu@ipsum.ca',
875
+ phoneNo: '070 6292 4498',
876
+ street: '3135 Curabitur Rd.',
877
+ city: 'Darmstadt',
878
+ postcode: '010900',
879
+ country: 'Colombia',
880
+ personalID: '16890811 2991',
881
+ },
882
+ {
883
+ firstName: 'Kylee',
884
+ lastName: 'Riddle',
885
+ email: 'libero.Proin@malesuadafamesac.com',
886
+ phoneNo: '(017177) 84788',
887
+ street: '7336 Ipsum St.',
888
+ city: 'Semarang',
889
+ postcode: '9828',
890
+ country: 'Papua New Guinea',
891
+ personalID: '16260701 0093',
892
+ },
893
+ {
894
+ firstName: 'Cathleen',
895
+ lastName: 'Dale',
896
+ email: 'risus.Donec@augue.edu',
897
+ phoneNo: '(0115) 224 4142',
898
+ street: 'Ap #568-2948 Fringilla Rd.',
899
+ city: 'Brandenburg',
900
+ postcode: 'CH2L 4EH',
901
+ country: 'Guinea-Bissau',
902
+ personalID: '16161203 4817',
903
+ },
904
+ {
905
+ firstName: 'Sierra',
906
+ lastName: 'Robbins',
907
+ email: 'dictum.eleifend.nunc@tellus.net',
908
+ phoneNo: '(01266) 957950',
909
+ street: '481-6201 Mattis. Rd.',
910
+ city: 'Upper Hutt',
911
+ postcode: '23945',
912
+ country: 'Isle of Man',
913
+ personalID: '16691217 6010',
914
+ },
915
+ {
916
+ firstName: 'Levi',
917
+ lastName: 'Simpson',
918
+ email: 'Nulla.tempor.augue@nibhdolor.ca',
919
+ phoneNo: '0855 608 0347',
920
+ street: '555-4187 Integer Av.',
921
+ city: 'Curacaví',
922
+ postcode: '439311',
923
+ country: 'Tuvalu',
924
+ personalID: '16000330 9499',
925
+ },
926
+ {
927
+ firstName: 'Kyle',
928
+ lastName: 'Mendez',
929
+ email: 'lacinia@senectus.org',
930
+ phoneNo: '0845 46 40',
931
+ street: '814-4647 Nec, St.',
932
+ city: 'Akron',
933
+ postcode: '199413',
934
+ country: 'Qatar',
935
+ personalID: '16471029 5397',
936
+ },
937
+ {
938
+ firstName: 'Emery',
939
+ lastName: 'Hurley',
940
+ email: 'Nulla.facilisis@nonummyultriciesornare.co.uk',
941
+ phoneNo: '(01553) 502913',
942
+ street: '4540 Luctus Ave',
943
+ city: 'Meux',
944
+ postcode: '36612',
945
+ country: 'Belize',
946
+ personalID: '16440228 3842',
947
+ },
948
+ {
949
+ firstName: 'Nadine',
950
+ lastName: 'Buchanan',
951
+ email: 'Duis@Sed.ca',
952
+ phoneNo: '055 2785 0228',
953
+ street: '694 Mi, Av.',
954
+ city: 'Middelburg',
955
+ postcode: '62232-88887',
956
+ country: 'Uruguay',
957
+ personalID: '16721129 5857',
958
+ },
959
+ {
960
+ firstName: 'Dalton',
961
+ lastName: 'Nieves',
962
+ email: 'nibh.dolor.nonummy@laoreetlibero.org',
963
+ phoneNo: '0395 486 9374',
964
+ street: '797-8170 Enim, Street',
965
+ city: 'Burhanpur',
966
+ postcode: '29633-93750',
967
+ country: 'Cayman Islands',
968
+ personalID: '16600205 0067',
969
+ },
970
+ {
971
+ firstName: 'Zeph',
972
+ lastName: 'Ruiz',
973
+ email: 'non.dui@felisorci.com',
974
+ phoneNo: '0845 46 41',
975
+ street: 'Ap #282-8369 Malesuada Ave',
976
+ city: 'Cavallino',
977
+ postcode: 'EW2V 1ZE',
978
+ country: 'Niger',
979
+ personalID: '16580706 9124',
980
+ },
981
+ {
982
+ firstName: 'Shannon',
983
+ lastName: 'Decker',
984
+ email: 'leo@lobortis.co.uk',
985
+ phoneNo: '0800 135593',
986
+ street: 'P.O. Box 587, 6871 Eleifend. Ave',
987
+ city: 'Rocca San Felice',
988
+ postcode: '42271-38735',
989
+ country: 'Somalia',
990
+ personalID: '16090810 4763',
991
+ },
992
+ {
993
+ firstName: 'Erich',
994
+ lastName: 'Daniels',
995
+ email: 'cursus.non.egestas@aliquet.org',
996
+ phoneNo: '0845 46 44',
997
+ street: '689-4565 Velit. Avenue',
998
+ city: 'Edmundston',
999
+ postcode: 'JR32 7QA',
1000
+ country: 'Sao Tome and Principe',
1001
+ personalID: '16720401 5049',
1002
+ },
1003
+ {
1004
+ firstName: 'Rhiannon',
1005
+ lastName: 'Malone',
1006
+ email: 'arcu.Morbi.sit@cursus.edu',
1007
+ phoneNo: '0361 311 4051',
1008
+ street: 'Ap #971-1781 Vehicula Road',
1009
+ city: 'Wood Buffalo',
1010
+ postcode: '71682',
1011
+ country: 'Croatia',
1012
+ personalID: '16931028 3388',
1013
+ },
1014
+ {
1015
+ firstName: 'Elijah',
1016
+ lastName: 'Sosa',
1017
+ email: 'ipsum.Donec.sollicitudin@leo.co.uk',
1018
+ phoneNo: '0800 365 8250',
1019
+ street: 'P.O. Box 169, 2562 Commodo Ave',
1020
+ city: 'Montoggio',
1021
+ postcode: '42092',
1022
+ country: 'San Marino',
1023
+ personalID: '16251107 2403',
1024
+ },
1025
+ {
1026
+ firstName: 'Grady',
1027
+ lastName: 'Crosby',
1028
+ email: 'mollis.nec.cursus@malesuadamalesuadaInteger.edu',
1029
+ phoneNo: '070 2824 3427',
1030
+ street: '821-5145 Id, Ave',
1031
+ city: 'Rosoux-Crenwick',
1032
+ postcode: '56176',
1033
+ country: 'Cuba',
1034
+ personalID: '16520115 9133',
1035
+ },
1036
+ {
1037
+ firstName: 'Quentin',
1038
+ lastName: 'Armstrong',
1039
+ email: 'erat.vel@auctor.net',
1040
+ phoneNo: '(029) 5052 0365',
1041
+ street: '157-253 Hendrerit Av.',
1042
+ city: 'Aubervilliers',
1043
+ postcode: '2151',
1044
+ country: 'Mayotte',
1045
+ personalID: '16730607 0553',
1046
+ },
1047
+ {
1048
+ firstName: 'Samuel',
1049
+ lastName: 'Harrell',
1050
+ email: 'tellus@magnaSed.edu',
1051
+ phoneNo: '07064 102166',
1052
+ street: 'P.O. Box 713, 4115 Ut Rd.',
1053
+ city: 'Kingston',
1054
+ postcode: '23315',
1055
+ country: 'Lebanon',
1056
+ personalID: '16361016 5551',
1057
+ },
1058
+ {
1059
+ firstName: 'Merritt',
1060
+ lastName: 'Holland',
1061
+ email: 'interdum.Nunc.sollicitudin@elitpellentesque.edu',
1062
+ phoneNo: '0800 825458',
1063
+ street: 'P.O. Box 261, 3590 Nascetur Road',
1064
+ city: 'Drancy',
1065
+ postcode: '760017',
1066
+ country: 'French Southern Territories',
1067
+ personalID: '16040311 2121',
1068
+ },
1069
+ {
1070
+ firstName: 'Harlan',
1071
+ lastName: 'Brennan',
1072
+ email: 'nascetur.ridiculus@feugiatmetussit.net',
1073
+ phoneNo: '(012812) 59410',
1074
+ street: '8210 Torquent Av.',
1075
+ city: 'Grantham',
1076
+ postcode: '01537',
1077
+ country: 'Saint Pierre and Miquelon',
1078
+ personalID: '16431216 0239',
1079
+ },
1080
+ {
1081
+ firstName: 'Stuart',
1082
+ lastName: 'Deleon',
1083
+ email: 'sed.pede.nec@maurisMorbinon.com',
1084
+ phoneNo: '0807 013 3815',
1085
+ street: 'P.O. Box 143, 4909 At Street',
1086
+ city: 'Terrance',
1087
+ postcode: '27218',
1088
+ country: 'Jersey',
1089
+ personalID: '16330207 5852',
1090
+ },
1091
+ {
1092
+ firstName: 'Clarke',
1093
+ lastName: 'Middleton',
1094
+ email: 'in@estacfacilisis.org',
1095
+ phoneNo: '(028) 5013 9648',
1096
+ street: '9856 Eget, Avenue',
1097
+ city: 'Solihull',
1098
+ postcode: '72893',
1099
+ country: 'Seychelles',
1100
+ personalID: '16340804 3325',
1101
+ },
1102
+ {
1103
+ firstName: 'Roanna',
1104
+ lastName: 'Gentry',
1105
+ email: 'dui@nascetur.net',
1106
+ phoneNo: '(024) 3023 2962',
1107
+ street: '3566 Ornare. Rd.',
1108
+ city: 'Freiberg',
1109
+ postcode: '3899',
1110
+ country: 'Lesotho',
1111
+ personalID: '16680618 3791',
1112
+ },
1113
+ {
1114
+ firstName: 'Delilah',
1115
+ lastName: 'Bird',
1116
+ email: 'laoreet.lectus.quis@utaliquam.edu',
1117
+ phoneNo: '07160 224163',
1118
+ street: 'P.O. Box 332, 8565 Molestie Avenue',
1119
+ city: 'Washuk',
1120
+ postcode: '607065',
1121
+ country: 'Indonesia',
1122
+ personalID: '16891112 9461',
1123
+ },
1124
+ {
1125
+ firstName: 'Georgia',
1126
+ lastName: 'Cash',
1127
+ email: 'dui@enimnisl.net',
1128
+ phoneNo: '(0113) 542 3955',
1129
+ street: '900-3252 Fusce Avenue',
1130
+ city: 'Sint-Michiels',
1131
+ postcode: 'Z8203',
1132
+ country: 'Niue',
1133
+ personalID: '16340718 4716',
1134
+ },
1135
+ {
1136
+ firstName: 'Aiko',
1137
+ lastName: 'Mclean',
1138
+ email: 'cubilia.Curae.Phasellus@augueid.com',
1139
+ phoneNo: '055 9506 2116',
1140
+ street: 'P.O. Box 786, 1756 Fringilla St.',
1141
+ city: 'Malonne',
1142
+ postcode: 'Y8E 7M2',
1143
+ country: 'Belize',
1144
+ personalID: '16680622 4207',
1145
+ },
1146
+ {
1147
+ firstName: 'Winter',
1148
+ lastName: 'Jacobs',
1149
+ email: 'aliquet@Duisac.ca',
1150
+ phoneNo: '0800 693847',
1151
+ street: '774-9011 Arcu Road',
1152
+ city: 'Bilbo',
1153
+ postcode: '05558',
1154
+ country: 'Equatorial Guinea',
1155
+ personalID: '16611201 4144',
1156
+ },
1157
+ {
1158
+ firstName: 'Jolene',
1159
+ lastName: 'Rios',
1160
+ email: 'odio.Aliquam.vulputate@ac.ca',
1161
+ phoneNo: '(023) 4876 2215',
1162
+ street: 'Ap #325-8225 Amet Road',
1163
+ city: 'Limena',
1164
+ postcode: 'K56 0YJ',
1165
+ country: 'Morocco',
1166
+ personalID: '16170215 3485',
1167
+ },
1168
+ {
1169
+ firstName: 'Kaden',
1170
+ lastName: 'Morrow',
1171
+ email: 'rutrum@eleifendnec.ca',
1172
+ phoneNo: '07305 685548',
1173
+ street: '8870 Aliquam Road',
1174
+ city: 'Sète',
1175
+ postcode: '04908',
1176
+ country: 'Peru',
1177
+ personalID: '16820820 6675',
1178
+ },
1179
+ {
1180
+ firstName: 'Kaseem',
1181
+ lastName: 'Norris',
1182
+ email: 'mauris.erat.eget@nequeMorbi.com',
1183
+ phoneNo: '07275 403152',
1184
+ street: 'P.O. Box 776, 7115 Integer Avenue',
1185
+ city: 'Jönköping',
1186
+ postcode: '42236-83471',
1187
+ country: 'Sudan',
1188
+ personalID: '16440829 7895',
1189
+ },
1190
+ {
1191
+ firstName: 'Vladimir',
1192
+ lastName: 'Mcguire',
1193
+ email: 'id@nonarcuVivamus.edu',
1194
+ phoneNo: '0500 950469',
1195
+ street: '2067 Est Ave',
1196
+ city: 'Ziano di Fiemme',
1197
+ postcode: '774056',
1198
+ country: 'Mexico',
1199
+ personalID: '16771016 3796',
1200
+ },
1201
+ {
1202
+ firstName: 'Jocelyn',
1203
+ lastName: 'Schroeder',
1204
+ email: 'dolor@nec.ca',
1205
+ phoneNo: '07302 403156',
1206
+ street: 'Ap #155-3999 Vivamus St.',
1207
+ city: 'Malloa',
1208
+ postcode: '4059',
1209
+ country: 'Canada',
1210
+ personalID: '16530314 9388',
1211
+ },
1212
+ {
1213
+ firstName: 'Howard',
1214
+ lastName: 'Villarreal',
1215
+ email: 'Donec.felis@insodales.com',
1216
+ phoneNo: '07624 830239',
1217
+ street: '540-7057 Cras Rd.',
1218
+ city: 'Siverek',
1219
+ postcode: '8701',
1220
+ country: 'Seychelles',
1221
+ personalID: '16640823 8530',
1222
+ },
1223
+ {
1224
+ firstName: 'Adam',
1225
+ lastName: 'Miranda',
1226
+ email: 'amet.dapibus@faucibus.edu',
1227
+ phoneNo: '0845 46 49',
1228
+ street: 'Ap #931-6286 Diam. Avenue',
1229
+ city: 'Warburg',
1230
+ postcode: '01972',
1231
+ country: 'Jordan',
1232
+ personalID: '16370414 7911',
1233
+ },
1234
+ {
1235
+ firstName: 'Aiko',
1236
+ lastName: 'Elliott',
1237
+ email: 'sodales@mauris.edu',
1238
+ phoneNo: '0800 1111',
1239
+ street: 'P.O. Box 583, 6119 Ut St.',
1240
+ city: 'Villavicencio',
1241
+ postcode: '4864 XQ',
1242
+ country: 'Faroe Islands',
1243
+ personalID: '16940907 6115',
1244
+ },
1245
+ \].map((person) \=> ({
1246
+ ...person,
1247
+ sales: getSales(Math.random()),
1248
+ profit: getProfit(Math.random()),
1249
+ redOrGreen: getRating(),
1250
+ date: new Date(Math.floor(Math.random() \* \-10000000000)).toDateString(),
1251
+ }));
1252
+ const createClassNameMutationObserver \= (
1253
+ element: HTMLElement,
1254
+ callback: (className: string) \=> void,
1255
+ ): MutationObserver \=> {
1256
+ const observer \= new MutationObserver(() \=> {
1257
+ callback(element.className);
1258
+ });
1259
+ observer.observe(element, {
1260
+ attributes: true,
1261
+ attributeFilter: \['class'\],
1262
+ childList: false,
1263
+ characterData: false,
1264
+ });
1265
+ return observer;
1266
+ };
1267
+ const useClassNameMutationObserver \= (
1268
+ element: HTMLElement,
1269
+ callback: () \=> void,
1270
+ ): void \=> {
1271
+ useEffect(() \=> {
1272
+ const observer \= createClassNameMutationObserver(element, callback);
1273
+ // Cleanup listener
1274
+ return (): void \=> {
1275
+ observer.disconnect();
1276
+ };
1277
+ });
1278
+ };
1279
+ const RedOrGreenFormatter \= (params: ValueFormatterParams) \=> {
1280
+ const dotStyle \= styles\[\`dot--${params.value}\`\];
1281
+ return <span className\={\`${styles.dot} ${dotStyle}\`} />;
1282
+ };
1283
+ const CommaFormatter \= (params: ValueFormatterParams): string \=> {
1284
+ return params.value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');
1285
+ };
1286
+ const CurrencyFormatter \= (params: ValueFormatterParams): string \=> {
1287
+ if (params.value \=== '0.00') {
1288
+ return formatter2dp.format(params.value);
1289
+ }
1290
+ return formatterCurrency.format(params.value);
1291
+ };
1292
+ export const AgGridComplex \= (args: AgGridReactProps) \=> {
1293
+ const \[rowData, setRowData\] \= useState(BIG\_DATA);
1294
+ const api \= useRef<GridApi\>();
1295
+ // pick one row at random to show data updating in the grid
1296
+ useEffect(() \=> {
1297
+ const updateTick \= setInterval(() \=> {
1298
+ const randomNo \= Math.random();
1299
+ const index \= Math.floor(Math.random() \* rowData.length);
1300
+ const itemToUpdate \= rowData\[index\];
1301
+ if (randomNo < 0.5) {
1302
+ itemToUpdate.sales \= getSales(Math.random());
1303
+ } else if (randomNo \> 0.9) {
1304
+ itemToUpdate.profit \= getProfit(0);
1305
+ } else {
1306
+ itemToUpdate.profit \= getProfit(Math.random());
1307
+ }
1308
+ setRowData(rowData);
1309
+ api.current?.refreshCells();
1310
+ }, 500);
1311
+ return () \=> {
1312
+ clearInterval(updateTick);
1313
+ };
1314
+ }, \[rowData\]);
1315
+ const onGridReady \= useCallback((event: GridReadyEvent): void \=> {
1316
+ api.current \= event.api;
1317
+ api.current.resetRowHeights();
1318
+ }, \[\]);
1319
+ useClassNameMutationObserver(document.documentElement, () \=> {
1320
+ if (api.current) {
1321
+ api.current.resetRowHeights();
1322
+ }
1323
+ });
1324
+ return (
1325
+ <IressAgGridContainer
1326
+ alignMiddle
1327
+ style\={{ height: '100vh', width: '100%' }}
1328
+ \>
1329
+ <AgGridReact {...args}
1330
+ onGridReady={onGridReady}
1331
+ rowDragManaged animateRows enableRangeSelection={true}
1332
+ enableCharts={true}
1333
+ sideBar={true}
1334
+ rowData={rowData}
1335
+ rowSelection="multiple" rowMultiSelectWithClick components={{
1336
+ redGreenDots: RedOrGreenFormatter,
1337
+ }}
1338
+ defaultColDef={{
1339
+ enableCellChangeFlash: true,
1340
+ resizable: true,
1341
+ sortable: true,
1342
+ unSortIcon: true,
1343
+ filter: true,
1344
+ floatingFilter: true,
1345
+ enablePivot: false,
1346
+ filterParams: {
1347
+ buttons: \['reset', 'apply'\],
1348
+ },
1349
+ autoHeight: true,
1350
+ wrapText: true,
1351
+ }}
1352
+ icons={AG\_THEME\_IRESS\_ICONS}
1353
+ columnDefs={\[
1354
+ {
1355
+ headerName: 'Employee',
1356
+ children: \[
1357
+ {
1358
+ field: 'firstName',
1359
+ editable: true,
1360
+ filter: 'agTextColumnFilter',
1361
+ headerTooltip: 'First name',
1362
+ rowDrag: true,
1363
+ lockVisible: true,
1364
+ tooltipField: 'firstName',
1365
+ },
1366
+ {
1367
+ field: 'lastName',
1368
+ editable: true,
1369
+ filter: 'agTextColumnFilter',
1370
+ headerTooltip: 'Surname',
1371
+ lockVisible: true,
1372
+ cellClass: 'iress-cell--divider',
1373
+ headerClass: 'iress-cell--divider',
1374
+ columnGroupShow: 'open',
1375
+ },
1376
+ {
1377
+ field: 'personalID',
1378
+ filter: 'agTextColumnFilter',
1379
+ headerTooltip: 'Personal ID',
1380
+ columnGroupShow: 'open',
1381
+ },
1382
+ {
1383
+ field: 'date',
1384
+ filter: 'agDateColumnFilter',
1385
+ headerTooltip: 'Date',
1386
+ columnGroupShow: 'open',
1387
+ },
1388
+ \],
1389
+ },
1390
+ {
1391
+ headerName: 'Sales performance',
1392
+ children: \[
1393
+ {
1394
+ field: 'redOrGreen',
1395
+ headerName: 'Rating',
1396
+ cellRenderer: 'redGreenDots',
1397
+ filter: false,
1398
+ },
1399
+ {
1400
+ field: 'sales',
1401
+ filter: 'agNumberColumnFilter',
1402
+ valueFormatter: CommaFormatter,
1403
+ },
1404
+ {
1405
+ field: 'profit',
1406
+ valueFormatter: CurrencyFormatter,
1407
+ cellClassRules: {
1408
+ 'iress--positive': (params) \=> parseInt(params.value, 10) \> 0,
1409
+ 'iress--negative': (params) \=> parseInt(params.value, 10) < 0,
1410
+ 'iress--zero': (params) \=> params.value \=== '0.00',
1411
+ },
1412
+ },
1413
+ \],
1414
+ },
1415
+ {
1416
+ headerName: 'Contact details',
1417
+ children: \[
1418
+ {
1419
+ field: 'email',
1420
+ width: 350,
1421
+ filter: 'agTextColumnFilter',
1422
+ headerTooltip: 'Email address',
1423
+ cellClass: 'iress-cell--ellipsis',
1424
+ },
1425
+ {
1426
+ field: 'phoneNo',
1427
+ enableValue: true,
1428
+ filter: 'agTextColumnFilter',
1429
+ headerTooltip: 'Phone number',
1430
+ },
1431
+ \],
1432
+ },
1433
+ {
1434
+ headerName: 'Address',
1435
+ children: \[
1436
+ {
1437
+ field: 'street',
1438
+ width: 350,
1439
+ filter: 'agTextColumnFilter',
1440
+ cellClass: 'iress-cell--ellipsis',
1441
+ columnGroupShow: 'open',
1442
+ },
1443
+ {
1444
+ field: 'city',
1445
+ filter: 'agTextColumnFilter',
1446
+ columnGroupShow: 'open',
1447
+ },
1448
+ {
1449
+ field: 'postcode',
1450
+ filter: 'agTextColumnFilter',
1451
+ columnGroupShow: 'open',
1452
+ },
1453
+ { field: 'country', filter: 'agTextColumnFilter' },
1454
+ \],
1455
+ },
1456
+ \]}
1457
+ /> </IressAgGridContainer\>
1458
+ );
1459
+ };
1460
+ export default AgGridComplex;
1461
+
1462
+ Copy
573
1463
 
574
1464
  ### [](#compact)Compact
575
1465
 
@@ -603,9 +1493,9 @@ Country
603
1493
 
604
1494
  Shellie
605
1495
 
606
- 17,972
1496
+ 31,402
607
1497
 
608
- \-£688.02
1498
+ \-£697.34
609
1499
 
610
1500
  aliquet@purus.com
611
1501
 
@@ -615,9 +1505,9 @@ French Polynesia
615
1505
 
616
1506
  Jade
617
1507
 
618
- 65,080
1508
+ 77,405
619
1509
 
620
- £152.28
1510
+ £210.43
621
1511
 
622
1512
  mi.pede.nonummy@senectus.org
623
1513
 
@@ -627,9 +1517,9 @@ Tonga
627
1517
 
628
1518
  Wyoming
629
1519
 
630
- 8,750
1520
+ 71,423
631
1521
 
632
- £10.93
1522
+ \-£763.27
633
1523
 
634
1524
  Nulla.tempor.augue@aliquamiaculis.org
635
1525
 
@@ -639,9 +1529,9 @@ Rwanda
639
1529
 
640
1530
  Christine
641
1531
 
642
- 16,278
1532
+ 53,913
643
1533
 
644
- \-£795.88
1534
+ 0.00
645
1535
 
646
1536
  neque.sed.dictum@ultricesVivamus.ca
647
1537
 
@@ -651,9 +1541,9 @@ Bahamas
651
1541
 
652
1542
  Jameson
653
1543
 
654
- 42,804
1544
+ 22,036
655
1545
 
656
- \-£972.10
1546
+ £195.10
657
1547
 
658
1548
  sem.semper@liberoProin.com
659
1549
 
@@ -663,9 +1553,9 @@ Nauru
663
1553
 
664
1554
  Driscoll
665
1555
 
666
- 11,266
1556
+ 40,956
667
1557
 
668
- \-£610.75
1558
+ \-£775.97
669
1559
 
670
1560
  libero.dui@estacfacilisis.edu
671
1561
 
@@ -675,9 +1565,9 @@ Tajikistan
675
1565
 
676
1566
  Morgan
677
1567
 
678
- 84,926
1568
+ 90,802
679
1569
 
680
- \-£653.18
1570
+ \-£944.95
681
1571
 
682
1572
  mauris.eu@ipsum.ca
683
1573
 
@@ -687,9 +1577,9 @@ Colombia
687
1577
 
688
1578
  Kylee
689
1579
 
690
- 5,227
1580
+ 89,571
691
1581
 
692
- 0.00
1582
+ £135.63
693
1583
 
694
1584
  libero.Proin@malesuadafamesac.com
695
1585
 
@@ -699,9 +1589,9 @@ Papua New Guinea
699
1589
 
700
1590
  Cathleen
701
1591
 
702
- 11,127
1592
+ 11,990
703
1593
 
704
- \-£931.98
1594
+ £359.81
705
1595
 
706
1596
  risus.Donec@augue.edu
707
1597
 
@@ -711,9 +1601,9 @@ Guinea-Bissau
711
1601
 
712
1602
  Sierra
713
1603
 
714
- 68,369
1604
+ 90,143
715
1605
 
716
- \-£686.59
1606
+ £104.59
717
1607
 
718
1608
  dictum.eleifend.nunc@tellus.net
719
1609
 
@@ -723,9 +1613,9 @@ Isle of Man
723
1613
 
724
1614
  Levi
725
1615
 
726
- 56,491
1616
+ 54,014
727
1617
 
728
- \-£897.31
1618
+ \-£689.82
729
1619
 
730
1620
  Nulla.tempor.augue@nibhdolor.ca
731
1621
 
@@ -735,9 +1625,9 @@ Tuvalu
735
1625
 
736
1626
  Kyle
737
1627
 
738
- 4,929
1628
+ 68,546
739
1629
 
740
- \-£537.12
1630
+ 0.00
741
1631
 
742
1632
  lacinia@senectus.org
743
1633
 
@@ -747,9 +1637,9 @@ Qatar
747
1637
 
748
1638
  Emery
749
1639
 
750
- 25,854
1640
+ 33,689
751
1641
 
752
- £87.24
1642
+ \-£566.56
753
1643
 
754
1644
  Nulla.facilisis@nonummyultriciesornare.co.uk
755
1645
 
@@ -759,9 +1649,9 @@ Belize
759
1649
 
760
1650
  Nadine
761
1651
 
762
- 9,152
1652
+ 8,157
763
1653
 
764
- \-£973.34
1654
+ £478.86
765
1655
 
766
1656
  Duis@Sed.ca
767
1657
 
@@ -771,9 +1661,9 @@ Uruguay
771
1661
 
772
1662
  Dalton
773
1663
 
774
- 52,780
1664
+ 15,504
775
1665
 
776
- £353.64
1666
+ \-£697.81
777
1667
 
778
1668
  nibh.dolor.nonummy@laoreetlibero.org
779
1669
 
@@ -783,9 +1673,9 @@ Cayman Islands
783
1673
 
784
1674
  Zeph
785
1675
 
786
- 44,588
1676
+ 85,532
787
1677
 
788
- \-£709.00
1678
+ £176.54
789
1679
 
790
1680
  non.dui@felisorci.com
791
1681
 
@@ -795,9 +1685,9 @@ Niger
795
1685
 
796
1686
  Shannon
797
1687
 
798
- 54,700
1688
+ 51,971
799
1689
 
800
- £151.31
1690
+ \-£560.58
801
1691
 
802
1692
  leo@lobortis.co.uk
803
1693
 
@@ -807,9 +1697,9 @@ Somalia
807
1697
 
808
1698
  Erich
809
1699
 
810
- 31,612
1700
+ 50,825
811
1701
 
812
- \-£557.04
1702
+ £468.14
813
1703
 
814
1704
  cursus.non.egestas@aliquet.org
815
1705
 
@@ -819,9 +1709,9 @@ Sao Tome and Principe
819
1709
 
820
1710
  Rhiannon
821
1711
 
822
- 69,501
1712
+ 88,614
823
1713
 
824
- £116.64
1714
+ £374.60
825
1715
 
826
1716
  arcu.Morbi.sit@cursus.edu
827
1717
 
@@ -831,9 +1721,9 @@ Croatia
831
1721
 
832
1722
  Elijah
833
1723
 
834
- 32,390
1724
+ 97,084
835
1725
 
836
- £115.44
1726
+ \-£515.56
837
1727
 
838
1728
  ipsum.Donec.sollicitudin@leo.co.uk
839
1729
 
@@ -843,9 +1733,9 @@ San Marino
843
1733
 
844
1734
  Grady
845
1735
 
846
- 53,408
1736
+ 1,352
847
1737
 
848
- £82.94
1738
+ \-£754.41
849
1739
 
850
1740
  mollis.nec.cursus@malesuadamalesuadaInteger.edu
851
1741
 
@@ -855,9 +1745,9 @@ Cuba
855
1745
 
856
1746
  Quentin
857
1747
 
858
- 62,717
1748
+ 9,164
859
1749
 
860
- \-£830.80
1750
+ 0.00
861
1751
 
862
1752
  erat.vel@auctor.net
863
1753
 
@@ -867,9 +1757,9 @@ Mayotte
867
1757
 
868
1758
  Samuel
869
1759
 
870
- 65,380
1760
+ 8,709
871
1761
 
872
- \-£799.63
1762
+ £422.41
873
1763
 
874
1764
  tellus@magnaSed.edu
875
1765
 
@@ -879,9 +1769,9 @@ Lebanon
879
1769
 
880
1770
  Merritt
881
1771
 
882
- 10,433
1772
+ 3,443
883
1773
 
884
- \-£505.97
1774
+ \-£968.07
885
1775
 
886
1776
  interdum.Nunc.sollicitudin@elitpellentesque.edu
887
1777
 
@@ -891,9 +1781,9 @@ French Southern Territories
891
1781
 
892
1782
  Harlan
893
1783
 
894
- 50,760
1784
+ 22,747
895
1785
 
896
- £295.19
1786
+ \-£893.54
897
1787
 
898
1788
  nascetur.ridiculus@feugiatmetussit.net
899
1789
 
@@ -903,9 +1793,9 @@ Saint Pierre and Miquelon
903
1793
 
904
1794
  Stuart
905
1795
 
906
- 60,138
1796
+ 94,877
907
1797
 
908
- \-£863.95
1798
+ £327.49
909
1799
 
910
1800
  sed.pede.nec@maurisMorbinon.com
911
1801
 
@@ -1009,7 +1899,709 @@ to of
1009
1899
 
1010
1900
  Page of
1011
1901
 
1012
- Show code
1902
+ Hide code
1903
+
1904
+ \[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
1905
+
1906
+ import { useCallback, useEffect, useRef, useState } from 'react';
1907
+ import { AG\_GRID\_LICENSE\_KEY } from '@iress/ag-grid-license-key';
1908
+ import type {
1909
+ GridApi,
1910
+ GridReadyEvent,
1911
+ ValueFormatterParams,
1912
+ } from 'ag-grid-community';
1913
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
1914
+ import {
1915
+ AllEnterpriseModule,
1916
+ LicenseManager,
1917
+ ModuleRegistry,
1918
+ provideGlobalGridOptions,
1919
+ } from 'ag-grid-enterprise';
1920
+ import { AG\_THEME\_IRESS\_ICONS, IressAgGridContainer } from '@iress/ids-themes';
1921
+ import styles from '@iress-storybook/styles.module.scss';
1922
+ LicenseManager.setLicenseKey(AG\_GRID\_LICENSE\_KEY);
1923
+ ModuleRegistry.registerModules(\[AllEnterpriseModule\]);
1924
+ provideGlobalGridOptions({ theme: 'legacy' });
1925
+ const formatter2dp \= new Intl.NumberFormat('en-UK', {
1926
+ minimumFractionDigits: 2,
1927
+ maximumFractionDigits: 2,
1928
+ });
1929
+ const formatterCurrency \= new Intl.NumberFormat('en-UK', {
1930
+ minimumFractionDigits: 2,
1931
+ maximumFractionDigits: 2,
1932
+ currencySign: 'standard',
1933
+ currency: 'GBP',
1934
+ style: 'currency',
1935
+ });
1936
+ const getSales \= (number: number) \=> {
1937
+ const no \= number \* 100000;
1938
+ return Math.ceil(no);
1939
+ };
1940
+ const getProfit \= (number: number) \=> {
1941
+ const no \= number \> 0.5 ? number \* \-1000 : number \* 1000;
1942
+ return formatter2dp.format(no);
1943
+ };
1944
+ const getRating \= () \=> (Math.random() \> 0.5 ? 'red' : 'green');
1945
+ const BIG\_DATA \= \[
1946
+ {
1947
+ firstName: 'Shellie',
1948
+ lastName: 'Cantu',
1949
+ email: 'aliquet@purus.com',
1950
+ phoneNo: '0828 746 6831',
1951
+ street: '639-9644 Eget Street',
1952
+ city: 'Weißenfels',
1953
+ postcode: '37962',
1954
+ country: 'French Polynesia',
1955
+ personalID: '16011210 9582',
1956
+ },
1957
+ {
1958
+ firstName: 'Jade',
1959
+ lastName: 'Sellers',
1960
+ email: 'mi.pede.nonummy@senectus.org',
1961
+ phoneNo: '0800 360062',
1962
+ street: 'P.O. Box 511, 3099 In Rd.',
1963
+ city: 'Cochrane',
1964
+ postcode: 'K8I 3RB',
1965
+ country: 'Tonga',
1966
+ personalID: '16870328 2056',
1967
+ },
1968
+ {
1969
+ firstName: 'Wyoming',
1970
+ lastName: 'Fox',
1971
+ email: 'Nulla.tempor.augue@aliquamiaculis.org',
1972
+ phoneNo: '0800 377 7753',
1973
+ street: '7354 Ac Ave',
1974
+ city: 'East Kilbride',
1975
+ postcode: '233010',
1976
+ country: 'Rwanda',
1977
+ personalID: '16070816 5048',
1978
+ },
1979
+ {
1980
+ firstName: 'Christine',
1981
+ lastName: 'Holcomb',
1982
+ email: 'neque.sed.dictum@ultricesVivamus.ca',
1983
+ phoneNo: '07578 190673',
1984
+ street: 'Ap #121-4421 Iaculis Av.',
1985
+ city: 'Etroubles',
1986
+ postcode: '6742',
1987
+ country: 'Bahamas',
1988
+ personalID: '16401211 0773',
1989
+ },
1990
+ {
1991
+ firstName: 'Jameson',
1992
+ lastName: 'Sutton',
1993
+ email: 'sem.semper@liberoProin.com',
1994
+ phoneNo: '07489 442639',
1995
+ street: 'Ap #700-1481 Porttitor Ave',
1996
+ city: 'Nice',
1997
+ postcode: '14655',
1998
+ country: 'Nauru',
1999
+ personalID: '16301129 4323',
2000
+ },
2001
+ {
2002
+ firstName: 'Driscoll',
2003
+ lastName: 'Jenkins',
2004
+ email: 'libero.dui@estacfacilisis.edu',
2005
+ phoneNo: '0843 298 8205',
2006
+ street: 'Ap #775-8090 Sed Avenue',
2007
+ city: 'Natales',
2008
+ postcode: '622109',
2009
+ country: 'Tajikistan',
2010
+ personalID: '16430908 1950',
2011
+ },
2012
+ {
2013
+ firstName: 'Morgan',
2014
+ lastName: 'Hutchinson',
2015
+ email: 'mauris.eu@ipsum.ca',
2016
+ phoneNo: '070 6292 4498',
2017
+ street: '3135 Curabitur Rd.',
2018
+ city: 'Darmstadt',
2019
+ postcode: '010900',
2020
+ country: 'Colombia',
2021
+ personalID: '16890811 2991',
2022
+ },
2023
+ {
2024
+ firstName: 'Kylee',
2025
+ lastName: 'Riddle',
2026
+ email: 'libero.Proin@malesuadafamesac.com',
2027
+ phoneNo: '(017177) 84788',
2028
+ street: '7336 Ipsum St.',
2029
+ city: 'Semarang',
2030
+ postcode: '9828',
2031
+ country: 'Papua New Guinea',
2032
+ personalID: '16260701 0093',
2033
+ },
2034
+ {
2035
+ firstName: 'Cathleen',
2036
+ lastName: 'Dale',
2037
+ email: 'risus.Donec@augue.edu',
2038
+ phoneNo: '(0115) 224 4142',
2039
+ street: 'Ap #568-2948 Fringilla Rd.',
2040
+ city: 'Brandenburg',
2041
+ postcode: 'CH2L 4EH',
2042
+ country: 'Guinea-Bissau',
2043
+ personalID: '16161203 4817',
2044
+ },
2045
+ {
2046
+ firstName: 'Sierra',
2047
+ lastName: 'Robbins',
2048
+ email: 'dictum.eleifend.nunc@tellus.net',
2049
+ phoneNo: '(01266) 957950',
2050
+ street: '481-6201 Mattis. Rd.',
2051
+ city: 'Upper Hutt',
2052
+ postcode: '23945',
2053
+ country: 'Isle of Man',
2054
+ personalID: '16691217 6010',
2055
+ },
2056
+ {
2057
+ firstName: 'Levi',
2058
+ lastName: 'Simpson',
2059
+ email: 'Nulla.tempor.augue@nibhdolor.ca',
2060
+ phoneNo: '0855 608 0347',
2061
+ street: '555-4187 Integer Av.',
2062
+ city: 'Curacaví',
2063
+ postcode: '439311',
2064
+ country: 'Tuvalu',
2065
+ personalID: '16000330 9499',
2066
+ },
2067
+ {
2068
+ firstName: 'Kyle',
2069
+ lastName: 'Mendez',
2070
+ email: 'lacinia@senectus.org',
2071
+ phoneNo: '0845 46 40',
2072
+ street: '814-4647 Nec, St.',
2073
+ city: 'Akron',
2074
+ postcode: '199413',
2075
+ country: 'Qatar',
2076
+ personalID: '16471029 5397',
2077
+ },
2078
+ {
2079
+ firstName: 'Emery',
2080
+ lastName: 'Hurley',
2081
+ email: 'Nulla.facilisis@nonummyultriciesornare.co.uk',
2082
+ phoneNo: '(01553) 502913',
2083
+ street: '4540 Luctus Ave',
2084
+ city: 'Meux',
2085
+ postcode: '36612',
2086
+ country: 'Belize',
2087
+ personalID: '16440228 3842',
2088
+ },
2089
+ {
2090
+ firstName: 'Nadine',
2091
+ lastName: 'Buchanan',
2092
+ email: 'Duis@Sed.ca',
2093
+ phoneNo: '055 2785 0228',
2094
+ street: '694 Mi, Av.',
2095
+ city: 'Middelburg',
2096
+ postcode: '62232-88887',
2097
+ country: 'Uruguay',
2098
+ personalID: '16721129 5857',
2099
+ },
2100
+ {
2101
+ firstName: 'Dalton',
2102
+ lastName: 'Nieves',
2103
+ email: 'nibh.dolor.nonummy@laoreetlibero.org',
2104
+ phoneNo: '0395 486 9374',
2105
+ street: '797-8170 Enim, Street',
2106
+ city: 'Burhanpur',
2107
+ postcode: '29633-93750',
2108
+ country: 'Cayman Islands',
2109
+ personalID: '16600205 0067',
2110
+ },
2111
+ {
2112
+ firstName: 'Zeph',
2113
+ lastName: 'Ruiz',
2114
+ email: 'non.dui@felisorci.com',
2115
+ phoneNo: '0845 46 41',
2116
+ street: 'Ap #282-8369 Malesuada Ave',
2117
+ city: 'Cavallino',
2118
+ postcode: 'EW2V 1ZE',
2119
+ country: 'Niger',
2120
+ personalID: '16580706 9124',
2121
+ },
2122
+ {
2123
+ firstName: 'Shannon',
2124
+ lastName: 'Decker',
2125
+ email: 'leo@lobortis.co.uk',
2126
+ phoneNo: '0800 135593',
2127
+ street: 'P.O. Box 587, 6871 Eleifend. Ave',
2128
+ city: 'Rocca San Felice',
2129
+ postcode: '42271-38735',
2130
+ country: 'Somalia',
2131
+ personalID: '16090810 4763',
2132
+ },
2133
+ {
2134
+ firstName: 'Erich',
2135
+ lastName: 'Daniels',
2136
+ email: 'cursus.non.egestas@aliquet.org',
2137
+ phoneNo: '0845 46 44',
2138
+ street: '689-4565 Velit. Avenue',
2139
+ city: 'Edmundston',
2140
+ postcode: 'JR32 7QA',
2141
+ country: 'Sao Tome and Principe',
2142
+ personalID: '16720401 5049',
2143
+ },
2144
+ {
2145
+ firstName: 'Rhiannon',
2146
+ lastName: 'Malone',
2147
+ email: 'arcu.Morbi.sit@cursus.edu',
2148
+ phoneNo: '0361 311 4051',
2149
+ street: 'Ap #971-1781 Vehicula Road',
2150
+ city: 'Wood Buffalo',
2151
+ postcode: '71682',
2152
+ country: 'Croatia',
2153
+ personalID: '16931028 3388',
2154
+ },
2155
+ {
2156
+ firstName: 'Elijah',
2157
+ lastName: 'Sosa',
2158
+ email: 'ipsum.Donec.sollicitudin@leo.co.uk',
2159
+ phoneNo: '0800 365 8250',
2160
+ street: 'P.O. Box 169, 2562 Commodo Ave',
2161
+ city: 'Montoggio',
2162
+ postcode: '42092',
2163
+ country: 'San Marino',
2164
+ personalID: '16251107 2403',
2165
+ },
2166
+ {
2167
+ firstName: 'Grady',
2168
+ lastName: 'Crosby',
2169
+ email: 'mollis.nec.cursus@malesuadamalesuadaInteger.edu',
2170
+ phoneNo: '070 2824 3427',
2171
+ street: '821-5145 Id, Ave',
2172
+ city: 'Rosoux-Crenwick',
2173
+ postcode: '56176',
2174
+ country: 'Cuba',
2175
+ personalID: '16520115 9133',
2176
+ },
2177
+ {
2178
+ firstName: 'Quentin',
2179
+ lastName: 'Armstrong',
2180
+ email: 'erat.vel@auctor.net',
2181
+ phoneNo: '(029) 5052 0365',
2182
+ street: '157-253 Hendrerit Av.',
2183
+ city: 'Aubervilliers',
2184
+ postcode: '2151',
2185
+ country: 'Mayotte',
2186
+ personalID: '16730607 0553',
2187
+ },
2188
+ {
2189
+ firstName: 'Samuel',
2190
+ lastName: 'Harrell',
2191
+ email: 'tellus@magnaSed.edu',
2192
+ phoneNo: '07064 102166',
2193
+ street: 'P.O. Box 713, 4115 Ut Rd.',
2194
+ city: 'Kingston',
2195
+ postcode: '23315',
2196
+ country: 'Lebanon',
2197
+ personalID: '16361016 5551',
2198
+ },
2199
+ {
2200
+ firstName: 'Merritt',
2201
+ lastName: 'Holland',
2202
+ email: 'interdum.Nunc.sollicitudin@elitpellentesque.edu',
2203
+ phoneNo: '0800 825458',
2204
+ street: 'P.O. Box 261, 3590 Nascetur Road',
2205
+ city: 'Drancy',
2206
+ postcode: '760017',
2207
+ country: 'French Southern Territories',
2208
+ personalID: '16040311 2121',
2209
+ },
2210
+ {
2211
+ firstName: 'Harlan',
2212
+ lastName: 'Brennan',
2213
+ email: 'nascetur.ridiculus@feugiatmetussit.net',
2214
+ phoneNo: '(012812) 59410',
2215
+ street: '8210 Torquent Av.',
2216
+ city: 'Grantham',
2217
+ postcode: '01537',
2218
+ country: 'Saint Pierre and Miquelon',
2219
+ personalID: '16431216 0239',
2220
+ },
2221
+ {
2222
+ firstName: 'Stuart',
2223
+ lastName: 'Deleon',
2224
+ email: 'sed.pede.nec@maurisMorbinon.com',
2225
+ phoneNo: '0807 013 3815',
2226
+ street: 'P.O. Box 143, 4909 At Street',
2227
+ city: 'Terrance',
2228
+ postcode: '27218',
2229
+ country: 'Jersey',
2230
+ personalID: '16330207 5852',
2231
+ },
2232
+ {
2233
+ firstName: 'Clarke',
2234
+ lastName: 'Middleton',
2235
+ email: 'in@estacfacilisis.org',
2236
+ phoneNo: '(028) 5013 9648',
2237
+ street: '9856 Eget, Avenue',
2238
+ city: 'Solihull',
2239
+ postcode: '72893',
2240
+ country: 'Seychelles',
2241
+ personalID: '16340804 3325',
2242
+ },
2243
+ {
2244
+ firstName: 'Roanna',
2245
+ lastName: 'Gentry',
2246
+ email: 'dui@nascetur.net',
2247
+ phoneNo: '(024) 3023 2962',
2248
+ street: '3566 Ornare. Rd.',
2249
+ city: 'Freiberg',
2250
+ postcode: '3899',
2251
+ country: 'Lesotho',
2252
+ personalID: '16680618 3791',
2253
+ },
2254
+ {
2255
+ firstName: 'Delilah',
2256
+ lastName: 'Bird',
2257
+ email: 'laoreet.lectus.quis@utaliquam.edu',
2258
+ phoneNo: '07160 224163',
2259
+ street: 'P.O. Box 332, 8565 Molestie Avenue',
2260
+ city: 'Washuk',
2261
+ postcode: '607065',
2262
+ country: 'Indonesia',
2263
+ personalID: '16891112 9461',
2264
+ },
2265
+ {
2266
+ firstName: 'Georgia',
2267
+ lastName: 'Cash',
2268
+ email: 'dui@enimnisl.net',
2269
+ phoneNo: '(0113) 542 3955',
2270
+ street: '900-3252 Fusce Avenue',
2271
+ city: 'Sint-Michiels',
2272
+ postcode: 'Z8203',
2273
+ country: 'Niue',
2274
+ personalID: '16340718 4716',
2275
+ },
2276
+ {
2277
+ firstName: 'Aiko',
2278
+ lastName: 'Mclean',
2279
+ email: 'cubilia.Curae.Phasellus@augueid.com',
2280
+ phoneNo: '055 9506 2116',
2281
+ street: 'P.O. Box 786, 1756 Fringilla St.',
2282
+ city: 'Malonne',
2283
+ postcode: 'Y8E 7M2',
2284
+ country: 'Belize',
2285
+ personalID: '16680622 4207',
2286
+ },
2287
+ {
2288
+ firstName: 'Winter',
2289
+ lastName: 'Jacobs',
2290
+ email: 'aliquet@Duisac.ca',
2291
+ phoneNo: '0800 693847',
2292
+ street: '774-9011 Arcu Road',
2293
+ city: 'Bilbo',
2294
+ postcode: '05558',
2295
+ country: 'Equatorial Guinea',
2296
+ personalID: '16611201 4144',
2297
+ },
2298
+ {
2299
+ firstName: 'Jolene',
2300
+ lastName: 'Rios',
2301
+ email: 'odio.Aliquam.vulputate@ac.ca',
2302
+ phoneNo: '(023) 4876 2215',
2303
+ street: 'Ap #325-8225 Amet Road',
2304
+ city: 'Limena',
2305
+ postcode: 'K56 0YJ',
2306
+ country: 'Morocco',
2307
+ personalID: '16170215 3485',
2308
+ },
2309
+ {
2310
+ firstName: 'Kaden',
2311
+ lastName: 'Morrow',
2312
+ email: 'rutrum@eleifendnec.ca',
2313
+ phoneNo: '07305 685548',
2314
+ street: '8870 Aliquam Road',
2315
+ city: 'Sète',
2316
+ postcode: '04908',
2317
+ country: 'Peru',
2318
+ personalID: '16820820 6675',
2319
+ },
2320
+ {
2321
+ firstName: 'Kaseem',
2322
+ lastName: 'Norris',
2323
+ email: 'mauris.erat.eget@nequeMorbi.com',
2324
+ phoneNo: '07275 403152',
2325
+ street: 'P.O. Box 776, 7115 Integer Avenue',
2326
+ city: 'Jönköping',
2327
+ postcode: '42236-83471',
2328
+ country: 'Sudan',
2329
+ personalID: '16440829 7895',
2330
+ },
2331
+ {
2332
+ firstName: 'Vladimir',
2333
+ lastName: 'Mcguire',
2334
+ email: 'id@nonarcuVivamus.edu',
2335
+ phoneNo: '0500 950469',
2336
+ street: '2067 Est Ave',
2337
+ city: 'Ziano di Fiemme',
2338
+ postcode: '774056',
2339
+ country: 'Mexico',
2340
+ personalID: '16771016 3796',
2341
+ },
2342
+ {
2343
+ firstName: 'Jocelyn',
2344
+ lastName: 'Schroeder',
2345
+ email: 'dolor@nec.ca',
2346
+ phoneNo: '07302 403156',
2347
+ street: 'Ap #155-3999 Vivamus St.',
2348
+ city: 'Malloa',
2349
+ postcode: '4059',
2350
+ country: 'Canada',
2351
+ personalID: '16530314 9388',
2352
+ },
2353
+ {
2354
+ firstName: 'Howard',
2355
+ lastName: 'Villarreal',
2356
+ email: 'Donec.felis@insodales.com',
2357
+ phoneNo: '07624 830239',
2358
+ street: '540-7057 Cras Rd.',
2359
+ city: 'Siverek',
2360
+ postcode: '8701',
2361
+ country: 'Seychelles',
2362
+ personalID: '16640823 8530',
2363
+ },
2364
+ {
2365
+ firstName: 'Adam',
2366
+ lastName: 'Miranda',
2367
+ email: 'amet.dapibus@faucibus.edu',
2368
+ phoneNo: '0845 46 49',
2369
+ street: 'Ap #931-6286 Diam. Avenue',
2370
+ city: 'Warburg',
2371
+ postcode: '01972',
2372
+ country: 'Jordan',
2373
+ personalID: '16370414 7911',
2374
+ },
2375
+ {
2376
+ firstName: 'Aiko',
2377
+ lastName: 'Elliott',
2378
+ email: 'sodales@mauris.edu',
2379
+ phoneNo: '0800 1111',
2380
+ street: 'P.O. Box 583, 6119 Ut St.',
2381
+ city: 'Villavicencio',
2382
+ postcode: '4864 XQ',
2383
+ country: 'Faroe Islands',
2384
+ personalID: '16940907 6115',
2385
+ },
2386
+ \].map((person) \=> ({
2387
+ ...person,
2388
+ sales: getSales(Math.random()),
2389
+ profit: getProfit(Math.random()),
2390
+ redOrGreen: getRating(),
2391
+ date: new Date(Math.floor(Math.random() \* \-10000000000)).toDateString(),
2392
+ }));
2393
+ const createClassNameMutationObserver \= (
2394
+ element: HTMLElement,
2395
+ callback: (className: string) \=> void,
2396
+ ): MutationObserver \=> {
2397
+ const observer \= new MutationObserver(() \=> {
2398
+ callback(element.className);
2399
+ });
2400
+ observer.observe(element, {
2401
+ attributes: true,
2402
+ attributeFilter: \['class'\],
2403
+ childList: false,
2404
+ characterData: false,
2405
+ });
2406
+ return observer;
2407
+ };
2408
+ const useClassNameMutationObserver \= (
2409
+ element: HTMLElement,
2410
+ callback: () \=> void,
2411
+ ): void \=> {
2412
+ useEffect(() \=> {
2413
+ const observer \= createClassNameMutationObserver(element, callback);
2414
+ // Cleanup listener
2415
+ return (): void \=> {
2416
+ observer.disconnect();
2417
+ };
2418
+ });
2419
+ };
2420
+ const RedOrGreenFormatter \= (params: ValueFormatterParams) \=> {
2421
+ const dotStyle \= styles\[\`dot--${params.value}\`\];
2422
+ return <span className\={\`${styles.dot} ${dotStyle}\`} />;
2423
+ };
2424
+ const CommaFormatter \= (params: ValueFormatterParams): string \=> {
2425
+ return params.value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');
2426
+ };
2427
+ const CurrencyFormatter \= (params: ValueFormatterParams): string \=> {
2428
+ if (params.value \=== '0.00') {
2429
+ return formatter2dp.format(params.value);
2430
+ }
2431
+ return formatterCurrency.format(params.value);
2432
+ };
2433
+ export const AgGridCompact \= (args: AgGridReactProps) \=> {
2434
+ const \[rowData, setRowData\] \= useState(BIG\_DATA);
2435
+ const api \= useRef<GridApi\>();
2436
+ // pick one row at random to show data updating in the grid
2437
+ useEffect(() \=> {
2438
+ const updateTick \= setInterval(() \=> {
2439
+ const randomNo \= Math.random();
2440
+ const index \= Math.floor(Math.random() \* rowData.length);
2441
+ const itemToUpdate \= rowData\[index\];
2442
+ if (randomNo < 0.5) {
2443
+ itemToUpdate.sales \= getSales(Math.random());
2444
+ } else if (randomNo \> 0.9) {
2445
+ itemToUpdate.profit \= getProfit(0);
2446
+ } else {
2447
+ itemToUpdate.profit \= getProfit(Math.random());
2448
+ }
2449
+ setRowData(rowData);
2450
+ api.current?.refreshCells();
2451
+ }, 500);
2452
+ return () \=> {
2453
+ clearInterval(updateTick);
2454
+ };
2455
+ }, \[rowData\]);
2456
+ const onGridReady \= useCallback((event: GridReadyEvent): void \=> {
2457
+ api.current \= event.api;
2458
+ api.current.resetRowHeights();
2459
+ }, \[\]);
2460
+ useClassNameMutationObserver(document.documentElement, () \=> {
2461
+ if (api.current) {
2462
+ api.current.resetRowHeights();
2463
+ }
2464
+ });
2465
+ return (
2466
+ <IressAgGridContainer
2467
+ alignMiddle
2468
+ compact
2469
+ style\={{ height: '100vh', width: '100%' }}
2470
+ \>
2471
+ <AgGridReact {...args}
2472
+ onGridReady={onGridReady}
2473
+ rowDragManaged animateRows enableRangeSelection={true}
2474
+ enableCharts={true}
2475
+ sideBar={true}
2476
+ rowData={rowData}
2477
+ rowSelection="multiple" rowMultiSelectWithClick components={{
2478
+ redGreenDots: RedOrGreenFormatter,
2479
+ }}
2480
+ defaultColDef={{
2481
+ enableCellChangeFlash: true,
2482
+ resizable: true,
2483
+ sortable: true,
2484
+ unSortIcon: true,
2485
+ filter: true,
2486
+ floatingFilter: true,
2487
+ enablePivot: false,
2488
+ filterParams: {
2489
+ buttons: \['reset', 'apply'\],
2490
+ },
2491
+ autoHeight: true,
2492
+ wrapText: true,
2493
+ }}
2494
+ icons={AG\_THEME\_IRESS\_ICONS}
2495
+ columnDefs={\[
2496
+ {
2497
+ headerName: 'Employee',
2498
+ children: \[
2499
+ {
2500
+ field: 'firstName',
2501
+ editable: true,
2502
+ filter: 'agTextColumnFilter',
2503
+ headerTooltip: 'First name',
2504
+ rowDrag: true,
2505
+ lockVisible: true,
2506
+ tooltipField: 'firstName',
2507
+ },
2508
+ {
2509
+ field: 'lastName',
2510
+ editable: true,
2511
+ filter: 'agTextColumnFilter',
2512
+ headerTooltip: 'Surname',
2513
+ lockVisible: true,
2514
+ cellClass: 'iress-cell--divider',
2515
+ headerClass: 'iress-cell--divider',
2516
+ columnGroupShow: 'open',
2517
+ },
2518
+ {
2519
+ field: 'personalID',
2520
+ filter: 'agTextColumnFilter',
2521
+ headerTooltip: 'Personal ID',
2522
+ columnGroupShow: 'open',
2523
+ },
2524
+ {
2525
+ field: 'date',
2526
+ filter: 'agDateColumnFilter',
2527
+ headerTooltip: 'Date',
2528
+ columnGroupShow: 'open',
2529
+ },
2530
+ \],
2531
+ },
2532
+ {
2533
+ headerName: 'Sales performance',
2534
+ children: \[
2535
+ {
2536
+ field: 'redOrGreen',
2537
+ headerName: 'Rating',
2538
+ cellRenderer: 'redGreenDots',
2539
+ filter: false,
2540
+ },
2541
+ {
2542
+ field: 'sales',
2543
+ filter: 'agNumberColumnFilter',
2544
+ valueFormatter: CommaFormatter,
2545
+ },
2546
+ {
2547
+ field: 'profit',
2548
+ valueFormatter: CurrencyFormatter,
2549
+ cellClassRules: {
2550
+ 'iress--positive': (params) \=> parseInt(params.value, 10) \> 0,
2551
+ 'iress--negative': (params) \=> parseInt(params.value, 10) < 0,
2552
+ 'iress--zero': (params) \=> params.value \=== '0.00',
2553
+ },
2554
+ },
2555
+ \],
2556
+ },
2557
+ {
2558
+ headerName: 'Contact details',
2559
+ children: \[
2560
+ {
2561
+ field: 'email',
2562
+ width: 350,
2563
+ filter: 'agTextColumnFilter',
2564
+ headerTooltip: 'Email address',
2565
+ cellClass: 'iress-cell--ellipsis',
2566
+ },
2567
+ {
2568
+ field: 'phoneNo',
2569
+ enableValue: true,
2570
+ filter: 'agTextColumnFilter',
2571
+ headerTooltip: 'Phone number',
2572
+ },
2573
+ \],
2574
+ },
2575
+ {
2576
+ headerName: 'Address',
2577
+ children: \[
2578
+ {
2579
+ field: 'street',
2580
+ width: 350,
2581
+ filter: 'agTextColumnFilter',
2582
+ cellClass: 'iress-cell--ellipsis',
2583
+ columnGroupShow: 'open',
2584
+ },
2585
+ {
2586
+ field: 'city',
2587
+ filter: 'agTextColumnFilter',
2588
+ columnGroupShow: 'open',
2589
+ },
2590
+ {
2591
+ field: 'postcode',
2592
+ filter: 'agTextColumnFilter',
2593
+ columnGroupShow: 'open',
2594
+ },
2595
+ { field: 'country', filter: 'agTextColumnFilter' },
2596
+ \],
2597
+ },
2598
+ \]}
2599
+ /> </IressAgGridContainer\>
2600
+ );
2601
+ };
2602
+ export default AgGridCompact;
2603
+
2604
+ Copy
1013
2605
 
1014
2606
  [](#utility-classes)Utility classes
1015
2607
  -----------------------------------