@itwin/imodel-components-react 4.17.0 → 5.0.0-dev.2

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 (532) hide show
  1. package/README.md +15 -2
  2. package/lib/{cjs/imodel-components-react → imodel-components-react}/UiIModelComponents.d.ts +1 -1
  3. package/lib/imodel-components-react/UiIModelComponents.d.ts.map +1 -0
  4. package/lib/{esm/imodel-components-react → imodel-components-react}/UiIModelComponents.js +4 -7
  5. package/lib/imodel-components-react/UiIModelComponents.js.map +1 -0
  6. package/lib/imodel-components-react/color/AlphaSlider.d.ts.map +1 -0
  7. package/lib/{esm/imodel-components-react → imodel-components-react}/color/AlphaSlider.js +1 -1
  8. package/lib/imodel-components-react/color/AlphaSlider.js.map +1 -0
  9. package/lib/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -0
  10. package/lib/{esm/imodel-components-react → imodel-components-react}/color/ColorPickerButton.js +4 -3
  11. package/lib/imodel-components-react/color/ColorPickerButton.js.map +1 -0
  12. package/lib/{esm/imodel-components-react → imodel-components-react}/color/ColorPickerButton.scss +2 -4
  13. package/lib/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -0
  14. package/lib/imodel-components-react/color/ColorPickerDialog.js.map +1 -0
  15. package/lib/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -0
  16. package/lib/{esm/imodel-components-react → imodel-components-react}/color/ColorPickerPopup.js +4 -3
  17. package/lib/imodel-components-react/color/ColorPickerPopup.js.map +1 -0
  18. package/lib/imodel-components-react/color/HueSlider.d.ts.map +1 -0
  19. package/lib/{esm/imodel-components-react → imodel-components-react}/color/HueSlider.js +1 -1
  20. package/lib/{esm/imodel-components-react → imodel-components-react}/color/HueSlider.js.map +1 -1
  21. package/lib/imodel-components-react/color/SaturationPicker.d.ts.map +1 -0
  22. package/lib/{esm/imodel-components-react → imodel-components-react}/color/SaturationPicker.js +1 -1
  23. package/lib/imodel-components-react/color/SaturationPicker.js.map +1 -0
  24. package/lib/imodel-components-react/color/Swatch.d.ts.map +1 -0
  25. package/lib/{esm/imodel-components-react → imodel-components-react}/color/Swatch.js +1 -1
  26. package/lib/{esm/imodel-components-react → imodel-components-react}/color/Swatch.js.map +1 -1
  27. package/lib/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -0
  28. package/lib/imodel-components-react/color/getCSSColorFromDef.js.map +1 -0
  29. package/lib/imodel-components-react/editors/ColorEditor.d.ts.map +1 -0
  30. package/lib/{esm/imodel-components-react → imodel-components-react}/editors/ColorEditor.js +3 -4
  31. package/lib/imodel-components-react/editors/ColorEditor.js.map +1 -0
  32. package/lib/{cjs/imodel-components-react → imodel-components-react}/editors/ColorEditor.scss +0 -2
  33. package/lib/imodel-components-react/editors/WeightEditor.d.ts.map +1 -0
  34. package/lib/{esm/imodel-components-react → imodel-components-react}/editors/WeightEditor.js +3 -4
  35. package/lib/imodel-components-react/editors/WeightEditor.js.map +1 -0
  36. package/lib/{cjs/imodel-components-react → imodel-components-react}/editors/WeightEditor.scss +0 -2
  37. package/lib/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -0
  38. package/lib/{esm/imodel-components-react → imodel-components-react}/inputs/QuantityInput.js +1 -1
  39. package/lib/{esm/imodel-components-react → imodel-components-react}/inputs/QuantityInput.js.map +1 -1
  40. package/lib/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -0
  41. package/lib/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -0
  42. package/lib/{cjs/imodel-components-react → imodel-components-react}/inputs/QuantityNumberInput.scss +1 -1
  43. package/lib/imodel-components-react/lineweight/Swatch.d.ts.map +1 -0
  44. package/lib/{esm/imodel-components-react → imodel-components-react}/lineweight/Swatch.js +1 -1
  45. package/lib/{esm/imodel-components-react → imodel-components-react}/lineweight/Swatch.js.map +1 -1
  46. package/lib/{cjs/imodel-components-react → imodel-components-react}/lineweight/Swatch.scss +2 -4
  47. package/lib/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -0
  48. package/lib/{esm/imodel-components-react → imodel-components-react}/lineweight/WeightPickerButton.js +1 -1
  49. package/lib/{esm/imodel-components-react → imodel-components-react}/lineweight/WeightPickerButton.js.map +1 -1
  50. package/lib/{esm/imodel-components-react → imodel-components-react}/lineweight/WeightPickerButton.scss +5 -6
  51. package/lib/imodel-components-react/navigationaids/Cube.d.ts.map +1 -0
  52. package/lib/imodel-components-react/navigationaids/Cube.js.map +1 -0
  53. package/lib/{esm/imodel-components-react → imodel-components-react}/navigationaids/CubeNavigationAid.d.ts +1 -1
  54. package/lib/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -0
  55. package/lib/{esm/imodel-components-react → imodel-components-react}/navigationaids/CubeNavigationAid.js +3 -3
  56. package/lib/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -0
  57. package/lib/{esm/imodel-components-react → imodel-components-react}/navigationaids/CubeNavigationAid.scss +1 -2
  58. package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -0
  59. package/lib/{esm/imodel-components-react → imodel-components-react}/navigationaids/DrawingNavigationAid.js +2 -2
  60. package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -0
  61. package/lib/{cjs/imodel-components-react → imodel-components-react}/navigationaids/DrawingNavigationAid.scss +9 -10
  62. package/lib/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -0
  63. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatPanel.js +6 -6
  64. package/lib/imodel-components-react/quantityformat/FormatPanel.js.map +1 -0
  65. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatPanel.scss +0 -2
  66. package/lib/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -0
  67. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatPrecision.js +3 -3
  68. package/lib/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -0
  69. package/lib/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -0
  70. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatSample.js +1 -1
  71. package/lib/imodel-components-react/quantityformat/FormatSample.js.map +1 -0
  72. package/lib/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -0
  73. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatType.js +1 -1
  74. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatType.js.map +1 -1
  75. package/lib/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -0
  76. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatUnitLabel.js +1 -1
  77. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatUnitLabel.js.map +1 -1
  78. package/lib/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -0
  79. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/FormatUnits.js +2 -2
  80. package/lib/imodel-components-react/quantityformat/FormatUnits.js.map +1 -0
  81. package/lib/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -0
  82. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/MiscFormatOptions.js +7 -7
  83. package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -0
  84. package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -0
  85. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/QuantityFormatPanel.js +1 -1
  86. package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -0
  87. package/lib/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -0
  88. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/DecimalPrecision.js +1 -1
  89. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/DecimalPrecision.js.map +1 -1
  90. package/lib/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -0
  91. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/DecimalSeparator.js +1 -1
  92. package/lib/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -0
  93. package/lib/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -0
  94. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/FractionPrecision.js +1 -1
  95. package/lib/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -0
  96. package/lib/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -0
  97. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/ScientificType.js +1 -1
  98. package/lib/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -0
  99. package/lib/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -0
  100. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/SignOption.js +1 -1
  101. package/lib/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -0
  102. package/lib/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -0
  103. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/StationSeparatorSelector.js +1 -1
  104. package/lib/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -0
  105. package/lib/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -0
  106. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/StationSizeSelector.js +1 -1
  107. package/lib/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -0
  108. package/lib/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -0
  109. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/ThousandsSelector.js +1 -1
  110. package/lib/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -0
  111. package/lib/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -0
  112. package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/ThousandsSeparator.js +2 -2
  113. package/lib/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -0
  114. package/lib/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -0
  115. package/lib/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -0
  116. package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/BaseSolarDataProvider.d.ts +1 -1
  117. package/lib/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -0
  118. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/BaseSolarDataProvider.js.map +1 -1
  119. package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/BaseTimelineDataProvider.d.ts +1 -1
  120. package/lib/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -0
  121. package/lib/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -0
  122. package/lib/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -0
  123. package/lib/imodel-components-react/timeline/InlineEdit.js.map +1 -0
  124. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/InlineEdit.scss +3 -5
  125. package/lib/imodel-components-react/timeline/PlayButton.d.ts.map +1 -0
  126. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/PlayButton.js +1 -1
  127. package/lib/imodel-components-react/timeline/PlayButton.js.map +1 -0
  128. package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/Scrubber.d.ts +2 -4
  129. package/lib/imodel-components-react/timeline/Scrubber.d.ts.map +1 -0
  130. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/Scrubber.js +19 -12
  131. package/lib/imodel-components-react/timeline/Scrubber.js.map +1 -0
  132. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/Scrubber.scss +1 -1
  133. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/SolarTimeline.d.ts +1 -1
  134. package/lib/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -0
  135. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/SolarTimeline.js +3 -3
  136. package/lib/imodel-components-react/timeline/SolarTimeline.js.map +1 -0
  137. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/SolarTimeline.scss +0 -2
  138. package/lib/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -0
  139. package/lib/imodel-components-react/timeline/SpeedTimeline.js.map +1 -0
  140. package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/SpeedTimeline.scss +2 -4
  141. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/Timeline.scss +7 -9
  142. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/TimelineComponent.d.ts +1 -1
  143. package/lib/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -0
  144. package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/TimelineComponent.js +5 -5
  145. package/lib/imodel-components-react/timeline/TimelineComponent.js.map +1 -0
  146. package/lib/imodel-components-react/timeline/interfaces.d.ts.map +1 -0
  147. package/lib/imodel-components-react/timeline/interfaces.js.map +1 -0
  148. package/lib/imodel-components-react/useTranslation.d.ts.map +1 -0
  149. package/lib/{esm/imodel-components-react → imodel-components-react}/useTranslation.js +2 -2
  150. package/lib/imodel-components-react/useTranslation.js.map +1 -0
  151. package/lib/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -0
  152. package/lib/{esm/imodel-components-react → imodel-components-react}/viewport/ViewportComponent.js +1 -1
  153. package/lib/imodel-components-react/viewport/ViewportComponent.js.map +1 -0
  154. package/lib/{cjs/imodel-components-react → imodel-components-react}/viewport/ViewportComponentEvents.d.ts +1 -1
  155. package/lib/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -0
  156. package/lib/{esm/imodel-components-react → imodel-components-react}/viewport/ViewportComponentEvents.js +1 -1
  157. package/lib/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -0
  158. package/lib/imodel-components-react.d.ts +77 -0
  159. package/lib/imodel-components-react.d.ts.map +1 -0
  160. package/lib/imodel-components-react.js +90 -0
  161. package/lib/imodel-components-react.js.map +1 -0
  162. package/lib/internal.d.ts +2 -0
  163. package/lib/internal.d.ts.map +1 -0
  164. package/lib/{esm/imodel-components-react/navigationaids/Cube.scss → internal.js} +2 -15
  165. package/lib/internal.js.map +1 -0
  166. package/package.json +46 -36
  167. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +0 -1
  168. package/lib/cjs/imodel-components-react/UiIModelComponents.js +0 -78
  169. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +0 -1
  170. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +0 -1
  171. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +0 -182
  172. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +0 -1
  173. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +0 -1
  174. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +0 -119
  175. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +0 -1
  176. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +0 -90
  177. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +0 -1
  178. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +0 -76
  179. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +0 -1
  180. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +0 -1
  181. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +0 -141
  182. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +0 -1
  183. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +0 -1
  184. package/lib/cjs/imodel-components-react/color/HueSlider.js +0 -201
  185. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +0 -1
  186. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +0 -1
  187. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +0 -197
  188. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +0 -1
  189. package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +0 -1
  190. package/lib/cjs/imodel-components-react/color/Swatch.js +0 -63
  191. package/lib/cjs/imodel-components-react/color/Swatch.js.map +0 -1
  192. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts.map +0 -1
  193. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +0 -24
  194. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +0 -1
  195. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts.map +0 -1
  196. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +0 -150
  197. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +0 -1
  198. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts.map +0 -1
  199. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +0 -153
  200. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +0 -1
  201. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +0 -1
  202. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +0 -94
  203. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +0 -1
  204. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +0 -1
  205. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +0 -265
  206. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +0 -1
  207. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts.map +0 -1
  208. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +0 -84
  209. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +0 -1
  210. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +0 -1
  211. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +0 -160
  212. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +0 -1
  213. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +0 -51
  214. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts.map +0 -1
  215. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +0 -151
  216. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +0 -1
  217. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +0 -153
  218. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +0 -1
  219. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +0 -683
  220. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +0 -1
  221. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +0 -178
  222. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +0 -1
  223. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +0 -736
  224. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +0 -1
  225. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts.map +0 -1
  226. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +0 -112
  227. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +0 -1
  228. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +0 -55
  229. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +0 -1
  230. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +0 -56
  231. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +0 -1
  232. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +0 -1
  233. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +0 -94
  234. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +0 -1
  235. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +0 -1
  236. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +0 -115
  237. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +0 -1
  238. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +0 -1
  239. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +0 -117
  240. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +0 -1
  241. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +0 -1
  242. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +0 -137
  243. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +0 -1
  244. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +0 -1
  245. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +0 -193
  246. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +0 -1
  247. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +0 -1
  248. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +0 -145
  249. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +0 -1
  250. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +0 -1
  251. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +0 -104
  252. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +0 -1
  253. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +0 -1
  254. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +0 -59
  255. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +0 -1
  256. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +0 -1
  257. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +0 -87
  258. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +0 -1
  259. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +0 -1
  260. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +0 -60
  261. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +0 -1
  262. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +0 -1
  263. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +0 -68
  264. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +0 -1
  265. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +0 -1
  266. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +0 -76
  267. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +0 -1
  268. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +0 -1
  269. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +0 -59
  270. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +0 -1
  271. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +0 -1
  272. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +0 -65
  273. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +0 -1
  274. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +0 -1
  275. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +0 -106
  276. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +0 -1
  277. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +0 -1
  278. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +0 -135
  279. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +0 -1
  280. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +0 -1
  281. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +0 -150
  282. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +0 -1
  283. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +0 -1
  284. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +0 -64
  285. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +0 -1
  286. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts.map +0 -1
  287. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +0 -86
  288. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +0 -1
  289. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +0 -24
  290. package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts.map +0 -1
  291. package/lib/cjs/imodel-components-react/timeline/PlayButton.js +0 -50
  292. package/lib/cjs/imodel-components-react/timeline/PlayButton.js.map +0 -1
  293. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts.map +0 -1
  294. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +0 -185
  295. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +0 -1
  296. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +0 -105
  297. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +0 -60
  298. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +0 -1
  299. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +0 -358
  300. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +0 -1
  301. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +0 -45
  302. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts.map +0 -1
  303. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +0 -57
  304. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +0 -1
  305. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +0 -165
  306. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +0 -100
  307. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +0 -1
  308. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +0 -286
  309. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +0 -1
  310. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +0 -1
  311. package/lib/cjs/imodel-components-react/timeline/interfaces.js +0 -46
  312. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +0 -1
  313. package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +0 -1
  314. package/lib/cjs/imodel-components-react/useTranslation.js +0 -52
  315. package/lib/cjs/imodel-components-react/useTranslation.js.map +0 -1
  316. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +0 -1
  317. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +0 -267
  318. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +0 -1
  319. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +0 -1
  320. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +0 -119
  321. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +0 -1
  322. package/lib/cjs/imodel-components-react.d.ts +0 -80
  323. package/lib/cjs/imodel-components-react.d.ts.map +0 -1
  324. package/lib/cjs/imodel-components-react.js +0 -103
  325. package/lib/cjs/imodel-components-react.js.map +0 -1
  326. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +0 -29
  327. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +0 -1
  328. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +0 -1
  329. package/lib/esm/imodel-components-react/UiIModelComponents.json +0 -150
  330. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +0 -36
  331. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +0 -1
  332. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +0 -1
  333. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +0 -71
  334. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +0 -40
  335. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +0 -1
  336. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +0 -1
  337. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +0 -26
  338. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +0 -1
  339. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +0 -1
  340. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +0 -47
  341. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +0 -1
  342. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +0 -1
  343. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +0 -62
  344. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +0 -25
  345. package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +0 -1
  346. package/lib/esm/imodel-components-react/color/HueSlider.scss +0 -78
  347. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +0 -23
  348. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +0 -1
  349. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +0 -1
  350. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +0 -36
  351. package/lib/esm/imodel-components-react/color/Swatch.d.ts +0 -25
  352. package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +0 -1
  353. package/lib/esm/imodel-components-react/color/Swatch.scss +0 -22
  354. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +0 -7
  355. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts.map +0 -1
  356. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +0 -1
  357. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +0 -42
  358. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts.map +0 -1
  359. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +0 -1
  360. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +0 -18
  361. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +0 -44
  362. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts.map +0 -1
  363. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +0 -1
  364. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +0 -16
  365. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +0 -26
  366. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +0 -1
  367. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +0 -47
  368. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +0 -1
  369. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +0 -1
  370. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +0 -106
  371. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +0 -33
  372. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts.map +0 -1
  373. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +0 -48
  374. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +0 -59
  375. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +0 -1
  376. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +0 -46
  377. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts.map +0 -1
  378. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +0 -1
  379. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +0 -1
  380. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +0 -1
  381. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +0 -144
  382. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +0 -1
  383. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +0 -1
  384. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +0 -134
  385. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +0 -29
  386. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts.map +0 -1
  387. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +0 -1
  388. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +0 -19
  389. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +0 -1
  390. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +0 -1
  391. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +0 -20
  392. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +0 -1
  393. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +0 -1
  394. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +0 -19
  395. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +0 -1
  396. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +0 -19
  397. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +0 -1
  398. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +0 -21
  399. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +0 -1
  400. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +0 -1
  401. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +0 -23
  402. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +0 -1
  403. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +0 -1
  404. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +0 -24
  405. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +0 -1
  406. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +0 -1
  407. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +0 -18
  408. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +0 -1
  409. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +0 -18
  410. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +0 -1
  411. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +0 -1
  412. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +0 -17
  413. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +0 -1
  414. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +0 -1
  415. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +0 -19
  416. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +0 -1
  417. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +0 -1
  418. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +0 -18
  419. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +0 -1
  420. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +0 -1
  421. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +0 -18
  422. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +0 -1
  423. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +0 -1
  424. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +0 -18
  425. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +0 -1
  426. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +0 -1
  427. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +0 -18
  428. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +0 -1
  429. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +0 -1
  430. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +0 -18
  431. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +0 -1
  432. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +0 -1
  433. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +0 -24
  434. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +0 -1
  435. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +0 -1
  436. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +0 -53
  437. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +0 -1
  438. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +0 -32
  439. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +0 -1
  440. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +0 -1
  441. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +0 -27
  442. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts.map +0 -1
  443. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +0 -1
  444. package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts +0 -12
  445. package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts.map +0 -1
  446. package/lib/esm/imodel-components-react/timeline/PlayButton.js.map +0 -1
  447. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +0 -54
  448. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts.map +0 -1
  449. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +0 -1
  450. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +0 -1
  451. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +0 -1
  452. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +0 -16
  453. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts.map +0 -1
  454. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +0 -1
  455. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +0 -40
  456. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +0 -1
  457. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +0 -1
  458. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +0 -48
  459. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +0 -146
  460. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +0 -1
  461. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +0 -1
  462. package/lib/esm/imodel-components-react/useTranslation.d.ts +0 -7
  463. package/lib/esm/imodel-components-react/useTranslation.d.ts.map +0 -1
  464. package/lib/esm/imodel-components-react/useTranslation.js.map +0 -1
  465. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +0 -43
  466. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +0 -1
  467. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +0 -1
  468. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +0 -119
  469. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +0 -1
  470. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +0 -1
  471. package/lib/esm/imodel-components-react.d.ts +0 -80
  472. package/lib/esm/imodel-components-react.d.ts.map +0 -1
  473. package/lib/esm/imodel-components-react.js +0 -85
  474. package/lib/esm/imodel-components-react.js.map +0 -1
  475. /package/lib/{cjs/imodel-components-react → imodel-components-react}/UiIModelComponents.json +0 -0
  476. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/AlphaSlider.d.ts +0 -0
  477. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/AlphaSlider.scss +0 -0
  478. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/ColorPickerButton.d.ts +0 -0
  479. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/ColorPickerDialog.d.ts +0 -0
  480. /package/lib/{esm/imodel-components-react → imodel-components-react}/color/ColorPickerDialog.js +0 -0
  481. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/ColorPickerPopup.d.ts +0 -0
  482. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/ColorPickerPopup.scss +0 -0
  483. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/HueSlider.d.ts +0 -0
  484. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/HueSlider.scss +0 -0
  485. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/SaturationPicker.d.ts +0 -0
  486. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/SaturationPicker.scss +0 -0
  487. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/Swatch.d.ts +0 -0
  488. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/Swatch.scss +0 -0
  489. /package/lib/{cjs/imodel-components-react → imodel-components-react}/color/getCSSColorFromDef.d.ts +0 -0
  490. /package/lib/{esm/imodel-components-react → imodel-components-react}/color/getCSSColorFromDef.js +0 -0
  491. /package/lib/{cjs/imodel-components-react → imodel-components-react}/editors/ColorEditor.d.ts +0 -0
  492. /package/lib/{cjs/imodel-components-react → imodel-components-react}/editors/WeightEditor.d.ts +0 -0
  493. /package/lib/{cjs/imodel-components-react → imodel-components-react}/inputs/QuantityInput.d.ts +0 -0
  494. /package/lib/{cjs/imodel-components-react → imodel-components-react}/inputs/QuantityNumberInput.d.ts +0 -0
  495. /package/lib/{esm/imodel-components-react → imodel-components-react}/inputs/QuantityNumberInput.js +0 -0
  496. /package/lib/{cjs/imodel-components-react → imodel-components-react}/lineweight/Swatch.d.ts +0 -0
  497. /package/lib/{cjs/imodel-components-react → imodel-components-react}/lineweight/WeightPickerButton.d.ts +0 -0
  498. /package/lib/{cjs/imodel-components-react → imodel-components-react}/navigationaids/Cube.d.ts +0 -0
  499. /package/lib/{esm/imodel-components-react → imodel-components-react}/navigationaids/Cube.js +0 -0
  500. /package/lib/{cjs/imodel-components-react → imodel-components-react}/navigationaids/Cube.scss +0 -0
  501. /package/lib/{cjs/imodel-components-react → imodel-components-react}/navigationaids/DrawingNavigationAid.d.ts +0 -0
  502. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatPanel.d.ts +0 -0
  503. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatPrecision.d.ts +0 -0
  504. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatSample.d.ts +0 -0
  505. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatType.d.ts +0 -0
  506. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatUnitLabel.d.ts +0 -0
  507. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/FormatUnits.d.ts +0 -0
  508. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/MiscFormatOptions.d.ts +0 -0
  509. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/QuantityFormatPanel.d.ts +0 -0
  510. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/DecimalPrecision.d.ts +0 -0
  511. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/DecimalSeparator.d.ts +0 -0
  512. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/FractionPrecision.d.ts +0 -0
  513. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/ScientificType.d.ts +0 -0
  514. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/SignOption.d.ts +0 -0
  515. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/StationSeparatorSelector.d.ts +0 -0
  516. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/StationSizeSelector.d.ts +0 -0
  517. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/ThousandsSelector.d.ts +0 -0
  518. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/ThousandsSeparator.d.ts +0 -0
  519. /package/lib/{cjs/imodel-components-react → imodel-components-react}/quantityformat/misc/UnitDescr.d.ts +0 -0
  520. /package/lib/{esm/imodel-components-react → imodel-components-react}/quantityformat/misc/UnitDescr.js +0 -0
  521. /package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/BaseSolarDataProvider.js +0 -0
  522. /package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/BaseTimelineDataProvider.js +0 -0
  523. /package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/InlineEdit.d.ts +0 -0
  524. /package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/InlineEdit.js +0 -0
  525. /package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/PlayButton.d.ts +0 -0
  526. /package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/SpeedTimeline.d.ts +0 -0
  527. /package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/SpeedTimeline.js +0 -0
  528. /package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/TimelineComponent.scss +0 -0
  529. /package/lib/{cjs/imodel-components-react → imodel-components-react}/timeline/interfaces.d.ts +0 -0
  530. /package/lib/{esm/imodel-components-react → imodel-components-react}/timeline/interfaces.js +0 -0
  531. /package/lib/{cjs/imodel-components-react → imodel-components-react}/useTranslation.d.ts +0 -0
  532. /package/lib/{cjs/imodel-components-react → imodel-components-react}/viewport/ViewportComponent.d.ts +0 -0
