@itwin/imodel-components-react 4.0.0-dev.15 → 4.0.0-dev.16

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 (172) hide show
  1. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  2. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  3. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +1 -1
  4. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  5. package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
  6. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +90 -90
  8. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  9. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  10. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +62 -62
  11. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  12. package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
  13. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  14. package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
  15. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  16. package/lib/cjs/imodel-components-react/color/Swatch.scss +22 -22
  17. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  18. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
  20. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  21. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
  22. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  23. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  24. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +106 -106
  25. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
  27. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  28. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +51 -51
  29. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  30. package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
  31. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +0 -21
  32. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  33. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +1 -25
  34. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -178
  36. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  37. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -135
  38. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +59 -59
  40. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  41. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  43. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  44. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  47. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  48. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  49. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  50. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  51. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  53. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  54. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  55. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  57. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  58. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  59. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  60. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
  61. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  62. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +28 -28
  63. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  64. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +105 -105
  65. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  66. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +359 -359
  67. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  68. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  69. package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
  70. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  71. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +177 -177
  72. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +0 -29
  73. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  74. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  75. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  76. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  77. package/lib/cjs/imodel-components-react.d.ts +0 -1
  78. package/lib/cjs/imodel-components-react.d.ts.map +1 -1
  79. package/lib/cjs/imodel-components-react.js +0 -1
  80. package/lib/cjs/imodel-components-react.js.map +1 -1
  81. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  82. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  83. package/lib/esm/imodel-components-react/color/AlphaSlider.js +1 -1
  84. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  85. package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
  86. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  87. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +90 -90
  88. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  89. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  90. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +62 -62
  91. package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
  92. package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
  93. package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
  94. package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
  95. package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
  96. package/lib/esm/imodel-components-react/color/Swatch.scss +22 -22
  97. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
  98. package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
  99. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
  100. package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
  101. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
  102. package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  103. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  104. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +106 -106
  105. package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
  106. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
  107. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  108. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +51 -51
  109. package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
  110. package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
  111. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +0 -21
  112. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  113. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +0 -24
  114. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  115. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -178
  116. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  117. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -135
  118. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  119. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +59 -59
  120. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  121. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  122. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  123. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  124. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  125. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  126. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  127. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  128. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  129. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  130. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  131. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  132. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  133. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  134. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  135. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  136. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  137. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  138. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
  139. package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  140. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
  141. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  142. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +28 -28
  143. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  144. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +105 -105
  145. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  146. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +359 -359
  147. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  148. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
  149. package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
  150. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  151. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +177 -177
  152. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +0 -29
  153. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  154. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  155. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  156. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  157. package/lib/esm/imodel-components-react.d.ts +0 -1
  158. package/lib/esm/imodel-components-react.d.ts.map +1 -1
  159. package/lib/esm/imodel-components-react.js +0 -1
  160. package/lib/esm/imodel-components-react.js.map +1 -1
  161. package/lib/public/locales/en/UiIModelComponents.json +139 -139
  162. package/package.json +5 -5
  163. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  164. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  165. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +0 -150
  166. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  167. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +0 -94
  168. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  169. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  170. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +0 -123
  171. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  172. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +0 -94
