@itwin/imodel-components-react 3.4.0-dev.46 → 3.4.0-dev.48

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 (342) hide show
  1. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  4. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +186 -186
  6. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
  8. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  9. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
  12. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  13. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  15. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  23. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  24. package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  27. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
  29. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  30. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  31. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  32. package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
  33. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  34. package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
  35. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  36. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  37. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  38. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  39. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
  40. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  41. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  42. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  43. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
  44. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  46. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  47. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
  48. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  49. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +265 -265
  51. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  53. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
  55. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  57. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
  59. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  60. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  61. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  62. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
  63. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  64. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  65. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +634 -634
  67. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  68. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  69. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  72. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  73. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +83 -83
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  92. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +154 -154
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  128. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  131. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  134. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  138. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
  142. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
  146. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  150. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  151. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  154. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  155. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +358 -358
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  159. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  162. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  163. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  168. package/lib/cjs/imodel-components-react.d.ts +82 -82
  169. package/lib/cjs/imodel-components-react.js +101 -101
  170. package/lib/cjs/imodel-components-react.js.map +1 -1
  171. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  172. package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -75
  173. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  174. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  175. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  176. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  177. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  178. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  179. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
  180. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  181. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
  182. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  183. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  184. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  185. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  186. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
  187. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  188. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  189. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  193. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  194. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  195. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  196. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  197. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  198. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  199. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  200. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  201. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  202. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  203. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  204. package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
  205. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  206. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  207. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  208. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  209. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  210. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  211. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  212. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  213. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  214. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  215. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  216. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  217. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  218. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  219. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  220. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
  221. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  222. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  223. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  224. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  225. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  226. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  227. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  228. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
  229. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  230. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  231. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  232. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  233. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  234. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  235. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  236. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +606 -606
  237. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  238. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  239. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  240. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
  241. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  242. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  243. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  244. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  245. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  246. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  247. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  248. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  249. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  250. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  251. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +60 -60
  252. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  253. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  254. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  255. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  256. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  257. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  258. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  259. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  260. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  261. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  262. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  263. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  264. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  265. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  266. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +131 -131
  267. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  268. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  269. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  270. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  271. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  272. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  273. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  274. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  275. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  276. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  277. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  278. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  279. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  280. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  281. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  282. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  283. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  284. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  285. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  286. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  287. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  288. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  289. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  290. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  291. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  292. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  293. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  294. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  295. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  296. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  297. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  298. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  299. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
  300. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  301. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  302. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  303. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  304. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  305. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  306. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  307. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  308. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  309. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
  310. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  311. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
  312. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  313. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  314. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  315. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
  316. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  317. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
  318. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  319. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  320. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  321. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  322. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  323. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  324. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  325. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  326. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +332 -332
  327. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  328. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  329. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
  330. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  331. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  332. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  333. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  334. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  335. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  336. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
  337. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  338. package/lib/esm/imodel-components-react.d.ts +82 -82
  339. package/lib/esm/imodel-components-react.js +87 -87
  340. package/lib/esm/imodel-components-react.js.map +1 -1
  341. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  342. package/package.json +19 -19
