@itwin/imodel-components-react 4.0.0-dev.10 → 4.0.0-dev.12

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 (362) hide show
  1. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js +77 -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.d.ts.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +108 -107
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  13. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +90 -90
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
  16. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  23. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +139 -137
  24. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  25. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +62 -63
  26. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  27. package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
  28. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  30. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  31. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
  32. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  33. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  34. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  35. package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
  36. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  37. package/lib/cjs/imodel-components-react/color/Swatch.scss +22 -23
  38. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  39. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  40. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  41. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  42. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
  43. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  44. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  45. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  46. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
  47. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  48. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  49. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  50. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
  51. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  53. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  54. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +268 -265
  55. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +106 -107
  57. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  58. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
  59. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  60. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  61. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  62. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
  63. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  64. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  65. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  66. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
  67. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  68. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  69. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  70. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  71. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +638 -634
  72. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -182
  74. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  75. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  76. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +653 -647
  77. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  78. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -134
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +63 -63
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +84 -83
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
  92. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  93. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  94. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
  95. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  96. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  97. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
  98. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  99. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  100. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
  101. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  102. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  103. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +145 -145
  104. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
  128. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  129. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  130. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
  131. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  132. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  133. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
  134. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  135. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  136. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
  137. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  138. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  139. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  140. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  141. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  142. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
  143. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  144. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  145. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  146. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  147. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +95 -91
  148. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  149. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +28 -31
  150. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  151. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
  152. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  153. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +105 -112
  154. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  155. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  156. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +428 -424
  157. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  158. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +359 -356
  159. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  160. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
  161. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  162. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  163. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  164. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  165. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  166. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +365 -358
  167. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  168. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +161 -164
  169. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
  170. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  171. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  172. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  173. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
  174. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  175. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  176. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  177. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  178. package/lib/cjs/imodel-components-react.d.ts +82 -82
  179. package/lib/cjs/imodel-components-react.js +101 -101
  180. package/lib/cjs/imodel-components-react.js.map +1 -1
  181. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  182. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  183. package/lib/esm/imodel-components-react/UiIModelComponents.js +73 -75
  184. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  185. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  186. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  187. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  188. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  189. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  190. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  191. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +83 -82
  192. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  193. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +90 -90
  194. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  195. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  196. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  197. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  198. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
  199. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  200. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  201. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  202. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  203. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +114 -112
  204. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  205. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +62 -63
  206. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  207. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  208. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  209. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  210. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  211. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  212. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  213. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  214. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  215. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  216. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  217. package/lib/esm/imodel-components-react/color/Swatch.scss +22 -23
  218. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  219. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  220. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  221. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  222. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  223. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  224. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  225. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  226. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  227. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  228. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  229. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  230. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  231. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  232. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  233. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  234. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +243 -240
  235. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  236. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +106 -107
  237. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  238. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  239. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  240. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  241. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  242. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
  243. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  244. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  245. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  246. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  247. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  248. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  249. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  250. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  251. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +610 -606
  252. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  253. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -182
  254. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  255. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  256. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +626 -620
  257. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  258. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -134
  259. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  260. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  261. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  262. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +63 -63
  263. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  264. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  265. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  266. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  267. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  268. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +61 -60
  269. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  270. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  271. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  272. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  273. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  274. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  275. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  276. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  277. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  278. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  279. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  280. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  281. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  282. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  283. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +122 -122
  284. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  285. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  286. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  287. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  288. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  289. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  290. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  291. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  292. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  293. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  294. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  295. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  296. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  297. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  298. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  299. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  300. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  301. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  302. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  303. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  304. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  305. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  306. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  307. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  308. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  309. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  310. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  311. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  312. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  313. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  314. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  315. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  316. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
  317. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  318. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  319. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  320. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  321. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  322. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  323. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  324. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  325. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  326. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  327. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +68 -64
  328. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  329. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +28 -31
  330. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  331. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  332. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  333. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +105 -112
  334. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  335. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  336. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +402 -398
  337. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  338. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +359 -356
  339. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  340. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  341. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  342. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  343. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  344. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  345. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  346. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +339 -332
  347. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  348. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +161 -164
  349. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
  350. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  351. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  352. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  353. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  354. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  355. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  356. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
  357. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  358. package/lib/esm/imodel-components-react.d.ts +82 -82
  359. package/lib/esm/imodel-components-react.js +87 -87
  360. package/lib/esm/imodel-components-react.js.map +1 -1
  361. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  362. package/package.json +22 -26
