@itwin/imodel-components-react 3.0.0-dev.77 → 3.0.0-dev.81
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/lib/{imodel-components-react → cjs/imodel-components-react}/UiIModelComponents.d.ts +0 -0
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/UiIModelComponents.js +0 -0
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/AlphaSlider.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/AlphaSlider.js +0 -0
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/AlphaSlider.scss +0 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerButton.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerButton.js +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerButton.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerDialog.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerDialog.js +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPanel.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPanel.js +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPanel.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPopup.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPopup.js +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/ColorPickerPopup.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/HueSlider.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/HueSlider.js +0 -0
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/HueSlider.scss +0 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/SaturationPicker.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/SaturationPicker.js +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/SaturationPicker.scss +0 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/Swatch.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/Swatch.js +8 -16
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/Swatch.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/getCSSColorFromDef.d.ts +0 -0
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/color/getCSSColorFromDef.js +0 -0
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/ColorEditor.d.ts +0 -0
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/ColorEditor.js +0 -0
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/ColorEditor.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/WeightEditor.d.ts +0 -0
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/WeightEditor.js +0 -0
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/editors/WeightEditor.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/inputs/QuantityInput.d.ts +0 -0
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/inputs/QuantityInput.js +0 -0
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/inputs/QuantityNumberInput.d.ts +0 -0
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/inputs/QuantityNumberInput.js +2 -13
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/inputs/QuantityNumberInput.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/Swatch.d.ts +0 -0
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/Swatch.js +12 -16
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/Swatch.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/WeightPickerButton.d.ts +0 -0
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/WeightPickerButton.js +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/lineweight/WeightPickerButton.scss +2 -2
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/Cube.d.ts +0 -0
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/Cube.js +9 -17
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/Cube.scss +0 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/CubeNavigationAid.d.ts +0 -0
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/CubeNavigationAid.js +6 -17
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/CubeNavigationAid.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/DrawingNavigationAid.d.ts +0 -0
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/DrawingNavigationAid.js +4 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/navigationaids/DrawingNavigationAid.scss +2 -2
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatPanel.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatPanel.js +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatPanel.scss +2 -2
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatPrecision.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatPrecision.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatSample.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatSample.js +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatType.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatType.js +3 -14
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatUnitLabel.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatUnitLabel.js +4 -15
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatUnits.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/FormatUnits.js +11 -11
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/MiscFormatOptions.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/MiscFormatOptions.js +6 -6
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/QuantityFormatPanel.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/QuantityFormatPanel.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/DecimalPrecision.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/DecimalPrecision.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/DecimalSeparator.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/DecimalSeparator.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/FractionPrecision.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/FractionPrecision.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ScientificType.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ScientificType.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/SignOption.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/SignOption.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/StationSeparatorSelector.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/StationSeparatorSelector.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/StationSizeSelector.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/StationSizeSelector.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ThousandsSelector.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ThousandsSelector.js +2 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ThousandsSeparator.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/ThousandsSeparator.js +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/UnitDescr.d.ts +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/quantityformat/misc/UnitDescr.js +0 -0
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/BaseSolarDataProvider.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/BaseSolarDataProvider.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/BaseTimelineDataProvider.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/BaseTimelineDataProvider.js +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/ContextMenu.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/ContextMenu.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/ContextMenu.scss +2 -2
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/InlineEdit.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/InlineEdit.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/InlineEdit.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/PlayerButton.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/PlayerButton.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/PlayerButton.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/Scrubber.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/Scrubber.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/Scrubber.scss +2 -2
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SolarTimeline.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SolarTimeline.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SolarTimeline.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SpeedTimeline.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SpeedTimeline.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/SpeedTimeline.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/Timeline.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/TimelineComponent.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/TimelineComponent.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/TimelineComponent.scss +1 -1
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/interfaces.d.ts +0 -0
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/timeline/interfaces.js +0 -0
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/viewport/ViewportComponent.d.ts +0 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/viewport/ViewportComponent.js +4 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/viewport/ViewportComponentEvents.d.ts +0 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -0
- package/lib/{imodel-components-react → cjs/imodel-components-react}/viewport/ViewportComponentEvents.js +0 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -0
- package/lib/{imodel-components-react.d.ts → cjs/imodel-components-react.d.ts} +0 -0
- package/lib/cjs/imodel-components-react.d.ts.map +1 -0
- package/lib/{imodel-components-react.js → cjs/imodel-components-react.js} +0 -0
- package/lib/cjs/imodel-components-react.js.map +1 -0
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +34 -0
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/UiIModelComponents.js +75 -0
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +37 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +161 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +38 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +83 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +92 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +39 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +22 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +123 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +94 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +94 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +53 -0
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +23 -0
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/HueSlider.js +174 -0
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -0
- package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +21 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +188 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -0
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +23 -0
- package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/Swatch.js +35 -0
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -0
- package/lib/esm/imodel-components-react/color/Swatch.scss +24 -0
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +7 -0
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +20 -0
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -0
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +45 -0
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +125 -0
- package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -0
- package/lib/esm/imodel-components-react/editors/ColorEditor.scss +19 -0
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +48 -0
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/editors/WeightEditor.js +134 -0
- package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -0
- package/lib/esm/imodel-components-react/editors/WeightEditor.scss +17 -0
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +26 -0
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +71 -0
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -0
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +45 -0
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -0
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -0
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +89 -0
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +34 -0
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/lineweight/Swatch.js +60 -0
- package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -0
- package/lib/esm/imodel-components-react/lineweight/Swatch.scss +49 -0
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +61 -0
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +134 -0
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -0
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +53 -0
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +46 -0
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/Cube.js +101 -0
- package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -0
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -0
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +573 -0
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +181 -0
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +146 -0
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +621 -0
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -0
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +134 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +27 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +77 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +65 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +31 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +19 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +61 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +64 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +84 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +20 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +111 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +22 -0
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +159 -0
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +23 -0
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +132 -0
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +37 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +25 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +17 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +32 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +19 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +26 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +28 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +36 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +25 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +34 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +18 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +70 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +24 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +97 -0
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +53 -0
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +140 -0
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +32 -0
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +66 -0
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/ContextMenu.d.ts +55 -0
- package/lib/esm/imodel-components-react/timeline/ContextMenu.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/ContextMenu.js +55 -0
- package/lib/esm/imodel-components-react/timeline/ContextMenu.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/ContextMenu.scss +81 -0
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +28 -0
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js +56 -0
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +27 -0
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +34 -0
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +65 -0
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +26 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +55 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +165 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.scss +107 -0
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +78 -0
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +399 -0
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +358 -0
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +16 -0
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +29 -0
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +40 -0
- package/lib/esm/imodel-components-react/timeline/Timeline.scss +165 -0
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +135 -0
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +341 -0
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +164 -0
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +175 -0
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/interfaces.js +43 -0
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +67 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +227 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +107 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +95 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -0
- package/lib/esm/imodel-components-react.d.ts +84 -0
- package/lib/esm/imodel-components-react.d.ts.map +1 -0
- package/lib/esm/imodel-components-react.js +89 -0
- package/lib/esm/imodel-components-react.js.map +1 -0
- package/package.json +32 -27
- package/lib/imodel-components-react/UiIModelComponents.d.ts.map +0 -1
- package/lib/imodel-components-react/UiIModelComponents.js.map +0 -1
- package/lib/imodel-components-react/color/AlphaSlider.d.ts.map +0 -1
- package/lib/imodel-components-react/color/AlphaSlider.js.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerButton.d.ts.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerButton.js.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerDialog.d.ts.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerDialog.js.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerPopup.d.ts.map +0 -1
- package/lib/imodel-components-react/color/ColorPickerPopup.js.map +0 -1
- package/lib/imodel-components-react/color/HueSlider.d.ts.map +0 -1
- package/lib/imodel-components-react/color/HueSlider.js.map +0 -1
- package/lib/imodel-components-react/color/SaturationPicker.d.ts.map +0 -1
- package/lib/imodel-components-react/color/SaturationPicker.js.map +0 -1
- package/lib/imodel-components-react/color/Swatch.d.ts.map +0 -1
- package/lib/imodel-components-react/color/Swatch.js.map +0 -1
- package/lib/imodel-components-react/color/getCSSColorFromDef.d.ts.map +0 -1
- package/lib/imodel-components-react/color/getCSSColorFromDef.js.map +0 -1
- package/lib/imodel-components-react/editors/ColorEditor.d.ts.map +0 -1
- package/lib/imodel-components-react/editors/ColorEditor.js.map +0 -1
- package/lib/imodel-components-react/editors/WeightEditor.d.ts.map +0 -1
- package/lib/imodel-components-react/editors/WeightEditor.js.map +0 -1
- package/lib/imodel-components-react/inputs/QuantityInput.d.ts.map +0 -1
- package/lib/imodel-components-react/inputs/QuantityInput.js.map +0 -1
- package/lib/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +0 -1
- package/lib/imodel-components-react/inputs/QuantityNumberInput.js.map +0 -1
- package/lib/imodel-components-react/lineweight/Swatch.d.ts.map +0 -1
- package/lib/imodel-components-react/lineweight/Swatch.js.map +0 -1
- package/lib/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +0 -1
- package/lib/imodel-components-react/lineweight/WeightPickerButton.js.map +0 -1
- package/lib/imodel-components-react/navigationaids/Cube.d.ts.map +0 -1
- package/lib/imodel-components-react/navigationaids/Cube.js.map +0 -1
- package/lib/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +0 -1
- package/lib/imodel-components-react/navigationaids/CubeNavigationAid.js.map +0 -1
- package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +0 -1
- package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatPanel.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatPanel.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatPrecision.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatSample.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatSample.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatType.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatType.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatUnitLabel.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatUnits.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/FormatUnits.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ScientificType.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/SignOption.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +0 -1
- package/lib/imodel-components-react/quantityformat/misc/UnitDescr.js.map +0 -1
- package/lib/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/BaseSolarDataProvider.js.map +0 -1
- package/lib/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +0 -1
- package/lib/imodel-components-react/timeline/ContextMenu.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/ContextMenu.js.map +0 -1
- package/lib/imodel-components-react/timeline/InlineEdit.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/InlineEdit.js.map +0 -1
- package/lib/imodel-components-react/timeline/PlayerButton.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/PlayerButton.js.map +0 -1
- package/lib/imodel-components-react/timeline/Scrubber.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/Scrubber.js.map +0 -1
- package/lib/imodel-components-react/timeline/SolarTimeline.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/SolarTimeline.js.map +0 -1
- package/lib/imodel-components-react/timeline/SpeedTimeline.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/SpeedTimeline.js.map +0 -1
- package/lib/imodel-components-react/timeline/TimelineComponent.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/TimelineComponent.js.map +0 -1
- package/lib/imodel-components-react/timeline/interfaces.d.ts.map +0 -1
- package/lib/imodel-components-react/timeline/interfaces.js.map +0 -1
- package/lib/imodel-components-react/viewport/ViewportComponent.d.ts.map +0 -1
- package/lib/imodel-components-react/viewport/ViewportComponent.js.map +0 -1
- package/lib/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +0 -1
- package/lib/imodel-components-react/viewport/ViewportComponentEvents.js.map +0 -1
- package/lib/imodel-components-react.d.ts.map +0 -1
- package/lib/imodel-components-react.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlphaSlider.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/AlphaSlider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAcnD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,aAA+B;IAIpE,gBAAgB;IAChB,YAAY,KAAuB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QALP,eAAU,GAA0B,IAAI,CAAC;QACzC,uBAAkB,GAAG,kBAAkB,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QAOxE,qBAAgB,GAAG,CAAC,CAAsE,EAAE,YAAqB,EAAE,KAAa,EAAE,SAAyB,EAAsB,EAAE;YACzL,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC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CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YAC1C,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;QAE9D,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAc,iBAAiB;YACtF,4CACc,cAAc,EAC1B,IAAI,EAAC,QAAQ,gBAAa,IAAI,CAAC,kBAAkB,mBAClC,CAAC,mBAAiB,CAAC,mBAAiB,IAAI,CAAC,KAAK,CAAC,KAAK,EACnE,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,SAAS,EAC/C,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,WAAW,EAAE,IAAI,CAAC,SAAS,EAC3B,YAAY,EAAE,IAAI,CAAC,SAAS,EAC5B,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,IAAI,CAAC,UAAU;gBAE1B,6BAAK,KAAK,EAAE,YAAY,EAAE,SAAS,EAAC,0BAA0B,iBAAa,eAAe,GAAG,CACzF,CACF,CACP,CAAC;IACJ,CAAC;CAEF","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\nimport \"./AlphaSlider.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\n\n/** Properties for the [[AlphaSlider]] React component\n * @beta\n */\nexport interface AlphaSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {\n /** true if slider is oriented horizontal, else vertical orientation is assumed */\n isHorizontal?: boolean;\n /** function to run when user selects color swatch */\n onAlphaChange?: ((alpha: number) => void) | undefined;\n /** Alpha value between 0 (transparent) and 1 (opaque) */\n alpha: number;\n}\n\n/** AlphaSlider component used to set the alpha value.\n * @beta\n */\nexport class AlphaSlider extends React.PureComponent<AlphaSliderProps> {\n private _container: HTMLDivElement | null = null;\n private _transparencyLabel = UiIModelComponents.translate(\"color.transparency\");\n\n /** @internal */\n constructor(props: AlphaSliderProps) {\n super(props);\n }\n\n private _calculateChange = (e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>, isHorizontal: boolean, alpha: number, container: HTMLDivElement): number | undefined => {\n e.preventDefault();\n const { width: containerWidth, height: containerHeight } = container.getBoundingClientRect();\n\n let x = 0;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n // istanbul ignore if\n if (undefined === e.touches)\n return undefined;\n x = e.touches[0].pageX;\n }\n // istanbul ignore if\n if (undefined === x)\n return undefined;\n\n let y = 0;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n // istanbul ignore if\n if (undefined === e.touches)\n return;\n y = e.touches[0].pageY;\n }\n // istanbul ignore if\n if (undefined === y)\n return undefined;\n\n const left = x - (container.getBoundingClientRect().left + window.scrollX);\n const top = y - (container.getBoundingClientRect().top + window.scrollY);\n\n let t = 0;\n\n if (!isHorizontal) {\n // istanbul ignore next\n if (top < 0) {\n t = 1;\n } else if (top > containerHeight) {\n t = 0;\n } else {\n t = 1 - (top / containerHeight);\n }\n } else { // horizontal\n // istanbul ignore next\n if (left < 0) {\n t = 0;\n } else if (left > containerWidth) {\n t = 1;\n } else {\n t = left / containerWidth;\n }\n }\n\n // istanbul ignore if\n if (t < 0) t = 0;\n // istanbul ignore if\n if (t > 1) t = 1;\n // istanbul ignore next\n return (alpha !== t) ? t : undefined;\n };\n\n /** @internal */\n public override componentWillUnmount() {\n this._unbindEventListeners();\n }\n\n private _onChange = (e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (this._container && this.props.onAlphaChange) {\n const change = this._calculateChange(e, this.props.isHorizontal ? this.props.isHorizontal : false, this.props.alpha, this._container);\n undefined !== change && typeof this.props.onAlphaChange === \"function\" && this.props.onAlphaChange(change);\n }\n };\n\n private _onMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {\n this._onChange(e);\n // istanbul ignore else\n if (this._container)\n this._container.focus();\n window.addEventListener(\"mousemove\", this._onChange as any);\n window.addEventListener(\"mouseup\", this._onMouseUp);\n };\n\n private _onKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n let newTransparency: number | undefined;\n if (evt.key === SpecialKey.ArrowLeft || evt.key === SpecialKey.ArrowDown) {\n newTransparency = this.props.alpha - (evt.ctrlKey ? .1 : .05);\n } else if (evt.key === SpecialKey.ArrowRight || evt.key === SpecialKey.ArrowUp) {\n newTransparency = this.props.alpha + (evt.ctrlKey ? .1 : .05);\n } else if (evt.key === SpecialKey.PageDown) {\n newTransparency = this.props.alpha - (evt.ctrlKey ? .5 : .25);\n } else if (evt.key === SpecialKey.PageUp) {\n newTransparency = this.props.alpha + (evt.ctrlKey ? .5 : .25);\n } else if (evt.key === SpecialKey.Home) {\n newTransparency = 0;\n } else {\n // istanbul ignore else\n if (evt.key === SpecialKey.End) {\n newTransparency = 1;\n }\n }\n\n // istanbul ignore else\n if (undefined !== newTransparency) {\n // istanbul ignore if\n if (newTransparency > 1) newTransparency = 1;\n // istanbul ignore if\n if (newTransparency < 0) newTransparency = 0;\n // istanbul ignore else\n if (this.props.onAlphaChange)\n this.props.onAlphaChange(newTransparency);\n }\n };\n\n private _onMouseUp = () => {\n this._unbindEventListeners();\n };\n\n private _unbindEventListeners() {\n window.removeEventListener(\"mousemove\", this._onChange as any);\n window.removeEventListener(\"mouseup\", this._onMouseUp);\n }\n\n /** @internal */\n public override render(): React.ReactNode {\n const containerClasses = classnames(\n this.props.isHorizontal ? \"components-alpha-container-horizontal\" : \"components-alpha-container-vertical\",\n this.props.className,\n );\n\n const pointerStyle: React.CSSProperties = this.props.isHorizontal ?\n { left: `${(this.props.alpha * 100)}%` } :\n { left: `0px`, top: `${-(this.props.alpha * 100) + 100}%` };\n\n return (\n <div className={containerClasses} style={this.props.style} data-testid=\"alpha-container\">\n <div\n data-testid=\"alpha-slider\"\n role=\"slider\" aria-label={this._transparencyLabel}\n aria-valuemin={0} aria-valuemax={1} aria-valuenow={this.props.alpha}\n className=\"components-alpha-slider\"\n ref={(container) => this._container = container}\n onMouseDown={this._onMouseDown}\n onTouchMove={this._onChange}\n onTouchStart={this._onChange}\n tabIndex={0}\n onKeyDown={this._onKeyDown}\n >\n <div style={pointerStyle} className=\"components-alpha-pointer\" data-testid=\"alpha-pointer\" />\n </div>\n </div>\n );\n }\n\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
.components-alpha-pointer {
|
|
6
|
+
position: absolute;
|
|
7
|
+
width: 1.2rem;
|
|
8
|
+
height: 1.2rem;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
background-color: rgb(248, 248, 248);
|
|
11
|
+
box-shadow: rgba(0, 0, 0, 0.37) 0px 1px 4px 0px;
|
|
12
|
+
|
|
13
|
+
&:focus {
|
|
14
|
+
outline: none;
|
|
15
|
+
border: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.components-alpha-container-horizontal {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 1rem;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
|
|
26
|
+
.components-alpha-slider {
|
|
27
|
+
position: relative;
|
|
28
|
+
width: calc(100% - 1.2rem);
|
|
29
|
+
height: 100%;
|
|
30
|
+
background-color: linear-gradient(to right, rgba(47, 37, 72, 0) 0%, rgb(47, 37, 72) 100%);
|
|
31
|
+
background-image: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" fill-opacity=".15"><rect x="200" width="200" height="200" /> <rect y="200" width="200" height="200" /></svg>'),
|
|
32
|
+
linear-gradient(to right, rgba(47, 37, 72, 0) 0%, rgb(47, 37, 72) 100%);
|
|
33
|
+
background-size: 2rem 1rem, cover;
|
|
34
|
+
background-repeat: repeat, no-repeat;
|
|
35
|
+
|
|
36
|
+
.components-alpha-pointer {
|
|
37
|
+
transform: translate(-.6rem, -.1rem);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.components-alpha-container-vertical {
|
|
43
|
+
width: 1rem;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
height: 100%;
|
|
48
|
+
|
|
49
|
+
.components-alpha-slider {
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: calc(100% - 1.2rem);
|
|
53
|
+
background-color: linear-gradient(to bottom, rgba(47, 37, 72, 0) 0%, rgb(47, 37, 72) 100%);
|
|
54
|
+
background-image: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" fill-opacity=".15"><rect x="200" width="200" height="200" /> <rect y="200" width="200" height="200" /></svg>'),
|
|
55
|
+
linear-gradient(to top, rgba(47, 37, 72, 0) 0%, rgb(47, 37, 72) 100%);
|
|
56
|
+
background-size: 1rem 2rem, cover;
|
|
57
|
+
background-repeat: repeat, no-repeat;
|
|
58
|
+
|
|
59
|
+
.components-alpha-pointer {
|
|
60
|
+
transform: translate(-.1rem, -.6rem);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import "./ColorPickerButton.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { ColorDef } from "@itwin/core-common";
|
|
7
|
+
import { CommonProps } from "@itwin/core-react";
|
|
8
|
+
/** Properties for the [[ColorPickerButton]] React component
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface ColorPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
+
/** Active color */
|
|
13
|
+
initialColor: ColorDef;
|
|
14
|
+
/** Available colors */
|
|
15
|
+
colorDefs?: ColorDef[];
|
|
16
|
+
/** Function to run when user selects color swatch */
|
|
17
|
+
onColorPick?: ((color: ColorDef) => void) | undefined;
|
|
18
|
+
/** Show swatches as squares unless round is set to true */
|
|
19
|
+
round?: boolean;
|
|
20
|
+
/** Disabled or not */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Readonly or not */
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
/** Title to show at top of DropDown */
|
|
25
|
+
dropDownTitle?: string;
|
|
26
|
+
/** Number of columns */
|
|
27
|
+
numColumns?: number;
|
|
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
|
+
}
|
|
33
|
+
/** ColorPickerButton component
|
|
34
|
+
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export declare const ColorPickerButton: (props: ColorPickerProps) => JSX.Element | null;
|
|
38
|
+
//# sourceMappingURL=ColorPickerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerButton.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAmB7E;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW;IAClG,mBAAmB;IACnB,YAAY,EAAE,QAAQ,CAAC;IACvB,uBAAuB;IACvB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtD,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAyFD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,GAAG,CAAC,OAAO,GAAG,IAAkC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import "./ColorPickerButton.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
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 { ColorSwatch } from "./Swatch";
|
|
15
|
+
import { getCSSColorFromDef } from "./getCSSColorFromDef";
|
|
16
|
+
// cSpell:ignore colorpicker
|
|
17
|
+
function ColorOptions({ handleColorPicked, options, numColumns, round, title }) {
|
|
18
|
+
const containerStyle = { gridTemplateColumns: `repeat(${numColumns}, 1fr)` };
|
|
19
|
+
return (React.createElement("div", { className: "components-colorpicker-popup-container" },
|
|
20
|
+
title && React.createElement("h4", null, title),
|
|
21
|
+
React.createElement("div", { "data-testid": "components-colorpicker-popup-colors", className: "components-colorpicker-popup-colors", style: containerStyle }, options.map((color, index) => React.createElement(ColorSwatch, { className: "components-colorpicker-swatch", key: index, colorDef: color, onColorPick: handleColorPicked, round: round })))));
|
|
22
|
+
}
|
|
23
|
+
// Defined using following pattern (const ColorPickerButton at bottom) to ensure useful API documentation is extracted
|
|
24
|
+
const ForwardRefColorPickerButton = React.forwardRef(function ForwardRefColorPickerButton({ className, colorDefs, disabled, dropDownTitle, initialColor, numColumns, onColorPick, readonly, round, showCaret, style }, ref) {
|
|
25
|
+
const target = React.useRef();
|
|
26
|
+
const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
|
|
27
|
+
const [showPopup, setShowPopup] = React.useState(false);
|
|
28
|
+
const [colorDef, setColorDef] = React.useState(initialColor);
|
|
29
|
+
// See if new initialColor props have changed since component mounted
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
setColorDef(initialColor);
|
|
32
|
+
}, [initialColor]);
|
|
33
|
+
const defaultColors = React.useRef([
|
|
34
|
+
ColorDef.create(ColorByName.red),
|
|
35
|
+
ColorDef.create(ColorByName.orange),
|
|
36
|
+
ColorDef.create(ColorByName.yellow),
|
|
37
|
+
ColorDef.create(ColorByName.green),
|
|
38
|
+
ColorDef.create(ColorByName.blue),
|
|
39
|
+
ColorDef.create(ColorByName.indigo),
|
|
40
|
+
ColorDef.create(ColorByName.violet),
|
|
41
|
+
ColorDef.create(ColorByName.black),
|
|
42
|
+
ColorDef.create(ColorByName.white),
|
|
43
|
+
ColorDef.create(ColorByName.cyan),
|
|
44
|
+
ColorDef.create(ColorByName.fuchsia),
|
|
45
|
+
ColorDef.create(ColorByName.tan),
|
|
46
|
+
ColorDef.create(ColorByName.gray),
|
|
47
|
+
ColorDef.create(ColorByName.brown),
|
|
48
|
+
ColorDef.create(ColorByName.purple),
|
|
49
|
+
ColorDef.create(ColorByName.olive),
|
|
50
|
+
]);
|
|
51
|
+
const closePopup = React.useCallback(() => {
|
|
52
|
+
setShowPopup(false);
|
|
53
|
+
}, []);
|
|
54
|
+
const togglePopup = React.useCallback(() => {
|
|
55
|
+
setShowPopup(!showPopup);
|
|
56
|
+
}, [showPopup]);
|
|
57
|
+
const handleColorPicked = React.useCallback((color) => {
|
|
58
|
+
closePopup();
|
|
59
|
+
// istanbul ignore else
|
|
60
|
+
if (!color.equals(colorDef)) {
|
|
61
|
+
setColorDef(color);
|
|
62
|
+
onColorPick && onColorPick(color);
|
|
63
|
+
}
|
|
64
|
+
}, [closePopup, colorDef, onColorPick]);
|
|
65
|
+
const rgbaString = getCSSColorFromDef(colorDef);
|
|
66
|
+
const buttonStyle = { ...style };
|
|
67
|
+
const swatchStyle = { backgroundColor: rgbaString };
|
|
68
|
+
const buttonClassNames = classnames("components-colorpicker-button", round && "round", readonly && "readonly", className);
|
|
69
|
+
const colorOptions = colorDefs && colorDefs.length ? colorDefs : defaultColors.current;
|
|
70
|
+
return (React.createElement(React.Fragment, null,
|
|
71
|
+
React.createElement("button", { "data-testid": "components-colorpicker-button", "data-value": rgbaString, onClick: togglePopup, className: buttonClassNames, style: buttonStyle, disabled: disabled, ref: refs },
|
|
72
|
+
React.createElement("div", { className: "components-colorpicker-button-container" },
|
|
73
|
+
React.createElement("div", { className: "components-colorpicker-button-color-swatch", style: swatchStyle }),
|
|
74
|
+
showCaret && React.createElement(WebFontIcon, { className: "components-caret", iconName: showPopup ? "icon-caret-up" : "icon-caret-down", iconSize: "x-small" }))),
|
|
75
|
+
React.createElement(Popup, { className: "components-colorpicker-popup", isOpen: showPopup, position: RelativePosition.BottomLeft, onClose: closePopup, target: target.current, closeOnNestedPopupOutsideClick: true },
|
|
76
|
+
React.createElement(ColorOptions, { handleColorPicked: handleColorPicked, options: colorOptions, numColumns: numColumns !== null && numColumns !== void 0 ? numColumns : 4, round: !!round, title: dropDownTitle }))));
|
|
77
|
+
});
|
|
78
|
+
/** ColorPickerButton component
|
|
79
|
+
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
80
|
+
* @beta
|
|
81
|
+
*/
|
|
82
|
+
export const ColorPickerButton = ForwardRefColorPickerButton;
|
|
83
|
+
//# sourceMappingURL=ColorPickerButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerButton.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,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C,WAAW,IAAC,SAAS,EAAC,kBAAkB,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,EAAC,SAAS,GAAG,CACpI,CACC;QACT,oBAAC,KAAK,IACJ,SAAS,EAAC,8BAA8B,EACxC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,EACrC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,8BAA8B;YAE9B,oBAAC,YAAY,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,GAAI,CAC1I,CACP,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAoD,2BAA2B,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\nimport \"./ColorPickerButton.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { CommonProps, Popup, useRefs, WebFontIcon } from \"@itwin/core-react\";\nimport { ColorSwatch } from \"./Swatch\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\n\n// cSpell:ignore colorpicker\n\nfunction ColorOptions({ handleColorPicked, options, numColumns, round, title }: { handleColorPicked: ((color: ColorDef) => void), options: ColorDef[], numColumns: number, round: boolean, title?: string }) {\n const containerStyle: React.CSSProperties = { gridTemplateColumns: `repeat(${numColumns}, 1fr)` };\n return (\n <div className=\"components-colorpicker-popup-container\">\n {title && <h4>{title}</h4>}\n <div data-testid=\"components-colorpicker-popup-colors\" className=\"components-colorpicker-popup-colors\" style={containerStyle}>\n {options.map((color, index) => <ColorSwatch className=\"components-colorpicker-swatch\" key={index} colorDef={color}\n onColorPick={handleColorPicked} round={round} />)}\n </div>\n </div>\n );\n}\n\n/** Properties for the [[ColorPickerButton]] React component\n * @beta\n */\nexport interface ColorPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /** Active color */\n initialColor: ColorDef;\n /** Available colors */\n colorDefs?: ColorDef[];\n /** Function to run when user selects color swatch */\n onColorPick?: ((color: ColorDef) => void) | undefined;\n /** Show swatches as squares unless round is set to true */\n round?: boolean;\n /** Disabled or not */\n disabled?: boolean;\n /** Readonly or not */\n readonly?: boolean;\n /** Title to show at top of DropDown */\n dropDownTitle?: string;\n /** Number of columns */\n numColumns?: number;\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}\n\n// Defined using following pattern (const ColorPickerButton at bottom) to ensure useful API documentation is extracted\nconst ForwardRefColorPickerButton = React.forwardRef<HTMLButtonElement, ColorPickerProps>(\n function ForwardRefColorPickerButton({ className, colorDefs, disabled, dropDownTitle, initialColor, numColumns, onColorPick, readonly, round, showCaret, style }, ref) {\n const target = React.useRef<HTMLButtonElement>();\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(initialColor);\n\n // See if new initialColor props have changed since component mounted\n React.useEffect(() => {\n setColorDef(initialColor);\n }, [initialColor]);\n\n const defaultColors = React.useRef(\n [\n ColorDef.create(ColorByName.red),\n ColorDef.create(ColorByName.orange),\n ColorDef.create(ColorByName.yellow),\n ColorDef.create(ColorByName.green),\n ColorDef.create(ColorByName.blue),\n ColorDef.create(ColorByName.indigo),\n ColorDef.create(ColorByName.violet),\n ColorDef.create(ColorByName.black),\n ColorDef.create(ColorByName.white),\n ColorDef.create(ColorByName.cyan),\n ColorDef.create(ColorByName.fuchsia),\n ColorDef.create(ColorByName.tan),\n ColorDef.create(ColorByName.gray),\n ColorDef.create(ColorByName.brown),\n ColorDef.create(ColorByName.purple),\n ColorDef.create(ColorByName.olive),\n ]);\n\n const closePopup = React.useCallback(() => {\n setShowPopup(false);\n }, []);\n\n const togglePopup = React.useCallback(() => {\n setShowPopup(!showPopup);\n }, [showPopup]);\n\n const handleColorPicked = React.useCallback((color: ColorDef) => {\n closePopup();\n\n // istanbul ignore else\n if (!color.equals(colorDef)) {\n setColorDef(color);\n onColorPick && onColorPick(color);\n }\n }, [closePopup, colorDef, onColorPick]);\n\n const rgbaString = getCSSColorFromDef(colorDef);\n\n const buttonStyle = { ...style } as React.CSSProperties;\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\n\n const buttonClassNames = classnames(\"components-colorpicker-button\",\n round && \"round\",\n readonly && \"readonly\",\n className,\n );\n\n const colorOptions = colorDefs && colorDefs.length ? colorDefs : defaultColors.current;\n return (\n <>\n <button data-testid=\"components-colorpicker-button\" data-value={rgbaString} onClick={togglePopup} className={buttonClassNames}\n style={buttonStyle} disabled={disabled} ref={refs} >\n <div className=\"components-colorpicker-button-container\">\n <div className=\"components-colorpicker-button-color-swatch\" style={swatchStyle} />\n {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={RelativePosition.BottomLeft}\n onClose={closePopup}\n target={target.current}\n closeOnNestedPopupOutsideClick\n >\n <ColorOptions handleColorPicked={handleColorPicked} options={colorOptions} numColumns={numColumns ?? 4} round={!!round} title={dropDownTitle} />\n </Popup>\n </>\n );\n }\n);\n\n/** ColorPickerButton component\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\n * @beta\n */\nexport const ColorPickerButton: (props: ColorPickerProps) => JSX.Element | null = ForwardRefColorPickerButton;\n\n"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
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-button {
|
|
9
|
+
font-family: $iui-font-family;
|
|
10
|
+
font-size: $iui-font-size;
|
|
11
|
+
color: $buic-foreground-body;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
border: 1px solid transparent;
|
|
14
|
+
border-radius: 3px;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
border: none;
|
|
17
|
+
padding: 0;
|
|
18
|
+
|
|
19
|
+
>.components-colorpicker-button-container {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: center;
|
|
23
|
+
border-radius: 3px;
|
|
24
|
+
|
|
25
|
+
>.components-colorpicker-button-color-swatch {
|
|
26
|
+
border: 1px solid $buic-inputs-border;
|
|
27
|
+
border-radius: 3px;
|
|
28
|
+
width: 1.25em;
|
|
29
|
+
height: 1.25em;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
>.components-caret {
|
|
33
|
+
margin-left: .25em;
|
|
34
|
+
margin-right: .25em;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:not(.readonly) {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:disabled {
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
|
|
45
|
+
>.components-colorpicker-button-container {
|
|
46
|
+
>.components-caret {
|
|
47
|
+
color: $buic-icon-color-disabled;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.round {
|
|
53
|
+
.components-colorpicker-button-container {
|
|
54
|
+
border-bottom-left-radius: 50%;
|
|
55
|
+
border-top-left-radius: 50%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.components-colorpicker-button-color-swatch {
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.components-colorpicker-popup {
|
|
66
|
+
border: 1px solid $buic-inputs-border;
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
|
|
69
|
+
.components-colorpicker-popup-container {
|
|
70
|
+
color: $buic-foreground-body;
|
|
71
|
+
background: $buic-background-control;
|
|
72
|
+
border-radius: 6px;
|
|
73
|
+
|
|
74
|
+
>.components-colorpicker-popup-colors {
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-gap: 8px;
|
|
77
|
+
padding: 8px;
|
|
78
|
+
|
|
79
|
+
>.components-colorpicker-swatch {
|
|
80
|
+
height: 1.5em;
|
|
81
|
+
width: 1.5em;
|
|
82
|
+
transition: scale 0.2s ease;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
outline: none;
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
transform: scale(1.15);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="react" />
|
|
5
|
+
import { ColorDef } from "@itwin/core-common";
|
|
6
|
+
/** Properties for the [[ColorPickerDialog]] React component
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export interface ColorPickerDialogProps {
|
|
10
|
+
dialogTitle: string;
|
|
11
|
+
color: ColorDef;
|
|
12
|
+
onOkResult: (selectedColor: ColorDef) => void;
|
|
13
|
+
onCancelResult: () => void;
|
|
14
|
+
colorPresets?: ColorDef[];
|
|
15
|
+
/** If set show either HSL or RGB input values. If undefined no input value is shown */
|
|
16
|
+
colorInputType?: "HSL" | "RGB";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Color Picker Dialog to use as modal dialog.
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export declare function ColorPickerDialog({ dialogTitle, color, onOkResult, onCancelResult, colorPresets, colorInputType }: ColorPickerDialogProps): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=ColorPickerDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerDialog.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerDialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAOH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,UAAU,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC9C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,uFAAuF;IACvF,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,sBAAsB,eAwCzI"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { DialogButtonType } from "@itwin/appui-abstract";
|
|
11
|
+
import { Dialog } from "@itwin/core-react";
|
|
12
|
+
import { ColorPickerPanel } from "./ColorPickerPanel";
|
|
13
|
+
/**
|
|
14
|
+
* Color Picker Dialog to use as modal dialog.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export function ColorPickerDialog({ dialogTitle, color, onOkResult, onCancelResult, colorPresets, colorInputType }) {
|
|
18
|
+
const [activeColor, setActiveColor] = React.useState(color);
|
|
19
|
+
const dialogContainer = React.useRef(null);
|
|
20
|
+
const handleOk = React.useCallback(() => {
|
|
21
|
+
onOkResult(activeColor);
|
|
22
|
+
}, [onOkResult, activeColor]);
|
|
23
|
+
const handleCancel = React.useCallback(() => {
|
|
24
|
+
// istanbul ignore else
|
|
25
|
+
if (onCancelResult)
|
|
26
|
+
onCancelResult();
|
|
27
|
+
}, [onCancelResult]);
|
|
28
|
+
const handleColorChange = React.useCallback((newColorDef) => {
|
|
29
|
+
setActiveColor(newColorDef);
|
|
30
|
+
}, []);
|
|
31
|
+
const buttonCluster = React.useMemo(() => [
|
|
32
|
+
{ type: DialogButtonType.OK, onClick: handleOk },
|
|
33
|
+
{ type: DialogButtonType.Cancel, onClick: handleCancel },
|
|
34
|
+
], [handleCancel, handleOk]);
|
|
35
|
+
return (React.createElement("div", { ref: dialogContainer },
|
|
36
|
+
React.createElement(Dialog, { title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 340, maxWidth: 400 },
|
|
37
|
+
React.createElement(ColorPickerPanel, { colorInputType: colorInputType, activeColor: activeColor, colorPresets: colorPresets, onColorChange: handleColorChange }))));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=ColorPickerDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerDialog.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAetD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAA0B;IACxI,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE3D,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACtC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;IAC9B,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC1C,uBAAuB;QACvB,IAAI,cAAc;YAChB,cAAc,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,WAAqB,EAAE,EAAE;QACpE,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACxC,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAChD,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;KACzD,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,6BAAK,GAAG,EAAE,eAAe;QACvB,oBAAC,MAAM,IACL,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,IAAI,EACX,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,GAAG;YAEb,oBAAC,gBAAgB,IAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,GAAI,CACrI,CACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Color\n */\n\n// cSpell:ignore colorpicker\n\nimport * as React from \"react\";\nimport { DialogButtonType } from \"@itwin/appui-abstract\";\nimport { Dialog } from \"@itwin/core-react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { ColorPickerPanel } from \"./ColorPickerPanel\";\n\n/** Properties for the [[ColorPickerDialog]] React component\n * @beta\n */\nexport interface ColorPickerDialogProps {\n dialogTitle: string;\n color: ColorDef;\n onOkResult: (selectedColor: ColorDef) => void;\n onCancelResult: () => void;\n colorPresets?: ColorDef[];\n /** If set show either HSL or RGB input values. If undefined no input value is shown */\n colorInputType?: \"HSL\" | \"RGB\";\n}\n\n/**\n * Color Picker Dialog to use as modal dialog.\n * @beta\n */\nexport function ColorPickerDialog({ dialogTitle, color, onOkResult, onCancelResult, colorPresets, colorInputType }: ColorPickerDialogProps) {\n const [activeColor, setActiveColor] = React.useState(color);\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const handleOk = React.useCallback(() => {\n onOkResult(activeColor);\n }, [onOkResult, activeColor]);\n const handleCancel = React.useCallback(() => {\n // istanbul ignore else\n if (onCancelResult)\n onCancelResult();\n }, [onCancelResult]);\n\n const handleColorChange = React.useCallback((newColorDef: ColorDef) => {\n setActiveColor(newColorDef);\n }, []);\n\n const buttonCluster = React.useMemo(() => [\n { type: DialogButtonType.OK, onClick: handleOk },\n { type: DialogButtonType.Cancel, onClick: handleCancel },\n ], [handleCancel, handleOk]);\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n buttonCluster={buttonCluster}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={340}\n maxWidth={400}\n >\n <ColorPickerPanel colorInputType={colorInputType} activeColor={activeColor} colorPresets={colorPresets} onColorChange={handleColorChange} />\n </Dialog>\n </div >\n );\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="react" />
|
|
5
|
+
import { ColorDef } from "@itwin/core-common";
|
|
6
|
+
import "./ColorPickerPanel.scss";
|
|
7
|
+
/** Properties for the [[ColorPickerPanel]] React component
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface ColorPickerPanelProps {
|
|
11
|
+
activeColor: ColorDef;
|
|
12
|
+
onColorChange: (selectedColor: ColorDef) => void;
|
|
13
|
+
colorPresets?: ColorDef[];
|
|
14
|
+
/** If set show either HSL or RGB input values. If undefined no input value is shown */
|
|
15
|
+
colorInputType?: "HSL" | "RGB";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Color Picker Dialog to use as modal dialog.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps): JSX.Element;
|
|
22
|
+
//# sourceMappingURL=ColorPickerPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerPanel.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPanel.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAKH,OAAO,EAAE,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AAIxD,OAAO,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,QAAQ,CAAC;IACtB,aAAa,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,uFAAuF;IACvF,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAChC;AAED;;;GAGG;AAEH,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,qBAAqB,eAuInH"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Color
|
|
7
|
+
*/
|
|
8
|
+
// cSpell:ignore colorpicker
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { ColorDef } from "@itwin/core-common";
|
|
11
|
+
import { ColorSwatch } from "./Swatch";
|
|
12
|
+
import { HueSlider } from "./HueSlider";
|
|
13
|
+
import { SaturationPicker } from "./SaturationPicker";
|
|
14
|
+
import "./ColorPickerPanel.scss";
|
|
15
|
+
import { NumberInput } from "@itwin/core-react";
|
|
16
|
+
/**
|
|
17
|
+
* Color Picker Dialog to use as modal dialog.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
// istanbul ignore next
|
|
21
|
+
export function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }) {
|
|
22
|
+
const handlePresetColorPick = React.useCallback((newColor, e) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
if (onColorChange) {
|
|
25
|
+
onColorChange(newColor);
|
|
26
|
+
}
|
|
27
|
+
}, [onColorChange]);
|
|
28
|
+
const handleHueChange = React.useCallback((newHsvColor) => {
|
|
29
|
+
// for a ColorDef to be created from hsv s can't be 0
|
|
30
|
+
if (newHsvColor.s === 0) {
|
|
31
|
+
newHsvColor = newHsvColor.clone(undefined, 0.5);
|
|
32
|
+
}
|
|
33
|
+
const newColorDef = newHsvColor.toColorDef();
|
|
34
|
+
if (onColorChange) {
|
|
35
|
+
onColorChange(newColorDef);
|
|
36
|
+
}
|
|
37
|
+
}, [onColorChange]);
|
|
38
|
+
const handleSaturationChange = React.useCallback((newHsvColor) => {
|
|
39
|
+
const newColorDef = newHsvColor.toColorDef();
|
|
40
|
+
if (onColorChange) {
|
|
41
|
+
onColorChange(newColorDef);
|
|
42
|
+
}
|
|
43
|
+
}, [onColorChange]);
|
|
44
|
+
const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);
|
|
45
|
+
const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);
|
|
46
|
+
const color = React.useMemo(() => activeColor.colors, [activeColor]);
|
|
47
|
+
const handleLightnessValueChange = React.useCallback((value, _stringValue) => {
|
|
48
|
+
const newHsl = currentHsl.clone(undefined, undefined, (value !== null && value !== void 0 ? value : 0) / 100);
|
|
49
|
+
if (onColorChange) {
|
|
50
|
+
const newColorDef = newHsl.toColorDef();
|
|
51
|
+
onColorChange(newColorDef);
|
|
52
|
+
}
|
|
53
|
+
}, [currentHsl, onColorChange]);
|
|
54
|
+
const handleHueValueChange = React.useCallback((value, _stringValue) => {
|
|
55
|
+
const newHsl = currentHsl.clone((value !== null && value !== void 0 ? value : 0) / 360, undefined, undefined);
|
|
56
|
+
if (onColorChange) {
|
|
57
|
+
const newColorDef = newHsl.toColorDef();
|
|
58
|
+
onColorChange(newColorDef);
|
|
59
|
+
}
|
|
60
|
+
}, [currentHsl, onColorChange]);
|
|
61
|
+
const handleSaturationValueChange = React.useCallback((value, _stringValue) => {
|
|
62
|
+
const newHsl = currentHsl.clone(undefined, (value !== null && value !== void 0 ? value : 0) / 100, undefined);
|
|
63
|
+
if (onColorChange) {
|
|
64
|
+
const newColorDef = newHsl.toColorDef();
|
|
65
|
+
onColorChange(newColorDef);
|
|
66
|
+
}
|
|
67
|
+
}, [currentHsl, onColorChange]);
|
|
68
|
+
const handleRedChange = React.useCallback((value, _stringValue) => {
|
|
69
|
+
if (undefined !== value) {
|
|
70
|
+
const newColorDef = ColorDef.from(value, color.g, color.b);
|
|
71
|
+
if (onColorChange) {
|
|
72
|
+
onColorChange(newColorDef);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [color, onColorChange]);
|
|
76
|
+
const handleGreenChange = React.useCallback((value, _stringValue) => {
|
|
77
|
+
if (undefined !== value) {
|
|
78
|
+
const newColorDef = ColorDef.from(color.r, value, color.b);
|
|
79
|
+
if (onColorChange) {
|
|
80
|
+
onColorChange(newColorDef);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [color, onColorChange]);
|
|
84
|
+
const handleBlueChange = React.useCallback((value, _stringValue) => {
|
|
85
|
+
if (undefined !== value) {
|
|
86
|
+
const newColorDef = ColorDef.from(color.r, color.g, value);
|
|
87
|
+
if (onColorChange) {
|
|
88
|
+
onColorChange(newColorDef);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, [color, onColorChange]);
|
|
92
|
+
return (React.createElement("div", { "data-testid": "components-colorpicker-panel", className: "components-colorpicker-panel" },
|
|
93
|
+
React.createElement("div", { className: "components-colorpicker-panel-color" },
|
|
94
|
+
React.createElement("div", { className: "components-colorpicker-saturation" },
|
|
95
|
+
React.createElement(SaturationPicker, { hsv: currentHsv, onSaturationChange: handleSaturationChange })),
|
|
96
|
+
React.createElement("div", { className: "components-colorpicker-hue" },
|
|
97
|
+
React.createElement(HueSlider, { hsv: currentHsv, onHueChange: handleHueChange, isHorizontal: false }))),
|
|
98
|
+
(colorInputType === "RGB") &&
|
|
99
|
+
React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
|
|
100
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
101
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "R"),
|
|
102
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-red", value: color.r, onChange: handleRedChange, min: 0, max: 255 })),
|
|
103
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
104
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "G"),
|
|
105
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-green", value: color.g, onChange: handleGreenChange, min: 0, max: 255 })),
|
|
106
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
107
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "B"),
|
|
108
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-blue", value: color.b, onChange: handleBlueChange, min: 0, max: 255 }))),
|
|
109
|
+
(colorInputType === "HSL") &&
|
|
110
|
+
React.createElement("div", { "data-testid": "components-colorpicker-input-panel", className: "components-colorpicker-input-panel" },
|
|
111
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
112
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "H"),
|
|
113
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-hue", value: Math.round(currentHsl.h * 360), onChange: handleHueValueChange, min: 0, max: 360 })),
|
|
114
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
115
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "S"),
|
|
116
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-saturation", value: Math.round(currentHsl.s * 100), onChange: handleSaturationValueChange, min: 0, max: 100 })),
|
|
117
|
+
React.createElement("div", { className: "components-colorpicker-input-value-wrapper" },
|
|
118
|
+
React.createElement("span", { className: "uicore-inputs-labeled-input" }, "L"),
|
|
119
|
+
React.createElement(NumberInput, { "data-testid": "components-colorpicker-input-value-lightness", value: Math.round(currentHsl.l * 100), onChange: handleLightnessValueChange, min: 0, max: 100 }))),
|
|
120
|
+
colorPresets && colorPresets.length &&
|
|
121
|
+
React.createElement("div", { className: "components-colorpicker-panel-presets" }, colorPresets.map((preset, index) => React.createElement(ColorSwatch, { className: "components-colorpicker-panel-swatch", key: index, colorDef: preset, round: false, onColorPick: handlePresetColorPick })))));
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=ColorPickerPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPanel.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAA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AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Color\n */\n\n// cSpell:ignore colorpicker\n\nimport * as React from \"react\";\nimport { ColorDef, HSVColor } from \"@itwin/core-common\";\nimport { ColorSwatch } from \"./Swatch\";\nimport { HueSlider } from \"./HueSlider\";\nimport { SaturationPicker } from \"./SaturationPicker\";\nimport \"./ColorPickerPanel.scss\";\nimport { NumberInput } from \"@itwin/core-react\";\n\n/** Properties for the [[ColorPickerPanel]] React component\n * @public\n */\nexport interface ColorPickerPanelProps {\n activeColor: ColorDef;\n onColorChange: (selectedColor: ColorDef) => void;\n colorPresets?: ColorDef[];\n /** If set show either HSL or RGB input values. If undefined no input value is shown */\n colorInputType?: \"HSL\" | \"RGB\";\n}\n\n/**\n * Color Picker Dialog to use as modal dialog.\n * @public\n */\n// istanbul ignore next\nexport function ColorPickerPanel({ activeColor, onColorChange, colorPresets, colorInputType }: ColorPickerPanelProps) {\n\n const handlePresetColorPick = React.useCallback((newColor: ColorDef, e: React.MouseEvent<Element, MouseEvent>) => {\n e.preventDefault();\n if (onColorChange) {\n onColorChange(newColor);\n }\n }, [onColorChange]);\n\n const handleHueChange = React.useCallback((newHsvColor: HSVColor) => {\n // for a ColorDef to be created from hsv s can't be 0\n if (newHsvColor.s === 0) {\n newHsvColor = newHsvColor.clone(undefined, 0.5);\n }\n\n const newColorDef = newHsvColor.toColorDef();\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }, [onColorChange]);\n\n const handleSaturationChange = React.useCallback((newHsvColor: HSVColor) => {\n const newColorDef = newHsvColor.toColorDef();\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }, [onColorChange]);\n\n const currentHsl = React.useMemo(() => activeColor.toHSL(), [activeColor]);\n const currentHsv = React.useMemo(() => activeColor.toHSV(), [activeColor]);\n const color = React.useMemo(() => activeColor.colors, [activeColor]);\n\n const handleLightnessValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone(undefined, undefined, (value ?? 0) / 100);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleHueValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone((value ?? 0) / 360, undefined, undefined);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleSaturationValueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n const newHsl = currentHsl.clone(undefined, (value ?? 0) / 100, undefined);\n\n if (onColorChange) {\n const newColorDef = newHsl.toColorDef();\n onColorChange(newColorDef);\n }\n }, [currentHsl, onColorChange]);\n\n const handleRedChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(value, color.g, color.b);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n const handleGreenChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(color.r, value, color.b);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n const handleBlueChange = React.useCallback((value: number | undefined, _stringValue: string) => {\n if (undefined !== value) {\n const newColorDef = ColorDef.from(color.r, color.g, value);\n if (onColorChange) {\n onColorChange(newColorDef);\n }\n }\n }, [color, onColorChange]);\n\n return (\n <div data-testid=\"components-colorpicker-panel\" className=\"components-colorpicker-panel\">\n <div className=\"components-colorpicker-panel-color\">\n <div className=\"components-colorpicker-saturation\">\n <SaturationPicker hsv={currentHsv} onSaturationChange={handleSaturationChange} />\n </div>\n <div className=\"components-colorpicker-hue\">\n <HueSlider hsv={currentHsv} onHueChange={handleHueChange} isHorizontal={false} />\n </div>\n </div>\n {(colorInputType === \"RGB\") &&\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">R</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-red\" value={color.r} onChange={handleRedChange} min={0} max={255} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">G</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-green\" value={color.g} onChange={handleGreenChange} min={0} max={255} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">B</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-blue\" value={color.b} onChange={handleBlueChange} min={0} max={255} />\n </div>\n </div>}\n {(colorInputType === \"HSL\") &&\n <div data-testid=\"components-colorpicker-input-panel\" className=\"components-colorpicker-input-panel\">\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">H</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-hue\" value={Math.round(currentHsl.h * 360)} onChange={handleHueValueChange} min={0} max={360} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">S</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-saturation\" value={Math.round(currentHsl.s * 100)} onChange={handleSaturationValueChange} min={0} max={100} />\n </div>\n <div className=\"components-colorpicker-input-value-wrapper\">\n <span className=\"uicore-inputs-labeled-input\">L</span>\n <NumberInput data-testid=\"components-colorpicker-input-value-lightness\" value={Math.round(currentHsl.l * 100)} onChange={handleLightnessValueChange} min={0} max={100} />\n </div>\n </div>}\n\n {\n colorPresets && colorPresets.length &&\n <div className=\"components-colorpicker-panel-presets\">\n {colorPresets.map((preset, index) => <ColorSwatch className=\"components-colorpicker-panel-swatch\" key={index} colorDef={preset} round={false} onColorPick={handlePresetColorPick} />)}\n </div>\n }\n </div>\n );\n}\n"]}
|