@itwin/imodel-components-react 5.4.0 → 5.6.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.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,29 @@
1
1
  # Change Log - @itwin/imodel-components-react
2
2
 
3
- This log was last generated on Thu, 17 Apr 2025 09:55:41 GMT and should not be manually modified.
3
+ ## 5.6.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a4b74f9]
8
+ - @itwin/components-react@5.6.0
9
+ - @itwin/core-react@5.6.0
10
+
11
+ ## 5.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - c619667: Updated peer dependencies to support iTwin.js core v5 packages.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [c619667]
20
+ - Updated dependencies [c619667]
21
+ - Updated dependencies [a69108d]
22
+ - @itwin/components-react@5.5.0
23
+ - @itwin/core-react@5.5.0
4
24
 
5
25
  ## 5.4.0
26
+
6
27
  Thu, 17 Apr 2025 09:55:41 GMT
7
28
 
8
29
  ### Updates
@@ -10,21 +31,25 @@ Thu, 17 Apr 2025 09:55:41 GMT
10
31
  - Added Quantity and Weight property editor specifications for the new editors system.
11
32
 
12
33
  ## 5.3.1
34
+
13
35
  Thu, 20 Mar 2025 11:10:28 GMT
14
36
 
15
37
  _Version update only_
16
38
 
17
39
  ## 5.3.0
40
+
18
41
  Fri, 14 Mar 2025 17:37:48 GMT
19
42
 
20
43
  _Version update only_
21
44
 
22
45
  ## 5.2.0
46
+
23
47
  Thu, 27 Feb 2025 08:07:36 GMT
24
48
 
25
49
  _Version update only_
26
50
 
27
51
  ## 5.1.0
52
+
28
53
  Thu, 30 Jan 2025 09:15:23 GMT
29
54
 
30
55
  ### Updates
@@ -32,21 +57,25 @@ Thu, 30 Jan 2025 09:15:23 GMT
32
57
  - cSpell fixes
33
58
 
34
59
  ## 5.0.5
60
+
35
61
  Tue, 21 Jan 2025 11:38:58 GMT
36
62
 
37
63
  _Version update only_
38
64
 
39
65
  ## 5.0.4
66
+
40
67
  Fri, 17 Jan 2025 14:12:03 GMT
41
68
 
42
69
  _Version update only_
43
70
 
44
71
  ## 5.0.3
72
+
45
73
  Fri, 17 Jan 2025 11:42:02 GMT
46
74
 
47
75
  _Version update only_
48
76
 
49
77
  ## 5.0.2
78
+
50
79
  Thu, 16 Jan 2025 12:04:12 GMT
51
80
 
52
81
  ### Updates
@@ -54,11 +83,13 @@ Thu, 16 Jan 2025 12:04:12 GMT
54
83
  - Use import attributes for json imports.
55
84
 
56
85
  ## 5.0.1
86
+
57
87
  Wed, 15 Jan 2025 11:47:00 GMT
58
88
 
59
89
  _Version update only_
60
90
 
61
91
  ## 5.0.0
92
+
62
93
  Mon, 16 Dec 2024 11:43:27 GMT
63
94
 
64
95
  ### Updates
@@ -75,36 +106,43 @@ Mon, 16 Dec 2024 11:43:27 GMT
75
106
  - Replace buic variables with iTwinUI CSS variables.
76
107
 
77
108
  ## 4.17.6
109
+
78
110
  Wed, 20 Nov 2024 14:27:46 GMT
79
111
 
80
112
  _Version update only_
81
113
 
82
114
  ## 4.17.5
115
+
83
116
  Thu, 14 Nov 2024 08:22:04 GMT
84
117
 
85
118
  _Version update only_
86
119
 
87
120
  ## 4.17.4
121
+
88
122
  Fri, 08 Nov 2024 14:41:23 GMT
89
123
 
90
124
  _Version update only_
91
125
 
92
126
  ## 4.17.3
127
+
93
128
  Wed, 06 Nov 2024 09:04:20 GMT
94
129
 
95
130
  _Version update only_
96
131
 
97
132
  ## 4.17.2
133
+
98
134
  Wed, 30 Oct 2024 14:46:15 GMT
99
135
 
100
136
  _Version update only_
101
137
 
102
138
  ## 4.17.1
139
+
103
140
  Wed, 09 Oct 2024 10:50:47 GMT
104
141
 
105
142
  _Version update only_
106
143
 
107
144
  ## 4.17.0
145
+
108
146
  Thu, 19 Sep 2024 12:50:53 GMT
109
147
 
110
148
  ### Updates
@@ -112,31 +150,37 @@ Thu, 19 Sep 2024 12:50:53 GMT
112
150
  - Deprecated component props in favor of type helper
113
151
 
114
152
  ## 4.16.5
153
+
115
154
  Tue, 10 Sep 2024 16:40:46 GMT
116
155
 
117
156
  _Version update only_
118
157
 
119
158
  ## 4.16.4
159
+
120
160
  Wed, 04 Sep 2024 08:10:19 GMT
121
161
 
122
162
  _Version update only_
123
163
 
124
164
  ## 4.16.3
165
+
125
166
  Tue, 03 Sep 2024 14:32:22 GMT
126
167
 
127
168
  _Version update only_
128
169
 
129
170
  ## 4.16.2
171
+
130
172
  Wed, 28 Aug 2024 06:32:12 GMT
131
173
 
132
174
  _Version update only_
133
175
 
134
176
  ## 4.16.1
177
+
135
178
  Fri, 16 Aug 2024 08:18:14 GMT
136
179
 
137
180
  _Version update only_
138
181
 
139
182
  ## 4.16.0
183
+
140
184
  Wed, 07 Aug 2024 12:38:32 GMT
141
185
 
142
186
  ### Updates
@@ -145,56 +189,67 @@ Wed, 07 Aug 2024 12:38:32 GMT
145
189
  - Added `trackContainerProps` property to `TimelineComponent`.
146
190
 
147
191
  ## 4.15.5
192
+
148
193
  Wed, 24 Jul 2024 16:09:26 GMT
149
194
 
150
195
  _Version update only_
151
196
 
152
197
  ## 4.15.4
198
+
153
199
  Mon, 22 Jul 2024 21:27:52 GMT
154
200
 
155
201
  _Version update only_
156
202
 
157
203
  ## 4.15.3
204
+
158
205
  Mon, 15 Jul 2024 12:12:01 GMT
159
206
 
160
207
  _Version update only_
161
208
 
162
209
  ## 4.15.2
210
+
163
211
  Wed, 10 Jul 2024 11:54:56 GMT
164
212
 
165
213
  _Version update only_
166
214
 
167
215
  ## 4.15.1
216
+
168
217
  Tue, 09 Jul 2024 09:23:12 GMT
169
218
 
170
219
  _Version update only_
171
220
 
172
221
  ## 4.15.0
222
+
173
223
  Fri, 28 Jun 2024 09:09:37 GMT
174
224
 
175
225
  _Version update only_
176
226
 
177
227
  ## 4.14.2
228
+
178
229
  Mon, 22 Jul 2024 21:23:09 GMT
179
230
 
180
231
  _Version update only_
181
232
 
182
233
  ## 4.14.1
234
+
183
235
  Tue, 11 Jun 2024 15:58:29 GMT
184
236
 
185
237
  _Version update only_
186
238
 
187
239
  ## 4.14.0
240
+
188
241
  Thu, 06 Jun 2024 08:24:21 GMT
189
242
 
190
243
  _Version update only_
191
244
 
192
245
  ## 4.13.4
246
+
193
247
  Tue, 21 May 2024 08:21:34 GMT
194
248
 
195
249
  _Version update only_
196
250
 
197
251
  ## 4.13.3
252
+
198
253
  Fri, 17 May 2024 09:43:31 GMT
199
254
 
200
255
  ### Updates
@@ -203,16 +258,19 @@ Fri, 17 May 2024 09:43:31 GMT
203
258
  - upgrade to TypeScript@5.3.3 and @itwin/build-tools@4.6.x
204
259
 
205
260
  ## 4.13.2
261
+
206
262
  Wed, 08 May 2024 08:24:46 GMT
207
263
 
208
264
  _Version update only_
209
265
 
210
266
  ## 4.13.1
267
+
211
268
  Tue, 07 May 2024 15:01:46 GMT
212
269
 