package/README.md CHANGED
@@ -6,6 +6,19 @@ Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md
6
6
 
7
7
  The **@itwin/imodel-components-react** package contains React components that depend on the @itwin/core-frontend, @itwin/core-common or @itwin/core-quantity packages.
8
8
 
9
- ## Documentation
9
+ ## Usage
10
10
 
11
- See the [iTwin.js](https://www.itwinjs.org/learning/ui/imodel-components/) documentation for more information.
11
+ To get started with the `@itwin/imodel-components-react` package, simply import the necessary components and utilities:
12
+
13
+ ```tsx
14
+ import * as React from "react";
15
+ import { TimelineComponent } from "@itwin/imodel-components-react";
16
+
17
+ export function GetTimelineComponent() {
18
+ return (
19
+ <TimelineComponent startDate={new Date(2024, 8, 30)} endDate={new Date()} />
20
+ );
21
+ }
22
+ ```
23
+
24
+ For more details, check out the [@itwin/imodel-components-react documentation](https://www.itwinjs.org/reference/imodel-components-react/).
@@ -24,6 +24,6 @@ export declare class UiIModelComponents {
24
24
  */
25
25
  static translate(key: string | string[]): string;
26
26
  /** @internal */
27
- static loggerCategory(obj: any): string;
27
+ static loggerCategory(name: string): string;
28
28
  }
29
29
  //# sourceMappingURL=UiIModelComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiIModelComponents.d.ts","sourceRoot":"","sources":["../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAOH;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;OAEG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB/C,gEAAgE;WAClD,SAAS;IAQvB,4DAA4D;IAC5D,WAAkB,WAAW,IAAI,OAAO,CAEvC;IAED,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAavD,gBAAgB;WACF,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGnD"}
@@ -9,7 +9,6 @@ import { Logger } from "@itwin/core-bentley";
9
9
  import { IModelApp } from "@itwin/core-frontend";
10
10
  import { UiComponents } from "@itwin/components-react";
11
11
  import { EmptyLocalization } from "@itwin/core-common";
12
- import { getObjectClassName } from "@itwin/core-react";
13
12
  /**
14
13
  * Manages the localization service for the imodel-components-react package.
15
14
  * @public
@@ -20,7 +19,7 @@ export class UiIModelComponents {
20
19
  */
21
20
  static async initialize() {
22
21
  if (UiIModelComponents._initialized) {
23
- Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);
22
+ Logger.logInfo(UiIModelComponents.loggerCategory("UiIModelComponents"), `UiIModelComponents.initialize already called`);
24
23
  return;
25
24
  }
26
25
  await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);
@@ -58,16 +57,14 @@ export class UiIModelComponents {
58
57
  */
59
58
  static translate(key) {
60
59
  if (!UiIModelComponents.initialized || !IModelApp.localization) {
61
- Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);
60
+ Logger.logError(UiIModelComponents.loggerCategory("UiIModelComponents"), `translate: IModelApp.localization has not been setup. Returning blank string.`);
62
61
  return "";
63
62
  }
64
63
  return IModelApp.localization.getLocalizedString(`${UiIModelComponents.localizationNamespace}:${key}`);
65
64
  }
66
65
  /** @internal */
67
- static loggerCategory(obj) {
68
- const className = getObjectClassName(obj);
69
- const category = UiIModelComponents.packageName + (className ? `.${className}` : "");
70
- return category;
66
+ static loggerCategory(name) {
67
+ return `${UiIModelComponents.packageName}.${name}`;
71
68
  }
72
69
  }
73
70
  UiIModelComponents._initialized = false;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE,CAAC;YACpC,MAAM,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E,CAChF,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAC9C,GAAG,kBAAkB,CAAC,qBAAqB,IAAI,GAAG,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,IAAY;QACvC,OAAO,GAAG,kBAAkB,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;IACrD,CAAC;;AAzEc,+BAAY,GAAG,KAAK,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 Common\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { UiComponents } from \"@itwin/components-react\";\nimport { EmptyLocalization } from \"@itwin/core-common\";\n\n/**\n * Manages the localization service for the imodel-components-react package.\n * @public\n */\nexport class UiIModelComponents {\n private static _initialized = false;\n\n /**\n * initialize UiIModelComponents.\n */\n public static async initialize(): Promise<void> {\n if (UiIModelComponents._initialized) {\n Logger.logInfo(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `UiIModelComponents.initialize already called`\n );\n return;\n }\n\n await IModelApp.localization?.registerNamespace(\n UiIModelComponents.localizationNamespace\n );\n\n if (!IModelApp.localization) {\n // it should only get here in unit test where IModelApp is not setup\n const localization = new EmptyLocalization();\n await localization.initialize();\n await UiComponents.initialize(localization);\n } else {\n await UiComponents.initialize(IModelApp.localization);\n }\n\n UiIModelComponents._initialized = true;\n }\n\n /** Unregisters the UiIModelComponents localization namespace */\n public static terminate() {\n IModelApp.localization?.unregisterNamespace(\n UiIModelComponents.localizationNamespace\n );\n UiComponents.terminate();\n UiIModelComponents._initialized = false;\n }\n\n /** Determines if UiIModelComponents has been initialized */\n public static get initialized(): boolean {\n return UiIModelComponents._initialized;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiIModelComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"imodel-components-react\";\n }\n\n /** Calls localization.getLocalizedString with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiIModelComponents.initialized || !IModelApp.localization) {\n Logger.logError(\n UiIModelComponents.loggerCategory(\"UiIModelComponents\"),\n `translate: IModelApp.localization has not been setup. Returning blank string.`\n );\n return \"\";\n }\n return IModelApp.localization.getLocalizedString(\n `${UiIModelComponents.localizationNamespace}:${key}`\n );\n }\n\n /** @internal */\n public static loggerCategory(name: string): string {\n return `${UiIModelComponents.packageName}.${name}`;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlphaSlider.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/AlphaSlider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;GAGG;AACH,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAE1C,WAAW;IACb,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtD,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AAEH,qBAAa,WAAY,SAAQ,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IACpE,OAAO,CAAC,UAAU,CAA+B;IAEjD,gBAAgB;gBAEJ,KAAK,EAAE,gBAAgB;IAInC,OAAO,CAAC,gBAAgB,CAuDtB;IAEc,oBAAoB;IAIpC,OAAO,CAAC,SAAS,CAcf;IAEF,OAAO,CAAC,YAAY,CAKlB;IAEF,OAAO,CAAC,UAAU,CA6BhB;IAEF,OAAO,CAAC,UAAU,CAEhB;IAEF,OAAO,CAAC,qBAAqB;IAKb,MAAM,IAAI,KAAK,CAAC,SAAS;CA0C1C"}
