@itwin/imodel-components-react 4.10.0 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +1 -1
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js +6 -6
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -1
  6. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +4 -2
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  9. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +5 -2
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  13. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +1 -1
  16. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +5 -5
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  21. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +2 -0
  22. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -1
  23. package/lib/cjs/imodel-components-react/color/HueSlider.js +4 -3
  24. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  25. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +2 -0
  26. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
  27. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +4 -3
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +2 -0
  30. package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -1
  31. package/lib/cjs/imodel-components-react/color/Swatch.js +2 -0
  32. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  33. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +2 -1
  34. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
  36. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +5 -4
  37. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  38. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
  39. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  40. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
  41. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  43. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +1 -2
  44. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  46. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  47. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +5 -4
  48. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  49. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  50. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +6 -7
  51. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
  53. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +10 -10
  54. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  55. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
  56. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -14
  57. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  58. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
  59. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +13 -9
  60. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  61. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
  62. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +21 -28
  63. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  64. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
  65. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +18 -17
  66. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  67. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
  68. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +7 -6
  69. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  70. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
  71. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +14 -13
  72. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
  74. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +7 -6
  75. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  76. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
  77. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +9 -8
  78. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  79. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
  80. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +23 -22
  81. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  82. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +7 -6
  84. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  85. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +15 -14
  87. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  88. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -6
  90. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  91. package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts +3 -15
  92. package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts.map +1 -1
  93. package/lib/cjs/imodel-components-react/timeline/PlayButton.js +12 -42
  94. package/lib/cjs/imodel-components-react/timeline/PlayButton.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +1 -1
  96. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  97. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
  98. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  99. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +111 -202
  100. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  101. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +25 -333
  102. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +5 -1
  103. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  104. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +39 -30
  105. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  106. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +2 -2
  107. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  108. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  109. package/lib/cjs/imodel-components-react/useTranslation.d.ts +10 -0
  110. package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +1 -0
  111. package/lib/cjs/imodel-components-react/useTranslation.js +20 -0
  112. package/lib/cjs/imodel-components-react/useTranslation.js.map +1 -0
  113. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  114. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +13 -8
  115. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  116. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +1 -1
  117. package/lib/esm/imodel-components-react/UiIModelComponents.js +6 -6
  118. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  119. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -1
  120. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
  121. package/lib/esm/imodel-components-react/color/AlphaSlider.js +4 -2
  122. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  123. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
  124. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  125. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +5 -2
  126. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  127. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
  128. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
  129. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +1 -1
  130. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  131. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
  132. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  133. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +5 -5
  134. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  135. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +2 -0
  136. package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -1
  137. package/lib/esm/imodel-components-react/color/HueSlider.js +4 -3
  138. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  139. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +2 -0
  140. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
  141. package/lib/esm/imodel-components-react/color/SaturationPicker.js +4 -3
  142. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  143. package/lib/esm/imodel-components-react/color/Swatch.d.ts +2 -0
  144. package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -1
  145. package/lib/esm/imodel-components-react/color/Swatch.js +2 -0
  146. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  147. package/lib/esm/imodel-components-react/editors/ColorEditor.js +2 -1
  148. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  149. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
  150. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +5 -4
  151. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  152. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
  153. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  154. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
  155. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  156. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  157. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +1 -2
  158. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  159. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  160. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  161. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +5 -4
  162. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  163. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  164. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +6 -7
  165. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  166. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
  167. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +10 -10
  168. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  169. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
  170. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -14
  171. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  172. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
  173. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +13 -9
  174. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  175. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
  176. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +21 -28
  177. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  178. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
  179. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +18 -17
  180. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  181. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
  182. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +7 -6
  183. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  184. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
  185. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +14 -13
  186. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  187. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
  188. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +7 -6
  189. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  190. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
  191. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +9 -8
  192. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  193. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
  194. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +23 -22
  195. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  196. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
  197. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +7 -6
  198. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  199. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
  200. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +15 -14
  201. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  202. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
  203. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -6
  204. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  205. package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts +3 -15
  206. package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts.map +1 -1
  207. package/lib/esm/imodel-components-react/timeline/PlayButton.js +12 -39
  208. package/lib/esm/imodel-components-react/timeline/PlayButton.js.map +1 -1
  209. package/lib/esm/imodel-components-react/timeline/Scrubber.js +1 -1
  210. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  211. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
  212. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  213. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +112 -203
  214. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  215. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +25 -333
  216. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +5 -1
  217. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  218. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +40 -31
  219. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  220. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +2 -2
  221. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  222. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  223. package/lib/esm/imodel-components-react/useTranslation.d.ts +10 -0
  224. package/lib/esm/imodel-components-react/useTranslation.d.ts.map +1 -0
  225. package/lib/esm/imodel-components-react/useTranslation.js +16 -0
  226. package/lib/esm/imodel-components-react/useTranslation.js.map +1 -0
  227. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  228. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +13 -8
  229. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  230. package/lib/public/locales/en/UiIModelComponents.json +14 -3
  231. package/package.json +10 -10
  232. package/lib/cjs/imodel-components-react/timeline/PlayButton.scss +0 -28
  233. package/lib/esm/imodel-components-react/timeline/PlayButton.scss +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"DrawingNavigationAid.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/navigationaids/DrawingNavigationAid.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAqC;AACrC,4DAAoC;AACpC,6CAA+B;AAC/B,oDAAsC;AACtC,6CAAkC;AAClC,wDAQ8B;AAO9B,wDAAiE;AAEjE,kDAAyC;AACzC,8DAA2D;AAE3D,iFAA8E;AAC9E,oEAKoC;AAEpC,gDAAgD;AAChD,0DAA0D;AAE1D;;;GAGG;AACH,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;AACvB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AA6DD;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,KAAK,CAAC,SAG/C;IAiBC,YAAY,KAAgC;QAC1C,KAAK,CAAC,KAAK,CA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,WAAW,CAAC;YACrD,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC1C;IACH,CAAC;CACF;AA/GD,0DA+GC","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 NavigationAids\n */\n\nimport \"./DrawingNavigationAid.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Key } from \"ts-key-enum\";\nimport {\n Constant,\n Geometry,\n Matrix3d,\n Point2d,\n Point3d,\n Point4d,\n Vector3d,\n} from \"@itwin/core-geometry\";\nimport type {\n IModelConnection,\n ViewManager,\n Viewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport { IModelApp, ScreenViewport } from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport type { ViewRotationChangeEventArgs } from \"../viewport/ViewportComponentEvents\";\nimport { ViewportComponentEvents } from \"../viewport/ViewportComponentEvents\";\nimport {\n SvgAdd,\n SvgRemove,\n SvgRotateLeft,\n SvgSortUp,\n} from \"@itwin/itwinui-icons-react\";\n\n// cSpell:ignore Quaternion Quaternions unrotate\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n\n/**\n * Enum for mode that minimap is currently in\n * @internal\n */\nexport enum MapMode {\n Opened = \"map-opened\",\n Closed = \"map-closed\",\n}\n\n/** Properties for the [[DrawingNavigationAid]] component\n * @public\n */\nexport interface DrawingNavigationAidProps extends CommonProps {\n iModelConnection: IModelConnection;\n viewport?: Viewport;\n\n // used only in testing\n\n /** @internal */\n animationTime?: number;\n /** @internal */\n openSize?: Vector3d;\n /** @internal */\n closeSize?: Vector3d;\n /** @internal */\n initialMapMode?: MapMode;\n /** @internal */\n onAnimationEnd?: () => void;\n /** @internal */\n initialRotateMinimapWithView?: boolean;\n /** @internal */\n initialView?: ViewState;\n /** @internal */\n viewManagerOverride?: ViewManager;\n /** @internal */\n screenViewportOverride?: typeof ScreenViewport;\n}\n\n/** @internal */\ninterface DrawingNavigationAidState {\n startOrigin: Point3d;\n origin: Point3d;\n extents: Vector3d;\n startRotation: Matrix3d;\n rotation: Matrix3d;\n\n startMapOrigin: Point3d;\n mapOrigin: Point3d;\n startMapExtents: Vector3d;\n mapExtents: Vector3d;\n\n mouseStart: Point2d;\n panningDirection: Vector3d;\n startDrawingZoom: number;\n drawingZoom: number;\n\n mode: MapMode;\n animation: number;\n\n isMoving: boolean;\n isPanning: boolean;\n\n viewId: string;\n view: ViewState | undefined;\n\n rotateMinimapWithView: boolean;\n}\n\n/**\n * A Drawing Navigation Aid.\n * @public\n */\nexport class DrawingNavigationAid extends React.Component<\n DrawingNavigationAidProps,\n DrawingNavigationAidState\n> {\n private _rootElement = React.createRef<HTMLDivElement>();\n private _viewContainerElement = React.createRef<HTMLDivElement>();\n private _viewElement = React.createRef<HTMLDivElement>();\n private _rootOffset: DOMRect = DOMRect.fromRect({\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n });\n private _viewport: Viewport | undefined;\n private _animationFrame: any;\n private _mounted: boolean = false;\n\n /** @internal */\n public override readonly state: Readonly<DrawingNavigationAidState>;\n\n constructor(props: DrawingNavigationAidProps) {\n super(props);\n const mode = props.initialMapMode || MapMode.Closed;\n const mapExtents =\n mode === MapMode.Closed\n ? this._getClosedMapSize()\n : this._getOpenedMapSize();\n const startMapExtents = mapExtents;\n\n this.state = {\n startOrigin: Point3d.createZero(),\n origin: Point3d.createZero(),\n extents: Vector3d.create(1, 1, 1),\n startRotation: Matrix3d.createIdentity(),\n rotation: Matrix3d.createIdentity(),\n\n startMapOrigin: Point3d.createZero(),\n mapOrigin: Point3d.createZero(),\n startMapExtents,\n mapExtents,\n\n mouseStart: Point2d.createZero(),\n panningDirection: Vector3d.createZero(),\n startDrawingZoom: 1.0,\n drawingZoom: 1.0,\n\n mode,\n animation: 1.0,\n\n viewId: props.initialView !== undefined ? props.initialView.id : \"\",\n view: props.initialView,\n\n isMoving: false,\n isPanning: false,\n rotateMinimapWithView:\n props.initialRotateMinimapWithView !== undefined\n ? props.initialRotateMinimapWithView\n : false,\n };\n }\n\n /** @internal */\n public override render(): React.ReactNode {\n const {\n startOrigin,\n origin,\n extents,\n startRotation,\n rotation,\n startMapOrigin,\n mapOrigin,\n startMapExtents,\n mapExtents,\n startDrawingZoom,\n drawingZoom,\n animation,\n viewId,\n mode,\n rotateMinimapWithView,\n } = this.state;\n\n const a = DrawingNavigationAid._animationFn(animation);\n const rot = Matrix3d.createFromQuaternion(\n Point4d.interpolateQuaternions(\n startRotation.toQuaternion(),\n a,\n rotation.toQuaternion()\n )\n );\n const or = startOrigin.interpolate(a, origin);\n const map = startMapOrigin.interpolate(a, mapOrigin);\n const sz = startMapExtents.interpolate(a, mapExtents);\n const dz = Geometry.interpolate(startDrawingZoom, a, drawingZoom);\n\n const rootStyle: React.CSSProperties = {\n width: sz.x,\n height: sz.y,\n ...this.props.style,\n };\n const is3D = this._isViewport3D();\n\n const tOr =\n rotateMinimapWithView || is3D\n ? rotation.multiplyVector(Vector3d.createFrom(or))\n : Vector3d.createFrom(or);\n const tMap =\n rotateMinimapWithView || is3D\n ? rotation.multiplyVector(Vector3d.createFrom(map))\n : Vector3d.createFrom(map);\n\n const tPosX = (tOr.x - extents.x / 2 - tMap.x) * dz + sz.x / 2;\n const tPosY = (-tOr.y - extents.y / 2 + tMap.y) * dz + sz.y / 2;\n const viewWindowStyle = {\n transform: `translate(${tPosX}px, ${tPosY}px)`,\n height: extents.y * dz,\n width: extents.x * dz,\n };\n if (!rotateMinimapWithView && !is3D)\n viewWindowStyle.transform =\n \"matrix3d(\" +\n `${rot.at(0, 0)}, ${rot.at(1, 0)}, ${rot.at(2, 0)}, 0, ` +\n `${rot.at(0, 1)}, ${rot.at(1, 1)}, ${rot.at(2, 1)}, 0, ` +\n `${rot.at(0, 2)}, ${rot.at(1, 2)}, ${rot.at(2, 2)}, 0, ` +\n `${tPosX}, ${tPosY}, 0, 1)`;\n const isAnimating =\n animation !== 1 && !startMapExtents.isExactEqual(mapExtents);\n if (mode === MapMode.Opened || isAnimating) {\n rootStyle.position = \"fixed\";\n rootStyle.right = window.innerWidth - this._rootOffset.right;\n rootStyle.top = this._rootOffset.top;\n }\n\n const halfExtents = extents.scale(0.5);\n const offset =\n rotateMinimapWithView || is3D\n ? Vector3d.createZero()\n : rotation.multiplyTransposeVector(halfExtents).minus(halfExtents);\n\n const unrotateLabel = UiIModelComponents.translate(\"drawing.unrotate\");\n const e = sz.scale(1 / dz);\n const halfMapExtents = e.scale(0.5);\n const mapOffset =\n rotateMinimapWithView || is3D\n ? rotation.multiplyTransposeVector(halfMapExtents)\n : halfMapExtents;\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n const nodes = (\n <div\n className={classnames(\n \"components-drawing-navigation-aid\",\n this.props.className\n )}\n data-testid=\"components-drawing-navigation-aid\"\n ref={this._rootElement}\n onWheel={this._handleWheel}\n onMouseDown={this._handleDrawingMouseDown}\n style={rootStyle}\n role=\"presentation\"\n >\n <DrawingNavigationCanvas\n view={this.state.view}\n viewManagerOverride={viewManager}\n screenViewportOverride={screenViewport}\n viewId={viewId}\n origin={map.plus(offset).minus(mapOffset)}\n extents={e}\n zoom={dz}\n rotation={\n rotateMinimapWithView || is3D ? rotation : Matrix3d.createIdentity()\n }\n />\n <div\n className=\"drawing-container\"\n data-testid=\"drawing-container\"\n ref={this._viewContainerElement}\n >\n <div\n className=\"drawing-view-window\"\n data-testid=\"drawing-view-window\"\n onMouseDown={this._handleWindowMouseDown}\n onTouchStart={this._handleWindowTouchStart}\n style={viewWindowStyle}\n ref={this._viewElement}\n role=\"presentation\"\n />\n {!is3D && (\n <div\n className={classnames(\"toggle-rotate-style\", \"icon\", {\n checked: rotateMinimapWithView,\n })}\n data-testid=\"toggle-rotate-style\"\n style={\n mode === MapMode.Closed && !isAnimating\n ? { bottom: 2, left: 2 }\n : {}\n }\n title={UiIModelComponents.translate(\"drawing.rotateStyle\")}\n onClick={this._toggleRotationMode}\n role=\"presentation\"\n >\n <Icon iconSpec={<SvgRotateLeft />} />\n </div>\n )}\n {!rot.isIdentity && (\n <div\n className=\"unrotate-button\"\n data-testid=\"drawing-unrotate-button\"\n style={mode === MapMode.Closed && !isAnimating ? { top: 2 } : {}}\n onClick={this._handleUnrotate}\n role=\"button\"\n tabIndex={-1}\n >\n {unrotateLabel}\n </div>\n )}\n {mode === MapMode.Opened && !isAnimating && (\n <>\n <div\n className=\"close\"\n data-testid=\"drawing-close-button\"\n onClick={this._closeLargeMap}\n role=\"button\"\n tabIndex={-1}\n >\n <div className=\"close-icon icon\">\n <Icon iconSpec={<SvgSortUp />} />\n </div>\n </div>\n <div className=\"zoom\">\n <div\n className=\"zoom-button icon\"\n data-testid=\"drawing-zoom-in-button\"\n onClick={this._handleZoomIn}\n role=\"button\"\n tabIndex={-1}\n >\n <Icon iconSpec={<SvgAdd />} />\n </div>\n <div\n className=\"zoom-button icon\"\n data-testid=\"drawing-zoom-out-button\"\n onClick={this._handleZoomOut}\n role=\"button\"\n tabIndex={-1}\n >\n <Icon iconSpec={<SvgRemove />} />\n </div>\n </div>\n </>\n )}\n </div>\n </div>\n );\n if (\n mode === MapMode.Closed &&\n (animation === 1.0 || startMapExtents.isExactEqual(mapExtents))\n ) {\n return nodes;\n } else {\n let drawingPortal = document.querySelector(\"#components-drawing-portal\");\n if (!drawingPortal) {\n drawingPortal = document.createElement(\"div\");\n drawingPortal.id = \"components-drawing-portal\";\n document.body.appendChild(drawingPortal);\n }\n return ReactDOM.createPortal(nodes, drawingPortal);\n }\n }\n\n private _isViewport3D = () => {\n return this.state.view !== undefined && this.state.view.is3d();\n };\n\n private _lastTime: number | undefined;\n\n private static _animationFn = (t: number) =>\n t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t;\n\n private _animation = () => {\n const t = Date.now();\n const delta = this._lastTime ? t - this._lastTime : 16;\n this._lastTime = t;\n if (this.state.animation !== 1) {\n const animation = Math.min(\n 1,\n this.state.animation +\n delta / (1000 * (this.props.animationTime || 0.4))\n );\n this._updateFrustum();\n\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ animation }, () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n });\n }\n } else {\n this._lastTime = undefined;\n this._animationEnd();\n }\n };\n\n private _animationEnd = () => {\n const hasViewportMoved =\n !this.state.origin.isAlmostEqual(this.state.startOrigin) ||\n !this.state.rotation.isAlmostEqual(this.state.startRotation);\n const startMapOrigin = Point3d.createFrom(this.state.mapOrigin);\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const startDrawingZoom = this.state.drawingZoom;\n const startOrigin = this.state.origin;\n const startRotation = this.state.rotation;\n // istanbul ignore next\n if (this._mounted) {\n this.setState(\n {\n startMapOrigin,\n startDrawingZoom,\n startOrigin,\n startRotation,\n startMapExtents,\n },\n () => {\n // istanbul ignore else\n if (this.props.onAnimationEnd) this.props.onAnimationEnd();\n if (hasViewportMoved) this._updateFrustum(true);\n }\n );\n }\n };\n\n private _lastPanTime: number | undefined;\n\n private _panAnimation = () => {\n const t = Date.now();\n if (this._lastPanTime === undefined) this._lastPanTime = t - 16.667;\n const delta = t - this._lastPanTime;\n this._lastPanTime = t;\n // istanbul ignore else\n if (!this.state.panningDirection.isAlmostZero && this.state.isMoving) {\n const { panningDirection } = this.state;\n const offset = panningDirection.scale(\n delta / 1000 / this.state.drawingZoom\n );\n const mapOrigin = this.state.mapOrigin.plus(offset);\n\n const origin = this.state.origin.plus(offset);\n this._updateFrustum();\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ mapOrigin, origin, panningDirection }, () => {\n this._animationFrame = setTimeout(this._panAnimation, 16.667);\n });\n }\n } else {\n this._lastPanTime = undefined;\n this._updateFrustum(true);\n }\n };\n\n public override componentDidMount() {\n this._mounted = true;\n ViewportComponentEvents.onViewRotationChangeEvent.addListener(\n this._handleViewRotationChangeEvent\n );\n window.addEventListener(\"mousedown\", this._handleMouseDown as any);\n window.addEventListener(\"mouseup\", this._handleMouseDragEnd as any);\n window.addEventListener(\"mousemove\", this._handleMouseDrag as any);\n window.addEventListener(\"keyup\", this._handleKeyUp as any);\n }\n\n public override componentWillUnmount() {\n ViewportComponentEvents.onViewRotationChangeEvent.removeListener(\n this._handleViewRotationChangeEvent\n );\n window.removeEventListener(\"mousedown\", this._handleMouseDown as any);\n window.removeEventListener(\"mouseup\", this._handleMouseDragEnd as any);\n window.removeEventListener(\"mousemove\", this._handleMouseDrag as any);\n window.removeEventListener(\"keyup\", this._handleKeyUp as any);\n clearTimeout(this._animationFrame);\n if (this.props.onAnimationEnd) this.props.onAnimationEnd();\n\n const rt = document.getElementById(\n \"components-drawing-portal\"\n ) as HTMLDivElement;\n if (rt && rt.parentElement !== null && rt.children.length === 0) {\n rt.parentElement.removeChild(rt);\n }\n this._mounted = false;\n }\n\n // Synchronize with rotation coming from the Viewport\n private _handleViewRotationChangeEvent = (\n args: ViewRotationChangeEventArgs\n ) => {\n // istanbul ignore else\n if (\n !this.state.isMoving &&\n !this.state.isPanning &&\n this.props.viewport === args.viewport\n ) {\n const extents = args.viewport.view.getExtents().clone();\n const rotation = args.viewport.view.getRotation().clone();\n const halfExtents = extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? rotation.multiplyTransposeVector(halfExtents)\n : halfExtents;\n const origin = args.viewport.view.getOrigin().plus(offset);\n const deltaZoom =\n (this.state.extents.x - extents.x) / this.state.extents.x;\n let drawingZoom = this.state.drawingZoom / (1 - deltaZoom);\n const deltaOrigin = origin.minus(this.state.origin);\n let mapOrigin = this.state.mapOrigin.plus(deltaOrigin);\n mapOrigin = mapOrigin.plus(\n Vector3d.createFrom(origin.minus(mapOrigin)).scale(deltaZoom)\n );\n if (this.state.viewId !== args.viewport.view.id) {\n const rect =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n extents,\n rotation\n );\n const maxRectDim = Math.max(rect.y, rect.x);\n const maxExtentDim = Math.max(\n this.state.mapExtents.x,\n this.state.mapExtents.y\n );\n drawingZoom = maxExtentDim / (3 * maxRectDim);\n mapOrigin = origin.clone();\n this._viewport = args.viewport;\n this.setState({\n viewId: args.viewport.view.id,\n view: args.viewport.view.clone(),\n });\n }\n // istanbul ignore next\n if (this._mounted) {\n this.setState({\n startOrigin: origin,\n origin,\n extents,\n startRotation: rotation,\n rotation,\n startMapOrigin: mapOrigin,\n mapOrigin,\n startDrawingZoom: drawingZoom,\n drawingZoom,\n });\n }\n }\n };\n\n private _updateFrustum = (complete: boolean = false) => {\n const halfExtents = this.state.extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(halfExtents)\n : halfExtents;\n const origin = this.state.origin.minus(offset);\n ViewportComponentEvents.setDrawingViewportState(\n origin,\n this.state.rotation,\n complete\n );\n };\n\n private _toggleRotationMode = () => {\n const rotateMinimapWithView = !this.state.rotateMinimapWithView;\n this.setState({ rotateMinimapWithView }, () => {\n if (this._viewport)\n this._handleViewRotationChangeEvent({ viewport: this._viewport });\n });\n };\n\n private _handleKeyUp = (event: React.KeyboardEvent) => {\n // istanbul ignore else\n if (\n event.key === Key.Escape.valueOf() &&\n this.state.mode === MapMode.Opened\n ) {\n this._closeLargeMap();\n }\n };\n\n private _lastClientXY: Point2d = Point2d.createZero();\n\n private _processWindowDrag(movement: Point2d) {\n const vect = Vector3d.create(\n movement.x / this.state.drawingZoom,\n -movement.y / this.state.drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const origin = this.state.origin.plus(offset);\n const panningDirection = this._getPanVector();\n const wasAlmostZero = this.state.panningDirection.isAlmostZero;\n this.setState(\n { startOrigin: origin, origin, panningDirection, isPanning: false },\n () => {\n this._updateFrustum();\n if (wasAlmostZero && !this.state.panningDirection.isAlmostZero) {\n this._animationFrame = setTimeout(this._panAnimation, 16.667);\n }\n }\n );\n }\n\n private _processWindowEndDrag() {\n this.setState({ isMoving: false });\n this._updateFrustum(true);\n if (this.state.mode === MapMode.Closed) {\n setTimeout(() => {\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.origin.clone();\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ startMapOrigin, mapOrigin, animation: 0 }, () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n });\n }\n }, 0);\n }\n }\n\n private _handleMouseDown = (event: React.MouseEvent) => {\n // Used only to determine if mouse was moved between mousedown and mouseup\n const mouseStart = Point2d.create(event.clientX, event.clientY);\n this.setState({ mouseStart });\n this._lastClientXY = Point2d.create(event.clientX, event.clientY);\n };\n\n private _handleDrawingMouseDown = (event: React.MouseEvent) => {\n if (this.state.mode === MapMode.Opened) {\n event.preventDefault();\n this.setState({ isPanning: true });\n }\n };\n\n private _handleWindowMouseDown = (event: React.MouseEvent) => {\n event.preventDefault();\n this.setState({ isMoving: true });\n };\n\n private _handleMouseDrag = (event: React.MouseEvent) => {\n const mouse = Point2d.create(event.clientX, event.clientY);\n const movement = mouse.minus(this._lastClientXY);\n if (this.state.isMoving) {\n // add scaled mouse movement\n this._processWindowDrag(movement);\n } else {\n // istanbul ignore else\n if (this.state.isPanning && this.state.mode === MapMode.Opened) {\n const vect = Vector3d.create(\n movement.x / this.state.drawingZoom,\n -movement.y / this.state.drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const mapOrigin = this.state.mapOrigin.minus(offset);\n this.setState({ startMapOrigin: mapOrigin, mapOrigin });\n }\n }\n this._lastClientXY = mouse;\n };\n\n private _handleMouseDragEnd = (event: React.MouseEvent) => {\n const mouse = Point2d.create(event.clientX, event.clientY);\n if (\n mouse.isAlmostEqual(this.state.mouseStart) &&\n this.state.mode === MapMode.Closed &&\n (event.target === this._viewContainerElement.current ||\n event.target === this._viewElement.current)\n ) {\n this._openLargeMap();\n } else if (this.state.isMoving) {\n this._processWindowEndDrag();\n } else if (this.state.isPanning) {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened) {\n event.stopPropagation();\n this.setState({ isPanning: false });\n }\n } else if (\n (!(event.target instanceof Node) ||\n (this._rootElement.current &&\n !this._rootElement.current.contains(event.target))) &&\n mouse.isAlmostEqual(this.state.mouseStart)\n ) {\n this._closeLargeMap();\n }\n this._lastClientXY = Point2d.create(event.clientX, event.clientY);\n };\n\n // istanbul ignore next - unable to test touch\n private _handleWindowTouchStart = (event: any) => {\n if (1 !== event.targetTouches.length) return;\n window.addEventListener(\"touchmove\", this._onTouchMove, false);\n window.addEventListener(\"touchend\", this._onTouchEnd, false);\n const mouseStart = Point2d.create(\n event.targetTouches[0].clientX,\n event.targetTouches[0].clientY\n );\n this.setState({ mouseStart });\n this._lastClientXY = mouseStart.clone();\n this.setState({ isMoving: true });\n };\n\n // istanbul ignore next - unable to test touch\n private _onTouchMove = (event: TouchEvent) => {\n if (1 !== event.targetTouches.length) return;\n const mouse = Point2d.create(\n event.targetTouches[0].clientX,\n event.targetTouches[0].clientY\n );\n const movement = mouse.minus(this._lastClientXY);\n // add scaled mouse movement\n this._processWindowDrag(movement);\n this._lastClientXY = mouse;\n };\n\n // istanbul ignore next - unable to test touch\n private _onTouchEnd = (event: TouchEvent) => {\n if (0 !== event.targetTouches.length) return;\n this._processWindowEndDrag();\n if (0 !== event.changedTouches.length)\n this._lastClientXY = Point2d.create(\n event.changedTouches[0].clientX,\n event.changedTouches[0].clientY\n ); // Doesn't seem necessary...but _handleMouseDragEnd sets it...\n window.removeEventListener(\"touchmove\", this._onTouchMove);\n window.removeEventListener(\"touchend\", this._onTouchEnd);\n };\n\n /** @internal */\n public static getDefaultClosedMapSize = (): Vector3d => {\n return Vector3d.create(96, 96);\n };\n\n /** @internal */\n public static getDefaultOpenedMapSize = (\n paddingX: number = 0,\n paddingY: number = 0\n ): Vector3d => {\n return Vector3d.create(\n window.innerWidth / 3 - 2 * (window.innerWidth - paddingX),\n window.innerHeight / 3 - 2 * paddingY\n );\n };\n\n private _getClosedMapSize = (): Vector3d => {\n if (this.props.closeSize === undefined)\n return DrawingNavigationAid.getDefaultClosedMapSize();\n return this.props.closeSize;\n };\n\n private _getOpenedMapSize = (): Vector3d => {\n if (this.props.openSize === undefined)\n return DrawingNavigationAid.getDefaultOpenedMapSize(\n this._rootOffset.right,\n this._rootOffset.top\n );\n return this.props.openSize;\n };\n\n private _openLargeMap = () => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Closed && this.state.animation === 1.0) {\n // istanbul ignore else\n if (this._rootElement.current) {\n const rect = this._rootElement.current.getBoundingClientRect();\n this._rootOffset = rect;\n }\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const mapExtents = this._getOpenedMapSize();\n this.setState(\n {\n mode: MapMode.Opened,\n isMoving: false,\n isPanning: false,\n mapExtents,\n startMapExtents,\n animation: 0,\n },\n () => {\n this._animationFrame = setTimeout(this._animation);\n }\n );\n }\n };\n\n private _closeLargeMap = () => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened && this.state.animation === 1.0) {\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.origin.clone();\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const mapExtents = this._getClosedMapSize();\n const rect =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n this.state.extents,\n this.state.rotation\n );\n const maxRectDim = Math.max(rect.y, rect.x);\n const maxExtentDim = Math.max(mapExtents.x, mapExtents.y);\n const drawingZoom = maxExtentDim / (3 * maxRectDim);\n const startDrawingZoom = this.state.drawingZoom;\n this.setState(\n {\n mode: MapMode.Closed,\n startMapOrigin,\n mapOrigin,\n startDrawingZoom,\n drawingZoom,\n isMoving: false,\n isPanning: false,\n startMapExtents,\n mapExtents,\n panningDirection: Vector3d.createZero(),\n animation: 0,\n },\n () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n }\n );\n }\n };\n\n private _getPanVector = () => {\n const is3D = this._isViewport3D();\n const rect =\n this.state.rotateMinimapWithView || is3D\n ? this.state.extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n this.state.extents,\n this.state.rotation\n );\n\n const mapExtents = this.state.mapExtents.scale(1 / this.state.drawingZoom);\n\n const maxMagnitude = 80; // maximum acceleration\n const magnitudeTravel = 30; // How far, in pixels, that magnitude increases from 0 to max acceleration\n\n const diff = Vector3d.createFrom(\n this.state.origin.minus(this.state.mapOrigin)\n );\n const diffVector =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyVector(diff)\n : diff;\n\n // capture any values\n const magnitudeVector = Vector3d.create(\n Math.max(0, Math.abs(diffVector.x) - (mapExtents.x - rect.x) / 2),\n Math.max(0, Math.abs(diffVector.y) - (mapExtents.y - rect.y) / 2)\n );\n if (magnitudeVector.isAlmostZero) return Vector3d.createZero();\n const magnitude =\n (Math.min(\n magnitudeVector.magnitude() * this.state.drawingZoom,\n magnitudeTravel\n ) /\n magnitudeTravel) *\n maxMagnitude;\n\n const vect = Vector3d.createFrom(\n this.state.origin.minus(this.state.mapOrigin)\n ); // vect will never be zero or magnitude would also be zero\n const norm = vect.normalize();\n return norm!.scale(magnitude); // norm is only undefined when vect is zero, in which it would have returned at magnitudeVector.isAlmostZero\n };\n\n private _handleWheel = (event: React.WheelEvent) => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened && this.state.animation === 1) {\n const { mapOrigin, drawingZoom } = this.state;\n const mapSize = this._getOpenedMapSize();\n\n const mouseX = event.clientX - this._rootOffset.right + mapSize.x / 2;\n const mouseY = event.clientY - this._rootOffset.top - mapSize.y / 2;\n const is3D = this._isViewport3D();\n if (event.deltaY < 0) {\n const zoom = drawingZoom * 1.1;\n const vect = Vector3d.create(\n (mouseX * 0.1) / zoom,\n (-mouseY * 0.1) / zoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const m = mapOrigin.plus(offset);\n this.setState({ mapOrigin: m, drawingZoom: zoom });\n }\n if (event.deltaY > 0) {\n const zoom = drawingZoom / 1.1;\n const vect = Vector3d.create(\n (mouseX * 0.1) / drawingZoom,\n (-mouseY * 0.1) / drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const m = mapOrigin.minus(offset);\n this.setState({ mapOrigin: m, drawingZoom: zoom });\n }\n }\n };\n\n private _handleZoomIn = () => {\n const zoom = this.state.drawingZoom * 1.4;\n this.setState({ drawingZoom: zoom });\n };\n\n private _handleZoomOut = () => {\n const zoom = this.state.drawingZoom / 1.4;\n this.setState({ drawingZoom: zoom });\n };\n\n private _handleUnrotate = () => {\n const startRotation = this.state.rotation;\n const halfExtents = this.state.extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? Vector3d.createZero()\n : this.state.rotation\n .multiplyTransposeVector(halfExtents)\n .minus(halfExtents);\n const startOrigin = this.state.origin;\n const origin = this.state.origin.plus(offset);\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.mapOrigin.plus(offset);\n this.setState(\n {\n animation: 0,\n startOrigin,\n origin,\n startMapOrigin,\n mapOrigin,\n startRotation,\n rotation: Matrix3d.createIdentity(),\n },\n () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n }\n );\n };\n\n /** @internal */\n public static findRotatedWindowDimensions = (\n extents: Vector3d,\n rotation: Matrix3d\n ) => {\n const cos = rotation.at(0, 0);\n const sin = rotation.at(1, 0);\n // extents.x/y should be divided in half, but we don't have to do that immediately.\n const cosWidth = cos * extents.x;\n const sinHeight = sin * extents.y;\n\n const sinWidth = cos * extents.x;\n const cosHeight = sin * extents.y;\n\n const a = Math.atan2(sin, cos);\n\n if (a % Math.PI >= 0 && a % Math.PI < Math.PI / 2) {\n const y1 = -cosHeight - sinWidth;\n const x2 = cosWidth + sinHeight;\n const y3 = cosHeight + sinWidth;\n const x4 = -cosWidth - sinHeight;\n // Instead, divide total difference\n return Vector3d.create(Math.abs(x2 - x4) / 2, Math.abs(y1 - y3) / 2);\n } else {\n const x1 = -cosWidth + sinHeight;\n const y2 = -cosHeight + sinWidth;\n const x3 = cosWidth - sinHeight;\n const y4 = cosHeight - sinWidth;\n return Vector3d.create(Math.abs(x1 - x3) / 2, Math.abs(y2 - y4) / 2);\n }\n };\n}\n\n/** @internal */\nexport interface DrawingNavigationCanvasProps {\n view: ViewState | undefined;\n viewId?: string;\n origin: Point3d;\n extents: Vector3d;\n zoom: number;\n rotation: Matrix3d;\n viewManagerOverride?: ViewManager;\n screenViewportOverride?: typeof ScreenViewport;\n canvasSizeOverride?: boolean;\n}\n\n/** @internal */\nexport class DrawingNavigationCanvas extends React.Component<DrawingNavigationCanvasProps> {\n private _canvasElement = React.createRef<HTMLDivElement>();\n private _vp?: ScreenViewport;\n\n public override render(): React.ReactNode {\n return (\n <div\n className=\"drawing-canvas\"\n data-testid=\"drawing-canvas\"\n ref={this._canvasElement}\n ></div>\n );\n }\n\n public override componentDidMount() {\n if (this._canvasElement.current && this.props.view !== undefined) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n /* istanbul ignore next */\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n const previousView = viewManager.selectedView;\n this._vp = screenViewport.create(\n this._canvasElement.current,\n this.props.view\n );\n this.customizeViewport(this._vp);\n viewManager.addViewport(this._vp);\n void viewManager.setSelectedView(previousView); // switch to original viewport\n this._update();\n }\n }\n\n private customizeViewport(vp: ScreenViewport): void {\n /* istanbul ignore next */\n if (vp.logo.style) vp.logo.style.display = \"none\";\n\n /* istanbul ignore next */\n if (vp.viewFlags.acsTriad)\n vp.viewFlags = vp.viewFlags.with(\"acsTriad\", false);\n }\n\n private _update = () => {\n // istanbul ignore else\n if (this._vp) {\n const max = Math.max(this.props.extents.x, this.props.extents.y);\n this._vp.view.extentLimits = { max, min: Constant.oneMillimeter };\n this._vp.view.setOrigin(this.props.origin);\n this._vp.view.setRotation(this.props.rotation);\n this._vp.view.setExtents(this.props.extents);\n this._vp.applyViewState(this._vp.view);\n }\n };\n\n public override componentDidUpdate(oldProps: DrawingNavigationCanvasProps) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n if (this.props.view !== undefined) {\n if (oldProps.view !== this.props.view) {\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n if (\n oldProps !== undefined &&\n oldProps.viewId !== \"\" &&\n oldProps.viewId !== this.props.viewId &&\n this._vp\n ) {\n viewManager.dropViewport(this._vp, true);\n }\n // istanbul ignore else\n if (\n this._canvasElement.current &&\n (this.props.canvasSizeOverride ||\n /* istanbul ignore next */ (this._canvasElement.current\n .clientWidth !== 0 &&\n /* istanbul ignore next */ this._canvasElement.current\n .clientHeight !== 0))\n ) {\n const previousView = viewManager.selectedView;\n this._vp = screenViewport.create(\n this._canvasElement.current,\n this.props.view.clone()\n );\n this.customizeViewport(this._vp);\n viewManager.addViewport(this._vp);\n void viewManager.setSelectedView(previousView); // switch to original viewport\n this._update();\n }\n } else if (\n !this.props.origin.isExactEqual(oldProps.origin) ||\n !this.props.extents.isExactEqual(oldProps.extents) ||\n this.props.zoom !== oldProps.zoom ||\n !this.props.rotation.isExactEqual(oldProps.rotation)\n ) {\n this._update();\n }\n }\n }\n\n public override componentWillUnmount() {\n if (this._vp) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n viewManager.dropViewport(this._vp, true);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"DrawingNavigationAid.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/navigationaids/DrawingNavigationAid.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAqC;AACrC,4DAAoC;AACpC,6CAA+B;AAC/B,oDAAsC;AACtC,6CAAkC;AAClC,wDAQ8B;AAO9B,wDAAiE;AAEjE,kDAAyC;AACzC,8DAA2D;AAE3D,iFAA8E;AAC9E,oEAKoC;AAEpC,gDAAgD;AAChD,0DAA0D;AAE1D;;;GAGG;AACH,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;AACvB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AA6DD;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,KAAK,CAAC,SAG/C;IAiBC,YAAY,KAAgC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;QAjBP,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QACjD,0BAAqB,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC1D,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QACjD,gBAAW,GAAY,OAAO,CAAC,QAAQ,CAAC;YAC9C,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACV,CAAC,CAAC;QAGK,aAAQ,GAAY,KAAK,CAAC;QAkQ1B,kBAAa,GAAG,GAAG,EAAE;YAC3B,OAAO,IAAI,CAAC,KAAK,C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C,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBAClC,KAAK,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,8BAA8B;oBAC9E,IAAI,CAAC,OAAO,EAAE,CAAC;iBAChB;aACF;iBAAM,IACL,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAChD,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAClD,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;gBACjC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACpD;gBACA,IAAI,CAAC,OAAO,EAAE,CAAC;aAChB;SACF;IACH,CAAC;IAEe,oBAAoB;QAClC,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB;gBAChD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB;gBAChC,CAAC,CAAC,0BAA0B,CAAC,yBAAS,CAAC,WAAW,CAAC;YACrD,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC1C;IACH,CAAC;CACF;AA/GD,0DA+GC","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 NavigationAids\n */\n\nimport \"./DrawingNavigationAid.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Key } from \"ts-key-enum\";\nimport {\n Constant,\n Geometry,\n Matrix3d,\n Point2d,\n Point3d,\n Point4d,\n Vector3d,\n} from \"@itwin/core-geometry\";\nimport type {\n IModelConnection,\n ViewManager,\n Viewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport { IModelApp, ScreenViewport } from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport type { ViewRotationChangeEventArgs } from \"../viewport/ViewportComponentEvents\";\nimport { ViewportComponentEvents } from \"../viewport/ViewportComponentEvents\";\nimport {\n SvgAdd,\n SvgRemove,\n SvgRotateLeft,\n SvgSortUp,\n} from \"@itwin/itwinui-icons-react\";\n\n// cSpell:ignore Quaternion Quaternions unrotate\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n\n/**\n * Enum for mode that minimap is currently in\n * @internal\n */\nexport enum MapMode {\n Opened = \"map-opened\",\n Closed = \"map-closed\",\n}\n\n/** Properties for the [[DrawingNavigationAid]] component\n * @public\n */\nexport interface DrawingNavigationAidProps extends CommonProps {\n iModelConnection: IModelConnection;\n viewport?: Viewport;\n\n // used only in testing\n\n /** @internal */\n animationTime?: number;\n /** @internal */\n openSize?: Vector3d;\n /** @internal */\n closeSize?: Vector3d;\n /** @internal */\n initialMapMode?: MapMode;\n /** @internal */\n onAnimationEnd?: () => void;\n /** @internal */\n initialRotateMinimapWithView?: boolean;\n /** @internal */\n initialView?: ViewState;\n /** @internal */\n viewManagerOverride?: ViewManager;\n /** @internal */\n screenViewportOverride?: typeof ScreenViewport;\n}\n\n/** @internal */\ninterface DrawingNavigationAidState {\n startOrigin: Point3d;\n origin: Point3d;\n extents: Vector3d;\n startRotation: Matrix3d;\n rotation: Matrix3d;\n\n startMapOrigin: Point3d;\n mapOrigin: Point3d;\n startMapExtents: Vector3d;\n mapExtents: Vector3d;\n\n mouseStart: Point2d;\n panningDirection: Vector3d;\n startDrawingZoom: number;\n drawingZoom: number;\n\n mode: MapMode;\n animation: number;\n\n isMoving: boolean;\n isPanning: boolean;\n\n viewId: string;\n view: ViewState | undefined;\n\n rotateMinimapWithView: boolean;\n}\n\n/**\n * A Drawing Navigation Aid.\n * @public\n */\nexport class DrawingNavigationAid extends React.Component<\n DrawingNavigationAidProps,\n DrawingNavigationAidState\n> {\n private _rootElement = React.createRef<HTMLDivElement>();\n private _viewContainerElement = React.createRef<HTMLDivElement>();\n private _viewElement = React.createRef<HTMLDivElement>();\n private _rootOffset: DOMRect = DOMRect.fromRect({\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n });\n private _viewport: Viewport | undefined;\n private _animationFrame: any;\n private _mounted: boolean = false;\n\n /** @internal */\n public override readonly state: Readonly<DrawingNavigationAidState>;\n\n constructor(props: DrawingNavigationAidProps) {\n super(props);\n const mode = props.initialMapMode || MapMode.Closed;\n const mapExtents =\n mode === MapMode.Closed\n ? this._getClosedMapSize()\n : this._getOpenedMapSize();\n const startMapExtents = mapExtents;\n\n this.state = {\n startOrigin: Point3d.createZero(),\n origin: Point3d.createZero(),\n extents: Vector3d.create(1, 1, 1),\n startRotation: Matrix3d.createIdentity(),\n rotation: Matrix3d.createIdentity(),\n\n startMapOrigin: Point3d.createZero(),\n mapOrigin: Point3d.createZero(),\n startMapExtents,\n mapExtents,\n\n mouseStart: Point2d.createZero(),\n panningDirection: Vector3d.createZero(),\n startDrawingZoom: 1.0,\n drawingZoom: 1.0,\n\n mode,\n animation: 1.0,\n\n viewId: props.initialView !== undefined ? props.initialView.id : \"\",\n view: props.initialView,\n\n isMoving: false,\n isPanning: false,\n rotateMinimapWithView:\n props.initialRotateMinimapWithView !== undefined\n ? props.initialRotateMinimapWithView\n : false,\n };\n }\n\n /** @internal */\n public override render(): React.ReactNode {\n const {\n startOrigin,\n origin,\n extents,\n startRotation,\n rotation,\n startMapOrigin,\n mapOrigin,\n startMapExtents,\n mapExtents,\n startDrawingZoom,\n drawingZoom,\n animation,\n viewId,\n mode,\n rotateMinimapWithView,\n } = this.state;\n\n const a = DrawingNavigationAid._animationFn(animation);\n const rot = Matrix3d.createFromQuaternion(\n Point4d.interpolateQuaternions(\n startRotation.toQuaternion(),\n a,\n rotation.toQuaternion()\n )\n );\n const or = startOrigin.interpolate(a, origin);\n const map = startMapOrigin.interpolate(a, mapOrigin);\n const sz = startMapExtents.interpolate(a, mapExtents);\n const dz = Geometry.interpolate(startDrawingZoom, a, drawingZoom);\n\n const rootStyle: React.CSSProperties = {\n width: sz.x,\n height: sz.y,\n ...this.props.style,\n };\n const is3D = this._isViewport3D();\n\n const tOr =\n rotateMinimapWithView || is3D\n ? rotation.multiplyVector(Vector3d.createFrom(or))\n : Vector3d.createFrom(or);\n const tMap =\n rotateMinimapWithView || is3D\n ? rotation.multiplyVector(Vector3d.createFrom(map))\n : Vector3d.createFrom(map);\n\n const tPosX = (tOr.x - extents.x / 2 - tMap.x) * dz + sz.x / 2;\n const tPosY = (-tOr.y - extents.y / 2 + tMap.y) * dz + sz.y / 2;\n const viewWindowStyle = {\n transform: `translate(${tPosX}px, ${tPosY}px)`,\n height: extents.y * dz,\n width: extents.x * dz,\n };\n if (!rotateMinimapWithView && !is3D)\n viewWindowStyle.transform =\n \"matrix3d(\" +\n `${rot.at(0, 0)}, ${rot.at(1, 0)}, ${rot.at(2, 0)}, 0, ` +\n `${rot.at(0, 1)}, ${rot.at(1, 1)}, ${rot.at(2, 1)}, 0, ` +\n `${rot.at(0, 2)}, ${rot.at(1, 2)}, ${rot.at(2, 2)}, 0, ` +\n `${tPosX}, ${tPosY}, 0, 1)`;\n const isAnimating =\n animation !== 1 && !startMapExtents.isExactEqual(mapExtents);\n if (mode === MapMode.Opened || isAnimating) {\n rootStyle.position = \"fixed\";\n rootStyle.right = window.innerWidth - this._rootOffset.right;\n rootStyle.top = this._rootOffset.top;\n }\n\n const halfExtents = extents.scale(0.5);\n const offset =\n rotateMinimapWithView || is3D\n ? Vector3d.createZero()\n : rotation.multiplyTransposeVector(halfExtents).minus(halfExtents);\n\n const e = sz.scale(1 / dz);\n const halfMapExtents = e.scale(0.5);\n const mapOffset =\n rotateMinimapWithView || is3D\n ? rotation.multiplyTransposeVector(halfMapExtents)\n : halfMapExtents;\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n const nodes = (\n <div\n className={classnames(\n \"components-drawing-navigation-aid\",\n this.props.className\n )}\n data-testid=\"components-drawing-navigation-aid\"\n ref={this._rootElement}\n onWheel={this._handleWheel}\n onMouseDown={this._handleDrawingMouseDown}\n style={rootStyle}\n role=\"presentation\"\n >\n <DrawingNavigationCanvas\n view={this.state.view}\n viewManagerOverride={viewManager}\n screenViewportOverride={screenViewport}\n viewId={viewId}\n origin={map.plus(offset).minus(mapOffset)}\n extents={e}\n zoom={dz}\n rotation={\n rotateMinimapWithView || is3D ? rotation : Matrix3d.createIdentity()\n }\n />\n <div\n className=\"drawing-container\"\n data-testid=\"drawing-container\"\n ref={this._viewContainerElement}\n >\n <div\n className=\"drawing-view-window\"\n data-testid=\"drawing-view-window\"\n onMouseDown={this._handleWindowMouseDown}\n onTouchStart={this._handleWindowTouchStart}\n style={viewWindowStyle}\n ref={this._viewElement}\n role=\"presentation\"\n />\n {!is3D && (\n <div\n className={classnames(\"toggle-rotate-style\", \"icon\", {\n checked: rotateMinimapWithView,\n })}\n data-testid=\"toggle-rotate-style\"\n style={\n mode === MapMode.Closed && !isAnimating\n ? { bottom: 2, left: 2 }\n : {}\n }\n title={UiIModelComponents.translate(\"drawing.rotateStyle\")}\n onClick={this._toggleRotationMode}\n role=\"presentation\"\n >\n <Icon iconSpec={<SvgRotateLeft />} />\n </div>\n )}\n {!rot.isIdentity && (\n <div\n className=\"unrotate-button\"\n data-testid=\"drawing-unrotate-button\"\n style={mode === MapMode.Closed && !isAnimating ? { top: 2 } : {}}\n onClick={this._handleUnrotate}\n role=\"button\"\n tabIndex={-1}\n >\n {UiIModelComponents.translate(\"drawing.unrotate\")}\n </div>\n )}\n {mode === MapMode.Opened && !isAnimating && (\n <>\n <div\n className=\"close\"\n data-testid=\"drawing-close-button\"\n onClick={this._closeLargeMap}\n role=\"button\"\n tabIndex={-1}\n >\n <div className=\"close-icon icon\">\n <Icon iconSpec={<SvgSortUp />} />\n </div>\n </div>\n <div className=\"zoom\">\n <div\n className=\"zoom-button icon\"\n data-testid=\"drawing-zoom-in-button\"\n onClick={this._handleZoomIn}\n role=\"button\"\n tabIndex={-1}\n >\n <Icon iconSpec={<SvgAdd />} />\n </div>\n <div\n className=\"zoom-button icon\"\n data-testid=\"drawing-zoom-out-button\"\n onClick={this._handleZoomOut}\n role=\"button\"\n tabIndex={-1}\n >\n <Icon iconSpec={<SvgRemove />} />\n </div>\n </div>\n </>\n )}\n </div>\n </div>\n );\n if (\n mode === MapMode.Closed &&\n (animation === 1.0 || startMapExtents.isExactEqual(mapExtents))\n ) {\n return nodes;\n } else {\n let drawingPortal = document.querySelector(\"#components-drawing-portal\");\n if (!drawingPortal) {\n drawingPortal = document.createElement(\"div\");\n drawingPortal.id = \"components-drawing-portal\";\n document.body.appendChild(drawingPortal);\n }\n return ReactDOM.createPortal(nodes, drawingPortal);\n }\n }\n\n private _isViewport3D = () => {\n return this.state.view !== undefined && this.state.view.is3d();\n };\n\n private _lastTime: number | undefined;\n\n private static _animationFn = (t: number) =>\n t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t;\n\n private _animation = () => {\n const t = Date.now();\n const delta = this._lastTime ? t - this._lastTime : 16;\n this._lastTime = t;\n if (this.state.animation !== 1) {\n const animation = Math.min(\n 1,\n this.state.animation +\n delta / (1000 * (this.props.animationTime || 0.4))\n );\n this._updateFrustum();\n\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ animation }, () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n });\n }\n } else {\n this._lastTime = undefined;\n this._animationEnd();\n }\n };\n\n private _animationEnd = () => {\n const hasViewportMoved =\n !this.state.origin.isAlmostEqual(this.state.startOrigin) ||\n !this.state.rotation.isAlmostEqual(this.state.startRotation);\n const startMapOrigin = Point3d.createFrom(this.state.mapOrigin);\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const startDrawingZoom = this.state.drawingZoom;\n const startOrigin = this.state.origin;\n const startRotation = this.state.rotation;\n // istanbul ignore next\n if (this._mounted) {\n this.setState(\n {\n startMapOrigin,\n startDrawingZoom,\n startOrigin,\n startRotation,\n startMapExtents,\n },\n () => {\n // istanbul ignore else\n if (this.props.onAnimationEnd) this.props.onAnimationEnd();\n if (hasViewportMoved) this._updateFrustum(true);\n }\n );\n }\n };\n\n private _lastPanTime: number | undefined;\n\n private _panAnimation = () => {\n const t = Date.now();\n if (this._lastPanTime === undefined) this._lastPanTime = t - 16.667;\n const delta = t - this._lastPanTime;\n this._lastPanTime = t;\n // istanbul ignore else\n if (!this.state.panningDirection.isAlmostZero && this.state.isMoving) {\n const { panningDirection } = this.state;\n const offset = panningDirection.scale(\n delta / 1000 / this.state.drawingZoom\n );\n const mapOrigin = this.state.mapOrigin.plus(offset);\n\n const origin = this.state.origin.plus(offset);\n this._updateFrustum();\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ mapOrigin, origin, panningDirection }, () => {\n this._animationFrame = setTimeout(this._panAnimation, 16.667);\n });\n }\n } else {\n this._lastPanTime = undefined;\n this._updateFrustum(true);\n }\n };\n\n public override componentDidMount() {\n this._mounted = true;\n ViewportComponentEvents.onViewRotationChangeEvent.addListener(\n this._handleViewRotationChangeEvent\n );\n window.addEventListener(\"mousedown\", this._handleMouseDown as any);\n window.addEventListener(\"mouseup\", this._handleMouseDragEnd as any);\n window.addEventListener(\"mousemove\", this._handleMouseDrag as any);\n window.addEventListener(\"keyup\", this._handleKeyUp as any);\n }\n\n public override componentWillUnmount() {\n ViewportComponentEvents.onViewRotationChangeEvent.removeListener(\n this._handleViewRotationChangeEvent\n );\n window.removeEventListener(\"mousedown\", this._handleMouseDown as any);\n window.removeEventListener(\"mouseup\", this._handleMouseDragEnd as any);\n window.removeEventListener(\"mousemove\", this._handleMouseDrag as any);\n window.removeEventListener(\"keyup\", this._handleKeyUp as any);\n clearTimeout(this._animationFrame);\n if (this.props.onAnimationEnd) this.props.onAnimationEnd();\n\n const rt = document.getElementById(\n \"components-drawing-portal\"\n ) as HTMLDivElement;\n if (rt && rt.parentElement !== null && rt.children.length === 0) {\n rt.parentElement.removeChild(rt);\n }\n this._mounted = false;\n }\n\n // Synchronize with rotation coming from the Viewport\n private _handleViewRotationChangeEvent = (\n args: ViewRotationChangeEventArgs\n ) => {\n // istanbul ignore else\n if (\n !this.state.isMoving &&\n !this.state.isPanning &&\n this.props.viewport === args.viewport\n ) {\n const extents = args.viewport.view.getExtents().clone();\n const rotation = args.viewport.view.getRotation().clone();\n const halfExtents = extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? rotation.multiplyTransposeVector(halfExtents)\n : halfExtents;\n const origin = args.viewport.view.getOrigin().plus(offset);\n const deltaZoom =\n (this.state.extents.x - extents.x) / this.state.extents.x;\n let drawingZoom = this.state.drawingZoom / (1 - deltaZoom);\n const deltaOrigin = origin.minus(this.state.origin);\n let mapOrigin = this.state.mapOrigin.plus(deltaOrigin);\n mapOrigin = mapOrigin.plus(\n Vector3d.createFrom(origin.minus(mapOrigin)).scale(deltaZoom)\n );\n if (this.state.viewId !== args.viewport.view.id) {\n const rect =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n extents,\n rotation\n );\n const maxRectDim = Math.max(rect.y, rect.x);\n const maxExtentDim = Math.max(\n this.state.mapExtents.x,\n this.state.mapExtents.y\n );\n drawingZoom = maxExtentDim / (3 * maxRectDim);\n mapOrigin = origin.clone();\n this._viewport = args.viewport;\n this.setState({\n viewId: args.viewport.view.id,\n view: args.viewport.view.clone(),\n });\n }\n // istanbul ignore next\n if (this._mounted) {\n this.setState({\n startOrigin: origin,\n origin,\n extents,\n startRotation: rotation,\n rotation,\n startMapOrigin: mapOrigin,\n mapOrigin,\n startDrawingZoom: drawingZoom,\n drawingZoom,\n });\n }\n }\n };\n\n private _updateFrustum = (complete: boolean = false) => {\n const halfExtents = this.state.extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(halfExtents)\n : halfExtents;\n const origin = this.state.origin.minus(offset);\n ViewportComponentEvents.setDrawingViewportState(\n origin,\n this.state.rotation,\n complete\n );\n };\n\n private _toggleRotationMode = () => {\n const rotateMinimapWithView = !this.state.rotateMinimapWithView;\n this.setState({ rotateMinimapWithView }, () => {\n if (this._viewport)\n this._handleViewRotationChangeEvent({ viewport: this._viewport });\n });\n };\n\n private _handleKeyUp = (event: React.KeyboardEvent) => {\n // istanbul ignore else\n if (\n event.key === Key.Escape.valueOf() &&\n this.state.mode === MapMode.Opened\n ) {\n this._closeLargeMap();\n }\n };\n\n private _lastClientXY: Point2d = Point2d.createZero();\n\n private _processWindowDrag(movement: Point2d) {\n const vect = Vector3d.create(\n movement.x / this.state.drawingZoom,\n -movement.y / this.state.drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const origin = this.state.origin.plus(offset);\n const panningDirection = this._getPanVector();\n const wasAlmostZero = this.state.panningDirection.isAlmostZero;\n this.setState(\n { startOrigin: origin, origin, panningDirection, isPanning: false },\n () => {\n this._updateFrustum();\n if (wasAlmostZero && !this.state.panningDirection.isAlmostZero) {\n this._animationFrame = setTimeout(this._panAnimation, 16.667);\n }\n }\n );\n }\n\n private _processWindowEndDrag() {\n this.setState({ isMoving: false });\n this._updateFrustum(true);\n if (this.state.mode === MapMode.Closed) {\n setTimeout(() => {\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.origin.clone();\n // istanbul ignore next\n if (this._mounted) {\n this.setState({ startMapOrigin, mapOrigin, animation: 0 }, () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n });\n }\n }, 0);\n }\n }\n\n private _handleMouseDown = (event: React.MouseEvent) => {\n // Used only to determine if mouse was moved between mousedown and mouseup\n const mouseStart = Point2d.create(event.clientX, event.clientY);\n this.setState({ mouseStart });\n this._lastClientXY = Point2d.create(event.clientX, event.clientY);\n };\n\n private _handleDrawingMouseDown = (event: React.MouseEvent) => {\n if (this.state.mode === MapMode.Opened) {\n event.preventDefault();\n this.setState({ isPanning: true });\n }\n };\n\n private _handleWindowMouseDown = (event: React.MouseEvent) => {\n event.preventDefault();\n this.setState({ isMoving: true });\n };\n\n private _handleMouseDrag = (event: React.MouseEvent) => {\n const mouse = Point2d.create(event.clientX, event.clientY);\n const movement = mouse.minus(this._lastClientXY);\n if (this.state.isMoving) {\n // add scaled mouse movement\n this._processWindowDrag(movement);\n } else {\n // istanbul ignore else\n if (this.state.isPanning && this.state.mode === MapMode.Opened) {\n const vect = Vector3d.create(\n movement.x / this.state.drawingZoom,\n -movement.y / this.state.drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const mapOrigin = this.state.mapOrigin.minus(offset);\n this.setState({ startMapOrigin: mapOrigin, mapOrigin });\n }\n }\n this._lastClientXY = mouse;\n };\n\n private _handleMouseDragEnd = (event: React.MouseEvent) => {\n const mouse = Point2d.create(event.clientX, event.clientY);\n if (\n mouse.isAlmostEqual(this.state.mouseStart) &&\n this.state.mode === MapMode.Closed &&\n (event.target === this._viewContainerElement.current ||\n event.target === this._viewElement.current)\n ) {\n this._openLargeMap();\n } else if (this.state.isMoving) {\n this._processWindowEndDrag();\n } else if (this.state.isPanning) {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened) {\n event.stopPropagation();\n this.setState({ isPanning: false });\n }\n } else if (\n (!(event.target instanceof Node) ||\n (this._rootElement.current &&\n !this._rootElement.current.contains(event.target))) &&\n mouse.isAlmostEqual(this.state.mouseStart)\n ) {\n this._closeLargeMap();\n }\n this._lastClientXY = Point2d.create(event.clientX, event.clientY);\n };\n\n // istanbul ignore next - unable to test touch\n private _handleWindowTouchStart = (event: any) => {\n if (1 !== event.targetTouches.length) return;\n window.addEventListener(\"touchmove\", this._onTouchMove, false);\n window.addEventListener(\"touchend\", this._onTouchEnd, false);\n const mouseStart = Point2d.create(\n event.targetTouches[0].clientX,\n event.targetTouches[0].clientY\n );\n this.setState({ mouseStart });\n this._lastClientXY = mouseStart.clone();\n this.setState({ isMoving: true });\n };\n\n // istanbul ignore next - unable to test touch\n private _onTouchMove = (event: TouchEvent) => {\n if (1 !== event.targetTouches.length) return;\n const mouse = Point2d.create(\n event.targetTouches[0].clientX,\n event.targetTouches[0].clientY\n );\n const movement = mouse.minus(this._lastClientXY);\n // add scaled mouse movement\n this._processWindowDrag(movement);\n this._lastClientXY = mouse;\n };\n\n // istanbul ignore next - unable to test touch\n private _onTouchEnd = (event: TouchEvent) => {\n if (0 !== event.targetTouches.length) return;\n this._processWindowEndDrag();\n if (0 !== event.changedTouches.length)\n this._lastClientXY = Point2d.create(\n event.changedTouches[0].clientX,\n event.changedTouches[0].clientY\n ); // Doesn't seem necessary...but _handleMouseDragEnd sets it...\n window.removeEventListener(\"touchmove\", this._onTouchMove);\n window.removeEventListener(\"touchend\", this._onTouchEnd);\n };\n\n /** @internal */\n public static getDefaultClosedMapSize = (): Vector3d => {\n return Vector3d.create(96, 96);\n };\n\n /** @internal */\n public static getDefaultOpenedMapSize = (\n paddingX: number = 0,\n paddingY: number = 0\n ): Vector3d => {\n return Vector3d.create(\n window.innerWidth / 3 - 2 * (window.innerWidth - paddingX),\n window.innerHeight / 3 - 2 * paddingY\n );\n };\n\n private _getClosedMapSize = (): Vector3d => {\n if (this.props.closeSize === undefined)\n return DrawingNavigationAid.getDefaultClosedMapSize();\n return this.props.closeSize;\n };\n\n private _getOpenedMapSize = (): Vector3d => {\n if (this.props.openSize === undefined)\n return DrawingNavigationAid.getDefaultOpenedMapSize(\n this._rootOffset.right,\n this._rootOffset.top\n );\n return this.props.openSize;\n };\n\n private _openLargeMap = () => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Closed && this.state.animation === 1.0) {\n // istanbul ignore else\n if (this._rootElement.current) {\n const rect = this._rootElement.current.getBoundingClientRect();\n this._rootOffset = rect;\n }\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const mapExtents = this._getOpenedMapSize();\n this.setState(\n {\n mode: MapMode.Opened,\n isMoving: false,\n isPanning: false,\n mapExtents,\n startMapExtents,\n animation: 0,\n },\n () => {\n this._animationFrame = setTimeout(this._animation);\n }\n );\n }\n };\n\n private _closeLargeMap = () => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened && this.state.animation === 1.0) {\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.origin.clone();\n const startMapExtents = Vector3d.createFrom(this.state.mapExtents);\n const mapExtents = this._getClosedMapSize();\n const rect =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? this.state.extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n this.state.extents,\n this.state.rotation\n );\n const maxRectDim = Math.max(rect.y, rect.x);\n const maxExtentDim = Math.max(mapExtents.x, mapExtents.y);\n const drawingZoom = maxExtentDim / (3 * maxRectDim);\n const startDrawingZoom = this.state.drawingZoom;\n this.setState(\n {\n mode: MapMode.Closed,\n startMapOrigin,\n mapOrigin,\n startDrawingZoom,\n drawingZoom,\n isMoving: false,\n isPanning: false,\n startMapExtents,\n mapExtents,\n panningDirection: Vector3d.createZero(),\n animation: 0,\n },\n () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n }\n );\n }\n };\n\n private _getPanVector = () => {\n const is3D = this._isViewport3D();\n const rect =\n this.state.rotateMinimapWithView || is3D\n ? this.state.extents\n : DrawingNavigationAid.findRotatedWindowDimensions(\n this.state.extents,\n this.state.rotation\n );\n\n const mapExtents = this.state.mapExtents.scale(1 / this.state.drawingZoom);\n\n const maxMagnitude = 80; // maximum acceleration\n const magnitudeTravel = 30; // How far, in pixels, that magnitude increases from 0 to max acceleration\n\n const diff = Vector3d.createFrom(\n this.state.origin.minus(this.state.mapOrigin)\n );\n const diffVector =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyVector(diff)\n : diff;\n\n // capture any values\n const magnitudeVector = Vector3d.create(\n Math.max(0, Math.abs(diffVector.x) - (mapExtents.x - rect.x) / 2),\n Math.max(0, Math.abs(diffVector.y) - (mapExtents.y - rect.y) / 2)\n );\n if (magnitudeVector.isAlmostZero) return Vector3d.createZero();\n const magnitude =\n (Math.min(\n magnitudeVector.magnitude() * this.state.drawingZoom,\n magnitudeTravel\n ) /\n magnitudeTravel) *\n maxMagnitude;\n\n const vect = Vector3d.createFrom(\n this.state.origin.minus(this.state.mapOrigin)\n ); // vect will never be zero or magnitude would also be zero\n const norm = vect.normalize();\n return norm!.scale(magnitude); // norm is only undefined when vect is zero, in which it would have returned at magnitudeVector.isAlmostZero\n };\n\n private _handleWheel = (event: React.WheelEvent) => {\n // istanbul ignore else\n if (this.state.mode === MapMode.Opened && this.state.animation === 1) {\n const { mapOrigin, drawingZoom } = this.state;\n const mapSize = this._getOpenedMapSize();\n\n const mouseX = event.clientX - this._rootOffset.right + mapSize.x / 2;\n const mouseY = event.clientY - this._rootOffset.top - mapSize.y / 2;\n const is3D = this._isViewport3D();\n if (event.deltaY < 0) {\n const zoom = drawingZoom * 1.1;\n const vect = Vector3d.create(\n (mouseX * 0.1) / zoom,\n (-mouseY * 0.1) / zoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const m = mapOrigin.plus(offset);\n this.setState({ mapOrigin: m, drawingZoom: zoom });\n }\n if (event.deltaY > 0) {\n const zoom = drawingZoom / 1.1;\n const vect = Vector3d.create(\n (mouseX * 0.1) / drawingZoom,\n (-mouseY * 0.1) / drawingZoom,\n 0\n );\n const offset =\n this.state.rotateMinimapWithView || is3D\n ? this.state.rotation.multiplyTransposeVector(vect)\n : vect;\n const m = mapOrigin.minus(offset);\n this.setState({ mapOrigin: m, drawingZoom: zoom });\n }\n }\n };\n\n private _handleZoomIn = () => {\n const zoom = this.state.drawingZoom * 1.4;\n this.setState({ drawingZoom: zoom });\n };\n\n private _handleZoomOut = () => {\n const zoom = this.state.drawingZoom / 1.4;\n this.setState({ drawingZoom: zoom });\n };\n\n private _handleUnrotate = () => {\n const startRotation = this.state.rotation;\n const halfExtents = this.state.extents.scale(0.5);\n const offset =\n this.state.rotateMinimapWithView || this._isViewport3D()\n ? Vector3d.createZero()\n : this.state.rotation\n .multiplyTransposeVector(halfExtents)\n .minus(halfExtents);\n const startOrigin = this.state.origin;\n const origin = this.state.origin.plus(offset);\n const startMapOrigin = this.state.mapOrigin;\n const mapOrigin = this.state.mapOrigin.plus(offset);\n this.setState(\n {\n animation: 0,\n startOrigin,\n origin,\n startMapOrigin,\n mapOrigin,\n startRotation,\n rotation: Matrix3d.createIdentity(),\n },\n () => {\n this._animationFrame = setTimeout(this._animation, 16.667);\n }\n );\n };\n\n /** @internal */\n public static findRotatedWindowDimensions = (\n extents: Vector3d,\n rotation: Matrix3d\n ) => {\n const cos = rotation.at(0, 0);\n const sin = rotation.at(1, 0);\n // extents.x/y should be divided in half, but we don't have to do that immediately.\n const cosWidth = cos * extents.x;\n const sinHeight = sin * extents.y;\n\n const sinWidth = cos * extents.x;\n const cosHeight = sin * extents.y;\n\n const a = Math.atan2(sin, cos);\n\n if (a % Math.PI >= 0 && a % Math.PI < Math.PI / 2) {\n const y1 = -cosHeight - sinWidth;\n const x2 = cosWidth + sinHeight;\n const y3 = cosHeight + sinWidth;\n const x4 = -cosWidth - sinHeight;\n // Instead, divide total difference\n return Vector3d.create(Math.abs(x2 - x4) / 2, Math.abs(y1 - y3) / 2);\n } else {\n const x1 = -cosWidth + sinHeight;\n const y2 = -cosHeight + sinWidth;\n const x3 = cosWidth - sinHeight;\n const y4 = cosHeight - sinWidth;\n return Vector3d.create(Math.abs(x1 - x3) / 2, Math.abs(y2 - y4) / 2);\n }\n };\n}\n\n/** @internal */\nexport interface DrawingNavigationCanvasProps {\n view: ViewState | undefined;\n viewId?: string;\n origin: Point3d;\n extents: Vector3d;\n zoom: number;\n rotation: Matrix3d;\n viewManagerOverride?: ViewManager;\n screenViewportOverride?: typeof ScreenViewport;\n canvasSizeOverride?: boolean;\n}\n\n/** @internal */\nexport class DrawingNavigationCanvas extends React.Component<DrawingNavigationCanvasProps> {\n private _canvasElement = React.createRef<HTMLDivElement>();\n private _vp?: ScreenViewport;\n\n public override render(): React.ReactNode {\n return (\n <div\n className=\"drawing-canvas\"\n data-testid=\"drawing-canvas\"\n ref={this._canvasElement}\n ></div>\n );\n }\n\n public override componentDidMount() {\n if (this._canvasElement.current && this.props.view !== undefined) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n /* istanbul ignore next */\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n const previousView = viewManager.selectedView;\n this._vp = screenViewport.create(\n this._canvasElement.current,\n this.props.view\n );\n this.customizeViewport(this._vp);\n viewManager.addViewport(this._vp);\n void viewManager.setSelectedView(previousView); // switch to original viewport\n this._update();\n }\n }\n\n private customizeViewport(vp: ScreenViewport): void {\n /* istanbul ignore next */\n if (vp.logo.style) vp.logo.style.display = \"none\";\n\n /* istanbul ignore next */\n if (vp.viewFlags.acsTriad)\n vp.viewFlags = vp.viewFlags.with(\"acsTriad\", false);\n }\n\n private _update = () => {\n // istanbul ignore else\n if (this._vp) {\n const max = Math.max(this.props.extents.x, this.props.extents.y);\n this._vp.view.extentLimits = { max, min: Constant.oneMillimeter };\n this._vp.view.setOrigin(this.props.origin);\n this._vp.view.setRotation(this.props.rotation);\n this._vp.view.setExtents(this.props.extents);\n this._vp.applyViewState(this._vp.view);\n }\n };\n\n public override componentDidUpdate(oldProps: DrawingNavigationCanvasProps) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n if (this.props.view !== undefined) {\n if (oldProps.view !== this.props.view) {\n const screenViewport = this.props.screenViewportOverride\n ? this.props.screenViewportOverride\n : /* istanbul ignore next */ ScreenViewport;\n if (\n oldProps !== undefined &&\n oldProps.viewId !== \"\" &&\n oldProps.viewId !== this.props.viewId &&\n this._vp\n ) {\n viewManager.dropViewport(this._vp, true);\n }\n // istanbul ignore else\n if (\n this._canvasElement.current &&\n (this.props.canvasSizeOverride ||\n /* istanbul ignore next */ (this._canvasElement.current\n .clientWidth !== 0 &&\n /* istanbul ignore next */ this._canvasElement.current\n .clientHeight !== 0))\n ) {\n const previousView = viewManager.selectedView;\n this._vp = screenViewport.create(\n this._canvasElement.current,\n this.props.view.clone()\n );\n this.customizeViewport(this._vp);\n viewManager.addViewport(this._vp);\n void viewManager.setSelectedView(previousView); // switch to original viewport\n this._update();\n }\n } else if (\n !this.props.origin.isExactEqual(oldProps.origin) ||\n !this.props.extents.isExactEqual(oldProps.extents) ||\n this.props.zoom !== oldProps.zoom ||\n !this.props.rotation.isExactEqual(oldProps.rotation)\n ) {\n this._update();\n }\n }\n }\n\n public override componentWillUnmount() {\n if (this._vp) {\n const viewManager = this.props.viewManagerOverride\n ? this.props.viewManagerOverride\n : /* istanbul ignore next */ IModelApp.viewManager;\n viewManager.dropViewport(this._vp, true);\n }\n }\n}\n"]}