213
270
  _Version update only_
214
271
 
215
272
  ## 4.13.0
273
+
216
274
  Tue, 07 May 2024 08:44:06 GMT
217
275
 
218
276
  ### Updates
@@ -220,11 +278,13 @@ Tue, 07 May 2024 08:44:06 GMT
220
278
  - Deprecated all UI event classes.
221
279
 
222
280
  ## 4.12.0
281
+
223
282
  Fri, 05 Apr 2024 09:55:35 GMT
224
283
 
225
284
  _Version update only_
226
285
 
227
286
  ## 4.11.0
287
+
228
288
  Thu, 21 Mar 2024 16:38:04 GMT
229
289
 
230
290
  ### Updates
@@ -236,6 +296,7 @@ Thu, 21 Mar 2024 16:38:04 GMT
236
296
  - Removed memoization for translated strings in components.
237
297
 
238
298
  ## 4.10.0
299
+
239
300
  Mon, 26 Feb 2024 15:50:45 GMT
240
301
 
241
302
  ### Updates
@@ -244,6 +305,7 @@ Mon, 26 Feb 2024 15:50:45 GMT
244
305
  - Use iTwinUI 3.x.
245
306
 
246
307
  ## 4.9.0
308
+
247
309
  Tue, 06 Feb 2024 08:56:40 GMT
248
310
 
249
311
  ### Updates
@@ -251,26 +313,31 @@ Tue, 06 Feb 2024 08:56:40 GMT
251
313
  - ignore appui-abstract eslint deprecation m
252
314
 
253
315
  ## 4.8.3
316
+
254
317
  Tue, 30 Jan 2024 09:04:27 GMT
255
318
 
256
319
  _Version update only_
257
320
 
258
321
  ## 4.8.2
322
+
259
323
  Wed, 24 Jan 2024 12:37:04 GMT
260
324
 
261
325
  _Version update only_
262
326
 
263
327
  ## 4.8.1
328
+
264
329
  Thu, 11 Jan 2024 13:05:42 GMT
265
330
 
266
331
  _Version update only_
267
332
 
268
333
  ## 4.8.0
334
+
269
335
  Thu, 21 Dec 2023 14:08:43 GMT
270
336
 
271
337
  _Version update only_
272
338
 
273
339
  ## 4.7.2
340
+
274
341
  Wed, 20 Dec 2023 23:11:37 GMT
275
342
 
276
343
  ### Updates
@@ -278,6 +345,7 @@ Wed, 20 Dec 2023 23:11:37 GMT
278
345
  - Revert Viewport creation delay from 0x0.
279
346
 
280
347
  ## 4.7.1
348
+
281
349
  Thu, 07 Dec 2023 19:40:17 GMT
282
350
 
283
351
  ### Updates
@@ -285,6 +353,7 @@ Thu, 07 Dec 2023 19:40:17 GMT
285
353
  - `ViewportComponent` will now wait to have positive space before creating iTwin.js viewport.
286
354
 
287
355
  ## 4.7.0
356
+
288
357
  Fri, 01 Dec 2023 20:01:16 GMT
289
358
 
290
359
  ### Updates
@@ -294,41 +363,49 @@ Fri, 01 Dec 2023 20:01:16 GMT
294
363
  - Remove additional `changeView` call on `ViewportComponent` mount.
295
364
 
296
365
  ## 4.6.3
366
+
297
367
  Wed, 25 Oct 2023 09:39:22 GMT
298
368
 
299
369
  _Version update only_
300
370
 
301
371
  ## 4.6.2
372
+
302
373
  Tue, 17 Oct 2023 19:16:23 GMT
303
374
 
304
375
  _Version update only_
305
376
 
306
377
  ## 4.6.1
378
+
307
379
  Thu, 12 Oct 2023 16:59:20 GMT
308
380
 
309
381
  _Version update only_
310
382
 
311
383
  ## 4.6.0
384
+
312
385
  Wed, 04 Oct 2023 18:05:34 GMT
313
386
 
314
387
  _Version update only_
315
388
 
316
389
  ## 4.5.1
390
+
317
391
  Fri, 08 Sep 2023 16:10:53 GMT
318
392
 
319
393
  _Version update only_
320
394
 
321
395
  ## 4.5.0
396
+
322
397
  Wed, 06 Sep 2023 17:29:22 GMT
323
398
 
324
399
  _Version update only_
325
400
 
326
401
  ## 4.4.0
402
+
327
403
  Tue, 15 Aug 2023 18:02:09 GMT
328
404
 
329
405
  _Version update only_
330
406
 
331
407
  ## 4.3.0
408
+
332
409
  Mon, 17 Jul 2023 10:16:20 GMT
333
410
 
334
411
  ### Updates
@@ -336,6 +413,7 @@ Mon, 17 Jul 2023 10:16:20 GMT
336
413
  - Update sinon to 15.2.0 and @types/sinon to 10.0.15
337
414
 
338
415
  ## 4.2.0
416
+
339
417
  Tue, 27 Jun 2023 14:50:22 GMT
340
418
 
341
419
  ### Updates
@@ -344,6 +422,7 @@ Tue, 27 Jun 2023 14:50:22 GMT
344
422
  - Update `@itwin/itwinui-react` version to 2.11.6.
345
423
 
346
424
  ## 4.1.0
425
+
347
426
  Mon, 29 May 2023 14:05:04 GMT
348
427
 
349
428
  ### Updates
@@ -352,11 +431,13 @@ Mon, 29 May 2023 14:05:04 GMT
352
431
  - Change arrow-click rotation logic to allow rotation to rotated faces.
353
432
 
354
433
  ## 4.0.1
434
+
355
435
  Fri, 19 May 2023 12:24:31 GMT
356
436
 
357
437
  _Version update only_
358
438
 
359
439
  ## 4.0.0
440
+
360
441
  Mon, 01 May 2023 13:32:16 GMT
361
442
 
362
443
  ### Updates
@@ -375,16 +456,19 @@ Mon, 01 May 2023 13:32:16 GMT
375
456
  - Remove webfont icons from components.
376
457
 
377
458
  ## 3.7.2
459
+
378
460
  Wed, 12 Apr 2023 13:12:42 GMT
379
461
 
380
462
  _Version update only_
381
463
 
382
464
  ## 3.7.1
465
+
383
466
  Mon, 03 Apr 2023 15:15:37 GMT
384
467
 
385
468
  _Version update only_
386
469
 
387
470
  ## 3.7.0
471
+
388
472
  Wed, 29 Mar 2023 15:02:27 GMT
389
473
 
390
474
  ### Updates
@@ -395,21 +479,25 @@ Wed, 29 Mar 2023 15:02:27 GMT
395
479
  - Update @deprecated comments
396
480
 
397
481
  ## 3.6.3
482
+
398
483
  Mon, 27 Mar 2023 16:26:47 GMT
399
484
 
400
485
  _Version update only_
401
486
 
402
487
  ## 3.6.2
488
+
403
489
  Fri, 17 Mar 2023 17:52:32 GMT
404
490
 
405
491
  _Version update only_
406
492
 
407
493
  ## 3.6.1
494
+
408
495
  Fri, 24 Feb 2023 22:00:48 GMT
409
496
 
410
497
  _Version update only_
411
498
 
412
499
  ## 3.6.0
500
+
413
501
  Wed, 08 Feb 2023 14:58:40 GMT
414
502
 
415
503
  ### Updates
@@ -417,36 +505,43 @@ Wed, 08 Feb 2023 14:58:40 GMT
417
505
  - Use EmptyLocalization for localization in tests to increase test performance
418
506
 
419
507
  ## 3.5.6
508
+
420
509
  Fri, 24 Feb 2023 16:02:47 GMT
421
510
 
422
511
  _Version update only_
423
512
 
424
513
  ## 3.5.5
514
+
425
515
  Thu, 26 Jan 2023 22:53:27 GMT
426
516
 
427
517
  _Version update only_
428
518
 
429
519
  ## 3.5.4
520
+
430
521
  Wed, 18 Jan 2023 15:27:15 GMT
431
522
 
432
523
  _Version update only_
433
524
 
434
525
  ## 3.5.3
526
+
435
527
  Fri, 13 Jan 2023 17:23:07 GMT
436
528
 
437
529
  _Version update only_
438
530
 
439
531
  ## 3.5.2
