@itwin/imodel-components-react 3.4.0-dev.55 → 3.4.0-dev.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  4. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +186 -186
  6. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
  8. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  9. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
  12. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  13. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  15. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  23. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  24. package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  27. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
  29. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  30. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  31. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  32. package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
  33. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  34. package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
  35. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  36. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  37. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  38. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  39. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
  40. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  41. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  42. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  43. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
  44. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  46. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  47. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
  48. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  49. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +265 -265
  51. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  53. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
  55. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  57. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
  59. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  60. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  61. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  62. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
  63. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  64. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  65. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +634 -634
  67. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  68. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  69. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  72. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  73. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +83 -83
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  92. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +154 -154
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  128. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  131. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  134. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  138. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
  142. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
  146. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  150. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  151. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  154. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  155. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +358 -358
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  159. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  162. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  163. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  168. package/lib/cjs/imodel-components-react.d.ts +82 -82
  169. package/lib/cjs/imodel-components-react.js +101 -101
  170. package/lib/cjs/imodel-components-react.js.map +1 -1
  171. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  172. package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -75
  173. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  174. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  175. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  176. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  177. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  178. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  179. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
  180. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  181. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
  182. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  183. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  184. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  185. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
  186. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
  187. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
  188. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
  189. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
  193. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  194. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  195. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  196. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  197. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  198. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  199. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  200. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  201. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  202. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  203. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  204. package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
  205. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  206. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  207. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  208. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  209. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  210. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  211. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  212. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  213. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  214. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  215. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  216. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  217. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  218. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  219. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  220. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
  221. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  222. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
  223. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  224. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  225. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  226. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  227. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  228. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
  229. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  230. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
  231. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  232. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  233. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  234. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  235. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
  236. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +606 -606
  237. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  238. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
  239. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  240. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
  241. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  242. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
  243. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  244. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  245. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  246. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
  247. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  248. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  249. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  250. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  251. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +60 -60
  252. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  253. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  254. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  255. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  256. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  257. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  258. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  259. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  260. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  261. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  262. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  263. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  264. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  265. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  266. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +131 -131
  267. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  268. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  269. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  270. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  271. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  272. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  273. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  274. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  275. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  276. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  277. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  278. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  279. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  280. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  281. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  282. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  283. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  284. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  285. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  286. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  287. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  288. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  289. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  290. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  291. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  292. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  293. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  294. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  295. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  296. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  297. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  298. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  299. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
  300. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  301. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  302. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  303. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  304. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  305. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  306. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  307. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  308. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  309. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
  310. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  311. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
  312. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  313. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  314. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  315. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
  316. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  317. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
  318. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  319. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
  320. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  321. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  322. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  323. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  324. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  325. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
  326. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +332 -332
  327. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  328. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +163 -163
  329. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
  330. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  331. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  332. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  333. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  334. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  335. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  336. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
  337. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  338. package/lib/esm/imodel-components-react.d.ts +82 -82
  339. package/lib/esm/imodel-components-react.js +87 -87
  340. package/lib/esm/imodel-components-react.js.map +1 -1
  341. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  342. package/package.json +19 -19
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerDialog.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,Q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AAQ,CAAC,CAAC,CAAC;IAE7B,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,YAAY,EAAE;YAChB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;SACjE;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,6BAAK,GAAG,EAAE,eAAe;QACvB,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,IAAC,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;gBACrG,oBAAC,YAAY,OAAG;gBACf,cAAc;oBACb,oBAAC,eAAe,IAAC,kBAAkB,EAAE,cAAc,GAAI;gBACxD,YAAY;oBACX,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC5B,CACP,CACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Color\r\n */\r\n\r\n// cSpell:ignore colorpicker\r\n\r\nimport * as React from \"react\";\r\nimport { DialogButtonType } from \"@itwin/appui-abstract\";\r\nimport { Dialog } from \"@itwin/core-react\";\r\nimport { ColorDef } from \"@itwin/core-common\";\r\nimport { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\r\n\r\n/** Properties for the [[ColorPickerDialog]] React component\r\n * @beta\r\n */\r\nexport interface ColorPickerDialogProps {\r\n dialogTitle: string;\r\n color: ColorDef;\r\n onOkResult: (selectedColor: ColorDef) => void;\r\n onCancelResult: () => void;\r\n /** displayed in rows of 9 items */\r\n colorPresets?: ColorDef[];\r\n /** If set show either HSL, RGB, or HEX input values. If undefined no input value is shown */\r\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\r\n}\r\n\r\n/**\r\n * Color Picker Dialog to use as modal dialog.\r\n * @beta\r\n */\r\nexport function ColorPickerDialog({ dialogTitle, color, onOkResult, onCancelResult, colorPresets, colorInputType }: ColorPickerDialogProps) {\r\n const [activeColor, setActiveColor] = React.useState(color);\r\n const dialogContainer = React.useRef<HTMLDivElement>(null);\r\n\r\n const handleOk = React.useCallback(() => {\r\n onOkResult(activeColor);\r\n }, [onOkResult, activeColor]);\r\n const handleCancel = React.useCallback(() => {\r\n // istanbul ignore else\r\n if (onCancelResult)\r\n onCancelResult();\r\n }, [onCancelResult]);\r\n\r\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\r\n const newColorDef = ColorDef.fromTbgr(newColorValue.toTbgr());\r\n setActiveColor(newColorDef);\r\n }, []);\r\n\r\n const buttonCluster = React.useMemo(() => [\r\n { type: DialogButtonType.OK, onClick: handleOk },\r\n { type: DialogButtonType.Cancel, onClick: handleCancel },\r\n ], [handleCancel, handleOk]);\r\n\r\n const colorOptions = React.useMemo(() => {\r\n if (colorPresets) {\r\n return colorPresets.map((def) => ColorValue.fromTbgr(def.tbgr));\r\n }\r\n return undefined;\r\n }, [colorPresets]);\r\n\r\n return (\r\n <div ref={dialogContainer}>\r\n <Dialog\r\n title={dialogTitle}\r\n opened={true}\r\n resizable={false}\r\n movable={true}\r\n modal={true}\r\n buttonCluster={buttonCluster}\r\n onClose={handleCancel}\r\n onEscape={handleCancel}\r\n maxWidth={320}\r\n >\r\n <ColorPicker selectedColor={ColorValue.fromTbgr(activeColor.tbgr)} onChangeComplete={handleColorChanged} >\r\n <ColorBuilder />\r\n {colorInputType &&\r\n <ColorInputPanel defaultColorFormat={colorInputType} />}\r\n {colorOptions &&\r\n <ColorPalette colors={colorOptions} />}\r\n </ColorPicker>\r\n </Dialog>\r\n </div >\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"ColorPickerDialog.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAgB5G;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAA0B;IACxI,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE3D,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACtC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;IAC9B,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC1C,uBAAuB;QACvB,IAAI,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AAI,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;gBACrG,oBAAC,YAAY,OAAG;gBACf,cAAc;oBACb,oBAAC,eAAe,IAAC,kBAAkB,EAAE,cAAc,GAAI;gBACxD,YAAY;oBACX,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC5B,CACP,CACJ,CACR,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\n// cSpell:ignore colorpicker\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 { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\n\n/** Properties for the [[ColorPickerDialog]] React component\n * @beta\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 */\nexport function ColorPickerDialog({ dialogTitle, color, onOkResult, onCancelResult, colorPresets, colorInputType }: ColorPickerDialogProps) {\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 // istanbul ignore else\n if (onCancelResult)\n 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 { type: DialogButtonType.OK, onClick: handleOk },\n { type: DialogButtonType.Cancel, onClick: handleCancel },\n ], [handleCancel, handleOk]);\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 <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 selectedColor={ColorValue.fromTbgr(activeColor.tbgr)} onChangeComplete={handleColorChanged} >\n <ColorBuilder />\n {colorInputType &&\n <ColorInputPanel defaultColorFormat={colorInputType} />}\n {colorOptions &&\n <ColorPalette colors={colorOptions} />}\n </ColorPicker>\n </Dialog>\n </div >\n );\n}\n"]}
@@ -1,22 +1,22 @@
1
- /** @packageDocumentation
2
- * @module Color
3
- */
4
- /// <reference types="react" />
5
- import { ColorDef } from "@itwin/core-common";
6
- import "./ColorPickerPanel.scss";
7
- /** Properties for the [[ColorPickerPanel]] React component
8
- * @public @deprecated use `ColorPicker` for itwinui-react
9
- */
10
- export interface ColorPickerPanelProps {
11
- activeColor: ColorDef;
12
- onColorChange: (selectedColor: ColorDef) => void;
13
- colorPresets?: ColorDef[];
14
- /** If set show either HSL or RGB input values. If undefined no input value is shown */
15
- colorInputType?: "HSL" | "RGB";
16
- }
17
- /**
18
- * Color Picker Dialog to use as modal dialog.
19
- * @public @deprecated use `ColorPicker` for itwinui-react
20
- */
21
- export declare function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module Color
3
+ */
4
+ /// <reference types="react" />
5
+ import { ColorDef } from "@itwin/core-common";
6
+ import "./ColorPickerPanel.scss";
7
+ /** Properties for the [[ColorPickerPanel]] React component
8
+ * @public @deprecated use `ColorPicker` for itwinui-react
9
+ */
10
+ export interface ColorPickerPanelProps {
11
+ activeColor: ColorDef;
12
+ onColorChange: (selectedColor: ColorDef) => void;
13
+ colorPresets?: ColorDef[];
14
+ /** If set show either HSL or RGB input values. If undefined no input value is shown */
15
+ colorInputType?: "HSL" | "RGB";
16
+ }
17
+ /**
18
+ * Color Picker Dialog to use as modal dialog.
19
+ * @public @deprecated use `ColorPicker` for itwinui-react
20
+ */
21
+ export declare function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps): JSX.Element;
22
22
  //# sourceMappingURL=ColorPickerPanel.d.ts.map