@@ -1,27 +1,27 @@
1
- /** @packageDocumentation
2
- * @module QuantityFormat
3
- */
4
- import "./FormatPanel.scss";
5
- import * as React from "react";
6
- import { FormatProps, FormatterSpec, UnitProps, UnitsProvider } from "@itwin/core-quantity";
7
- import { CommonProps } from "@itwin/core-react";
8
- /** Properties of [[FormatPanel]] component.
9
- * @alpha
10
- */
11
- export interface FormatPanelProps extends CommonProps {
12
- initialFormat: FormatProps;
13
- unitsProvider: UnitsProvider;
14
- persistenceUnit: Promise<UnitProps> | UnitProps;
15
- showSample?: boolean;
16
- initialMagnitude?: number;
17
- enableMinimumProperties?: boolean;
18
- onFormatChange?: (format: FormatProps) => void;
19
- provideFormatSpec?: (formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec>;
20
- providePrimaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;
21
- provideSecondaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;
22
- }
23
- /** Component to show/edit Quantity Format.
24
- * @alpha
25
- */
26
- export declare function FormatPanel(props: FormatPanelProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module QuantityFormat
3
+ */
4
+ import "./FormatPanel.scss";
5
+ import * as React from "react";
6
+ import { FormatProps, FormatterSpec, UnitProps, UnitsProvider } from "@itwin/core-quantity";
7
+ import { CommonProps } from "@itwin/core-react";
8
+ /** Properties of [[FormatPanel]] component.
9
+ * @alpha
10
+ */
11
+ export interface FormatPanelProps extends CommonProps {
12
+ initialFormat: FormatProps;
13
+ unitsProvider: UnitsProvider;
14
+ persistenceUnit: Promise<UnitProps> | UnitProps;
15
+ showSample?: boolean;
16
+ initialMagnitude?: number;
17
+ enableMinimumProperties?: boolean;
18
+ onFormatChange?: (format: FormatProps) => void;
19
+ provideFormatSpec?: (formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec>;
20
+ providePrimaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;
21
+ provideSecondaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;
22
+ }
23
+ /** Component to show/edit Quantity Format.
24
+ * @alpha
25
+ */
26
+ export declare function FormatPanel(props: FormatPanelProps): JSX.Element;
27
27
  //# sourceMappingURL=FormatPanel.d.ts.map
@@ -1,100 +1,100 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module QuantityFormat
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FormatPanel = void 0;
30
- require("./FormatPanel.scss");
31
- const React = __importStar(require("react"));
32
- const core_quantity_1 = require("@itwin/core-quantity");
33
- const FormatPrecision_1 = require("./FormatPrecision");
34
- const FormatSample_1 = require("./FormatSample");
35
- const FormatType_1 = require("./FormatType");
36
- const FormatUnitLabel_1 = require("./FormatUnitLabel");
37
- const FormatUnits_1 = require("./FormatUnits");
38
- const MiscFormatOptions_1 = require("./MiscFormatOptions");
39
- async function generateFormatSpec(formatProps, persistenceUnit, unitsProvider) {
40
- const actualFormat = await core_quantity_1.Format.createFromJSON("custom", unitsProvider, formatProps);
41
- return core_quantity_1.FormatterSpec.create(actualFormat.name, actualFormat, unitsProvider, persistenceUnit);
42
- }
43
- /** Component to show/edit Quantity Format.
44
- * @alpha
45
- */
46
- function FormatPanel(props) {
47
- const [formatSpec, setFormatSpec] = React.useState();
48
- const { initialFormat, showSample, initialMagnitude, unitsProvider, persistenceUnit, onFormatChange, provideFormatSpec, enableMinimumProperties } = props;
49
- const [formatProps, setFormatProps] = React.useState(initialFormat);
50
- const [showOptions, setShowOptions] = React.useState(false);
51
- React.useEffect(() => {
52
- setFormatProps(initialFormat);
53
- setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook
54
- }, [initialFormat]);
55
- const handleUserFormatChanges = React.useCallback((newProps) => {
56
- setFormatProps(newProps);
57
- setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook
58
- onFormatChange && onFormatChange(newProps);
59
- }, [onFormatChange]);
60
- const isMounted = React.useRef(false);
61
- // runs returned function only when component is unmounted.
62
- React.useEffect(() => {
63
- isMounted.current = true;
64
- return (() => {
65
- isMounted.current = false;
66
- });
67
- }, []);
68
- React.useEffect(() => {
69
- async function fetchFormatSpec() {
70
- const pu = await persistenceUnit;
71
- let newFormatSpec;
72
- if (provideFormatSpec) {
73
- newFormatSpec = await provideFormatSpec(formatProps, pu, unitsProvider);
74
- }
75
- else {
76
- newFormatSpec = await generateFormatSpec(formatProps, pu, unitsProvider);
77
- }
78
- isMounted.current && setFormatSpec(newFormatSpec);
79
- }
80
- if (!formatSpec)
81
- fetchFormatSpec(); // eslint-disable-line @typescript-eslint/no-floating-promises
82
- }, [formatProps, formatSpec, persistenceUnit, provideFormatSpec, unitsProvider]);
83
- const handleFormatChange = React.useCallback((newFormatProps) => {
84
- handleUserFormatChanges(newFormatProps);
85
- }, [handleUserFormatChanges]);
86
- const handleShowOptions = React.useCallback((show) => {
87
- setShowOptions(show);
88
- }, []);
89
- return (React.createElement("div", { className: "components-quantityFormat-panel" },
90
- showSample &&
91
- React.createElement(FormatSample_1.FormatSample, { formatSpec: formatSpec, initialMagnitude: initialMagnitude }),
92
- React.createElement(FormatUnits_1.FormatUnits, { unitsProvider: unitsProvider, persistenceUnit: formatSpec === null || formatSpec === void 0 ? void 0 : formatSpec.persistenceUnit, initialFormat: formatProps, onUnitsChange: handleFormatChange }),
93
- React.createElement(FormatUnitLabel_1.FormatUnitLabel, { formatProps: formatProps, onUnitLabelChange: handleFormatChange }),
94
- React.createElement(FormatType_1.FormatTypeOption, { formatProps: formatProps, onChange: handleFormatChange }),
95
- React.createElement(FormatPrecision_1.FormatPrecision, { formatProps: formatProps, onChange: handleFormatChange }),
96
- props.providePrimaryChildren && props.providePrimaryChildren(formatProps, handleFormatChange),
97
- React.createElement(MiscFormatOptions_1.MiscFormatOptions, { formatProps: formatProps, onChange: handleFormatChange, enableMinimumProperties: enableMinimumProperties, showOptions: showOptions, onShowHideOptions: handleShowOptions }, props.provideSecondaryChildren && props.provideSecondaryChildren(formatProps, handleFormatChange))));
98
- }
99
- exports.FormatPanel = FormatPanel;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module QuantityFormat
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FormatPanel = void 0;
30
+ require("./FormatPanel.scss");
31
+ const React = __importStar(require("react"));
32
+ const core_quantity_1 = require("@itwin/core-quantity");
33
+ const FormatPrecision_1 = require("./FormatPrecision");
34
+ const FormatSample_1 = require("./FormatSample");
35
+ const FormatType_1 = require("./FormatType");
36
+ const FormatUnitLabel_1 = require("./FormatUnitLabel");
37
+ const FormatUnits_1 = require("./FormatUnits");
38
+ const MiscFormatOptions_1 = require("./MiscFormatOptions");
39
+ async function generateFormatSpec(formatProps, persistenceUnit, unitsProvider) {
40
+ const actualFormat = await core_quantity_1.Format.createFromJSON("custom", unitsProvider, formatProps);
41
+ return core_quantity_1.FormatterSpec.create(actualFormat.name, actualFormat, unitsProvider, persistenceUnit);
42
+ }
43
+ /** Component to show/edit Quantity Format.
44
+ * @alpha
45
+ */
46
+ function FormatPanel(props) {
47
+ const [formatSpec, setFormatSpec] = React.useState();
48
+ const { initialFormat, showSample, initialMagnitude, unitsProvider, persistenceUnit, onFormatChange, provideFormatSpec, enableMinimumProperties } = props;
49
+ const [formatProps, setFormatProps] = React.useState(initialFormat);
50
+ const [showOptions, setShowOptions] = React.useState(false);
51
+ React.useEffect(() => {
52
+ setFormatProps(initialFormat);
53
+ setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook
54
+ }, [initialFormat]);
55
+ const handleUserFormatChanges = React.useCallback((newProps) => {
56
+ setFormatProps(newProps);
57
+ setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook
58
+ onFormatChange && onFormatChange(newProps);
59
+ }, [onFormatChange]);
60
+ const isMounted = React.useRef(false);
61
+ // runs returned function only when component is unmounted.
62
+ React.useEffect(() => {
63
+ isMounted.current = true;
64
+ return (() => {
65
+ isMounted.current = false;
66
+ });
67
+ }, []);
68
+ React.useEffect(() => {
69
+ async function fetchFormatSpec() {
70
+ const pu = await persistenceUnit;
71
+ let newFormatSpec;
72
+ if (provideFormatSpec) {
73
+ newFormatSpec = await provideFormatSpec(formatProps, pu, unitsProvider);
74
+ }
75
+ else {
76
+ newFormatSpec = await generateFormatSpec(formatProps, pu, unitsProvider);
77
+ }
78
+ isMounted.current && setFormatSpec(newFormatSpec);
79
+ }
80
+ if (!formatSpec)
81
+ fetchFormatSpec(); // eslint-disable-line @typescript-eslint/no-floating-promises
82
+ }, [formatProps, formatSpec, persistenceUnit, provideFormatSpec, unitsProvider]);
83
+ const handleFormatChange = React.useCallback((newFormatProps) => {
84
+ handleUserFormatChanges(newFormatProps);
85
+ }, [handleUserFormatChanges]);
86
+ const handleShowOptions = React.useCallback((show) => {
87
+ setShowOptions(show);
88
+ }, []);
89
+ return (React.createElement("div", { className: "components-quantityFormat-panel" },
90
+ showSample &&
91
+ React.createElement(FormatSample_1.FormatSample, { formatSpec: formatSpec, initialMagnitude: initialMagnitude }),
92
+ React.createElement(FormatUnits_1.FormatUnits, { unitsProvider: unitsProvider, persistenceUnit: formatSpec === null || formatSpec === void 0 ? void 0 : formatSpec.persistenceUnit, initialFormat: formatProps, onUnitsChange: handleFormatChange }),
93
+ React.createElement(FormatUnitLabel_1.FormatUnitLabel, { formatProps: formatProps, onUnitLabelChange: handleFormatChange }),
94
+ React.createElement(FormatType_1.FormatTypeOption, { formatProps: formatProps, onChange: handleFormatChange }),
95
+ React.createElement(FormatPrecision_1.FormatPrecision, { formatProps: formatProps, onChange: handleFormatChange }),
96
+ props.providePrimaryChildren && props.providePrimaryChildren(formatProps, handleFormatChange),
97
+ React.createElement(MiscFormatOptions_1.MiscFormatOptions, { formatProps: formatProps, onChange: handleFormatChange, enableMinimumProperties: enableMinimumProperties, showOptions: showOptions, onShowHideOptions: handleShowOptions }, props.provideSecondaryChildren && props.provideSecondaryChildren(formatProps, handleFormatChange))));
98
+ }
99
+ exports.FormatPanel = FormatPanel;
100
100
  //# sourceMappingURL=FormatPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPanel.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/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QAC5D,cAAc,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC7C,UAAU;YACT,oBAAC,2BAAY,IAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,GAAI;QAE9E,oBAAC,yBAAW,IAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,GAAI;QAC1J,oBAAC,iCAAe,IAAC,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,GAAI;QACpF,oBAAC,6BAAgB,IAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,GAAI;QAC5E,oBAAC,iCAAe,IAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,GAAI;QAC1E,KAAK,CAAC,sBAAsB,IAAI,KAAK,CAAC,sBAAsB,CAAC,WAAW,EAAE,kBAAkB,CAAC;QAC9F,oBAAC,qCAAiB,IAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,IACxL,KAAK,CAAC,wBAAwB,IAAI,KAAK,CAAC,wBAAwB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAChF,CAChB,CACP,CAAC;AACJ,CAAC;AAjED,kCAiEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module QuantityFormat\r\n */\r\n\r\nimport \"./FormatPanel.scss\";\r\nimport * as React from \"react\";\r\nimport { Format, FormatProps, FormatterSpec, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { FormatPrecision } from \"./FormatPrecision\";\r\nimport { FormatSample } from \"./FormatSample\";\r\nimport { FormatTypeOption } from \"./FormatType\";\r\nimport { FormatUnitLabel } from \"./FormatUnitLabel\";\r\nimport { FormatUnits } from \"./FormatUnits\";\r\nimport { MiscFormatOptions } from \"./MiscFormatOptions\";\r\n\r\n/** Properties of [[FormatPanel]] component.\r\n * @alpha\r\n */\r\nexport interface FormatPanelProps extends CommonProps {\r\n initialFormat: FormatProps;\r\n unitsProvider: UnitsProvider;\r\n persistenceUnit: Promise<UnitProps> | UnitProps;\r\n showSample?: boolean;\r\n initialMagnitude?: number;\r\n // if true a only primary format properties are initially displayed and a \"More/Less\" link is added.\r\n enableMinimumProperties?: boolean;\r\n onFormatChange?: (format: FormatProps) => void;\r\n provideFormatSpec?: (formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec>;\r\n providePrimaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;\r\n provideSecondaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;\r\n}\r\n\r\nasync function generateFormatSpec(formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) {\r\n const actualFormat = await Format.createFromJSON(\"custom\", unitsProvider, formatProps);\r\n return FormatterSpec.create(actualFormat.name, actualFormat, unitsProvider, persistenceUnit);\r\n}\r\n\r\n/** Component to show/edit Quantity Format.\r\n * @alpha\r\n */\r\nexport function FormatPanel(props: FormatPanelProps) {\r\n const [formatSpec, setFormatSpec] = React.useState<FormatterSpec>();\r\n const { initialFormat, showSample, initialMagnitude, unitsProvider, persistenceUnit, onFormatChange, provideFormatSpec, enableMinimumProperties } = props;\r\n const [formatProps, setFormatProps] = React.useState(initialFormat);\r\n const [showOptions, setShowOptions] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n setFormatProps(initialFormat);\r\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\r\n }, [initialFormat]);\r\n\r\n const handleUserFormatChanges = React.useCallback((newProps: FormatProps) => {\r\n setFormatProps(newProps);\r\n setFormatSpec(undefined); // this will trigger the new spec to be created in the useEffect hook\r\n onFormatChange && onFormatChange(newProps);\r\n }, [onFormatChange]);\r\n\r\n const isMounted = React.useRef(false);\r\n\r\n // runs returned function only when component is unmounted.\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n return (() => {\r\n isMounted.current = false;\r\n });\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n async function fetchFormatSpec() {\r\n const pu = await persistenceUnit;\r\n let newFormatSpec: FormatterSpec;\r\n if (provideFormatSpec) {\r\n newFormatSpec = await provideFormatSpec(formatProps, pu, unitsProvider);\r\n } else {\r\n newFormatSpec = await generateFormatSpec(formatProps, pu, unitsProvider);\r\n }\r\n isMounted.current && setFormatSpec(newFormatSpec);\r\n }\r\n if (!formatSpec)\r\n fetchFormatSpec(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [formatProps, formatSpec, persistenceUnit, provideFormatSpec, unitsProvider]);\r\n\r\n const handleFormatChange = React.useCallback((newFormatProps: FormatProps) => {\r\n handleUserFormatChanges(newFormatProps);\r\n }, [handleUserFormatChanges]);\r\n\r\n const handleShowOptions = React.useCallback((show: boolean) => {\r\n setShowOptions(show);\r\n }, []);\r\n\r\n return (\r\n <div className=\"components-quantityFormat-panel\">\r\n {showSample &&\r\n <FormatSample formatSpec={formatSpec} initialMagnitude={initialMagnitude} />\r\n }\r\n <FormatUnits unitsProvider={unitsProvider} persistenceUnit={formatSpec?.persistenceUnit} initialFormat={formatProps} onUnitsChange={handleFormatChange} />\r\n <FormatUnitLabel formatProps={formatProps} onUnitLabelChange={handleFormatChange} />\r\n <FormatTypeOption formatProps={formatProps} onChange={handleFormatChange} />\r\n <FormatPrecision formatProps={formatProps} onChange={handleFormatChange} />\r\n {props.providePrimaryChildren && props.providePrimaryChildren(formatProps, handleFormatChange)}\r\n <MiscFormatOptions formatProps={formatProps} onChange={handleFormatChange} enableMinimumProperties={enableMinimumProperties} showOptions={showOptions} onShowHideOptions={handleShowOptions}>\r\n {props.provideSecondaryChildren && props.provideSecondaryChildren(formatProps, handleFormatChange)}\r\n </MiscFormatOptions>\r\n </div>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"FormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPanel.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAA4B;AAC5B,6CAA+B;AAC/B,wDAAoG;AAEpG,uDAAoD;AACpD,iDAA8C;AAC9C,6CAAgD;AAChD,uDAAoD;AACpD,+CAA4C;AAC5C,2DAAwD;AAmBxD,KAAK,UAAU,kBAAkB,CAAC,WAAwB,EAAE,eAA0B,EAAE,aAA4B;IAClH,MAAM,YAAY,GAAG,MAAM,sBAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;IACvF,OAAO,6BAAa,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAC/F,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAiB,CAAC;IACpE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,GAAG,KAAK,CAAC;IAC1J,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACpE,MAAM,CAAC,WAAW,EAAE,cAAc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,iBAAiB,IACxL,KAAK,CAAC,wBAAwB,IAAI,KAAK,CAAC,wBAAwB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAChF,CAChB,CACP,CAAC;AACJ,CAAC;AAjED,kCAiEC","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 { Format, FormatProps, FormatterSpec, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\nimport { 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?: (formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) => Promise<FormatterSpec>;\n providePrimaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;\n provideSecondaryChildren?: (formatProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => React.ReactNode;\n}\n\nasync function generateFormatSpec(formatProps: FormatProps, persistenceUnit: UnitProps, unitsProvider: UnitsProvider) {\n const actualFormat = await Format.createFromJSON(\"custom\", unitsProvider, formatProps);\n return FormatterSpec.create(actualFormat.name, actualFormat, unitsProvider, persistenceUnit);\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 { initialFormat, showSample, initialMagnitude, unitsProvider, persistenceUnit, onFormatChange, provideFormatSpec, enableMinimumProperties } = 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((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 }, [onFormatChange]);\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(formatProps, pu, unitsProvider);\n }\n isMounted.current && setFormatSpec(newFormatSpec);\n }\n if (!formatSpec)\n fetchFormatSpec(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }, [formatProps, formatSpec, persistenceUnit, provideFormatSpec, unitsProvider]);\n\n const handleFormatChange = React.useCallback((newFormatProps: FormatProps) => {\n handleUserFormatChanges(newFormatProps);\n }, [handleUserFormatChanges]);\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 formatSpec={formatSpec} initialMagnitude={initialMagnitude} />\n }\n <FormatUnits unitsProvider={unitsProvider} persistenceUnit={formatSpec?.persistenceUnit} initialFormat={formatProps} onUnitsChange={handleFormatChange} />\n <FormatUnitLabel formatProps={formatProps} onUnitLabelChange={handleFormatChange} />\n <FormatTypeOption formatProps={formatProps} onChange={handleFormatChange} />\n <FormatPrecision formatProps={formatProps} onChange={handleFormatChange} />\n {props.providePrimaryChildren && props.providePrimaryChildren(formatProps, handleFormatChange)}\n <MiscFormatOptions formatProps={formatProps} onChange={handleFormatChange} enableMinimumProperties={enableMinimumProperties} showOptions={showOptions} onShowHideOptions={handleShowOptions}>\n {props.provideSecondaryChildren && props.provideSecondaryChildren(formatProps, handleFormatChange)}\n </MiscFormatOptions>\n </div>\n );\n}\n"]}
@@ -1,65 +1,65 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
6
- @import "~@itwin/core-react/lib/cjs/core-react/select/select";
7
- @import "~@itwin/itwinui-css/scss/style/typography";
8
-
9
- .components-quantityFormat-panel {
10
- display: grid;
11
- grid-template-columns: auto 1fr;
12
- row-gap: 0;
13
- column-gap: 6px;
14
- align-items: center;
15
-
16
- >.uicore-label {
17
- font-size: $iui-font-size;
18
- margin: 4.4px 0;
19
-
20
- /* match margin on other select controls so it spaces properly in grid */
21
- &.uicore-disabled {
22
- color: $buic-text-color-disabled;
23
- }
24
- }
25
-
26
- >span.components-inline {
27
- display: flex;
28
- flex-direction: row;
29
- align-items: center;
30
- gap: 4px;
31
- }
32
-
33
- >label.core-checkbox.core-checkbox-no-label {
34
- min-height: 1.57em;
35
- }
36
-
37
- >button.components-quantityFormat-more-button {
38
- grid-column: 1 / span 2;
39
- border: none;
40
- outline: none;
41
- background: none;
42
- }
43
-
44
- .components-quantityFormat-more-button-label {
45
- margin-right: .25em;
46
- }
47
-
48
- >a.components-quantityFormat-more-less {
49
- font-size: $iui-font-size;
50
- color: $buic-foreground-alert;
51
- -webkit-transition: text-decoration 1s ease;
52
- -moz-transition: text-decoration 1s ease;
53
- -o-transition: text-decoration 1s ease;
54
- transition: text-decoration 0.1s ease;
55
-
56
- &:hover {
57
- text-decoration: underline;
58
- cursor: pointer;
59
- }
60
- }
61
-
62
- .iui-input {
63
- padding: $uicore-iui-input-padding;
64
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
6
+ @import "~@itwin/core-react/lib/cjs/core-react/select/select";
7
+ @import "~@itwin/itwinui-css/scss/style/typography";
8
+
9
+ .components-quantityFormat-panel {
10
+ display: grid;
11
+ grid-template-columns: auto 1fr;
12
+ row-gap: 0;
13
+ column-gap: 6px;
14
+ align-items: center;
15
+
16
+ >.uicore-label {
17
+ font-size: $iui-font-size;
18
+ margin: 4.4px 0;
19
+
20
+ /* match margin on other select controls so it spaces properly in grid */
21
+ &.uicore-disabled {
22
+ color: $buic-text-color-disabled;
23
+ }
24
+ }
25
+
26
+ >span.components-inline {
27
+ display: flex;
28
+ flex-direction: row;
29
+ align-items: center;
30
+ gap: 4px;
31
+ }
32
+
33
+ >label.core-checkbox.core-checkbox-no-label {
34
+ min-height: 1.57em;
35
+ }
36
+
37
+ >button.components-quantityFormat-more-button {
38
+ grid-column: 1 / span 2;
39
+ border: none;
40
+ outline: none;
41
+ background: none;
42
+ }
43
+
44
+ .components-quantityFormat-more-button-label {
45
+ margin-right: .25em;
46
+ }
47
+
48
+ >a.components-quantityFormat-more-less {
49
+ font-size: $iui-font-size;
50
+ color: $buic-foreground-alert;
51
+ -webkit-transition: text-decoration 1s ease;
52
+ -moz-transition: text-decoration 1s ease;
53
+ -o-transition: text-decoration 1s ease;
54
+ transition: text-decoration 0.1s ease;
55
+
56
+ &:hover {
57
+ text-decoration: underline;
58
+ cursor: pointer;
59
+ }
60
+ }
61
+
62
+ .iui-input {
63
+ padding: $uicore-iui-input-padding;
64
+ }
65
65
  }
@@ -1,18 +1,18 @@
1
- /** @packageDocumentation
2
- * @module QuantityFormat
3
- */
4
- /// <reference types="react" />
5
- import { CommonProps } from "@itwin/core-react";
6
- import { FormatProps } from "@itwin/core-quantity";
7
- /** Properties of [[FormatPrecision]] component.
8
- * @alpha
9
- */
10
- export interface FormatPrecisionProps extends CommonProps {
11
- formatProps: FormatProps;
12
- onChange?: (format: FormatProps) => void;
13
- }
14
- /** Component to show/edit Quantity Format Precision.
15
- * @alpha
16
- */
17
- export declare function FormatPrecision(props: FormatPrecisionProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module QuantityFormat
3
+ */
4
+ /// <reference types="react" />
5
+ import { CommonProps } from "@itwin/core-react";
6
+ import { FormatProps } from "@itwin/core-quantity";
7
+ /** Properties of [[FormatPrecision]] component.
8
+ * @alpha
9
+ */
10
+ export interface FormatPrecisionProps extends CommonProps {
11
+ formatProps: FormatProps;
12
+ onChange?: (format: FormatProps) => void;
13
+ }
14
+ /** Component to show/edit Quantity Format Precision.
15
+ * @alpha
16
+ */
17
+ export declare function FormatPrecision(props: FormatPrecisionProps): JSX.Element;
18
18
  //# sourceMappingURL=FormatPrecision.d.ts.map
@@ -1,54 +1,54 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module QuantityFormat
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.FormatPrecision = void 0;
30
- const React = __importStar(require("react"));
31
- const core_quantity_1 = require("@itwin/core-quantity");
32
- const DecimalPrecision_1 = require("./misc/DecimalPrecision");
33
- const FractionPrecision_1 = require("./misc/FractionPrecision");
34
- const UiIModelComponents_1 = require("../UiIModelComponents");
35
- /** Component to show/edit Quantity Format Precision.
36
- * @alpha
37
- */
38
- function FormatPrecision(props) {
39
- var _a, _b;
40
- const { formatProps, onChange } = props;
41
- const handlePrecisionChange = React.useCallback((precision) => {
42
- const newFormatProps = { ...formatProps, precision };
43
- onChange && onChange(newFormatProps);
44
- }, [formatProps, onChange]);
45
- const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
46
- const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.precision"));
47
- return (React.createElement(React.Fragment, null,
48
- React.createElement("span", { className: "uicore-label" }, label.current),
49
- formatType === core_quantity_1.FormatType.Fractional ?
50
- React.createElement(FractionPrecision_1.FractionPrecisionSelector, { "data-testid": "fraction-precision-selector", precision: (_a = formatProps.precision) !== null && _a !== void 0 ? _a : 0, onChange: handlePrecisionChange }) :
51
- React.createElement(DecimalPrecision_1.DecimalPrecisionSelector, { "data-testid": "decimal-precision-selector", precision: (_b = formatProps.precision) !== null && _b !== void 0 ? _b : 0, onChange: handlePrecisionChange })));
52
- }
53
- exports.FormatPrecision = FormatPrecision;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module QuantityFormat
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FormatPrecision = void 0;
30
+ const React = __importStar(require("react"));
31
+ const core_quantity_1 = require("@itwin/core-quantity");
32
+ const DecimalPrecision_1 = require("./misc/DecimalPrecision");
33
+ const FractionPrecision_1 = require("./misc/FractionPrecision");
34
+ const UiIModelComponents_1 = require("../UiIModelComponents");
35
+ /** Component to show/edit Quantity Format Precision.
36
+ * @alpha
37
+ */
38
+ function FormatPrecision(props) {
39
+ var _a, _b;
40
+ const { formatProps, onChange } = props;
41
+ const handlePrecisionChange = React.useCallback((precision) => {
42
+ const newFormatProps = { ...formatProps, precision };
43
+ onChange && onChange(newFormatProps);
44
+ }, [formatProps, onChange]);
45
+ const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
46
+ const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.precision"));
47
+ return (React.createElement(React.Fragment, null,
48
+ React.createElement("span", { className: "uicore-label" }, label.current),
49
+ formatType === core_quantity_1.FormatType.Fractional ?
50
+ React.createElement(FractionPrecision_1.FractionPrecisionSelector, { "data-testid": "fraction-precision-selector", precision: (_a = formatProps.precision) !== null && _a !== void 0 ? _a : 0, onChange: handlePrecisionChange }) :
51
+ React.createElement(DecimalPrecision_1.DecimalPrecisionSelector, { "data-testid": "decimal-precision-selector", precision: (_b = formatProps.precision) !== null && _b !== void 0 ? _b : 0, onChange: handlePrecisionChange })));
52
+ }
53
+ exports.FormatPrecision = FormatPrecision;
54
54
  //# sourceMappingURL=FormatPrecision.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatPrecision.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPrecision.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAgF;AAChF,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,CAAC,CAAC,SAAiB,EAAE,EAAE;QACpE,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,SAAS,EAAE,CAAC;QACrD,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAC5F,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,cAAc,IAAG,KAAK,CAAC,OAAO,CAAQ;QACtD,UAAU,KAAK,0BAAU,CAAC,UAAU,CAAC,CAAC;YACrC,oBAAC,6CAAyB,mBAAa,6BAA6B,EAAC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EAAE,QAAQ,EAAE,qBAAqB,GAAI,CAAC,CAAC;YACjJ,oBAAC,2CAAwB,mBAAa,4BAA4B,EAAC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EAAE,QAAQ,EAAE,qBAAqB,GAAI,CAE9I,CACJ,CAAC;AACJ,CAAC;AApBD,0CAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module QuantityFormat\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { FormatProps, FormatType, parseFormatType } from \"@itwin/core-quantity\";\r\nimport { DecimalPrecisionSelector } from \"./misc/DecimalPrecision\";\r\nimport { FractionPrecisionSelector } from \"./misc/FractionPrecision\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\n\r\n/** Properties of [[FormatPrecision]] component.\r\n * @alpha\r\n */\r\nexport interface FormatPrecisionProps extends CommonProps {\r\n formatProps: FormatProps;\r\n onChange?: (format: FormatProps) => void;\r\n}\r\n\r\n/** Component to show/edit Quantity Format Precision.\r\n * @alpha\r\n */\r\nexport function FormatPrecision(props: FormatPrecisionProps) {\r\n const { formatProps, onChange } = props;\r\n\r\n const handlePrecisionChange = React.useCallback((precision: number) => {\r\n const newFormatProps = { ...formatProps, precision };\r\n onChange && onChange(newFormatProps);\r\n }, [formatProps, onChange]);\r\n\r\n const formatType = parseFormatType(formatProps.type, \"format\");\r\n\r\n const label = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.precision\"));\r\n return (\r\n <>\r\n <span className={\"uicore-label\"}>{label.current}</span>\r\n {formatType === FormatType.Fractional ?\r\n <FractionPrecisionSelector data-testid=\"fraction-precision-selector\" precision={formatProps.precision ?? 0} onChange={handlePrecisionChange} /> :\r\n <DecimalPrecisionSelector data-testid=\"decimal-precision-selector\" precision={formatProps.precision ?? 0} onChange={handlePrecisionChange} />\r\n }\r\n </>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"FormatPrecision.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatPrecision.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAgF;AAChF,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,CAAC,CAAC,SAAiB,EAAE,EAAE;QACpE,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,SAAS,EAAE,CAAC;QACrD,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAC5F,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,cAAc,IAAG,KAAK,CAAC,OAAO,CAAQ;QACtD,UAAU,KAAK,0BAAU,CAAC,UAAU,CAAC,CAAC;YACrC,oBAAC,6CAAyB,mBAAa,6BAA6B,EAAC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EAAE,QAAQ,EAAE,qBAAqB,GAAI,CAAC,CAAC;YACjJ,oBAAC,2CAAwB,mBAAa,4BAA4B,EAAC,SAAS,EAAE,MAAA,WAAW,CAAC,SAAS,mCAAI,CAAC,EAAE,QAAQ,EAAE,qBAAqB,GAAI,CAE9I,CACJ,CAAC;AACJ,CAAC;AApBD,0CAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { FormatProps, 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((precision: number) => {\n const newFormatProps = { ...formatProps, precision };\n onChange && onChange(newFormatProps);\n }, [formatProps, onChange]);\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n\n const label = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.precision\"));\n return (\n <>\n <span className={\"uicore-label\"}>{label.current}</span>\n {formatType === FormatType.Fractional ?\n <FractionPrecisionSelector data-testid=\"fraction-precision-selector\" precision={formatProps.precision ?? 0} onChange={handlePrecisionChange} /> :\n <DecimalPrecisionSelector data-testid=\"decimal-precision-selector\" precision={formatProps.precision ?? 0} onChange={handlePrecisionChange} />\n }\n </>\n );\n}\n"]}
@@ -1,19 +1,19 @@
1
- /** @packageDocumentation
2
- * @module QuantityFormat
3
- */
4
- /// <reference types="react" />
5
- import { FormatterSpec } from "@itwin/core-quantity";
6
- import { CommonProps } from "@itwin/core-react";
7
- /** Properties of [[FormatSample]] component.
8
- * @alpha
9
- */
10
- export interface FormatSampleProps extends CommonProps {
11
- formatSpec?: FormatterSpec;
12
- initialMagnitude?: number;
13
- hideLabels?: boolean;
14
- }
15
- /** Component to show the persistence value and formatted value given a FormatterSpec.
16
- * @alpha
17
- */
18
- export declare function FormatSample(props: FormatSampleProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module QuantityFormat
3
+ */
4
+ /// <reference types="react" />
5
+ import { FormatterSpec } from "@itwin/core-quantity";
6
+ import { CommonProps } from "@itwin/core-react";
7
+ /** Properties of [[FormatSample]] component.
8
+ * @alpha
9
+ */
10
+ export interface FormatSampleProps extends CommonProps {
11
+ formatSpec?: FormatterSpec;
12
+ initialMagnitude?: number;
13
+ hideLabels?: boolean;
14
+ }
15
+ /** Component to show the persistence value and formatted value given a FormatterSpec.
16
+ * @alpha
17
+ */
18
+ export declare function FormatSample(props: FormatSampleProps): JSX.Element;
19
19
  //# sourceMappingURL=FormatSample.d.ts.map