@itwin/imodel-components-react 3.7.2 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  6. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +186 -186
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
  9. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
  13. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  23. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  24. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
  26. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  27. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  29. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
  30. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  31. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  32. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  33. package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
  34. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
  36. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  37. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  38. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  40. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
  41. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  43. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  44. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
  45. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  47. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  48. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
  49. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  51. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +265 -265
  52. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  53. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  55. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
  56. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  57. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  59. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
  60. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  61. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  62. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  63. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
  64. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  65. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +175 -175
  67. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +647 -647
  68. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  69. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
  72. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +83 -83
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
  92. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
  95. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +154 -154
  98. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
  128. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
  131. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  134. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  138. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  142. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  146. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  150. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  151. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  154. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  155. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +387 -387
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  159. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +185 -185
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  162. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  163. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  168. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  169. package/lib/cjs/imodel-components-react.d.ts +82 -82
  170. package/lib/cjs/imodel-components-react.js +101 -101
  171. package/lib/cjs/imodel-components-react.js.map +1 -1
  172. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  173. package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -75
  174. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  175. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  176. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  177. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  178. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  179. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  180. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
  181. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  182. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
  183. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  184. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  185. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  186. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  187. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
  188. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  189. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  193. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  194. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  195. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  196. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  197. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  198. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  199. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  200. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  201. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  202. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  203. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  204. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  205. package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
  206. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  207. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  208. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  209. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  210. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  211. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  212. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  213. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  214. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  215. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  216. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  217. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  218. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  219. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  220. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  221. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
  222. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  223. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  224. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  225. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  226. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  227. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  228. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  229. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
  230. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  231. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  232. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  233. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  234. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  235. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  236. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +175 -175
  237. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +619 -619
  238. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  239. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  240. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  241. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
  242. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  243. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  244. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  245. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  246. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  247. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  248. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  249. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  250. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  251. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  252. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +60 -60
  253. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  254. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  255. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  256. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  257. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  258. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  259. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  260. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  261. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  262. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  263. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  264. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  265. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  266. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  267. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +131 -131
  268. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  269. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  270. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  271. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  272. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  273. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  274. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  275. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  276. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  277. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  278. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  279. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  280. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  281. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  282. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  283. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  284. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  285. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  286. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  287. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  288. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  289. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  290. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  291. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  292. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  293. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  294. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  295. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  296. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  297. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  298. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  299. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  300. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
  301. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  302. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  303. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  304. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  305. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  306. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  307. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  308. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  309. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  310. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
  311. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  312. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
  313. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  314. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  315. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  316. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
  317. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  318. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
  319. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  320. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  321. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  322. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  323. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  324. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  325. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  326. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  327. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +361 -361
  328. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  329. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +185 -185
  330. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
  331. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  332. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  333. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  334. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  335. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  336. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  337. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
  338. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  339. package/lib/esm/imodel-components-react.d.ts +82 -82
  340. package/lib/esm/imodel-components-react.js +87 -87
  341. package/lib/esm/imodel-components-react.js.map +1 -1
  342. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  343. package/package.json +19 -19