532
+
440
533
  Wed, 11 Jan 2023 16:46:30 GMT
441
534
 
442
535
  _Version update only_
443
536
 
444
537
  ## 3.5.1
538
+
445
539
  Thu, 15 Dec 2022 16:38:29 GMT
446
540
 
447
541
  _Version update only_
448
542
 
449
543
  ## 3.5.0
544
+
450
545
  Wed, 07 Dec 2022 19:12:37 GMT
451
546
 
452
547
  ### Updates
@@ -454,41 +549,49 @@ Wed, 07 Dec 2022 19:12:37 GMT
454
549
  - Unpin classnames package
455
550
 
456
551
  ## 3.4.7
552
+
457
553
  Wed, 30 Nov 2022 14:28:19 GMT
458
554
 
459
555
  _Version update only_
460
556
 
461
557
  ## 3.4.6
558
+
462
559
  Tue, 22 Nov 2022 14:24:19 GMT
463
560
 
464
561
  _Version update only_
465
562
 
466
563
  ## 3.4.5
564
+
467
565
  Thu, 17 Nov 2022 21:32:50 GMT
468
566
 
469
567
  _Version update only_
470
568
 
471
569
  ## 3.4.4
570
+
472
571
  Thu, 10 Nov 2022 19:32:17 GMT
473
572
 
474
573
  _Version update only_
475
574
 
476
575
  ## 3.4.3
576
+
477
577
  Fri, 28 Oct 2022 13:34:58 GMT
478
578
 
479
579
  _Version update only_
480
580
 
481
581
  ## 3.4.2
582
+
482
583
  Mon, 24 Oct 2022 13:23:45 GMT
483
584
 
484
585
  _Version update only_
485
586
 
486
587
  ## 3.4.1
588
+
487
589
  Mon, 17 Oct 2022 20:06:51 GMT
488
590
 
489
591
  _Version update only_
490
592
 
491
593
  ## 3.4.0
594
+
492
595
  Thu, 13 Oct 2022 20:24:47 GMT
493
596
 
494
597
  ### Updates
@@ -497,31 +600,37 @@ Thu, 13 Oct 2022 20:24:47 GMT
497
600
  - Fix/Remove skipped tests
498
601
 
499
602
  ## 3.3.5
603
+
500
604
  Tue, 27 Sep 2022 11:50:59 GMT
501
605
 
502
606
  _Version update only_
503
607
 
504
608
  ## 3.3.4
609
+
505
610
  Thu, 08 Sep 2022 19:00:05 GMT
506
611
 
507
612
  _Version update only_
508
613
 
509
614
  ## 3.3.3
615
+
510
616
  Tue, 06 Sep 2022 20:54:19 GMT
511
617
 
512
618
  _Version update only_
513
619
 
514
620
  ## 3.3.2
621
+
515
622
  Thu, 01 Sep 2022 14:37:22 GMT
516
623
 
517
624
  _Version update only_
518
625
 
519
626
  ## 3.3.1
627
+
520
628
  Fri, 26 Aug 2022 15:40:02 GMT
521
629
 
522
630
  _Version update only_
523
631
 
524
632
  ## 3.3.0
633
+
525
634
  Thu, 18 Aug 2022 19:08:02 GMT
526
635
 
527
636
  ### Updates
@@ -533,46 +642,55 @@ Thu, 18 Aug 2022 19:08:02 GMT
533
642
  - Update iTwinUI-react to 1.38.1
534
643
 
535
644
  ## 3.2.9
645
+
536
646
  Fri, 26 Aug 2022 14:21:40 GMT
537
647
 
538
648
  _Version update only_
539
649
 
540
650
  ## 3.2.8
651
+
541
652
  Tue, 09 Aug 2022 15:52:41 GMT
542
653
 
543
654
  _Version update only_
544
655
 
545
656
  ## 3.2.7
657
+
546
658
  Mon, 01 Aug 2022 13:36:56 GMT
547
659
 
548
660
  _Version update only_
549
661
 
550
662
  ## 3.2.6
663
+
551
664
  Fri, 15 Jul 2022 19:04:43 GMT
552
665
 
553
666
  _Version update only_
554
667
 
555
668
  ## 3.2.5
669
+
556
670
  Wed, 13 Jul 2022 15:45:53 GMT
557
671
 
558
672
  _Version update only_
559
673
 
560
674
  ## 3.2.4
675
+
561
676
  Tue, 21 Jun 2022 18:06:33 GMT
562
677
 
563
678
  _Version update only_
564
679
 
565
680
  ## 3.2.3
681
+
566
682
  Fri, 17 Jun 2022 15:18:39 GMT
567
683
 
568
684
  _Version update only_
569
685
 
570
686
  ## 3.2.2
687
+
571
688
  Fri, 10 Jun 2022 16:11:37 GMT
572
689
 
573
690
  _Version update only_
574
691
 
575
692
  ## 3.2.1
693
+
576
694
  Tue, 07 Jun 2022 15:02:56 GMT
577
695
 
578
696
  ### Updates
@@ -580,28 +698,33 @@ Tue, 07 Jun 2022 15:02:56 GMT
580
698
  - Remove fix height from ColorPicker dialog.
581
699
 
582
700
  ## 3.2.0
701
+
583
702
  Fri, 20 May 2022 13:10:54 GMT
584
703
 
585
704
  ### Updates
586
705
 
587
- - Fix for losing viewport content after clicking PW link
706
+ - Fix for losing viewport content after clicking PW link
588
707
 
589
708
  ## 3.1.3
709
+
590
710
  Fri, 15 Apr 2022 13:49:25 GMT
591
711
 
592
712
  _Version update only_
593
713
 
594
714
  ## 3.1.2
715
+
595
716
  Wed, 06 Apr 2022 22:27:56 GMT
596
717
 
597
718
  _Version update only_
598
719
 
599
720
  ## 3.1.1
721
+
600
722
  Thu, 31 Mar 2022 15:55:48 GMT
601
723
 
602
724
  _Version update only_
603
725
 
604
726
  ## 3.1.0
727
+
605
728
  Tue, 29 Mar 2022 20:53:47 GMT
606
729
 
607
730
  ### Updates
@@ -615,16 +738,19 @@ Tue, 29 Mar 2022 20:53:47 GMT
615
738
  - Update to latest itwinui-react.
616
739
 
617
740
  ## 3.0.3
741
+
618
742
  Fri, 25 Mar 2022 15:10:02 GMT
619
743
 
620
744
  _Version update only_
621
745
 
622
746
  ## 3.0.2
747
+
623
748
  Thu, 10 Mar 2022 21:18:13 GMT
624
749
 
625
750
  _Version update only_
626
751
 
627
752
  ## 3.0.1
753
+
628
754
  Thu, 24 Feb 2022 15:26:55 GMT
629
755
 
630
756
  ### Updates
@@ -632,6 +758,7 @@ Thu, 24 Feb 2022 15:26:55 GMT
632
758
  - Avoid processing stale viewStates that reference closed imodels.
633
759
 
634
760
  ## 3.0.0
761
+
635
762
  Mon, 24 Jan 2022 14:00:52 GMT
636
763
 
637
764
  ### Updates
@@ -646,7 +773,7 @@ Mon, 24 Jan 2022 14:00:52 GMT
646
773
  - tool.run and tool.parseAndRun are now async methods
647
774
  - Deprecate obsolete code.
648
775
  - Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
649
- - update immer to fix security warning
776
+ - update immer to fix security warning
650
777
  - Deprecate and promote apis
651
778
  - Deprecate obsolete APIs. Publish beta APIs from last release.
652
779
  - Upgraded itwinui-react to 1.16.2. Fixed editor sizes.
@@ -665,4 +792,3 @@ Mon, 24 Jan 2022 14:00:52 GMT
665
792
  - Update to latest types/react package
666
793
  - Update ViewportComponent to function component that properly processes async method to get viewState.
667
794
  - Lock down and update version numbers so docs will build.
668
-
@@ -60,7 +60,7 @@ export class UiIModelComponents {
60
60
  Logger.logError(UiIModelComponents.loggerCategory("UiIModelComponents"), `translate: IModelApp.localization has not been setup. Returning blank string.`);
61
61
  return "";
62
62
  }
