@itwin/imodel-components-react 4.0.0-dev.2 → 4.0.0-dev.20

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 (226) hide show
  1. package/CHANGELOG.md +139 -2
  2. package/LICENSE.md +1 -1
  3. package/README.md +2 -2
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  5. package/lib/cjs/imodel-components-react/UiIModelComponents.js +3 -7
  6. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +6 -2
  9. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +9 -4
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  13. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +4 -4
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +5 -1
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +10 -4
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  20. package/lib/cjs/imodel-components-react/color/HueSlider.js +5 -1
  21. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +5 -1
  23. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  24. package/lib/cjs/imodel-components-react/color/Swatch.js +5 -1
  25. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/Swatch.scss +1 -2
  27. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +5 -1
  28. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +1 -1
  30. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +5 -1
  31. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  32. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +1 -1
  33. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +5 -1
  34. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
  36. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  37. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +11 -4
  38. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  40. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +5 -1
  41. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +1 -1
  43. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +6 -2
  44. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  46. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +5 -1
  47. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  48. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +4 -24
  49. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  50. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +46 -54
  51. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  53. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  54. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +16 -6
  55. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  57. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +6 -2
  58. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  59. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  60. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +7 -4
  61. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  62. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  63. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +10 -5
  64. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  65. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +6 -3
  66. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  67. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +6 -3
  68. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  69. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +10 -10
  70. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  71. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +8 -5
  72. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +5 -1
  74. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  75. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +5 -1
  76. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  77. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +5 -1
  78. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  79. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +5 -1
  80. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +5 -1
  82. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +5 -1
  84. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  85. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +5 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  87. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +5 -1
  88. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +5 -1
  90. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  91. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -3
  92. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  93. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +5 -1
  94. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  96. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +22 -23
  97. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +5 -1
  99. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  100. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +2 -2
  101. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  102. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +12 -4
  103. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +9 -12
  105. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +5 -1
  106. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +8 -15
  108. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  109. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +13 -5
  110. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  111. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  112. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +5 -1
  113. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  114. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +3 -6
  115. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  116. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +59 -19
  117. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  118. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  119. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +3 -32
  120. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  121. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +1 -1
  123. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  124. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +12 -10
  125. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  126. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +1 -1
  127. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  128. package/lib/cjs/imodel-components-react.d.ts +0 -1
  129. package/lib/cjs/imodel-components-react.d.ts.map +1 -1
  130. package/lib/cjs/imodel-components-react.js +5 -2
  131. package/lib/cjs/imodel-components-react.js.map +1 -1
  132. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  133. package/lib/esm/imodel-components-react/UiIModelComponents.js +4 -7
  134. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  135. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  136. package/lib/esm/imodel-components-react/color/AlphaSlider.js +1 -1
  137. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  138. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  139. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +5 -4
  140. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  141. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +4 -4
  142. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  143. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +6 -4
  144. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  145. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  146. package/lib/esm/imodel-components-react/color/Swatch.scss +1 -2
  147. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +1 -1
  148. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +1 -1
  149. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
  150. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  151. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +7 -4
  152. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  153. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  154. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +1 -1
  155. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +2 -1
  156. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  157. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  158. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +4 -24
  159. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  160. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +42 -52
  161. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  162. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  163. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  164. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +12 -5
  165. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  166. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  167. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  168. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  169. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  170. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +2 -3
  171. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  172. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  173. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +6 -5
  174. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  175. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +1 -2
  176. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  177. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -2
  178. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  179. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +5 -9
  180. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  181. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +3 -4
  182. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  183. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +1 -2
  184. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  185. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  186. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +22 -23
  187. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  188. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +2 -2
  189. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  190. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +7 -3
  191. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  192. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +9 -12
  193. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +8 -15
  194. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  195. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +10 -6
  196. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  197. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  198. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +3 -6
  199. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  200. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +47 -11
  201. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  202. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  203. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +3 -32
  204. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  205. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  206. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +1 -1
  207. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  208. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +7 -9
  209. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  210. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +2 -1
  211. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  212. package/lib/esm/imodel-components-react.d.ts +0 -1
  213. package/lib/esm/imodel-components-react.d.ts.map +1 -1
  214. package/lib/esm/imodel-components-react.js +0 -1
  215. package/lib/esm/imodel-components-react.js.map +1 -1
  216. package/package.json +38 -39
  217. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  218. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  219. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +0 -146
  220. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  221. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +0 -94
  222. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  223. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  224. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +0 -123
  225. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  226. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +0 -94
@@ -5,17 +5,19 @@
5
5
  /** @packageDocumentation
6
6
  * @module Timeline
7
7
  */
8
- import "./TimelineComponent.scss";
9
- import classnames from "classnames";
10
- import * as React from "react";
11
8
  import { UiAdmin } from "@itwin/appui-abstract";
12
9
  import { toDateString, toTimeString, UiComponents } from "@itwin/components-react";
10
+ import { Icon } from "@itwin/core-react";
11
+ import { SvgCaretLeft, SvgCaretRight, SvgCheckmark, SvgMoreVertical, SvgPlayCircular } from "@itwin/itwinui-icons-react";
12
+ import { DropdownMenu, MenuDivider, MenuItem } from "@itwin/itwinui-react";
13
+ import classnames from "classnames";
14
+ import * as React from "react";
13
15
  import { UiIModelComponents } from "../UiIModelComponents";
14
16
  import { InlineEdit } from "./InlineEdit";
15
17
  import { TimelinePausePlayAction } from "./interfaces";
16
18
  import { PlayButton, PlayerButton } from "./PlayerButton";
17
19
  import { Scrubber } from "./Scrubber";
18
- import { DropdownMenu, MenuDivider, MenuItem } from "@itwin/itwinui-react";
20
+ import "./TimelineComponent.scss";
19
21
  // cspell:ignore millisec
20
22
  const slowSpeed = 60 * 1000;
21
23
  const mediumSpeed = 20 * 1000;
@@ -212,7 +214,9 @@ export class TimelineComponent extends React.Component {
212
214
  let keyIndex = 0;
213
215
  if (this.state.includeRepeat) {
214
216
  const checked = this.state.repeat;
215
- const icon = checked ? React.createElement("span", { className: "icon icon-checkmark" }) : React.createElement("span", null);
217
+ const icon = checked ? React.createElement("span", { className: "icon" },
218
+ React.createElement(Icon, { iconSpec: React.createElement(SvgCheckmark, null) }),
219
+ " ") : React.createElement("span", null);
216
220
  itemNodes.push(React.createElement(MenuItem, { key: ++keyIndex, onClick: () => { this._onRepeatChanged(); close(); }, icon: icon }, this._repeatLabel));
217
221
  itemNodes.push(React.createElement(MenuDivider, { key: ++keyIndex }));
218
222
  }
@@ -221,8 +225,38 @@ export class TimelineComponent extends React.Component {
221
225
  });
222
226
  return itemNodes;
223
227
  };