@@ -1,134 +1,134 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module LineWeight
7
- */
8
- import "./WeightPickerButton.scss";
9
- import classnames from "classnames";
10
- import * as React from "react";
11
- import { RelativePosition, SpecialKey } from "@itwin/appui-abstract";
12
- import { ElementResizeObserver, Popup } from "@itwin/core-react";
13
- import { LineWeightSwatch } from "./Swatch";
14
- /** WeightPickerButton component
15
- * @public
16
- */
17
- export class WeightPickerButton extends React.PureComponent {
18
- /** @internal */
19
- constructor(props) {
20
- super(props);
21
- this._target = React.createRef();
22
- this._weightsContainer = null;
23
- this._focusTarget = React.createRef(); // weight button that should receive focus after popup is open
24
- this._togglePopup = () => {
25
- if (this.props.readonly)
26
- return;
27
- this.setState((prevState) => ({ showPopup: !prevState.showPopup }));
28
- };
29
- this._onPopupOpened = () => {
30
- };
31
- this._closePopup = () => {
32
- this.setState((_prevState) => ({ showPopup: false }));
33
- };
34
- this._handleWeightPicked = (weight) => {
35
- this._closePopup();
36
- this.props.onLineWeightPick && this.props.onLineWeightPick(weight);
37
- };
38
- this._handleKeyDown = (event) => {
39
- if (event.key === SpecialKey.Enter) {
40
- event.preventDefault();
41
- event.stopPropagation();
42
- const weightButton = document.activeElement;
43
- // istanbul ignore else
44
- if (weightButton.tagName === "BUTTON") {
45
- try {
46
- const values = weightButton.id.split("-");
47
- // istanbul ignore else
48
- if (values.length) {
49
- const weight = parseInt(values[values.length - 1], 10);
50
- // istanbul ignore else
51
- if (!isNaN(weight)) {
52
- // istanbul ignore else
53
- if (this.props.onLineWeightPick)
54
- this.props.onLineWeightPick(weight);
55
- }
56
- }
57
- }
58
- catch { }
59
- }
60
- this._closePopup();
61
- }
62
- else {
63
- switch (event.key) {
64
- case SpecialKey.ArrowDown:
65
- this.moveFocusInPopup(false, event);
66
- break;
67
- case SpecialKey.ArrowUp:
68
- this.moveFocusInPopup(true, event);
69
- break;
70
- }
71
- }
72
- };
73
- this._setWeightContainer = (el) => {
74
- this._weightsContainer = el;
75
- };
76
- this.state = { showPopup: false, targetElement: null };
77
- }
78
- setFocus() {
79
- // istanbul ignore next
80
- this._focusTarget.current && this._focusTarget.current.focus();
81
- }
82
- componentDidMount() {
83
- // eslint-disable-next-line no-console
84
- // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? "set" : "unset"}`);
85
- this.setState({ targetElement: this._target.current });
86
- }
87
- buildIdForWeight(weight) {
88
- return `ui-core-lineweight-${weight}`;
89
- }
90
- moveFocusInPopup(moveUp, event) {
91
- const activeElement = document.activeElement;
92
- // istanbul ignore else
93
- if (this._weightsContainer && activeElement && activeElement.tagName === "BUTTON") {
94
- const values = activeElement.id.split("-");
95
- // istanbul ignore else
96
- if (values.length === 4 && values[2] === "lineweight") {
97
- const weight = parseInt(values[3], 10);
98
- const foundIndex = this.props.weights.findIndex((val) => val === weight);
99
- // istanbul ignore next
100
- if (foundIndex < 0)
101
- return;
102
- const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :
103
- (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);
104
- const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`);
105
- // istanbul ignore else
106
- if (focusLocation) {
107
- focusLocation.focus();
108
- event.preventDefault();
109
- event.stopPropagation();
110
- }
111
- }
112
- }
113
- }
114
- renderPopup(title) {
115
- return (React.createElement("div", { className: "components-weightpicker-popup-container" },
116
- title && React.createElement("h4", null, title),
117
- React.createElement("ul", { "data-testid": "components-weightpicker-popup-lines", className: "components-weightpicker-popup-lines", onKeyDown: this._handleKeyDown, ref: this._setWeightContainer }, this.props.weights.map((weight, index) => {
118
- const classNames = classnames("components-weightpicker-swatch", weight === this.props.activeWeight && "active");
119
- return (React.createElement(LineWeightSwatch, { className: classNames, key: index, colorDef: this.props.colorDef, id: this.buildIdForWeight(weight), hideLabel: this.props.hideLabel, onClick: this._handleWeightPicked.bind(this, weight), weight: weight }));
120
- }))));
121
- }
122
- /** @internal */
123
- render() {
124
- const buttonClassNames = classnames("components-weightpicker-button", this.props.className);
125
- return (React.createElement(React.Fragment, null,
126
- React.createElement("div", { ref: this._target, style: this.props.style },
127
- React.createElement(LineWeightSwatch, { "data-testid": "components-weightpicker-button", className: buttonClassNames, weight: this.props.activeWeight, colorDef: this.props.colorDef, readonly: this.props.readonly, disabled: this.props.disabled, hideLabel: this.props.hideLabel, "aria-haspopup": "listbox", "aria-expanded": this.state.showPopup, onClick: this._togglePopup })),
128
- React.createElement(ElementResizeObserver, { watchedElement: this.state.targetElement, render: ({ width }) => (React.createElement(Popup, { className: "components-weightpicker-popup", style: { width: `${width}px` }, isOpen: this.state.showPopup, position: RelativePosition.Bottom, offset: 0, showShadow: false, onClose: this._closePopup, onOpen: this._onPopupOpened, focusTarget: `#${this.buildIdForWeight(this.props.activeWeight)}`, moveFocus: true, target: this.state.targetElement, closeOnNestedPopupOutsideClick: true }, this.renderPopup(this.props.dropDownTitle))) })));
129
- }
130
- }
131
- WeightPickerButton.defaultProps = {
132
- weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
133
- };
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module LineWeight
7
+ */
8
+ import "./WeightPickerButton.scss";
9
+ import classnames from "classnames";
10
+ import * as React from "react";
11
+ import { RelativePosition, SpecialKey } from "@itwin/appui-abstract";
12
+ import { ElementResizeObserver, Popup } from "@itwin/core-react";
13
+ import { LineWeightSwatch } from "./Swatch";
14
+ /** WeightPickerButton component
15
+ * @public
16
+ */
17
+ export class WeightPickerButton extends React.PureComponent {
18
+ /** @internal */
19
+ constructor(props) {
20
+ super(props);
21
+ this._target = React.createRef();
22
+ this._weightsContainer = null;
23
+ this._focusTarget = React.createRef(); // weight button that should receive focus after popup is open
24
+ this._togglePopup = () => {
25
+ if (this.props.readonly)
26
+ return;
27
+ this.setState((prevState) => ({ showPopup: !prevState.showPopup }));
28
+ };
29
+ this._onPopupOpened = () => {
30
+ };
31
+ this._closePopup = () => {
32
+ this.setState((_prevState) => ({ showPopup: false }));
33
+ };
34
+ this._handleWeightPicked = (weight) => {
35
+ this._closePopup();
36
+ this.props.onLineWeightPick && this.props.onLineWeightPick(weight);
37
+ };
38
+ this._handleKeyDown = (event) => {
39
+ if (event.key === SpecialKey.Enter) {
40
+ event.preventDefault();
41
+ event.stopPropagation();
42
+ const weightButton = document.activeElement;
43
+ // istanbul ignore else
44
+ if (weightButton.tagName === "BUTTON") {
45
+ try {
46
+ const values = weightButton.id.split("-");
47
+ // istanbul ignore else
48
+ if (values.length) {
49
+ const weight = parseInt(values[values.length - 1], 10);
50
+ // istanbul ignore else
51
+ if (!isNaN(weight)) {
52
+ // istanbul ignore else
53
+ if (this.props.onLineWeightPick)
54
+ this.props.onLineWeightPick(weight);
55
+ }
56
+ }
57
+ }
58
+ catch { }
59
+ }
60
+ this._closePopup();
61
+ }
62
+ else {
63
+ switch (event.key) {
64
+ case SpecialKey.ArrowDown:
65
+ this.moveFocusInPopup(false, event);
66
+ break;
67
+ case SpecialKey.ArrowUp:
68
+ this.moveFocusInPopup(true, event);
69
+ break;
70
+ }
71
+ }
72
+ };
73
+ this._setWeightContainer = (el) => {
74
+ this._weightsContainer = el;
75
+ };
76
+ this.state = { showPopup: false, targetElement: null };
77
+ }
78
+ setFocus() {
79
+ // istanbul ignore next
80
+ this._focusTarget.current && this._focusTarget.current.focus();
81
+ }
82
+ componentDidMount() {
83
+ // eslint-disable-next-line no-console
84
+ // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? "set" : "unset"}`);
85
+ this.setState({ targetElement: this._target.current });
86
+ }
87
+ buildIdForWeight(weight) {
88
+ return `ui-core-lineweight-${weight}`;
89
+ }
90
+ moveFocusInPopup(moveUp, event) {
91
+ const activeElement = document.activeElement;
92
+ // istanbul ignore else
93
+ if (this._weightsContainer && activeElement && activeElement.tagName === "BUTTON") {
94
+ const values = activeElement.id.split("-");
95
+ // istanbul ignore else
96
+ if (values.length === 4 && values[2] === "lineweight") {
97
+ const weight = parseInt(values[3], 10);
98
+ const foundIndex = this.props.weights.findIndex((val) => val === weight);
99
+ // istanbul ignore next
100
+ if (foundIndex < 0)
101
+ return;
102
+ const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :
103
+ (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);
104
+ const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`);
105
+ // istanbul ignore else
106
+ if (focusLocation) {
107
+ focusLocation.focus();
108
+ event.preventDefault();
109
+ event.stopPropagation();
110
+ }
111
+ }
112
+ }
113
+ }
114
+ renderPopup(title) {
115
+ return (React.createElement("div", { className: "components-weightpicker-popup-container" },
116
+ title && React.createElement("h4", null, title),
117
+ React.createElement("ul", { "data-testid": "components-weightpicker-popup-lines", className: "components-weightpicker-popup-lines", onKeyDown: this._handleKeyDown, ref: this._setWeightContainer }, this.props.weights.map((weight, index) => {
118
+ const classNames = classnames("components-weightpicker-swatch", weight === this.props.activeWeight && "active");
119
+ return (React.createElement(LineWeightSwatch, { className: classNames, key: index, colorDef: this.props.colorDef, id: this.buildIdForWeight(weight), hideLabel: this.props.hideLabel, onClick: this._handleWeightPicked.bind(this, weight), weight: weight }));
120
+ }))));
121
+ }
122
+ /** @internal */
123
+ render() {
124
+ const buttonClassNames = classnames("components-weightpicker-button", this.props.className);
125
+ return (React.createElement(React.Fragment, null,
126
+ React.createElement("div", { ref: this._target, style: this.props.style },
127
+ React.createElement(LineWeightSwatch, { "data-testid": "components-weightpicker-button", className: buttonClassNames, weight: this.props.activeWeight, colorDef: this.props.colorDef, readonly: this.props.readonly, disabled: this.props.disabled, hideLabel: this.props.hideLabel, "aria-haspopup": "listbox", "aria-expanded": this.state.showPopup, onClick: this._togglePopup })),
128
+ React.createElement(ElementResizeObserver, { watchedElement: this.state.targetElement, render: ({ width }) => (React.createElement(Popup, { className: "components-weightpicker-popup", style: { width: `${width}px` }, isOpen: this.state.showPopup, position: RelativePosition.Bottom, offset: 0, showShadow: false, onClose: this._closePopup, onOpen: this._onPopupOpened, focusTarget: `#${this.buildIdForWeight(this.props.activeWeight)}`, moveFocus: true, target: this.state.targetElement, closeOnNestedPopupOutsideClick: true }, this.renderPopup(this.props.dropDownTitle))) })));
129
+ }
130
+ }
131
+ WeightPickerButton.defaultProps = {
132
+ weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
133
+ };
134
134
  //# sourceMappingURL=WeightPickerButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WeightPickerButton.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/lineweight/WeightPickerButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAe,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgC5C;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,aAAmD;IAK/F,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,YAAO,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC5C,sBAAiB,GAA0B,IAAI,CAAC;QAChD,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAqB,CAAC,CAAE,8DAA8D;QAkBpH,iBAAY,GAAG,GAAG,EAAE;YAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACrB,OAAO;YACT,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,SAA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AAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,mBACjB,SAAS,mBACR,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,OAAO,EAAE,IAAI,CAAC,YAAY,GAAI,CAC5B;YACN,oBAAC,qBAAqB,IAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,EACpE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACd,oBAAC,KAAK,IACJ,SAAS,EAAC,+BAA+B,EACzC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EACjC,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,WAAW,EAAE,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,EACjE,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAChC,8BAA8B,UAE7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CACrC,CACT,GACD,CACD,CACJ,CAAC;IACJ,CAAC;;AAvKa,+BAAY,GAAG;IAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;CACzC,CAAC","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 LineWeight\r\n */\r\n\r\nimport \"./WeightPickerButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ColorDef } from \"@itwin/core-common\";\r\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, ElementResizeObserver, Popup } from \"@itwin/core-react\";\r\nimport { LineWeightSwatch } from \"./Swatch\";\r\n\r\n// cSpell:ignore weightpicker lineweight\r\n\r\n/** Properties for the [[WeightPickerButton]] React component\r\n * @public\r\n */\r\nexport interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** active weight */\r\n activeWeight: number;\r\n /** available weights */\r\n weights: number[];\r\n /** color specification */\r\n colorDef?: ColorDef;\r\n /** function to run when user selects weight swatch */\r\n onLineWeightPick?: ((weight: number) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not */\r\n readonly?: boolean;\r\n /** hide the weight label */\r\n hideLabel?: boolean;\r\n /** Title to show at top of DropDown */\r\n dropDownTitle?: string;\r\n}\r\n\r\n/** @internal */\r\ninterface WeightPickerState {\r\n showPopup: boolean;\r\n targetElement: HTMLDivElement | null;\r\n}\r\n\r\n/** WeightPickerButton component\r\n * @public\r\n */\r\nexport class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {\r\n private _target = React.createRef<HTMLDivElement>();\r\n private _weightsContainer: HTMLDivElement | null = null;\r\n private _focusTarget = React.createRef<HTMLButtonElement>(); // weight button that should receive focus after popup is open\r\n\r\n /** @internal */\r\n constructor(props: WeightPickerProps) {\r\n super(props);\r\n\r\n this.state = { showPopup: false, targetElement: null };\r\n }\r\n\r\n public setFocus(): void {\r\n // istanbul ignore next\r\n this._focusTarget.current && this._focusTarget.current.focus();\r\n }\r\n\r\n public static defaultProps = {\r\n weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\r\n };\r\n\r\n private _togglePopup = () => {\r\n if (this.props.readonly)\r\n return;\r\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\r\n };\r\n\r\n private _onPopupOpened = () => {\r\n };\r\n\r\n private _closePopup = () => {\r\n this.setState((_prevState) => ({ showPopup: false }));\r\n };\r\n\r\n private _handleWeightPicked = (weight: number) => {\r\n this._closePopup();\r\n this.props.onLineWeightPick && this.props.onLineWeightPick(weight);\r\n };\r\n\r\n public override componentDidMount() {\r\n // eslint-disable-next-line no-console\r\n // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? \"set\" : \"unset\"}`);\r\n this.setState({ targetElement: this._target.current });\r\n }\r\n\r\n private buildIdForWeight(weight: number): string {\r\n return `ui-core-lineweight-${weight}`;\r\n }\r\n\r\n private moveFocusInPopup(moveUp: boolean, event: React.KeyboardEvent<any>) {\r\n const activeElement = document.activeElement;\r\n // istanbul ignore else\r\n if (this._weightsContainer && activeElement && activeElement.tagName === \"BUTTON\") {\r\n const values = activeElement.id.split(\"-\");\r\n // istanbul ignore else\r\n if (values.length === 4 && values[2] === \"lineweight\") {\r\n const weight = parseInt(values[3], 10);\r\n const foundIndex = this.props.weights.findIndex((val) => val === weight);\r\n // istanbul ignore next\r\n if (foundIndex < 0)\r\n return;\r\n\r\n const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :\r\n (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);\r\n\r\n const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`) as HTMLButtonElement;\r\n // istanbul ignore else\r\n if (focusLocation) {\r\n focusLocation.focus();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _handleKeyDown = (event: React.KeyboardEvent<any>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const weightButton = document.activeElement as HTMLElement;\r\n // istanbul ignore else\r\n if (weightButton.tagName === \"BUTTON\") {\r\n try {\r\n const values = weightButton.id.split(\"-\");\r\n // istanbul ignore else\r\n if (values.length) {\r\n const weight = parseInt(values[values.length - 1], 10);\r\n // istanbul ignore else\r\n if (!isNaN(weight)) {\r\n // istanbul ignore else\r\n if (this.props.onLineWeightPick)\r\n this.props.onLineWeightPick(weight);\r\n }\r\n }\r\n } catch { }\r\n }\r\n this._closePopup();\r\n } else {\r\n switch (event.key) {\r\n case SpecialKey.ArrowDown:\r\n this.moveFocusInPopup(false, event);\r\n break;\r\n case SpecialKey.ArrowUp:\r\n this.moveFocusInPopup(true, event);\r\n break;\r\n }\r\n }\r\n };\r\n\r\n private _setWeightContainer = (el: any) => {\r\n this._weightsContainer = el;\r\n };\r\n\r\n private renderPopup(title: string | undefined) {\r\n return (\r\n <div className=\"components-weightpicker-popup-container\">\r\n {title && <h4>{title}</h4>}\r\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\r\n <ul data-testid=\"components-weightpicker-popup-lines\" className=\"components-weightpicker-popup-lines\" onKeyDown={this._handleKeyDown} ref={this._setWeightContainer}>\r\n {this.props.weights.map((weight, index) => {\r\n const classNames = classnames(\r\n \"components-weightpicker-swatch\",\r\n weight === this.props.activeWeight && \"active\",\r\n );\r\n return (<LineWeightSwatch\r\n className={classNames}\r\n key={index}\r\n colorDef={this.props.colorDef}\r\n id={this.buildIdForWeight(weight)}\r\n hideLabel={this.props.hideLabel}\r\n onClick={this._handleWeightPicked.bind(this, weight)}\r\n weight={weight} />);\r\n })\r\n }\r\n </ul>\r\n </div>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const buttonClassNames = classnames(\r\n \"components-weightpicker-button\",\r\n this.props.className,\r\n );\r\n\r\n return (\r\n <>\r\n <div ref={this._target} style={this.props.style} >\r\n <LineWeightSwatch\r\n data-testid=\"components-weightpicker-button\"\r\n className={buttonClassNames}\r\n weight={this.props.activeWeight}\r\n colorDef={this.props.colorDef}\r\n readonly={this.props.readonly}\r\n disabled={this.props.disabled}\r\n hideLabel={this.props.hideLabel}\r\n aria-haspopup=\"listbox\"\r\n aria-expanded={this.state.showPopup}\r\n onClick={this._togglePopup} />\r\n </div>\r\n <ElementResizeObserver watchedElement={this.state.targetElement} render=\r\n {({ width }) => (\r\n <Popup\r\n className=\"components-weightpicker-popup\"\r\n style={{ width: `${width}px` }}\r\n isOpen={this.state.showPopup}\r\n position={RelativePosition.Bottom}\r\n offset={0}\r\n showShadow={false}\r\n onClose={this._closePopup}\r\n onOpen={this._onPopupOpened}\r\n focusTarget={`#${this.buildIdForWeight(this.props.activeWeight)}`}\r\n moveFocus={true}\r\n target={this.state.targetElement}\r\n closeOnNestedPopupOutsideClick\r\n >\r\n {this.renderPopup(this.props.dropDownTitle)}\r\n </Popup>\r\n )}\r\n />\r\n </>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"WeightPickerButton.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/lineweight/WeightPickerButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAe,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgC5C;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,aAAmD;IAK/F,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,YAAO,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC5C,sBAAiB,GAA0B,IA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AvKa,+BAAY,GAAG;IAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;CACzC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LineWeight\n */\n\nimport \"./WeightPickerButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps, ElementResizeObserver, Popup } from \"@itwin/core-react\";\nimport { LineWeightSwatch } from \"./Swatch\";\n\n// cSpell:ignore weightpicker lineweight\n\n/** Properties for the [[WeightPickerButton]] React component\n * @public\n */\nexport interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /** active weight */\n activeWeight: number;\n /** available weights */\n weights: number[];\n /** color specification */\n colorDef?: ColorDef;\n /** function to run when user selects weight swatch */\n onLineWeightPick?: ((weight: number) => void) | undefined;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not */\n readonly?: boolean;\n /** hide the weight label */\n hideLabel?: boolean;\n /** Title to show at top of DropDown */\n dropDownTitle?: string;\n}\n\n/** @internal */\ninterface WeightPickerState {\n showPopup: boolean;\n targetElement: HTMLDivElement | null;\n}\n\n/** WeightPickerButton component\n * @public\n */\nexport class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {\n private _target = React.createRef<HTMLDivElement>();\n private _weightsContainer: HTMLDivElement | null = null;\n private _focusTarget = React.createRef<HTMLButtonElement>(); // weight button that should receive focus after popup is open\n\n /** @internal */\n constructor(props: WeightPickerProps) {\n super(props);\n\n this.state = { showPopup: false, targetElement: null };\n }\n\n public setFocus(): void {\n // istanbul ignore next\n this._focusTarget.current && this._focusTarget.current.focus();\n }\n\n public static defaultProps = {\n weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n };\n\n private _togglePopup = () => {\n if (this.props.readonly)\n return;\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\n };\n\n private _onPopupOpened = () => {\n };\n\n private _closePopup = () => {\n this.setState((_prevState) => ({ showPopup: false }));\n };\n\n private _handleWeightPicked = (weight: number) => {\n this._closePopup();\n this.props.onLineWeightPick && this.props.onLineWeightPick(weight);\n };\n\n public override componentDidMount() {\n // eslint-disable-next-line no-console\n // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? \"set\" : \"unset\"}`);\n this.setState({ targetElement: this._target.current });\n }\n\n private buildIdForWeight(weight: number): string {\n return `ui-core-lineweight-${weight}`;\n }\n\n private moveFocusInPopup(moveUp: boolean, event: React.KeyboardEvent<any>) {\n const activeElement = document.activeElement;\n // istanbul ignore else\n if (this._weightsContainer && activeElement && activeElement.tagName === \"BUTTON\") {\n const values = activeElement.id.split(\"-\");\n // istanbul ignore else\n if (values.length === 4 && values[2] === \"lineweight\") {\n const weight = parseInt(values[3], 10);\n const foundIndex = this.props.weights.findIndex((val) => val === weight);\n // istanbul ignore next\n if (foundIndex < 0)\n return;\n\n const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :\n (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);\n\n const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`) as HTMLButtonElement;\n // istanbul ignore else\n if (focusLocation) {\n focusLocation.focus();\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }\n\n private _handleKeyDown = (event: React.KeyboardEvent<any>) => {\n if (event.key === SpecialKey.Enter) {\n event.preventDefault();\n event.stopPropagation();\n const weightButton = document.activeElement as HTMLElement;\n // istanbul ignore else\n if (weightButton.tagName === \"BUTTON\") {\n try {\n const values = weightButton.id.split(\"-\");\n // istanbul ignore else\n if (values.length) {\n const weight = parseInt(values[values.length - 1], 10);\n // istanbul ignore else\n if (!isNaN(weight)) {\n // istanbul ignore else\n if (this.props.onLineWeightPick)\n this.props.onLineWeightPick(weight);\n }\n }\n } catch { }\n }\n this._closePopup();\n } else {\n switch (event.key) {\n case SpecialKey.ArrowDown:\n this.moveFocusInPopup(false, event);\n break;\n case SpecialKey.ArrowUp:\n this.moveFocusInPopup(true, event);\n break;\n }\n }\n };\n\n private _setWeightContainer = (el: any) => {\n this._weightsContainer = el;\n };\n\n private renderPopup(title: string | undefined) {\n return (\n <div className=\"components-weightpicker-popup-container\">\n {title && <h4>{title}</h4>}\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <ul data-testid=\"components-weightpicker-popup-lines\" className=\"components-weightpicker-popup-lines\" onKeyDown={this._handleKeyDown} ref={this._setWeightContainer}>\n {this.props.weights.map((weight, index) => {\n const classNames = classnames(\n \"components-weightpicker-swatch\",\n weight === this.props.activeWeight && \"active\",\n );\n return (<LineWeightSwatch\n className={classNames}\n key={index}\n colorDef={this.props.colorDef}\n id={this.buildIdForWeight(weight)}\n hideLabel={this.props.hideLabel}\n onClick={this._handleWeightPicked.bind(this, weight)}\n weight={weight} />);\n })\n }\n </ul>\n </div>\n );\n }\n\n /** @internal */\n public override render() {\n const buttonClassNames = classnames(\n \"components-weightpicker-button\",\n this.props.className,\n );\n\n return (\n <>\n <div ref={this._target} style={this.props.style} >\n <LineWeightSwatch\n data-testid=\"components-weightpicker-button\"\n className={buttonClassNames}\n weight={this.props.activeWeight}\n colorDef={this.props.colorDef}\n readonly={this.props.readonly}\n disabled={this.props.disabled}\n hideLabel={this.props.hideLabel}\n aria-haspopup=\"listbox\"\n aria-expanded={this.state.showPopup}\n onClick={this._togglePopup} />\n </div>\n <ElementResizeObserver watchedElement={this.state.targetElement} render=\n {({ width }) => (\n <Popup\n className=\"components-weightpicker-popup\"\n style={{ width: `${width}px` }}\n isOpen={this.state.showPopup}\n position={RelativePosition.Bottom}\n offset={0}\n showShadow={false}\n onClose={this._closePopup}\n onOpen={this._onPopupOpened}\n focusTarget={`#${this.buildIdForWeight(this.props.activeWeight)}`}\n moveFocus={true}\n target={this.state.targetElement}\n closeOnNestedPopupOutsideClick\n >\n {this.renderPopup(this.props.dropDownTitle)}\n </Popup>\n )}\n />\n </>\n );\n }\n}\n"]}
@@ -1,53 +1,53 @@
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/style/themecolors";
6
- @import "~@itwin/core-react/lib/cjs/core-react/button/button";
7
-
8
- .components-weightpicker-button {
9
- color: $buic-foreground-body;
10
- background: $buic-background-control;
11
- border: 1px solid $buic-inputs-border;
12
- border-radius: 3px;
13
- min-width: 100px;
14
-
15
- &:not(.readonly):not([disabled]) {
16
- cursor: pointer;
17
- }
18
-
19
- &:active,
20
- &:focus {
21
- @include uicore-buttons-button-focused;
22
- }
23
- }
24
-
25
- .components-weightpicker-popup {
26
-
27
- &.core-popup {
28
- background: $buic-background-control;
29
- border: 1px solid $buic-inputs-border;
30
- }
31
-
32
- .components-weightpicker-popup-container {
33
- color: $buic-foreground-body;
34
- background: $buic-background-control;
35
- min-width: 60px;
36
- padding: 0 4px;
37
- border-radius: 4px;
38
-
39
- >ul {
40
- padding: 4px 0;
41
- list-style: none;
42
- margin: 0.25rem 0;
43
-
44
- >.components-weightpicker-swatch:hover {
45
- background: $buic-row-hover;
46
- }
47
-
48
- >.components-weightpicker-swatch.active {
49
- background: $buic-row-selection;
50
- }
51
- }
52
- }
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/style/themecolors";
6
+ @import "~@itwin/core-react/lib/cjs/core-react/button/button";
7
+
8
+ .components-weightpicker-button {
9
+ color: $buic-foreground-body;
10
+ background: $buic-background-control;
11
+ border: 1px solid $buic-inputs-border;
12
+ border-radius: 3px;
13
+ min-width: 100px;
14
+
15
+ &:not(.readonly):not([disabled]) {
16
+ cursor: pointer;
17
+ }
18
+
19
+ &:active,
20
+ &:focus {
21
+ @include uicore-buttons-button-focused;
22
+ }
23
+ }
24
+
25
+ .components-weightpicker-popup {
26
+
27
+ &.core-popup {
28
+ background: $buic-background-control;
29
+ border: 1px solid $buic-inputs-border;
30
+ }
31
+
32
+ .components-weightpicker-popup-container {
33
+ color: $buic-foreground-body;
34
+ background: $buic-background-control;
35
+ min-width: 60px;
36
+ padding: 0 4px;
37
+ border-radius: 4px;
38
+
39
+ >ul {
40
+ padding: 4px 0;
41
+ list-style: none;
42
+ margin: 0.25rem 0;
43
+
44
+ >.components-weightpicker-swatch:hover {
45
+ background: $buic-row-hover;
46
+ }
47
+
48
+ >.components-weightpicker-swatch.active {
49
+ background: $buic-row-selection;
50
+ }
51
+ }
52
+ }
53
53
  }
@@ -1,46 +1,46 @@
1
- /** @packageDocumentation
2
- * @module Cube
3
- */
4
- import "./Cube.scss";
5
- import * as React from "react";
6
- import { Matrix3d } from "@itwin/core-geometry";
7
- import { CommonProps } from "@itwin/core-react";
8
- /** Cube Face enumeration
9
- * @public
10
- */
11
- export declare enum Face {
12
- None = "",
13
- Left = "left",
14
- Right = "right",
15
- Back = "back",
16
- Front = "front",
17
- Bottom = "bottom",
18
- Top = "top"
19
- }
20
- /** Properties for the [[Cube]] React component
21
- * @public
22
- */
23
- export interface CubeProps extends React.AllHTMLAttributes<HTMLDivElement>, CommonProps {
24
- faces?: {
25
- [key: string]: React.ReactNode;
26
- };
27
- rotMatrix: Matrix3d;
28
- }
29
- /** Cube React component used by the 3d Cube Navigation Aid
30
- * @public
31
- */
32
- export declare class Cube extends React.PureComponent<CubeProps> {
33
- render(): React.ReactNode;
34
- }
35
- /** @internal */
36
- export interface CubeFaceProps extends React.AllHTMLAttributes<HTMLDivElement> {
37
- rotMatrix: Matrix3d;
38
- face: Face;
39
- }
40
- /** @internal */
41
- export declare class CubeFace extends React.Component<CubeFaceProps> {
42
- private _faceWidth;
43
- render(): React.ReactNode;
44
- private getCSSClassNameFromFace;
45
- }
1
+ /** @packageDocumentation
2
+ * @module Cube
3
+ */
4
+ import "./Cube.scss";
5
+ import * as React from "react";
6
+ import { Matrix3d } from "@itwin/core-geometry";
7
+ import { CommonProps } from "@itwin/core-react";
8
+ /** Cube Face enumeration
9
+ * @public
10
+ */
11
+ export declare enum Face {
12
+ None = "",
13
+ Left = "left",
14
+ Right = "right",
15
+ Back = "back",
16
+ Front = "front",
17
+ Bottom = "bottom",
18
+ Top = "top"
19
+ }
20
+ /** Properties for the [[Cube]] React component
21
+ * @public
22
+ */
23
+ export interface CubeProps extends React.AllHTMLAttributes<HTMLDivElement>, CommonProps {
24
+ faces?: {
25
+ [key: string]: React.ReactNode;
26
+ };
27
+ rotMatrix: Matrix3d;
28
+ }
29
+ /** Cube React component used by the 3d Cube Navigation Aid
30
+ * @public
31
+ */
32
+ export declare class Cube extends React.PureComponent<CubeProps> {
33
+ render(): React.ReactNode;
34
+ }
35
+ /** @internal */
36
+ export interface CubeFaceProps extends React.AllHTMLAttributes<HTMLDivElement> {
37
+ rotMatrix: Matrix3d;
38
+ face: Face;
39
+ }
40
+ /** @internal */
41
+ export declare class CubeFace extends React.Component<CubeFaceProps> {
42
+ private _faceWidth;
43
+ render(): React.ReactNode;
44
+ private getCSSClassNameFromFace;
45
+ }
46
46
  //# sourceMappingURL=Cube.d.ts.map