@@ -98,7 +98,7 @@ function FormatPanel(props) {
98
98
  }, []);
99
99
  return (React.createElement("div", { className: "components-quantityFormat-panel" },
100
100
  showSample && (React.createElement(FormatSample_1.FormatSample, { formatSpec: formatSpec, initialMagnitude: initialMagnitude })),
101
- React.createElement(FormatUnits_1.FormatUnits, { unitsProvider: unitsProvider, persistenceUnit: formatSpec?.persistenceUnit, initialFormat: formatProps, onUnitsChange: handleFormatChange }),
101
+ React.createElement(FormatUnits_1.FormatUnits, { unitsProvider: unitsProvider, persistenceUnit: formatSpec === null || formatSpec === void 0 ? void 0 : formatSpec.persistenceUnit, initialFormat: formatProps, onUnitsChange: handleFormatChange }),
102
102
  React.createElement(FormatUnitLabel_1.FormatUnitLabel, { formatProps: formatProps, onUnitLabelChange: handleFormatChange }),
103
103
  React.createElement(FormatType_1.FormatTypeOption, { formatProps: formatProps, onChange: handleFormatChange }),
104
104
  React.createElement(FormatPrecision_1.FormatPrecision, { formatProps: formatProps, onChange: handleFormatChange }),
@@ -1 +1 @@
1
- {"version":3,"file":"FormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPanel.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAA4B;AAC5B,6CAA+B;AAM/B,wDAA6D;AAE7D,uDAAoD;AACpD,iDAA8C;AAC9C,6CAAgD;AAChD,uDAAoD;AACpD,+CAA4C;AAC5C,2DAAwD;AA6BxD,KAAK,UAAU,kBAAkB,CAC/B,WAAwB,EACxB,eAA0B,EAC1B,aAA4B;IAE5B,MAAM,YAAY,GAAG,MAAM,sBAAM,CAAC,cAAc,CAC9C,QAAQ,EACR,aAAa,EACb,WAAW,CACZ,CAAC;IACF,OAAO,6BAAa,CAAC,MAAM,CACzB,YAAY,CAAC,IAAI,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,CAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAiB,CAAC;IACpE,MAAM,EACJ,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,uBAAuB,GACxB,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QA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AiB,EAAE,iBAAiB,IAEnC,KAAK,CAAC,wBAAwB;YAC7B,KAAK,CAAC,wBAAwB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAC/C,CAChB,CACP,CAAC;AACJ,CAAC;AAlHD,kCAkHC","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 \"./FormatPanel.scss\";\nimport * as React from \"react\";\nimport type {\n FormatProps,\n UnitProps,\n UnitsProvider,\n} from \"@itwin/core-quantity\";\nimport { Format, FormatterSpec } from \"@itwin/core-quantity\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FormatPrecision } from \"./FormatPrecision\";\nimport { FormatSample } from \"./FormatSample\";\nimport { FormatTypeOption } from \"./FormatType\";\nimport { FormatUnitLabel } from \"./FormatUnitLabel\";\nimport { FormatUnits } from \"./FormatUnits\";\nimport { MiscFormatOptions } from \"./MiscFormatOptions\";\n\n/** Properties of [[FormatPanel]] component.\n * @alpha\n */\nexport interface FormatPanelProps extends CommonProps {\n initialFormat: FormatProps;\n unitsProvider: UnitsProvider;\n persistenceUnit: Promise<UnitProps> | UnitProps;\n showSample?: boolean;\n initialMagnitude?: number;\n // if true a only primary format properties are initially displayed and a \"More/Less\" link is added.\n enableMinimumProperties?: boolean;\n onFormatChange?: (format: FormatProps) => void;\n provideFormatSpec?: (\n formatProps: FormatProps,\n persistenceUnit: UnitProps,\n unitsProvider: UnitsProvider\n ) => Promise<FormatterSpec>;\n providePrimaryChildren?: (\n formatProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => React.ReactNode;\n provideSecondaryChildren?: (\n formatProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => React.ReactNode;\n}\n\nasync function generateFormatSpec(\n formatProps: FormatProps,\n persistenceUnit: UnitProps,\n unitsProvider: UnitsProvider\n) {\n const actualFormat = await Format.createFromJSON(\n \"custom\",\n unitsProvider,\n formatProps\n );\n return FormatterSpec.create(\n actualFormat.name,\n actualFormat,\n unitsProvider,\n persistenceUnit\n );\n}\n\n/** Component to show/edit Quantity Format.\n * @alpha\n */\nexport function FormatPanel(props: FormatPanelProps) {\n const [formatSpec, setFormatSpec] = React.useState<FormatterSpec>();\n const {\n initialFormat,\n showSample,\n initialMagnitude,\n unitsProvider,\n persistenceUnit,\n onFormatChange,\n provideFormatSpec,\n enableMinimumProperties,\n } = props;\n const [formatProps, setFormatProps] = React.useState(initialFormat);\n const [showOptions, setShowOptions] = React.useState(false);\n\n React.useEffect(() => {\n setFormatProps(initialFormat);\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\n }, [initialFormat]);\n\n const handleUserFormatChanges = React.useCallback(\n (newProps: FormatProps) => {\n setFormatProps(newProps);\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\n onFormatChange && onFormatChange(newProps);\n },\n [onFormatChange]\n );\n\n const isMounted = React.useRef(false);\n\n // runs returned function only when component is unmounted.\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n React.useEffect(() => {\n async function fetchFormatSpec() {\n const pu = await persistenceUnit;\n let newFormatSpec: FormatterSpec;\n if (provideFormatSpec) {\n newFormatSpec = await provideFormatSpec(formatProps, pu, unitsProvider);\n } else {\n newFormatSpec = await generateFormatSpec(\n formatProps,\n pu,\n unitsProvider\n );\n }\n isMounted.current && setFormatSpec(newFormatSpec);\n }\n if (!formatSpec) void fetchFormatSpec();\n }, [\n formatProps,\n formatSpec,\n persistenceUnit,\n provideFormatSpec,\n unitsProvider,\n ]);\n\n const handleFormatChange = React.useCallback(\n (newFormatProps: FormatProps) => {\n handleUserFormatChanges(newFormatProps);\n },\n [handleUserFormatChanges]\n );\n\n const handleShowOptions = React.useCallback((show: boolean) => {\n setShowOptions(show);\n }, []);\n\n return (\n <div className=\"components-quantityFormat-panel\">\n {showSample && (\n <FormatSample\n formatSpec={formatSpec}\n initialMagnitude={initialMagnitude}\n />\n )}\n <FormatUnits\n unitsProvider={unitsProvider}\n persistenceUnit={formatSpec?.persistenceUnit}\n initialFormat={formatProps}\n onUnitsChange={handleFormatChange}\n />\n <FormatUnitLabel\n formatProps={formatProps}\n onUnitLabelChange={handleFormatChange}\n />\n <FormatTypeOption\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n <FormatPrecision\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n {props.providePrimaryChildren &&\n props.providePrimaryChildren(formatProps, handleFormatChange)}\n <MiscFormatOptions\n formatProps={formatProps}\n onChange={handleFormatChange}\n enableMinimumProperties={enableMinimumProperties}\n showOptions={showOptions}\n onShowHideOptions={handleShowOptions}\n >\n {props.provideSecondaryChildren &&\n props.provideSecondaryChildren(formatProps, handleFormatChange)}\n </MiscFormatOptions>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"FormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPanel.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAA4B;AAC5B,6CAA+B;AAM/B,wDAA6D;AAE7D,uDAAoD;AACpD,iDAA8C;AAC9C,6CAAgD;AAChD,uDAAoD;AACpD,+CAA4C;AAC5C,2DAAwD;AA6BxD,KAAK,UAAU,kBAAkB,CAC/B,WAAwB,EACxB,eAA0B,EAC1B,aAA4B;IAE5B,MAAM,YAAY,GAAG,MAAM,sBAAM,CAAC,cAAc,CAC9C,QAAQ,EACR,aAAa,EACb,WAAW,CACZ,CAAC;IACF,OAAO,6BAAa,CAAC,MAAM,CACzB,YAAY,CAAC,IAAI,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,CAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,CAAC,U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IACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,kBAAkB,GAC5B;QACD,KAAK,CAAC,sBAAsB;YAC3B,KAAK,CAAC,sBAAsB,CAAC,WAAW,EAAE,kBAAkB,CAAC;QAC/D,oBAAC,qCAAiB,IAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,kBAAkB,EAC5B,uBAAuB,EAAE,uBAAuB,EAChD,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,IAEnC,KAAK,CAAC,wBAAwB;YAC7B,KAAK,CAAC,wBAAwB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAC/C,CAChB,CACP,CAAC;AACJ,CAAC;AAlHD,kCAkHC","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 \"./FormatPanel.scss\";\nimport * as React from \"react\";\nimport type {\n FormatProps,\n UnitProps,\n UnitsProvider,\n} from \"@itwin/core-quantity\";\nimport { Format, FormatterSpec } from \"@itwin/core-quantity\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FormatPrecision } from \"./FormatPrecision\";\nimport { FormatSample } from \"./FormatSample\";\nimport { FormatTypeOption } from \"./FormatType\";\nimport { FormatUnitLabel } from \"./FormatUnitLabel\";\nimport { FormatUnits } from \"./FormatUnits\";\nimport { MiscFormatOptions } from \"./MiscFormatOptions\";\n\n/** Properties of [[FormatPanel]] component.\n * @alpha\n */\nexport interface FormatPanelProps extends CommonProps {\n initialFormat: FormatProps;\n unitsProvider: UnitsProvider;\n persistenceUnit: Promise<UnitProps> | UnitProps;\n showSample?: boolean;\n initialMagnitude?: number;\n // if true a only primary format properties are initially displayed and a \"More/Less\" link is added.\n enableMinimumProperties?: boolean;\n onFormatChange?: (format: FormatProps) => void;\n provideFormatSpec?: (\n formatProps: FormatProps,\n persistenceUnit: UnitProps,\n unitsProvider: UnitsProvider\n ) => Promise<FormatterSpec>;\n providePrimaryChildren?: (\n formatProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => React.ReactNode;\n provideSecondaryChildren?: (\n formatProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => React.ReactNode;\n}\n\nasync function generateFormatSpec(\n formatProps: FormatProps,\n persistenceUnit: UnitProps,\n unitsProvider: UnitsProvider\n) {\n const actualFormat = await Format.createFromJSON(\n \"custom\",\n unitsProvider,\n formatProps\n );\n return FormatterSpec.create(\n actualFormat.name,\n actualFormat,\n unitsProvider,\n persistenceUnit\n );\n}\n\n/** Component to show/edit Quantity Format.\n * @alpha\n */\nexport function FormatPanel(props: FormatPanelProps) {\n const [formatSpec, setFormatSpec] = React.useState<FormatterSpec>();\n const {\n initialFormat,\n showSample,\n initialMagnitude,\n unitsProvider,\n persistenceUnit,\n onFormatChange,\n provideFormatSpec,\n enableMinimumProperties,\n } = props;\n const [formatProps, setFormatProps] = React.useState(initialFormat);\n const [showOptions, setShowOptions] = React.useState(false);\n\n React.useEffect(() => {\n setFormatProps(initialFormat);\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\n }, [initialFormat]);\n\n const handleUserFormatChanges = React.useCallback(\n (newProps: FormatProps) => {\n setFormatProps(newProps);\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\n onFormatChange && onFormatChange(newProps);\n },\n [onFormatChange]\n );\n\n const isMounted = React.useRef(false);\n\n // runs returned function only when component is unmounted.\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n React.useEffect(() => {\n async function fetchFormatSpec() {\n const pu = await persistenceUnit;\n let newFormatSpec: FormatterSpec;\n if (provideFormatSpec) {\n newFormatSpec = await provideFormatSpec(formatProps, pu, unitsProvider);\n } else {\n newFormatSpec = await generateFormatSpec(\n formatProps,\n pu,\n unitsProvider\n );\n }\n isMounted.current && setFormatSpec(newFormatSpec);\n }\n if (!formatSpec) void fetchFormatSpec();\n }, [\n formatProps,\n formatSpec,\n persistenceUnit,\n provideFormatSpec,\n unitsProvider,\n ]);\n\n const handleFormatChange = React.useCallback(\n (newFormatProps: FormatProps) => {\n handleUserFormatChanges(newFormatProps);\n },\n [handleUserFormatChanges]\n );\n\n const handleShowOptions = React.useCallback((show: boolean) => {\n setShowOptions(show);\n }, []);\n\n return (\n <div className=\"components-quantityFormat-panel\">\n {showSample && (\n <FormatSample\n formatSpec={formatSpec}\n initialMagnitude={initialMagnitude}\n />\n )}\n <FormatUnits\n unitsProvider={unitsProvider}\n persistenceUnit={formatSpec?.persistenceUnit}\n initialFormat={formatProps}\n onUnitsChange={handleFormatChange}\n />\n <FormatUnitLabel\n formatProps={formatProps}\n onUnitLabelChange={handleFormatChange}\n />\n <FormatTypeOption\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n <FormatPrecision\n formatProps={formatProps}\n onChange={handleFormatChange}\n />\n {props.providePrimaryChildren &&\n props.providePrimaryChildren(formatProps, handleFormatChange)}\n <MiscFormatOptions\n formatProps={formatProps}\n onChange={handleFormatChange}\n enableMinimumProperties={enableMinimumProperties}\n showOptions={showOptions}\n onShowHideOptions={handleShowOptions}\n >\n {props.provideSecondaryChildren &&\n props.provideSecondaryChildren(formatProps, handleFormatChange)}\n </MiscFormatOptions>\n </div>\n );\n}\n"]}
@@ -35,21 +35,22 @@ const React = __importStar(require("react"));
35
35
  const core_quantity_1 = require("@itwin/core-quantity");
36
36
  const DecimalPrecision_1 = require("./misc/DecimalPrecision");
37
37
  const FractionPrecision_1 = require("./misc/FractionPrecision");
38
- const UiIModelComponents_1 = require("../UiIModelComponents");
38
+ const useTranslation_1 = require("../useTranslation");
39
39
  /** Component to show/edit Quantity Format Precision.
40
40
  * @alpha
41
41
  */
42
42
  function FormatPrecision(props) {
43
+ var _a, _b;
43
44
  const { formatProps, onChange } = props;
45
+ const { translate } = (0, useTranslation_1.useTranslation)();
44
46
  const handlePrecisionChange = React.useCallback((precision) => {
45
47
  const newFormatProps = { ...formatProps, precision };
46
48
  onChange && onChange(newFormatProps);
47
49
  }, [formatProps, onChange]);
48
50
  const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
49
- const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.precision"));
50
51
  return (React.createElement(React.Fragment, null,
51
- React.createElement("span", { className: "uicore-label" }, label.current),
52
- formatType === core_quantity_1.FormatType.Fractional ? (React.createElement(FractionPrecision_1.FractionPrecisionSelector, { "data-testid": "fraction-precision-selector", precision: formatProps.precision ?? 0, onChange: handlePrecisionChange })) : (React.createElement(DecimalPrecision_1.DecimalPrecisionSelector, { "data-testid": "decimal-precision-selector", precision: formatProps.precision ?? 0, onChange: handlePrecisionChange }))));
52
+ React.createElement("span", { className: "uicore-label" }, translate("QuantityFormat.labels.precision")),
53
+ formatType === core_quantity_1.FormatType.Fractional ? (React.createElement(FractionPrecision_1.FractionPrecisionSelector, { "data-testid": "fraction-precision-selector", precision: (_a = formatProps.precision) !== null && _a !== void 0 ? _a : 0, onChange: handlePrecisionChange })) : (React.createElement(DecimalPrecision_1.DecimalPrecisionSelector, { "data-testid": "decimal-precision-selector", precision: (_b = formatProps.precision) !== null && _b !== void 0 ? _b : 0, onChange: handlePrecisionChange }))));
53
54
  }
