@itwin/imodel-components-react 5.4.0 → 5.5.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 +122 -4
- package/lib/imodel-components-react/UiIModelComponents.js +1 -1
- package/lib/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatType.js +2 -0
- package/lib/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js +2 -0
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/package.json +26 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
# Change Log - @itwin/imodel-components-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 5.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c619667: Updated peer dependencies to support iTwin.js core v5 packages.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [c619667]
|
|
12
|
+
- Updated dependencies [c619667]
|
|
13
|
+
- Updated dependencies [a69108d]
|
|
14
|
+
- @itwin/components-react@5.5.0
|
|
15
|
+
- @itwin/core-react@5.5.0
|
|
4
16
|
|
|
5
17
|
## 5.4.0
|
|
18
|
+
|
|
6
19
|
Thu, 17 Apr 2025 09:55:41 GMT
|
|
7
20
|
|
|
8
21
|
### Updates
|
|
@@ -10,21 +23,25 @@ Thu, 17 Apr 2025 09:55:41 GMT
|
|
|
10
23
|
- Added Quantity and Weight property editor specifications for the new editors system.
|
|
11
24
|
|
|
12
25
|
## 5.3.1
|
|
26
|
+
|
|
13
27
|
Thu, 20 Mar 2025 11:10:28 GMT
|
|
14
28
|
|
|
15
29
|
_Version update only_
|
|
16
30
|
|
|
17
31
|
## 5.3.0
|
|
32
|
+
|
|
18
33
|
Fri, 14 Mar 2025 17:37:48 GMT
|
|
19
34
|
|
|
20
35
|
_Version update only_
|
|
21
36
|
|
|
22
37
|
## 5.2.0
|
|
38
|
+
|
|
23
39
|
Thu, 27 Feb 2025 08:07:36 GMT
|
|
24
40
|
|
|
25
41
|
_Version update only_
|
|
26
42
|
|
|
27
43
|
## 5.1.0
|
|
44
|
+
|
|
28
45
|
Thu, 30 Jan 2025 09:15:23 GMT
|
|
29
46
|
|
|
30
47
|
### Updates
|
|
@@ -32,21 +49,25 @@ Thu, 30 Jan 2025 09:15:23 GMT
|
|
|
32
49
|
- cSpell fixes
|
|
33
50
|
|
|
34
51
|
## 5.0.5
|
|
52
|
+
|
|
35
53
|
Tue, 21 Jan 2025 11:38:58 GMT
|
|
36
54
|
|
|
37
55
|
_Version update only_
|
|
38
56
|
|
|
39
57
|
## 5.0.4
|
|
58
|
+
|
|
40
59
|
Fri, 17 Jan 2025 14:12:03 GMT
|
|
41
60
|
|
|
42
61
|
_Version update only_
|
|
43
62
|
|
|
44
63
|
## 5.0.3
|
|
64
|
+
|
|
45
65
|
Fri, 17 Jan 2025 11:42:02 GMT
|
|
46
66
|
|
|
47
67
|
_Version update only_
|
|
48
68
|
|
|
49
69
|
## 5.0.2
|
|
70
|
+
|
|
50
71
|
Thu, 16 Jan 2025 12:04:12 GMT
|
|
51
72
|
|
|
52
73
|
### Updates
|
|
@@ -54,11 +75,13 @@ Thu, 16 Jan 2025 12:04:12 GMT
|
|
|
54
75
|
- Use import attributes for json imports.
|
|
55
76
|
|
|
56
77
|
## 5.0.1
|
|
78
|
+
|
|
57
79
|
Wed, 15 Jan 2025 11:47:00 GMT
|
|
58
80
|
|
|
59
81
|
_Version update only_
|
|
60
82
|
|
|
61
83
|
## 5.0.0
|
|
84
|
+
|
|
62
85
|
Mon, 16 Dec 2024 11:43:27 GMT
|
|
63
86
|
|
|
64
87
|
### Updates
|
|
@@ -75,36 +98,43 @@ Mon, 16 Dec 2024 11:43:27 GMT
|
|
|
75
98
|
- Replace buic variables with iTwinUI CSS variables.
|
|
76
99
|
|
|
77
100
|
## 4.17.6
|
|
101
|
+
|
|
78
102
|
Wed, 20 Nov 2024 14:27:46 GMT
|
|
79
103
|
|
|
80
104
|
_Version update only_
|
|
81
105
|
|
|
82
106
|
## 4.17.5
|
|
107
|
+
|
|
83
108
|
Thu, 14 Nov 2024 08:22:04 GMT
|
|
84
109
|
|
|
85
110
|
_Version update only_
|
|
86
111
|
|
|
87
112
|
## 4.17.4
|
|
113
|
+
|
|
88
114
|
Fri, 08 Nov 2024 14:41:23 GMT
|
|
89
115
|
|
|
90
116
|
_Version update only_
|
|
91
117
|
|
|
92
118
|
## 4.17.3
|
|
119
|
+
|
|
93
120
|
Wed, 06 Nov 2024 09:04:20 GMT
|
|
94
121
|
|
|
95
122
|
_Version update only_
|
|
96
123
|
|
|
97
124
|
## 4.17.2
|
|
125
|
+
|
|
98
126
|
Wed, 30 Oct 2024 14:46:15 GMT
|
|
99
127
|
|
|
100
128
|
_Version update only_
|
|
101
129
|
|
|
102
130
|
## 4.17.1
|
|
131
|
+
|
|
103
132
|
Wed, 09 Oct 2024 10:50:47 GMT
|
|
104
133
|
|
|
105
134
|
_Version update only_
|
|
106
135
|
|
|
107
136
|
## 4.17.0
|
|
137
|
+
|
|
108
138
|
Thu, 19 Sep 2024 12:50:53 GMT
|
|
109
139
|
|
|
110
140
|
### Updates
|
|
@@ -112,31 +142,37 @@ Thu, 19 Sep 2024 12:50:53 GMT
|
|
|
112
142
|
- Deprecated component props in favor of type helper
|
|
113
143
|
|
|
114
144
|
## 4.16.5
|
|
145
|
+
|
|
115
146
|
Tue, 10 Sep 2024 16:40:46 GMT
|
|
116
147
|
|
|
117
148
|
_Version update only_
|
|
118
149
|
|
|
119
150
|
## 4.16.4
|
|
151
|
+
|
|
120
152
|
Wed, 04 Sep 2024 08:10:19 GMT
|
|
121
153
|
|
|
122
154
|
_Version update only_
|
|
123
155
|
|
|
124
156
|
## 4.16.3
|
|
157
|
+
|
|
125
158
|
Tue, 03 Sep 2024 14:32:22 GMT
|
|
126
159
|
|
|
127
160
|
_Version update only_
|
|
128
161
|
|
|
129
162
|
## 4.16.2
|
|
163
|
+
|
|
130
164
|
Wed, 28 Aug 2024 06:32:12 GMT
|
|
131
165
|
|
|
132
166
|
_Version update only_
|
|
133
167
|
|
|
134
168
|
## 4.16.1
|
|
169
|
+
|
|
135
170
|
Fri, 16 Aug 2024 08:18:14 GMT
|
|
136
171
|
|
|
137
172
|
_Version update only_
|
|
138
173
|
|
|
139
174
|
## 4.16.0
|
|
175
|
+
|
|
140
176
|
Wed, 07 Aug 2024 12:38:32 GMT
|
|
141
177
|
|
|
142
178
|
### Updates
|
|
@@ -145,56 +181,67 @@ Wed, 07 Aug 2024 12:38:32 GMT
|
|
|
145
181
|
- Added `trackContainerProps` property to `TimelineComponent`.
|
|
146
182
|
|
|
147
183
|
## 4.15.5
|
|
184
|
+
|
|
148
185
|
Wed, 24 Jul 2024 16:09:26 GMT
|
|
149
186
|
|
|
150
187
|
_Version update only_
|
|
151
188
|
|
|
152
189
|
## 4.15.4
|
|
190
|
+
|
|
153
191
|
Mon, 22 Jul 2024 21:27:52 GMT
|
|
154
192
|
|
|
155
193
|
_Version update only_
|
|
156
194
|
|
|
157
195
|
## 4.15.3
|
|
196
|
+
|
|
158
197
|
Mon, 15 Jul 2024 12:12:01 GMT
|
|
159
198
|
|
|
160
199
|
_Version update only_
|
|
161
200
|
|
|
162
201
|
## 4.15.2
|
|
202
|
+
|
|
163
203
|
Wed, 10 Jul 2024 11:54:56 GMT
|
|
164
204
|
|
|
165
205
|
_Version update only_
|
|
166
206
|
|
|
167
207
|
## 4.15.1
|
|
208
|
+
|
|
168
209
|
Tue, 09 Jul 2024 09:23:12 GMT
|
|
169
210
|
|
|
170
211
|
_Version update only_
|
|
171
212
|
|
|
172
213
|
## 4.15.0
|
|
214
|
+
|
|
173
215
|
Fri, 28 Jun 2024 09:09:37 GMT
|
|
174
216
|
|
|
175
217
|
_Version update only_
|
|
176
218
|
|
|
177
219
|
## 4.14.2
|
|
220
|
+
|
|
178
221
|
Mon, 22 Jul 2024 21:23:09 GMT
|
|
179
222
|
|
|
180
223
|
_Version update only_
|
|
181
224
|
|
|
182
225
|
## 4.14.1
|
|
226
|
+
|
|
183
227
|
Tue, 11 Jun 2024 15:58:29 GMT
|
|
184
228
|
|
|
185
229
|
_Version update only_
|
|
186
230
|
|
|
187
231
|
## 4.14.0
|
|
232
|
+
|
|
188
233
|
Thu, 06 Jun 2024 08:24:21 GMT
|
|
189
234
|
|
|
190
235
|
_Version update only_
|
|
191
236
|
|
|
192
237
|
## 4.13.4
|
|
238
|
+
|
|
193
239
|
Tue, 21 May 2024 08:21:34 GMT
|
|
194
240
|
|
|
195
241
|
_Version update only_
|
|
196
242
|
|
|
197
243
|
## 4.13.3
|
|
244
|
+
|
|
198
245
|
Fri, 17 May 2024 09:43:31 GMT
|
|
199
246
|
|
|
200
247
|
### Updates
|
|
@@ -203,16 +250,19 @@ Fri, 17 May 2024 09:43:31 GMT
|
|
|
203
250
|
- upgrade to TypeScript@5.3.3 and @itwin/build-tools@4.6.x
|
|
204
251
|
|
|
205
252
|
## 4.13.2
|
|
253
|
+
|
|
206
254
|
Wed, 08 May 2024 08:24:46 GMT
|
|
207
255
|
|
|
208
256
|
_Version update only_
|
|
209
257
|
|
|
210
258
|
## 4.13.1
|
|
259
|
+
|
|
211
260
|
Tue, 07 May 2024 15:01:46 GMT
|
|
212
261
|
|
|
213
262
|
_Version update only_
|
|
214
263
|
|
|
215
264
|
## 4.13.0
|
|
265
|
+
|
|
216
266
|
Tue, 07 May 2024 08:44:06 GMT
|
|
217
267
|
|
|
218
268
|
### Updates
|
|
@@ -220,11 +270,13 @@ Tue, 07 May 2024 08:44:06 GMT
|
|
|
220
270
|
- Deprecated all UI event classes.
|
|
221
271
|
|
|
222
272
|
## 4.12.0
|
|
273
|
+
|
|
223
274
|
Fri, 05 Apr 2024 09:55:35 GMT
|
|
224
275
|
|
|
225
276
|
_Version update only_
|
|
226
277
|
|
|
227
278
|
## 4.11.0
|
|
279
|
+
|
|
228
280
|
Thu, 21 Mar 2024 16:38:04 GMT
|
|
229
281
|
|
|
230
282
|
### Updates
|
|
@@ -236,6 +288,7 @@ Thu, 21 Mar 2024 16:38:04 GMT
|
|
|
236
288
|
- Removed memoization for translated strings in components.
|
|
237
289
|
|
|
238
290
|
## 4.10.0
|
|
291
|
+
|
|
239
292
|
Mon, 26 Feb 2024 15:50:45 GMT
|
|
240
293
|
|
|
241
294
|
### Updates
|
|
@@ -244,6 +297,7 @@ Mon, 26 Feb 2024 15:50:45 GMT
|
|
|
244
297
|
- Use iTwinUI 3.x.
|
|
245
298
|
|
|
246
299
|
## 4.9.0
|
|
300
|
+
|
|
247
301
|
Tue, 06 Feb 2024 08:56:40 GMT
|
|
248
302
|
|
|
249
303
|
### Updates
|
|
@@ -251,26 +305,31 @@ Tue, 06 Feb 2024 08:56:40 GMT
|
|
|
251
305
|
- ignore appui-abstract eslint deprecation m
|
|
252
306
|
|
|
253
307
|
## 4.8.3
|
|
308
|
+
|
|
254
309
|
Tue, 30 Jan 2024 09:04:27 GMT
|
|
255
310
|
|
|
256
311
|
_Version update only_
|
|
257
312
|
|
|
258
313
|
## 4.8.2
|
|
314
|
+
|
|
259
315
|
Wed, 24 Jan 2024 12:37:04 GMT
|
|
260
316
|
|
|
261
317
|
_Version update only_
|
|
262
318
|
|
|
263
319
|
## 4.8.1
|
|
320
|
+
|
|
264
321
|
Thu, 11 Jan 2024 13:05:42 GMT
|
|
265
322
|
|
|
266
323
|
_Version update only_
|
|
267
324
|
|
|
268
325
|
## 4.8.0
|
|
326
|
+
|
|
269
327
|
Thu, 21 Dec 2023 14:08:43 GMT
|
|
270
328
|
|
|
271
329
|
_Version update only_
|
|
272
330
|
|
|
273
331
|
## 4.7.2
|
|
332
|
+
|
|
274
333
|
Wed, 20 Dec 2023 23:11:37 GMT
|
|
275
334
|
|
|
276
335
|
### Updates
|
|
@@ -278,6 +337,7 @@ Wed, 20 Dec 2023 23:11:37 GMT
|
|
|
278
337
|
- Revert Viewport creation delay from 0x0.
|
|
279
338
|
|
|
280
339
|
## 4.7.1
|
|
340
|
+
|
|
281
341
|
Thu, 07 Dec 2023 19:40:17 GMT
|
|
282
342
|
|
|
283
343
|
### Updates
|
|
@@ -285,6 +345,7 @@ Thu, 07 Dec 2023 19:40:17 GMT
|
|
|
285
345
|
- `ViewportComponent` will now wait to have positive space before creating iTwin.js viewport.
|
|
286
346
|
|
|
287
347
|
## 4.7.0
|
|
348
|
+
|
|
288
349
|
Fri, 01 Dec 2023 20:01:16 GMT
|
|
289
350
|
|
|
290
351
|
### Updates
|
|
@@ -294,41 +355,49 @@ Fri, 01 Dec 2023 20:01:16 GMT
|
|
|
294
355
|
- Remove additional `changeView` call on `ViewportComponent` mount.
|
|
295
356
|
|
|
296
357
|
## 4.6.3
|
|
358
|
+
|
|
297
359
|
Wed, 25 Oct 2023 09:39:22 GMT
|
|
298
360
|
|
|
299
361
|
_Version update only_
|
|
300
362
|
|
|
301
363
|
## 4.6.2
|
|
364
|
+
|
|
302
365
|
Tue, 17 Oct 2023 19:16:23 GMT
|
|
303
366
|
|
|
304
367
|
_Version update only_
|
|
305
368
|
|
|
306
369
|
## 4.6.1
|
|
370
|
+
|
|
307
371
|
Thu, 12 Oct 2023 16:59:20 GMT
|
|
308
372
|
|
|
309
373
|
_Version update only_
|
|
310
374
|
|
|
311
375
|
## 4.6.0
|
|
376
|
+
|
|
312
377
|
Wed, 04 Oct 2023 18:05:34 GMT
|
|
313
378
|
|
|
314
379
|
_Version update only_
|
|
315
380
|
|
|
316
381
|
## 4.5.1
|
|
382
|
+
|
|
317
383
|
Fri, 08 Sep 2023 16:10:53 GMT
|
|
318
384
|
|
|
319
385
|
_Version update only_
|
|
320
386
|
|
|
321
387
|
## 4.5.0
|
|
388
|
+
|
|
322
389
|
Wed, 06 Sep 2023 17:29:22 GMT
|
|
323
390
|
|
|
324
391
|
_Version update only_
|
|
325
392
|
|
|
326
393
|
## 4.4.0
|
|
394
|
+
|
|
327
395
|
Tue, 15 Aug 2023 18:02:09 GMT
|
|
328
396
|
|
|
329
397
|
_Version update only_
|
|
330
398
|
|
|
331
399
|
## 4.3.0
|
|
400
|
+
|
|
332
401
|
Mon, 17 Jul 2023 10:16:20 GMT
|
|
333
402
|
|
|
334
403
|
### Updates
|
|
@@ -336,6 +405,7 @@ Mon, 17 Jul 2023 10:16:20 GMT
|
|
|
336
405
|
- Update sinon to 15.2.0 and @types/sinon to 10.0.15
|
|
337
406
|
|
|
338
407
|
## 4.2.0
|
|
408
|
+
|
|
339
409
|
Tue, 27 Jun 2023 14:50:22 GMT
|
|
340
410
|
|
|
341
411
|
### Updates
|
|
@@ -344,6 +414,7 @@ Tue, 27 Jun 2023 14:50:22 GMT
|
|
|
344
414
|
- Update `@itwin/itwinui-react` version to 2.11.6.
|
|
345
415
|
|
|
346
416
|
## 4.1.0
|
|
417
|
+
|
|
347
418
|
Mon, 29 May 2023 14:05:04 GMT
|
|
348
419
|
|
|
349
420
|
### Updates
|
|
@@ -352,11 +423,13 @@ Mon, 29 May 2023 14:05:04 GMT
|
|
|
352
423
|
- Change arrow-click rotation logic to allow rotation to rotated faces.
|
|
353
424
|
|
|
354
425
|
## 4.0.1
|
|
426
|
+
|
|
355
427
|
Fri, 19 May 2023 12:24:31 GMT
|
|
356
428
|
|
|
357
429
|
_Version update only_
|
|
358
430
|
|
|
359
431
|
## 4.0.0
|
|
432
|
+
|
|
360
433
|
Mon, 01 May 2023 13:32:16 GMT
|
|
361
434
|
|
|
362
435
|
### Updates
|
|
@@ -375,16 +448,19 @@ Mon, 01 May 2023 13:32:16 GMT
|
|
|
375
448
|
- Remove webfont icons from components.
|
|
376
449
|
|
|
377
450
|
## 3.7.2
|
|
451
|
+
|
|
378
452
|
Wed, 12 Apr 2023 13:12:42 GMT
|
|
379
453
|
|
|
380
454
|
_Version update only_
|
|
381
455
|
|
|
382
456
|
## 3.7.1
|
|
457
|
+
|
|
383
458
|
Mon, 03 Apr 2023 15:15:37 GMT
|
|
384
459
|
|
|
385
460
|
_Version update only_
|
|
386
461
|
|
|
387
462
|
## 3.7.0
|
|
463
|
+
|
|
388
464
|
Wed, 29 Mar 2023 15:02:27 GMT
|
|
389
465
|
|
|
390
466
|
### Updates
|
|
@@ -395,21 +471,25 @@ Wed, 29 Mar 2023 15:02:27 GMT
|
|
|
395
471
|
- Update @deprecated comments
|
|
396
472
|
|
|
397
473
|
## 3.6.3
|
|
474
|
+
|
|
398
475
|
Mon, 27 Mar 2023 16:26:47 GMT
|
|
399
476
|
|
|
400
477
|
_Version update only_
|
|
401
478
|
|
|
402
479
|
## 3.6.2
|
|
480
|
+
|
|
403
481
|
Fri, 17 Mar 2023 17:52:32 GMT
|
|
404
482
|
|
|
405
483
|
_Version update only_
|
|
406
484
|
|
|
407
485
|
## 3.6.1
|
|
486
|
+
|
|
408
487
|
Fri, 24 Feb 2023 22:00:48 GMT
|
|
409
488
|
|
|
410
489
|
_Version update only_
|
|
411
490
|
|
|
412
491
|
## 3.6.0
|
|
492
|
+
|
|
413
493
|
Wed, 08 Feb 2023 14:58:40 GMT
|
|
414
494
|
|
|
415
495
|
### Updates
|
|
@@ -417,36 +497,43 @@ Wed, 08 Feb 2023 14:58:40 GMT
|
|
|
417
497
|
- Use EmptyLocalization for localization in tests to increase test performance
|
|
418
498
|
|
|
419
499
|
## 3.5.6
|
|
500
|
+
|
|
420
501
|
Fri, 24 Feb 2023 16:02:47 GMT
|
|
421
502
|
|
|
422
503
|
_Version update only_
|
|
423
504
|
|
|
424
505
|
## 3.5.5
|
|
506
|
+
|
|
425
507
|
Thu, 26 Jan 2023 22:53:27 GMT
|
|
426
508
|
|
|
427
509
|
_Version update only_
|
|
428
510
|
|
|
429
511
|
## 3.5.4
|
|
512
|
+
|
|
430
513
|
Wed, 18 Jan 2023 15:27:15 GMT
|
|
431
514
|
|
|
432
515
|
_Version update only_
|
|
433
516
|
|
|
434
517
|
## 3.5.3
|
|
518
|
+
|
|
435
519
|
Fri, 13 Jan 2023 17:23:07 GMT
|
|
436
520
|
|
|
437
521
|
_Version update only_
|
|
438
522
|
|
|
439
523
|
## 3.5.2
|
|
524
|
+
|
|
440
525
|
Wed, 11 Jan 2023 16:46:30 GMT
|
|
441
526
|
|
|
442
527
|
_Version update only_
|
|
443
528
|
|
|
444
529
|
## 3.5.1
|
|
530
|
+
|
|
445
531
|
Thu, 15 Dec 2022 16:38:29 GMT
|
|
446
532
|
|
|
447
533
|
_Version update only_
|
|
448
534
|
|
|
449
535
|
## 3.5.0
|
|
536
|
+
|
|
450
537
|
Wed, 07 Dec 2022 19:12:37 GMT
|
|
451
538
|
|
|
452
539
|
### Updates
|
|
@@ -454,41 +541,49 @@ Wed, 07 Dec 2022 19:12:37 GMT
|
|
|
454
541
|
- Unpin classnames package
|
|
455
542
|
|
|
456
543
|
## 3.4.7
|
|
544
|
+
|
|
457
545
|
Wed, 30 Nov 2022 14:28:19 GMT
|
|
458
546
|
|
|
459
547
|
_Version update only_
|
|
460
548
|
|
|
461
549
|
## 3.4.6
|
|
550
|
+
|
|
462
551
|
Tue, 22 Nov 2022 14:24:19 GMT
|
|
463
552
|
|
|
464
553
|
_Version update only_
|
|
465
554
|
|
|
466
555
|
## 3.4.5
|
|
556
|
+
|
|
467
557
|
Thu, 17 Nov 2022 21:32:50 GMT
|
|
468
558
|
|
|
469
559
|
_Version update only_
|
|
470
560
|
|
|
471
561
|
## 3.4.4
|
|
562
|
+
|
|
472
563
|
Thu, 10 Nov 2022 19:32:17 GMT
|
|
473
564
|
|
|
474
565
|
_Version update only_
|
|
475
566
|
|
|
476
567
|
## 3.4.3
|
|
568
|
+
|
|
477
569
|
Fri, 28 Oct 2022 13:34:58 GMT
|
|
478
570
|
|
|
479
571
|
_Version update only_
|
|
480
572
|
|
|
481
573
|
## 3.4.2
|
|
574
|
+
|
|
482
575
|
Mon, 24 Oct 2022 13:23:45 GMT
|
|
483
576
|
|
|
484
577
|
_Version update only_
|
|
485
578
|
|
|
486
579
|
## 3.4.1
|
|
580
|
+
|
|
487
581
|
Mon, 17 Oct 2022 20:06:51 GMT
|
|
488
582
|
|
|
489
583
|
_Version update only_
|
|
490
584
|
|
|
491
585
|
## 3.4.0
|
|
586
|
+
|
|
492
587
|
Thu, 13 Oct 2022 20:24:47 GMT
|
|
493
588
|
|
|
494
589
|
### Updates
|
|
@@ -497,31 +592,37 @@ Thu, 13 Oct 2022 20:24:47 GMT
|
|
|
497
592
|
- Fix/Remove skipped tests
|
|
498
593
|
|
|
499
594
|
## 3.3.5
|
|
595
|
+
|
|
500
596
|
Tue, 27 Sep 2022 11:50:59 GMT
|
|
501
597
|
|
|
502
598
|
_Version update only_
|
|
503
599
|
|
|
504
600
|
## 3.3.4
|
|
601
|
+
|
|
505
602
|
Thu, 08 Sep 2022 19:00:05 GMT
|
|
506
603
|
|
|
507
604
|
_Version update only_
|
|
508
605
|
|
|
509
606
|
## 3.3.3
|
|
607
|
+
|
|
510
608
|
Tue, 06 Sep 2022 20:54:19 GMT
|
|
511
609
|
|
|
512
610
|
_Version update only_
|
|
513
611
|
|
|
514
612
|
## 3.3.2
|
|
613
|
+
|
|
515
614
|
Thu, 01 Sep 2022 14:37:22 GMT
|
|
516
615
|
|
|
517
616
|
_Version update only_
|
|
518
617
|
|
|
519
618
|
## 3.3.1
|
|
619
|
+
|
|
520
620
|
Fri, 26 Aug 2022 15:40:02 GMT
|
|
521
621
|
|
|
522
622
|
_Version update only_
|
|
523
623
|
|
|
524
624
|
## 3.3.0
|
|
625
|
+
|
|
525
626
|
Thu, 18 Aug 2022 19:08:02 GMT
|
|
526
627
|
|
|
527
628
|
### Updates
|
|
@@ -533,46 +634,55 @@ Thu, 18 Aug 2022 19:08:02 GMT
|
|
|
533
634
|
- Update iTwinUI-react to 1.38.1
|
|
534
635
|
|
|
535
636
|
## 3.2.9
|
|
637
|
+
|
|
536
638
|
Fri, 26 Aug 2022 14:21:40 GMT
|
|
537
639
|
|
|
538
640
|
_Version update only_
|
|
539
641
|
|
|
540
642
|
## 3.2.8
|
|
643
|
+
|
|
541
644
|
Tue, 09 Aug 2022 15:52:41 GMT
|
|
542
645
|
|
|
543
646
|
_Version update only_
|
|
544
647
|
|
|
545
648
|
## 3.2.7
|
|
649
|
+
|
|
546
650
|
Mon, 01 Aug 2022 13:36:56 GMT
|
|
547
651
|
|
|
548
652
|
_Version update only_
|
|
549
653
|
|
|
550
654
|
## 3.2.6
|
|
655
|
+
|
|
551
656
|
Fri, 15 Jul 2022 19:04:43 GMT
|
|
552
657
|
|
|
553
658
|
_Version update only_
|
|
554
659
|
|
|
555
660
|
## 3.2.5
|
|
661
|
+
|
|
556
662
|
Wed, 13 Jul 2022 15:45:53 GMT
|
|
557
663
|
|
|
558
664
|
_Version update only_
|
|
559
665
|
|
|
560
666
|
## 3.2.4
|
|
667
|
+
|
|
561
668
|
Tue, 21 Jun 2022 18:06:33 GMT
|
|
562
669
|
|
|
563
670
|
_Version update only_
|
|
564
671
|
|
|
565
672
|
## 3.2.3
|
|
673
|
+
|
|
566
674
|
Fri, 17 Jun 2022 15:18:39 GMT
|
|
567
675
|
|
|
568
676
|
_Version update only_
|
|
569
677
|
|
|
570
678
|
## 3.2.2
|
|
679
|
+
|
|
571
680
|
Fri, 10 Jun 2022 16:11:37 GMT
|
|
572
681
|
|
|
573
682
|
_Version update only_
|
|
574
683
|
|
|
575
684
|
## 3.2.1
|
|
685
|
+
|
|
576
686
|
Tue, 07 Jun 2022 15:02:56 GMT
|
|
577
687
|
|
|
578
688
|
### Updates
|
|
@@ -580,28 +690,33 @@ Tue, 07 Jun 2022 15:02:56 GMT
|
|
|
580
690
|
- Remove fix height from ColorPicker dialog.
|
|
581
691
|
|
|
582
692
|
## 3.2.0
|
|
693
|
+
|
|
583
694
|
Fri, 20 May 2022 13:10:54 GMT
|
|
584
695
|
|
|
585
696
|
### Updates
|
|
586
697
|
|
|
587
|
-
- Fix for losing viewport content after clicking PW link
|
|
698
|
+
- Fix for losing viewport content after clicking PW link
|
|
588
699
|
|
|
589
700
|
## 3.1.3
|
|
701
|
+
|
|
590
702
|
Fri, 15 Apr 2022 13:49:25 GMT
|
|
591
703
|
|
|
592
704
|
_Version update only_
|
|
593
705
|
|
|
594
706
|
## 3.1.2
|
|
707
|
+
|
|
595
708
|
Wed, 06 Apr 2022 22:27:56 GMT
|
|
596
709
|
|
|
597
710
|
_Version update only_
|
|
598
711
|
|
|
599
712
|
## 3.1.1
|
|
713
|
+
|
|
600
714
|
Thu, 31 Mar 2022 15:55:48 GMT
|
|
601
715
|
|
|
602
716
|
_Version update only_
|
|
603
717
|
|
|
604
718
|
## 3.1.0
|
|
719
|
+
|
|
605
720
|
Tue, 29 Mar 2022 20:53:47 GMT
|
|
606
721
|
|
|
607
722
|
### Updates
|
|
@@ -615,16 +730,19 @@ Tue, 29 Mar 2022 20:53:47 GMT
|
|
|
615
730
|
- Update to latest itwinui-react.
|
|
616
731
|
|
|
617
732
|
## 3.0.3
|
|
733
|
+
|
|
618
734
|
Fri, 25 Mar 2022 15:10:02 GMT
|
|
619
735
|
|
|
620
736
|
_Version update only_
|
|
621
737
|
|
|
622
738
|
## 3.0.2
|
|
739
|
+
|
|
623
740
|
Thu, 10 Mar 2022 21:18:13 GMT
|
|
624
741
|
|
|
625
742
|
_Version update only_
|
|
626
743
|
|
|
627
744
|
## 3.0.1
|
|
745
|
+
|
|
628
746
|
Thu, 24 Feb 2022 15:26:55 GMT
|
|
629
747
|
|
|
630
748
|
### Updates
|
|
@@ -632,6 +750,7 @@ Thu, 24 Feb 2022 15:26:55 GMT
|
|
|
632
750
|
- Avoid processing stale viewStates that reference closed imodels.
|
|
633
751
|
|
|
634
752
|
## 3.0.0
|
|
753
|
+
|
|
635
754
|
Mon, 24 Jan 2022 14:00:52 GMT
|
|
636
755
|
|
|
637
756
|
### Updates
|
|
@@ -646,7 +765,7 @@ Mon, 24 Jan 2022 14:00:52 GMT
|
|
|
646
765
|
- tool.run and tool.parseAndRun are now async methods
|
|
647
766
|
- Deprecate obsolete code.
|
|
648
767
|
- Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
|
|
649
|
-
-
|
|
768
|
+
- update immer to fix security warning
|
|
650
769
|
- Deprecate and promote apis
|
|
651
770
|
- Deprecate obsolete APIs. Publish beta APIs from last release.
|
|
652
771
|
- Upgraded itwinui-react to 1.16.2. Fixed editor sizes.
|
|
@@ -665,4 +784,3 @@ Mon, 24 Jan 2022 14:00:52 GMT
|
|
|
665
784
|
- Update to latest types/react package
|
|
666
785
|
- Update ViewportComponent to function component that properly processes async method to get viewState.
|
|
667
786
|
- 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,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,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,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,
|
|
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,EACL,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWtD;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA6B;QAC7D;YACE,KAAK,EAAE,UAAU,CAAC,OAAO;YACzB,KAAK,EAAE,SAAS,CAAC,wBAAwB,CAAC;SAC3C;QACD;YACE,KAAK,EAAE,UAAU,CAAC,UAAU;YAC5B,KAAK,EAAE,SAAS,CAAC,2BAA2B,CAAC;SAC9C;QACD;YACE,KAAK,EAAE,UAAU,CAAC,OAAO;YACzB,KAAK,EAAE,SAAS,CAAC,wBAAw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C,iBAAiB,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;qBACrD,iBAAiB,EAAE;qBACnB,QAAQ,CAAC,GAAG,CAAC;oBACd,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,CAAC,CAAC;gBACN,MAAM;YACR,KAAK,UAAU,CAAC,UAAU;gBACxB,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC;gBACtC,MAAM;QACV,CAAC;QACD,MAAM,cAAc,GAAG;YACrB,GAAG,WAAW;YACd,IAAI;YACJ,SAAS;YACT,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 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/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWtD;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA6B;QAC7D;YACE,KAAK,EAAE,UAAU,CAAC,OAAO;YACzB,KAAK,EAAE,SAAS,CAAC,wBAAwB,CAAC;SAC3C;QACD;YACE,KAAK,EAAE,UAAU,CAAC,UAA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,KAAK,UAAU,CAAC,OAAO;gBACrB,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,UAAU,CAAC,OAAO;gBACrB,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC;gBACjC,iBAAiB,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;qBACrD,iBAAiB,EAAE;qBACnB,QAAQ,CAAC,GAAG,CAAC;oBACd,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,CAAC,CAAC;gBACN,MAAM;YACR,KAAK,UAAU,CAAC,UAAU;gBACxB,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC;gBACtC,MAAM;QACV,CAAC;QACD,MAAM,cAAc,GAAG;YACrB,GAAG,WAAW;YACd,IAAI;YACJ,SAAS;YACT,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,
|
|
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,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAgBtD;;GAEG;AACH,4DAA4D;AAC5D,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,uBAAuB,GACxB,GAAG,KAAK,CAAC;IACV,MAA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,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;;;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,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAA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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.
|
|
3
|
+
"version": "5.5.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/
|
|
40
|
-
"@itwin/core-
|
|
41
|
-
"@itwin/core-
|
|
42
|
-
"@itwin/core-
|
|
43
|
-
"@itwin/core-
|
|
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.5.0",
|
|
48
|
+
"@itwin/core-react": "5.5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@itwin/appui-abstract": "
|
|
51
|
+
"@itwin/appui-abstract": "rc",
|
|
52
52
|
"@itwin/build-tools": "4.10.2",
|
|
53
|
-
"@itwin/core-bentley": "
|
|
54
|
-
"@itwin/core-common": "
|
|
55
|
-
"@itwin/core-frontend": "
|
|
56
|
-
"@itwin/core-geometry": "
|
|
57
|
-
"@itwin/core-orbitgt": "
|
|
58
|
-
"@itwin/core-quantity": "
|
|
59
|
-
"@itwin/eslint-plugin": "5.
|
|
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": "
|
|
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.
|
|
87
|
-
"@itwin/core-react": "5.
|
|
87
|
+
"@itwin/components-react": "5.5.0",
|
|
88
|
+
"@itwin/core-react": "5.5.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
|
|
103
|
+
"clean": "rimraf -g lib",
|
|
103
104
|
"cover": "vitest run --coverage",
|
|
104
|
-
"lint": "eslint
|
|
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
|
}
|