224
- return (React.createElement(DropdownMenu, { menuItems: createMenuItemNodes },
225
- React.createElement("span", { "data-testid": "timeline-settings", className: "timeline-settings icon icon-more-vertical-2", role: "button", tabIndex: -1, title: UiComponents.translate("button.label.settings") })));
228
+ return (React.createElement(DropdownMenu, { menuItems: createMenuItemNodes, placement: "top-start", popperOptions: {
229
+ modifiers: [
230
+ {
231
+ name: "hide", // When the timeline is no longer visible, hide the popper.
232
+ },
233
+ {
234
+ name: "preventOverflow",
235
+ options: {
236
+ altAxis: true, // Allow the popper to go below the reference element and use as much space as needed.
237
+ },
238
+ },
239
+ {
240
+ name: "computeStyles",
241
+ options: {
242
+ roundOffsets: ({ x, y }) => ({
243
+ x,
244
+ y: Math.max(y, 0), // Ensure that the top of the popper will not go over the top of the document.
245
+ }),
246
+ },
247
+ },
248
+ {
249
+ name: "setPopperClass",
250
+ enabled: true,
251
+ phase: "beforeWrite",
252
+ fn({ state }) {
253
+ state.attributes.popper.class = "timeline-component-max-sized-scrolling-menu";
254
+ },
255
+ },
256
+ ]
257
+ } },
258
+ React.createElement("span", { "data-testid": "timeline-settings", className: "timeline-settings icon", role: "button", tabIndex: -1, title: UiComponents.translate("button.label.settings") },
259
+ React.createElement(Icon, { iconSpec: React.createElement(SvgMoreVertical, null) }))));
226
260
  };