@@ -9,7 +9,7 @@ import "./AlphaSlider.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { Key } from "ts-key-enum";
12
- import { UiIModelComponents } from "../UiIModelComponents";
12
+ import { UiIModelComponents } from "../UiIModelComponents.js";
13
13
  /** AlphaSlider component used to set the alpha value.
14
14
  * @public
15
15
  * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlphaSlider.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/AlphaSlider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAkB9D;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,aAA+B;IAGpE,gBAAgB;IAChB,mDAAmD;IACnD,YAAY,KAAuB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QALP,eAAU,GAA0B,IAAI,CAAC;QAQzC,qBAAgB,GAAG,CACzB,CAAsE,EACtE,YAAqB,EACrB,KAAa,EACb,SAAyB,EACL,EAAE;YACtB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,GACtD,SAAS,CAAC,qB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,MAAM,YAAY,GAAwB,IAAI,CAAC,KAAK,CAAC,YAAY;YAC/D,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,GAAG,EAAE;YACxC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;QAEhE,OAAO,CACL,6BACE,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,iBACX,iBAAiB;YAE7B,4CACc,cAAc,EAC1B,IAAI,EAAC,QAAQ,gBACD,kBAAkB,CAAC,SAAS,CAAC,oBAAoB,CAAC,mBAC/C,CAAC,mBACD,CAAC,mBACD,IAAI,CAAC,KAAK,CAAC,KAAK,EAC/B,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,EACjD,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,WAAW,EAAE,IAAI,CAAC,SAAS,EAC3B,YAAY,EAAE,IAAI,CAAC,SAAS,EAC5B,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,IAAI,CAAC,UAAU;gBAE1B,6BACE,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,0BAA0B,iBACxB,eAAe,GAC3B,CACE,CACF,CACP,CAAC;IACJ,CAAC;CACF","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 Color\n */\n\nimport \"./AlphaSlider.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents.js\";\n\n/** Properties for the [[AlphaSlider]] React component\n * @public\n * @deprecated in 4.11.0. Props of deprecated component {@link AlphaSlider}.\n */\nexport interface AlphaSliderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** true if slider is oriented horizontal, else vertical orientation is assumed */\n isHorizontal?: boolean;\n /** function to run when user selects color swatch */\n onAlphaChange?: ((alpha: number) => void) | undefined;\n /** Alpha value between 0 (transparent) and 1 (opaque) */\n alpha: number;\n}\n\n/** AlphaSlider component used to set the alpha value.\n * @public\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class AlphaSlider extends React.PureComponent<AlphaSliderProps> {\n private _container: HTMLDivElement | null = null;\n\n /** @internal */\n // eslint-disable-next-line deprecation/deprecation\n constructor(props: AlphaSliderProps) {\n super(props);\n }\n\n private _calculateChange = (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n isHorizontal: boolean,\n alpha: number,\n container: HTMLDivElement\n ): number | undefined => {\n e.preventDefault();\n const { width: containerWidth, height: containerHeight } =\n container.getBoundingClientRect();\n\n let x = 0;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n if (undefined === e.touches) return undefined;\n x = e.touches[0].pageX;\n }\n if (undefined === x) return undefined;\n\n let y = 0;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n if (undefined === e.touches) return;\n y = e.touches[0].pageY;\n }\n if (undefined === y) return undefined;\n\n const left = x - (container.getBoundingClientRect().left + window.scrollX);\n const top = y - (container.getBoundingClientRect().top + window.scrollY);\n\n let t = 0;\n\n if (!isHorizontal) {\n if (top < 0) {\n t = 1;\n } else if (top > containerHeight) {\n t = 0;\n } else {\n t = 1 - top / containerHeight;\n }\n } else {\n // horizontal\n if (left < 0) {\n t = 0;\n } else if (left > containerWidth) {\n t = 1;\n } else {\n t = left / containerWidth;\n }\n }\n\n if (t < 0) t = 0;\n if (t > 1) t = 1;\n return alpha !== t ? t : undefined;\n };\n\n public override componentWillUnmount() {\n this._unbindEventListeners();\n }\n\n private _onChange = (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (this._container && this.props.onAlphaChange) {\n const change = this._calculateChange(\n e,\n this.props.isHorizontal ? this.props.isHorizontal : false,\n this.props.alpha,\n this._container\n );\n undefined !== change &&\n typeof this.props.onAlphaChange === \"function\" &&\n this.props.onAlphaChange(change);\n }\n };\n\n private _onMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {\n this._onChange(e);\n if (this._container) this._container.focus();\n window.addEventListener(\"mousemove\", this._onChange as any);\n window.addEventListener(\"mouseup\", this._onMouseUp);\n };\n\n private _onKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n let newTransparency: number | undefined;\n if (\n evt.key === Key.ArrowLeft.valueOf() ||\n evt.key === Key.ArrowDown.valueOf()\n ) {\n newTransparency = this.props.alpha - (evt.ctrlKey ? 0.1 : 0.05);\n } else if (\n evt.key === Key.ArrowRight.valueOf() ||\n evt.key === Key.ArrowUp.valueOf()\n ) {\n newTransparency = this.props.alpha + (evt.ctrlKey ? 0.1 : 0.05);\n } else if (evt.key === Key.PageDown.valueOf()) {\n newTransparency = this.props.alpha - (evt.ctrlKey ? 0.5 : 0.25);\n } else if (evt.key === Key.PageUp.valueOf()) {\n newTransparency = this.props.alpha + (evt.ctrlKey ? 0.5 : 0.25);\n } else if (evt.key === Key.Home.valueOf()) {\n newTransparency = 0;\n } else {\n if (evt.key === Key.End.valueOf()) {\n newTransparency = 1;\n }\n }\n\n if (undefined !== newTransparency) {\n if (newTransparency > 1) newTransparency = 1;\n if (newTransparency < 0) newTransparency = 0;\n if (this.props.onAlphaChange) this.props.onAlphaChange(newTransparency);\n }\n };\n\n private _onMouseUp = () => {\n this._unbindEventListeners();\n };\n\n private _unbindEventListeners() {\n window.removeEventListener(\"mousemove\", this._onChange as any);\n window.removeEventListener(\"mouseup\", this._onMouseUp);\n }\n\n public override render(): React.ReactNode {\n const containerClasses = classnames(\n this.props.isHorizontal\n ? \"components-alpha-container-horizontal\"\n : \"components-alpha-container-vertical\",\n this.props.className\n );\n\n const pointerStyle: React.CSSProperties = this.props.isHorizontal\n ? { left: `${this.props.alpha * 100}%` }\n : { left: `0px`, top: `${-(this.props.alpha * 100) + 100}%` };\n\n return (\n <div\n className={containerClasses}\n style={this.props.style}\n data-testid=\"alpha-container\"\n >\n <div\n data-testid=\"alpha-slider\"\n role=\"slider\"\n aria-label={UiIModelComponents.translate(\"color.transparency\")}\n aria-valuemin={0}\n aria-valuemax={1}\n aria-valuenow={this.props.alpha}\n className=\"components-alpha-slider\"\n ref={(container) => (this._container = container)}\n onMouseDown={this._onMouseDown}\n onTouchMove={this._onChange}\n onTouchStart={this._onChange}\n tabIndex={0}\n onKeyDown={this._onKeyDown}\n >\n <div\n style={pointerStyle}\n className=\"components-alpha-pointer\"\n data-testid=\"alpha-pointer\"\n />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerButton.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/ColorPickerButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgDrD;;;GAGG;AACH,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAEnD,WAAW;IACb,mBAAmB;IACnB,YAAY,EAAE,QAAQ,CAAC;IACvB,uBAAuB;IACvB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtD,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAqID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAE9B,KAAK,EAAE,gBAAgB,KACpB,KAAK,CAAC,SAAuC,CAAC"}