@@ -1,45 +1,45 @@
1
- /** @packageDocumentation
2
- * @module Inputs
3
- */
4
- import "./QuantityNumberInput.scss";
5
- import * as React from "react";
6
- import { QuantityTypeArg } from "@itwin/core-frontend";
7
- import { InputProps } from "@itwin/itwinui-react";
8
- /** Step function prototype for [[QuantityNumberInput]] component
9
- * @beta
10
- */
11
- export declare type StepFunctionProp = number | ((direction: string) => number | undefined);
12
- /** Properties for the [[QuantityNumberInput]] component
13
- * @beta
14
- */
15
- export interface QuantityNumberInputProps extends Omit<InputProps, "value" | "min" | "max" | "step" | "onFocus" | "onChange"> {
16
- /** Initial magnitude in 'persistence' units. See `getPersistenceUnitByQuantityType` in [QuantityFormatter]($core-frontend).
17
- * Set to `undefined` to show placeholder text */
18
- persistenceValue?: number;
19
- /** CSS class name for the QuantityNumberInput component container div */
20
- containerClassName?: string;
21
- /** number or function Number.MIN_SAFE_INTEGER */
22
- min?: number;
23
- /** number or function defaults to Number.MAX_SAFE_INTEGER */
24
- max?: number;
25
- /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */
26
- step?: StepFunctionProp;
27
- /** Set to true to "snap" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */
28
- snap?: boolean;
29
- /** Function to call when the quantity value is changed. The value returned will be in 'persistence' units. */
30
- onChange?: (value: number) => void;
31
- /** if true up/down buttons are shown larger and side by side */
32
- showTouchButtons?: boolean;
33
- /** Provides ability to return reference to HTMLInputElement */
34
- ref?: React.Ref<HTMLInputElement>;
35
- /** Type of quantity being input. */
36
- quantityType: QuantityTypeArg;
37
- }
38
- /** The QuantityNumberInput component accepts input for quantity values. The quantity value is shown as a single numeric value and the quantity's
39
- * "display" unit is shown next to the input control. The "display" unit is determined by the active unit system as defined by the [QuantityFormatter]($frontend).
40
- * The control also display buttons to increment and decrement the "displayed" value. The value reported by via the onChange function is in "persistence"
41
- * units that can be stored in the iModel.
42
- * @beta
43
- */
44
- export declare const QuantityNumberInput: (props: QuantityNumberInputProps) => JSX.Element | null;
1
+ /** @packageDocumentation
2
+ * @module Inputs
3
+ */
4
+ import "./QuantityNumberInput.scss";
5
+ import * as React from "react";
6
+ import { QuantityTypeArg } from "@itwin/core-frontend";
7
+ import { InputProps } from "@itwin/itwinui-react";
8
+ /** Step function prototype for [[QuantityNumberInput]] component
9
+ * @beta
10
+ */
11
+ export declare type StepFunctionProp = number | ((direction: string) => number | undefined);
12
+ /** Properties for the [[QuantityNumberInput]] component
13
+ * @beta
14
+ */
15
+ export interface QuantityNumberInputProps extends Omit<InputProps, "value" | "min" | "max" | "step" | "onFocus" | "onChange"> {
16
+ /** Initial magnitude in 'persistence' units. See `getPersistenceUnitByQuantityType` in [QuantityFormatter]($core-frontend).
17
+ * Set to `undefined` to show placeholder text */
18
+ persistenceValue?: number;
19
+ /** CSS class name for the QuantityNumberInput component container div */
20
+ containerClassName?: string;
21
+ /** number or function Number.MIN_SAFE_INTEGER */
22
+ min?: number;
23
+ /** number or function defaults to Number.MAX_SAFE_INTEGER */
24
+ max?: number;
25
+ /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */
26
+ step?: StepFunctionProp;
27
+ /** Set to true to "snap" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */
28
+ snap?: boolean;
29
+ /** Function to call when the quantity value is changed. The value returned will be in 'persistence' units. */
30
+ onChange?: (value: number) => void;
31
+ /** if true up/down buttons are shown larger and side by side */
32
+ showTouchButtons?: boolean;
33
+ /** Provides ability to return reference to HTMLInputElement */
34
+ ref?: React.Ref<HTMLInputElement>;
35
+ /** Type of quantity being input. */
36
+ quantityType: QuantityTypeArg;
37
+ }
38
+ /** The QuantityNumberInput component accepts input for quantity values. The quantity value is shown as a single numeric value and the quantity's
39
+ * "display" unit is shown next to the input control. The "display" unit is determined by the active unit system as defined by the [QuantityFormatter]($frontend).
40
+ * The control also display buttons to increment and decrement the "displayed" value. The value reported by via the onChange function is in "persistence"
41
+ * units that can be stored in the iModel.
42
+ * @beta
43
+ */
44
+ export declare const QuantityNumberInput: (props: QuantityNumberInputProps) => JSX.Element | null;
45
45
  //# sourceMappingURL=QuantityNumberInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuantityNumberInput.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/QuantityNumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAyC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAS,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3H;qDACiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,0HAA0H;IAC1H,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,oCAAoC;IACpC,YAAY,EAAE,eAAe,CAAC;CAC/B;AA8QD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO,GAAG,IAAoC,CAAC"}
