@itwin/imodel-components-react 3.5.0-dev.63 → 3.5.0-dev.66

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.
Files changed (343) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  6. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +186 -186
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
  9. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
  13. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  23. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  24. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
  26. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  27. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  29. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
  30. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  31. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  32. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  33. package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
  34. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
  36. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  37. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  38. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  40. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
  41. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  43. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  44. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
  45. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  47. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  48. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
  49. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  51. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +265 -265
  52. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  53. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  55. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
  56. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  57. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  59. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
  60. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  61. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  62. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  63. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
  64. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  65. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  67. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +634 -634
  68. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  69. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
  72. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +83 -83
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
  92. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
  95. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +154 -154
  98. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
  128. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
  131. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  134. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  138. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  142. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  146. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  150. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  151. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  154. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  155. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +358 -358
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  159. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  162. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  163. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  168. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  169. package/lib/cjs/imodel-components-react.d.ts +82 -82
  170. package/lib/cjs/imodel-components-react.js +101 -101
  171. package/lib/cjs/imodel-components-react.js.map +1 -1
  172. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  173. package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -75
  174. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  175. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  176. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  177. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  178. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  179. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  180. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
  181. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  182. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
  183. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  184. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  185. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  186. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  187. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
  188. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  189. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  193. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  194. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  195. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  196. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  197. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  198. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  199. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  200. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  201. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  202. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  203. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  204. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  205. package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
  206. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  207. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  208. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  209. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  210. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  211. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  212. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  213. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  214. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  215. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  216. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  217. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  218. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  219. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  220. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  221. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
  222. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  223. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  224. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  225. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  226. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  227. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  228. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  229. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
  230. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  231. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  232. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  233. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  234. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  235. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  236. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  237. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +606 -606
  238. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  239. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  240. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  241. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
  242. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  243. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  244. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  245. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  246. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  247. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  248. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  249. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  250. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  251. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  252. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +60 -60
  253. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  254. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  255. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  256. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  257. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  258. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  259. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  260. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  261. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  262. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  263. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  264. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  265. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  266. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  267. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +131 -131
  268. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  269. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  270. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  271. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  272. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  273. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  274. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  275. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  276. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  277. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  278. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  279. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  280. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  281. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  282. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  283. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  284. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  285. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  286. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  287. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  288. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  289. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  290. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  291. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  292. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  293. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  294. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  295. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  296. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  297. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  298. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  299. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  300. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
  301. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  302. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  303. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  304. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  305. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  306. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  307. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  308. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  309. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  310. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
  311. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  312. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
  313. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  314. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  315. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  316. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
  317. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  318. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
  319. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  320. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  321. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  322. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  323. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  324. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  325. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  326. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  327. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +332 -332
  328. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  329. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  330. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
  331. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  332. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  333. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  334. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  335. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  336. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  337. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
  338. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  339. package/lib/esm/imodel-components-react.d.ts +82 -82
  340. package/lib/esm/imodel-components-react.js +87 -87
  341. package/lib/esm/imodel-components-react.js.map +1 -1
  342. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  343. package/package.json +19 -19