54
55
  exports.FormatPrecision = FormatPrecision;
55
56
  //# sourceMappingURL=FormatPrecision.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatPrecision.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAAmE;AACnE,8DAAmE;AACnE,gEAAqE;AACrE,8DAA2D;AAU3D;;GAEG;AACH,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW,CAC7C,CAAC,SAAiB,EAAE,EAAE;QACpB,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,SAAS,EAAE,CAAC;QACrD,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,CAAC,CACxB,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CACxB,uCAAkB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAChE,CAAC;IACF,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,cAAc,IAAG,KAAK,CAAC,OAAO,CAAQ;QACtD,UAAU,KAAK,0BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CACtC,oBAAC,6CAAyB,mBACZ,6BAA6B,EACzC,SAAS,EAAE,WAAW,CAAC,SAAS,IAAI,CAAC,EACrC,QAAQ,EAAE,qBAAqB,GAC/B,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,2CAAwB,mBACX,4BAA4B,EACxC,SAAS,EAAE,WAAW,CAAC,SAAS,IAAI,CAAC,EACrC,QAAQ,EAAE,qBAAqB,GAC/B,CACH,CACA,CACJ,CAAC;AACJ,CAAC;AAlCD,0CAkCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { FormatProps } from \"@itwin/core-quantity\";\nimport { FormatType, parseFormatType } from \"@itwin/core-quantity\";\nimport { DecimalPrecisionSelector } from \"./misc/DecimalPrecision\";\nimport { FractionPrecisionSelector } from \"./misc/FractionPrecision\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\n/** Properties of [[FormatPrecision]] component.\n * @alpha\n */\nexport interface FormatPrecisionProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n}\n\n/** Component to show/edit Quantity Format Precision.\n * @alpha\n */\nexport function FormatPrecision(props: FormatPrecisionProps) {\n const { formatProps, onChange } = props;\n\n const handlePrecisionChange = React.useCallback(\n (precision: number) => {\n const newFormatProps = { ...formatProps, precision };\n onChange && onChange(newFormatProps);\n },\n [formatProps, onChange]\n );\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n\n const label = React.useRef(\n UiIModelComponents.translate(\"QuantityFormat.labels.precision\")\n );\n return (\n <>\n <span className={\"uicore-label\"}>{label.current}</span>\n {formatType === FormatType.Fractional ? (\n <FractionPrecisionSelector\n data-testid=\"fraction-precision-selector\"\n precision={formatProps.precision ?? 0}\n onChange={handlePrecisionChange}\n />\n ) : (\n <DecimalPrecisionSelector\n data-testid=\"decimal-precision-selector\"\n precision={formatProps.precision ?? 0}\n onChange={handlePrecisionChange}\n />\n )}\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"FormatPrecision.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAAmE;AACnE,8DAAmE;AACnE,gEAAqE;AACrE,sDAAmD;AAUnD;;GAEG;AACH,SAAgB,eAAe,CAAC,KAA2B;;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAEvC,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW,CAC7C,CAAC,SAAiB,EAAE,EAAE;QACpB,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,SAAS,EAAE,CAAC;QACrD,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,CAAC,CACxB,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE/D,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,cAAc,IAC5B,SAAS,CAAC,iCAAiC,CAAC,CACxC;QACN,UAAU,KAAK,0BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CACtC,oBAAC,6CAAyB,mBACZ,6BAA6B,EACzC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EACrC,QAAQ,EAAE,qBAAqB,GAC/B,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,2CAAwB,mBACX,4BAA4B,EACxC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EACrC,QAAQ,EAAE,qBAAqB,GAC/B,CACH,CACA,CACJ,CAAC;AACJ,CAAC;AAlCD,0CAkCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { FormatProps } from \"@itwin/core-quantity\";\nimport { FormatType, parseFormatType } from \"@itwin/core-quantity\";\nimport { DecimalPrecisionSelector } from \"./misc/DecimalPrecision\";\nimport { FractionPrecisionSelector } from \"./misc/FractionPrecision\";\nimport { useTranslation } from \"../useTranslation\";\n\n/** Properties of [[FormatPrecision]] component.\n * @alpha\n */\nexport interface FormatPrecisionProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n}\n\n/** Component to show/edit Quantity Format Precision.\n * @alpha\n */\nexport function FormatPrecision(props: FormatPrecisionProps) {\n const { formatProps, onChange } = props;\n const { translate } = useTranslation();\n\n const handlePrecisionChange = React.useCallback(\n (precision: number) => {\n const newFormatProps = { ...formatProps, precision };\n onChange && onChange(newFormatProps);\n },\n [formatProps, onChange]\n );\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n\n return (\n <>\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.precision\")}\n </span>\n {formatType === FormatType.Fractional ? (\n <FractionPrecisionSelector\n data-testid=\"fraction-precision-selector\"\n precision={formatProps.precision ?? 0}\n onChange={handlePrecisionChange}\n />\n ) : (\n <DecimalPrecisionSelector\n data-testid=\"decimal-precision-selector\"\n precision={formatProps.precision ?? 0}\n onChange={handlePrecisionChange}\n />\n )}\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormatSample.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAuFpD"}