@@ -10,9 +10,10 @@ import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { ColorByName, ColorDef } from "@itwin/core-common";
12
12
  import { RelativePosition } from "@itwin/appui-abstract";
13
- import { Icon, Popup, useRefs } from "@itwin/core-react";
14
- import { ColorSwatch } from "./Swatch";
15
- import { getCSSColorFromDef } from "./getCSSColorFromDef";
13
+ import { Icon, Popup } from "@itwin/core-react";
14
+ import { useRefs } from "@itwin/core-react/internal";
15
+ import { ColorSwatch } from "./Swatch.js";
16
+ import { getCSSColorFromDef } from "./getCSSColorFromDef.js";
16
17
  import { SvgCaretDownSmall, SvgCaretUpSmall } from "@itwin/itwinui-icons-react";
17
18
  // cSpell:ignore colorpicker
18
19
  function ColorOptions({ handleColorPicked, options, numColumns, round, title, }) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerButton.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/ColorPickerButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAE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F,MAAM,YAAY,GAChB,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC;IACpE,OAAO,CACL;QACE,+CACc,+BAA+B,gBAC/B,UAAU,EACtB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,IAAI;YAET,6BAAK,SAAS,EAAC,yCAAyC;gBACtD,6BACE,SAAS,EAAC,4CAA4C,EACtD,KAAK,EAAE,WAAW,iBACL,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,GAClD;gBACD,SAAS,IAAI;gBACZ,mDAAmD;gBACnD,oBAAC,IAAI,IACH,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CAAC,CAAC,CAAC,oBAAC,iBAAiB,OAAG,GACjE,CACH,CACG,CACC;QAET,oBAAC,KAAK,IACJ,SAAS,EAAC,8BAA8B,EACxC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,EACrC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,8BAA8B;YAE9B,oBAAC,YAAY,IACX,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,IAAI,CAAC,EAC3B,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAE,aAAa,GACpB,CACI,CACP,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAGP,2BAA2B,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 Color\n */\n\nimport \"./ColorPickerButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon, Popup } from \"@itwin/core-react\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport { ColorSwatch } from \"./Swatch.js\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef.js\";\nimport { SvgCaretDownSmall, SvgCaretUpSmall } from \"@itwin/itwinui-icons-react\";\n\n// cSpell:ignore colorpicker\n\nfunction ColorOptions({\n handleColorPicked,\n options,\n numColumns,\n round,\n title,\n}: {\n handleColorPicked: (color: ColorDef) => void;\n options: ColorDef[];\n numColumns: number;\n round: boolean;\n title?: string;\n}) {\n const containerStyle: React.CSSProperties = {\n gridTemplateColumns: `repeat(${numColumns}, 1fr)`,\n };\n return (\n <div className=\"components-colorpicker-popup-container\">\n {title && <h4>{title}</h4>}\n <div\n data-testid=\"components-colorpicker-popup-colors\"\n className=\"components-colorpicker-popup-colors\"\n style={containerStyle}\n >\n {options.map((color, index) => (\n // eslint-disable-next-line deprecation/deprecation\n <ColorSwatch\n className=\"components-colorpicker-swatch\"\n key={index}\n colorDef={color}\n onColorPick={handleColorPicked}\n round={round}\n />\n ))}\n </div>\n </div>\n );\n}\n\n/** Properties for the [[ColorPickerButton]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link ColorPickerButton}.\n */\nexport interface ColorPickerProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** Active color */\n initialColor: ColorDef;\n /** Available colors */\n colorDefs?: ColorDef[];\n /** Function to run when user selects color swatch */\n onColorPick?: ((color: ColorDef) => void) | undefined;\n /** Show swatches as squares unless round is set to true */\n round?: boolean;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not */\n readonly?: boolean;\n /** Title to show at top of DropDown */\n dropDownTitle?: string;\n /** Number of columns */\n numColumns?: number;\n /** Provides ability to return reference to HTMLButtonElement */\n ref?: React.Ref<HTMLButtonElement>;\n /** If true show up/down caret next to color */\n showCaret?: boolean;\n}\n\n// Defined using following pattern (const ColorPickerButton at bottom) to ensure useful API documentation is extracted\nconst ForwardRefColorPickerButton = React.forwardRef<\n HTMLButtonElement,\n // eslint-disable-next-line deprecation/deprecation\n ColorPickerProps\n>(function ForwardRefColorPickerButton(\n {\n className,\n colorDefs,\n disabled,\n dropDownTitle,\n initialColor,\n numColumns,\n onColorPick,\n readonly,\n round,\n showCaret,\n style,\n },\n ref\n) {\n const target = React.useRef<HTMLButtonElement>(null);\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\n const [showPopup, setShowPopup] = React.useState(false);\n const [colorDef, setColorDef] = React.useState(initialColor);\n\n // See if new initialColor props have changed since component mounted\n React.useEffect(() => {\n setColorDef(initialColor);\n }, [initialColor]);\n\n const defaultColors = React.useRef([\n ColorDef.create(ColorByName.red),\n ColorDef.create(ColorByName.orange),\n ColorDef.create(ColorByName.yellow),\n ColorDef.create(ColorByName.green),\n ColorDef.create(ColorByName.blue),\n ColorDef.create(ColorByName.indigo),\n ColorDef.create(ColorByName.violet),\n ColorDef.create(ColorByName.black),\n ColorDef.create(ColorByName.white),\n ColorDef.create(ColorByName.cyan),\n ColorDef.create(ColorByName.fuchsia),\n ColorDef.create(ColorByName.tan),\n ColorDef.create(ColorByName.gray),\n ColorDef.create(ColorByName.brown),\n ColorDef.create(ColorByName.purple),\n ColorDef.create(ColorByName.olive),\n ]);\n\n const closePopup = React.useCallback(() => {\n setShowPopup(false);\n }, []);\n\n const togglePopup = React.useCallback(() => {\n setShowPopup(!showPopup);\n }, [showPopup]);\n\n const handleColorPicked = React.useCallback(\n (color: ColorDef) => {\n closePopup();\n\n if (!color.equals(colorDef)) {\n setColorDef(color);\n onColorPick && onColorPick(color);\n }\n },\n [closePopup, colorDef, onColorPick]\n );\n\n const rgbaString = getCSSColorFromDef(colorDef);\n\n const buttonStyle = { ...style } as React.CSSProperties;\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\n\n const buttonClassNames = classnames(\n \"components-colorpicker-button\",\n round && \"round\",\n readonly && \"readonly\",\n className\n );\n\n const colorOptions =\n colorDefs && colorDefs.length ? colorDefs : defaultColors.current;\n return (\n <>\n <button\n data-testid=\"components-colorpicker-button\"\n data-value={rgbaString}\n onClick={togglePopup}\n className={buttonClassNames}\n style={buttonStyle}\n disabled={disabled}\n ref={refs}\n >\n <div className=\"components-colorpicker-button-container\">\n <div\n className=\"components-colorpicker-button-color-swatch\"\n style={swatchStyle}\n data-testid={showPopup ? \"caret-up\" : \"caret-down\"}\n />\n {showCaret && (\n // eslint-disable-next-line deprecation/deprecation\n <Icon\n className=\"components-caret\"\n iconSpec={showPopup ? <SvgCaretUpSmall /> : <SvgCaretDownSmall />}\n />\n )}\n </div>\n </button>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Popup\n className=\"components-colorpicker-popup\"\n isOpen={showPopup}\n position={RelativePosition.BottomLeft}\n onClose={closePopup}\n target={target.current}\n closeOnNestedPopupOutsideClick\n >\n <ColorOptions\n handleColorPicked={handleColorPicked}\n options={colorOptions}\n numColumns={numColumns ?? 4}\n round={!!round}\n title={dropDownTitle}\n />\n </Popup>\n </>\n );\n});\n\n/** ColorPickerButton component\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport const ColorPickerButton: (\n // eslint-disable-next-line deprecation/deprecation\n props: ColorPickerProps\n) => React.ReactNode = ForwardRefColorPickerButton;\n"]}