@@ -1,84 +1,84 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module QuantityFormat
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FormatSample = void 0;
30
- const React = __importStar(require("react"));
31
- const appui_abstract_1 = require("@itwin/appui-abstract");
32
- const core_react_1 = require("@itwin/core-react");
33
- const itwinui_react_1 = require("@itwin/itwinui-react");
34
- const UiIModelComponents_1 = require("../UiIModelComponents");
35
- /** Component to show the persistence value and formatted value given a FormatterSpec.
36
- * @alpha
37
- */
38
- function FormatSample(props) {
39
- const { initialMagnitude, formatSpec, hideLabels } = props;
40
- const initialValue = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
41
- const [magnitude, setMagnitude] = React.useState(initialValue);
42
- const [sampleValue, setSampleValue] = React.useState(initialValue.toString());
43
- React.useEffect(() => {
44
- const value = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
45
- setMagnitude(value);
46
- setSampleValue(value.toString());
47
- }, [initialMagnitude]);
48
- const handleOnValueBlur = React.useCallback(() => {
49
- let newValue = Number.parseFloat(sampleValue);
50
- if (Number.isNaN(newValue))
51
- newValue = 0;
52
- setMagnitude(newValue);
53
- setSampleValue(newValue.toString());
54
- }, [sampleValue]);
55
- const handleOnValueChange = React.useCallback((event) => {
56
- setSampleValue(event.target.value);
57
- }, []);
58
- const handleKeyDown = React.useCallback((e) => {
59
- // istanbul ignore else
60
- if (e.key === appui_abstract_1.SpecialKey.Enter) {
61
- let newValue = Number.parseFloat(sampleValue);
62
- if (Number.isNaN(newValue))
63
- newValue = 0;
64
- setMagnitude(newValue);
65
- setSampleValue(newValue.toString());
66
- e.preventDefault();
67
- }
68
- }, [sampleValue]);
69
- const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : "";
70
- const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : "";
71
- const valueLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.value"));
72
- const formattedLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.formatted"));
73
- return (React.createElement(React.Fragment, null,
74
- !hideLabels && React.createElement("span", { className: "uicore-label" }, valueLabel.current),
75
- React.createElement("span", { className: "components-inline" },
76
- React.createElement(itwinui_react_1.Input, { "data-testid": "format-sample-input", className: "components-quantity-persistence-input", value: sampleValue, onChange: handleOnValueChange, onKeyDown: handleKeyDown, onBlur: handleOnValueBlur, size: "small" }),
77
- activePersistenceUnitLabel),
78
- !hideLabels && React.createElement("span", { className: "uicore-label" }, formattedLabel.current),
79
- React.createElement("span", null,
80
- hideLabels && (formattedValue.length > 0) && React.createElement(core_react_1.WebFontIcon, { iconName: "icon-progress-forward-2" }),
81
- React.createElement("span", { "data-testid": "format-sample-formatted", className: "uicore-label components-quantity-formatted-sample" }, formattedValue))));
82
- }
83
- exports.FormatSample = FormatSample;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module QuantityFormat
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FormatSample = void 0;
30
+ const React = __importStar(require("react"));
31
+ const appui_abstract_1 = require("@itwin/appui-abstract");
32
+ const core_react_1 = require("@itwin/core-react");
33
+ const itwinui_react_1 = require("@itwin/itwinui-react");
34
+ const UiIModelComponents_1 = require("../UiIModelComponents");
35
+ /** Component to show the persistence value and formatted value given a FormatterSpec.
36
+ * @alpha
37
+ */
38
+ function FormatSample(props) {
39
+ const { initialMagnitude, formatSpec, hideLabels } = props;
40
+ const initialValue = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
41
+ const [magnitude, setMagnitude] = React.useState(initialValue);
42
+ const [sampleValue, setSampleValue] = React.useState(initialValue.toString());
43
+ React.useEffect(() => {
44
+ const value = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
45
+ setMagnitude(value);
46
+ setSampleValue(value.toString());
47
+ }, [initialMagnitude]);
48
+ const handleOnValueBlur = React.useCallback(() => {
49
+ let newValue = Number.parseFloat(sampleValue);
50
+ if (Number.isNaN(newValue))
51
+ newValue = 0;
52
+ setMagnitude(newValue);
53
+ setSampleValue(newValue.toString());
54
+ }, [sampleValue]);
55
+ const handleOnValueChange = React.useCallback((event) => {
56
+ setSampleValue(event.target.value);
57
+ }, []);
58
+ const handleKeyDown = React.useCallback((e) => {
59
+ // istanbul ignore else
60
+ if (e.key === appui_abstract_1.SpecialKey.Enter) {
61
+ let newValue = Number.parseFloat(sampleValue);
62
+ if (Number.isNaN(newValue))
63
+ newValue = 0;
64
+ setMagnitude(newValue);
65
+ setSampleValue(newValue.toString());
66
+ e.preventDefault();
67
+ }
68
+ }, [sampleValue]);
69
+ const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : "";
70
+ const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : "";
71
+ const valueLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.value"));
72
+ const formattedLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.formatted"));
73
+ return (React.createElement(React.Fragment, null,
74
+ !hideLabels && React.createElement("span", { className: "uicore-label" }, valueLabel.current),
75
+ React.createElement("span", { className: "components-inline" },
76
+ React.createElement(itwinui_react_1.Input, { "data-testid": "format-sample-input", className: "components-quantity-persistence-input", value: sampleValue, onChange: handleOnValueChange, onKeyDown: handleKeyDown, onBlur: handleOnValueBlur, size: "small" }),
77
+ activePersistenceUnitLabel),
78
+ !hideLabels && React.createElement("span", { className: "uicore-label" }, formattedLabel.current),
79
+ React.createElement("span", null,
80
+ hideLabels && (formattedValue.length > 0) && React.createElement(core_react_1.WebFontIcon, { iconName: "icon-progress-forward-2" }),
81
+ React.createElement("span", { "data-testid": "format-sample-formatted", className: "uicore-label components-quantity-formatted-sample" }, formattedValue))));
82
+ }
83
+ exports.FormatSample = FormatSample;
84
84
  //# sourceMappingURL=FormatSample.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAAmD;AACnD,kDAA6D;AAC7D,wDAA6C;AAC7C,8DAA2D;AAW3D;;GAEG;AACH,SAAgB,YAA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AAS,EAAE,cAAc,IAAG,cAAc,CAAC,OAAO,CAAQ;QAChF;YACG,UAAU,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,oBAAC,wBAAW,IAAC,QAAQ,EAAC,yBAAyB,GAAG;YAChG,6CAAkB,yBAAyB,EAAC,SAAS,EAAE,mDAAmD,IAAG,cAAc,CAAQ,CAC9H,CACN,CACJ,CAAC;AACJ,CAAC;AAvDD,oCAuDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module QuantityFormat\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { FormatterSpec } from \"@itwin/core-quantity\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, WebFontIcon } from \"@itwin/core-react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\n\r\n/** Properties of [[FormatSample]] component.\r\n * @alpha\r\n */\r\nexport interface FormatSampleProps extends CommonProps {\r\n formatSpec?: FormatterSpec;\r\n initialMagnitude?: number;\r\n hideLabels?: boolean;\r\n}\r\n\r\n/** Component to show the persistence value and formatted value given a FormatterSpec.\r\n * @alpha\r\n */\r\nexport function FormatSample(props: FormatSampleProps) {\r\n const { initialMagnitude, formatSpec, hideLabels } = props;\r\n const initialValue = initialMagnitude ?? 0;\r\n const [magnitude, setMagnitude] = React.useState(initialValue);\r\n const [sampleValue, setSampleValue] = React.useState(initialValue.toString());\r\n\r\n React.useEffect(() => {\r\n const value = initialMagnitude ?? 0;\r\n setMagnitude(value);\r\n setSampleValue(value.toString());\r\n }, [initialMagnitude]);\r\n\r\n const handleOnValueBlur = React.useCallback(() => {\r\n let newValue = Number.parseFloat(sampleValue);\r\n if (Number.isNaN(newValue))\r\n newValue = 0;\r\n setMagnitude(newValue);\r\n setSampleValue(newValue.toString());\r\n }, [sampleValue]);\r\n\r\n const handleOnValueChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSampleValue(event.target.value);\r\n }, []);\r\n\r\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (e.key === SpecialKey.Enter) {\r\n let newValue = Number.parseFloat(sampleValue);\r\n if (Number.isNaN(newValue))\r\n newValue = 0;\r\n setMagnitude(newValue);\r\n setSampleValue(newValue.toString());\r\n e.preventDefault();\r\n }\r\n }, [sampleValue]);\r\n\r\n const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : \"\";\r\n const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : \"\";\r\n\r\n const valueLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.value\"));\r\n const formattedLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.formatted\"));\r\n\r\n return (\r\n <>\r\n {!hideLabels && <span className={\"uicore-label\"}>{valueLabel.current}</span>}\r\n <span className=\"components-inline\">\r\n <Input data-testid=\"format-sample-input\" className={\"components-quantity-persistence-input\"} value={sampleValue} onChange={handleOnValueChange} onKeyDown={handleKeyDown} onBlur={handleOnValueBlur} size=\"small\" />{activePersistenceUnitLabel}\r\n </span>\r\n {!hideLabels && <span className={\"uicore-label\"}>{formattedLabel.current}</span>}\r\n <span>\r\n {hideLabels && (formattedValue.length > 0) && <WebFontIcon iconName=\"icon-progress-forward-2\" />}\r\n <span data-testid=\"format-sample-formatted\" className={\"uicore-label components-quantity-formatted-sample\"}>{formattedValue}</span>\r\n </span>\r\n </>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B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,iBAAiB,EAAE,IAAI,EAAC,OAAO,GAAG;YAAC,0BAA0B,CAC1O;QACN,CAAC,UAAU,IAAI,8BAAM,SAAS,EAAE,cAAc,IAAG,cAAc,CAAC,OAAO,CAAQ;QAChF;YACG,UAAU,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,oBAAC,wBAAW,IAAC,QAAQ,EAAC,yBAAyB,GAAG;YAChG,6CAAkB,yBAAyB,EAAC,SAAS,EAAE,mDAAmD,IAAG,cAAc,CAAQ,CAC9H,CACN,CACJ,CAAC;AACJ,CAAC;AAvDD,oCAuDC","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 { FormatterSpec } from \"@itwin/core-quantity\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps, WebFontIcon } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\n/** Properties of [[FormatSample]] component.\n * @alpha\n */\nexport interface FormatSampleProps extends CommonProps {\n formatSpec?: FormatterSpec;\n initialMagnitude?: number;\n hideLabels?: boolean;\n}\n\n/** Component to show the persistence value and formatted value given a FormatterSpec.\n * @alpha\n */\nexport function FormatSample(props: FormatSampleProps) {\n const { initialMagnitude, formatSpec, hideLabels } = props;\n const initialValue = initialMagnitude ?? 0;\n const [magnitude, setMagnitude] = React.useState(initialValue);\n const [sampleValue, setSampleValue] = React.useState(initialValue.toString());\n\n React.useEffect(() => {\n const value = initialMagnitude ?? 0;\n setMagnitude(value);\n setSampleValue(value.toString());\n }, [initialMagnitude]);\n\n const handleOnValueBlur = React.useCallback(() => {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue))\n newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n }, [sampleValue]);\n\n const handleOnValueChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSampleValue(event.target.value);\n }, []);\n\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (e.key === SpecialKey.Enter) {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue))\n newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n e.preventDefault();\n }\n }, [sampleValue]);\n\n const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : \"\";\n const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : \"\";\n\n const valueLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.value\"));\n const formattedLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.formatted\"));\n\n return (\n <>\n {!hideLabels && <span className={\"uicore-label\"}>{valueLabel.current}</span>}\n <span className=\"components-inline\">\n <Input data-testid=\"format-sample-input\" className={\"components-quantity-persistence-input\"} value={sampleValue} onChange={handleOnValueChange} onKeyDown={handleKeyDown} onBlur={handleOnValueBlur} size=\"small\" />{activePersistenceUnitLabel}\n </span>\n {!hideLabels && <span className={\"uicore-label\"}>{formattedLabel.current}</span>}\n <span>\n {hideLabels && (formattedValue.length > 0) && <WebFontIcon iconName=\"icon-progress-forward-2\" />}\n <span data-testid=\"format-sample-formatted\" className={\"uicore-label components-quantity-formatted-sample\"}>{formattedValue}</span>\n </span>\n </>\n );\n}\n"]}