227
261
  this.state = {
228
262
  isPlaying: false,
@@ -299,7 +333,9 @@ export class TimelineComponent extends React.Component {
299
333
  _createMenuItemNode(item, index, currentTimelineDuration, close) {
300
334
  const label = item.label;
301
335
  const checked = currentTimelineDuration === item.timelineDuration;
302
- const icon = checked ? React.createElement("span", { className: "icon icon-checkmark" }) : React.createElement("span", null);
336
+ const icon = checked ? React.createElement("span", { className: "icon" },
337
+ React.createElement(Icon, { iconSpec: React.createElement(SvgCheckmark, null) }),
338
+ " ") : React.createElement("span", null);
303
339
  return (React.createElement(MenuItem, { key: index, icon: icon, onClick: () => { this._onSetTotalDuration(item.timelineDuration); close(); } }, label));
304
340
  }
305
341
  render() {
@@ -312,9 +348,9 @@ export class TimelineComponent extends React.Component {
312
348
  return (React.createElement("div", { "data-testid": "timeline-component", className: classnames("timeline-component", !!minimized && "minimized", hasDates && "has-dates") },
313
349
  React.createElement("div", { className: "header" },
314
350
  React.createElement(PlayButton, { className: "play-button", isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, "data-testid": "timeline-play" }),
315
- React.createElement(PlayerButton, { className: "play-backward", icon: "icon-caret-left", onClick: this._onBackward, title: UiIModelComponents.translate("timeline.backward") }),
316
- React.createElement(PlayerButton, { className: "play-button-step", icon: "icon-media-controls-circular-play", isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, title: UiIModelComponents.translate("timeline.step") }),
317
- React.createElement(PlayerButton, { className: "play-forward", icon: "icon-caret-right", onClick: this._onForward, title: UiIModelComponents.translate("timeline.backward") }),
351
+ React.createElement(PlayerButton, { className: "play-backward", icon: React.createElement(SvgCaretLeft, null), onClick: this._onBackward, title: UiIModelComponents.translate("timeline.backward") }),
352
+ React.createElement(PlayerButton, { className: "play-button-step", icon: React.createElement(SvgPlayCircular, null), isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, title: UiIModelComponents.translate("timeline.step") }),
353
+ React.createElement(PlayerButton, { className: "play-forward", icon: React.createElement(SvgCaretRight, null), onClick: this._onForward, title: UiIModelComponents.translate("timeline.backward") }),
318
354
  React.createElement("span", { className: "current-date" }, toDateString(currentDate, timeZoneOffset, dateFormatOptions))),
319
355
  React.createElement("div", { className: "scrubber" },
320
356
  React.createElement(PlayButton, { className: "play-button", isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause }),
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/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AI,6CAAkB,iBAAiB,EAAC,SAAS,EAAC,YAAY,IAAE,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBAC3J,YAAY,IAAI,8BAAM,SAAS,EAAC,qBAAqB,IAAE,cAAc,CAAQ,CAC1E;gBACN,oBAAC,QAAQ,IACP,SAAS,EAAC,QAAQ,EAClB,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,UAAU,EAAE,CAAC,CAAC,SAAS,EACvB,QAAQ,EAAE,CAAC,YAAY,EACvB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC7B;gBACF,6BAAK,SAAS,EAAC,oBAAoB;oBAChC,QAAQ,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAQ;oBACrF,QAAQ,IAAI,CAAC,YAAY,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBACzH,YAAY,IAAI,oBAAC,UAAU,IAAC,SAAS,EAAC,mBAAmB,EAAC,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,CAAC,sBAAsB,GAAI,CACnI;gBACL,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAChC,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 Timeline\n */\n\nimport \"./TimelineComponent.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { GenericUiEventArgs, UiAdmin } from \"@itwin/appui-abstract\";\nimport { DateFormatOptions, toDateString, toTimeString, UiComponents } from \"@itwin/components-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport { PlaybackSettings, TimelinePausePlayAction, TimelinePausePlayArgs } from \"./interfaces\";\nimport { PlayButton, PlayerButton } from \"./PlayerButton\";\nimport { Scrubber } from \"./Scrubber\";\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\n\n// cspell:ignore millisec\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n/**\n * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n/**\n * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n/**\n * [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds. */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.) */\n minimized?: boolean;\n /** When playing, repeat indefinitely */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true) */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append, replace)*/\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n}\n/** @internal */\ninterface TimelineComponentState {\n /** True if timeline is currently playing, false if paused */\n isPlaying: boolean;\n /** Minimized mode (For future use. This will always be true) */\n minimized?: boolean;\n /** Current duration in milliseconds */\n currentDuration: number;\n /** Total duration in milliseconds */\n totalDuration: number;\n /** If true, automatically restart when the timeline is finished playing */\n repeat: boolean;\n /** If true, include the repeat option in the timeline context menu */\n includeRepeat: boolean;\n}\n\n/**\n * [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport class TimelineComponent extends React.Component<TimelineComponentProps, TimelineComponentState> {\n private _timeLastCycle = 0;\n private _requestFrame = 0;\n private _unmounted = false;\n private _repeatLabel: string;\n private _removeListener?: () => void;\n private _standardTimelineMenuItems: TimelineMenuItemProps[] = [\n { label: UiIModelComponents.translate(\"timeline.slow\"), timelineDuration: slowSpeed },\n { label: UiIModelComponents.translate(\"timeline.medium\"), timelineDuration: mediumSpeed },\n { label: UiIModelComponents.translate(\"timeline.fast\"), timelineDuration: fastSpeed },\n ];\n\n constructor(props: TimelineComponentProps) {\n super(props);\n\n this.state = {\n isPlaying: false,\n minimized: true,\n currentDuration: props.initialDuration ? props.initialDuration : /* istanbul ignore next */ 0,\n totalDuration: this.props.totalDuration,\n repeat: this.props.repeat ? true : false,\n includeRepeat: this.props.includeRepeat || this.props.includeRepeat === undefined ? true : false,\n };\n\n this._repeatLabel = UiIModelComponents.translate(\"timeline.repeat\");\n // istanbul ignore else\n if (this.props.componentId) { // can't handle an event if we have no id\n this._removeListener = UiAdmin.onGenericUiEvent.addListener(this._handleTimelinePausePlayEvent);\n }\n }\n\n public override componentWillUnmount() {\n if (this._removeListener)\n this._removeListener();\n window.cancelAnimationFrame(this._requestFrame);\n this._unmounted = true;\n }\n\n public override shouldComponentUpdate(nextProps: TimelineComponentProps, nextState: TimelineComponentState) {\n let result = false;\n\n // istanbul ignore next\n if (nextState !== this.state || nextProps !== this.props ||\n nextProps.startDate !== this.props.startDate ||\n nextProps.endDate !== this.props.endDate ||\n nextProps.initialDuration !== this.props.initialDuration ||\n nextProps.repeat !== this.props.repeat\n )\n result = true;\n\n return result;\n }\n\n public override componentDidUpdate(prevProps: TimelineComponentProps) {\n // istanbul ignore else\n if (this.props.initialDuration !== prevProps.initialDuration) {\n this._setDuration(this.props.initialDuration ? this.props.initialDuration : /* istanbul ignore next */ 0);\n }\n\n // istanbul ignore else\n if (this.props.repeat !== prevProps.repeat) {\n this._changeRepeatSetting(this.props.repeat);\n }\n\n // istanbul ignore else\n if (this.props.totalDuration !== prevProps.totalDuration) {\n this._onSetTotalDuration(this.props.totalDuration);\n }\n }\n private _handleTimelinePausePlayEvent = (args: GenericUiEventArgs): void => {\n const timelineArgs = args as TimelinePausePlayArgs;\n // istanbul ignore else\n if (!timelineArgs || this.props.componentId !== timelineArgs.uiComponentId || timelineArgs.timelineAction === undefined)\n return;\n\n let startPlaying: boolean;\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n startPlaying = true;\n break;\n case TimelinePausePlayAction.Pause:\n startPlaying = false;\n break;\n case TimelinePausePlayAction.Toggle:\n startPlaying = !this.state.isPlaying;\n break;\n // istanbul ignore next\n default:\n return; // throw error?\n }\n if (startPlaying)\n this._onPlay();\n else\n this._onPause();\n };\n\n // user clicked backward button\n private _onBackward = () => {\n // istanbul ignore else\n if (this.props.onJump)\n this.props.onJump(false);\n };\n\n // user clicked forward button\n private _onForward = () => {\n // istanbul ignore else\n if (this.props.onJump)\n this.props.onJump(true);\n };\n\n // user clicked play button\n private _onPlay = () => {\n // istanbul ignore if\n if (this.state.isPlaying)\n return;\n\n // timeline was complete, restart from the beginning\n if (this.state.currentDuration >= this.state.totalDuration) {\n this._replay();\n } else\n this._play();\n\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(true);\n };\n\n // user clicked pause button\n private _onPause = () => {\n // istanbul ignore if\n if (!this.state.isPlaying)\n return;\n\n // stop requesting frames\n window.cancelAnimationFrame(this._requestFrame);\n\n // stop playing\n this.setState({ isPlaying: false });\n\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(false);\n };\n\n // user clicked on timeline rail or dragged scrubber handle\n private _onTimelineChange = (values: ReadonlyArray<number>) => {\n const currentDuration = values[0];\n this._setDuration(currentDuration);\n };\n\n // set the current duration, which will call the OnChange callback\n private _setDuration = (currentDuration: number) => {\n const actualDuration = Math.min(this.state.totalDuration, (Math.max(currentDuration, 0)));\n\n this._timeLastCycle = new Date().getTime();\n // istanbul ignore else\n if (!this._unmounted)\n this.setState({ currentDuration: actualDuration });\n // istanbul ignore else\n if (this.props.onChange) {\n const fraction = actualDuration / this.state.totalDuration;\n this.props.onChange(fraction);\n }\n };\n\n // recursively update the animation until we hit the end or the pause button is clicked\n private _updateAnimation = (_timestamp: number) => {\n // istanbul ignore else\n if (!this.state.isPlaying && !this._unmounted) {\n return;\n }\n\n // update duration\n const currentTime = new Date().getTime();\n const millisecondsElapsed = currentTime - this._timeLastCycle;\n const duration = this.state.currentDuration + millisecondsElapsed;\n this._setDuration(duration);\n\n // stop the animation!\n if (duration >= this.state.totalDuration) {\n window.cancelAnimationFrame(this._requestFrame);\n this.setState({ isPlaying: false });\n if (this.state.repeat)\n this._replay();\n else {\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(false);\n }\n\n return;\n }\n\n // continue the animation - request the next frame\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n };\n\n private _play() {\n // start playing\n this.setState({ isPlaying: true }, () => {\n // request the next frame\n this._timeLastCycle = new Date().getTime();\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n });\n }\n\n private _replay = () => {\n // timeline was complete, restart from the beginning\n this.setState({ currentDuration: 0 }, (() => this._play()));\n };\n\n private _displayTime(millisec: number) {\n const addZero = (i: number) => {\n return (i < 10) ? `0${i}` : i;\n };\n\n const date = new Date(millisec);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n }\n\n private _getMilliseconds(time: string) {\n // istanbul ignore else - WIP\n if (time.indexOf(\":\") !== -1) {\n return (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000;\n } else {\n return Number(time) * 1000;\n }\n }\n\n // user changed the total duration\n private _onTotalDurationChange = (value: string) => {\n // NOTE: we should reset the current duration to 0\n const milliseconds = this._getMilliseconds(value);\n this._onSetTotalDuration(milliseconds);\n };\n\n private _changeRepeatSetting = (newValue?: boolean) => {\n // istanbul ignore else\n if (newValue !== undefined) {\n this.setState(\n () => ({ repeat: newValue }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n });\n }\n };\n\n private _onRepeatChanged = () => {\n this.setState(\n (prevState) => ({ repeat: !prevState.repeat }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n });\n };\n\n private _currentDate = (): Date => {\n const fraction = this.state.currentDuration / this.state.totalDuration;\n if (this.props.endDate && this.props.startDate) {\n const timeElapsed = (this.props.endDate.getTime() - this.props.startDate.getTime()) * fraction;\n return new Date(this.props.startDate.getTime() + timeElapsed);\n }\n return new Date();\n };\n\n private _onSetTotalDuration = (milliseconds: number) => {\n this.setState(\n { totalDuration: milliseconds },\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ duration: milliseconds });\n }\n });\n };\n\n private _createMenuItemNode(item: TimelineMenuItemProps, index: number, currentTimelineDuration: number, close: () => void): JSX.Element {\n const label = item.label;\n const checked = currentTimelineDuration === item.timelineDuration;\n const icon = checked ? <span className=\"icon icon-checkmark\" /> : <span />;\n return (\n <MenuItem key={index} icon={icon}\n onClick={() => { this._onSetTotalDuration(item.timelineDuration); close(); }} >\n {label}\n </MenuItem>\n );\n }\n\n private _renderSettings = () => {\n const createMenuItemNodes = (close: () => void): JSX.Element[] => {\n\n const { totalDuration } = this.state;\n let contextMenuItems: Array<TimelineMenuItemProps> = [];\n\n if (!this.props.appMenuItems) {\n contextMenuItems = this._standardTimelineMenuItems;\n } else {\n if (this.props.appMenuItemOption === \"append\") {\n contextMenuItems = this._standardTimelineMenuItems.concat(this.props.appMenuItems);\n } else if (this.props.appMenuItemOption === \"prefix\") {\n contextMenuItems = this.props.appMenuItems.concat(this._standardTimelineMenuItems);\n } else {\n contextMenuItems = this.props.appMenuItems;\n }\n }\n\n const itemNodes: JSX.Element[] = [];\n let keyIndex = 0;\n if (this.state.includeRepeat) {\n const checked = this.state.repeat;\n const icon = checked ? <span className=\"icon icon-checkmark\" /> : <span />;\n itemNodes.push(<MenuItem key={++keyIndex} onClick={() => { this._onRepeatChanged(); close(); }} icon={icon}>\n {this._repeatLabel}\n </MenuItem>);\n itemNodes.push(<MenuDivider key={++keyIndex} />);\n }\n\n contextMenuItems.forEach((item: TimelineMenuItemProps, index: number) => {\n itemNodes.push(this._createMenuItemNode(item, index + keyIndex + 1, totalDuration, close));\n });\n\n return itemNodes;\n };\n\n return (\n <DropdownMenu menuItems={createMenuItemNodes}>\n <span data-testid=\"timeline-settings\" className=\"timeline-settings icon icon-more-vertical-2\"\n role=\"button\" tabIndex={-1} title={UiComponents.translate(\"button.label.settings\")}\n ></span>\n </DropdownMenu>\n );\n };\n\n public override render() {\n const { startDate, endDate, showDuration, timeZoneOffset, dateFormatOptions, timeFormatOptions } = this.props;\n const { currentDuration, totalDuration, minimized } = this.state;\n const currentDate = this._currentDate();\n const durationString = this._displayTime(currentDuration);\n const totalDurationString = this._displayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n\n return (\n <div data-testid=\"timeline-component\" className={classnames(\"timeline-component\", !!minimized && \"minimized\", hasDates && \"has-dates\")} >\n <div className=\"header\">\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} data-testid=\"timeline-play\" />\n <PlayerButton className=\"play-backward\" icon=\"icon-caret-left\" onClick={this._onBackward}\n title={UiIModelComponents.translate(\"timeline.backward\")} />\n <PlayerButton className=\"play-button-step\" icon=\"icon-media-controls-circular-play\"\n isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause}\n title={UiIModelComponents.translate(\"timeline.step\")} />\n <PlayerButton className=\"play-forward\" icon=\"icon-caret-right\" onClick={this._onForward}\n title={UiIModelComponents.translate(\"timeline.backward\")} />\n <span className=\"current-date\">{toDateString(currentDate, timeZoneOffset, dateFormatOptions)}</span>\n </div>\n <div className=\"scrubber\">\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} />\n <div className=\"start-time-container\">\n {hasDates && <span data-testid=\"test-start-date\" className=\"start-date\">{toDateString(startDate, timeZoneOffset, dateFormatOptions)}</span>}\n {hasDates && !showDuration && <span data-testid=\"test-start-time\" className=\"start-time\">{toTimeString(startDate, timeZoneOffset, timeFormatOptions)}</span>}\n {showDuration && <span className=\"duration-start-time\">{durationString}</span>}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={this.state.currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={this.state.isPlaying}\n inMiniMode={!!minimized}\n showTime={!showDuration}\n onChange={this._onTimelineChange}\n onUpdate={this._onTimelineChange}\n timeZoneOffset={this.props.timeZoneOffset}\n markDate={this.props.markDate}\n />\n <div className=\"end-time-container\">\n {hasDates && <span className=\"end-date\">{toDateString(endDate, timeZoneOffset)}</span>}\n {hasDates && !showDuration && <span className=\"end-time\">{toTimeString(endDate, timeZoneOffset, timeFormatOptions)}</span>}\n {showDuration && <InlineEdit className=\"duration-end-time\" defaultValue={totalDurationString} onChange={this._onTotalDurationChange} />}\n </div>\n {minimized && this._renderSettings()}\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAsB,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,WA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CAAC,KAAK,CAAC,SAAS,EAC/B,UAAU,EAAE,CAAC,CAAC,SAAS,EACvB,QAAQ,EAAE,CAAC,YAAY,EACvB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC7B;gBACF,6BAAK,SAAS,EAAC,oBAAoB;oBAChC,QAAQ,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAQ;oBACrF,QAAQ,IAAI,CAAC,YAAY,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBACzH,YAAY,IAAI,oBAAC,UAAU,IAAC,SAAS,EAAC,mBAAmB,EAAC,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,CAAC,sBAAsB,GAAI,CACnI;gBACL,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAChC,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 Timeline\n */\nimport { GenericUiEventArgs, UiAdmin } from \"@itwin/appui-abstract\";\nimport { DateFormatOptions, toDateString, toTimeString, UiComponents } from \"@itwin/components-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { SvgCaretLeft, SvgCaretRight, SvgCheckmark, SvgMoreVertical, SvgPlayCircular } from \"@itwin/itwinui-icons-react\";\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\n\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport { PlaybackSettings, TimelinePausePlayAction, TimelinePausePlayArgs } from \"./interfaces\";\nimport { PlayButton, PlayerButton } from \"./PlayerButton\";\nimport { Scrubber } from \"./Scrubber\";\n\nimport \"./TimelineComponent.scss\";\n\n// cspell:ignore millisec\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n/**\n * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n/**\n * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n/**\n * [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds. */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.) */\n minimized?: boolean;\n /** When playing, repeat indefinitely */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true) */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append, replace)*/\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n}\n/** @internal */\ninterface TimelineComponentState {\n /** True if timeline is currently playing, false if paused */\n isPlaying: boolean;\n /** Minimized mode (For future use. This will always be true) */\n minimized?: boolean;\n /** Current duration in milliseconds */\n currentDuration: number;\n /** Total duration in milliseconds */\n totalDuration: number;\n /** If true, automatically restart when the timeline is finished playing */\n repeat: boolean;\n /** If true, include the repeat option in the timeline context menu */\n includeRepeat: boolean;\n}\n\n/**\n * [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport class TimelineComponent extends React.Component<TimelineComponentProps, TimelineComponentState> {\n private _timeLastCycle = 0;\n private _requestFrame = 0;\n private _unmounted = false;\n private _repeatLabel: string;\n private _removeListener?: () => void;\n private _standardTimelineMenuItems: TimelineMenuItemProps[] = [\n { label: UiIModelComponents.translate(\"timeline.slow\"), timelineDuration: slowSpeed },\n { label: UiIModelComponents.translate(\"timeline.medium\"), timelineDuration: mediumSpeed },\n { label: UiIModelComponents.translate(\"timeline.fast\"), timelineDuration: fastSpeed },\n ];\n\n constructor(props: TimelineComponentProps) {\n super(props);\n\n this.state = {\n isPlaying: false,\n minimized: true,\n currentDuration: props.initialDuration ? props.initialDuration : /* istanbul ignore next */ 0,\n totalDuration: this.props.totalDuration,\n repeat: this.props.repeat ? true : false,\n includeRepeat: this.props.includeRepeat || this.props.includeRepeat === undefined ? true : false,\n };\n\n this._repeatLabel = UiIModelComponents.translate(\"timeline.repeat\");\n // istanbul ignore else\n if (this.props.componentId) { // can't handle an event if we have no id\n this._removeListener = UiAdmin.onGenericUiEvent.addListener(this._handleTimelinePausePlayEvent);\n }\n }\n\n public override componentWillUnmount() {\n if (this._removeListener)\n this._removeListener();\n window.cancelAnimationFrame(this._requestFrame);\n this._unmounted = true;\n }\n\n public override shouldComponentUpdate(nextProps: TimelineComponentProps, nextState: TimelineComponentState) {\n let result = false;\n\n // istanbul ignore next\n if (nextState !== this.state || nextProps !== this.props ||\n nextProps.startDate !== this.props.startDate ||\n nextProps.endDate !== this.props.endDate ||\n nextProps.initialDuration !== this.props.initialDuration ||\n nextProps.repeat !== this.props.repeat\n )\n result = true;\n\n return result;\n }\n\n public override componentDidUpdate(prevProps: TimelineComponentProps) {\n // istanbul ignore else\n if (this.props.initialDuration !== prevProps.initialDuration) {\n this._setDuration(this.props.initialDuration ? this.props.initialDuration : /* istanbul ignore next */ 0);\n }\n\n // istanbul ignore else\n if (this.props.repeat !== prevProps.repeat) {\n this._changeRepeatSetting(this.props.repeat);\n }\n\n // istanbul ignore else\n if (this.props.totalDuration !== prevProps.totalDuration) {\n this._onSetTotalDuration(this.props.totalDuration);\n }\n }\n private _handleTimelinePausePlayEvent = (args: GenericUiEventArgs): void => {\n const timelineArgs = args as TimelinePausePlayArgs;\n // istanbul ignore else\n if (!timelineArgs || this.props.componentId !== timelineArgs.uiComponentId || timelineArgs.timelineAction === undefined)\n return;\n\n let startPlaying: boolean;\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n startPlaying = true;\n break;\n case TimelinePausePlayAction.Pause:\n startPlaying = false;\n break;\n case TimelinePausePlayAction.Toggle:\n startPlaying = !this.state.isPlaying;\n break;\n // istanbul ignore next\n default:\n return; // throw error?\n }\n if (startPlaying)\n this._onPlay();\n else\n this._onPause();\n };\n\n // user clicked backward button\n private _onBackward = () => {\n // istanbul ignore else\n if (this.props.onJump)\n this.props.onJump(false);\n };\n\n // user clicked forward button\n private _onForward = () => {\n // istanbul ignore else\n if (this.props.onJump)\n this.props.onJump(true);\n };\n\n // user clicked play button\n private _onPlay = () => {\n // istanbul ignore if\n if (this.state.isPlaying)\n return;\n\n // timeline was complete, restart from the beginning\n if (this.state.currentDuration >= this.state.totalDuration) {\n this._replay();\n } else\n this._play();\n\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(true);\n };\n\n // user clicked pause button\n private _onPause = () => {\n // istanbul ignore if\n if (!this.state.isPlaying)\n return;\n\n // stop requesting frames\n window.cancelAnimationFrame(this._requestFrame);\n\n // stop playing\n this.setState({ isPlaying: false });\n\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(false);\n };\n\n // user clicked on timeline rail or dragged scrubber handle\n private _onTimelineChange = (values: ReadonlyArray<number>) => {\n const currentDuration = values[0];\n this._setDuration(currentDuration);\n };\n\n // set the current duration, which will call the OnChange callback\n private _setDuration = (currentDuration: number) => {\n const actualDuration = Math.min(this.state.totalDuration, (Math.max(currentDuration, 0)));\n\n this._timeLastCycle = new Date().getTime();\n // istanbul ignore else\n if (!this._unmounted)\n this.setState({ currentDuration: actualDuration });\n // istanbul ignore else\n if (this.props.onChange) {\n const fraction = actualDuration / this.state.totalDuration;\n this.props.onChange(fraction);\n }\n };\n\n // recursively update the animation until we hit the end or the pause button is clicked\n private _updateAnimation = (_timestamp: number) => {\n // istanbul ignore else\n if (!this.state.isPlaying && !this._unmounted) {\n return;\n }\n\n // update duration\n const currentTime = new Date().getTime();\n const millisecondsElapsed = currentTime - this._timeLastCycle;\n const duration = this.state.currentDuration + millisecondsElapsed;\n this._setDuration(duration);\n\n // stop the animation!\n if (duration >= this.state.totalDuration) {\n window.cancelAnimationFrame(this._requestFrame);\n this.setState({ isPlaying: false });\n if (this.state.repeat)\n this._replay();\n else {\n // istanbul ignore else\n if (this.props.onPlayPause)\n this.props.onPlayPause(false);\n }\n\n return;\n }\n\n // continue the animation - request the next frame\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n };\n\n private _play() {\n // start playing\n this.setState({ isPlaying: true }, () => {\n // request the next frame\n this._timeLastCycle = new Date().getTime();\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n });\n }\n\n private _replay = () => {\n // timeline was complete, restart from the beginning\n this.setState({ currentDuration: 0 }, (() => this._play()));\n };\n\n private _displayTime(millisec: number) {\n const addZero = (i: number) => {\n return (i < 10) ? `0${i}` : i;\n };\n\n const date = new Date(millisec);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n }\n\n private _getMilliseconds(time: string) {\n // istanbul ignore else - WIP\n if (time.indexOf(\":\") !== -1) {\n return (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000;\n } else {\n return Number(time) * 1000;\n }\n }\n\n // user changed the total duration\n private _onTotalDurationChange = (value: string) => {\n // NOTE: we should reset the current duration to 0\n const milliseconds = this._getMilliseconds(value);\n this._onSetTotalDuration(milliseconds);\n };\n\n private _changeRepeatSetting = (newValue?: boolean) => {\n // istanbul ignore else\n if (newValue !== undefined) {\n this.setState(\n () => ({ repeat: newValue }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n });\n }\n };\n\n private _onRepeatChanged = () => {\n this.setState(\n (prevState) => ({ repeat: !prevState.repeat }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n });\n };\n\n private _currentDate = (): Date => {\n const fraction = this.state.currentDuration / this.state.totalDuration;\n if (this.props.endDate && this.props.startDate) {\n const timeElapsed = (this.props.endDate.getTime() - this.props.startDate.getTime()) * fraction;\n return new Date(this.props.startDate.getTime() + timeElapsed);\n }\n return new Date();\n };\n\n private _onSetTotalDuration = (milliseconds: number) => {\n this.setState(\n { totalDuration: milliseconds },\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ duration: milliseconds });\n }\n });\n };\n\n private _createMenuItemNode(item: TimelineMenuItemProps, index: number, currentTimelineDuration: number, close: () => void): JSX.Element {\n const label = item.label;\n const checked = currentTimelineDuration === item.timelineDuration;\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\n return (\n <MenuItem key={index} icon={icon}\n onClick={() => { this._onSetTotalDuration(item.timelineDuration); close(); }} >\n {label}\n </MenuItem>\n );\n }\n\n private _renderSettings = () => {\n const createMenuItemNodes = (close: () => void): JSX.Element[] => {\n\n const { totalDuration } = this.state;\n let contextMenuItems: Array<TimelineMenuItemProps> = [];\n\n if (!this.props.appMenuItems) {\n contextMenuItems = this._standardTimelineMenuItems;\n } else {\n if (this.props.appMenuItemOption === \"append\") {\n contextMenuItems = this._standardTimelineMenuItems.concat(this.props.appMenuItems);\n } else if (this.props.appMenuItemOption === \"prefix\") {\n contextMenuItems = this.props.appMenuItems.concat(this._standardTimelineMenuItems);\n } else {\n contextMenuItems = this.props.appMenuItems;\n }\n }\n\n const itemNodes: JSX.Element[] = [];\n let keyIndex = 0;\n if (this.state.includeRepeat) {\n const checked = this.state.repeat;\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\n itemNodes.push(<MenuItem key={++keyIndex} onClick={() => { this._onRepeatChanged(); close(); }} icon={icon}>\n {this._repeatLabel}\n </MenuItem>);\n itemNodes.push(<MenuDivider key={++keyIndex} />);\n }\n\n contextMenuItems.forEach((item: TimelineMenuItemProps, index: number) => {\n itemNodes.push(this._createMenuItemNode(item, index + keyIndex + 1, totalDuration, close));\n });\n\n return itemNodes;\n };\n\n return (\n <DropdownMenu menuItems={createMenuItemNodes} placement=\"top-start\" popperOptions={{\n modifiers: [\n {\n name: \"hide\", // When the timeline is no longer visible, hide the popper.\n },\n {\n name: \"preventOverflow\",\n options: {\n altAxis: true, // Allow the popper to go below the reference element and use as much space as needed.\n },\n },\n {\n name: \"computeStyles\",\n options: {\n roundOffsets: ({ x, y }: { x: number, y: number }) => ({\n x,\n y: Math.max(y, 0), // Ensure that the top of the popper will not go over the top of the document.\n }),\n },\n },\n {\n name: \"setPopperClass\", // Ensure we target only THIS popper with a class\n enabled: true,\n phase: \"beforeWrite\",\n fn({ state }) {\n state.attributes.popper.class = \"timeline-component-max-sized-scrolling-menu\";\n },\n },\n ]}}>\n <span data-testid=\"timeline-settings\" className=\"timeline-settings icon\"\n role=\"button\" tabIndex={-1} title={UiComponents.translate(\"button.label.settings\")}\n ><Icon iconSpec={<SvgMoreVertical />} /></span>\n </DropdownMenu>\n );\n };\n\n public override render() {\n const { startDate, endDate, showDuration, timeZoneOffset, dateFormatOptions, timeFormatOptions } = this.props;\n const { currentDuration, totalDuration, minimized } = this.state;\n const currentDate = this._currentDate();\n const durationString = this._displayTime(currentDuration);\n const totalDurationString = this._displayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n\n return (\n <div data-testid=\"timeline-component\" className={classnames(\"timeline-component\", !!minimized && \"minimized\", hasDates && \"has-dates\")} >\n <div className=\"header\">\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} data-testid=\"timeline-play\" />\n <PlayerButton className=\"play-backward\" icon={<SvgCaretLeft />} onClick={this._onBackward}\n title={UiIModelComponents.translate(\"timeline.backward\")} />\n <PlayerButton className=\"play-button-step\" icon={<SvgPlayCircular />}\n isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause}\n title={UiIModelComponents.translate(\"timeline.step\")} />\n <PlayerButton className=\"play-forward\" icon={<SvgCaretRight />} onClick={this._onForward}\n title={UiIModelComponents.translate(\"timeline.backward\")} />\n <span className=\"current-date\">{toDateString(currentDate, timeZoneOffset, dateFormatOptions)}</span>\n </div>\n <div className=\"scrubber\">\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} />\n <div className=\"start-time-container\">\n {hasDates && <span data-testid=\"test-start-date\" className=\"start-date\">{toDateString(startDate, timeZoneOffset, dateFormatOptions)}</span>}\n {hasDates && !showDuration && <span data-testid=\"test-start-time\" className=\"start-time\">{toTimeString(startDate, timeZoneOffset, timeFormatOptions)}</span>}\n {showDuration && <span className=\"duration-start-time\">{durationString}</span>}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={this.state.currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={this.state.isPlaying}\n inMiniMode={!!minimized}\n showTime={!showDuration}\n onChange={this._onTimelineChange}\n onUpdate={this._onTimelineChange}\n timeZoneOffset={this.props.timeZoneOffset}\n markDate={this.props.markDate}\n />\n <div className=\"end-time-container\">\n {hasDates && <span className=\"end-date\">{toDateString(endDate, timeZoneOffset)}</span>}\n {hasDates && !showDuration && <span className=\"end-time\">{toTimeString(endDate, timeZoneOffset, timeFormatOptions)}</span>}\n {showDuration && <InlineEdit className=\"duration-end-time\" defaultValue={totalDurationString} onChange={this._onTotalDurationChange} />}\n </div>\n {minimized && this._renderSettings()}\n </div>\n </div>\n );\n }\n}\n"]}
@@ -2,11 +2,8 @@
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
  .timeline-component {
8
6
  box-sizing: border-box;
9
- background: $buic-background-2;
10
7
  width: 100%;
11
8
  display: flex;
12
9
  flex-direction: column;
@@ -38,13 +35,13 @@
38
35
  font-size: 14px;
39
36
  min-width: 180px;
40
37
  padding: 8px;
41
- color: $buic-foreground-body;
38
+ color: var(--iui-color-text);
42
39
  position: absolute;
43
40
  left: 50%;
44
41
  transform: translateX(-50%);
45
42
  border-radius: var(--iui-border-radius-1);
46
- border: solid 1px $buic-background-5;
47
- background-color: $buic-background-1;
43
+ border: solid 1px var(--iui-color-border);
44
+ background-color: var(--iui-color-background);
48
45
  text-align: center;
49
46
  box-sizing: border-box;
50
47
  display: flex;
@@ -77,7 +74,7 @@
77
74
  .start-time,
78
75
  .end-time {
79
76
  font-size: 12px;
80
- color: $buic-foreground-muted;
77
+ color: var(--iui-color-text-muted);
81
78
  text-align: center;
82
79
  min-height: inherit;
83
80
  }
@@ -86,7 +83,7 @@
86
83
  .duration-end-time {
87
84
  font-size: 14px;
88
85
  width: 40px;
89
- color: $buic-foreground-body;
86
+ color: var(--iui-color-text);
90
87
  text-align: center;
91
88
  min-height: inherit;
92
89
  }
@@ -94,7 +91,7 @@
94
91
  .start-date,
95
92
  .end-date {
96
93
  font-size: 12px;
97
- color: $buic-foreground-muted;
94
+ color: var(--iui-color-text-muted);
98
95
  padding-bottom: 4px;
99
96
  }
100
97
 
@@ -110,11 +107,11 @@
110
107
  .timeline-settings {
111
108
  margin-left: auto;
112
109
  font-size: 14px;
113
- color: $buic-foreground-body;
110
+ color: var(--iui-color-text);
114
111
  cursor: pointer;
115
112
 
116
113
  &:hover {
117
- color: $buic-foreground-activehover;
114
+ color: var(--iui-color-text-hover);
118
115
  }
119
116
 
120
117
  &:focus {
@@ -162,3 +159,20 @@
162
159
  transform: translateY(-50%);
163
160
  }
164
161
  }
162
+
163
+ .timeline-component-max-sized-scrolling-menu {
164
+ display: flex;
165
+ max-height: 100%;
166
+ > .tippy-box {
167
+ display: flex;
168
+ > .tippy-content {
169
+ display: flex;
170
+ > div {
171
+ display: flex;
172
+ > .iui-menu {
173
+ overflow: auto;
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
@@ -4,35 +4,6 @@
4
4
  import { ColorDef } from "@itwin/core-common";
5
5
  import { ScreenViewport } from "@itwin/core-frontend";
6
6
  import { GenericUiEventArgs } from "@itwin/appui-abstract";
7
- /**
8
- * A range of time which can be used to focus in on activities scheduled around a milestone.
9
- * @public
10
- */
11
- export interface MilestoneRange {
12
- start: Date;
13
- end: Date;
14
- }
15
- /**
16
- * A Milestone event that is to be noted in the timeline.
17
- * @internal
18
- * @deprecated
19
- */
20
- export interface Milestone {
21
- /** uniqueId of milestone */
22
- id: string;
23
- /** milestone date */
24
- date: Date;
25
- parentId?: string;
26
- /** Milestone label that is display if space allows */
27
- label?: string;
28
- /** Milestone description that is show as tooltip */
29
- description?: string;
30
- /** animation range that includes milestone */
31
- range?: MilestoneRange;
32
- /** Set to true if read only. */
33
- readonly?: boolean;
34
- children?: Milestone[];
35
- }
36
7
  /** The timeline scale.
37
8
  * @public
38
9
  */
@@ -81,13 +52,13 @@ export interface PlaybackSettings {
81
52
  * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.
82
53
  * @public
83
54
  */
84
- export declare type AnimationFractionChangeHandler = (animationFraction: number) => void;
55
+ export type AnimationFractionChangeHandler = (animationFraction: number) => void;
85
56
  /**
86
57
  * An interface used to notify Handlers of Playback Settings changes.
87
58
  * Contains the settings to be used.
88
59
  * @public
89
60
  */
90
- export declare type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;
61
+ export type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;
91
62
  /** Actions for Pause/Play event
92
63
  * @public
93
64
  */
@@ -141,7 +112,7 @@ export interface TimelineDataProvider {
141
112
  * Contains the settings to be used.
142
113
  * @alpha
143
114
  */
144
- export declare type SolarPlaybackProgressHandler = (time: Date) => void;
115
+ export type SolarPlaybackProgressHandler = (time: Date) => void;
145
116
  /** Data Provider interface for getting and setting solar position
146
117
  * @alpha
147
118
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,iBAAiB;IACjB,KAAK,IAAA;IACL,oBAAoB;IACpB,QAAQ,IAAA;IACR,kBAAkB;IAClB,MAAM,IAAA;IACN,gBAAgB;IAChB,IAAI,IAAA;IACJ,iBAAiB;IACjB,KAAK,IAAA;CACN;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC7B,qDAAqD;IACrD,UAAU,IAAA;IACV,sEAAsE;IACtE,WAAW,IAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,IAAI,CAA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,EAAE,cAAc,CAAC;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,mBAAmB;IACnB,WAAW,EAAE,QAAQ,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;sGACkG;IAClG,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAsCH;;GAEG;AACH,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAoCD;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","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 Timeline\n */\n\nimport { ColorDef } from \"@itwin/core-common\";\nimport { ScreenViewport } from \"@itwin/core-frontend\";\nimport { GenericUiEventArgs } from \"@itwin/appui-abstract\";\n\n/**\n * A range of time which can be used to focus in on activities scheduled around a milestone.\n * @public\n */\nexport interface MilestoneRange {\n start: Date;\n end: Date;\n}\n\n/**\n * A Milestone event that is to be noted in the timeline.\n * @internal\n * @deprecated\n */\nexport interface Milestone {\n /** uniqueId of milestone */\n id: string;\n /** milestone date */\n date: Date;\n parentId?: string;\n /** Milestone label that is display if space allows */\n label?: string;\n /** Milestone description that is show as tooltip */\n description?: string;\n /** animation range that includes milestone */\n range?: MilestoneRange;\n /** Set to true if read only. */\n readonly?: boolean;\n // eslint-disable-next-line deprecation/deprecation\n children?: Milestone[];\n}\n\n/** The timeline scale.\n * @public\n */\nexport enum TimelineScale {\n /** Show years */\n Years,\n /** Show quarters */\n Quarters,\n /** Show months */\n Months,\n /** Show days */\n Days,\n /** Show hours */\n Hours,\n}\n\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\n * @public\n */\nexport enum TimelineDateDisplay {\n /** Display time axis using actual start/end dates */\n ActualTime,\n /** Display time axis using time relative to actual start/end dates */\n ProjectTime,\n}\n\n/**\n * Playback Settings.\n * @public\n */\nexport interface PlaybackSettings {\n /** time in milliseconds to play animation from start date to end date */\n duration?: number;\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\n loop?: boolean;\n /** If true a minimal set of data is displayed. */\n minimized?: boolean;\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\n playbackStart?: Date;\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\n playbackEnd?: Date;\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\n allowMilestoneEdits?: boolean;\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\n dateDisplay?: TimelineDateDisplay;\n}\n\n/**\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\n * @public\n */\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\n\n/**\n * An interface used to notify Handlers of Playback Settings changes.\n * Contains the settings to be used.\n * @public\n */\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\n\n/** Actions for Pause/Play event\n * @public\n */\nexport enum TimelinePausePlayAction {\n Toggle,\n Pause,\n Play,\n}\n/** Args for event to pause or play the timeline component\n * @public\n */\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\n timelineAction: TimelinePausePlayAction;\n}\n/** Interface for a timeline data provider class\n * @public\n */\nexport interface TimelineDataProvider {\n /** uniqueId of provider */\n id: string;\n /** view id when viewport is initially assigned */\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n /** Starting date for entire timeline */\n start?: Date;\n /** End date for entire timeline */\n end?: Date;\n /** Current animation fraction from 0.0 to 1.0 */\n animationFraction?: number;\n getSettings(): PlaybackSettings;\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\n initialDuration: number;\n /** Called to get the duration of the Playback. */\n duration: number;\n /** If true the playback will continuously loop. */\n loop: boolean;\n /** Called to save the playback settings */\n updateSettings(settings: PlaybackSettings): void;\n /** Async call to load milestone and settings data */\n loadTimelineData(): Promise<boolean>;\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n}\n\n/**\n * An interface used to notify Handlers of Playback progress.\n * Contains the settings to be used.\n * @alpha\n */\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\n\n/** Data Provider interface for getting and setting solar position\n * @alpha\n */\nexport interface SolarDataProvider {\n // View Id used to determine sunrise and sunset\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n // set to true is timeline should be shown - return false if view is not set to display shadow.\n readonly shouldShowTimeline: boolean;\n /** Starting date for entire timeline */\n day: Date;\n /** Starting time for day in milliseconds */\n readonly dayStartMs: number;\n /** Time of day for sun */\n readonly timeOfDay: Date;\n /** Called during playback to update animation */\n onTimeChanged?: SolarPlaybackProgressHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n /** Time of Sunrise to nearest minute */\n readonly sunrise: Date;\n /** time of Sunrise to nearest minute */\n readonly sunset: Date;\n /** shadow color */\n shadowColor: ColorDef;\n /** timezone offset for local project time */\n readonly timeZoneOffset: number;\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\n * current time and the value is adjusted to be the same date and time at the project location. */\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAMH;;GAEG;AACH,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAoCD;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","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 Timeline\n */\n\nimport { ColorDef } from \"@itwin/core-common\";\nimport { ScreenViewport } from \"@itwin/core-frontend\";\nimport { GenericUiEventArgs } from \"@itwin/appui-abstract\";\n\n/** The timeline scale.\n * @public\n */\nexport enum TimelineScale {\n /** Show years */\n Years,\n /** Show quarters */\n Quarters,\n /** Show months */\n Months,\n /** Show days */\n Days,\n /** Show hours */\n Hours,\n}\n\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\n * @public\n */\nexport enum TimelineDateDisplay {\n /** Display time axis using actual start/end dates */\n ActualTime,\n /** Display time axis using time relative to actual start/end dates */\n ProjectTime,\n}\n\n/**\n * Playback Settings.\n * @public\n */\nexport interface PlaybackSettings {\n /** time in milliseconds to play animation from start date to end date */\n duration?: number;\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\n loop?: boolean;\n /** If true a minimal set of data is displayed. */\n minimized?: boolean;\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\n playbackStart?: Date;\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\n playbackEnd?: Date;\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\n allowMilestoneEdits?: boolean;\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\n dateDisplay?: TimelineDateDisplay;\n}\n\n/**\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\n * @public\n */\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\n\n/**\n * An interface used to notify Handlers of Playback Settings changes.\n * Contains the settings to be used.\n * @public\n */\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\n\n/** Actions for Pause/Play event\n * @public\n */\nexport enum TimelinePausePlayAction {\n Toggle,\n Pause,\n Play,\n}\n/** Args for event to pause or play the timeline component\n * @public\n */\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\n timelineAction: TimelinePausePlayAction;\n}\n/** Interface for a timeline data provider class\n * @public\n */\nexport interface TimelineDataProvider {\n /** uniqueId of provider */\n id: string;\n /** view id when viewport is initially assigned */\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n /** Starting date for entire timeline */\n start?: Date;\n /** End date for entire timeline */\n end?: Date;\n /** Current animation fraction from 0.0 to 1.0 */\n animationFraction?: number;\n getSettings(): PlaybackSettings;\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\n initialDuration: number;\n /** Called to get the duration of the Playback. */\n duration: number;\n /** If true the playback will continuously loop. */\n loop: boolean;\n /** Called to save the playback settings */\n updateSettings(settings: PlaybackSettings): void;\n /** Async call to load milestone and settings data */\n loadTimelineData(): Promise<boolean>;\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n}\n\n/**\n * An interface used to notify Handlers of Playback progress.\n * Contains the settings to be used.\n * @alpha\n */\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\n\n/** Data Provider interface for getting and setting solar position\n * @alpha\n */\nexport interface SolarDataProvider {\n // View Id used to determine sunrise and sunset\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n // set to true is timeline should be shown - return false if view is not set to display shadow.\n readonly shouldShowTimeline: boolean;\n /** Starting date for entire timeline */\n day: Date;\n /** Starting time for day in milliseconds */\n readonly dayStartMs: number;\n /** Time of day for sun */\n readonly timeOfDay: Date;\n /** Called during playback to update animation */\n onTimeChanged?: SolarPlaybackProgressHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n /** Time of Sunrise to nearest minute */\n readonly sunrise: Date;\n /** time of Sunrise to nearest minute */\n readonly sunset: Date;\n /** shadow color */\n shadowColor: ColorDef;\n /** timezone offset for local project time */\n readonly timeZoneOffset: number;\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\n * current time and the value is adjusted to be the same date and time at the project location. */\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\n}\n"]}
@@ -8,7 +8,7 @@ import { CommonProps } from "@itwin/core-react";
8
8
  /** Type for a ViewState prop
9
9
  * @public
10
10
  */
11
- export declare type ViewStateProp = ViewState | (() => ViewState);
11
+ export type ViewStateProp = ViewState | (() => ViewState);
12
12
  /**
13
13
  * Properties for [[ViewportComponent]] component.
14
14
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EACM,gBAAgB,EAAE,cAAc,EAC3C,cAAc,EAAgB,WAAW,EAC/B,SAAS,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD;;GAEG;AACH,oBAAY,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwQrD"}
1
+ {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EACM,gBAAgB,EAAE,cAAc,EAC3C,cAAc,EAAgB,WAAW,EAC/B,SAAS,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwQrD"}
@@ -18,7 +18,7 @@ import { ViewportComponentEvents, } from "./ViewportComponentEvents";
18
18
  export function ViewportComponent(props) {
19
19
  const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride, tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;
20
20
  // istanbul ignore next
21
- const viewManagerRef = React.useRef(viewManagerOverride !== null && viewManagerOverride !== void 0 ? viewManagerOverride : IModelApp.viewManager);
21
+ const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);
22
22
  const tentativePointOverrideRef = React.useRef(tentativePointOverride);
23
23
  const screenViewportCreated = React.useRef(false);
24
24
  const viewportDiv = React.useRef(null);
@@ -64,10 +64,9 @@ export function ViewportComponent(props) {
64
64
  };
65
65
  const targetPoint = React.useRef(null);
66
66
  const getRotatePoint = (vp) => {
67
- var _a, _b;
68
67
  const lastTargetPoint = targetPoint.current;
69
68
  // istanbul ignore next
70
- const tentativePoint = (_a = tentativePointOverrideRef.current) !== null && _a !== void 0 ? _a : IModelApp.tentativePoint;
69
+ const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;
71
70
  // istanbul ignore else
72
71
  if (tentativePoint.isActive)
73
72
  return tentativePoint.getPoint();
@@ -92,7 +91,7 @@ export function ViewportComponent(props) {
92
91
  const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));
93
92
  targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());
94
93
  // istanbul ignore next
95
- return (_b = targetPoint.current) !== null && _b !== void 0 ? _b : vp.view.getCenter();
94
+ return targetPoint.current ?? vp.view.getCenter();
96
95
  };
97
96
  const handleCubeRotationChangeEvent = (args) => {
98
97
  const viewManager = viewManagerRef.current;
@@ -200,8 +199,8 @@ export function ViewportComponent(props) {
200
199
  Logger.logError("ViewportComponent", `A Viewstate or a viewId and imodel must be provided`);
201
200
  }
202
201
  // istanbul ignore next
203
- if (isMounted.current && ((currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isOpen) || (currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isBlank))) {
204
- setInitialViewState(currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.clone());
202
+ if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {
203
+ setInitialViewState(currentViewState?.clone());
205
204
  }
206
205
  }
207
206
  if (undefined === initialViewState)
@@ -210,11 +209,10 @@ export function ViewportComponent(props) {
210
209
  const [viewOverlay, setViewOverlay] = React.useState(null);
211
210
  // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.
212
211
  React.useEffect(() => {
213
- var _a;
214
212
  const parentDiv = viewportDiv.current;
215
213
  const viewManager = viewManagerRef.current;
216
214
  // istanbul ignore next
217
- if (parentDiv && initialViewState && ((initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isOpen) || (initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isBlank))) {
215
+ if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {
218
216
  if (!screenViewportCreated.current) {
219
217
  const screenViewport = getScreenViewport(parentDiv, initialViewState);
220
218
  screenViewportRef.current = screenViewport;
@@ -227,7 +225,7 @@ export function ViewportComponent(props) {
227
225
  }
228
226
  else {
229
227
  // istanbul ignore next
230
- (_a = screenViewportRef.current) === null || _a === void 0 ? void 0 : _a.changeView(initialViewState);
228
+ screenViewportRef.current?.changeView(initialViewState);
231
229
  }
232
230
  }
233
231
  // eslint-disable-next-line react-hooks/exhaustive-deps