@@ -2,8 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
-
7
5
  button.components-colorpicker-button {
8
6
  font-family: var(--iui-font-sans);
9
7
  font-size: var(--iui-font-size-1);
@@ -43,7 +41,7 @@ button.components-colorpicker-button {
43
41
 
44
42
  > .components-colorpicker-button-container {
45
43
  > .components-caret {
46
- color: $buic-icon-color-disabled;
44
+ color: var(--iui-color-text-disabled);
47
45
  }
48
46
  }
49
47
  }
@@ -66,7 +64,7 @@ button.components-colorpicker-button {
66
64
 
67
65
  .components-colorpicker-popup-container {
68
66
  color: var(--iui-color-text);
69
- background: $buic-background-control;
67
+ background: var(--iui-color-background);
70
68
  border-radius: 6px;
71
69
 
72
70
  > .components-colorpicker-popup-colors {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerDialog.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/ColorPickerDialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAS9C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,UAAU,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC9C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mCAAmC;IACnC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,6FAA6F;IAC7F,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,KAAK,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EACD,sBAAsB,qBA0DrB"}
@@ -0,0 +1 @@
1
+ {"version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,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CACjC,GAAG,EAAE,CAAC;QACJ,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAChD,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;KACzD,EACD,CAAC,YAAY,EAAE,QAAQ,CAAC,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,6BAAK,GAAG,EAAE,eAAe;QAEvB,oBAAC,MAAM,IACL,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,KAAK,EAChB,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,IAAI,EACX,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,GAAG;YAEb,oBAAC,WAAW,IACV,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EACpD,gBAAgB,EAAE,kBAAkB;gBAEpC,oBAAC,YAAY,OAAG;gBACf,cAAc,IAAI,CACjB,oBAAC,eAAe,IAAC,kBAAkB,EAAE,cAAc,GAAI,CACxD;gBACA,YAAY,IAAI,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC3C,CACP,CACL,CACP,CAAC;AACJ,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 Color\n */\n\nimport * as React from \"react\";\nimport { DialogButtonType } from \"@itwin/appui-abstract\";\nimport { Dialog } from \"@itwin/core-react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport {\n ColorBuilder,\n ColorInputPanel,\n ColorPalette,\n ColorPicker,\n ColorValue,\n} from \"@itwin/itwinui-react\";\n\n/** Properties for the [[ColorPickerDialog]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link ColorPickerDialog}.\n */\nexport interface ColorPickerDialogProps {\n dialogTitle: string;\n color: ColorDef;\n onOkResult: (selectedColor: ColorDef) => void;\n onCancelResult: () => void;\n /** displayed in rows of 9 items */\n colorPresets?: ColorDef[];\n /** If set show either HSL, RGB, or HEX input values. If undefined no input value is shown */\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\n}\n\n/**\n * Color Picker Dialog to use as modal dialog.\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport function ColorPickerDialog({\n dialogTitle,\n color,\n onOkResult,\n onCancelResult,\n colorPresets,\n colorInputType,\n}: // eslint-disable-next-line deprecation/deprecation\nColorPickerDialogProps) {\n const [activeColor, setActiveColor] = React.useState(color);\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const handleOk = React.useCallback(() => {\n onOkResult(activeColor);\n }, [onOkResult, activeColor]);\n const handleCancel = React.useCallback(() => {\n if (onCancelResult) onCancelResult();\n }, [onCancelResult]);\n\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\n const newColorDef = ColorDef.fromTbgr(newColorValue.toTbgr());\n setActiveColor(newColorDef);\n }, []);\n\n const buttonCluster = React.useMemo(\n () => [\n { type: DialogButtonType.OK, onClick: handleOk },\n { type: DialogButtonType.Cancel, onClick: handleCancel },\n ],\n [handleCancel, handleOk]\n );\n\n const colorOptions = React.useMemo(() => {\n if (colorPresets) {\n return colorPresets.map((def) => ColorValue.fromTbgr(def.tbgr));\n }\n return undefined;\n }, [colorPresets]);\n\n return (\n <div ref={dialogContainer}>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Dialog\n title={dialogTitle}\n opened={true}\n resizable={false}\n movable={true}\n modal={true}\n buttonCluster={buttonCluster}\n onClose={handleCancel}\n onEscape={handleCancel}\n maxWidth={320}\n >\n <ColorPicker\n selectedColor={ColorValue.fromTbgr(activeColor.tbgr)}\n onChangeComplete={handleColorChanged}\n >\n <ColorBuilder />\n {colorInputType && (\n <ColorInputPanel defaultColorFormat={colorInputType} />\n )}\n {colorOptions && <ColorPalette colors={colorOptions} />}\n </ColorPicker>\n </Dialog>\n </div>\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerPopup.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAe,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD,OAAO,yBAAyB,CAAC;AASjC;;;GAGG;AACH,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAEnD,WAAW;IACb,oBAAoB;IACpB,YAAY,EAAE,QAAQ,CAAC;IACvB;uCACmC;IACnC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,uDAAuD;IACvD,aAAa,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,gEAAgE;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+BAA+B;IAC/B,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACxC;AAgKD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAE7B,KAAK,EAAE,qBAAqB,KACzB,KAAK,CAAC,SAAsC,CAAC"}
@@ -9,12 +9,13 @@ import * as React from "react";
9
9
  import classnames from "classnames";
10
10
  import { ColorByName, ColorDef } from "@itwin/core-common";
11
11
  import { RelativePosition } from "@itwin/appui-abstract";
12
- import { Icon, Popup, useRefs } from "@itwin/core-react";
12
+ import { Icon, Popup } from "@itwin/core-react";
13
+ import { useRefs } from "@itwin/core-react/internal";
13
14
  import { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue, } from "@itwin/itwinui-react";
14
15
  import "./ColorPickerPopup.scss";
15
- import { getCSSColorFromDef } from "./getCSSColorFromDef";
16
+ import { getCSSColorFromDef } from "./getCSSColorFromDef.js";
16
17
  import { SvgCaretDownSmall, SvgCaretUpSmall, SvgClose, } from "@itwin/itwinui-icons-react";
17
- import { useTranslation } from "../useTranslation";
18
+ import { useTranslation } from "../useTranslation.js";
18
19
  // Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted
19
20
  const ForwardRefColorPickerPopup = React.forwardRef(function ForwardRefColorPickerPopup(props, ref) {
20
21
  const { translate } = useTranslation();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerPopup.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,QAAQ,GACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAqCtD,qHAAqH;AAErH,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CAIjD,SAAS,0BAA0B,CAAC,KAAK,EAAE,GAAG;IAC9C,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,uGAAuG;IAC1I,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC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AM,CAAC,MAAM,gBAAgB,GAGN,0BAA0B,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 Color\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Icon, Popup } from \"@itwin/core-react\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport {\n ColorBuilder,\n ColorInputPanel,\n ColorPalette,\n ColorPicker,\n ColorValue,\n} from \"@itwin/itwinui-react\";\nimport \"./ColorPickerPopup.scss\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef.js\";\nimport {\n SvgCaretDownSmall,\n SvgCaretUpSmall,\n SvgClose,\n} from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n/** Properties for the [[ColorPickerPopup]] React component\n * @public\n * @deprecated in 4.11.0. Props of deprecated component {@link ColorPickerPopup}.\n */\nexport interface ColorPickerPopupProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** Current color */\n initialColor: ColorDef;\n /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.\n * Displayed in rows of 9 items */\n colorDefs?: ColorDef[];\n /** Function to call when the color value is changed */\n onColorChange?: ((newColor: ColorDef) => void) | undefined;\n /** Function to call when the popup is closed */\n onClose?: ((colorValue: ColorDef) => void) | undefined;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not, color displayed on button but button will not trigger pop-up */\n readonly?: boolean;\n /** popup position. If not set RelativePosition.BottomLeft is used */\n popupPosition?: RelativePosition;\n /** Provides ability to return reference to HTMLButtonElement */\n ref?: React.Ref<HTMLButtonElement>;\n /** If true show up/down caret next to color */\n showCaret?: boolean;\n /** If true, don't propagate clicks out of the ColorPicker */\n captureClicks?: boolean;\n /** If true, don't show close button at top */\n hideCloseButton?: boolean;\n /** If set show input values */\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\n}\n\n// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted\n\nconst ForwardRefColorPickerPopup = React.forwardRef<\n HTMLButtonElement,\n // eslint-disable-next-line deprecation/deprecation\n ColorPickerPopupProps\n>(function ForwardRefColorPickerPopup(props, ref) {\n const { translate } = useTranslation();\n const target = React.useRef<HTMLButtonElement>(null);\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\n const [showPopup, setShowPopup] = React.useState(false);\n const [colorDef, setColorDef] = React.useState(props.initialColor);\n const initialColorRef = React.useRef(props.initialColor);\n\n React.useEffect(() => {\n if (props.initialColor !== initialColorRef.current) {\n initialColorRef.current = props.initialColor;\n setColorDef(props.initialColor);\n }\n }, [props.initialColor]);\n\n const defaultColors = React.useRef([\n ColorValue.fromTbgr(ColorByName.red),\n ColorValue.fromTbgr(ColorByName.orange),\n ColorValue.fromTbgr(ColorByName.yellow),\n ColorValue.fromTbgr(ColorByName.green),\n ColorValue.fromTbgr(ColorByName.blue),\n ColorValue.fromTbgr(ColorByName.mediumBlue),\n ColorValue.fromTbgr(ColorByName.indigo),\n ColorValue.fromTbgr(ColorByName.violet),\n ColorValue.fromTbgr(ColorByName.black),\n ColorValue.fromTbgr(ColorByName.white),\n ColorValue.fromTbgr(ColorByName.cyan),\n ColorValue.fromTbgr(ColorByName.fuchsia),\n ColorValue.fromTbgr(ColorByName.tan),\n ColorValue.fromTbgr(ColorByName.gray),\n ColorValue.fromTbgr(ColorByName.brown),\n ColorValue.fromTbgr(ColorByName.purple),\n ColorValue.fromTbgr(ColorByName.olive),\n ColorValue.fromTbgr(ColorByName.darkGreen),\n ]);\n\n const closePopup = React.useCallback(() => {\n props.onClose && props.onClose(colorDef);\n setShowPopup(false);\n }, [colorDef, props]);\n\n const togglePopup = React.useCallback(() => {\n setShowPopup(!showPopup);\n }, [showPopup]);\n\n const handleColorChanged = React.useCallback(\n (newColorValue: ColorValue) => {\n const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());\n if (!newColor.equals(colorDef)) {\n setColorDef(newColor);\n\n props.onColorChange && props.onColorChange(newColor);\n }\n },\n [colorDef, props]\n );\n\n const rgbaString = getCSSColorFromDef(colorDef);\n\n const buttonStyle = { ...props.style } as React.CSSProperties;\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\n const buttonClassNames = classnames(\n \"components-colorpicker-popup-button\",\n props.readonly && \"readonly\",\n props.className\n );\n\n const clickHandler = (event: React.MouseEvent) => {\n if (props.captureClicks) event.stopPropagation();\n };\n\n const colorOptions = React.useMemo(() => {\n if (props.colorDefs && props.colorDefs.length) {\n return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));\n }\n if (props.colorDefs && 0 === props.colorDefs.length) return undefined;\n return defaultColors.current;\n }, [props.colorDefs]);\n const popupPosition =\n undefined !== props.popupPosition\n ? props.popupPosition\n : RelativePosition.BottomLeft;\n\n const closeLabel = translate(\"color.close\");\n const togglePopupLabel = translate(\"color.toggleColorPopup\");\n\n return (\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n <div onClick={clickHandler}>\n <button\n data-testid=\"components-colorpicker-popup-button\"\n onClick={togglePopup}\n className={buttonClassNames}\n style={buttonStyle}\n disabled={props.disabled}\n ref={refs}\n title={togglePopupLabel}\n >\n <div className=\"components-colorpicker-button-container\">\n <div\n className=\"components-colorpicker-button-color-swatch\"\n style={swatchStyle}\n data-testid={showPopup ? \"caret-up\" : \"caret-down\"}\n />\n {props.showCaret && (\n // eslint-disable-next-line deprecation/deprecation\n <Icon\n className=\"components-caret\"\n iconSpec={showPopup ? <SvgCaretUpSmall /> : <SvgCaretDownSmall />}\n />\n )}\n </div>\n </button>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Popup\n className=\"components-colorpicker-popup\"\n isOpen={showPopup}\n position={popupPosition}\n onClose={closePopup}\n target={target.current}\n closeOnNestedPopupOutsideClick\n >\n <div className=\"components-colorpicker-popup-panel-padding\">\n {!props.hideCloseButton && (\n <button\n title={closeLabel}\n className={\n \"core-focus-trap-ignore-initial core-dialog-close icon\"\n }\n data-testid=\"core-dialog-close\"\n onClick={togglePopup}\n >\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Icon iconSpec={<SvgClose />} />\n </button>\n )}\n <ColorPicker\n selectedColor={ColorValue.fromTbgr(colorDef.tbgr)}\n onChangeComplete={handleColorChanged}\n >\n <ColorBuilder />\n {props.colorInputType && (\n <ColorInputPanel defaultColorFormat={props.colorInputType} />\n )}\n {colorOptions && <ColorPalette colors={colorOptions} />}\n </ColorPicker>\n </div>\n </Popup>\n </div>\n );\n});\n\n/**\n * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\n * @public\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport const ColorPickerPopup: (\n // eslint-disable-next-line deprecation/deprecation\n props: ColorPickerPopupProps\n) => React.ReactNode = ForwardRefColorPickerPopup;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HueSlider.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/HueSlider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2DrD;;;GAGG;AACH,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAE1C,WAAW;IACb,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpD,sBAAsB;IACtB,GAAG,EAAE,QAAQ,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,WAAW,EACX,GAAG,EACH,SAAS,EACT,KAAK,GACN,EACD,cAAc,qBAwKb"}
@@ -9,7 +9,7 @@ import "./HueSlider.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { Key } from "ts-key-enum";
12
- import { useTranslation } from "../useTranslation";
12
+ import { useTranslation } from "../useTranslation.js";
13
13
  // hue is a value from 0 to 360
14
14
  function calculateHue(currentPos, high, isVertical) {
15
15
  if (currentPos <= 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"HueSlider.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/HueSlider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,+BAA+B;AAC/B,SAAS,YAAY,CAAC,UAAkB,EAAE,IAAY,EAAE,UAAmB;IACzE,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC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CAAC,CAAC;YACE,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG;YACvC,eAAe,EAAE,OAAO,GAAG,CAAC,CAAC,cAAc;SAC5C,CAAC;IAEN,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,iBAAc,eAAe;QACzE,4CACc,YAAY,EACxB,IAAI,EAAC,QAAQ,gBACD,SAAS,CAAC,WAAW,CAAC,mBACnB,CAAC,mBACD,GAAG,mBACH,GAAG,CAAC,CAAC,EACpB,SAAS,EAAC,uBAAuB,EACjC,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,UAAU,EACvB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,SAAS;YAEpB,6BACE,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,wBAAwB,iBACtB,aAAa,GACzB,CACE,CACF,CACP,CAAC;AACJ,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 Color\n */\n\nimport \"./HueSlider.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { HSVColor } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { useTranslation } from \"../useTranslation\";\n\n// hue is a value from 0 to 360\nfunction calculateHue(currentPos: number, high: number, isVertical: boolean) {\n if (currentPos <= 0) {\n return isVertical ? 359 : 0;\n } else if (currentPos >= high) {\n return isVertical ? 0 : 359;\n } else {\n let percent = (currentPos * 100) / high;\n if (isVertical) percent = 100 - percent;\n return Math.round((359 * percent) / 100);\n }\n}\n\nfunction calculateChange(\n currentHue: number,\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n isHorizontal: boolean,\n container: HTMLDivElement\n) {\n const {\n width: containerWidth,\n height: containerHeight,\n top: containerTop,\n left: containerLeft,\n } = container.getBoundingClientRect();\n\n let x: number | undefined;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n if (undefined === e.touches || 0 === e.touches.length) return currentHue;\n x = e.touches[0].pageX;\n }\n if (undefined === x) return currentHue;\n\n let y: number | undefined;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n if (undefined === e.touches || 0 === e.touches.length) return currentHue;\n y = e.touches[0].pageY;\n }\n if (undefined === y) return currentHue;\n\n const pointerX = x - (containerLeft + window.scrollX);\n const pointerY = y - (containerTop + window.scrollY);\n\n if (!isHorizontal) {\n // vertical\n return calculateHue(pointerY, containerHeight, true);\n } else {\n // horizontal\n return calculateHue(pointerX, containerWidth, false);\n }\n}\n\n/** Properties for the [[HueSlider]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link HueSlider}.\n */\nexport interface HueSliderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** true if slider is oriented horizontal, else vertical orientation is assumed */\n isHorizontal?: boolean;\n /** function to run when user hue is changed */\n onHueChange?: ((hue: HSVColor) => void) | undefined;\n /** HSV Color Value */\n hsv: HSVColor;\n}\n\n/** HueSlider component used to set the hue value.\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport function HueSlider({\n isHorizontal,\n onHueChange,\n hsv,\n className,\n style,\n}: // eslint-disable-next-line deprecation/deprecation\nHueSliderProps) {\n const { translate } = useTranslation();\n const container = React.useRef<HTMLDivElement>(null);\n const isDragging = React.useRef(false);\n\n const onChange = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (container.current) {\n const newHue = calculateChange(\n hsv.h,\n e,\n !!isHorizontal,\n container.current\n );\n const newColor = hsv.clone(newHue);\n if (onHueChange) onHueChange(newColor);\n }\n },\n [isHorizontal, hsv, onHueChange]\n );\n\n const onDragging = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (isDragging.current) {\n onChange(e);\n }\n },\n [onChange]\n );\n\n const onMouseUp = React.useCallback(() => {\n if (isDragging.current) {\n isDragging.current = false;\n }\n }, []);\n\n const onTouchEnd = React.useCallback(\n (event: React.TouchEvent<HTMLDivElement>) => {\n event.preventDefault();\n\n if (isDragging.current) {\n onChange(event);\n isDragging.current = false;\n }\n },\n [onChange]\n );\n\n const onMouseDown = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n if (e.target !== e.currentTarget) {\n if (!isDragging.current) {\n document.addEventListener(\"mouseup\", onMouseUp, {\n capture: true,\n once: true,\n });\n isDragging.current = true;\n }\n }\n\n onChange(e);\n\n if (container.current) container.current.focus();\n },\n [onChange, onMouseUp]\n );\n\n const onTouchStart = React.useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) isDragging.current = true;\n\n onChange(e);\n\n if (container.current) container.current.focus();\n },\n [onChange]\n );\n\n const onKeyDown = React.useCallback(\n (evt: React.KeyboardEvent<HTMLDivElement>) => {\n let newHue: number | undefined;\n const hueValue = hsv.h;\n if (\n evt.key === Key.ArrowLeft.valueOf() ||\n evt.key === Key.ArrowDown.valueOf()\n ) {\n newHue = hueValue - (evt.ctrlKey ? 10 : 1);\n } else if (\n evt.key === Key.ArrowRight.valueOf() ||\n evt.key === Key.ArrowUp.valueOf()\n ) {\n newHue = hueValue + (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === Key.PageDown.valueOf()) {\n newHue = hueValue - (evt.ctrlKey ? 180 : 60);\n } else if (evt.key === Key.PageUp.valueOf()) {\n newHue = hueValue + (evt.ctrlKey ? 180 : 60);\n } else if (evt.key === Key.Home.valueOf()) {\n newHue = 0;\n } else {\n if (evt.key === Key.End.valueOf()) {\n newHue = 359;\n }\n }\n\n if (undefined !== newHue) {\n if (newHue > 359) newHue = 359; // 360 is same as zero\n if (newHue < 0) newHue = 0;\n\n const newColor = hsv.clone(newHue);\n if (onHueChange) onHueChange(newColor);\n evt.preventDefault();\n }\n },\n [hsv, onHueChange]\n );\n\n const containerClasses = classnames(\n isHorizontal\n ? \"components-hue-container-horizontal\"\n : \"components-hue-container-vertical\",\n className\n );\n\n const pointerStyle: React.CSSProperties = isHorizontal\n ? {\n left: `${(hsv.h * 100) / 360}%`,\n backgroundColor: `hsl(${hsv.h} ,100%, 50%)`,\n }\n : {\n left: `0px`,\n top: `${-((hsv.h * 100) / 360) + 100}%`,\n backgroundColor: `hsl(${hsv.h} ,100%, 50%)`,\n };\n\n return (\n <div className={containerClasses} style={style} data-testid=\"hue-container\">\n <div\n data-testid=\"hue-slider\"\n role=\"slider\"\n aria-label={translate(\"color.hue\")}\n aria-valuemin={0}\n aria-valuemax={360}\n aria-valuenow={hsv.h}\n className=\"components-hue-slider\"\n ref={container}\n onMouseDown={onMouseDown}\n onMouseMove={onDragging}\n onTouchMove={onDragging}\n onMouseUp={onMouseUp}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n tabIndex={0}\n onKeyDown={onKeyDown}\n >\n <div\n style={pointerStyle}\n className=\"components-hue-pointer\"\n data-testid=\"hue-pointer\"\n />\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"HueSlider.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/HueSlider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,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------------------------------------------------------\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 Color\n */\n\nimport \"./HueSlider.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { HSVColor } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { useTranslation } from \"../useTranslation.js\";\n\n// hue is a value from 0 to 360\nfunction calculateHue(currentPos: number, high: number, isVertical: boolean) {\n if (currentPos <= 0) {\n return isVertical ? 359 : 0;\n } else if (currentPos >= high) {\n return isVertical ? 0 : 359;\n } else {\n let percent = (currentPos * 100) / high;\n if (isVertical) percent = 100 - percent;\n return Math.round((359 * percent) / 100);\n }\n}\n\nfunction calculateChange(\n currentHue: number,\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n isHorizontal: boolean,\n container: HTMLDivElement\n) {\n const {\n width: containerWidth,\n height: containerHeight,\n top: containerTop,\n left: containerLeft,\n } = container.getBoundingClientRect();\n\n let x: number | undefined;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n if (undefined === e.touches || 0 === e.touches.length) return currentHue;\n x = e.touches[0].pageX;\n }\n if (undefined === x) return currentHue;\n\n let y: number | undefined;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n if (undefined === e.touches || 0 === e.touches.length) return currentHue;\n y = e.touches[0].pageY;\n }\n if (undefined === y) return currentHue;\n\n const pointerX = x - (containerLeft + window.scrollX);\n const pointerY = y - (containerTop + window.scrollY);\n\n if (!isHorizontal) {\n // vertical\n return calculateHue(pointerY, containerHeight, true);\n } else {\n // horizontal\n return calculateHue(pointerX, containerWidth, false);\n }\n}\n\n/** Properties for the [[HueSlider]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link HueSlider}.\n */\nexport interface HueSliderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** true if slider is oriented horizontal, else vertical orientation is assumed */\n isHorizontal?: boolean;\n /** function to run when user hue is changed */\n onHueChange?: ((hue: HSVColor) => void) | undefined;\n /** HSV Color Value */\n hsv: HSVColor;\n}\n\n/** HueSlider component used to set the hue value.\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport function HueSlider({\n isHorizontal,\n onHueChange,\n hsv,\n className,\n style,\n}: // eslint-disable-next-line deprecation/deprecation\nHueSliderProps) {\n const { translate } = useTranslation();\n const container = React.useRef<HTMLDivElement>(null);\n const isDragging = React.useRef(false);\n\n const onChange = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (container.current) {\n const newHue = calculateChange(\n hsv.h,\n e,\n !!isHorizontal,\n container.current\n );\n const newColor = hsv.clone(newHue);\n if (onHueChange) onHueChange(newColor);\n }\n },\n [isHorizontal, hsv, onHueChange]\n );\n\n const onDragging = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (isDragging.current) {\n onChange(e);\n }\n },\n [onChange]\n );\n\n const onMouseUp = React.useCallback(() => {\n if (isDragging.current) {\n isDragging.current = false;\n }\n }, []);\n\n const onTouchEnd = React.useCallback(\n (event: React.TouchEvent<HTMLDivElement>) => {\n event.preventDefault();\n\n if (isDragging.current) {\n onChange(event);\n isDragging.current = false;\n }\n },\n [onChange]\n );\n\n const onMouseDown = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n if (e.target !== e.currentTarget) {\n if (!isDragging.current) {\n document.addEventListener(\"mouseup\", onMouseUp, {\n capture: true,\n once: true,\n });\n isDragging.current = true;\n }\n }\n\n onChange(e);\n\n if (container.current) container.current.focus();\n },\n [onChange, onMouseUp]\n );\n\n const onTouchStart = React.useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) isDragging.current = true;\n\n onChange(e);\n\n if (container.current) container.current.focus();\n },\n [onChange]\n );\n\n const onKeyDown = React.useCallback(\n (evt: React.KeyboardEvent<HTMLDivElement>) => {\n let newHue: number | undefined;\n const hueValue = hsv.h;\n if (\n evt.key === Key.ArrowLeft.valueOf() ||\n evt.key === Key.ArrowDown.valueOf()\n ) {\n newHue = hueValue - (evt.ctrlKey ? 10 : 1);\n } else if (\n evt.key === Key.ArrowRight.valueOf() ||\n evt.key === Key.ArrowUp.valueOf()\n ) {\n newHue = hueValue + (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === Key.PageDown.valueOf()) {\n newHue = hueValue - (evt.ctrlKey ? 180 : 60);\n } else if (evt.key === Key.PageUp.valueOf()) {\n newHue = hueValue + (evt.ctrlKey ? 180 : 60);\n } else if (evt.key === Key.Home.valueOf()) {\n newHue = 0;\n } else {\n if (evt.key === Key.End.valueOf()) {\n newHue = 359;\n }\n }\n\n if (undefined !== newHue) {\n if (newHue > 359) newHue = 359; // 360 is same as zero\n if (newHue < 0) newHue = 0;\n\n const newColor = hsv.clone(newHue);\n if (onHueChange) onHueChange(newColor);\n evt.preventDefault();\n }\n },\n [hsv, onHueChange]\n );\n\n const containerClasses = classnames(\n isHorizontal\n ? \"components-hue-container-horizontal\"\n : \"components-hue-container-vertical\",\n className\n );\n\n const pointerStyle: React.CSSProperties = isHorizontal\n ? {\n left: `${(hsv.h * 100) / 360}%`,\n backgroundColor: `hsl(${hsv.h} ,100%, 50%)`,\n }\n : {\n left: `0px`,\n top: `${-((hsv.h * 100) / 360) + 100}%`,\n backgroundColor: `hsl(${hsv.h} ,100%, 50%)`,\n };\n\n return (\n <div className={containerClasses} style={style} data-testid=\"hue-container\">\n <div\n data-testid=\"hue-slider\"\n role=\"slider\"\n aria-label={translate(\"color.hue\")}\n aria-valuemin={0}\n aria-valuemax={360}\n aria-valuenow={hsv.h}\n className=\"components-hue-slider\"\n ref={container}\n onMouseDown={onMouseDown}\n onMouseMove={onDragging}\n onTouchMove={onDragging}\n onMouseUp={onMouseUp}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n tabIndex={0}\n onKeyDown={onKeyDown}\n >\n <div\n style={pointerStyle}\n className=\"components-hue-pointer\"\n data-testid=\"hue-pointer\"\n />\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaturationPicker.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/SaturationPicker.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,yBAAyB,CAAC;AAEjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAuDrD;;;GAGG;AACH,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAE1C,WAAW;IACb,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAClE,sBAAsB;IACtB,GAAG,EAAE,QAAQ,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,kBAAkB,EAClB,GAAG,EACH,SAAS,EACT,KAAK,GACN,EACD,qBAAqB,qBA6JpB"}
@@ -10,7 +10,7 @@ import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { Key } from "ts-key-enum";
12
12
  import { ColorDef, HSVColor } from "@itwin/core-common";
13
- import { useTranslation } from "../useTranslation";
13
+ import { useTranslation } from "../useTranslation.js";
14
14
  function calculateChange(e, hsv, container) {
15
15
  const { width: containerWidth, height: containerHeight, top: containerTop, left: containerLeft, } = container.getBoundingClientRect();
16
16
  let x;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Satur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B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,SAAS;YAEpB,6BACE,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,+BAA+B,iBAC7B,oBAAoB,GAChC,CACE,CACF,CACP,CAAC;AACJ,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 Color\n */\n\nimport \"./SaturationPicker.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { ColorDef, HSVColor } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { useTranslation } from \"../useTranslation.js\";\n\nfunction calculateChange(\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n hsv: HSVColor,\n container: HTMLDivElement\n): HSVColor | undefined {\n const {\n width: containerWidth,\n height: containerHeight,\n top: containerTop,\n left: containerLeft,\n } = container.getBoundingClientRect();\n\n let x: number | undefined;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n if (undefined !== e.touches && e.touches.length) x = e.touches[0].pageX;\n }\n if (undefined === x) return hsv;\n\n let y = 0;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n if (undefined !== e.touches && e.touches.length) y = e.touches[0].pageY;\n }\n if (undefined === y) return hsv;\n\n let left = x - (containerLeft + window.scrollX);\n let top = y - (containerTop + window.scrollY);\n\n if (left < 0) {\n left = 0;\n } else if (left > containerWidth) {\n left = containerWidth;\n } else if (top < 0) {\n top = 0;\n } else if (top > containerHeight) {\n top = containerHeight;\n }\n\n let saturation = Math.round((left * 100) / containerWidth);\n let value = Math.round(-((top * 100) / containerHeight) + 100);\n\n if (saturation < 0) saturation = 0;\n if (saturation > 100) saturation = 100;\n if (value < 0) value = 0;\n if (value > 100) value = 100;\n\n return hsv.clone(hsv.h, saturation, value);\n}\n\n/** Properties for the [[SaturationPicker]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link SaturationPicker}.\n */\nexport interface SaturationPickerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** function to run when user selects location in saturation region */\n onSaturationChange?: ((saturation: HSVColor) => void) | undefined;\n /** HSV Color Value */\n hsv: HSVColor;\n}\n\n/** SaturationPicker component used to set the saturation value.\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\nexport function SaturationPicker({\n onSaturationChange,\n hsv,\n className,\n style,\n}: // eslint-disable-next-line deprecation/deprecation\nSaturationPickerProps) {\n const { translate } = useTranslation();\n const container = React.useRef<HTMLDivElement>(null);\n const isDragging = React.useRef(false);\n\n const onChange = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (container.current) {\n const newHsvColor = calculateChange(e, hsv, container.current);\n if (newHsvColor) {\n if (onSaturationChange) onSaturationChange(newHsvColor);\n }\n }\n },\n [hsv, onSaturationChange]\n );\n\n const onDragging = React.useCallback(\n (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (isDragging.current) {\n onChange(e);\n }\n },\n [onChange]\n );\n\n const onMouseUp = React.useCallback(() => {\n if (isDragging.current) {\n isDragging.current = false;\n }\n }, []);\n\n const onTouchEnd = React.useCallback(\n (event: React.TouchEvent<HTMLDivElement>) => {\n if (isDragging.current) {\n onChange(event);\n isDragging.current = false;\n }\n },\n [onChange]\n );\n\n const onMouseDown = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) {\n isDragging.current = true;\n document.addEventListener(\"mouseup\", onMouseUp, {\n capture: true,\n once: true,\n });\n }\n\n onChange(e);\n\n if (container.current) container.current.focus();\n\n e.preventDefault();\n },\n [onChange, onMouseUp]\n );\n\n const onTouchStart = React.useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) isDragging.current = true;\n\n onChange(e);\n\n if (container.current) container.current.focus();\n },\n [onChange]\n );\n\n const onKeyDown = React.useCallback(\n (evt: React.KeyboardEvent<HTMLDivElement>) => {\n const h = hsv.h;\n let { s, v } = { ...hsv };\n if (evt.key === Key.ArrowLeft.valueOf()) {\n s -= evt.ctrlKey ? 10 : 1;\n } else if (evt.key === Key.ArrowDown.valueOf()) {\n v -= evt.ctrlKey ? 10 : 1;\n } else if (evt.key === Key.ArrowRight.valueOf()) {\n s += evt.ctrlKey ? 10 : 1;\n } else if (evt.key === Key.ArrowUp.valueOf()) {\n v += evt.ctrlKey ? 10 : 1;\n } else if (evt.key === Key.PageDown.valueOf()) {\n v = 0;\n } else if (evt.key === Key.PageUp.valueOf()) {\n v = 100;\n } else if (evt.key === Key.Home.valueOf()) {\n s = 0;\n } else {\n if (evt.key === Key.End.valueOf()) {\n s = 100;\n }\n }\n\n if (s < 0) s = 0;\n if (s > 100) s = 100;\n if (v < 0) v = 0;\n if (v > 100) v = 100;\n\n const newColor = new HSVColor(h, s, v);\n if (onSaturationChange) onSaturationChange(newColor);\n\n evt.preventDefault();\n },\n [hsv, onSaturationChange]\n );\n\n const pointerStyle: React.CSSProperties = React.useMemo(\n () => ({\n left: `${hsv.s}%`,\n top: `${-hsv.v + 100}%`,\n backgroundColor: `${ColorDef.fromHSV(hsv).toRgbString()}`,\n }),\n [hsv]\n );\n\n const colorStyle: React.CSSProperties = React.useMemo(\n () => ({ backgroundColor: `hsl(${hsv.h} ,100%, 50%)` }),\n [hsv]\n );\n\n return (\n <div\n className={classnames(\"components-saturation-container\", className)}\n style={style}\n data-testid=\"saturation-container\"\n >\n <div\n data-testid=\"saturation-region\"\n role=\"slider\"\n aria-label={translate(\"color.saturation\")}\n aria-valuenow={hsv.s}\n style={colorStyle}\n className=\"components-saturation-region\"\n ref={container}\n onMouseDown={onMouseDown}\n onMouseMove={onDragging}\n onTouchMove={onDragging}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n tabIndex={0}\n onKeyDown={onKeyDown}\n >\n <div\n style={pointerStyle}\n className=\"components-saturation-pointer\"\n data-testid=\"saturation-pointer\"\n />\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Swatch.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/Swatch.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;GAGG;AACH,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAEnD,WAAW;IACb,0BAA0B;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3E,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAgClD"}
@@ -8,7 +8,7 @@
8
8
  import "./Swatch.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
- import { getCSSColorFromDef } from "./getCSSColorFromDef";
11
+ import { getCSSColorFromDef } from "./getCSSColorFromDef.js";
12
12
  /** ColorSwatch Functional component displays a color swatch in a button
13
13
  * @beta
14
14
  * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.
@@ -1 +1 @@
1
- {"version":3,"file":"Swatch.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/Swatch.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAkB1D;;;GAGG;AACH,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,UAAU,GAAwB;QACtC,eAAe,EAAE,UAAU;QAC3B,GAAG,KAAK,CAAC,KAAK;KACf,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAAmB,EAAE,EAAE;QAC1C,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW;YAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CACxB,yBAAyB,EACzB,KAAK,CAAC,KAAK,IAAI,OAAO,EACtB,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,KAAK,EAAE,6CAA6C;IACpD,GAAG,UAAU,CAAC,qBAAqB;MACpC,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,mCACM,UAAU,EACd,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;AACJ,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 Color\n */\n\nimport \"./Swatch.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ColorDef } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\n\n/** Properties for the [[ColorSwatch]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link ColorSwatch}.\n */\nexport interface ColorSwatchProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** color specification */\n colorDef: ColorDef;\n /** function to run when user selects color swatch */\n onColorPick?: ((color: ColorDef, e: React.MouseEvent) => void) | undefined;\n /** Show swatches as squares unless round is set to true */\n round?: boolean;\n}\n\n/** ColorSwatch Functional component displays a color swatch in a button\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function ColorSwatch(props: ColorSwatchProps) {\n const rgbaString = getCSSColorFromDef(props.colorDef);\n const colorStyle: React.CSSProperties = {\n backgroundColor: rgbaString,\n ...props.style,\n };\n\n const handleClick = (e: React.MouseEvent) => {\n if (props && props.onColorPick) props.onColorPick(props.colorDef, e);\n };\n\n const classes = classnames(\n \"components-color-swatch\",\n props.round && \"round\",\n props.className\n );\n\n const {\n onColorPick,\n colorDef,\n round, // do not pass on color swatch specific props\n ...otherProps // pass-through props\n } = props;\n\n return (\n <button\n {...otherProps}\n style={colorStyle}\n className={classes}\n onClick={handleClick}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Swatch.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/Swatch.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAkB7D;;;GAGG;AACH,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,UAAU,GAAwB;QACtC,eAAe,EAAE,UAAU;QAC3B,GAAG,KAAK,CAAC,KAAK;KACf,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAAmB,EAAE,EAAE;QAC1C,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW;YAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CACxB,yBAAyB,EACzB,KAAK,CAAC,KAAK,IAAI,OAAO,EACtB,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,KAAK,EAAE,6CAA6C;IACpD,GAAG,UAAU,CAAC,qBAAqB;MACpC,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,mCACM,UAAU,EACd,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;AACJ,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 Color\n */\n\nimport \"./Swatch.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ColorDef } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef.js\";\n\n/** Properties for the [[ColorSwatch]] React component\n * @beta\n * @deprecated in 4.11.0. Props of deprecated component {@link ColorSwatch}.\n */\nexport interface ColorSwatchProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n // eslint-disable-next-line deprecation/deprecation\n CommonProps {\n /** color specification */\n colorDef: ColorDef;\n /** function to run when user selects color swatch */\n onColorPick?: ((color: ColorDef, e: React.MouseEvent) => void) | undefined;\n /** Show swatches as squares unless round is set to true */\n round?: boolean;\n}\n\n/** ColorSwatch Functional component displays a color swatch in a button\n * @beta\n * @deprecated in 4.11.0. Use {@link https://itwinui.bentley.com/docs/colorpicker iTwinUI color picker} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function ColorSwatch(props: ColorSwatchProps) {\n const rgbaString = getCSSColorFromDef(props.colorDef);\n const colorStyle: React.CSSProperties = {\n backgroundColor: rgbaString,\n ...props.style,\n };\n\n const handleClick = (e: React.MouseEvent) => {\n if (props && props.onColorPick) props.onColorPick(props.colorDef, e);\n };\n\n const classes = classnames(\n \"components-color-swatch\",\n props.round && \"round\",\n props.className\n );\n\n const {\n onColorPick,\n colorDef,\n round, // do not pass on color swatch specific props\n ...otherProps // pass-through props\n } = props;\n\n return (\n <button\n {...otherProps}\n style={colorStyle}\n className={classes}\n onClick={handleClick}\n />\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCSSColorFromDef.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/color/getCSSColorFromDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAS7D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCSSColorFromDef.js","sourceRoot":"","sources":["../../../src/imodel-components-react/color/getCSSColorFromDef.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,gBAAgB;AAChB,MAAM,UAAU,kBAAkB,CAAC,QAAkB;IACnD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;IACvC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC,KAAK,CAAC;QAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;SAC3C,CAAC;QACJ,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3C,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;IAC/C,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,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 Color\n */\n\nimport type { ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport function getCSSColorFromDef(colorDef: ColorDef): string {\n const { b, g, r, t } = colorDef.colors;\n let rgbaString = \"\";\n if (t === 0) rgbaString = `rgb(${r},${g},${b})`;\n else {\n const alpha = ((255 - t) / 255).toFixed(2);\n rgbaString = `rgba(${r},${g},${b},${alpha})`;\n }\n return rgbaString;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorEditor.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/editors/ColorEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAIV,aAAa,EACd,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,gBAAgB;AAChB,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,QAAQ,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,WACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,gBAAgB,CACjE,YAAW,UAAU;IAErB,OAAO,CAAC,cAAc,CACF;IAEpB,SAAyB,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAKxD;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,YAAY,CAgBlB;IAEc,iBAAiB;IAIjB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IAkCf,MAAM;CAwBvB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
@@ -9,9 +9,9 @@ import "./ColorEditor.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { ColorDef } from "@itwin/core-common";
12
- import { PropertyEditorParamTypes, PropertyValueFormat, StandardEditorNames, StandardTypeNames, } from "@itwin/appui-abstract";
13
- import { PropertyEditorBase, PropertyEditorManager, } from "@itwin/components-react";
14
- import { ColorPickerButton } from "../color/ColorPickerButton";
12
+ import { PropertyEditorParamTypes, PropertyValueFormat, } from "@itwin/appui-abstract";
13
+ import { PropertyEditorBase } from "@itwin/components-react";
14
+ import { ColorPickerButton } from "../color/ColorPickerButton.js";
15
15
  /** ColorEditor React component that is a property editor with text input
16
16
  * @beta
17
17
  */
@@ -115,5 +115,4 @@ export class ColorPropertyEditor extends PropertyEditorBase {
115
115
  return React.createElement(ColorEditor, null);
116
116
  }
117
117
  }
118
- PropertyEditorManager.registerEditor(StandardTypeNames.Number, ColorPropertyEditor, StandardEditorNames.ColorPicker);
119
118
  //# sourceMappingURL=ColorEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorEditor.js","sourceRoot":"","sources":["../../../src/imodel-components-react/editors/ColorEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAO9C,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE;;GAEG;AACH,MAAM,OAAO,WACX,SAAQ,KAAK,CAAC,aAAoD;IADpE;;QAIU,mBAAc,GACpB,KAAK,CAAC,SAAS,EAAE,CAAC;QAEK,UAAK,GAA+B;YAC3D,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,CAAC;YACb,eAAe,EAAE,EAAE;SACpB,CAAC;QAmCM,iBAAY,GAAG,CAAC,KAAe,EAAE,EAAE;YACzC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAgC,CAAC;YAEnE,IAAI,CAAC,QAAQ,CACX;gBACE,UAAU,EAAE,KAAK,CAAC,IAAI;aACvB,EACD,KAAK,IAAI,EAAE;gBACT,IAAI,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;oBAC1C,MAAM,aAAa,GAAG,MAAM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ACD,IAAI,CAAC,QAAQ,CACX,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,EACjE,GAAG,EAAE;gBACH,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAEe,MAAM;QACpB,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxD,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACtE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAEvB,oBAAC,iBAAiB,CAAC,8CAA8C;gBAC/D,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,YAAY,EAAE,QAAQ,EACtB,SAAS,EACP,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;oBACnC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe;oBAC5B,CAAC,CAAC,CAAC,QAAQ,CAAC,EAEhB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAC9C,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,WAAW,EAAE,IAAI,CAAC,YAAY,iBAClB,yBAAyB,GACrC,CACE,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS;QAClB,OAAO,oBAAC,WAAW,OAAG,CAAC;IACzB,CAAC;CACF","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 PropertyEditors\n */\n\nimport \"./ColorEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport type {\n ColorEditorParams,\n PropertyEditorParams,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyEditorProps, TypeEditor } from \"@itwin/components-react\";\nimport { PropertyEditorBase } from \"@itwin/components-react\";\nimport { ColorPickerButton } from \"../color/ColorPickerButton.js\";\n\n/** @internal */\ninterface ColorEditorState {\n colorValue: number;\n readonly: boolean;\n isDisabled?: boolean;\n numColumns: number;\n availableColors: ColorDef[];\n}\n\n/** ColorEditor React component that is a property editor with text input\n * @beta\n */\nexport class ColorEditor\n extends React.PureComponent<PropertyEditorProps, ColorEditorState>\n implements TypeEditor\n{\n private _buttonElement: React.RefObject<HTMLButtonElement> =\n React.createRef();\n\n public override readonly state: Readonly<ColorEditorState> = {\n colorValue: 0,\n readonly: false,\n numColumns: 4,\n availableColors: [],\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.colorValue,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._buttonElement.current;\n }\n\n public get hasFocus(): boolean {\n return document.activeElement === this._buttonElement.current;\n }\n\n private setFocus(): void {\n if (\n this._buttonElement &&\n this._buttonElement.current &&\n !this.state.isDisabled\n ) {\n this._buttonElement.current.focus();\n }\n }\n\n private _onColorPick = (color: ColorDef) => {\n const propertyRecord = this.props.propertyRecord as PropertyRecord;\n\n this.setState(\n {\n colorValue: color.tbgr,\n },\n async () => {\n if (propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n if (propertyValue !== undefined) {\n this.props.onCommit({ propertyRecord, newValue: propertyValue });\n }\n }\n }\n );\n };\n\n public override componentDidMount() {\n void this.setStateFromProps();\n }\n\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n void this.setStateFromProps();\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n const colorValue = record.value.value as number;\n let numColumns = 4;\n const availableColors = new Array<ColorDef>();\n const readonly =\n record && undefined !== record.isReadonly ? record.isReadonly : false;\n const isDisabled = record ? record.isDisabled : undefined;\n\n if (record.property.editor && record.property.editor.params) {\n const colorParams = record.property.editor.params.find(\n (param: PropertyEditorParams) =>\n param.type === PropertyEditorParamTypes.ColorData.valueOf()\n ) as ColorEditorParams;\n if (colorParams) {\n colorParams.colorValues.forEach((colorNumber: number) => {\n availableColors.push(ColorDef.create(colorNumber));\n });\n if (colorParams.numColumns) numColumns = colorParams.numColumns;\n }\n }\n this.setState(\n { colorValue, readonly, isDisabled, numColumns, availableColors },\n () => {\n if (this.props.setFocus) {\n this.setFocus();\n }\n }\n );\n }\n }\n\n public override render() {\n const colorDef = ColorDef.create(this.state.colorValue);\n return (\n <div\n className={classnames(\"components-color-editor\", this.props.className)}\n style={this.props.style}\n >\n <ColorPickerButton // eslint-disable-line deprecation/deprecation\n ref={this._buttonElement}\n initialColor={colorDef}\n colorDefs={\n this.state.availableColors.length > 0\n ? this.state.availableColors\n : [colorDef]\n }\n numColumns={this.state.numColumns}\n disabled={this.state.isDisabled ? true : false}\n readonly={this.state.readonly}\n onColorPick={this._onColorPick}\n data-testid=\"components-color-editor\"\n />\n </div>\n );\n }\n}\n\n/** Color Property Editor registered for the \"number\" type name and \"color-picker\" editor name.\n * It uses the [[ColorEditor]] React component.\n * @beta\n */\nexport class ColorPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <ColorEditor />;\n }\n}\n"]}
@@ -2,8 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
-
7
5
  $components-color-editor-item-height: 100%;
8
6
 
9
7
  .components-color-editor {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeightEditor.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/editors/WeightEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAK7D,gBAAgB;AAChB,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,YACX,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,iBAAiB,CAClE,YAAW,UAAU;IAErB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,WAAW,CAAqC;IAExD,SAAyB,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAGzD;gBAEU,KAAK,EAAE,mBAAmB;IAezB,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAenE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAK7B;IAED,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,iBAAiB,CAgBvB;IAEc,iBAAiB;IAKjB,oBAAoB;IAIpB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IAoBf,MAAM;CAuBvB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
@@ -8,9 +8,9 @@
8
8
  import "./WeightEditor.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
- import { PropertyValueFormat, StandardEditorNames, StandardTypeNames, } from "@itwin/appui-abstract";
12
- import { PropertyEditorBase, PropertyEditorManager, } from "@itwin/components-react";
13
- import { WeightPickerButton } from "../lineweight/WeightPickerButton";
11
+ import { PropertyValueFormat } from "@itwin/appui-abstract";
12
+ import { PropertyEditorBase } from "@itwin/components-react";
13
+ import { WeightPickerButton } from "../lineweight/WeightPickerButton.js";
14
14
  /** WeightEditor React component that is a property editor for picking a weight using a [[WeightPickerButton]] component
15
15
  * @public
16
16
  */
@@ -118,5 +118,4 @@ export class WeightPropertyEditor extends PropertyEditorBase {
118
118
  return React.createElement(WeightEditor, null);
119
119
  }
120
120
  }
121
- PropertyEditorManager.registerEditor(StandardTypeNames.Number, WeightPropertyEditor, StandardEditorNames.WeightPicker);
122
121
  //# sourceMappingURL=WeightEditor.js.map