@@ -1,48 +1,48 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
-
7
- .components-lineweight-swatch {
8
- font-size: var(--iui-font-size-1);
9
- color: var(--iui-color-text);
10
- border: none;
11
- background: inherit;
12
- width: 100%;
13
- display: flex;
14
- flex-direction: row;
15
- align-items: center;
16
- padding: 3px 15px 3px 0;
17
- min-height: 22px;
18
- box-sizing: border-box;
19
-
20
- // remove inner focus ring that is specific to Firefox.
21
- &::-moz-focus-inner {
22
- border: 0px;
23
- }
24
-
25
- &:focus {
26
- outline: 1px solid $buic-row-selection;
27
- }
28
-
29
- &[disabled] {
30
- opacity: 0.2;
31
- cursor: default;
32
- }
33
-
34
- > span {
35
- width: 1.5em;
36
- text-align: right;
37
- }
38
-
39
- > div {
40
- flex: 1;
41
- background: $buic-foreground-body;
42
- margin-left: 15px;
43
- }
44
- }
45
-
46
- .components-lineweight-swatch.hide-label > span {
47
- display: none;
48
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
+
7
+ .components-lineweight-swatch {
8
+ font-size: var(--iui-font-size-1);
9
+ color: var(--iui-color-text);
10
+ border: none;
11
+ background: inherit;
12
+ width: 100%;
13
+ display: flex;
14
+ flex-direction: row;
15
+ align-items: center;
16
+ padding: 3px 15px 3px 0;
17
+ min-height: 22px;
18
+ box-sizing: border-box;
19
+
20
+ // remove inner focus ring that is specific to Firefox.
21
+ &::-moz-focus-inner {
22
+ border: 0px;
23
+ }
24
+
25
+ &:focus {
26
+ outline: 1px solid $buic-row-selection;
27
+ }
28
+
29
+ &[disabled] {
30
+ opacity: 0.2;
31
+ cursor: default;
32
+ }
33
+
34
+ > span {
35
+ width: 1.5em;
36
+ text-align: right;
37
+ }
38
+
39
+ > div {
40
+ flex: 1;
41
+ background: $buic-foreground-body;
42
+ margin-left: 15px;
43
+ }
44
+ }
45
+
46
+ .components-lineweight-swatch.hide-label > span {
47
+ display: none;
48
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"WeightPickerButton.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/lineweight/WeightPickerButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAe,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgC5C;;GAEG;AACH,MAAa,kBAAmB,SAAQ,KAAK,CAAC,aAAmD;IAK/F,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,YAAO,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC5C,sBAAiB,GAA0B,IAAI,CAAC;QAChD,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAqB,CAAC,CAAE,8DAA8D;QAkBpH,iBAAY,GAAG,GAAG,EAAE;YAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACrB,OAAO;YACT,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACtE,CAAC,CAAC;QAEM,mBAAc,GAAG,GAAG,EAAE;QAC9B,CAAC,CAAC;QAEM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC;QAE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AAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,EACpE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACd,oBAAC,KAAK,IACJ,SAAS,EAAC,+BAA+B,EACzC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EACjC,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,WAAW,EAAE,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,EACjE,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAChC,8BAA8B,UAE7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CACrC,CACT,GACD,CACD,CACJ,CAAC;IACJ,CAAC;;AAvKa,+BAAY,GAAG;IAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;CACzC,AAFyB,CAExB;SAnBS,kBAAkB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LineWeight\r\n */\r\n\r\nimport \"./WeightPickerButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ColorDef } from \"@itwin/core-common\";\r\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, ElementResizeObserver, Popup } from \"@itwin/core-react\";\r\nimport { LineWeightSwatch } from \"./Swatch\";\r\n\r\n// cSpell:ignore weightpicker lineweight\r\n\r\n/** Properties for the [[WeightPickerButton]] React component\r\n * @public\r\n */\r\nexport interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** active weight */\r\n activeWeight: number;\r\n /** available weights */\r\n weights: number[];\r\n /** color specification */\r\n colorDef?: ColorDef;\r\n /** function to run when user selects weight swatch */\r\n onLineWeightPick?: ((weight: number) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not */\r\n readonly?: boolean;\r\n /** hide the weight label */\r\n hideLabel?: boolean;\r\n /** Title to show at top of DropDown */\r\n dropDownTitle?: string;\r\n}\r\n\r\n/** @internal */\r\ninterface WeightPickerState {\r\n showPopup: boolean;\r\n targetElement: HTMLDivElement | null;\r\n}\r\n\r\n/** WeightPickerButton component\r\n * @public\r\n */\r\nexport class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {\r\n private _target = React.createRef<HTMLDivElement>();\r\n private _weightsContainer: HTMLDivElement | null = null;\r\n private _focusTarget = React.createRef<HTMLButtonElement>(); // weight button that should receive focus after popup is open\r\n\r\n /** @internal */\r\n constructor(props: WeightPickerProps) {\r\n super(props);\r\n\r\n this.state = { showPopup: false, targetElement: null };\r\n }\r\n\r\n public setFocus(): void {\r\n // istanbul ignore next\r\n this._focusTarget.current && this._focusTarget.current.focus();\r\n }\r\n\r\n public static defaultProps = {\r\n weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\r\n };\r\n\r\n private _togglePopup = () => {\r\n if (this.props.readonly)\r\n return;\r\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\r\n };\r\n\r\n private _onPopupOpened = () => {\r\n };\r\n\r\n private _closePopup = () => {\r\n this.setState((_prevState) => ({ showPopup: false }));\r\n };\r\n\r\n private _handleWeightPicked = (weight: number) => {\r\n this._closePopup();\r\n this.props.onLineWeightPick && this.props.onLineWeightPick(weight);\r\n };\r\n\r\n public override componentDidMount() {\r\n // eslint-disable-next-line no-console\r\n // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? \"set\" : \"unset\"}`);\r\n this.setState({ targetElement: this._target.current });\r\n }\r\n\r\n private buildIdForWeight(weight: number): string {\r\n return `ui-core-lineweight-${weight}`;\r\n }\r\n\r\n private moveFocusInPopup(moveUp: boolean, event: React.KeyboardEvent<any>) {\r\n const activeElement = document.activeElement;\r\n // istanbul ignore else\r\n if (this._weightsContainer && activeElement && activeElement.tagName === \"BUTTON\") {\r\n const values = activeElement.id.split(\"-\");\r\n // istanbul ignore else\r\n if (values.length === 4 && values[2] === \"lineweight\") {\r\n const weight = parseInt(values[3], 10);\r\n const foundIndex = this.props.weights.findIndex((val) => val === weight);\r\n // istanbul ignore next\r\n if (foundIndex < 0)\r\n return;\r\n\r\n const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :\r\n (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);\r\n\r\n const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`) as HTMLButtonElement;\r\n // istanbul ignore else\r\n if (focusLocation) {\r\n focusLocation.focus();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _handleKeyDown = (event: React.KeyboardEvent<any>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const weightButton = document.activeElement as HTMLElement;\r\n // istanbul ignore else\r\n if (weightButton.tagName === \"BUTTON\") {\r\n try {\r\n const values = weightButton.id.split(\"-\");\r\n // istanbul ignore else\r\n if (values.length) {\r\n const weight = parseInt(values[values.length - 1], 10);\r\n // istanbul ignore else\r\n if (!isNaN(weight)) {\r\n // istanbul ignore else\r\n if (this.props.onLineWeightPick)\r\n this.props.onLineWeightPick(weight);\r\n }\r\n }\r\n } catch { }\r\n }\r\n this._closePopup();\r\n } else {\r\n switch (event.key) {\r\n case SpecialKey.ArrowDown:\r\n this.moveFocusInPopup(false, event);\r\n break;\r\n case SpecialKey.ArrowUp:\r\n this.moveFocusInPopup(true, event);\r\n break;\r\n }\r\n }\r\n };\r\n\r\n private _setWeightContainer = (el: any) => {\r\n this._weightsContainer = el;\r\n };\r\n\r\n private renderPopup(title: string | undefined) {\r\n return (\r\n <div className=\"components-weightpicker-popup-container\">\r\n {title && <h4>{title}</h4>}\r\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\r\n <ul data-testid=\"components-weightpicker-popup-lines\" className=\"components-weightpicker-popup-lines\" onKeyDown={this._handleKeyDown} ref={this._setWeightContainer}>\r\n {this.props.weights.map((weight, index) => {\r\n const classNames = classnames(\r\n \"components-weightpicker-swatch\",\r\n weight === this.props.activeWeight && \"active\",\r\n );\r\n return (<LineWeightSwatch\r\n className={classNames}\r\n key={index}\r\n colorDef={this.props.colorDef}\r\n id={this.buildIdForWeight(weight)}\r\n hideLabel={this.props.hideLabel}\r\n onClick={this._handleWeightPicked.bind(this, weight)}\r\n weight={weight} />);\r\n })\r\n }\r\n </ul>\r\n </div>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const buttonClassNames = classnames(\r\n \"components-weightpicker-button\",\r\n this.props.className,\r\n );\r\n\r\n return (\r\n <>\r\n <div ref={this._target} style={this.props.style} >\r\n <LineWeightSwatch\r\n data-testid=\"components-weightpicker-button\"\r\n className={buttonClassNames}\r\n weight={this.props.activeWeight}\r\n colorDef={this.props.colorDef}\r\n readonly={this.props.readonly}\r\n disabled={this.props.disabled}\r\n hideLabel={this.props.hideLabel}\r\n aria-haspopup=\"listbox\"\r\n aria-expanded={this.state.showPopup}\r\n onClick={this._togglePopup} />\r\n </div>\r\n <ElementResizeObserver watchedElement={this.state.targetElement} render=\r\n {({ width }) => (\r\n <Popup\r\n className=\"components-weightpicker-popup\"\r\n style={{ width: `${width}px` }}\r\n isOpen={this.state.showPopup}\r\n position={RelativePosition.Bottom}\r\n offset={0}\r\n showShadow={false}\r\n onClose={this._closePopup}\r\n onOpen={this._onPopupOpened}\r\n focusTarget={`#${this.buildIdForWeight(this.props.activeWeight)}`}\r\n moveFocus={true}\r\n target={this.state.targetElement}\r\n closeOnNestedPopupOutsideClick\r\n >\r\n {this.renderPopup(this.props.dropDownTitle)}\r\n </Popup>\r\n )}\r\n />\r\n </>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"WeightPickerButton.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/lineweight/WeightPickerButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAe,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgC5C;;GAEG;AACH,MAAa,kBAAmB,SAAQ,KAAK,CAAC,aAAmD;IAK/F,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,YAAO,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC5C,sBAAiB,GAA0B,IAAI,CAAC;QAChD,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAqB,CAAC,CAAE,8DAA8D;QAkBpH,iBAAY,GAAG,GAAG,EAAE;YAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACrB,OAAO;YACT,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EA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C7B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,mBACjB,SAAS,mBACR,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,OAAO,EAAE,IAAI,CAAC,YAAY,GAAI,CAC5B;YACN,oBAAC,qBAAqB,IAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,EACpE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACd,oBAAC,KAAK,IACJ,SAAS,EAAC,+BAA+B,EACzC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EACjC,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,WAAW,EAAE,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,EACjE,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAChC,8BAA8B,UAE7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CACrC,CACT,GACD,CACD,CACJ,CAAC;IACJ,CAAC;;AAvKa,+BAAY,GAAG;IAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;CACzC,AAFyB,CAExB;SAnBS,kBAAkB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LineWeight\n */\n\nimport \"./WeightPickerButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps, ElementResizeObserver, Popup } from \"@itwin/core-react\";\nimport { LineWeightSwatch } from \"./Swatch\";\n\n// cSpell:ignore weightpicker lineweight\n\n/** Properties for the [[WeightPickerButton]] React component\n * @public\n */\nexport interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /** active weight */\n activeWeight: number;\n /** available weights */\n weights: number[];\n /** color specification */\n colorDef?: ColorDef;\n /** function to run when user selects weight swatch */\n onLineWeightPick?: ((weight: number) => void) | undefined;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not */\n readonly?: boolean;\n /** hide the weight label */\n hideLabel?: boolean;\n /** Title to show at top of DropDown */\n dropDownTitle?: string;\n}\n\n/** @internal */\ninterface WeightPickerState {\n showPopup: boolean;\n targetElement: HTMLDivElement | null;\n}\n\n/** WeightPickerButton component\n * @public\n */\nexport class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {\n private _target = React.createRef<HTMLDivElement>();\n private _weightsContainer: HTMLDivElement | null = null;\n private _focusTarget = React.createRef<HTMLButtonElement>(); // weight button that should receive focus after popup is open\n\n /** @internal */\n constructor(props: WeightPickerProps) {\n super(props);\n\n this.state = { showPopup: false, targetElement: null };\n }\n\n public setFocus(): void {\n // istanbul ignore next\n this._focusTarget.current && this._focusTarget.current.focus();\n }\n\n public static defaultProps = {\n weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n };\n\n private _togglePopup = () => {\n if (this.props.readonly)\n return;\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\n };\n\n private _onPopupOpened = () => {\n };\n\n private _closePopup = () => {\n this.setState((_prevState) => ({ showPopup: false }));\n };\n\n private _handleWeightPicked = (weight: number) => {\n this._closePopup();\n this.props.onLineWeightPick && this.props.onLineWeightPick(weight);\n };\n\n public override componentDidMount() {\n // eslint-disable-next-line no-console\n // console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? \"set\" : \"unset\"}`);\n this.setState({ targetElement: this._target.current });\n }\n\n private buildIdForWeight(weight: number): string {\n return `ui-core-lineweight-${weight}`;\n }\n\n private moveFocusInPopup(moveUp: boolean, event: React.KeyboardEvent<any>) {\n const activeElement = document.activeElement;\n // istanbul ignore else\n if (this._weightsContainer && activeElement && activeElement.tagName === \"BUTTON\") {\n const values = activeElement.id.split(\"-\");\n // istanbul ignore else\n if (values.length === 4 && values[2] === \"lineweight\") {\n const weight = parseInt(values[3], 10);\n const foundIndex = this.props.weights.findIndex((val) => val === weight);\n // istanbul ignore next\n if (foundIndex < 0)\n return;\n\n const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :\n (foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);\n\n const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`) as HTMLButtonElement;\n // istanbul ignore else\n if (focusLocation) {\n focusLocation.focus();\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }\n\n private _handleKeyDown = (event: React.KeyboardEvent<any>) => {\n if (event.key === SpecialKey.Enter) {\n event.preventDefault();\n event.stopPropagation();\n const weightButton = document.activeElement as HTMLElement;\n // istanbul ignore else\n if (weightButton.tagName === \"BUTTON\") {\n try {\n const values = weightButton.id.split(\"-\");\n // istanbul ignore else\n if (values.length) {\n const weight = parseInt(values[values.length - 1], 10);\n // istanbul ignore else\n if (!isNaN(weight)) {\n // istanbul ignore else\n if (this.props.onLineWeightPick)\n this.props.onLineWeightPick(weight);\n }\n }\n } catch { }\n }\n this._closePopup();\n } else {\n switch (event.key) {\n case SpecialKey.ArrowDown:\n this.moveFocusInPopup(false, event);\n break;\n case SpecialKey.ArrowUp:\n this.moveFocusInPopup(true, event);\n break;\n }\n }\n };\n\n private _setWeightContainer = (el: any) => {\n this._weightsContainer = el;\n };\n\n private renderPopup(title: string | undefined) {\n return (\n <div className=\"components-weightpicker-popup-container\">\n {title && <h4>{title}</h4>}\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <ul data-testid=\"components-weightpicker-popup-lines\" className=\"components-weightpicker-popup-lines\" onKeyDown={this._handleKeyDown} ref={this._setWeightContainer}>\n {this.props.weights.map((weight, index) => {\n const classNames = classnames(\n \"components-weightpicker-swatch\",\n weight === this.props.activeWeight && \"active\",\n );\n return (<LineWeightSwatch\n className={classNames}\n key={index}\n colorDef={this.props.colorDef}\n id={this.buildIdForWeight(weight)}\n hideLabel={this.props.hideLabel}\n onClick={this._handleWeightPicked.bind(this, weight)}\n weight={weight} />);\n })\n }\n </ul>\n </div>\n );\n }\n\n /** @internal */\n public override render() {\n const buttonClassNames = classnames(\n \"components-weightpicker-button\",\n this.props.className,\n );\n\n return (\n <>\n <div ref={this._target} style={this.props.style} >\n <LineWeightSwatch\n data-testid=\"components-weightpicker-button\"\n className={buttonClassNames}\n weight={this.props.activeWeight}\n colorDef={this.props.colorDef}\n readonly={this.props.readonly}\n disabled={this.props.disabled}\n hideLabel={this.props.hideLabel}\n aria-haspopup=\"listbox\"\n aria-expanded={this.state.showPopup}\n onClick={this._togglePopup} />\n </div>\n <ElementResizeObserver watchedElement={this.state.targetElement} render=\n {({ width }) => (\n <Popup\n className=\"components-weightpicker-popup\"\n style={{ width: `${width}px` }}\n isOpen={this.state.showPopup}\n position={RelativePosition.Bottom}\n offset={0}\n showShadow={false}\n onClose={this._closePopup}\n onOpen={this._onPopupOpened}\n focusTarget={`#${this.buildIdForWeight(this.props.activeWeight)}`}\n moveFocus={true}\n target={this.state.targetElement}\n closeOnNestedPopupOutsideClick\n >\n {this.renderPopup(this.props.dropDownTitle)}\n </Popup>\n )}\n />\n </>\n );\n }\n}\n"]}
@@ -1,51 +1,51 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
-
7
- .components-weightpicker-button {
8
- color: var(--iui-color-text);
9
- background: var(--iui-color-background);
10
- border: 1px solid var(--iui-color-border-foreground);
11
- border-radius: var(--iui-border-radius-1);
12
- min-width: 100px;
13
-
14
- &:not(.readonly):not([disabled]) {
15
- cursor: pointer;
16
- }
17
-
18
- &:active,
19
- &:focus {
20
- box-shadow: $buic-focus-boxshadow 0px 0px 0px 2px;
21
- }
22
- }
23
-
24
- .components-weightpicker-popup {
25
- &.core-popup {
26
- background: var(--iui-color-background);
27
- border: 1px solid var(--iui-color-border-foreground);
28
- }
29
-
30
- .components-weightpicker-popup-container {
31
- color: var(--iui-color-text);
32
- background: $buic-background-control;
33
- min-width: 60px;
34
- padding: 0 4px;
35
- border-radius: var(--iui-border-radius-1);
36
-
37
- > ul {
38
- padding: 4px 0;
39
- list-style: none;
40
- margin: 0.25rem 0;
41
-
42
- > .components-weightpicker-swatch:hover {
43
- background: $buic-row-hover;
44
- }
45
-
46
- > .components-weightpicker-swatch.active {
47
- background: $buic-row-selection;
48
- }
49
- }
50
- }
51
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
+
7
+ .components-weightpicker-button {
8
+ color: var(--iui-color-text);
9
+ background: var(--iui-color-background);
10
+ border: 1px solid var(--iui-color-border-foreground);
11
+ border-radius: var(--iui-border-radius-1);
12
+ min-width: 100px;
13
+
14
+ &:not(.readonly):not([disabled]) {
15
+ cursor: pointer;
16
+ }
17
+
18
+ &:active,
19
+ &:focus {
20
+ box-shadow: $buic-focus-boxshadow 0px 0px 0px 2px;
21
+ }
22
+ }
23
+
24
+ .components-weightpicker-popup {
25
+ &.core-popup {
26
+ background: var(--iui-color-background);
27
+ border: 1px solid var(--iui-color-border-foreground);
28
+ }
29
+
30
+ .components-weightpicker-popup-container {
31
+ color: var(--iui-color-text);
32
+ background: $buic-background-control;
33
+ min-width: 60px;
34
+ padding: 0 4px;
35
+ border-radius: var(--iui-border-radius-1);
36
+
37
+ > ul {
38
+ padding: 4px 0;
39
+ list-style: none;
40
+ margin: 0.25rem 0;
41
+
42
+ > .components-weightpicker-swatch:hover {
43
+ background: $buic-row-hover;
44
+ }
45
+
46
+ > .components-weightpicker-swatch.active {
47
+ background: $buic-row-selection;
48
+ }
49
+ }
50
+ }
51
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Cube.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/navigationaids/Cube.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD;;GAEG;AACH,MAAM,CAAN,IAAY,IAQX;AARD,WAAY,IAAI;IACd,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,yBAAiB,CAAA;IACjB,mBAAW,CAAA;AACb,CAAC,EARW,IAAI,KAAJ,IAAI,QAQf;AAUD;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAwB;IACtC,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE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CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACtC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,oDAAoD,EAAE,CAAC;SAC9G,CAAC;QACF,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACjD,MAAM,CAAC,GAAwB;YAC7B,SAAS;YACT,gEAAgE;YAChE,eAAe,EAAE,SAAS;YAC1B,GAAG,KAAK;SACT,CAAC;QAEF,OAAO,CACL,6BAAK,KAAK,EAAE,CAAC,iBACE,wBAAwB,IAAI,EAAE,EAC3C,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAC5D,KAAK,IACR,QAAQ,CACL,CACP,CAAC;IACJ,CAAC;IAEO,uBAAuB,CAAC,IAAU;QACxC,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,uBAAuB;QACvB,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI;YACpB,SAAS,GAAG,QAAQ,IAAI,EAAE,CAAC;QAE7B,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Cube\r\n */\r\n\r\nimport \"./Cube.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Matrix3d } from \"@itwin/core-geometry\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Cube Face enumeration\r\n * @public\r\n */\r\nexport enum Face {\r\n None = \"\",\r\n Left = \"left\",\r\n Right = \"right\",\r\n Back = \"back\",\r\n Front = \"front\",\r\n Bottom = \"bottom\",\r\n Top = \"top\",\r\n}\r\n\r\n/** Properties for the [[Cube]] React component\r\n * @public\r\n */\r\nexport interface CubeProps extends React.AllHTMLAttributes<HTMLDivElement>, CommonProps {\r\n faces?: { [key: string]: React.ReactNode };\r\n rotMatrix: Matrix3d;\r\n}\r\n\r\n/** Cube React component used by the 3d Cube Navigation Aid\r\n * @public\r\n */\r\nexport class Cube extends React.PureComponent<CubeProps> {\r\n public override render(): React.ReactNode {\r\n const { faces, rotMatrix, className, ...props } = this.props;\r\n return (\r\n <div className={classnames(\"components-cube-css3d\", className)} data-testid=\"components-cube\" {...props}>\r\n {[Face.Front, Face.Back, Face.Right, Face.Left, Face.Top, Face.Bottom]\r\n .map((face: Face) => {\r\n const content = faces && faces[face];\r\n return (\r\n <CubeFace\r\n key={face}\r\n rotMatrix={rotMatrix}\r\n face={face}>\r\n {content}\r\n </CubeFace>\r\n );\r\n })}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface CubeFaceProps extends React.AllHTMLAttributes<HTMLDivElement> {\r\n rotMatrix: Matrix3d;\r\n face: Face;\r\n}\r\n\r\n/** @internal */\r\nexport class CubeFace extends React.Component<CubeFaceProps> {\r\n private _faceWidth: number = 0;\r\n public override render(): React.ReactNode {\r\n const { rotMatrix, face, style, children, ...props } = this.props;\r\n if (face === Face.None)\r\n return null;\r\n const classes = classnames(\"face\", this.getCSSClassNameFromFace(face));\r\n // orient face (flip because of y axis reversal, rotate as necessary)\r\n let reorient: Matrix3d = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, 1);\r\n // Position face correctly (applies to rotation, as well as translation)\r\n let reposition: Matrix3d = Matrix3d.createIdentity();\r\n switch (this.props.face) {\r\n case Face.Bottom:\r\n reposition = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, -1);\r\n reorient = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, 1);\r\n break;\r\n case Face.Right:\r\n reposition = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);\r\n reorient = Matrix3d.createRowValues(0, 1, 0, 1, 0, 0, 0, 0, 1);\r\n break;\r\n case Face.Left:\r\n reposition = Matrix3d.createRowValues(0, 0, -1, 0, 1, 0, 1, 0, 0);\r\n reorient = Matrix3d.createRowValues(0, -1, 0, -1, 0, 0, 0, 0, 1);\r\n break;\r\n case Face.Back:\r\n reposition = Matrix3d.createRowValues(1, 0, 0, 0, 0, 1, 0, -1, 0);\r\n reorient = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, 1);\r\n break;\r\n case Face.Front:\r\n reposition = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);\r\n reorient = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, 1);\r\n break;\r\n }\r\n const repositioned = rotMatrix.multiplyMatrixMatrix(reposition);\r\n const vect = repositioned.multiplyXYZ(0, 0, this._faceWidth);\r\n const m = repositioned.multiplyMatrixMatrix(reorient);\r\n const list = [\r\n m.at(0, 0), -m.at(1, 0), m.at(2, 0), 0,\r\n m.at(0, 1), -m.at(1, 1), m.at(2, 1), 0,\r\n m.at(0, 2), -m.at(1, 2), m.at(2, 2), 0,\r\n vect.at(0), -vect.at(1), vect.at(2) - this._faceWidth /* move back faceWidth so face is on screen level */, 1,\r\n ];\r\n const transform = `matrix3d(${list.join(\", \")})`;\r\n const s: React.CSSProperties = {\r\n transform,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n WebkitTransform: transform,\r\n ...style,\r\n };\r\n\r\n return (\r\n <div style={s}\r\n data-testid={`components-cube-face-${face}`}\r\n className={classes}\r\n ref={(e) => { this._faceWidth = (e && e.clientWidth / 2) || 0; }}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n }\r\n\r\n private getCSSClassNameFromFace(face: Face): string {\r\n let className = \"\";\r\n\r\n // istanbul ignore else\r\n if (face !== Face.None)\r\n className = `cube-${face}`;\r\n\r\n return className;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Cube.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/navigationaids/Cube.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD;;GAEG;AACH,MAAM,CAAN,IAAY,IAQX;AARD,WAAY,IAAI;IACd,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,yBAAiB,CAAA;IACjB,mBAAW,CAAA;AACb,CAAC,EARW,IAAI,KAAJ,IAAI,QAQf;AAUD;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAwB;IACtC,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7D,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,SAAS,CAAC,iBAAc,iBAAiB,KAAK,KAAK,IACpG,CAAC,IAAI,CAAC,KAAK,EAAE,IAA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EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,oDAAoD,EAAE,CAAC;SAC9G,CAAC;QACF,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACjD,MAAM,CAAC,GAAwB;YAC7B,SAAS;YACT,gEAAgE;YAChE,eAAe,EAAE,SAAS;YAC1B,GAAG,KAAK;SACT,CAAC;QAEF,OAAO,CACL,6BAAK,KAAK,EAAE,CAAC,iBACE,wBAAwB,IAAI,EAAE,EAC3C,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAC5D,KAAK,IACR,QAAQ,CACL,CACP,CAAC;IACJ,CAAC;IAEO,uBAAuB,CAAC,IAAU;QACxC,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,uBAAuB;QACvB,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI;YACpB,SAAS,GAAG,QAAQ,IAAI,EAAE,CAAC;QAE7B,OAAO,SAAS,CAAC;IACnB,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 Cube\n */\n\nimport \"./Cube.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Matrix3d } from \"@itwin/core-geometry\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n/** Cube Face enumeration\n * @public\n */\nexport enum Face {\n None = \"\",\n Left = \"left\",\n Right = \"right\",\n Back = \"back\",\n Front = \"front\",\n Bottom = \"bottom\",\n Top = \"top\",\n}\n\n/** Properties for the [[Cube]] React component\n * @public\n */\nexport interface CubeProps extends React.AllHTMLAttributes<HTMLDivElement>, CommonProps {\n faces?: { [key: string]: React.ReactNode };\n rotMatrix: Matrix3d;\n}\n\n/** Cube React component used by the 3d Cube Navigation Aid\n * @public\n */\nexport class Cube extends React.PureComponent<CubeProps> {\n public override render(): React.ReactNode {\n const { faces, rotMatrix, className, ...props } = this.props;\n return (\n <div className={classnames(\"components-cube-css3d\", className)} data-testid=\"components-cube\" {...props}>\n {[Face.Front, Face.Back, Face.Right, Face.Left, Face.Top, Face.Bottom]\n .map((face: Face) => {\n const content = faces && faces[face];\n return (\n <CubeFace\n key={face}\n rotMatrix={rotMatrix}\n face={face}>\n {content}\n </CubeFace>\n );\n })}\n </div>\n );\n }\n}\n\n/** @internal */\nexport interface CubeFaceProps extends React.AllHTMLAttributes<HTMLDivElement> {\n rotMatrix: Matrix3d;\n face: Face;\n}\n\n/** @internal */\nexport class CubeFace extends React.Component<CubeFaceProps> {\n private _faceWidth: number = 0;\n public override render(): React.ReactNode {\n const { rotMatrix, face, style, children, ...props } = this.props;\n if (face === Face.None)\n return null;\n const classes = classnames(\"face\", this.getCSSClassNameFromFace(face));\n // orient face (flip because of y axis reversal, rotate as necessary)\n let reorient: Matrix3d = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, 1);\n // Position face correctly (applies to rotation, as well as translation)\n let reposition: Matrix3d = Matrix3d.createIdentity();\n switch (this.props.face) {\n case Face.Bottom:\n reposition = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, -1);\n reorient = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, 1);\n break;\n case Face.Right:\n reposition = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);\n reorient = Matrix3d.createRowValues(0, 1, 0, 1, 0, 0, 0, 0, 1);\n break;\n case Face.Left:\n reposition = Matrix3d.createRowValues(0, 0, -1, 0, 1, 0, 1, 0, 0);\n reorient = Matrix3d.createRowValues(0, -1, 0, -1, 0, 0, 0, 0, 1);\n break;\n case Face.Back:\n reposition = Matrix3d.createRowValues(1, 0, 0, 0, 0, 1, 0, -1, 0);\n reorient = Matrix3d.createRowValues(-1, 0, 0, 0, 1, 0, 0, 0, 1);\n break;\n case Face.Front:\n reposition = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);\n reorient = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, 1);\n break;\n }\n const repositioned = rotMatrix.multiplyMatrixMatrix(reposition);\n const vect = repositioned.multiplyXYZ(0, 0, this._faceWidth);\n const m = repositioned.multiplyMatrixMatrix(reorient);\n const list = [\n m.at(0, 0), -m.at(1, 0), m.at(2, 0), 0,\n m.at(0, 1), -m.at(1, 1), m.at(2, 1), 0,\n m.at(0, 2), -m.at(1, 2), m.at(2, 2), 0,\n vect.at(0), -vect.at(1), vect.at(2) - this._faceWidth /* move back faceWidth so face is on screen level */, 1,\n ];\n const transform = `matrix3d(${list.join(\", \")})`;\n const s: React.CSSProperties = {\n transform,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n WebkitTransform: transform,\n ...style,\n };\n\n return (\n <div style={s}\n data-testid={`components-cube-face-${face}`}\n className={classes}\n ref={(e) => { this._faceWidth = (e && e.clientWidth / 2) || 0; }}\n {...props}>\n {children}\n </div>\n );\n }\n\n private getCSSClassNameFromFace(face: Face): string {\n let className = \"\";\n\n // istanbul ignore else\n if (face !== Face.None)\n className = `cube-${face}`;\n\n return className;\n }\n}\n"]}
@@ -1,19 +1,19 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- $cube-width: 128px;
6
- $cube-side-width: 12px;
7
-
8
- .components-cube-css3d {
9
- width: $cube-width;
10
- height: $cube-width;
11
- perspective: 300px;
12
- transform-style: preserve-3d;
13
- .face {
14
- width: 100%;
15
- height: 100%;
16
- position: absolute;
17
- backface-visibility: inherit;
18
- }
19
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ $cube-width: 128px;
6
+ $cube-side-width: 12px;
7
+
8
+ .components-cube-css3d {
9
+ width: $cube-width;
10
+ height: $cube-width;
11
+ perspective: 300px;
12
+ transform-style: preserve-3d;
13
+ .face {
14
+ width: 100%;
15
+ height: 100%;
16
+ position: absolute;
17
+ backface-visibility: inherit;
18
+ }
19
+ }
@@ -13,39 +13,18 @@ export declare enum CubeNavigationHitBoxX {
13
13
  Right = 1,
14
14
  Left = -1
15
15
  }
16
- /** @internal
17
- * @deprecated in 2.x. Use [[CubeNavigationHitBoxX]] */
18
- export declare enum HitBoxX {
19
- None = 0,
20
- Right = 1,
21
- Left = -1
22
- }
23
16
  /** @public */
24
17
  export declare enum CubeNavigationHitBoxY {
25
18
  None = 0,
26
19
  Back = 1,
27
20
  Front = -1
28
21
  }
29
- /** @internal
30
- * @deprecated in 2.x. Use [[CubeNavigationHitBoxY]] */
31
- export declare enum HitBoxY {
32
- None = 0,
33
- Back = 1,
34
- Front = -1
35
- }
36
22
  /** @public */
37
23
  export declare enum CubeNavigationHitBoxZ {
38
24
  None = 0,
39
25
  Top = 1,
40
26
  Bottom = -1
41
27
  }
42
- /** @internal
43
- * @deprecated in 2.x. [[CubeNavigationHitBoxZ]] */
44
- export declare enum HitBoxZ {
45
- None = 0,
46
- Top = 1,
47
- Bottom = -1
48
- }
49
28
  /** @internal */
50
29
  export declare enum CubeHover {
51
30
  None = 0,
@@ -1 +1 @@
1
- {"version":3,"file":"CubeNavigationAid.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/navigationaids/CubeNavigationAid.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyC,QAAQ,EAAqB,QAAQ,EAAU,MAAM,sBAAsB,CAAC;AAC5H,OAAO,EAAa,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EAAQ,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGpC,cAAc;AACd,oBAAY,qBAAqB;IAC/B,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,KAAK;CACV;AACD;uDACuD;AACvD,oBAAY,OAAO;IACjB,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,KAAK;CACV;AAED,cAAc;AACd,oBAAY,qBAAqB;IAC/B,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,KAAK;CACX;AACD;uDACuD;AACvD,oBAAY,OAAO;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,KAAK;CACX;AAED,cAAc;AACd,oBAAY,qBAAqB;IAC/B,IAAI,IAAI;IACR,GAAG,IAAI;IACP,MAAM,KAAK;CACZ;AACD;mDACmD;AACnD,oBAAY,OAAO;IACjB,IAAI,IAAI;IACR,GAAG,IAAI;IACP,MAAM,KAAK;CACZ;AAwCD,gBAAgB;AAChB,oBAAY,SAAS;IACnB,IAAI,IAAI;IACR,KAAK,IAAA;IACL,MAAM,IAAA;CACP;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAIpB,gBAAgB;IAChB,cAAc,CAAC,EAAE,MA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
23
23
  CubeNavigationHitBoxX[CubeNavigationHitBoxX["Left"] = -1] = "Left";
24
24
  })(CubeNavigationHitBoxX || (CubeNavigationHitBoxX = {}));
25
- /** @internal
26
- * @deprecated in 2.x. Use [[CubeNavigationHitBoxX]] */
27
- export var HitBoxX;
28
- (function (HitBoxX) {
29
- HitBoxX[HitBoxX["None"] = 0] = "None";
30
- HitBoxX[HitBoxX["Right"] = 1] = "Right";
31
- HitBoxX[HitBoxX["Left"] = -1] = "Left";
32
- })(HitBoxX || (HitBoxX = {}));
33
25
  /** @public */
34
26
  export var CubeNavigationHitBoxY;
35
27
  (function (CubeNavigationHitBoxY) {
@@ -37,14 +29,6 @@ export var CubeNavigationHitBoxY;
37
29
  CubeNavigationHitBoxY[CubeNavigationHitBoxY["Back"] = 1] = "Back";
38
30
  CubeNavigationHitBoxY[CubeNavigationHitBoxY["Front"] = -1] = "Front";
39
31
  })(CubeNavigationHitBoxY || (CubeNavigationHitBoxY = {}));
40
- /** @internal
41
- * @deprecated in 2.x. Use [[CubeNavigationHitBoxY]] */
42
- export var HitBoxY;
43
- (function (HitBoxY) {
44
- HitBoxY[HitBoxY["None"] = 0] = "None";
45
- HitBoxY[HitBoxY["Back"] = 1] = "Back";
46
- HitBoxY[HitBoxY["Front"] = -1] = "Front";
47
- })(HitBoxY || (HitBoxY = {}));
48
32
  /** @public */
49
33
  export var CubeNavigationHitBoxZ;
50
34
  (function (CubeNavigationHitBoxZ) {
@@ -52,14 +36,6 @@ export var CubeNavigationHitBoxZ;
52
36
  CubeNavigationHitBoxZ[CubeNavigationHitBoxZ["Top"] = 1] = "Top";
53
37
  CubeNavigationHitBoxZ[CubeNavigationHitBoxZ["Bottom"] = -1] = "Bottom";
54
38
  })(CubeNavigationHitBoxZ || (CubeNavigationHitBoxZ = {}));
55
- /** @internal
56
- * @deprecated in 2.x. [[CubeNavigationHitBoxZ]] */
57
- export var HitBoxZ;
58
- (function (HitBoxZ) {
59
- HitBoxZ[HitBoxZ["None"] = 0] = "None";
60
- HitBoxZ[HitBoxZ["Top"] = 1] = "Top";
61
- HitBoxZ[HitBoxZ["Bottom"] = -1] = "Bottom";
62
- })(HitBoxZ || (HitBoxZ = {}));
63
39
  const cubeNavigationFaceLocs = {
64
40
  [Face.Left]: Vector3d.create(CubeNavigationHitBoxX.Left, CubeNavigationHitBoxY.None, CubeNavigationHitBoxZ.None),
65
41
  [Face.Right]: Vector3d.create(CubeNavigationHitBoxX.Right, CubeNavigationHitBoxY.None, CubeNavigationHitBoxZ.None),