1
+ {"version":3,"file":"QuantityNumberInput.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/QuantityNumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAyC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAS,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3H;qDACiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,0HAA0H;IAC1H,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,oCAAoC;IACpC,YAAY,EAAE,eAAe,CAAC;CAC/B;AAkRD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO,GAAG,IAAoC,CAAC"}
@@ -1,241 +1,244 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Inputs
7
- */
8
- import "./QuantityNumberInput.scss";
9
- import classnames from "classnames";
10
- import * as React from "react";
11
- import { WebFontIcon } from "@itwin/core-react";
12
- import { SpecialKey } from "@itwin/appui-abstract";
13
- import { IModelApp } from "@itwin/core-frontend";
14
- import { DecimalPrecision, FormatterSpec, FormatTraits, FormatType, Parser } from "@itwin/core-quantity";
15
- import { Input } from "@itwin/itwinui-react";
16
- /** adjust formatter spec to show only primary unit without a label. */
17
- function adjustFormatterSpec(formatterSpec) {
18
- if (undefined === formatterSpec)
19
- return formatterSpec;
20
- const singleUnitConversion = [];
21
- singleUnitConversion.push(formatterSpec.unitConversions[0]);
22
- const newFormat = formatterSpec.format.clone({
23
- showOnlyPrimaryUnit: true,
24
- traits: formatterSpec.format.formatTraits & ~FormatTraits.ShowUnitLabel,
25
- type: FormatType.Decimal,
26
- precision: FormatType.Decimal !== formatterSpec.format.type ? DecimalPrecision.Four : formatterSpec.format.precision,
27
- });
28
- return new FormatterSpec("single-value", newFormat, singleUnitConversion, formatterSpec.persistenceUnit);
29
- }
30
- function convertValueFromDisplayToPersistence(value, unitConversions, unit) {
31
- // istanbul ignore next
32
- if (!unitConversions || 0 === unitConversions.length)
33
- return value;
34
- const unitConversion = unitConversions.find((spec) => spec.name === unit.name);
35
- // istanbul ignore next
36
- if (!unitConversion)
37
- return value;
38
- const convertedValue = (value * unitConversion.conversion.factor) + unitConversion.conversion.offset;
39
- return convertedValue;
40
- }
41
- function getUnitLabel(parserSpec) {
42
- if (undefined === parserSpec)
43
- return "";
44
- const format = parserSpec.format;
45
- // istanbul ignore else
46
- if (!format.units || !format.units[0])
47
- return parserSpec.outUnit.label;
48
- const [unit, label] = format.units[0];
49
- // istanbul ignore next
50
- return label !== null && label !== void 0 ? label : unit.label;
51
- }
52
- const ForwardRefQuantityNumberInput = React.forwardRef(function ForwardRefQuantityNumberInput(props, ref) {
53
- const { containerClassName, persistenceValue, min, max, onChange, onBlur, onKeyDown, step, snap, showTouchButtons, quantityType, ...otherProps } = props;
54
- const rawValueRef = React.useRef(persistenceValue);
55
- const [formatterSpec, setFormatterSpec] = React.useState(() => adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
56
- const [parserSpec, setParserSpec] = React.useState(() => IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
57
- const formatValue = React.useCallback((value) => {
58
- if (undefined === value)
59
- return "";
60
- // istanbul ignore else
61
- if (formatterSpec) {
62
- return formatterSpec.applyFormatting(value);
63
- }
64
- // istanbul ignore next
65
- return value.toFixed(2);
66
- }, [formatterSpec]);
67
- const lastFormattedValueRef = React.useRef(formatValue(persistenceValue));
68
- const [formattedValue, setFormattedValue] = React.useState(() => lastFormattedValueRef.current);
69
- React.useEffect(() => {
70
- const handleUnitSystemChanged = (() => {
71
- setFormatterSpec(adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
72
- setParserSpec(IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
73
- });
74
- IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(handleUnitSystemChanged);
75
- return () => {
76
- IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.removeListener(handleUnitSystemChanged);
77
- };
78
- }, [quantityType]);
79
- React.useEffect(() => {
80
- const handleUnitSystemChanged = ((args) => {
81
- const quantityKey = IModelApp.quantityFormatter.getQuantityTypeKey(quantityType);
82
- // istanbul ignore else
83
- if (args.quantityType === quantityKey) {
84
- setFormatterSpec(adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
85
- setParserSpec(IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
86
- }
87
- });
88
- IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(handleUnitSystemChanged);
89
- return () => {
90
- IModelApp.quantityFormatter.onQuantityFormatsChanged.removeListener(handleUnitSystemChanged);
91
- };
92
- }, [quantityType]);
93
- const unitLabel = getUnitLabel(parserSpec);
94
- // See if new initialValue props have changed since component mounted
95
- React.useEffect(() => {
96
- rawValueRef.current = persistenceValue;
97
- const currentFormattedValue = formatValue(rawValueRef.current);
98
- setFormattedValue(currentFormattedValue);
99
- }, [formatValue, persistenceValue]);
100
- // this is the unprocessed input from user, it is not processed until blur or enter key press
101
- const handleDisplayValueChange = React.useCallback((event) => {
102
- setFormattedValue(event.currentTarget.value);
103
- }, []);
104
- const updateValue = React.useCallback((newValue) => {
105
- let persistedValue = newValue;
106
- // istanbul ignore else
107
- if (parserSpec) {
108
- // convert value from display unit to persistence unit
109
- const [unit] = parserSpec.format.units ? parserSpec.format.units[0] : /* istanbul ignore next */ [parserSpec.outUnit];
110
- persistedValue = convertValueFromDisplayToPersistence(newValue, parserSpec.unitConversions, unit);
111
- rawValueRef.current = persistedValue;
112
- }
113
- const newFormattedVal = formatValue(persistedValue);
114
- onChange && onChange(persistedValue);
115
- setFormattedValue(newFormattedVal);
116
- }, [formatValue, onChange, parserSpec]);
117
- /**
118
- * Used internally to parse the argument x to it's numeric representation.
119
- * If the argument cannot be converted to finite number returns 0; If a
120
- * "precision" prop is specified uses it round the number with that
121
- * precision (no fixed precision here because the return value is float, not
122
- * string).
123
- */
124
- const parseInternal = React.useCallback((x) => {
125
- if (!x)
126
- return 0;
127
- let n = parseFloat(x);
128
- // istanbul ignore next
129
- if (isNaN(n) || !isFinite(n)) {
130
- n = 0;
131
- }
132
- const localPrecision = 6; // TODO get a reasonable value from format
133
- const q = Math.pow(10, localPrecision);
134
- const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;
135
- const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;
136
- n = Math.min(Math.max(n, localMin), localMax);
137
- n = Math.round(n * q) / q;
138
- return n;
139
- }, [min, max]);
140
- const updateValueFromString = React.useCallback((strValue) => {
141
- // istanbul ignore else
142
- if (parserSpec) {
143
- const parseResult = IModelApp.quantityFormatter.parseToQuantityValue(strValue, parserSpec);
144
- // at this point we should have a string value in persistence units without a label
145
- if (Parser.isParsedQuantity(parseResult)) {
146
- const persistedValue = parseResult.value; // in persistence units
147
- // set strValue and let it go through parseInternal which will ensure min/max limits are observed
148
- strValue = formatValue(persistedValue);
149
- }
150
- else {
151
- // istanbul ignore else
152
- if (rawValueRef.current) { // restore last known good value
153
- const lastKnownFormattedVal = formatValue(rawValueRef.current);
154
- setFormattedValue(lastKnownFormattedVal);
155
- return;
156
- }
157
- }
158
- }
159
- const newValue = parseInternal(strValue);
160
- // istanbul ignore else
161
- if (undefined !== newValue)
162
- updateValue(newValue);
163
- }, [formatValue, parseInternal, parserSpec, updateValue]);
164
- const handleBlur = React.useCallback((event) => {
165
- const newVal = parseInternal(event.target.value);
166
- onBlur && onBlur(event);
167
- updateValue(newVal);
168
- }, [parseInternal, updateValue, onBlur]);
169
- const getIncrementValue = React.useCallback((increment) => {
170
- if (typeof step === "function") {
171
- const stepVal = step(increment ? "up" : "down");
172
- return stepVal ? stepVal : 1;
173
- }
174
- return !step ? 1 : step;
175
- }, [step]);
176
- /**
177
- * The internal method that actually sets the new value on the input
178
- */
179
- const applyStep = React.useCallback((increment) => {
180
- const incrementValue = getIncrementValue(increment);
181
- let num = parseInternal(formattedValue) + (increment ? incrementValue : -incrementValue);
182
- if (snap) {
183
- num = Math.round(num / incrementValue) * incrementValue;
184
- }
185
- const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;
186
- const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;
187
- num = Math.min(Math.max(num, localMin), localMax);
188
- updateValue(num);
189
- }, [formattedValue, getIncrementValue, max, min, parseInternal, snap, updateValue]);
190
- const handleKeyDown = React.useCallback((event) => {
191
- // istanbul ignore else
192
- if (event.key === SpecialKey.Enter) {
193
- updateValueFromString(event.currentTarget.value);
194
- event.preventDefault();
195
- }
196
- else if (event.key === SpecialKey.Escape) {
197
- setFormattedValue(formatValue(rawValueRef.current));
198
- event.preventDefault();
199
- }
200
- else if (event.key === SpecialKey.ArrowDown) {
201
- applyStep(false);
202
- event.preventDefault();
203
- }
204
- else if (event.key === SpecialKey.ArrowUp) {
205
- applyStep(true);
206
- event.preventDefault();
207
- }
208
- onKeyDown && onKeyDown(event);
209
- }, [onKeyDown, updateValueFromString, formatValue, applyStep]);
210
- const handleDownClick = React.useCallback((event) => {
211
- applyStep(false);
212
- event.preventDefault();
213
- }, [applyStep]);
214
- const handleUpClick = React.useCallback((event) => {
215
- applyStep(true);
216
- event.preventDefault();
217
- }, [applyStep]);
218
- // istanbul ignore next
219
- const handleFocus = React.useCallback((event) => {
220
- event.currentTarget.select();
221
- }, []);
222
- const isDisabled = !!otherProps.disabled;
223
- const containerClasses = classnames("component-quantity-number-input-container", containerClassName, showTouchButtons && "component-number-buttons-for-touch", isDisabled && "component-quantity-number-input-disabled");
224
- return (React.createElement("div", { className: containerClasses },
225
- React.createElement("div", { className: "component-quantity-number-input-value-and-buttons-container" },
226
- React.createElement(Input, { ref: ref, value: formattedValue, onChange: handleDisplayValueChange, onKeyDown: handleKeyDown, onBlur: handleBlur, onFocus: handleFocus, size: "small", ...otherProps }),
227
- React.createElement("div", { className: classnames("component-quantity-number-input-buttons-container", showTouchButtons && "component-number-buttons-for-touch") },
228
- React.createElement("div", { className: "component-quantity-number-input-button component-quantity-number-input-button-up", tabIndex: -1, onClick: handleUpClick },
229
- React.createElement(WebFontIcon, { iconName: "icon-caret-up" })),
230
- React.createElement("div", { className: "component-quantity-number-input-button component-quantity-number-input-button-down", tabIndex: -1, onClick: handleDownClick },
231
- React.createElement(WebFontIcon, { iconName: "icon-caret-down" })))),
232
- React.createElement("span", { className: "component-quantity-number-input-suffix" }, unitLabel)));
233
- });
234
- /** The QuantityNumberInput component accepts input for quantity values. The quantity value is shown as a single numeric value and the quantity's
235
- * "display" unit is shown next to the input control. The "display" unit is determined by the active unit system as defined by the [QuantityFormatter]($frontend).
236
- * The control also display buttons to increment and decrement the "displayed" value. The value reported by via the onChange function is in "persistence"
237
- * units that can be stored in the iModel.
238
- * @beta
239
- */
240
- export const QuantityNumberInput = ForwardRefQuantityNumberInput;
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Inputs
7
+ */
8
+ import "./QuantityNumberInput.scss";
9
+ import classnames from "classnames";
10
+ import * as React from "react";
11
+ import { Icon } from "@itwin/core-react";
12
+ import { SpecialKey } from "@itwin/appui-abstract";
13
+ import { IModelApp } from "@itwin/core-frontend";
14
+ import { DecimalPrecision, FormatterSpec, FormatTraits, FormatType, Parser } from "@itwin/core-quantity";
15
+ import { Input } from "@itwin/itwinui-react";
16
+ import { SvgCaretDown, SvgCaretDownSmall, SvgCaretUp, SvgCaretUpSmall } from "@itwin/itwinui-icons-react";
17
+ /** adjust formatter spec to show only primary unit without a label. */
18
+ function adjustFormatterSpec(formatterSpec) {
19
+ if (undefined === formatterSpec)
20
+ return formatterSpec;
21
+ const singleUnitConversion = [];
22
+ singleUnitConversion.push(formatterSpec.unitConversions[0]);
23
+ const newFormat = formatterSpec.format.clone({
24
+ showOnlyPrimaryUnit: true,
25
+ traits: formatterSpec.format.formatTraits & ~FormatTraits.ShowUnitLabel,
26
+ type: FormatType.Decimal,
27
+ precision: FormatType.Decimal !== formatterSpec.format.type ? DecimalPrecision.Four : formatterSpec.format.precision,
28
+ });
29
+ return new FormatterSpec("single-value", newFormat, singleUnitConversion, formatterSpec.persistenceUnit);
30
+ }
31
+ function convertValueFromDisplayToPersistence(value, unitConversions, unit) {
32
+ // istanbul ignore next
33
+ if (!unitConversions || 0 === unitConversions.length)
34
+ return value;
35
+ const unitConversion = unitConversions.find((spec) => spec.name === unit.name);
36
+ // istanbul ignore next
37
+ if (!unitConversion)
38
+ return value;
39
+ const convertedValue = (value * unitConversion.conversion.factor) + unitConversion.conversion.offset;
40
+ return convertedValue;
41
+ }
42
+ function getUnitLabel(parserSpec) {
43
+ if (undefined === parserSpec)
44
+ return "";
45
+ const format = parserSpec.format;
46
+ // istanbul ignore else
47
+ if (!format.units || !format.units[0])
48
+ return parserSpec.outUnit.label;
49
+ const [unit, label] = format.units[0];
50
+ // istanbul ignore next
51
+ return label !== null && label !== void 0 ? label : unit.label;
52
+ }
53
+ const ForwardRefQuantityNumberInput = React.forwardRef(function ForwardRefQuantityNumberInput(props, ref) {
54
+ const { containerClassName, persistenceValue, min, max, onChange, onBlur, onKeyDown, step, snap, showTouchButtons, quantityType, ...otherProps } = props;
55
+ const rawValueRef = React.useRef(persistenceValue);
56
+ const [formatterSpec, setFormatterSpec] = React.useState(() => adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
57
+ const [parserSpec, setParserSpec] = React.useState(() => IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
58
+ const formatValue = React.useCallback((value) => {
59
+ if (undefined === value)
60
+ return "";
61
+ // istanbul ignore else
62
+ if (formatterSpec) {
63
+ return formatterSpec.applyFormatting(value);
64
+ }
65
+ // istanbul ignore next
66
+ return value.toFixed(2);
67
+ }, [formatterSpec]);
68
+ const lastFormattedValueRef = React.useRef(formatValue(persistenceValue));
69
+ const [formattedValue, setFormattedValue] = React.useState(() => lastFormattedValueRef.current);
70
+ React.useEffect(() => {
71
+ const handleUnitSystemChanged = (() => {
72
+ setFormatterSpec(adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
73
+ setParserSpec(IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
74
+ });
75
+ IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(handleUnitSystemChanged);
76
+ return () => {
77
+ IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.removeListener(handleUnitSystemChanged);
78
+ };
79
+ }, [quantityType]);
80
+ React.useEffect(() => {
81
+ const handleUnitSystemChanged = ((args) => {
82
+ const quantityKey = IModelApp.quantityFormatter.getQuantityTypeKey(quantityType);
83
+ // istanbul ignore else
84
+ if (args.quantityType === quantityKey) {
85
+ setFormatterSpec(adjustFormatterSpec(IModelApp.quantityFormatter.findFormatterSpecByQuantityType(quantityType)));
86
+ setParserSpec(IModelApp.quantityFormatter.findParserSpecByQuantityType(quantityType));
87
+ }
88
+ });
89
+ IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(handleUnitSystemChanged);
90
+ return () => {
91
+ IModelApp.quantityFormatter.onQuantityFormatsChanged.removeListener(handleUnitSystemChanged);
92
+ };
93
+ }, [quantityType]);
94
+ const unitLabel = getUnitLabel(parserSpec);
95
+ // See if new initialValue props have changed since component mounted
96
+ React.useEffect(() => {
97
+ rawValueRef.current = persistenceValue;
98
+ const currentFormattedValue = formatValue(rawValueRef.current);
99
+ setFormattedValue(currentFormattedValue);
100
+ }, [formatValue, persistenceValue]);
101
+ // this is the unprocessed input from user, it is not processed until blur or enter key press
102
+ const handleDisplayValueChange = React.useCallback((event) => {
103
+ setFormattedValue(event.currentTarget.value);
104
+ }, []);
105
+ const updateValue = React.useCallback((newValue) => {
106
+ let persistedValue = newValue;
107
+ // istanbul ignore else
108
+ if (parserSpec) {
109
+ // convert value from display unit to persistence unit
110
+ const [unit] = parserSpec.format.units ? parserSpec.format.units[0] : /* istanbul ignore next */ [parserSpec.outUnit];
111
+ persistedValue = convertValueFromDisplayToPersistence(newValue, parserSpec.unitConversions, unit);
112
+ rawValueRef.current = persistedValue;
113
+ }
114
+ const newFormattedVal = formatValue(persistedValue);
115
+ onChange && onChange(persistedValue);
116
+ setFormattedValue(newFormattedVal);
117
+ }, [formatValue, onChange, parserSpec]);
118
+ /**
119
+ * Used internally to parse the argument x to it's numeric representation.
120
+ * If the argument cannot be converted to finite number returns 0; If a
121
+ * "precision" prop is specified uses it round the number with that
122
+ * precision (no fixed precision here because the return value is float, not
123
+ * string).
124
+ */
125
+ const parseInternal = React.useCallback((x) => {
126
+ if (!x)
127
+ return 0;
128
+ let n = parseFloat(x);
129
+ // istanbul ignore next
130
+ if (isNaN(n) || !isFinite(n)) {
131
+ n = 0;
132
+ }
133
+ const localPrecision = 6; // TODO get a reasonable value from format
134
+ const q = Math.pow(10, localPrecision);
135
+ const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;
136
+ const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;
137
+ n = Math.min(Math.max(n, localMin), localMax);
138
+ n = Math.round(n * q) / q;
139
+ return n;
140
+ }, [min, max]);
141
+ const updateValueFromString = React.useCallback((strValue) => {
142
+ // istanbul ignore else
143
+ if (parserSpec) {
144
+ const parseResult = IModelApp.quantityFormatter.parseToQuantityValue(strValue, parserSpec);
145
+ // at this point we should have a string value in persistence units without a label
146
+ if (Parser.isParsedQuantity(parseResult)) {
147
+ const persistedValue = parseResult.value; // in persistence units
148
+ // set strValue and let it go through parseInternal which will ensure min/max limits are observed
149
+ strValue = formatValue(persistedValue);
150
+ }
151
+ else {
152
+ // istanbul ignore else
153
+ if (rawValueRef.current) { // restore last known good value
154
+ const lastKnownFormattedVal = formatValue(rawValueRef.current);
155
+ setFormattedValue(lastKnownFormattedVal);
156
+ return;
157
+ }
158
+ }
159
+ }
160
+ const newValue = parseInternal(strValue);
161
+ // istanbul ignore else
162
+ if (undefined !== newValue)
163
+ updateValue(newValue);
164
+ }, [formatValue, parseInternal, parserSpec, updateValue]);
165
+ const handleBlur = React.useCallback((event) => {
166
+ const newVal = parseInternal(event.target.value);
167
+ onBlur && onBlur(event);
168
+ updateValue(newVal);
169
+ }, [parseInternal, updateValue, onBlur]);
170
+ const getIncrementValue = React.useCallback((increment) => {
171
+ if (typeof step === "function") {
172
+ const stepVal = step(increment ? "up" : "down");
173
+ return stepVal ? stepVal : 1;
174
+ }
175
+ return !step ? 1 : step;
176
+ }, [step]);
177
+ /**
178
+ * The internal method that actually sets the new value on the input
179
+ */
180
+ const applyStep = React.useCallback((increment) => {
181
+ const incrementValue = getIncrementValue(increment);
182
+ let num = parseInternal(formattedValue) + (increment ? incrementValue : -incrementValue);
183
+ if (snap) {
184
+ num = Math.round(num / incrementValue) * incrementValue;
185
+ }
186
+ const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;
187
+ const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;
188
+ num = Math.min(Math.max(num, localMin), localMax);
189
+ updateValue(num);
190
+ }, [formattedValue, getIncrementValue, max, min, parseInternal, snap, updateValue]);
191
+ const handleKeyDown = React.useCallback((event) => {
192
+ // istanbul ignore else
193
+ if (event.key === SpecialKey.Enter) {
194
+ updateValueFromString(event.currentTarget.value);
195
+ event.preventDefault();
196
+ }
197
+ else if (event.key === SpecialKey.Escape) {
198
+ setFormattedValue(formatValue(rawValueRef.current));
199
+ event.preventDefault();
200
+ }
201
+ else if (event.key === SpecialKey.ArrowDown) {
202
+ applyStep(false);
203
+ event.preventDefault();
204
+ }
205
+ else if (event.key === SpecialKey.ArrowUp) {
206
+ applyStep(true);
207
+ event.preventDefault();
208
+ }
209
+ onKeyDown && onKeyDown(event);
210
+ }, [onKeyDown, updateValueFromString, formatValue, applyStep]);
211
+ const handleDownClick = React.useCallback((event) => {
212
+ applyStep(false);
213
+ event.preventDefault();
214
+ }, [applyStep]);
215
+ const handleUpClick = React.useCallback((event) => {
216
+ applyStep(true);
217
+ event.preventDefault();
218
+ }, [applyStep]);
219
+ // istanbul ignore next
220
+ const handleFocus = React.useCallback((event) => {
221
+ event.currentTarget.select();
222
+ }, []);
223
+ const isDisabled = !!otherProps.disabled;
224
+ const containerClasses = classnames("component-quantity-number-input-container", containerClassName, showTouchButtons && "component-number-buttons-for-touch", isDisabled && "component-quantity-number-input-disabled");
225
+ const caretUp = showTouchButtons ? React.createElement(SvgCaretUp, null) : React.createElement(SvgCaretUpSmall, null);
226
+ const caretDown = showTouchButtons ? React.createElement(SvgCaretDown, null) : React.createElement(SvgCaretDownSmall, null);
227
+ return (React.createElement("div", { className: containerClasses },
228
+ React.createElement("div", { className: "component-quantity-number-input-value-and-buttons-container" },
229
+ React.createElement(Input, { ref: ref, value: formattedValue, onChange: handleDisplayValueChange, onKeyDown: handleKeyDown, onBlur: handleBlur, onFocus: handleFocus, size: "small", ...otherProps }),
230
+ React.createElement("div", { className: classnames("component-quantity-number-input-buttons-container", showTouchButtons && "component-number-buttons-for-touch") },
231
+ React.createElement("div", { className: "component-quantity-number-input-button component-quantity-number-input-button-up", tabIndex: -1, onClick: handleUpClick },
232
+ React.createElement(Icon, { iconSpec: caretUp })),
233
+ React.createElement("div", { className: "component-quantity-number-input-button component-quantity-number-input-button-down", tabIndex: -1, onClick: handleDownClick },
234
+ React.createElement(Icon, { iconSpec: caretDown })))),
235
+ React.createElement("span", { className: "component-quantity-number-input-suffix" }, unitLabel)));
236
+ });
237
+ /** The QuantityNumberInput component accepts input for quantity values. The quantity value is shown as a single numeric value and the quantity's
238
+ * "display" unit is shown next to the input control. The "display" unit is determined by the active unit system as defined by the [QuantityFormatter]($frontend).
239
+ * The control also display buttons to increment and decrement the "displayed" value. The value reported by via the onChange function is in "persistence"
240
+ * units that can be stored in the iModel.
241
+ * @beta
242
+ */
243
+ export const QuantityNumberInput = ForwardRefQuantityNumberInput;
241
244
  //# sourceMappingURL=QuantityNumberInput.js.map