@@ -1,18 +1,18 @@
1
- /** @packageDocumentation
2
- * @module QuantityFormat
3
- */
4
- /// <reference types="react" />
5
- import { CommonProps } from "@itwin/core-react";
6
- import { FormatProps } from "@itwin/core-quantity";
7
- /** Properties of [[FormatTypeOptionProps]] component.
8
- * @alpha
9
- */
10
- export interface FormatTypeOptionProps extends CommonProps {
11
- formatProps: FormatProps;
12
- onChange?: (format: FormatProps) => void;
13
- }
14
- /** Component to set the Quantity Format type.
15
- * @alpha
16
- */
17
- export declare function FormatTypeOption(props: FormatTypeOptionProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module QuantityFormat
3
+ */
4
+ /// <reference types="react" />
5
+ import { CommonProps } from "@itwin/core-react";
6
+ import { FormatProps } from "@itwin/core-quantity";
7
+ /** Properties of [[FormatTypeOptionProps]] component.
8
+ * @alpha
9
+ */
10
+ export interface FormatTypeOptionProps extends CommonProps {
11
+ formatProps: FormatProps;
12
+ onChange?: (format: FormatProps) => void;
13
+ }
14
+ /** Component to set the Quantity Format type.
15
+ * @alpha
16
+ */
17
+ export declare function FormatTypeOption(props: FormatTypeOptionProps): JSX.Element;
18
18
  //# sourceMappingURL=FormatType.d.ts.map
@@ -1,87 +1,87 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module QuantityFormat
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FormatTypeOption = void 0;
30
- const React = __importStar(require("react"));
31
- const UiIModelComponents_1 = require("../UiIModelComponents");
32
- const core_quantity_1 = require("@itwin/core-quantity");
33
- const itwinui_react_1 = require("@itwin/itwinui-react");
34
- /** Component to select the format type.
35
- * @alpha
36
- */
37
- function FormatTypeSelector(props) {
38
- const { type, onChange, ...otherProps } = props;
39
- const formatOptions = React.useRef([
40
- { value: core_quantity_1.FormatType.Decimal, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.decimal") },
41
- { value: core_quantity_1.FormatType.Scientific, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.scientific") },
42
- { value: core_quantity_1.FormatType.Station, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station") },
43
- { value: core_quantity_1.FormatType.Fractional, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.fractional") },
44
- ]);
45
- const handleOnChange = React.useCallback((newValue) => {
46
- onChange && onChange(newValue);
47
- }, [onChange]);
48
- return (React.createElement(itwinui_react_1.Select, { options: formatOptions.current, value: type, onChange: handleOnChange, size: "small", ...otherProps }));
49
- }
50
- /** Component to set the Quantity Format type.
51
- * @alpha
52
- */
53
- function FormatTypeOption(props) {
54
- const { formatProps, onChange } = props;
55
- const handleFormatTypeChange = React.useCallback((newType) => {
56
- var _a;
57
- const type = (0, core_quantity_1.formatTypeToString)(newType);
58
- let precision;
59
- let stationOffsetSize;
60
- let scientificType;
61
- switch (newType) { // type must be decimal, fractional, scientific, or station
62
- case core_quantity_1.FormatType.Scientific:
63
- precision = core_quantity_1.DecimalPrecision.Six;
64
- scientificType = (0, core_quantity_1.scientificTypeToString)(core_quantity_1.ScientificType.Normalized);
65
- break;
66
- case core_quantity_1.FormatType.Decimal:
67
- precision = core_quantity_1.DecimalPrecision.Four;
68
- break;
69
- case core_quantity_1.FormatType.Station:
70
- precision = core_quantity_1.DecimalPrecision.Two;
71
- stationOffsetSize = ((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units[0].name.toLocaleLowerCase().endsWith("m")) ? 3 : 2;
72
- break;
73
- case core_quantity_1.FormatType.Fractional:
74
- precision = core_quantity_1.FractionalPrecision.Eight;
75
- break;
76
- }
77
- const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };
78
- onChange && onChange(newFormatProps);
79
- }, [formatProps, onChange]);
80
- const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
81
- const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.type"));
82
- return (React.createElement(React.Fragment, null,
83
- React.createElement("span", { className: "uicore-label.current" }, label.current),
84
- React.createElement(FormatTypeSelector, { "data-testid": "format-type-selector", type: formatType, onChange: handleFormatTypeChange })));
85
- }
86
- exports.FormatTypeOption = FormatTypeOption;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module QuantityFormat
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FormatTypeOption = void 0;
30
+ const React = __importStar(require("react"));
31
+ const UiIModelComponents_1 = require("../UiIModelComponents");
32
+ const core_quantity_1 = require("@itwin/core-quantity");
33
+ const itwinui_react_1 = require("@itwin/itwinui-react");
34
+ /** Component to select the format type.
35
+ * @alpha
36
+ */
37
+ function FormatTypeSelector(props) {
38
+ const { type, onChange, ...otherProps } = props;
39
+ const formatOptions = React.useRef([
40
+ { value: core_quantity_1.FormatType.Decimal, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.decimal") },
41
+ { value: core_quantity_1.FormatType.Scientific, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.scientific") },
42
+ { value: core_quantity_1.FormatType.Station, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station") },
43
+ { value: core_quantity_1.FormatType.Fractional, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.fractional") },
44
+ ]);
45
+ const handleOnChange = React.useCallback((newValue) => {
46
+ onChange && onChange(newValue);
47
+ }, [onChange]);
48
+ return (React.createElement(itwinui_react_1.Select, { options: formatOptions.current, value: type, onChange: handleOnChange, size: "small", ...otherProps }));
49
+ }
50
+ /** Component to set the Quantity Format type.
51
+ * @alpha
52
+ */
53
+ function FormatTypeOption(props) {
54
+ const { formatProps, onChange } = props;
55
+ const handleFormatTypeChange = React.useCallback((newType) => {
56
+ var _a;
57
+ const type = (0, core_quantity_1.formatTypeToString)(newType);
58
+ let precision;
59
+ let stationOffsetSize;
60
+ let scientificType;
61
+ switch (newType) { // type must be decimal, fractional, scientific, or station
62
+ case core_quantity_1.FormatType.Scientific:
63
+ precision = core_quantity_1.DecimalPrecision.Six;
64
+ scientificType = (0, core_quantity_1.scientificTypeToString)(core_quantity_1.ScientificType.Normalized);
65
+ break;
66
+ case core_quantity_1.FormatType.Decimal:
67
+ precision = core_quantity_1.DecimalPrecision.Four;
68
+ break;
69
+ case core_quantity_1.FormatType.Station:
70
+ precision = core_quantity_1.DecimalPrecision.Two;
71
+ stationOffsetSize = ((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units[0].name.toLocaleLowerCase().endsWith("m")) ? 3 : 2;
72
+ break;
73
+ case core_quantity_1.FormatType.Fractional:
74
+ precision = core_quantity_1.FractionalPrecision.Eight;
75
+ break;
76
+ }
77
+ const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };
78
+ onChange && onChange(newFormatProps);
79
+ }, [formatProps, onChange]);
80
+ const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
81
+ const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.type"));
82
+ return (React.createElement(React.Fragment, null,
83
+ React.createElement("span", { className: "uicore-label.current" }, label.current),
84
+ React.createElement(FormatTypeSelector, { "data-testid": "format-type-selector", type: formatType, onChange: handleFormatTypeChange })));
85
+ }
86
+ exports.FormatTypeOption = FormatTypeOption;
87
87
  //# sourceMappingURL=FormatType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,8DAA2D;AAC3D,wDAE8B;AAC9B,wDAA4D;AAU5D;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA6B;QAC7D,EAAE,KAAK,EAAE,0BAAU,CAAC,OAAO,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAAE;QAC5F,EAAE,KAAK,EAAE,0BAAU,CAAC,UAAU,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,EAAE;QAClG,EAAE,KAAK,EAAE,0BAAU,CAAC,OAA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AC,GAAG,CAAC;gBACjC,iBAAiB,GAAG,CAAA,MAAA,WAAW,CAAC,SAAS,0CAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnG,MAAM;YACR,KAAK,0BAAU,CAAC,UAAU;gBACxB,SAAS,GAAG,mCAAmB,CAAC,KAAK,CAAC;gBACtC,MAAM;SACT;QACD,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;QAC9F,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEvF,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IAAG,KAAK,CAAC,OAAO,CAAQ;QAC/D,oBAAC,kBAAkB,mBAAa,sBAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,GAAI,CAC5G,CACJ,CAAC;AACJ,CAAC;AApCD,4CAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module QuantityFormat\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\nimport { DecimalPrecision, FormatProps, FormatType, formatTypeToString, FractionalPrecision, parseFormatType,\r\n ScientificType, scientificTypeToString,\r\n} from \"@itwin/core-quantity\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\n\r\n/** Properties of [[FormatTypeSelector]] component.\r\n * @alpha\r\n */\r\ninterface FormatTypeSelectorProps extends CommonProps {\r\n type: FormatType;\r\n onChange: (value: FormatType) => void;\r\n}\r\n\r\n/** Component to select the format type.\r\n * @alpha\r\n */\r\nfunction FormatTypeSelector(props: FormatTypeSelectorProps) {\r\n const { type, onChange, ...otherProps } = props;\r\n const formatOptions = React.useRef<SelectOption<FormatType>[]>([\r\n { value: FormatType.Decimal, label: UiIModelComponents.translate(\"QuantityFormat.decimal\") },\r\n { value: FormatType.Scientific, label: UiIModelComponents.translate(\"QuantityFormat.scientific\") },\r\n { value: FormatType.Station, label: UiIModelComponents.translate(\"QuantityFormat.station\") },\r\n { value: FormatType.Fractional, label: UiIModelComponents.translate(\"QuantityFormat.fractional\") },\r\n ]);\r\n\r\n const handleOnChange = React.useCallback((newValue: FormatType) => {\r\n onChange && onChange(newValue);\r\n }, [onChange]);\r\n\r\n return (\r\n <Select options={formatOptions.current} value={type} onChange={handleOnChange} size=\"small\" {...otherProps} />\r\n );\r\n}\r\n\r\n/** Properties of [[FormatTypeOptionProps]] component.\r\n * @alpha\r\n */\r\nexport interface FormatTypeOptionProps extends CommonProps {\r\n formatProps: FormatProps;\r\n onChange?: (format: FormatProps) => void;\r\n}\r\n\r\n/** Component to set the Quantity Format type.\r\n * @alpha\r\n */\r\nexport function FormatTypeOption(props: FormatTypeOptionProps) {\r\n const { formatProps, onChange } = props;\r\n const handleFormatTypeChange = React.useCallback((newType: FormatType) => {\r\n const type = formatTypeToString(newType);\r\n let precision: number | undefined;\r\n let stationOffsetSize: number | undefined;\r\n let scientificType: string | undefined;\r\n switch (newType) { // type must be decimal, fractional, scientific, or station\r\n case FormatType.Scientific:\r\n precision = DecimalPrecision.Six;\r\n scientificType = scientificTypeToString(ScientificType.Normalized);\r\n break;\r\n case FormatType.Decimal:\r\n precision = DecimalPrecision.Four;\r\n break;\r\n case FormatType.Station:\r\n precision = DecimalPrecision.Two;\r\n stationOffsetSize = formatProps.composite?.units[0].name.toLocaleLowerCase().endsWith(\"m\") ? 3 : 2;\r\n break;\r\n case FormatType.Fractional:\r\n precision = FractionalPrecision.Eight;\r\n break;\r\n }\r\n const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };\r\n onChange && onChange(newFormatProps);\r\n }, [formatProps, onChange]);\r\n\r\n const formatType = parseFormatType(formatProps.type, \"format\");\r\n const label = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.type\"));\r\n\r\n return (\r\n <>\r\n <span className={\"uicore-label.current\"}>{label.current}</span>\r\n <FormatTypeSelector data-testid=\"format-type-selector\" type={formatType} onChange={handleFormatTypeChange} />\r\n </>\r\n );\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,8DAA2D;AAC3D,wDAE8B;AAC9B,wDAA4D;AAU5D;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA6B;QAC7D,EAAE,KAAK,EAAE,0BAAU,CAAC,OAAO,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAAE;QAC5F,EAAE,KAAK,EAAE,0BAAU,CAAC,UAAU,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,EAAE;QAClG,EAAE,KAAK,EAAE,0BAAU,CAAC,OAAO,EAAE,KAAK,EAAE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jC,iBAAiB,GAAG,CAAA,MAAA,WAAW,CAAC,SAAS,0CAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnG,MAAM;YACR,KAAK,0BAAU,CAAC,UAAU;gBACxB,SAAS,GAAG,mCAAmB,CAAC,KAAK,CAAC;gBACtC,MAAM;SACT;QACD,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;QAC9F,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEvF,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IAAG,KAAK,CAAC,OAAO,CAAQ;QAC/D,oBAAC,kBAAkB,mBAAa,sBAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,GAAI,CAC5G,CACJ,CAAC;AACJ,CAAC;AApCD,4CAoCC","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 { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { DecimalPrecision, FormatProps, FormatType, formatTypeToString, FractionalPrecision, parseFormatType,\n ScientificType, scientificTypeToString,\n} from \"@itwin/core-quantity\";\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\n\n/** Properties of [[FormatTypeSelector]] component.\n * @alpha\n */\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 formatOptions = React.useRef<SelectOption<FormatType>[]>([\n { value: FormatType.Decimal, label: UiIModelComponents.translate(\"QuantityFormat.decimal\") },\n { value: FormatType.Scientific, label: UiIModelComponents.translate(\"QuantityFormat.scientific\") },\n { value: FormatType.Station, label: UiIModelComponents.translate(\"QuantityFormat.station\") },\n { value: FormatType.Fractional, label: UiIModelComponents.translate(\"QuantityFormat.fractional\") },\n ]);\n\n const handleOnChange = React.useCallback((newValue: FormatType) => {\n onChange && onChange(newValue);\n }, [onChange]);\n\n return (\n <Select options={formatOptions.current} value={type} onChange={handleOnChange} size=\"small\" {...otherProps} />\n );\n}\n\n/** Properties of [[FormatTypeOptionProps]] component.\n * @alpha\n */\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 */\nexport function FormatTypeOption(props: FormatTypeOptionProps) {\n const { formatProps, onChange } = props;\n const handleFormatTypeChange = React.useCallback((newType: FormatType) => {\n const type = formatTypeToString(newType);\n let precision: number | undefined;\n let stationOffsetSize: number | undefined;\n let scientificType: string | undefined;\n switch (newType) { // type must be decimal, fractional, scientific, or station\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.toLocaleLowerCase().endsWith(\"m\") ? 3 : 2;\n break;\n case FormatType.Fractional:\n precision = FractionalPrecision.Eight;\n break;\n }\n const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };\n onChange && onChange(newFormatProps);\n }, [formatProps, onChange]);\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n const label = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.type\"));\n\n return (\n <>\n <span className={\"uicore-label.current\"}>{label.current}</span>\n <FormatTypeSelector data-testid=\"format-type-selector\" type={formatType} onChange={handleFormatTypeChange} />\n </>\n );\n}\n\n"]}
@@ -1,18 +1,18 @@
1
- /** @packageDocumentation
2
- * @module QuantityFormat
3
- */
4
- /// <reference types="react" />
5
- import { CommonProps } from "@itwin/core-react";
6
- import { FormatProps } from "@itwin/core-quantity";
7
- /** Properties of [[FormatUnitLabel]] component.
8
- * @alpha
9
- */
10
- export interface FormatUnitLabelProps extends CommonProps {
11
- formatProps: FormatProps;
12
- onUnitLabelChange?: (format: FormatProps) => void;
13
- }
14
- /** Component to set the label separator definition in a Quantity Format and if it the label is to be displayed.
15
- * @alpha
16
- */
17
- export declare function FormatUnitLabel(props: FormatUnitLabelProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module QuantityFormat
3
+ */
4
+ /// <reference types="react" />
5
+ import { CommonProps } from "@itwin/core-react";
6
+ import { FormatProps } from "@itwin/core-quantity";
7
+ /** Properties of [[FormatUnitLabel]] component.
8
+ * @alpha
9
+ */
10
+ export interface FormatUnitLabelProps extends CommonProps {
11
+ formatProps: FormatProps;
12
+ onUnitLabelChange?: (format: FormatProps) => void;
13
+ }
14
+ /** Component to set the label separator definition in a Quantity Format and if it the label is to be displayed.
15
+ * @alpha
16
+ */
17
+ export declare function FormatUnitLabel(props: FormatUnitLabelProps): JSX.Element;
18
18
  //# sourceMappingURL=FormatUnitLabel.d.ts.map