@itwin/imodel-components-react 3.7.17 → 3.8.0
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.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js +186 -186
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -74
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +145 -145
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -96
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +265 -265
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +176 -176
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +673 -673
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -53
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +83 -83
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +86 -86
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +109 -109
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +184 -184
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +154 -154
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +59 -59
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +47 -47
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +54 -54
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +48 -48
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +50 -50
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +58 -58
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +47 -47
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +56 -56
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +95 -95
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +119 -119
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +143 -143
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
- package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +387 -387
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +185 -185
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -274
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/cjs/imodel-components-react.d.ts +82 -82
- package/lib/cjs/imodel-components-react.js +101 -101
- package/lib/cjs/imodel-components-react.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
- package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -75
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +93 -93
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
- package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
- package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
- package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
- package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
- package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
- package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
- package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
- package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
- package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +176 -176
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +645 -645
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +60 -60
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +131 -131
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -139
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
- package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +361 -361
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +185 -185
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -95
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/esm/imodel-components-react.d.ts +82 -82
- package/lib/esm/imodel-components-react.js +87 -87
- package/lib/esm/imodel-components-react.js.map +1 -1
- package/lib/public/locales/en/UiIModelComponents.json +139 -139
- package/package.json +19 -19
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Color
|
|
3
|
-
*/
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { ColorDef } from "@itwin/core-common";
|
|
6
|
-
import { RelativePosition } from "@itwin/appui-abstract";
|
|
7
|
-
import { CommonProps } from "@itwin/core-react";
|
|
8
|
-
import "./ColorPickerPopup.scss";
|
|
9
|
-
/** Properties for the [[ColorPickerPopup]] React component
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
13
|
-
/** Current color */
|
|
14
|
-
initialColor: ColorDef;
|
|
15
|
-
/** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.
|
|
16
|
-
* Displayed in rows of 9 items */
|
|
17
|
-
colorDefs?: ColorDef[];
|
|
18
|
-
/** Function to call when the color value is changed */
|
|
19
|
-
onColorChange?: ((newColor: ColorDef) => void) | undefined;
|
|
20
|
-
/** Function to call when the popup is closed */
|
|
21
|
-
onClose?: ((colorValue: ColorDef) => void) | undefined;
|
|
22
|
-
/** Disabled or not */
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
/** Readonly or not, color displayed on button but button will not trigger pop-up */
|
|
25
|
-
readonly?: boolean;
|
|
26
|
-
/** popup position. If not set RelativePosition.BottomLeft is used */
|
|
27
|
-
popupPosition?: RelativePosition;
|
|
28
|
-
/** Provides ability to return reference to HTMLButtonElement */
|
|
29
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
30
|
-
/** If true show up/down caret next to color */
|
|
31
|
-
showCaret?: boolean;
|
|
32
|
-
/** If true, don't propagate clicks out of the ColorPicker */
|
|
33
|
-
captureClicks?: boolean;
|
|
34
|
-
/** If true, don't show close button at top */
|
|
35
|
-
hideCloseButton?: boolean;
|
|
36
|
-
/** If set show input values */
|
|
37
|
-
colorInputType?: "hsl" | "rgb" | "hex";
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
|
|
41
|
-
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export declare const ColorPickerPopup: (props: ColorPickerPopupProps) => React.JSX.Element | null;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { ColorDef } from "@itwin/core-common";
|
|
6
|
+
import { RelativePosition } from "@itwin/appui-abstract";
|
|
7
|
+
import { CommonProps } from "@itwin/core-react";
|
|
8
|
+
import "./ColorPickerPopup.scss";
|
|
9
|
+
/** Properties for the [[ColorPickerPopup]] React component
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
13
|
+
/** Current color */
|
|
14
|
+
initialColor: ColorDef;
|
|
15
|
+
/** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.
|
|
16
|
+
* Displayed in rows of 9 items */
|
|
17
|
+
colorDefs?: ColorDef[];
|
|
18
|
+
/** Function to call when the color value is changed */
|
|
19
|
+
onColorChange?: ((newColor: ColorDef) => void) | undefined;
|
|
20
|
+
/** Function to call when the popup is closed */
|
|
21
|
+
onClose?: ((colorValue: ColorDef) => void) | undefined;
|
|
22
|
+
/** Disabled or not */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Readonly or not, color displayed on button but button will not trigger pop-up */
|
|
25
|
+
readonly?: boolean;
|
|
26
|
+
/** popup position. If not set RelativePosition.BottomLeft is used */
|
|
27
|
+
popupPosition?: RelativePosition;
|
|
28
|
+
/** Provides ability to return reference to HTMLButtonElement */
|
|
29
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
30
|
+
/** If true show up/down caret next to color */
|
|
31
|
+
showCaret?: boolean;
|
|
32
|
+
/** If true, don't propagate clicks out of the ColorPicker */
|
|
33
|
+
captureClicks?: boolean;
|
|
34
|
+
/** If true, don't show close button at top */
|
|
35
|
+
hideCloseButton?: boolean;
|
|
36
|
+
/** If set show input values */
|
|
37
|
+
colorInputType?: "hsl" | "rgb" | "hex";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
|
|
41
|
+
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare const ColorPickerPopup: (props: ColorPickerPopupProps) => React.JSX.Element | null;
|
|
45
45
|
//# sourceMappingURL=ColorPickerPopup.d.ts.map
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Color
|
|
7
|
-
*/
|
|
8
|
-
// cSpell:ignore colorpicker
|
|
9
|
-
import * as React from "react";
|
|
10
|
-
import classnames from "classnames";
|
|
11
|
-
import { ColorByName, ColorDef } from "@itwin/core-common";
|
|
12
|
-
import { RelativePosition } from "@itwin/appui-abstract";
|
|
13
|
-
import { Popup, useRefs, WebFontIcon } from "@itwin/core-react";
|
|
14
|
-
// import { ColorPickerPanel } from "./ColorPickerPanel";
|
|
15
|
-
import { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from "@itwin/itwinui-react";
|
|
16
|
-
import "./ColorPickerPopup.scss";
|
|
17
|
-
import { getCSSColorFromDef } from "./getCSSColorFromDef";
|
|
18
|
-
import { UiIModelComponents } from "../UiIModelComponents";
|
|
19
|
-
// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted
|
|
20
|
-
const ForwardRefColorPickerPopup = React.forwardRef(function ForwardRefColorPickerPopup(props, ref) {
|
|
21
|
-
const target = React.useRef(null);
|
|
22
|
-
const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
|
|
23
|
-
const [showPopup, setShowPopup] = React.useState(false);
|
|
24
|
-
const [colorDef, setColorDef] = React.useState(props.initialColor);
|
|
25
|
-
const initialColorRef = React.useRef(props.initialColor);
|
|
26
|
-
React.useEffect(() => {
|
|
27
|
-
if (props.initialColor !== initialColorRef.current) {
|
|
28
|
-
initialColorRef.current = props.initialColor;
|
|
29
|
-
setColorDef(props.initialColor);
|
|
30
|
-
}
|
|
31
|
-
}, [props.initialColor]);
|
|
32
|
-
const defaultColors = React.useRef([
|
|
33
|
-
ColorValue.fromTbgr(ColorByName.red),
|
|
34
|
-
ColorValue.fromTbgr(ColorByName.orange),
|
|
35
|
-
ColorValue.fromTbgr(ColorByName.yellow),
|
|
36
|
-
ColorValue.fromTbgr(ColorByName.green),
|
|
37
|
-
ColorValue.fromTbgr(ColorByName.blue),
|
|
38
|
-
ColorValue.fromTbgr(ColorByName.mediumBlue),
|
|
39
|
-
ColorValue.fromTbgr(ColorByName.indigo),
|
|
40
|
-
ColorValue.fromTbgr(ColorByName.violet),
|
|
41
|
-
ColorValue.fromTbgr(ColorByName.black),
|
|
42
|
-
ColorValue.fromTbgr(ColorByName.white),
|
|
43
|
-
ColorValue.fromTbgr(ColorByName.cyan),
|
|
44
|
-
ColorValue.fromTbgr(ColorByName.fuchsia),
|
|
45
|
-
ColorValue.fromTbgr(ColorByName.tan),
|
|
46
|
-
ColorValue.fromTbgr(ColorByName.gray),
|
|
47
|
-
ColorValue.fromTbgr(ColorByName.brown),
|
|
48
|
-
ColorValue.fromTbgr(ColorByName.purple),
|
|
49
|
-
ColorValue.fromTbgr(ColorByName.olive),
|
|
50
|
-
ColorValue.fromTbgr(ColorByName.darkGreen),
|
|
51
|
-
]);
|
|
52
|
-
// istanbul ignore next
|
|
53
|
-
const closePopup = React.useCallback(() => {
|
|
54
|
-
props.onClose && props.onClose(colorDef);
|
|
55
|
-
setShowPopup(false);
|
|
56
|
-
}, [colorDef, props]);
|
|
57
|
-
const togglePopup = React.useCallback(() => {
|
|
58
|
-
setShowPopup(!showPopup);
|
|
59
|
-
}, [showPopup]);
|
|
60
|
-
const handleColorChanged = React.useCallback((newColorValue) => {
|
|
61
|
-
const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());
|
|
62
|
-
// istanbul ignore else
|
|
63
|
-
if (!newColor.equals(colorDef)) {
|
|
64
|
-
setColorDef(newColor);
|
|
65
|
-
// istanbul ignore else
|
|
66
|
-
props.onColorChange && props.onColorChange(newColor);
|
|
67
|
-
}
|
|
68
|
-
}, [colorDef, props]);
|
|
69
|
-
const rgbaString = getCSSColorFromDef(colorDef);
|
|
70
|
-
const buttonStyle = { ...props.style };
|
|
71
|
-
const swatchStyle = { backgroundColor: rgbaString };
|
|
72
|
-
const buttonClassNames = classnames("components-colorpicker-popup-button", props.readonly && "readonly", props.className);
|
|
73
|
-
const clickHandler = (event) => {
|
|
74
|
-
// istanbul ignore else
|
|
75
|
-
if (props.captureClicks)
|
|
76
|
-
event.stopPropagation();
|
|
77
|
-
};
|
|
78
|
-
const colorOptions = React.useMemo(() => {
|
|
79
|
-
if (props.colorDefs && props.colorDefs.length) {
|
|
80
|
-
return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));
|
|
81
|
-
}
|
|
82
|
-
if (props.colorDefs && 0 === props.colorDefs.length)
|
|
83
|
-
return undefined;
|
|
84
|
-
return defaultColors.current;
|
|
85
|
-
}, [props.colorDefs]);
|
|
86
|
-
const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;
|
|
87
|
-
const [closeLabel] = React.useState(() => UiIModelComponents.translate("color.close"));
|
|
88
|
-
const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate("color.toggleColorPopup"));
|
|
89
|
-
return (
|
|
90
|
-
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
|
91
|
-
React.createElement("div", { onClick: clickHandler },
|
|
92
|
-
React.createElement("button", { "data-testid": "components-colorpicker-popup-button", onClick: togglePopup, className: buttonClassNames, style: buttonStyle, disabled: props.disabled, ref: refs, title: togglePopupLabel },
|
|
93
|
-
React.createElement("div", { className: "components-colorpicker-button-container" },
|
|
94
|
-
React.createElement("div", { className: "components-colorpicker-button-color-swatch", style: swatchStyle }),
|
|
95
|
-
props.showCaret && React.createElement(WebFontIcon, { className: "components-caret", iconName: showPopup ? "icon-caret-up" : "icon-caret-down", iconSize: "x-small" }))),
|
|
96
|
-
React.createElement(Popup, { className: "components-colorpicker-popup", isOpen: showPopup, position: popupPosition, onClose: closePopup, target: target.current, closeOnNestedPopupOutsideClick: true },
|
|
97
|
-
React.createElement("div", { className: "components-colorpicker-popup-panel-padding" },
|
|
98
|
-
!props.hideCloseButton &&
|
|
99
|
-
React.createElement("button", { title: closeLabel, className: "core-focus-trap-ignore-initial core-dialog-close icon icon-close", "data-testid": "core-dialog-close", onClick: togglePopup }),
|
|
100
|
-
React.createElement(ColorPicker, { selectedColor: ColorValue.fromTbgr(colorDef.tbgr), onChangeComplete: handleColorChanged },
|
|
101
|
-
React.createElement(ColorBuilder, null),
|
|
102
|
-
props.colorInputType &&
|
|
103
|
-
React.createElement(ColorInputPanel, { defaultColorFormat: props.colorInputType }),
|
|
104
|
-
colorOptions &&
|
|
105
|
-
React.createElement(ColorPalette, { colors: colorOptions }))))));
|
|
106
|
-
});
|
|
107
|
-
/**
|
|
108
|
-
* ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
|
|
109
|
-
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
110
|
-
* @public
|
|
111
|
-
*/
|
|
112
|
-
export const ColorPickerPopup = ForwardRefColorPickerPopup;
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Color
|
|
7
|
+
*/
|
|
8
|
+
// cSpell:ignore colorpicker
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import classnames from "classnames";
|
|
11
|
+
import { ColorByName, ColorDef } from "@itwin/core-common";
|
|
12
|
+
import { RelativePosition } from "@itwin/appui-abstract";
|
|
13
|
+
import { Popup, useRefs, WebFontIcon } from "@itwin/core-react";
|
|
14
|
+
// import { ColorPickerPanel } from "./ColorPickerPanel";
|
|
15
|
+
import { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from "@itwin/itwinui-react";
|
|
16
|
+
import "./ColorPickerPopup.scss";
|
|
17
|
+
import { getCSSColorFromDef } from "./getCSSColorFromDef";
|
|
18
|
+
import { UiIModelComponents } from "../UiIModelComponents";
|
|
19
|
+
// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted
|
|
20
|
+
const ForwardRefColorPickerPopup = React.forwardRef(function ForwardRefColorPickerPopup(props, ref) {
|
|
21
|
+
const target = React.useRef(null);
|
|
22
|
+
const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
|
|
23
|
+
const [showPopup, setShowPopup] = React.useState(false);
|
|
24
|
+
const [colorDef, setColorDef] = React.useState(props.initialColor);
|
|
25
|
+
const initialColorRef = React.useRef(props.initialColor);
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (props.initialColor !== initialColorRef.current) {
|
|
28
|
+
initialColorRef.current = props.initialColor;
|
|
29
|
+
setColorDef(props.initialColor);
|
|
30
|
+
}
|
|
31
|
+
}, [props.initialColor]);
|
|
32
|
+
const defaultColors = React.useRef([
|
|
33
|
+
ColorValue.fromTbgr(ColorByName.red),
|
|
34
|
+
ColorValue.fromTbgr(ColorByName.orange),
|
|
35
|
+
ColorValue.fromTbgr(ColorByName.yellow),
|
|
36
|
+
ColorValue.fromTbgr(ColorByName.green),
|
|
37
|
+
ColorValue.fromTbgr(ColorByName.blue),
|
|
38
|
+
ColorValue.fromTbgr(ColorByName.mediumBlue),
|
|
39
|
+
ColorValue.fromTbgr(ColorByName.indigo),
|
|
40
|
+
ColorValue.fromTbgr(ColorByName.violet),
|
|
41
|
+
ColorValue.fromTbgr(ColorByName.black),
|
|
42
|
+
ColorValue.fromTbgr(ColorByName.white),
|
|
43
|
+
ColorValue.fromTbgr(ColorByName.cyan),
|
|
44
|
+
ColorValue.fromTbgr(ColorByName.fuchsia),
|
|
45
|
+
ColorValue.fromTbgr(ColorByName.tan),
|
|
46
|
+
ColorValue.fromTbgr(ColorByName.gray),
|
|
47
|
+
ColorValue.fromTbgr(ColorByName.brown),
|
|
48
|
+
ColorValue.fromTbgr(ColorByName.purple),
|
|
49
|
+
ColorValue.fromTbgr(ColorByName.olive),
|
|
50
|
+
ColorValue.fromTbgr(ColorByName.darkGreen),
|
|
51
|
+
]);
|
|
52
|
+
// istanbul ignore next
|
|
53
|
+
const closePopup = React.useCallback(() => {
|
|
54
|
+
props.onClose && props.onClose(colorDef);
|
|
55
|
+
setShowPopup(false);
|
|
56
|
+
}, [colorDef, props]);
|
|
57
|
+
const togglePopup = React.useCallback(() => {
|
|
58
|
+
setShowPopup(!showPopup);
|
|
59
|
+
}, [showPopup]);
|
|
60
|
+
const handleColorChanged = React.useCallback((newColorValue) => {
|
|
61
|
+
const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());
|
|
62
|
+
// istanbul ignore else
|
|
63
|
+
if (!newColor.equals(colorDef)) {
|
|
64
|
+
setColorDef(newColor);
|
|
65
|
+
// istanbul ignore else
|
|
66
|
+
props.onColorChange && props.onColorChange(newColor);
|
|
67
|
+
}
|
|
68
|
+
}, [colorDef, props]);
|
|
69
|
+
const rgbaString = getCSSColorFromDef(colorDef);
|
|
70
|
+
const buttonStyle = { ...props.style };
|
|
71
|
+
const swatchStyle = { backgroundColor: rgbaString };
|
|
72
|
+
const buttonClassNames = classnames("components-colorpicker-popup-button", props.readonly && "readonly", props.className);
|
|
73
|
+
const clickHandler = (event) => {
|
|
74
|
+
// istanbul ignore else
|
|
75
|
+
if (props.captureClicks)
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
};
|
|
78
|
+
const colorOptions = React.useMemo(() => {
|
|
79
|
+
if (props.colorDefs && props.colorDefs.length) {
|
|
80
|
+
return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));
|
|
81
|
+
}
|
|
82
|
+
if (props.colorDefs && 0 === props.colorDefs.length)
|
|
83
|
+
return undefined;
|
|
84
|
+
return defaultColors.current;
|
|
85
|
+
}, [props.colorDefs]);
|
|
86
|
+
const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;
|
|
87
|
+
const [closeLabel] = React.useState(() => UiIModelComponents.translate("color.close"));
|
|
88
|
+
const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate("color.toggleColorPopup"));
|
|
89
|
+
return (
|
|
90
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
|
91
|
+
React.createElement("div", { onClick: clickHandler },
|
|
92
|
+
React.createElement("button", { "data-testid": "components-colorpicker-popup-button", onClick: togglePopup, className: buttonClassNames, style: buttonStyle, disabled: props.disabled, ref: refs, title: togglePopupLabel },
|
|
93
|
+
React.createElement("div", { className: "components-colorpicker-button-container" },
|
|
94
|
+
React.createElement("div", { className: "components-colorpicker-button-color-swatch", style: swatchStyle }),
|
|
95
|
+
props.showCaret && React.createElement(WebFontIcon, { className: "components-caret", iconName: showPopup ? "icon-caret-up" : "icon-caret-down", iconSize: "x-small" }))),
|
|
96
|
+
React.createElement(Popup, { className: "components-colorpicker-popup", isOpen: showPopup, position: popupPosition, onClose: closePopup, target: target.current, closeOnNestedPopupOutsideClick: true },
|
|
97
|
+
React.createElement("div", { className: "components-colorpicker-popup-panel-padding" },
|
|
98
|
+
!props.hideCloseButton &&
|
|
99
|
+
React.createElement("button", { title: closeLabel, className: "core-focus-trap-ignore-initial core-dialog-close icon icon-close", "data-testid": "core-dialog-close", onClick: togglePopup }),
|
|
100
|
+
React.createElement(ColorPicker, { selectedColor: ColorValue.fromTbgr(colorDef.tbgr), onChangeComplete: handleColorChanged },
|
|
101
|
+
React.createElement(ColorBuilder, null),
|
|
102
|
+
props.colorInputType &&
|
|
103
|
+
React.createElement(ColorInputPanel, { defaultColorFormat: props.colorInputType }),
|
|
104
|
+
colorOptions &&
|
|
105
|
+
React.createElement(ColorPalette, { colors: colorOptions }))))));
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
|
|
109
|
+
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export const ColorPickerPopup = ForwardRefColorPickerPopup;
|
|
113
113
|
//# sourceMappingURL=ColorPickerPopup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerPopup.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAA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Aa,EACvB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,8BAA8B;YAE9B,6BAAK,SAAS,EAAC,4CAA4C;gBACxD,CAAC,KAAK,CAAC,eAAe;oBACrB,gCAAQ,KAAK,EAAE,UAAU,EACvB,SAAS,EAAE,kEAAkE,iBACjE,mBAAmB,EAC/B,OAAO,EAAE,WAAW,GACpB;gBACJ,oBAAC,WAAW,IAAC,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;oBAClG,oBAAC,YAAY,OAAG;oBACf,KAAK,CAAC,cAAc;wBACnB,oBAAC,eAAe,IAAC,kBAAkB,EAAE,KAAK,CAAC,cAAc,GAAI;oBAC9D,YAAY;wBACX,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC5B,CACV,CACA,CACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+D,0BAA0B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Color\r\n */\r\n\r\n// cSpell:ignore colorpicker\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup, useRefs, WebFontIcon } from \"@itwin/core-react\";\r\n// import { ColorPickerPanel } from \"./ColorPickerPanel\";\r\nimport { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\r\nimport \"./ColorPickerPopup.scss\";\r\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\n\r\n/** Properties for the [[ColorPickerPopup]] React component\r\n * @public\r\n */\r\nexport interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Current color */\r\n initialColor: ColorDef;\r\n /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.\r\n * Displayed in rows of 9 items */\r\n colorDefs?: ColorDef[];\r\n /** Function to call when the color value is changed */\r\n onColorChange?: ((newColor: ColorDef) => void) | undefined;\r\n /** Function to call when the popup is closed */\r\n onClose?: ((colorValue: ColorDef) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not, color displayed on button but button will not trigger pop-up */\r\n readonly?: boolean;\r\n /** popup position. If not set RelativePosition.BottomLeft is used */\r\n popupPosition?: RelativePosition;\r\n /** Provides ability to return reference to HTMLButtonElement */\r\n ref?: React.Ref<HTMLButtonElement>;\r\n /** If true show up/down caret next to color */\r\n showCaret?: boolean;\r\n /** If true, don't propagate clicks out of the ColorPicker */\r\n captureClicks?: boolean;\r\n /** If true, don't show close button at top */\r\n hideCloseButton?: boolean;\r\n /** If set show input values */\r\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\r\n}\r\n\r\n// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted\r\n\r\nconst ForwardRefColorPickerPopup = React.forwardRef<HTMLButtonElement, ColorPickerPopupProps>(\r\n function ForwardRefColorPickerPopup(props, ref) {\r\n const target = React.useRef<HTMLButtonElement>(null);\r\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n const [showPopup, setShowPopup] = React.useState(false);\r\n const [colorDef, setColorDef] = React.useState(props.initialColor);\r\n const initialColorRef = React.useRef(props.initialColor);\r\n\r\n React.useEffect(() => {\r\n if (props.initialColor !== initialColorRef.current) {\r\n initialColorRef.current = props.initialColor;\r\n setColorDef(props.initialColor);\r\n }\r\n }, [props.initialColor]);\r\n\r\n const defaultColors = React.useRef(\r\n [\r\n ColorValue.fromTbgr(ColorByName.red),\r\n ColorValue.fromTbgr(ColorByName.orange),\r\n ColorValue.fromTbgr(ColorByName.yellow),\r\n ColorValue.fromTbgr(ColorByName.green),\r\n ColorValue.fromTbgr(ColorByName.blue),\r\n ColorValue.fromTbgr(ColorByName.mediumBlue),\r\n ColorValue.fromTbgr(ColorByName.indigo),\r\n ColorValue.fromTbgr(ColorByName.violet),\r\n ColorValue.fromTbgr(ColorByName.black),\r\n ColorValue.fromTbgr(ColorByName.white),\r\n ColorValue.fromTbgr(ColorByName.cyan),\r\n ColorValue.fromTbgr(ColorByName.fuchsia),\r\n ColorValue.fromTbgr(ColorByName.tan),\r\n ColorValue.fromTbgr(ColorByName.gray),\r\n ColorValue.fromTbgr(ColorByName.brown),\r\n ColorValue.fromTbgr(ColorByName.purple),\r\n ColorValue.fromTbgr(ColorByName.olive),\r\n ColorValue.fromTbgr(ColorByName.darkGreen),\r\n ]);\r\n\r\n // istanbul ignore next\r\n const closePopup = React.useCallback(() => {\r\n props.onClose && props.onClose(colorDef);\r\n setShowPopup(false);\r\n }, [colorDef, props]);\r\n\r\n const togglePopup = React.useCallback(() => {\r\n setShowPopup(!showPopup);\r\n }, [showPopup]);\r\n\r\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\r\n const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());\r\n // istanbul ignore else\r\n if (!newColor.equals(colorDef)) {\r\n setColorDef(newColor);\r\n\r\n // istanbul ignore else\r\n props.onColorChange && props.onColorChange(newColor);\r\n }\r\n }, [colorDef, props]);\r\n\r\n const rgbaString = getCSSColorFromDef(colorDef);\r\n\r\n const buttonStyle = { ...props.style } as React.CSSProperties;\r\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\r\n const buttonClassNames = classnames(\"components-colorpicker-popup-button\",\r\n props.readonly && \"readonly\",\r\n props.className,\r\n );\r\n\r\n const clickHandler = (event: React.MouseEvent) => {\r\n // istanbul ignore else\r\n if (props.captureClicks)\r\n event.stopPropagation();\r\n };\r\n\r\n const colorOptions = React.useMemo(() => {\r\n if (props.colorDefs && props.colorDefs.length) {\r\n return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));\r\n }\r\n if (props.colorDefs && 0 === props.colorDefs.length)\r\n return undefined;\r\n return defaultColors.current;\r\n }, [props.colorDefs]);\r\n const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;\r\n\r\n const [closeLabel] = React.useState(() => UiIModelComponents.translate(\"color.close\"));\r\n const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate(\"color.toggleColorPopup\"));\r\n\r\n return (\r\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\r\n <div onClick={clickHandler}>\r\n <button data-testid=\"components-colorpicker-popup-button\" onClick={togglePopup} className={buttonClassNames} style={buttonStyle}\r\n disabled={props.disabled} ref={refs} title={togglePopupLabel} >\r\n <div className=\"components-colorpicker-button-container\">\r\n <div className=\"components-colorpicker-button-color-swatch\" style={swatchStyle} />\r\n {props.showCaret && <WebFontIcon className=\"components-caret\" iconName={showPopup ? \"icon-caret-up\" : \"icon-caret-down\"} iconSize=\"x-small\" />}\r\n </div>\r\n </button>\r\n <Popup\r\n className=\"components-colorpicker-popup\"\r\n isOpen={showPopup}\r\n position={popupPosition}\r\n onClose={closePopup}\r\n target={target.current}\r\n closeOnNestedPopupOutsideClick\r\n >\r\n <div className=\"components-colorpicker-popup-panel-padding\">\r\n {!props.hideCloseButton &&\r\n <button title={closeLabel}\r\n className={\"core-focus-trap-ignore-initial core-dialog-close icon icon-close\"}\r\n data-testid=\"core-dialog-close\"\r\n onClick={togglePopup}\r\n />}\r\n <ColorPicker selectedColor={ColorValue.fromTbgr(colorDef.tbgr)} onChangeComplete={handleColorChanged} >\r\n <ColorBuilder />\r\n {props.colorInputType &&\r\n <ColorInputPanel defaultColorFormat={props.colorInputType} />}\r\n {colorOptions &&\r\n <ColorPalette colors={colorOptions} />}\r\n </ColorPicker>\r\n </div>\r\n </Popup>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.\r\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\r\n * @public\r\n */\r\nexport const ColorPickerPopup: (props: ColorPickerPopupProps) => React.JSX.Element | null = ForwardRefColorPickerPopup;\r\n"]}
|
|
1
|
+
{"version":3,"file":"ColorPickerPopup.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7E,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAiC3D,qHAAqH;AAErH,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CACjD,SAAS,0BAA0B,CAAC,KAAK,EAAE,GAAG;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAE,uGAAuG;IAC3I,M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C,MAAM,EAAE,YAAY,GAAI,CAC5B,CACV,CACA,CACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+D,0BAA0B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Color\n */\n\n// cSpell:ignore colorpicker\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { CommonProps, Popup, useRefs, WebFontIcon } from \"@itwin/core-react\";\n// import { ColorPickerPanel } from \"./ColorPickerPanel\";\nimport { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\nimport \"./ColorPickerPopup.scss\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\n/** Properties for the [[ColorPickerPopup]] React component\n * @public\n */\nexport interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /** Current color */\n initialColor: ColorDef;\n /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.\n * Displayed in rows of 9 items */\n colorDefs?: ColorDef[];\n /** Function to call when the color value is changed */\n onColorChange?: ((newColor: ColorDef) => void) | undefined;\n /** Function to call when the popup is closed */\n onClose?: ((colorValue: ColorDef) => void) | undefined;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not, color displayed on button but button will not trigger pop-up */\n readonly?: boolean;\n /** popup position. If not set RelativePosition.BottomLeft is used */\n popupPosition?: RelativePosition;\n /** Provides ability to return reference to HTMLButtonElement */\n ref?: React.Ref<HTMLButtonElement>;\n /** If true show up/down caret next to color */\n showCaret?: boolean;\n /** If true, don't propagate clicks out of the ColorPicker */\n captureClicks?: boolean;\n /** If true, don't show close button at top */\n hideCloseButton?: boolean;\n /** If set show input values */\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\n}\n\n// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted\n\nconst ForwardRefColorPickerPopup = React.forwardRef<HTMLButtonElement, ColorPickerPopupProps>(\n function ForwardRefColorPickerPopup(props, ref) {\n const target = React.useRef<HTMLButtonElement>(null);\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\n const [showPopup, setShowPopup] = React.useState(false);\n const [colorDef, setColorDef] = React.useState(props.initialColor);\n const initialColorRef = React.useRef(props.initialColor);\n\n React.useEffect(() => {\n if (props.initialColor !== initialColorRef.current) {\n initialColorRef.current = props.initialColor;\n setColorDef(props.initialColor);\n }\n }, [props.initialColor]);\n\n const defaultColors = React.useRef(\n [\n ColorValue.fromTbgr(ColorByName.red),\n ColorValue.fromTbgr(ColorByName.orange),\n ColorValue.fromTbgr(ColorByName.yellow),\n ColorValue.fromTbgr(ColorByName.green),\n ColorValue.fromTbgr(ColorByName.blue),\n ColorValue.fromTbgr(ColorByName.mediumBlue),\n ColorValue.fromTbgr(ColorByName.indigo),\n ColorValue.fromTbgr(ColorByName.violet),\n ColorValue.fromTbgr(ColorByName.black),\n ColorValue.fromTbgr(ColorByName.white),\n ColorValue.fromTbgr(ColorByName.cyan),\n ColorValue.fromTbgr(ColorByName.fuchsia),\n ColorValue.fromTbgr(ColorByName.tan),\n ColorValue.fromTbgr(ColorByName.gray),\n ColorValue.fromTbgr(ColorByName.brown),\n ColorValue.fromTbgr(ColorByName.purple),\n ColorValue.fromTbgr(ColorByName.olive),\n ColorValue.fromTbgr(ColorByName.darkGreen),\n ]);\n\n // istanbul ignore next\n const closePopup = React.useCallback(() => {\n props.onClose && props.onClose(colorDef);\n setShowPopup(false);\n }, [colorDef, props]);\n\n const togglePopup = React.useCallback(() => {\n setShowPopup(!showPopup);\n }, [showPopup]);\n\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\n const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());\n // istanbul ignore else\n if (!newColor.equals(colorDef)) {\n setColorDef(newColor);\n\n // istanbul ignore else\n props.onColorChange && props.onColorChange(newColor);\n }\n }, [colorDef, props]);\n\n const rgbaString = getCSSColorFromDef(colorDef);\n\n const buttonStyle = { ...props.style } as React.CSSProperties;\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\n const buttonClassNames = classnames(\"components-colorpicker-popup-button\",\n props.readonly && \"readonly\",\n props.className,\n );\n\n const clickHandler = (event: React.MouseEvent) => {\n // istanbul ignore else\n if (props.captureClicks)\n event.stopPropagation();\n };\n\n const colorOptions = React.useMemo(() => {\n if (props.colorDefs && props.colorDefs.length) {\n return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));\n }\n if (props.colorDefs && 0 === props.colorDefs.length)\n return undefined;\n return defaultColors.current;\n }, [props.colorDefs]);\n const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;\n\n const [closeLabel] = React.useState(() => UiIModelComponents.translate(\"color.close\"));\n const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate(\"color.toggleColorPopup\"));\n\n return (\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n <div onClick={clickHandler}>\n <button data-testid=\"components-colorpicker-popup-button\" onClick={togglePopup} className={buttonClassNames} style={buttonStyle}\n disabled={props.disabled} ref={refs} title={togglePopupLabel} >\n <div className=\"components-colorpicker-button-container\">\n <div className=\"components-colorpicker-button-color-swatch\" style={swatchStyle} />\n {props.showCaret && <WebFontIcon className=\"components-caret\" iconName={showPopup ? \"icon-caret-up\" : \"icon-caret-down\"} iconSize=\"x-small\" />}\n </div>\n </button>\n <Popup\n className=\"components-colorpicker-popup\"\n isOpen={showPopup}\n position={popupPosition}\n onClose={closePopup}\n target={target.current}\n closeOnNestedPopupOutsideClick\n >\n <div className=\"components-colorpicker-popup-panel-padding\">\n {!props.hideCloseButton &&\n <button title={closeLabel}\n className={\"core-focus-trap-ignore-initial core-dialog-close icon icon-close\"}\n data-testid=\"core-dialog-close\"\n onClick={togglePopup}\n />}\n <ColorPicker selectedColor={ColorValue.fromTbgr(colorDef.tbgr)} onChangeComplete={handleColorChanged} >\n <ColorBuilder />\n {props.colorInputType &&\n <ColorInputPanel defaultColorFormat={props.colorInputType} />}\n {colorOptions &&\n <ColorPalette colors={colorOptions} />}\n </ColorPicker>\n </div>\n </Popup>\n </div>\n );\n }\n);\n\n/**\n * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\n * @public\n */\nexport const ColorPickerPopup: (props: ColorPickerPopupProps) => React.JSX.Element | null = ForwardRefColorPickerPopup;\n"]}
|
|
@@ -1,64 +1,64 @@
|
|
|
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
|
-
@import "~@itwin/itwinui-css/scss/style/typography";
|
|
7
|
-
|
|
8
|
-
button.components-colorpicker-popup-button {
|
|
9
|
-
font-family: $iui-font-family;
|
|
10
|
-
font-size: $iui-font-size;
|
|
11
|
-
color: $buic-foreground-body;
|
|
12
|
-
background-color: transparent;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
border-radius: 3px;
|
|
15
|
-
border: none;
|
|
16
|
-
padding: 0;
|
|
17
|
-
|
|
18
|
-
&:not(.readonly) {
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
>.components-colorpicker-button-container {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
align-items: center;
|
|
26
|
-
|
|
27
|
-
>.components-colorpicker-button-color-swatch {
|
|
28
|
-
border: 1px solid $buic-inputs-border;
|
|
29
|
-
border-radius: 3px;
|
|
30
|
-
width: 1.25em;
|
|
31
|
-
height: 1.25em;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
>.components-caret {
|
|
35
|
-
margin-left: .25em;
|
|
36
|
-
margin-right: .25em;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:disabled {
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
|
|
43
|
-
>.components-colorpicker-button-container {
|
|
44
|
-
>.components-caret {
|
|
45
|
-
color: $buic-icon-color-disabled;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.components-colorpicker-popup-panel-padding {
|
|
52
|
-
padding: 3px 6px 6px 6px;
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
gap: 4px;
|
|
56
|
-
|
|
57
|
-
button.core-dialog-close {
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
margin-left: auto;
|
|
60
|
-
background: transparent;
|
|
61
|
-
border: none;
|
|
62
|
-
color: var(--buic-foreground-body);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
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
|
+
@import "~@itwin/itwinui-css/scss/style/typography";
|
|
7
|
+
|
|
8
|
+
button.components-colorpicker-popup-button {
|
|
9
|
+
font-family: $iui-font-family;
|
|
10
|
+
font-size: $iui-font-size;
|
|
11
|
+
color: $buic-foreground-body;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
border-radius: 3px;
|
|
15
|
+
border: none;
|
|
16
|
+
padding: 0;
|
|
17
|
+
|
|
18
|
+
&:not(.readonly) {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
>.components-colorpicker-button-container {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
align-items: center;
|
|
26
|
+
|
|
27
|
+
>.components-colorpicker-button-color-swatch {
|
|
28
|
+
border: 1px solid $buic-inputs-border;
|
|
29
|
+
border-radius: 3px;
|
|
30
|
+
width: 1.25em;
|
|
31
|
+
height: 1.25em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
>.components-caret {
|
|
35
|
+
margin-left: .25em;
|
|
36
|
+
margin-right: .25em;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:disabled {
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
|
|
43
|
+
>.components-colorpicker-button-container {
|
|
44
|
+
>.components-caret {
|
|
45
|
+
color: $buic-icon-color-disabled;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.components-colorpicker-popup-panel-padding {
|
|
52
|
+
padding: 3px 6px 6px 6px;
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 4px;
|
|
56
|
+
|
|
57
|
+
button.core-dialog-close {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
margin-left: auto;
|
|
60
|
+
background: transparent;
|
|
61
|
+
border: none;
|
|
62
|
+
color: var(--buic-foreground-body);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Color
|
|
3
|
-
*/
|
|
4
|
-
import "./HueSlider.scss";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { HSVColor } from "@itwin/core-common";
|
|
7
|
-
import { CommonProps } from "@itwin/core-react";
|
|
8
|
-
/** Properties for the [[HueSlider]] React component
|
|
9
|
-
* @beta
|
|
10
|
-
*/
|
|
11
|
-
export interface HueSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
|
|
12
|
-
/** true if slider is oriented horizontal, else vertical orientation is assumed */
|
|
13
|
-
isHorizontal?: boolean;
|
|
14
|
-
/** function to run when user hue is changed */
|
|
15
|
-
onHueChange?: ((hue: HSVColor) => void) | undefined;
|
|
16
|
-
/** HSV Color Value */
|
|
17
|
-
hsv: HSVColor;
|
|
18
|
-
}
|
|
19
|
-
/** HueSlider component used to set the hue value.
|
|
20
|
-
* @beta
|
|
21
|
-
*/
|
|
22
|
-
export declare function HueSlider({ isHorizontal, onHueChange, hsv, className, style }: HueSliderProps): React.JSX.Element;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import "./HueSlider.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { HSVColor } from "@itwin/core-common";
|
|
7
|
+
import { CommonProps } from "@itwin/core-react";
|
|
8
|
+
/** Properties for the [[HueSlider]] React component
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface HueSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
|
|
12
|
+
/** true if slider is oriented horizontal, else vertical orientation is assumed */
|
|
13
|
+
isHorizontal?: boolean;
|
|
14
|
+
/** function to run when user hue is changed */
|
|
15
|
+
onHueChange?: ((hue: HSVColor) => void) | undefined;
|
|
16
|
+
/** HSV Color Value */
|
|
17
|
+
hsv: HSVColor;
|
|
18
|
+
}
|
|
19
|
+
/** HueSlider component used to set the hue value.
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export declare function HueSlider({ isHorizontal, onHueChange, hsv, className, style }: HueSliderProps): React.JSX.Element;
|
|
23
23
|
//# sourceMappingURL=HueSlider.d.ts.map
|