@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
@@ -13,14 +13,14 @@ $bottom-position: 4px;
13
13
 
14
14
  .solar-timeline-wrapper {
15
15
  box-sizing: border-box;
16
- background: $buic-background-2;
16
+ background: var(--iui-color-background);
17
17
  width: 100%;
18
18
  display: flex;
19
19
  flex-direction: column;
20
20
  position: relative;
21
21
  padding: 8px 16px;
22
- color: $buic-foreground-body;
23
- font-size: 14px;
22
+ color: var(--iui-color-text);
23
+ font-size: var(--iui-font-size-1);
24
24
 
25
25
  > .header {
26
26
  display: flex;
@@ -38,7 +38,7 @@ $bottom-position: 4px;
38
38
  > .shadow-settings-button {
39
39
  display: flex;
40
40
  align-items: center;
41
- color: $buic-foreground-body;
41
+ color: var(--iui-color-icon);
42
42
  width: 26px;
43
43
  height: 26px;
44
44
  background: inherit;
@@ -48,11 +48,12 @@ $bottom-position: 4px;
48
48
  cursor: pointer;
49
49
 
50
50
  &:hover {
51
- color: $buic-foreground-activehover;
51
+ color: var(--iui-color-icon-hover);
52
52
  }
53
53
 
54
- &:focus {
55
- outline: none;
54
+ &:focus-visible {
55
+ outline: 1px solid var(--iui-color-border-accent);
56
+ outline-offset: -1px;
56
57
  }
57
58
  }
58
59
 
@@ -65,10 +66,15 @@ $bottom-position: 4px;
65
66
  border: none;
66
67
  display: flex;
67
68
  align-items: center;
68
- color: $buic-foreground-body;
69
- font-size: 14px;
69
+ color: var(--iui-color-text);
70
+ font-size: var(--iui-font-size-1);
70
71
  cursor: pointer;
71
72
 
73
+ &:focus-visible {
74
+ outline: 1px solid var(--iui-color-border-accent);
75
+ outline-offset: -1px;
76
+ }
77
+
72
78
  > span:nth-child(2) {
73
79
  margin: 0 6px;
74
80
  }
@@ -95,26 +101,22 @@ $bottom-position: 4px;
95
101
  }
96
102
 
97
103
  > .loop-playback {
98
- color: $buic-foreground-primary;
104
+ color: var(--iui-color-icon-accent);
99
105
  font-size: 16px;
100
106
  cursor: pointer;
101
107
 
102
- &:hover {
103
- color: $buic-foreground-primary-tone;
104
- }
105
-
106
108
  &:focus {
107
109
  outline: none;
108
110
  }
109
111
  }
110
112
 
111
113
  > .no-loop-playback {
112
- color: $buic-foreground-body;
114
+ color: var(--iui-color-icon);
113
115
  font-size: 16px;
114
116
  cursor: pointer;
115
117
 
116
118
  &:hover {
117
- color: $buic-foreground-activehover;
119
+ color: var(--iui-color-icon-hover);
118
120
  }
119
121
 
120
122
  &:focus {
@@ -150,11 +152,11 @@ $bottom-position: 4px;
150
152
 
151
153
  .rail-inner {
152
154
  width: 100%;
153
- background: $buic-background-5;
155
+ background: var(--iui-color-background-backdrop);
154
156
  }
155
157
 
156
158
  .rail-solar {
157
- background: $buic-foreground-primary;
159
+ background: var(--iui-color-background-accent);
158
160
  z-index: 1;
159
161
  }
160
162
 
@@ -192,7 +194,7 @@ $bottom-position: 4px;
192
194
  height: 10px;
193
195
  opacity: 0.25;
194
196
  margin: 0 1px;
195
- background-color: $buic-foreground-body;
197
+ background-color: var(--iui-color-text);
196
198
  }
197
199
  }
198
200
 
@@ -222,7 +224,7 @@ $bottom-position: 4px;
222
224
  }
223
225
 
224
226
  .sunrise {
225
- color: #ffcf00;
227
+ color: var(--iui-color-icon-warning);
226
228
  margin: 0 24px 0 8px;
227
229
  }
228
230
  }
@@ -317,7 +319,7 @@ $bottom-position: 4px;
317
319
  display: grid;