63
- return IModelApp.localization.getLocalizedString(`${UiIModelComponents.localizationNamespace}:${key}`);
63
+ return IModelApp.localization.getLocalizedString(`${UiIModelComponents.localizationNamespace}:${String(key)}`);
64
64
  }
65
65
  /** @internal */
66
66
  static loggerCategory(name) {
@@ -1 +1 @@
1
- {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE,CAAC;YACpC,MAAM,CAAC,OAAO,CACZ,kBAAkB,CAAC,cAAc,CAAC,oBAAoB,CAAC,EACvD,8CAA8C,CAC/C,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,SAAS,CAAC,YAAY,EAAE,iBAAiB,CAC7C,kBAAkB,CAAC,qBAAqB,CACzC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAC5B,oEAAoE;YACpE,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAE,CAAC;YAC7C,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC;YAChC,MAAM,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,MAAM,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACxD,CAAC;QAED,kBAAkB,CAAC,YAAY,GAAG,IAAI,CAAC;IACzC,CAAC;IAED,gEAAgE;IACzD,MAAM,CAAC,SAAS;QACrB,SAAS,CAAC,YAAY,EAAE,mBAAmB,CACzC,kBAAkB,CAAC,qBAAqB,CACzC,CAAC;QACF,YAAY,CAAC,SAAS,EAAE,CAAC;QACzB,kBAAkB,CAAC,YAAY,GAAG,KAAK,CAAC;IAC1C,CAAC;IAED,4DAA4D;IACrD,MAAM,KAAK,WAAW;QAC3B,OAAO,kBAAkB,CAAC,YAAY,CAAC;IACzC,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,CACb,kBAAkB,CAAC,cAAc,CAAC,oBAAoB,CAAC,EACvD,+EAA+E,CAChF,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAC9C,GAAG,kBAAkB,CAAC,qBAAqB,IAAI,GAAG,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,IAAY;QACvC,OAAO,GAAG,kBAAkB,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;IACrD,CAAC;;AAzEc,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { UiComponents } from \"@itwin/components-react\";\nimport { EmptyLocalization } from \"@itwin/core-common\";\n\n/**\n * Manages the localization service for the imodel-components-react package.\n * @public\n */\nexport class UiIModelComponents {\n private static _initialized = false;\n\n /**\n * initialize UiIModelComponents.\n */\n public static async initialize(): Promise<void> {\n if (UiIModelComponents._initialized) {\n Logger.logInfo(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `UiIModelComponents.initialize already called`\n );\n return;\n }\n\n await IModelApp.localization?.registerNamespace(\n UiIModelComponents.localizationNamespace\n );\n\n if (!IModelApp.localization) {\n // it should only get here in unit test where IModelApp is not setup\n const localization = new EmptyLocalization();\n await localization.initialize();\n await UiComponents.initialize(localization);\n } else {\n await UiComponents.initialize(IModelApp.localization);\n }\n\n UiIModelComponents._initialized = true;\n }\n\n /** Unregisters the UiIModelComponents localization namespace */\n public static terminate() {\n IModelApp.localization?.unregisterNamespace(\n UiIModelComponents.localizationNamespace\n );\n UiComponents.terminate();\n UiIModelComponents._initialized = false;\n }\n\n /** Determines if UiIModelComponents has been initialized */\n public static get initialized(): boolean {\n return UiIModelComponents._initialized;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiIModelComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"imodel-components-react\";\n }\n\n /** Calls localization.getLocalizedString with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiIModelComponents.initialized || !IModelApp.localization) {\n Logger.logError(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `translate: IModelApp.localization has not been setup. Returning blank string.`\n );\n return \"\";\n }\n return IModelApp.localization.getLocalizedString(\n `${UiIModelComponents.localizationNamespace}:${key}`\n );\n }\n\n /** @internal */\n public static loggerCategory(name: string): string {\n return `${UiIModelComponents.packageName}.${name}`;\n }\n}\n"]}
1
+ {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GA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IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,CACb,kBAAkB,CAAC,cAAc,CAAC,oBAAoB,CAAC,EACvD,+EAA+E,CAChF,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAC9C,GAAG,kBAAkB,CAAC,qBAAqB,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,IAAY;QACvC,OAAO,GAAG,kBAAkB,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;IACrD,CAAC;;AAzEc,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { UiComponents } from \"@itwin/components-react\";\nimport { EmptyLocalization } from \"@itwin/core-common\";\n\n/**\n * Manages the localization service for the imodel-components-react package.\n * @public\n */\nexport class UiIModelComponents {\n private static _initialized = false;\n\n /**\n * initialize UiIModelComponents.\n */\n public static async initialize(): Promise<void> {\n if (UiIModelComponents._initialized) {\n Logger.logInfo(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `UiIModelComponents.initialize already called`\n );\n return;\n }\n\n await IModelApp.localization?.registerNamespace(\n UiIModelComponents.localizationNamespace\n );\n\n if (!IModelApp.localization) {\n // it should only get here in unit test where IModelApp is not setup\n const localization = new EmptyLocalization();\n await localization.initialize();\n await UiComponents.initialize(localization);\n } else {\n await UiComponents.initialize(IModelApp.localization);\n }\n\n UiIModelComponents._initialized = true;\n }\n\n /** Unregisters the UiIModelComponents localization namespace */\n public static terminate() {\n IModelApp.localization?.unregisterNamespace(\n UiIModelComponents.localizationNamespace\n );\n UiComponents.terminate();\n UiIModelComponents._initialized = false;\n }\n\n /** Determines if UiIModelComponents has been initialized */\n public static get initialized(): boolean {\n return UiIModelComponents._initialized;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiIModelComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"imodel-components-react\";\n }\n\n /** Calls localization.getLocalizedString with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiIModelComponents.initialized || !IModelApp.localization) {\n Logger.logError(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `translate: IModelApp.localization has not been setup. Returning blank string.`\n );\n return \"\";\n }\n return IModelApp.localization.getLocalizedString(\n `${UiIModelComponents.localizationNamespace}:${String(key)}`\n );\n }\n\n /** @internal */\n public static loggerCategory(name: string): string {\n return `${UiIModelComponents.packageName}.${name}`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormatType.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAkExD;;;GAGG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED;;GAEG;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAwD5D"}
1
+ {"version":3,"file":"FormatType.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAkExD;;;GAGG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED;;GAEG;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA0D5D"}
@@ -46,6 +46,7 @@ export function FormatTypeOption(props) {
46
46
  const { formatProps, onChange } = props;
47
47
  const { translate } = useTranslation();
48
48
  const handleFormatTypeChange = React.useCallback((newType) => {
49
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
49
50
  const type = formatTypeToString(newType);
50
51
  let precision;
51
52
  let stationOffsetSize;
@@ -54,6 +55,7 @@ export function FormatTypeOption(props) {
54
55
  ) {
55
56
  case FormatType.Scientific:
56
57
  precision = DecimalPrecision.Six;
58
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
57
59
  scientificType = scientificTypeToString(ScientificType.Normalized);
58
60
  break;
59
61
  case FormatType.Decimal:
@@ -1 +1 @@
1
- {"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO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AU,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IACpC,SAAS,CAAC,4BAA4B,CAAC,CACnC;QACP,oBAAC,kBAAkB,mBACL,sBAAsB,EAClC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,sBAAsB,GAChC,CACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DecimalPrecision,\n FormatType,\n formatTypeToString,\n FractionalPrecision,\n parseFormatType,\n ScientificType,\n scientificTypeToString,\n} from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n/** Properties of [[FormatTypeSelector]] component.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface FormatTypeSelectorProps extends CommonProps {\n type: FormatType;\n onChange: (value: FormatType) => void;\n}\n\n/** Component to select the format type.\n * @alpha\n */\nfunction FormatTypeSelector(props: FormatTypeSelectorProps) {\n const { type, onChange, ...otherProps } = props;\n const { translate } = useTranslation();\n const formatOptions = React.useRef<SelectOption<FormatType>[]>([\n {\n value: FormatType.Decimal,\n label: translate(\"QuantityFormat.decimal\"),\n },\n {\n value: FormatType.Scientific,\n label: translate(\"QuantityFormat.scientific\"),\n },\n {\n value: FormatType.Station,\n label: translate(\"QuantityFormat.station\"),\n },\n {\n value: FormatType.Fractional,\n label: translate(\"QuantityFormat.fractional\"),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: FormatType) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={formatOptions.current}\n value={type}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n\n/** Properties of [[FormatTypeOption]] component.\n * @alpha\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof FormatTypeOption>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface FormatTypeOptionProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n}\n\n/** Component to set the Quantity Format type.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function FormatTypeOption(props: FormatTypeOptionProps) {\n const { formatProps, onChange } = props;\n const { translate } = useTranslation();\n const handleFormatTypeChange = React.useCallback(\n (newType: FormatType) => {\n const type = formatTypeToString(newType);\n let precision: number | undefined;\n let stationOffsetSize: number | undefined;\n let scientificType: string | undefined;\n switch (\n newType // type must be decimal, fractional, scientific, or station\n ) {\n case FormatType.Scientific:\n precision = DecimalPrecision.Six;\n scientificType = scientificTypeToString(ScientificType.Normalized);\n break;\n case FormatType.Decimal:\n precision = DecimalPrecision.Four;\n break;\n case FormatType.Station:\n precision = DecimalPrecision.Two;\n stationOffsetSize = formatProps.composite?.units[0].name\n .toLocaleLowerCase()\n .endsWith(\"m\")\n ? 3\n : 2;\n break;\n case FormatType.Fractional:\n precision = FractionalPrecision.Eight;\n break;\n }\n const newFormatProps = {\n ...formatProps,\n type,\n precision,\n scientificType,\n stationOffsetSize,\n };\n onChange && onChange(newFormatProps);\n },\n [formatProps, onChange]\n );\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n return (\n <>\n <span className={\"uicore-label.current\"}>\n {translate(\"QuantityFormat.labels.type\")}\n </span>\n <FormatTypeSelector\n data-testid=\"format-type-selector\"\n type={formatType}\n onChange={handleFormatTypeChange}\n />\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../src/imod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,cAAc;YACd,iBAAiB;SAClB,CAAC;QACF,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,CAAC,CACxB,CAAC;IAEF,MAAM,UAAU,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IACpC,SAAS,CAAC,4BAA4B,CAAC,CACnC;QACP,oBAAC,kBAAkB,mBACL,sBAAsB,EAClC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,sBAAsB,GAChC,CACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DecimalPrecision,\n FormatType,\n formatTypeToString,\n FractionalPrecision,\n parseFormatType,\n ScientificType,\n scientificTypeToString,\n} from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n/** Properties of [[FormatTypeSelector]] component.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface FormatTypeSelectorProps extends CommonProps {\n type: FormatType;\n onChange: (value: FormatType) => void;\n}\n\n/** Component to select the format type.\n * @alpha\n */\nfunction FormatTypeSelector(props: FormatTypeSelectorProps) {\n const { type, onChange, ...otherProps } = props;\n const { translate } = useTranslation();\n const formatOptions = React.useRef<SelectOption<FormatType>[]>([\n {\n value: FormatType.Decimal,\n label: translate(\"QuantityFormat.decimal\"),\n },\n {\n value: FormatType.Scientific,\n label: translate(\"QuantityFormat.scientific\"),\n },\n {\n value: FormatType.Station,\n label: translate(\"QuantityFormat.station\"),\n },\n {\n value: FormatType.Fractional,\n label: translate(\"QuantityFormat.fractional\"),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: FormatType) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={formatOptions.current}\n value={type}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n\n/** Properties of [[FormatTypeOption]] component.\n * @alpha\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof FormatTypeOption>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface FormatTypeOptionProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n}\n\n/** Component to set the Quantity Format type.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function FormatTypeOption(props: FormatTypeOptionProps) {\n const { formatProps, onChange } = props;\n const { translate } = useTranslation();\n const handleFormatTypeChange = React.useCallback(\n (newType: FormatType) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const type = formatTypeToString(newType);\n let precision: number | undefined;\n let stationOffsetSize: number | undefined;\n let scientificType: string | undefined;\n switch (\n newType // type must be decimal, fractional, scientific, or station\n ) {\n case FormatType.Scientific:\n precision = DecimalPrecision.Six;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scientificType = scientificTypeToString(ScientificType.Normalized);\n break;\n case FormatType.Decimal:\n precision = DecimalPrecision.Four;\n break;\n case FormatType.Station:\n precision = DecimalPrecision.Two;\n stationOffsetSize = formatProps.composite?.units[0].name\n .toLocaleLowerCase()\n .endsWith(\"m\")\n ? 3\n : 2;\n break;\n case FormatType.Fractional:\n precision = FractionalPrecision.Eight;\n break;\n }\n const newFormatProps = {\n ...formatProps,\n type,\n precision,\n scientificType,\n stationOffsetSize,\n };\n onChange && onChange(newFormatProps);\n },\n [formatProps, onChange]\n );\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n return (\n <>\n <span className={\"uicore-label.current\"}>\n {translate(\"QuantityFormat.labels.type\")}\n </span>\n <FormatTypeSelector\n data-testid=\"format-type-selector\"\n type={formatType}\n onChange={handleFormatTypeChange}\n />\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MiscFormatOptions.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/MiscFormatOptions.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAqBxE;;;GAGG;AAEH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AAEH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAmW9D"}
1
+ {"version":3,"file":"MiscFormatOptions.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/MiscFormatOptions.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAqBxE;;;GAGG;AAEH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AAEH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAqW9D"}
@@ -31,6 +31,7 @@ export function MiscFormatOptions(props) {
31
31
  return Format.isFormatTraitSetInProps(formatProps, trait);
32
32
  }, [formatProps]);
33
33
  const handleShowSignChange = React.useCallback((option) => {
34
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
34
35
  const newShowSignOption = showSignOptionToString(option);
35
36
  const newFormatProps = {
36
37
  ...formatProps,
@@ -102,6 +103,7 @@ export function MiscFormatOptions(props) {
102
103
  const handleScientificTypeChange = React.useCallback((type) => {
103
104
  const newFormatProps = {
104
105
  ...formatProps,
106
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
105
107
  scientificType: scientificTypeToString(type),
106
108
  };
107
109
  handleSetFormatProps(newFormatProps);
@@ -1 +1 @@
1
- {"version":3,"file":"MiscFormatOptions.js","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/MiscFormatOptions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,sBAAs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,CAAC,UAAU,GAC9C;YAEF,8BACE,SAAS,EAAE,UAAU,CACnB,cAAc,EACd,UAAU,KAAK,UAAU,CAAC,UAAU,IAAI,iBAAiB,CAC1D,IAEA,SAAS,CAAC,2CAA2C,CAAC,CAClD;YACP,oBAAC,sBAAsB,mBACT,0BAA0B,EACtC,IAAI,EACF,WAAW,CAAC,cAAc;oBAC1B,WAAW,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;oBACnC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC;oBAC3D,CAAC,CAAC,cAAc,CAAC,UAAU,EAE/B,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC,UAAU,EAC9C,QAAQ,EAAE,0BAA0B,GACpC;YAED,KAAK,CAAC,QAAQ;YAEd,uBAAuB,IAAI,WAAW,IAAI,CACzC,2BACE,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,qCAAqC,EAChD,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,IAEV,SAAS,CAAC,iCAAiC,CAAC,CAC3C,CACL,CACA,CACJ,CACA,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport type { FormatProps, ShowSignOption } from \"@itwin/core-quantity\";\nimport {\n Format,\n FormatTraits,\n FormatType,\n getTraitString,\n parseFormatType,\n parseScientificType,\n parseShowSignOption,\n ScientificType,\n scientificTypeToString,\n showSignOptionToString,\n} from \"@itwin/core-quantity\";\nimport { SignOptionSelector } from \"./misc/SignOption.js\";\nimport { ThousandsSeparator } from \"./misc/ThousandsSeparator.js\";\nimport { DecimalSeparatorSelector } from \"./misc/DecimalSeparator.js\";\nimport { ScientificTypeSelector } from \"./misc/ScientificType.js\";\nimport { StationSeparatorSelector } from \"./misc/StationSeparatorSelector.js\";\nimport { StationSizeSelector } from \"./misc/StationSizeSelector.js\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n/** Properties of [[MiscFormatOptions]] component.\n * @alpha\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof MiscFormatOptions>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface MiscFormatOptionsProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n enableMinimumProperties?: boolean;\n showOptions: boolean;\n onShowHideOptions: (show: boolean) => void;\n children?: React.ReactNode;\n}\n\n/** Component use to set miscellaneous properties is a Formatted Quantity.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function MiscFormatOptions(props: MiscFormatOptionsProps) {\n const {\n formatProps,\n onChange,\n showOptions,\n onShowHideOptions,\n enableMinimumProperties,\n } = props;\n const { translate } = useTranslation();\n\n const handleSetFormatProps = React.useCallback(\n (newFormatProps: FormatProps) => {\n onChange && onChange(newFormatProps);\n },\n [onChange]\n );\n\n const isFormatTraitSet = React.useCallback(\n (trait: FormatTraits) => {\n return Format.isFormatTraitSetInProps(formatProps, trait);\n },\n [formatProps]\n );\n\n const handleShowSignChange = React.useCallback(\n (option: ShowSignOption) => {\n const newShowSignOption = showSignOptionToString(option);\n const newFormatProps = {\n ...formatProps,\n showSignOption: newShowSignOption,\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const setFormatTrait = React.useCallback(\n (trait: FormatTraits, setActive: boolean) => {\n const traitStr = getTraitString(trait);\n let formatTraits: string[] = [traitStr];\n if (setActive) {\n // setting trait\n if (formatProps.formatTraits) {\n const traits = Array.isArray(formatProps.formatTraits)\n ? formatProps.formatTraits\n : formatProps.formatTraits.split(/,|;|\\|/);\n if (!traits.find((traitEntry) => traitStr === traitEntry)) {\n formatTraits = [...traits, traitStr];\n }\n }\n } else {\n // clearing trait\n if (!formatProps.formatTraits) return;\n const traits = Array.isArray(formatProps.formatTraits)\n ? formatProps.formatTraits\n : formatProps.formatTraits.split(/,|;|\\|/);\n formatTraits = traits.filter((traitEntry) => traitEntry !== traitStr);\n }\n const newFormatProps = { ...formatProps, formatTraits };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleShowTrailingZeroesChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.TrailZeroes, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleKeepDecimalPointChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.KeepDecimalPoint, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleKeepSingleZeroChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.KeepSingleZero, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleZeroEmptyChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.ZeroEmpty, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleUseFractionDashChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.FractionDash, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleDecimalSeparatorChange = React.useCallback(\n (decimalSeparator: string) => {\n let thousandSeparator = formatProps.thousandSeparator;\n // make sure 1000 and decimal separator do not match\n if (isFormatTraitSet(FormatTraits.Use1000Separator)) {\n switch (decimalSeparator) {\n case \".\":\n thousandSeparator = \",\";\n break;\n case \",\":\n thousandSeparator = \".\";\n break;\n }\n }\n const newFormatProps = {\n ...formatProps,\n thousandSeparator,\n decimalSeparator,\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, isFormatTraitSet, handleSetFormatProps]\n );\n\n const handleScientificTypeChange = React.useCallback(\n (type: ScientificType) => {\n const newFormatProps = {\n ...formatProps,\n scientificType: scientificTypeToString(type),\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleFormatChange = React.useCallback(\n (newFormatProps: FormatProps) => {\n handleSetFormatProps(newFormatProps);\n },\n [handleSetFormatProps]\n );\n\n const formatType = React.useMemo(\n () => parseFormatType(formatProps.type, \"format\"),\n [formatProps.type]\n );\n const showSignOption = React.useMemo(\n () =>\n parseShowSignOption(\n formatProps.showSignOption ?? \"onlyNegative\",\n \"format\"\n ),\n [formatProps.showSignOption]\n );\n\n const handleToggleButtonClick = React.useCallback(() => {\n onShowHideOptions(!showOptions);\n }, [onShowHideOptions, showOptions]);\n\n const handleKeyUpOnLink = React.useCallback(\n (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === Key.Enter.valueOf() || e.key === \" \") {\n onShowHideOptions(!showOptions);\n e.preventDefault();\n }\n },\n [onShowHideOptions, showOptions]\n );\n\n const handleStationSeparatorChange = React.useCallback(\n (value: string) => {\n const newFormatProps = { ...formatProps, stationSeparator: value };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleStationOffsetChange = React.useCallback(\n (value: number) => {\n const newFormatProps = { ...formatProps, stationOffsetSize: value };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n return (\n <>\n {enableMinimumProperties && !showOptions && (\n <a // eslint-disable-line jsx-a11y/anchor-is-valid\n onClick={handleToggleButtonClick}\n onKeyUp={handleKeyUpOnLink}\n className={\"components-quantityFormat-more-less\"}\n role=\"link\"\n tabIndex={0}\n >\n {translate(\"QuantityFormat.labels.moreLabel\")}\n </a>\n )}\n {(!enableMinimumProperties || showOptions) && (\n <>\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.signOptionLabel\")}\n </span>\n <SignOptionSelector\n data-testid=\"sign-option-selector\"\n signOption={showSignOption}\n onChange={handleShowSignChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Station && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.stationOffsetLabel\")}\n </span>\n <StationSizeSelector\n data-testid=\"station-size-selector\"\n value={formatProps.stationOffsetSize ?? 2}\n disabled={formatType !== FormatType.Station}\n onChange={handleStationOffsetChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Station && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.stationSeparatorLabel\")}\n </span>\n <StationSeparatorSelector\n data-testid=\"station-separator-selector\"\n separator={\n undefined !== formatProps.stationSeparator\n ? formatProps.stationSeparator\n : \"+\"\n }\n disabled={formatType !== FormatType.Station}\n onChange={handleStationSeparatorChange}\n />\n\n <ThousandsSeparator\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType === FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.decimalSeparatorLabel\")}\n </span>\n <DecimalSeparatorSelector\n data-testid=\"decimal-separator-selector\"\n separator={formatProps.decimalSeparator ?? \".\"}\n onChange={handleDecimalSeparatorChange}\n disabled={formatType === FormatType.Fractional}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.showTrailZerosLabel\")}\n </span>\n <Checkbox\n data-testid=\"show-trail-zeros\"\n checked={isFormatTraitSet(FormatTraits.TrailZeroes)}\n onChange={handleShowTrailingZeroesChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType === FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.keepDecimalPointLabel\")}\n </span>\n <Checkbox\n data-testid=\"keep-decimal-point\"\n checked={isFormatTraitSet(FormatTraits.KeepDecimalPoint)}\n onChange={handleKeepDecimalPointChange}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.keepSingleZeroLabel\")}\n </span>\n <Checkbox\n data-testid=\"keep-single-zero\"\n checked={isFormatTraitSet(FormatTraits.KeepSingleZero)}\n onChange={handleKeepSingleZeroChange}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.zeroEmptyLabel\")}\n </span>\n <Checkbox\n data-testid=\"zero-empty\"\n checked={isFormatTraitSet(FormatTraits.ZeroEmpty)}\n onChange={handleZeroEmptyChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.fractionDashLabel\")}\n </span>\n <Checkbox\n data-testid=\"fraction-dash\"\n checked={isFormatTraitSet(FormatTraits.FractionDash)}\n onChange={handleUseFractionDashChange}\n disabled={formatType !== FormatType.Fractional}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Scientific && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.scientificTypeLabel\")}\n </span>\n <ScientificTypeSelector\n data-testid=\"scientific-type-selector\"\n type={\n formatProps.scientificType &&\n formatProps.scientificType.length > 0\n ? parseScientificType(formatProps.scientificType, \"custom\")\n : ScientificType.Normalized\n }\n disabled={formatType !== FormatType.Scientific}\n onChange={handleScientificTypeChange}\n />\n\n {props.children}\n\n {enableMinimumProperties && showOptions && (\n <a // eslint-disable-line jsx-a11y/anchor-is-valid\n onClick={handleToggleButtonClick}\n onKeyUp={handleKeyUpOnLink}\n className={\"components-quantityFormat-more-less\"}\n role=\"link\"\n tabIndex={0}\n >\n {translate(\"QuantityFormat.labels.lessLabel\")}\n </a>\n )}\n </>\n )}\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"MiscFormatOptions.js","sourceRoot":"","sources":["../../../src/imodel-components-react/quantityformat/MiscFormatOptions.tsx"],"names":[],"mappings":"AAAA;;;gGA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BAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,EACjD,QAAQ,EAAE,qBAAqB,GAC/B;YAEF,8BACE,SAAS,EAAE,UAAU,CACnB,cAAc,EACd,UAAU,KAAK,UAAU,CAAC,UAAU,IAAI,iBAAiB,CAC1D,IAEA,SAAS,CAAC,yCAAyC,CAAC,CAChD;YACP,oBAAC,QAAQ,mBACK,eAAe,EAC3B,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,YAAY,CAAC,EACpD,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC,UAAU,GAC9C;YAEF,8BACE,SAAS,EAAE,UAAU,CACnB,cAAc,EACd,UAAU,KAAK,UAAU,CAAC,UAAU,IAAI,iBAAiB,CAC1D,IAEA,SAAS,CAAC,2CAA2C,CAAC,CAClD;YACP,oBAAC,sBAAsB,mBACT,0BAA0B,EACtC,IAAI,EACF,WAAW,CAAC,cAAc;oBAC1B,WAAW,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;oBACnC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC;oBAC3D,CAAC,CAAC,cAAc,CAAC,UAAU,EAE/B,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC,UAAU,EAC9C,QAAQ,EAAE,0BAA0B,GACpC;YAED,KAAK,CAAC,QAAQ;YAEd,uBAAuB,IAAI,WAAW,IAAI,CACzC,2BACE,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,qCAAqC,EAChD,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,IAEV,SAAS,CAAC,iCAAiC,CAAC,CAC3C,CACL,CACA,CACJ,CACA,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport type { FormatProps, ShowSignOption } from \"@itwin/core-quantity\";\nimport {\n Format,\n FormatTraits,\n FormatType,\n getTraitString,\n parseFormatType,\n parseScientificType,\n parseShowSignOption,\n ScientificType,\n scientificTypeToString,\n showSignOptionToString,\n} from \"@itwin/core-quantity\";\nimport { SignOptionSelector } from \"./misc/SignOption.js\";\nimport { ThousandsSeparator } from \"./misc/ThousandsSeparator.js\";\nimport { DecimalSeparatorSelector } from \"./misc/DecimalSeparator.js\";\nimport { ScientificTypeSelector } from \"./misc/ScientificType.js\";\nimport { StationSeparatorSelector } from \"./misc/StationSeparatorSelector.js\";\nimport { StationSizeSelector } from \"./misc/StationSizeSelector.js\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n/** Properties of [[MiscFormatOptions]] component.\n * @alpha\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof MiscFormatOptions>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface MiscFormatOptionsProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n enableMinimumProperties?: boolean;\n showOptions: boolean;\n onShowHideOptions: (show: boolean) => void;\n children?: React.ReactNode;\n}\n\n/** Component use to set miscellaneous properties is a Formatted Quantity.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function MiscFormatOptions(props: MiscFormatOptionsProps) {\n const {\n formatProps,\n onChange,\n showOptions,\n onShowHideOptions,\n enableMinimumProperties,\n } = props;\n const { translate } = useTranslation();\n\n const handleSetFormatProps = React.useCallback(\n (newFormatProps: FormatProps) => {\n onChange && onChange(newFormatProps);\n },\n [onChange]\n );\n\n const isFormatTraitSet = React.useCallback(\n (trait: FormatTraits) => {\n return Format.isFormatTraitSetInProps(formatProps, trait);\n },\n [formatProps]\n );\n\n const handleShowSignChange = React.useCallback(\n (option: ShowSignOption) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const newShowSignOption = showSignOptionToString(option);\n const newFormatProps = {\n ...formatProps,\n showSignOption: newShowSignOption,\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const setFormatTrait = React.useCallback(\n (trait: FormatTraits, setActive: boolean) => {\n const traitStr = getTraitString(trait);\n let formatTraits: string[] = [traitStr];\n if (setActive) {\n // setting trait\n if (formatProps.formatTraits) {\n const traits = Array.isArray(formatProps.formatTraits)\n ? formatProps.formatTraits\n : formatProps.formatTraits.split(/,|;|\\|/);\n if (!traits.find((traitEntry) => traitStr === traitEntry)) {\n formatTraits = [...traits, traitStr];\n }\n }\n } else {\n // clearing trait\n if (!formatProps.formatTraits) return;\n const traits = Array.isArray(formatProps.formatTraits)\n ? formatProps.formatTraits\n : formatProps.formatTraits.split(/,|;|\\|/);\n formatTraits = traits.filter((traitEntry) => traitEntry !== traitStr);\n }\n const newFormatProps = { ...formatProps, formatTraits };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleShowTrailingZeroesChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.TrailZeroes, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleKeepDecimalPointChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.KeepDecimalPoint, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleKeepSingleZeroChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.KeepSingleZero, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleZeroEmptyChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.ZeroEmpty, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleUseFractionDashChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setFormatTrait(FormatTraits.FractionDash, e.target.checked);\n },\n [setFormatTrait]\n );\n\n const handleDecimalSeparatorChange = React.useCallback(\n (decimalSeparator: string) => {\n let thousandSeparator = formatProps.thousandSeparator;\n // make sure 1000 and decimal separator do not match\n if (isFormatTraitSet(FormatTraits.Use1000Separator)) {\n switch (decimalSeparator) {\n case \".\":\n thousandSeparator = \",\";\n break;\n case \",\":\n thousandSeparator = \".\";\n break;\n }\n }\n const newFormatProps = {\n ...formatProps,\n thousandSeparator,\n decimalSeparator,\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, isFormatTraitSet, handleSetFormatProps]\n );\n\n const handleScientificTypeChange = React.useCallback(\n (type: ScientificType) => {\n const newFormatProps = {\n ...formatProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scientificType: scientificTypeToString(type),\n };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleFormatChange = React.useCallback(\n (newFormatProps: FormatProps) => {\n handleSetFormatProps(newFormatProps);\n },\n [handleSetFormatProps]\n );\n\n const formatType = React.useMemo(\n () => parseFormatType(formatProps.type, \"format\"),\n [formatProps.type]\n );\n const showSignOption = React.useMemo(\n () =>\n parseShowSignOption(\n formatProps.showSignOption ?? \"onlyNegative\",\n \"format\"\n ),\n [formatProps.showSignOption]\n );\n\n const handleToggleButtonClick = React.useCallback(() => {\n onShowHideOptions(!showOptions);\n }, [onShowHideOptions, showOptions]);\n\n const handleKeyUpOnLink = React.useCallback(\n (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === Key.Enter.valueOf() || e.key === \" \") {\n onShowHideOptions(!showOptions);\n e.preventDefault();\n }\n },\n [onShowHideOptions, showOptions]\n );\n\n const handleStationSeparatorChange = React.useCallback(\n (value: string) => {\n const newFormatProps = { ...formatProps, stationSeparator: value };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n const handleStationOffsetChange = React.useCallback(\n (value: number) => {\n const newFormatProps = { ...formatProps, stationOffsetSize: value };\n handleSetFormatProps(newFormatProps);\n },\n [formatProps, handleSetFormatProps]\n );\n\n return (\n <>\n {enableMinimumProperties && !showOptions && (\n <a // eslint-disable-line jsx-a11y/anchor-is-valid\n onClick={handleToggleButtonClick}\n onKeyUp={handleKeyUpOnLink}\n className={\"components-quantityFormat-more-less\"}\n role=\"link\"\n tabIndex={0}\n >\n {translate(\"QuantityFormat.labels.moreLabel\")}\n </a>\n )}\n {(!enableMinimumProperties || showOptions) && (\n <>\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.signOptionLabel\")}\n </span>\n <SignOptionSelector\n data-testid=\"sign-option-selector\"\n signOption={showSignOption}\n onChange={handleShowSignChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Station && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.stationOffsetLabel\")}\n </span>\n <StationSizeSelector\n data-testid=\"station-size-selector\"\n value={formatProps.stationOffsetSize ?? 2}\n disabled={formatType !== FormatType.Station}\n onChange={handleStationOffsetChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Station && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.stationSeparatorLabel\")}\n </span>\n <StationSeparatorSelector\n data-testid=\"station-separator-selector\"\n separator={\n undefined !== formatProps.stationSeparator\n ? formatProps.stationSeparator\n : \"+\"\n }\n disabled={formatType !== FormatType.Station}\n onChange={handleStationSeparatorChange}\n />\n\n <ThousandsSeparator\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType === FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.decimalSeparatorLabel\")}\n </span>\n <DecimalSeparatorSelector\n data-testid=\"decimal-separator-selector\"\n separator={formatProps.decimalSeparator ?? \".\"}\n onChange={handleDecimalSeparatorChange}\n disabled={formatType === FormatType.Fractional}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.showTrailZerosLabel\")}\n </span>\n <Checkbox\n data-testid=\"show-trail-zeros\"\n checked={isFormatTraitSet(FormatTraits.TrailZeroes)}\n onChange={handleShowTrailingZeroesChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType === FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.keepDecimalPointLabel\")}\n </span>\n <Checkbox\n data-testid=\"keep-decimal-point\"\n checked={isFormatTraitSet(FormatTraits.KeepDecimalPoint)}\n onChange={handleKeepDecimalPointChange}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.keepSingleZeroLabel\")}\n </span>\n <Checkbox\n data-testid=\"keep-single-zero\"\n checked={isFormatTraitSet(FormatTraits.KeepSingleZero)}\n onChange={handleKeepSingleZeroChange}\n />\n\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.zeroEmptyLabel\")}\n </span>\n <Checkbox\n data-testid=\"zero-empty\"\n checked={isFormatTraitSet(FormatTraits.ZeroEmpty)}\n onChange={handleZeroEmptyChange}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Fractional && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.fractionDashLabel\")}\n </span>\n <Checkbox\n data-testid=\"fraction-dash\"\n checked={isFormatTraitSet(FormatTraits.FractionDash)}\n onChange={handleUseFractionDashChange}\n disabled={formatType !== FormatType.Fractional}\n />\n\n <span\n className={classnames(\n \"uicore-label\",\n formatType !== FormatType.Scientific && \"uicore-disabled\"\n )}\n >\n {translate(\"QuantityFormat.labels.scientificTypeLabel\")}\n </span>\n <ScientificTypeSelector\n data-testid=\"scientific-type-selector\"\n type={\n formatProps.scientificType &&\n formatProps.scientificType.length > 0\n ? parseScientificType(formatProps.scientificType, \"custom\")\n : ScientificType.Normalized\n }\n disabled={formatType !== FormatType.Scientific}\n onChange={handleScientificTypeChange}\n />\n\n {props.children}\n\n {enableMinimumProperties && showOptions && (\n <a // eslint-disable-line jsx-a11y/anchor-is-valid\n onClick={handleToggleButtonClick}\n onKeyUp={handleKeyUpOnLink}\n className={\"components-quantityFormat-more-less\"}\n role=\"link\"\n tabIndex={0}\n >\n {translate(\"QuantityFormat.labels.lessLabel\")}\n </a>\n )}\n </>\n )}\n </>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/imodel-components-react",
3
- "version": "5.4.0",
3
+ "version": "5.6.0",
4
4
  "description": "A react component library of iTwin.js UI iModel components",
5
5
  "type": "module",
6
6
  "types": "./lib/imodel-components-react.d.ts",
@@ -35,30 +35,30 @@
35
35
  "url": "http://www.bentley.com"
36
36
  },
37
37
  "peerDependencies": {
38
- "@itwin/appui-abstract": "^4.0.0",
39
- "@itwin/components-react": "^5.4.0",
40
- "@itwin/core-bentley": "^4.0.0",
41
- "@itwin/core-common": "^4.0.0",
42
- "@itwin/core-frontend": "^4.0.0",
43
- "@itwin/core-geometry": "^4.0.0",
44
- "@itwin/core-quantity": "^4.0.0",
45
- "@itwin/core-react": "^5.4.0",
38
+ "@itwin/appui-abstract": "^4.0.0 || ^5.0.0",
39
+ "@itwin/core-bentley": "^4.0.0 || ^5.0.0",
40
+ "@itwin/core-common": "^4.0.0 || ^5.0.0",
41
+ "@itwin/core-frontend": "^4.0.0 || ^5.0.0",
42
+ "@itwin/core-geometry": "^4.0.0 || ^5.0.0",
43
+ "@itwin/core-quantity": "^4.0.0 || ^5.0.0",
46
44
  "@itwin/itwinui-react": "^3.15.0",
47
45
  "react": "^18.0.0",
48
- "react-dom": "^18.0.0"
46
+ "react-dom": "^18.0.0",
47
+ "@itwin/components-react": "5.6.0",
48
+ "@itwin/core-react": "5.6.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@itwin/appui-abstract": "^4.0.0",
51
+ "@itwin/appui-abstract": "rc",
52
52
  "@itwin/build-tools": "4.10.2",
53
- "@itwin/core-bentley": "^4.0.0",
54
- "@itwin/core-common": "^4.0.0",
55
- "@itwin/core-frontend": "^4.0.0",
56
- "@itwin/core-geometry": "^4.0.0",
57
- "@itwin/core-orbitgt": "^4.0.0",
58
- "@itwin/core-quantity": "^4.0.0",
59
- "@itwin/eslint-plugin": "5.0.0-dev.2",
53
+ "@itwin/core-bentley": "rc",
54
+ "@itwin/core-common": "rc",
55
+ "@itwin/core-frontend": "rc",
56
+ "@itwin/core-geometry": "rc",
57
+ "@itwin/core-orbitgt": "rc",
58
+ "@itwin/core-quantity": "rc",
59
+ "@itwin/eslint-plugin": "5.1.0",
60
60
  "@itwin/itwinui-react": "^3.17.0",
61
- "@itwin/webgl-compatibility": "^4.0.0",
61
+ "@itwin/webgl-compatibility": "rc",
62
62
  "@testing-library/dom": "^10.1.0",
63
63
  "@testing-library/react": "^15.0.7",
64
64
  "@testing-library/user-event": "^14.5.2",
@@ -67,6 +67,7 @@
67
67
  "@types/react-dom": "^18.3.1",
68
68
  "@vitest/coverage-v8": "^3.0.6",
69
69
  "cpx2": "^3.0.0",
70
+ "cross-env": "^5.1.4",
70
71
  "eslint": "^8.57.1",
71
72
  "eslint-config-prettier": "~8.8.0",
72
73
  "ignore-styles": "^5.0.1",
@@ -83,8 +84,8 @@
83
84
  "typescript": "~5.6.2",
84
85
  "upath": "^2.0.1",
85
86
  "vitest": "^3.0.6",
86
- "@itwin/components-react": "5.4.0",
87
- "@itwin/core-react": "5.4.0"
87
+ "@itwin/core-react": "5.6.0",
88
+ "@itwin/components-react": "5.6.0"
88
89
  },
89
90
  "dependencies": {
90
91
  "@itwin/itwinui-icons-react": "^2.8.0",
@@ -99,14 +100,14 @@
99
100
  "compat:css": "npm run compat:cjs && npm run compat:esm",
100
101
  "compat:cjs": "cpx \"./src/**/*.{*css,svg}\" ./lib/cjs",
101
102
  "compat:esm": "cpx \"./src/**/*.{*css,svg}\" ./lib/esm",
102
- "clean": "rimraf -g lib .rush/temp/package-deps*.json",
103
+ "clean": "rimraf -g lib",
103
104
  "cover": "vitest run --coverage",
104
- "lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
105
+ "lint": "eslint \"./src/**/*.{ts,tsx}\"",
105
106
  "lint:fix": "npm run -s lint -- --fix",
106
- "extract-api": "betools extract-api --entry=./lib/imodel-components-react",
107
+ "extract-api": "betools extract-api --entry=./lib/imodel-components-react --apiReportFolder=../../common/api --apiReportTempFolder=../../common/temp/api --apiSummaryFolder=../../common/api/summary",
107
108
  "test": "vitest",
108
109
  "docs": "npm run -s docs:reference && npm run -s docs:changelog",
109
110
  "docs:changelog": "cpx ./CHANGELOG.md ../../generated-docs/reference/imodel-components-react",
110
- "docs:reference": "betools docs --includes=../../generated-docs/extract --json=../../generated-docs/reference/imodel-components-react/file.json --tsIndexFile=./imodel-components-react.ts --onlyJson"
111
+ "docs:reference": "cross-env NODE_PROJECT_ROOT_DIRECTORY=../../ betools docs --includes=../../generated-docs/extract --json=../../generated-docs/reference/imodel-components-react/file.json --tsIndexFile=./imodel-components-react.ts --onlyJson"
111
112
  }
112
113
  }