@@ -1,123 +1,123 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Color
7
- */
8
- // cSpell:ignore colorpicker
9
- import * as React from "react";
10
- import { ColorDef } from "@itwin/core-common";
11
- import { ColorSwatch } from "./Swatch";
12
- import { HueSlider } from "./HueSlider";
13
- import { SaturationPicker } from "./SaturationPicker";
14
- import "./ColorPickerPanel.scss";
15
- import { NumberInput } from "@itwin/core-react";
16
- /**
17
- * Color Picker Dialog to use as modal dialog.
18
- * @public @deprecated use `ColorPicker` for itwinui-react
19
- */
20
- // istanbul ignore next
21
- export function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }) {
22
- const handlePresetColorPick = React.useCallback((newColor, e) => {
23
- e.preventDefault();
24
- if (onColorChange) {
25
- onColorChange(newColor);
26
- }
27
- }, [onColorChange]);
28
- const handleHueChange = React.useCallback((newHsvColor) => {
29
- // for a ColorDef to be created from hsv s can't be 0
30
- if (newHsvColor.s === 0) {
31
- newHsvColor = newHsvColor.clone(undefined, 0.5);
32
- }
33
- const newColorDef = newHsvColor.toColorDef();
34
- if (onColorChange) {
35
- onColorChange(newColorDef);
36
- }
37
- }, [onColorChange]);
38
- const handleSaturationChange = React.useCallback((newHsvColor) => {
39
- const newColorDef = newHsvColor.toColorDef();
40
- if (onColorChange) {
41
- onColorChange(newColorDef);
42
- }
43
- }, [onColorChange]);
44
- const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);
45
- const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);
46
- const color = React.useMemo(() => activeColor.colors, [activeColor]);
47
- const handleLightnessValueChange = React.useCallback((value, _stringValue) => {
48
- const newHsl = currentHsl.clone(undefined, undefined, (value !== null && value !== void 0 ? value : 0) / 100);
49
- if (onColorChange) {
50
- const newColorDef = newHsl.toColorDef();
51
- onColorChange(newColorDef);
52
- }
53
- }, [currentHsl, onColorChange]);
54
- const handleHueValueChange = React.useCallback((value, _stringValue) => {
55
- const newHsl = currentHsl.clone((value !== null && value !== void 0 ? value : 0) / 360, undefined, undefined);
56
- if (onColorChange) {
57
- const newColorDef = newHsl.toColorDef();
58
- onColorChange(newColorDef);
59
- }
60
- }, [currentHsl, onColorChange]);
61
- const handleSaturationValueChange = React.useCallback((value, _stringValue) => {
62
- const newHsl = currentHsl.clone(undefined, (value !== null && value !== void 0 ? value : 0) / 100, undefined);
63
- if (onColorChange) {
64
- const newColorDef = newHsl.toColorDef();
65
- onColorChange(newColorDef);
66
- }
67
- }, [currentHsl, onColorChange]);
68
- const handleRedChange = React.useCallback((value, _stringValue) => {
69
- if (undefined !== value) {
70
- const newColorDef = ColorDef.from(value, color.g, color.b);
71
- if (onColorChange) {
72
- onColorChange(newColorDef);
73
- }
74
- }
75
- }, [color, onColorChange]);
76
- const handleGreenChange = React.useCallback((value, _stringValue) => {
77
- if (undefined !== value) {
78
- const newColorDef = ColorDef.from(color.r, value, color.b);
79
- if (onColorChange) {
80
- onColorChange(newColorDef);
81
- }
82
- }
83
- }, [color, onColorChange]);
84
- const handleBlueChange = React.useCallback((value, _stringValue) => {
85
- if (undefined !== value) {
86
- const newColorDef = ColorDef.from(color.r, color.g, value);
87
- if (onColorChange) {
88
- onColorChange(newColorDef);
89
- }
90
- }
91
- }, [color, onColorChange]);
92
- return (React.createElement("div", { "data-testid": "components-colorpicker-panel", className: "components-colorpicker-panel" },
93
- React.createElement("div", { className: "components-colorpicker-panel-color" },
94
- React.createElement("div", { className: "components-colorpicker-saturation" },
95
- React.createElement(SaturationPicker, { hsv: currentHsv, onSaturationChange: handleSaturationChange })),
96
- React.createElement("div", { className: "components-colorpicker-hue" },
97
- React.createElement(HueSlider, { hsv: currentHsv, onHueChange: handleHueChange, isHorizontal: false }))),
98
- (colorInputType === "RGB") &&
99
- React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
100
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
101
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "R"),
102
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-red", value: color.r, onChange: handleRedChange, min: 0, max: 255 })),
103
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
104
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "G"),
105
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-green", value: color.g, onChange: handleGreenChange, min: 0, max: 255 })),
106
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
107
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "B"),
108
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-blue", value: color.b, onChange: handleBlueChange, min: 0, max: 255 }))),
109
- (colorInputType === "HSL") &&
110
- React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
111
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
112
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "H"),
113
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-hue", value: Math.round(currentHsl.h * 360), onChange: handleHueValueChange, min: 0, max: 360 })),
114
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
115
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "S"),
116
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-saturation", value: Math.round(currentHsl.s * 100), onChange: handleSaturationValueChange, min: 0, max: 100 })),
117
- React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
118
- React.createElement("span", { className: "uicore-inputs-labeled-input" }, "L"),
119
- React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-lightness", value: Math.round(currentHsl.l * 100), onChange: handleLightnessValueChange, min: 0, max: 100 }))),
120
- colorPresets && colorPresets.length &&
121
- React.createElement("div", { className: "components-colorpicker-panel-presets" }, colorPresets.map((preset, index) => React.createElement(ColorSwatch, { className: "components-colorpicker-panel-swatch", key: index, colorDef: preset, round: false, onColorPick: handlePresetColorPick })))));
122
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Color
7
+ */
8
+ // cSpell:ignore colorpicker
9
+ import * as React from "react";
10
+ import { ColorDef } from "@itwin/core-common";
11
+ import { ColorSwatch } from "./Swatch";
12
+ import { HueSlider } from "./HueSlider";
13
+ import { SaturationPicker } from "./SaturationPicker";
14
+ import "./ColorPickerPanel.scss";
15
+ import { NumberInput } from "@itwin/core-react";
16
+ /**
17
+ * Color Picker Dialog to use as modal dialog.
18
+ * @public @deprecated use `ColorPicker` for itwinui-react
19
+ */
20
+ // istanbul ignore next
21
+ export function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }) {
22
+ const handlePresetColorPick = React.useCallback((newColor, e) => {
23
+ e.preventDefault();
24
+ if (onColorChange) {
25
+ onColorChange(newColor);
26
+ }
27
+ }, [onColorChange]);
28
+ const handleHueChange = React.useCallback((newHsvColor) => {
29
+ // for a ColorDef to be created from hsv s can't be 0
30
+ if (newHsvColor.s === 0) {
31
+ newHsvColor = newHsvColor.clone(undefined, 0.5);
32
+ }
33
+ const newColorDef = newHsvColor.toColorDef();
34
+ if (onColorChange) {
35
+ onColorChange(newColorDef);
36
+ }
37
+ }, [onColorChange]);
38
+ const handleSaturationChange = React.useCallback((newHsvColor) => {
39
+ const newColorDef = newHsvColor.toColorDef();
40
+ if (onColorChange) {
41
+ onColorChange(newColorDef);
42
+ }
43
+ }, [onColorChange]);
44
+ const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);
45
+ const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);
46
+ const color = React.useMemo(() => activeColor.colors, [activeColor]);
47
+ const handleLightnessValueChange = React.useCallback((value, _stringValue) => {
48
+ const newHsl = currentHsl.clone(undefined, undefined, (value !== null && value !== void 0 ? value : 0) / 100);
49
+ if (onColorChange) {
50
+ const newColorDef = newHsl.toColorDef();
51
+ onColorChange(newColorDef);
52
+ }
53
+ }, [currentHsl, onColorChange]);
54
+ const handleHueValueChange = React.useCallback((value, _stringValue) => {
55
+ const newHsl = currentHsl.clone((value !== null && value !== void 0 ? value : 0) / 360, undefined, undefined);
56
+ if (onColorChange) {
57
+ const newColorDef = newHsl.toColorDef();
58
+ onColorChange(newColorDef);
59
+ }
60
+ }, [currentHsl, onColorChange]);
61
+ const handleSaturationValueChange = React.useCallback((value, _stringValue) => {
62
+ const newHsl = currentHsl.clone(undefined, (value !== null && value !== void 0 ? value : 0) / 100, undefined);
63
+ if (onColorChange) {
64
+ const newColorDef = newHsl.toColorDef();
65
+ onColorChange(newColorDef);
66
+ }
67
+ }, [currentHsl, onColorChange]);
68
+ const handleRedChange = React.useCallback((value, _stringValue) => {
69
+ if (undefined !== value) {
70
+ const newColorDef = ColorDef.from(value, color.g, color.b);
71
+ if (onColorChange) {
72
+ onColorChange(newColorDef);
73
+ }
74
+ }
75
+ }, [color, onColorChange]);
76
+ const handleGreenChange = React.useCallback((value, _stringValue) => {
77
+ if (undefined !== value) {
78
+ const newColorDef = ColorDef.from(color.r, value, color.b);
79
+ if (onColorChange) {
80
+ onColorChange(newColorDef);
81
+ }
82
+ }
83
+ }, [color, onColorChange]);
84
+ const handleBlueChange = React.useCallback((value, _stringValue) => {
85
+ if (undefined !== value) {
86
+ const newColorDef = ColorDef.from(color.r, color.g, value);
87
+ if (onColorChange) {
88
+ onColorChange(newColorDef);
89
+ }
90
+ }
91
+ }, [color, onColorChange]);
92
+ return (React.createElement("div", { "data-testid": "components-colorpicker-panel", className: "components-colorpicker-panel" },
93
+ React.createElement("div", { className: "components-colorpicker-panel-color" },
94
+ React.createElement("div", { className: "components-colorpicker-saturation" },
95
+ React.createElement(SaturationPicker, { hsv: currentHsv, onSaturationChange: handleSaturationChange })),
96
+ React.createElement("div", { className: "components-colorpicker-hue" },
97
+ React.createElement(HueSlider, { hsv: currentHsv, onHueChange: handleHueChange, isHorizontal: false }))),
98
+ (colorInputType === "RGB") &&
99
+ React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
100
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
101
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "R"),
102
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-red", value: color.r, onChange: handleRedChange, min: 0, max: 255 })),
103
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
104
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "G"),
105
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-green", value: color.g, onChange: handleGreenChange, min: 0, max: 255 })),
106
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
107
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "B"),
108
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-blue", value: color.b, onChange: handleBlueChange, min: 0, max: 255 }))),
109
+ (colorInputType === "HSL") &&
110
+ React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
111
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
112
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "H"),
113
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-hue", value: Math.round(currentHsl.h * 360), onChange: handleHueValueChange, min: 0, max: 360 })),
114
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
115
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "S"),
116
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-saturation", value: Math.round(currentHsl.s * 100), onChange: handleSaturationValueChange, min: 0, max: 100 })),
117
+ React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
118
+ React.createElement("span", { className: "uicore-inputs-labeled-input" }, "L"),
119
+ React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-lightness", value: Math.round(currentHsl.l * 100), onChange: handleLightnessValueChange, min: 0, max: 100 }))),
120
+ colorPresets && colorPresets.length &&
121
+ React.createElement("div", { className: "components-colorpicker-panel-presets" }, colorPresets.map((preset, index) => React.createElement(ColorSwatch, { className: "components-colorpicker-panel-swatch", key: index, colorDef: preset, round: false, onColorPick: handlePresetColorPick })))));
122
+ }
123
123
  //# sourceMappingURL=ColorPickerPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPanel.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,WA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L,CAEJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Color\r\n */\r\n\r\n// cSpell:ignore colorpicker\r\n\r\nimport * as React from \"react\";\r\nimport { ColorDef, HSVColor } from \"@itwin/core-common\";\r\nimport { ColorSwatch } from \"./Swatch\";\r\nimport { HueSlider } from \"./HueSlider\";\r\nimport { SaturationPicker } from \"./SaturationPicker\";\r\nimport \"./ColorPickerPanel.scss\";\r\nimport { NumberInput } from \"@itwin/core-react\";\r\n\r\n/** Properties for the [[ColorPickerPanel]] React component\r\n * @public @deprecated use `ColorPicker` for itwinui-react\r\n */\r\nexport interface ColorPickerPanelProps {\r\n activeColor: ColorDef;\r\n onColorChange: (selectedColor: ColorDef) => void;\r\n colorPresets?: ColorDef[];\r\n /** If set show either HSL or RGB input values. If undefined no input value is shown */\r\n colorInputType?: \"HSL\" | \"RGB\";\r\n}\r\n\r\n/**\r\n * Color Picker Dialog to use as modal dialog.\r\n * @public @deprecated use `ColorPicker` for itwinui-react\r\n */\r\n// istanbul ignore next\r\nexport function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps) { // eslint-disable-line deprecation/deprecation\r\n const handlePresetColorPick = React.useCallback((newColor: ColorDef, e: React.MouseEvent<Element, MouseEvent>) => {\r\n e.preventDefault();\r\n if (onColorChange) {\r\n onColorChange(newColor);\r\n }\r\n }, [onColorChange]);\r\n\r\n const handleHueChange = React.useCallback((newHsvColor: HSVColor) => {\r\n // for a ColorDef to be created from hsv s can't be 0\r\n if (newHsvColor.s === 0) {\r\n newHsvColor = newHsvColor.clone(undefined, 0.5);\r\n }\r\n\r\n const newColorDef = newHsvColor.toColorDef();\r\n if (onColorChange) {\r\n onColorChange(newColorDef);\r\n }\r\n }, [onColorChange]);\r\n\r\n const handleSaturationChange = React.useCallback((newHsvColor: HSVColor) => {\r\n const newColorDef = newHsvColor.toColorDef();\r\n if (onColorChange) {\r\n onColorChange(newColorDef);\r\n }\r\n }, [onColorChange]);\r\n\r\n const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);\r\n const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);\r\n const color = React.useMemo(() => activeColor.colors, [activeColor]);\r\n\r\n const handleLightnessValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n const newHsl = currentHsl.clone(undefined, undefined, (value ?? 0) / 100);\r\n\r\n if (onColorChange) {\r\n const newColorDef = newHsl.toColorDef();\r\n onColorChange(newColorDef);\r\n }\r\n }, [currentHsl, onColorChange]);\r\n\r\n const handleHueValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n const newHsl = currentHsl.clone((value ?? 0) / 360, undefined, undefined);\r\n\r\n if (onColorChange) {\r\n const newColorDef = newHsl.toColorDef();\r\n onColorChange(newColorDef);\r\n }\r\n }, [currentHsl, onColorChange]);\r\n\r\n const handleSaturationValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n const newHsl = currentHsl.clone(undefined, (value ?? 0) / 100, undefined);\r\n\r\n if (onColorChange) {\r\n const newColorDef = newHsl.toColorDef();\r\n onColorChange(newColorDef);\r\n }\r\n }, [currentHsl, onColorChange]);\r\n\r\n const handleRedChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n const newColorDef = ColorDef.from(value, color.g, color.b);\r\n if (onColorChange) {\r\n onColorChange(newColorDef);\r\n }\r\n }\r\n }, [color, onColorChange]);\r\n\r\n const handleGreenChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n const newColorDef = ColorDef.from(color.r, value, color.b);\r\n if (onColorChange) {\r\n onColorChange(newColorDef);\r\n }\r\n }\r\n }, [color, onColorChange]);\r\n\r\n const handleBlueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n const newColorDef = ColorDef.from(color.r, color.g, value);\r\n if (onColorChange) {\r\n onColorChange(newColorDef);\r\n }\r\n }\r\n }, [color, onColorChange]);\r\n\r\n return (\r\n <div data-testid=\"components-colorpicker-panel\" className=\"components-colorpicker-panel\">\r\n <div className=\"components-colorpicker-panel-color\">\r\n <div className=\"components-colorpicker-saturation\">\r\n <SaturationPicker hsv={currentHsv} onSaturationChange={handleSaturationChange} />\r\n </div>\r\n <div className=\"components-colorpicker-hue\">\r\n <HueSlider hsv={currentHsv} onHueChange={handleHueChange} isHorizontal={false} />\r\n </div>\r\n </div>\r\n {(colorInputType === \"RGB\") &&\r\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">R</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-red\" value={color.r} onChange={handleRedChange} min={0} max={255} />\r\n </div>\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">G</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-green\" value={color.g} onChange={handleGreenChange} min={0} max={255} />\r\n </div>\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">B</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-blue\" value={color.b} onChange={handleBlueChange} min={0} max={255} />\r\n </div>\r\n </div>}\r\n {(colorInputType === \"HSL\") &&\r\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">H</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-hue\" value={Math.round(currentHsl.h * 360)} onChange={handleHueValueChange} min={0} max={360} />\r\n </div>\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">S</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-saturation\" value={Math.round(currentHsl.s * 100)} onChange={handleSaturationValueChange} min={0} max={100} />\r\n </div>\r\n <div className=\"components-colorpicker-input-value-wrapper\">\r\n <span className=\"uicore-inputs-labeled-input\">L</span>\r\n <NumberInput data-testid=\"components-colorpicker-input-value-lightness\" value={Math.round(currentHsl.l * 100)} onChange={handleLightnessValueChange} min={0} max={100} />\r\n </div>\r\n </div>}\r\n\r\n {\r\n colorPresets && colorPresets.length &&\r\n <div className=\"components-colorpicker-panel-presets\">\r\n {colorPresets.map((preset, index) => <ColorSwatch className=\"components-colorpicker-panel-swatch\" key={index} colorDef={preset} round={false} onColorPick={handlePresetColorPick} />)}\r\n </div>\r\n }\r\n </div>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"ColorPickerPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPanel.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD;;;GAGG;AACH,uBAAuB;AACvB,MAAM,UAAU,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAyB;IAClH,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,CAAwC,EAAE,EAAE;QAC/G,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa,E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E,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CACzJ;gBACN,6BAAK,SAAS,EAAC,4CAA4C;oBACzD,8BAAM,SAAS,EAAC,6BAA6B,QAAS;oBACtD,oBAAC,WAAW,mBAAa,+CAA+C,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,QAAQ,EAAE,2BAA2B,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CACvK;gBACN,6BAAK,SAAS,EAAC,4CAA4C;oBACzD,8BAAM,SAAS,EAAC,6BAA6B,QAAS;oBACtD,oBAAC,WAAW,mBAAa,8CAA8C,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CACrK,CACF;QAGN,YAAY,IAAI,YAAY,CAAC,MAAM;YACnC,6BAAK,SAAS,EAAC,sCAAsC,IAClD,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAC,WAAW,IAAC,SAAS,EAAC,qCAAqC,EAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,GAAI,CAAC,CACjL,CAEJ,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\n// cSpell:ignore colorpicker\n\nimport * as React from \"react\";\nimport { ColorDef, HSVColor } from \"@itwin/core-common\";\nimport { ColorSwatch } from \"./Swatch\";\nimport { HueSlider } from \"./HueSlider\";\nimport { SaturationPicker } from \"./SaturationPicker\";\nimport \"./ColorPickerPanel.scss\";\nimport { NumberInput } from \"@itwin/core-react\";\n\n/** Properties for the [[ColorPickerPanel]] React component\n * @public @deprecated use `ColorPicker` for itwinui-react\n */\nexport interface ColorPickerPanelProps {\n activeColor: ColorDef;\n onColorChange: (selectedColor: ColorDef) => void;\n colorPresets?: ColorDef[];\n /** If set show either HSL or RGB input values. If undefined no input value is shown */\n colorInputType?: \"HSL\" | \"RGB\";\n}\n\n/**\n * Color Picker Dialog to use as modal dialog.\n * @public @deprecated use `ColorPicker` for itwinui-react\n */\n// istanbul ignore next\nexport function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps) { // eslint-disable-line deprecation/deprecation\n const handlePresetColorPick = React.useCallback((newColor: ColorDef, e: React.MouseEvent<Element, MouseEvent>) => {\n e.preventDefault();\n if (onColorChange) {\n onColorChange(newColor);\n }\n }, [onColorChange]);\n\n const handleHueChange = React.useCallback((newHsvColor: HSVColor) => {\n // for a ColorDef to be created from hsv s can't be 0\n if (newHsvColor.s === 0) {\n newHsvColor = newHsvColor.clone(undefined, 0.5);\n }\n\n const newColorDef = newHsvColor.toColorDef();\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }, [onColorChange]);\n\n const handleSaturationChange = React.useCallback((newHsvColor: HSVColor) => {\n const newColorDef = newHsvColor.toColorDef();\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }, [onColorChange]);\n\n const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);\n const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);\n const color = React.useMemo(() => activeColor.colors, [activeColor]);\n\n const handleLightnessValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone(undefined, undefined, (value ?? 0) / 100);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleHueValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone((value ?? 0) / 360, undefined, undefined);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleSaturationValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone(undefined, (value ?? 0) / 100, undefined);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleRedChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(value, color.g, color.b);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n const handleGreenChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(color.r, value, color.b);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n const handleBlueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(color.r, color.g, value);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n return (\n <div data-testid=\"components-colorpicker-panel\" className=\"components-colorpicker-panel\">\n <div className=\"components-colorpicker-panel-color\">\n <div className=\"components-colorpicker-saturation\">\n <SaturationPicker hsv={currentHsv} onSaturationChange={handleSaturationChange} />\n </div>\n <div className=\"components-colorpicker-hue\">\n <HueSlider hsv={currentHsv} onHueChange={handleHueChange} isHorizontal={false} />\n </div>\n </div>\n {(colorInputType === \"RGB\") &&\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">R</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-red\" value={color.r} onChange={handleRedChange} min={0} max={255} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">G</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-green\" value={color.g} onChange={handleGreenChange} min={0} max={255} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">B</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-blue\" value={color.b} onChange={handleBlueChange} min={0} max={255} />\n </div>\n </div>}\n {(colorInputType === \"HSL\") &&\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">H</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-hue\" value={Math.round(currentHsl.h * 360)} onChange={handleHueValueChange} min={0} max={360} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">S</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-saturation\" value={Math.round(currentHsl.s * 100)} onChange={handleSaturationValueChange} min={0} max={100} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">L</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-lightness\" value={Math.round(currentHsl.l * 100)} onChange={handleLightnessValueChange} min={0} max={100} />\n </div>\n </div>}\n\n {\n colorPresets && colorPresets.length &&\n <div className=\"components-colorpicker-panel-presets\">\n {colorPresets.map((preset, index) => <ColorSwatch className=\"components-colorpicker-panel-swatch\" key={index} colorDef={preset} round={false} onColorPick={handlePresetColorPick} />)}\n </div>\n }\n </div>\n );\n}\n"]}