318
320
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
319
321
  grid-column-gap: 2px;
320
- border-top: 1px solid $buic-background-5;
322
+ border-top: 1px solid var(--iui-color-border-subtle);
321
323
  }
322
324
  }
323
325
 
@@ -325,13 +327,13 @@ $bottom-position: 4px;
325
327
  position: absolute;
326
328
  top: -8px;
327
329
  display: inline-block;
328
- border-bottom: 1px dotted #222;
330
+ border-bottom: 1px dotted rgba(0, 0, 0, var(--iui-opacity-3));
329
331
  font-size: 14px;
330
332
  }
331
333
 
332
334
  .solar-tooltip-text {
333
335
  width: 100px;
334
- background-color: #222;
336
+ background-color: rgba(0, 0, 0, var(--iui-opacity-3));
335
337
  color: #fff;
336
338
  // opacity: 0.8;
337
339
  text-align: center;
@@ -351,6 +353,7 @@ $bottom-position: 4px;
351
353
  margin-left: -5px;
352
354
  border-width: 5px;
353
355
  border-style: solid;
354
- border-color: #222 transparent transparent transparent;
356
+ border-color: rgba(0, 0, 0, var(--iui-opacity-3)) transparent transparent
357
+ transparent;
355
358
  }
356
359
  }
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"SpeedTimeline.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/SpeedTimeline.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gCAA8B;AAC9B,4DAAoC;AACpC,6CAA+B;AAC/B,wDAA8C;AAU9C;;GAEG;AACH,gEAAgE;AAChE,SAAgB,aAAa,CAAC,KAAiB;IAC7C,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,CAAC,MAA6B,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAC9C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC1C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC;QAC3D,oBAAC,sBAAM,IACL,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,CAAC,EACN,QAAQ,EAAC,EAAE,EACX,QAAQ,EAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EACrB,gBAAgB,EAAC,MAAM,EACvB,YAAY,EAAE,YAAY,GAAI,CAC5B,CACP,CAAC;AACJ,CAAC;AA3BD,sCA2BC","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 \"./SpeedTimeline.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Slider } from \"@itwin/itwinui-react\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n// component is in alpha state - it may change after usability testing - test coverage not complete\n\ninterface SpeedProps extends CommonProps {\n speed: number;\n onChange?: (value: number) => void;\n}\n\n/** Speed Timeline used in Solar Timeline component\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SpeedTimeline(props: SpeedProps) {\n // istanbul ignore next - WIP\n const onChange = (values: ReadonlyArray<number>) => {\n const value = values[0];\n if (props.onChange && (value >= 1 && value <= 6))\n props.onChange(value);\n };\n\n const tooltipProps = React.useCallback(() => {\n return { visible: false };\n }, []);\n\n return (\n <div className={classnames(\"speed-timeline\", props.className)}>\n <Slider\n step={1}\n min={1}\n max={6}\n minLabel=\"\"\n maxLabel=\"\"\n onUpdate={onChange}\n onChange={onChange}\n values={[props.speed]}\n trackDisplayMode=\"none\"\n tooltipProps={tooltipProps} />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"SpeedTimeline.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/SpeedTimeline.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gCAA8B;AAC9B,4DAAoC;AACpC,6CAA+B;AAC/B,wDAA8C;AAU9C;;GAEG;AACH,gEAAgE;AAChE,SAAgB,aAAa,CAAC,KAAiB;IAC7C,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,CAAC,MAA6B,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAC9C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC1C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC;QAC3D,oBAAC,sBAAM,IACL,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,CAAC,EACN,QAAQ,EAAC,EAAE,EACX,QAAQ,EAAC,EAAE,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EACrB,gBAAgB,EAAC,MAAM,EACvB,YAAY,EAAE,YAAY,GAAI,CAC5B,CACP,CAAC;AACJ,CAAC;AA3BD,sCA2BC","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 \"./SpeedTimeline.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Slider } from \"@itwin/itwinui-react\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n// component is in alpha state - it may change after usability testing - test coverage not complete\n\ninterface SpeedProps extends CommonProps {\n speed: number;\n onChange?: (value: number) => void;\n}\n\n/** Speed Timeline used in Solar Timeline component\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SpeedTimeline(props: SpeedProps) {\n // istanbul ignore next - WIP\n const onChange = (values: ReadonlyArray<number>) => {\n const value = values[0];\n if (props.onChange && (value >= 1 && value <= 6))\n props.onChange(value);\n };\n\n const tooltipProps = React.useCallback(() => {\n return { visible: false };\n }, []);\n\n return (\n <div className={classnames(\"speed-timeline\", props.className)}>\n <Slider\n step={1}\n min={1}\n max={6}\n minLabel=\"\"\n maxLabel=\"\"\n onUpdate={onChange}\n onChange={onChange}\n values={[props.speed]}\n trackDisplayMode=\"none\"\n tooltipProps={tooltipProps} />\n </div>\n );\n}\n"]}
@@ -1,10 +1,7 @@
1
- /** @packageDocumentation
2
- * @module Timeline
3
- */
4
- import "./TimelineComponent.scss";
5
- import * as React from "react";
6
1
  import { DateFormatOptions } from "@itwin/components-react";