1
+ {"version":3,"file":"FormatSample.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAqFpD"}
@@ -35,18 +35,19 @@ const React = __importStar(require("react"));
35
35
  const ts_key_enum_1 = require("ts-key-enum");
36
36
  const core_react_1 = require("@itwin/core-react");
37
37
  const itwinui_react_1 = require("@itwin/itwinui-react");
38
- const UiIModelComponents_1 = require("../UiIModelComponents");
39
38
  const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
39
+ const useTranslation_1 = require("../useTranslation");
40
40
  /** Component to show the persistence value and formatted value given a FormatterSpec.
41
41
  * @alpha
42
42
  */
43
43
  function FormatSample(props) {
44
44
  const { initialMagnitude, formatSpec, hideLabels } = props;
45
- const initialValue = initialMagnitude ?? 0;
45
+ const { translate } = (0, useTranslation_1.useTranslation)();
46
+ const initialValue = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
46
47
  const [magnitude, setMagnitude] = React.useState(initialValue);
47
48
  const [sampleValue, setSampleValue] = React.useState(initialValue.toString());
48
49
  React.useEffect(() => {
49
- const value = initialMagnitude ?? 0;
50
+ const value = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
50
51
  setMagnitude(value);
51
52
  setSampleValue(value.toString());
52
53
  }, [initialMagnitude]);
@@ -77,14 +78,12 @@ function FormatSample(props) {
77
78
  const formattedValue = formatSpec
78
79
  ? formatSpec.applyFormatting(magnitude)
79
80
  : "";
80
- const valueLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.value"));
81
- const formattedLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.formatted"));
82
81
  return (React.createElement(React.Fragment, null,
83
- !hideLabels && (React.createElement("span", { className: "uicore-label" }, valueLabel.current)),
82
+ !hideLabels && (React.createElement("span", { className: "uicore-label" }, translate("QuantityFormat.labels.value"))),
84
83
  React.createElement("span", { className: "components-inline" },
85
84
  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" }),
86
85
  activePersistenceUnitLabel),
87
- !hideLabels && (React.createElement("span", { className: "uicore-label" }, formattedLabel.current)),
86
+ !hideLabels && (React.createElement("span", { className: "uicore-label" }, translate("QuantityFormat.labels.formatted"))),
88
87
  React.createElement("span", { "data-testid": "progress-forward" },
89
88
  hideLabels && formattedValue.length > 0 && (React.createElement(core_react_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgProgressForward, null) })),
90
89
  React.createElement("span", { "data-testid": "format-sample-formatted", className: "uicore-label components-quantity-formatted-sample" }, formattedValue))));