@@ -1,94 +1,94 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/index";
6
-
7
- $hovered-icon-color: $buic-foreground-primary-tone;
8
- $saturation-hue-height: 150px;
9
-
10
- .components-colorpicker-panel {
11
- display: flex;
12
- flex-direction: column;
13
-
14
- .components-colorpicker-panel-color {
15
- display: flex;
16
- flex-direction: row;
17
- height: 100%;
18
- column-gap: 20px;
19
-
20
- .components-colorpicker-saturation {
21
- margin: 1em;
22
- display: block;
23
- width: calc(100% - 40px);
24
- height: $saturation-hue-height;
25
- }
26
-
27
- .components-hue-container-vertical {
28
- height: $saturation-hue-height;
29
- margin-top: 1em;
30
- margin-right: .5em;
31
- }
32
- }
33
-
34
- .components-color-swatch {
35
- width: 2.0em;
36
- height: 2.0em;
37
- }
38
- }
39
-
40
- .components-colorpicker-panel-presets {
41
- width: 100%;
42
- height: 100%;
43
- padding-top: 10px;
44
- margin-top: 10px;
45
- margin-bottom: 10px;
46
- display: grid;
47
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
48
- column-gap: 2px;
49
- row-gap: 10px;
50
- border-top: 1px solid $buic-inputs-border;
51
- justify-items: center;
52
-
53
- .components-colorpicker-panel-swatch {
54
- width: 2em;
55
- height: 2em;
56
- padding: 0;
57
- border-color: $buic-inputs-border;
58
- }
59
- }
60
-
61
- .components-colorpicker-popup-panel-padding {
62
- display: flex;
63
- flex-direction: column;
64
-
65
- button.core-dialog-close {
66
- margin-left: auto;
67
- background: transparent;
68
- border: none;
69
- color: var(--buic-foreground-body);
70
- }
71
- }
72
-
73
- .components-colorpicker-input-panel {
74
- display: flex;
75
- flex-direction: row;
76
- align-items: center;
77
- justify-content: space-evenly;
78
-
79
- .components-colorpicker-input-value-wrapper {
80
- align-items: center;
81
- display: flex;
82
- flex-direction: row;
83
- gap: 4px;
84
-
85
- .uicore-inputs-labeled-input {
86
- text-align: right;
87
- margin: 0;
88
- }
89
-
90
- .core-number-input-container {
91
- width: 54px;
92
- }
93
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/index";
6
+
7
+ $hovered-icon-color: $buic-foreground-primary-tone;
8
+ $saturation-hue-height: 150px;
9
+
10
+ .components-colorpicker-panel {
11
+ display: flex;
12
+ flex-direction: column;
13
+
14
+ .components-colorpicker-panel-color {
15
+ display: flex;
16
+ flex-direction: row;
17
+ height: 100%;
18
+ column-gap: 20px;
19
+
20
+ .components-colorpicker-saturation {
21
+ margin: 1em;
22
+ display: block;
23
+ width: calc(100% - 40px);
24
+ height: $saturation-hue-height;
25
+ }
26
+
27
+ .components-hue-container-vertical {
28
+ height: $saturation-hue-height;
29
+ margin-top: 1em;
30
+ margin-right: .5em;
31
+ }
32
+ }
33
+
34
+ .components-color-swatch {
35
+ width: 2.0em;
36
+ height: 2.0em;
37
+ }
38
+ }
39
+
40
+ .components-colorpicker-panel-presets {
41
+ width: 100%;
42
+ height: 100%;
43
+ padding-top: 10px;
44
+ margin-top: 10px;
45
+ margin-bottom: 10px;
46
+ display: grid;
47
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
48
+ column-gap: 2px;
49
+ row-gap: 10px;
50
+ border-top: 1px solid $buic-inputs-border;
51
+ justify-items: center;
52
+
53
+ .components-colorpicker-panel-swatch {
54
+ width: 2em;
55
+ height: 2em;
56
+ padding: 0;
57
+ border-color: $buic-inputs-border;
58
+ }
59
+ }
60
+
61
+ .components-colorpicker-popup-panel-padding {
62
+ display: flex;
63
+ flex-direction: column;
64
+
65
+ button.core-dialog-close {
66
+ margin-left: auto;
67
+ background: transparent;
68
+ border: none;
69
+ color: var(--buic-foreground-body);
70
+ }
71
+ }
72
+
73
+ .components-colorpicker-input-panel {
74
+ display: flex;
75
+ flex-direction: row;
76
+ align-items: center;
77
+ justify-content: space-evenly;
78
+
79
+ .components-colorpicker-input-value-wrapper {
80
+ align-items: center;
81
+ display: flex;
82
+ flex-direction: row;
83
+ gap: 4px;
84
+
85
+ .uicore-inputs-labeled-input {
86
+ text-align: right;
87
+ margin: 0;
88
+ }
89
+
90
+ .core-number-input-container {
91
+ width: 54px;
92
+ }
93
+ }
94
94
  }