2
+ import * as React from "react";
7
3
  import { PlaybackSettings } from "./interfaces";
4
+ import "./TimelineComponent.scss";
8
5
  /**
9
6
  * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu
10
7
  * "replace" : use the app-supplied items in place of the standard items
@@ -13,7 +10,7 @@ import { PlaybackSettings } from "./interfaces";
13
10
  *
14
11
  * @public
15
12
  */
16
- export declare type TimelineMenuItemOption = "replace" | "append" | "prefix";
13
+ export type TimelineMenuItemOption = "replace" | "append" | "prefix";
17
14
  /**
18
15
  * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu
19
16
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAA4C,MAAM,yBAAyB,CAAC;AAGtG,OAAO,EAAE,gBAAgB,EAAkD,MAAM,cAAc,CAAC;AAUhG;;;;;;;GAOG;AACH,oBAAY,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACrE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IAEd,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AACD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,6GAA6G;IAC7G,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AACD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,QAAQ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,OAAO,CAcb;IAGF,OAAO,CAAC,QAAQ,CAcd;IAGF,OAAO,CAAC,iBAAiB,CAGvB;IAGF,OAAO,CAAC,YAAY,CAYlB;IAGF,OAAO,CAAC,gBAAgB,CA6BtB;IAEF,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,OAAO,CAGb;IAEF,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,sBAAsB,CAI5B;IAEF,OAAO,CAAC,oBAAoB,CAY1B;IAEF,OAAO,CAAC,gBAAgB,CAStB;IAEF,OAAO,CAAC,YAAY,CAOlB;IAEF,OAAO,CAAC,mBAAmB,CASzB;IAEF,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,eAAe,CAuErB;IAEc,MAAM;CAoDvB"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Timeline
8
- */
9
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
3
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
12
9
  }) : (function(o, m, k, k2) {
13
10
  if (k2 === undefined) k2 = k;
14
11
  o[k2] = m[k];
@@ -30,17 +27,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
27
  };
31
28
  Object.defineProperty(exports, "__esModule", { value: true });
32
29
  exports.TimelineComponent = void 0;
33
- require("./TimelineComponent.scss");
34
- const classnames_1 = __importDefault(require("classnames"));
35
- const React = __importStar(require("react"));
30
+ /*---------------------------------------------------------------------------------------------
31
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
32
+ * See LICENSE.md in the project root for license terms and full copyright notice.
33
+ *--------------------------------------------------------------------------------------------*/
34
+ /** @packageDocumentation
35
+ * @module Timeline
36
+ */
36
37
  const appui_abstract_1 = require("@itwin/appui-abstract");
37
38
  const components_react_1 = require("@itwin/components-react");
39
+ const core_react_1 = require("@itwin/core-react");
40
+ const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
41
+ const itwinui_react_1 = require("@itwin/itwinui-react");
42
+ const classnames_1 = __importDefault(require("classnames"));
43
+ const React = __importStar(require("react"));
38
44
  const UiIModelComponents_1 = require("../UiIModelComponents");
39
45
  const InlineEdit_1 = require("./InlineEdit");
40
46
  const interfaces_1 = require("./interfaces");
41
47
  const PlayerButton_1 = require("./PlayerButton");
42
48
  const Scrubber_1 = require("./Scrubber");
43
- const itwinui_react_1 = require("@itwin/itwinui-react");
49
+ require("./TimelineComponent.scss");
44
50
  // cspell:ignore millisec
45
51
  const slowSpeed = 60 * 1000;
46
52
  const mediumSpeed = 20 * 1000;
@@ -237,7 +243,9 @@ class TimelineComponent extends React.Component {
237
243
  let keyIndex = 0;
238
244
  if (this.state.includeRepeat) {
239
245
  const checked = this.state.repeat;
240
- const icon = checked ? React.createElement("span", { className: "icon icon-checkmark" }) : React.createElement("span", null);
246
+ const icon = checked ? React.createElement("span", { className: "icon" },
247
+ React.createElement(core_react_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgCheckmark, null) }),
248
+ " ") : React.createElement("span", null);
241
249
  itemNodes.push(React.createElement(itwinui_react_1.MenuItem, { key: ++keyIndex, onClick: () => { this._onRepeatChanged(); close(); }, icon: icon }, this._repeatLabel));
242
250
  itemNodes.push(React.createElement(itwinui_react_1.MenuDivider, { key: ++keyIndex }));
243
251
  }