@@ -1 +1 @@
1
- {"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,6CAAkC;AAGlC,kDAAyC;AACzC,wDAA6C;AAC7C,8DAA2D;AAC3D,oEAAgE;AAWhE;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,YAAY,GAAG,gBAAgB,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/D,MAAM,CAAC,WAAW,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ACJ,CAAC;AAvFD,oCAuFC","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 { Key } from \"ts-key-enum\";\nimport type { FormatterSpec } from \"@itwin/core-quantity\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { SvgProgressForward } from \"@itwin/itwinui-icons-react\";\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)) newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n }, [sampleValue]);\n\n const handleOnValueChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setSampleValue(event.target.value);\n },\n []\n );\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (e.key === Key.Enter.valueOf()) {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue)) newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n e.preventDefault();\n }\n },\n [sampleValue]\n );\n\n const activePersistenceUnitLabel = formatSpec\n ? formatSpec.persistenceUnit.label\n : \"\";\n const formattedValue = formatSpec\n ? formatSpec.applyFormatting(magnitude)\n : \"\";\n\n const valueLabel = React.useRef(\n UiIModelComponents.translate(\"QuantityFormat.labels.value\")\n );\n const formattedLabel = React.useRef(\n UiIModelComponents.translate(\"QuantityFormat.labels.formatted\")\n );\n\n return (\n <>\n {!hideLabels && (\n <span className={\"uicore-label\"}>{valueLabel.current}</span>\n )}\n <span className=\"components-inline\">\n <Input\n data-testid=\"format-sample-input\"\n className=\"components-quantity-persistence-input\"\n value={sampleValue}\n onChange={handleOnValueChange}\n onKeyDown={handleKeyDown}\n onBlur={handleOnValueBlur}\n size=\"small\"\n />\n {activePersistenceUnitLabel}\n </span>\n {!hideLabels && (\n <span className={\"uicore-label\"}>{formattedLabel.current}</span>\n )}\n <span data-testid=\"progress-forward\">\n {hideLabels && formattedValue.length > 0 && (\n <Icon iconSpec={<SvgProgressForward />} />\n )}\n <span\n data-testid=\"format-sample-formatted\"\n className={\"uicore-label components-quantity-formatted-sample\"}\n >\n {formattedValue}\n </span>\n </span>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,6CAAkC;AAGlC,kDAAyC;AACzC,wDAA6C;AAC7C,oEAAgE;AAChE,sDAAmD;AAWnD;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,YAAY,GAAG,gBAAgB,aAAhB,gBAAgB,cAA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AArFD,oCAqFC","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 { Key } from \"ts-key-enum\";\nimport type { FormatterSpec } from \"@itwin/core-quantity\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { SvgProgressForward } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../useTranslation\";\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 { translate } = useTranslation();\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)) newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n }, [sampleValue]);\n\n const handleOnValueChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setSampleValue(event.target.value);\n },\n []\n );\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (e.key === Key.Enter.valueOf()) {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue)) newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n e.preventDefault();\n }\n },\n [sampleValue]\n );\n\n const activePersistenceUnitLabel = formatSpec\n ? formatSpec.persistenceUnit.label\n : \"\";\n const formattedValue = formatSpec\n ? formatSpec.applyFormatting(magnitude)\n : \"\";\n\n return (\n <>\n {!hideLabels && (\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.value\")}\n </span>\n )}\n <span className=\"components-inline\">\n <Input\n data-testid=\"format-sample-input\"\n className=\"components-quantity-persistence-input\"\n value={sampleValue}\n onChange={handleOnValueChange}\n onKeyDown={handleKeyDown}\n onBlur={handleOnValueBlur}\n size=\"small\"\n />\n {activePersistenceUnitLabel}\n </span>\n {!hideLabels && (\n <span className={\"uicore-label\"}>\n {translate(\"QuantityFormat.labels.formatted\")}\n </span>\n )}\n <span data-testid=\"progress-forward\">\n {hideLabels && formattedValue.length > 0 && (\n <Icon iconSpec={<SvgProgressForward />} />\n )}\n <span\n data-testid=\"format-sample-formatted\"\n className={\"uicore-label components-quantity-formatted-sample\"}\n >\n {formattedValue}\n </span>\n </span>\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormatType.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA+DxD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAyD5D"}
1
+ {"version":3,"file":"FormatType.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAiExD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAwD5D"}