@@ -246,8 +254,38 @@ class TimelineComponent extends React.Component {
246
254
  });
247
255
  return itemNodes;
248
256
  };
249
- return (React.createElement(itwinui_react_1.DropdownMenu, { menuItems: createMenuItemNodes },
250
- React.createElement("span", { "data-testid": "timeline-settings", className: "timeline-settings icon icon-more-vertical-2", role: "button", tabIndex: -1, title: components_react_1.UiComponents.translate("button.label.settings") })));
257
+ return (React.createElement(itwinui_react_1.DropdownMenu, { menuItems: createMenuItemNodes, placement: "top-start", popperOptions: {
258
+ modifiers: [
259
+ {
260
+ name: "hide", // When the timeline is no longer visible, hide the popper.
261
+ },
262
+ {
263
+ name: "preventOverflow",
264
+ options: {
265
+ altAxis: true, // Allow the popper to go below the reference element and use as much space as needed.
266
+ },
267
+ },
268
+ {
269
+ name: "computeStyles",
270
+ options: {
271
+ roundOffsets: ({ x, y }) => ({
272
+ x,
273
+ y: Math.max(y, 0), // Ensure that the top of the popper will not go over the top of the document.
274
+ }),
275
+ },
276
+ },
277
+ {
278
+ name: "setPopperClass",
279
+ enabled: true,
280
+ phase: "beforeWrite",
281
+ fn({ state }) {
282
+ state.attributes.popper.class = "timeline-component-max-sized-scrolling-menu";
283
+ },
284
+ },
285
+ ]
286
+ } },
287
+ React.createElement("span", { "data-testid": "timeline-settings", className: "timeline-settings icon", role: "button", tabIndex: -1, title: components_react_1.UiComponents.translate("button.label.settings") },
288
+ React.createElement(core_react_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgMoreVertical, null) }))));
251
289
  };
252
290
  this.state = {
253
291
  isPlaying: false,
@@ -324,7 +362,9 @@ class TimelineComponent extends React.Component {
324
362
  _createMenuItemNode(item, index, currentTimelineDuration, close) {
325
363
  const label = item.label;
326
364
  const checked = currentTimelineDuration === item.timelineDuration;
327
- const icon = checked ? React.createElement("span", { className: "icon icon-checkmark" }) : React.createElement("span", null);
365
+ const icon = checked ? React.createElement("span", { className: "icon" },
366
+ React.createElement(core_react_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgCheckmark, null) }),
367
+ " ") : React.createElement("span", null);
328
368
  return (React.createElement(itwinui_react_1.MenuItem, { key: index, icon: icon, onClick: () => { this._onSetTotalDuration(item.timelineDuration); close(); } }, label));
329
369
  }
330
370
  render() {
@@ -337,9 +377,9 @@ class TimelineComponent extends React.Component {
337
377
  return (React.createElement("div", { "data-testid": "timeline-component", className: (0, classnames_1.default)("timeline-component", !!minimized && "minimized", hasDates && "has-dates") },
338
378
  React.createElement("div", { className: "header" },
339
379
  React.createElement(PlayerButton_1.PlayButton, { className: "play-button", isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, "data-testid": "timeline-play" }),
340
- React.createElement(PlayerButton_1.PlayerButton, { className: "play-backward", icon: "icon-caret-left", onClick: this._onBackward, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.backward") }),
341
- React.createElement(PlayerButton_1.PlayerButton, { className: "play-button-step", icon: "icon-media-controls-circular-play", isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.step") }),
342
- React.createElement(PlayerButton_1.PlayerButton, { className: "play-forward", icon: "icon-caret-right", onClick: this._onForward, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.backward") }),
380
+ React.createElement(PlayerButton_1.PlayerButton, { className: "play-backward", icon: React.createElement(itwinui_icons_react_1.SvgCaretLeft, null), onClick: this._onBackward, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.backward") }),
381
+ React.createElement(PlayerButton_1.PlayerButton, { className: "play-button-step", icon: React.createElement(itwinui_icons_react_1.SvgPlayCircular, null), isPlaying: this.state.isPlaying, onPlay: this._onPlay, onPause: this._onPause, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.step") }),
382
+ React.createElement(PlayerButton_1.PlayerButton, { className: "play-forward", icon: React.createElement(itwinui_icons_react_1.SvgCaretRight, null), onClick: this._onForward, title: UiIModelComponents_1.UiIModelComponents.translate("timeline.backward") }),
343
383
  React.createElement("span", { className: "current-date" }, (0, components_react_1.toDateString)(currentDate, timeZoneOffset, dateFormatOptions))),
344
384
  React.createElement("div", { className: "scrubber" },
345
385
  React.createElement(PlayerButton_1.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,oCAAkC;AAClC,4DAAoC;AACpC,6CAA+B;AAC/B,0DAAoE;AACpE,8DAAsG;AACtG,8DAA2D;AAC3D,6CAA0C;AAC1C,6CAAgG;AAChG,iDAA0D;AAC1D,yCAAsC;AACtC,wDAA2E;AAE3E,yBAAyB;AAEzB,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9B,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AA4F5B;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAyD;IAYpG,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QAZP,mBAAc,GAAG,CAAC,CAAC;QACnB,kBAAa,GAAG,CAAC,CAAC;QAClB,eAAU,GAAG,KAAK,CAAC;QAGnB,+BAA0B,GAA4B;YAC5D,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE;YACrF,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE;YACzF,EAAE,KAAK,EAAE,uCAAkB,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE;SACtF,CAAC;QA2DM,kCAA6B,GAAG,CAAC,IAAwB,EAAQ,EAAE;YACzE,MAAM,YAAY,GAAG,IAA6B,CAAC;YACnD,uB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I,6CAAkB,iBAAiB,EAAC,SAAS,EAAC,YAAY,IAAE,IAAA,+BAAY,EAAC,SAAS,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBAC3J,YAAY,IAAI,8BAAM,SAAS,EAAC,qBAAqB,IAAE,cAAc,CAAQ,CAC1E;gBACN,oBAAC,mBAAQ,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,IAAA,+BAAY,EAAC,OAAO,EAAE,cAAc,CAAC,CAAQ;oBACrF,QAAQ,IAAI,CAAC,YAAY,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,IAAA,+BAAY,EAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBACzH,YAAY,IAAI,oBAAC,uBAAU,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;AAzYD,8CAyYC","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,0DAAoE;AACpE,8DAAsG;AACtG,kDAAyC;AACzC,oEAAyH;AACzH,wDAA2E;AAC3E,4DAAoC;AACpC,6CAA+B;AAE/B,8DAA2D;AAC3D,6CAA0C;AAC1C,6CAAgG;AAChG,iDAA0D;AAC1D,yCAAsC;AAEtC,oCAAkC;AAElC,yBAAyB;AAEzB,MAAM,SAAS,GAAG,EA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BACrF,QAAQ,IAAI,CAAC,YAAY,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,IAAA,+BAAY,EAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBACzH,YAAY,IAAI,oBAAC,uBAAU,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;AAraD,8CAqaC","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
+ }