@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,188 @@
|
|
|
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 "./SaturationPicker.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { ColorDef, HSVColor } from "@itwin/core-common";
|
|
12
|
+
import { SpecialKey } from "@itwin/appui-abstract";
|
|
13
|
+
import { UiIModelComponents } from "../UiIModelComponents";
|
|
14
|
+
function calculateChange(e, hsv, container) {
|
|
15
|
+
const { width: containerWidth, height: containerHeight, top: containerTop, left: containerLeft } = container.getBoundingClientRect();
|
|
16
|
+
let x;
|
|
17
|
+
if ("pageX" in e) {
|
|
18
|
+
x = e.pageX;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// istanbul ignore next
|
|
22
|
+
if (undefined !== e.touches && e.touches.length)
|
|
23
|
+
x = e.touches[0].pageX;
|
|
24
|
+
}
|
|
25
|
+
// istanbul ignore if
|
|
26
|
+
if (undefined === x)
|
|
27
|
+
return hsv;
|
|
28
|
+
let y = 0;
|
|
29
|
+
if ("pageY" in e) {
|
|
30
|
+
y = e.pageY;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// istanbul ignore next
|
|
34
|
+
if (undefined !== e.touches && e.touches.length)
|
|
35
|
+
y = e.touches[0].pageY;
|
|
36
|
+
}
|
|
37
|
+
// istanbul ignore if
|
|
38
|
+
if (undefined === y)
|
|
39
|
+
return hsv;
|
|
40
|
+
let left = x - (containerLeft + window.scrollX);
|
|
41
|
+
let top = y - (containerTop + window.scrollY);
|
|
42
|
+
// istanbul ignore next
|
|
43
|
+
if (left < 0) {
|
|
44
|
+
left = 0;
|
|
45
|
+
}
|
|
46
|
+
else if (left > containerWidth) {
|
|
47
|
+
left = containerWidth;
|
|
48
|
+
}
|
|
49
|
+
else if (top < 0) {
|
|
50
|
+
top = 0;
|
|
51
|
+
}
|
|
52
|
+
else if (top > containerHeight) {
|
|
53
|
+
top = containerHeight;
|
|
54
|
+
}
|
|
55
|
+
let saturation = Math.round((left * 100) / containerWidth);
|
|
56
|
+
let value = Math.round(-((top * 100) / containerHeight) + 100);
|
|
57
|
+
// istanbul ignore if
|
|
58
|
+
if (saturation < 0)
|
|
59
|
+
saturation = 0;
|
|
60
|
+
// istanbul ignore if
|
|
61
|
+
if (saturation > 100)
|
|
62
|
+
saturation = 100;
|
|
63
|
+
// istanbul ignore if
|
|
64
|
+
if (value < 0)
|
|
65
|
+
value = 0;
|
|
66
|
+
// istanbul ignore if
|
|
67
|
+
if (value > 100)
|
|
68
|
+
value = 100;
|
|
69
|
+
return hsv.clone(hsv.h, saturation, value);
|
|
70
|
+
}
|
|
71
|
+
/** SaturationPicker component used to set the saturation value.
|
|
72
|
+
* @beta
|
|
73
|
+
*/
|
|
74
|
+
export function SaturationPicker({ onSaturationChange, hsv, className, style }) {
|
|
75
|
+
const container = React.useRef(null);
|
|
76
|
+
const [saturationLabel] = React.useState(() => UiIModelComponents.translate("color.saturation"));
|
|
77
|
+
const isDragging = React.useRef(false);
|
|
78
|
+
const onChange = React.useCallback((e) => {
|
|
79
|
+
// istanbul ignore else
|
|
80
|
+
if (container.current) {
|
|
81
|
+
const newHsvColor = calculateChange(e, hsv, container.current);
|
|
82
|
+
// istanbul ignore else
|
|
83
|
+
if (newHsvColor) {
|
|
84
|
+
// istanbul ignore else
|
|
85
|
+
if (onSaturationChange)
|
|
86
|
+
onSaturationChange(newHsvColor);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [hsv, onSaturationChange]);
|
|
90
|
+
const onDragging = React.useCallback((e) => {
|
|
91
|
+
// istanbul ignore else
|
|
92
|
+
if (isDragging.current) {
|
|
93
|
+
onChange(e);
|
|
94
|
+
}
|
|
95
|
+
}, [onChange]);
|
|
96
|
+
const onMouseUp = React.useCallback(() => {
|
|
97
|
+
// istanbul ignore else
|
|
98
|
+
if (isDragging.current) {
|
|
99
|
+
isDragging.current = false;
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
102
|
+
const onTouchEnd = React.useCallback((event) => {
|
|
103
|
+
// istanbul ignore else
|
|
104
|
+
if (isDragging.current) {
|
|
105
|
+
onChange(event);
|
|
106
|
+
isDragging.current = false;
|
|
107
|
+
}
|
|
108
|
+
}, [onChange]);
|
|
109
|
+
const onMouseDown = React.useCallback((e) => {
|
|
110
|
+
// istanbul ignore else
|
|
111
|
+
if (e.target !== e.currentTarget) {
|
|
112
|
+
isDragging.current = true;
|
|
113
|
+
document.addEventListener("mouseup", onMouseUp, { capture: true, once: true });
|
|
114
|
+
}
|
|
115
|
+
onChange(e);
|
|
116
|
+
// istanbul ignore else
|
|
117
|
+
if (container.current)
|
|
118
|
+
container.current.focus();
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
}, [onChange, onMouseUp]);
|
|
121
|
+
const onTouchStart = React.useCallback((e) => {
|
|
122
|
+
// istanbul ignore else
|
|
123
|
+
if (e.target !== e.currentTarget)
|
|
124
|
+
isDragging.current = true;
|
|
125
|
+
onChange(e);
|
|
126
|
+
// istanbul ignore else
|
|
127
|
+
if (container.current)
|
|
128
|
+
container.current.focus();
|
|
129
|
+
}, [onChange]);
|
|
130
|
+
const onKeyDown = React.useCallback((evt) => {
|
|
131
|
+
const h = hsv.h;
|
|
132
|
+
let { s, v } = { ...hsv };
|
|
133
|
+
if (evt.key === SpecialKey.ArrowLeft) {
|
|
134
|
+
s -= (evt.ctrlKey ? 10 : 1);
|
|
135
|
+
}
|
|
136
|
+
else if (evt.key === SpecialKey.ArrowDown) {
|
|
137
|
+
v -= (evt.ctrlKey ? 10 : 1);
|
|
138
|
+
}
|
|
139
|
+
else if (evt.key === SpecialKey.ArrowRight) {
|
|
140
|
+
s += (evt.ctrlKey ? 10 : 1);
|
|
141
|
+
}
|
|
142
|
+
else if (evt.key === SpecialKey.ArrowUp) {
|
|
143
|
+
v += (evt.ctrlKey ? 10 : 1);
|
|
144
|
+
}
|
|
145
|
+
else if (evt.key === SpecialKey.PageDown) {
|
|
146
|
+
v = 0;
|
|
147
|
+
}
|
|
148
|
+
else if (evt.key === SpecialKey.PageUp) {
|
|
149
|
+
v = 100;
|
|
150
|
+
}
|
|
151
|
+
else if (evt.key === SpecialKey.Home) {
|
|
152
|
+
s = 0;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
// istanbul ignore else
|
|
156
|
+
if (evt.key === SpecialKey.End) {
|
|
157
|
+
s = 100;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// istanbul ignore if
|
|
161
|
+
if (s < 0)
|
|
162
|
+
s = 0;
|
|
163
|
+
// istanbul ignore if
|
|
164
|
+
if (s > 100)
|
|
165
|
+
s = 100;
|
|
166
|
+
// istanbul ignore if
|
|
167
|
+
if (v < 0)
|
|
168
|
+
v = 0;
|
|
169
|
+
// istanbul ignore if
|
|
170
|
+
if (v > 100)
|
|
171
|
+
v = 100;
|
|
172
|
+
const newColor = new HSVColor(h, s, v);
|
|
173
|
+
// istanbul ignore else
|
|
174
|
+
if (onSaturationChange)
|
|
175
|
+
onSaturationChange(newColor);
|
|
176
|
+
evt.preventDefault();
|
|
177
|
+
}, [hsv, onSaturationChange]);
|
|
178
|
+
const pointerStyle = React.useMemo(() => ({
|
|
179
|
+
left: `${hsv.s}%`,
|
|
180
|
+
top: `${-(hsv.v) + 100}%`,
|
|
181
|
+
backgroundColor: `${ColorDef.fromHSV(hsv).toRgbString()}`,
|
|
182
|
+
}), [hsv]);
|
|
183
|
+
const colorStyle = React.useMemo(() => ({ backgroundColor: `hsl(${hsv.h} ,100%, 50%)` }), [hsv]);
|
|
184
|
+
return (React.createElement("div", { className: classnames("components-saturation-container", className), style: style, "data-testid": "saturation-container" },
|
|
185
|
+
React.createElement("div", { "data-testid": "saturation-region", role: "slider", "aria-label": saturationLabel, "aria-valuenow": hsv.s, style: colorStyle, className: "components-saturation-region", ref: container, onMouseDown: onMouseDown, onMouseMove: onDragging, onTouchMove: onDragging, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd, tabIndex: 0, onKeyDown: onKeyDown },
|
|
186
|
+
React.createElement("div", { style: pointerStyle, className: "components-saturation-pointer", "data-testid": "saturation-pointer" }))));
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=SaturationPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaturationPicker.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/SaturationPicker.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,SAAS,eAAe,CAAC,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B,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAwB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7D,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG;QACjB,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG;QACzB,eAAe,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;KAC1D,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEX,MAAM,UAAU,GAAwB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,GAAG,CAAC,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEtH,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,iCAAiC,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,iBAAc,sBAAsB;QACxH,4CACc,mBAAmB,EAC/B,IAAI,EAAC,QAAQ,gBAAa,eAAe,mBAAiB,GAAG,CAAC,CAAC,EAC/D,KAAK,EAAE,UAAU,EACjB,SAAS,EAAC,8BAA8B,EACxC,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,SAAS;YAEpB,6BAAK,KAAK,EAAE,YAAY,EAAE,SAAS,EAAC,+BAA+B,iBAAa,oBAAoB,GAAG,CACnG,CACD,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\nimport \"./SaturationPicker.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef, HSVColor } from \"@itwin/core-common\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\nfunction calculateChange(e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n hsv: HSVColor, container: HTMLDivElement): HSVColor | undefined {\n const { width: containerWidth, height: containerHeight, top: containerTop, left: containerLeft } = container.getBoundingClientRect();\n\n let x: number | undefined;\n if (\"pageX\" in e) {\n x = e.pageX;\n } else {\n // istanbul ignore next\n if (undefined !== e.touches && e.touches.length)\n x = e.touches[0].pageX;\n }\n // istanbul ignore if\n if (undefined === x)\n return hsv;\n\n let y = 0;\n if (\"pageY\" in e) {\n y = e.pageY;\n } else {\n // istanbul ignore next\n if (undefined !== e.touches && e.touches.length)\n y = e.touches[0].pageY;\n }\n // istanbul ignore if\n if (undefined === y)\n return hsv;\n\n let left = x - (containerLeft + window.scrollX);\n let top = y - (containerTop + window.scrollY);\n\n // istanbul ignore next\n if (left < 0) {\n left = 0;\n } else if (left > containerWidth) {\n left = containerWidth;\n } else if (top < 0) {\n top = 0;\n } else if (top > containerHeight) {\n top = containerHeight;\n }\n\n let saturation = Math.round((left * 100) / containerWidth);\n let value = Math.round(-((top * 100) / containerHeight) + 100);\n\n // istanbul ignore if\n if (saturation < 0)\n saturation = 0;\n // istanbul ignore if\n if (saturation > 100)\n saturation = 100;\n // istanbul ignore if\n if (value < 0)\n value = 0;\n // istanbul ignore if\n if (value > 100)\n value = 100;\n\n return hsv.clone(hsv.h, saturation, value);\n}\n\n/** Properties for the [[SaturationPicker]] React component\n * @beta\n */\nexport interface SaturationPickerProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {\n /** function to run when user selects location in saturation region */\n onSaturationChange?: ((saturation: HSVColor) => void) | undefined;\n /** HSV Color Value */\n hsv: HSVColor;\n}\n\n/** SaturationPicker component used to set the saturation value.\n * @beta\n */\nexport function SaturationPicker({ onSaturationChange, hsv, className, style }: SaturationPickerProps) {\n const container = React.useRef<HTMLDivElement>(null);\n const [saturationLabel] = React.useState(() => UiIModelComponents.translate(\"color.saturation\"));\n const isDragging = React.useRef(false);\n\n const onChange = React.useCallback((e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (container.current) {\n const newHsvColor = calculateChange(e, hsv, container.current);\n // istanbul ignore else\n if (newHsvColor) {\n // istanbul ignore else\n if (onSaturationChange)\n onSaturationChange(newHsvColor);\n }\n }\n }, [hsv, onSaturationChange]);\n\n const onDragging = React.useCallback((e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (isDragging.current) {\n onChange(e);\n }\n }, [onChange]);\n\n const onMouseUp = React.useCallback(() => {\n // istanbul ignore else\n if (isDragging.current) {\n isDragging.current = false;\n }\n }, []);\n\n const onTouchEnd = React.useCallback((event: React.TouchEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (isDragging.current) {\n onChange(event);\n isDragging.current = false;\n }\n }, [onChange]);\n\n const onMouseDown = React.useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (e.target !== e.currentTarget) {\n isDragging.current = true;\n document.addEventListener(\"mouseup\", onMouseUp, { capture: true, once: true });\n }\n\n onChange(e);\n\n // istanbul ignore else\n if (container.current)\n container.current.focus();\n\n e.preventDefault();\n }, [onChange, onMouseUp]);\n\n const onTouchStart = React.useCallback((e: React.TouchEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (e.target !== e.currentTarget)\n isDragging.current = true;\n\n onChange(e);\n\n // istanbul ignore else\n if (container.current)\n container.current.focus();\n }, [onChange]);\n\n const onKeyDown = React.useCallback((evt: React.KeyboardEvent<HTMLDivElement>) => {\n const h = hsv.h;\n let { s, v } = { ...hsv };\n if (evt.key === SpecialKey.ArrowLeft) {\n s -= (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === SpecialKey.ArrowDown) {\n v -= (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === SpecialKey.ArrowRight) {\n s += (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === SpecialKey.ArrowUp) {\n v += (evt.ctrlKey ? 10 : 1);\n } else if (evt.key === SpecialKey.PageDown) {\n v = 0;\n } else if (evt.key === SpecialKey.PageUp) {\n v = 100;\n } else if (evt.key === SpecialKey.Home) {\n s = 0;\n } else {\n // istanbul ignore else\n if (evt.key === SpecialKey.End) {\n s = 100;\n }\n }\n\n // istanbul ignore if\n if (s < 0)\n s = 0;\n // istanbul ignore if\n if (s > 100)\n s = 100;\n // istanbul ignore if\n if (v < 0)\n v = 0;\n // istanbul ignore if\n if (v > 100)\n v = 100;\n\n const newColor = new HSVColor(h, s, v);\n // istanbul ignore else\n if (onSaturationChange)\n onSaturationChange(newColor);\n\n evt.preventDefault();\n }, [hsv, onSaturationChange]);\n\n const pointerStyle: React.CSSProperties = React.useMemo(() => ({\n left: `${hsv.s}%`,\n top: `${-(hsv.v) + 100}%`,\n backgroundColor: `${ColorDef.fromHSV(hsv).toRgbString()}`,\n }), [hsv]);\n\n const colorStyle: React.CSSProperties = React.useMemo(() => ({ backgroundColor: `hsl(${hsv.h} ,100%, 50%)` }), [hsv]);\n\n return (\n <div className={classnames(\"components-saturation-container\", className)} style={style} data-testid=\"saturation-container\" >\n <div\n data-testid=\"saturation-region\"\n role=\"slider\" aria-label={saturationLabel} aria-valuenow={hsv.s}\n style={colorStyle}\n className=\"components-saturation-region\"\n ref={container}\n onMouseDown={onMouseDown}\n onMouseMove={onDragging}\n onTouchMove={onDragging}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n tabIndex={0}\n onKeyDown={onKeyDown}\n >\n <div style={pointerStyle} className=\"components-saturation-pointer\" data-testid=\"saturation-pointer\" />\n </div>\n </div >\n );\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
|
|
6
|
+
.components-saturation-container {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
min-width: 100px;
|
|
10
|
+
min-height: 100px;
|
|
11
|
+
|
|
12
|
+
.components-saturation-region {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
|
|
17
|
+
background-size: cover, cover;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
|
|
20
|
+
.components-saturation-pointer {
|
|
21
|
+
position: absolute;
|
|
22
|
+
width: 2em;
|
|
23
|
+
height: 2em;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
box-shadow: rgba(0, 0, 0, 0.37) 0px 4px 4px 0px;
|
|
26
|
+
border: 2px solid #fff;
|
|
27
|
+
transform: translate(-1em, -1em);
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
outline: none;
|
|
31
|
+
border: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import "./Swatch.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 [[ColorSwatch]] React component
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface ColorSwatchProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
+
/** color specification */
|
|
13
|
+
colorDef: ColorDef;
|
|
14
|
+
/** function to run when user selects color swatch */
|
|
15
|
+
onColorPick?: ((color: ColorDef, e: React.MouseEvent) => void) | undefined;
|
|
16
|
+
/** Show swatches as squares unless round is set to true */
|
|
17
|
+
round?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** ColorSwatch Functional component displays a color swatch in a button
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export declare function ColorSwatch(props: ColorSwatchProps): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=Swatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Swatch.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/Swatch.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW;IAClG,0BAA0B;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3E,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eA2BlD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 "./Swatch.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { getCSSColorFromDef } from "./getCSSColorFromDef";
|
|
12
|
+
/** ColorSwatch Functional component displays a color swatch in a button
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export function ColorSwatch(props) {
|
|
16
|
+
const rgbaString = getCSSColorFromDef(props.colorDef);
|
|
17
|
+
const colorStyle = {
|
|
18
|
+
backgroundColor: rgbaString,
|
|
19
|
+
...props.style,
|
|
20
|
+
};
|
|
21
|
+
const handleClick = (e) => {
|
|
22
|
+
// istanbul ignore else
|
|
23
|
+
if (props && props.onColorPick)
|
|
24
|
+
props.onColorPick(props.colorDef, e);
|
|
25
|
+
};
|
|
26
|
+
const classes = classnames("components-color-swatch", props.round && "round", props.className);
|
|
27
|
+
const {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
onColorPick, colorDef, round, // do not pass on color swatch specific props
|
|
30
|
+
// eslint-disable-next-line comma-dangle
|
|
31
|
+
...otherProps // pass-through props
|
|
32
|
+
} = props;
|
|
33
|
+
return React.createElement("button", { ...otherProps, style: colorStyle, className: classes, onClick: handleClick });
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Swatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Swatch.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/Swatch.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAc1D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,UAAU,GAAwB;QACtC,eAAe,EAAE,UAAU;QAC3B,GAAG,KAAK,CAAC,KAAK;KACf,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAAmB,EAAE,EAAE;QAC1C,uBAAuB;QACvB,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW;YAC5B,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CACxB,yBAAyB,EACzB,KAAK,CAAC,KAAK,IAAI,OAAO,EACtB,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,MAAM;IACJ,6DAA6D;IAC7D,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,6CAA6C;IAC3E,wCAAwC;IACxC,GAAG,UAAU,CAAC,qBAAqB;MACpC,GAAG,KAAK,CAAC;IAEV,OAAO,mCAAY,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAI,CAAC;AACjG,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 \"./Swatch.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\n\n/** Properties for the [[ColorSwatch]] React component\n * @beta\n */\nexport interface ColorSwatchProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /** color specification */\n colorDef: ColorDef;\n /** function to run when user selects color swatch */\n onColorPick?: ((color: ColorDef, e: React.MouseEvent) => void) | undefined;\n /** Show swatches as squares unless round is set to true */\n round?: boolean;\n}\n\n/** ColorSwatch Functional component displays a color swatch in a button\n * @beta\n */\nexport function ColorSwatch(props: ColorSwatchProps) {\n const rgbaString = getCSSColorFromDef(props.colorDef);\n const colorStyle: React.CSSProperties = {\n backgroundColor: rgbaString,\n ...props.style,\n };\n\n const handleClick = (e: React.MouseEvent) => {\n // istanbul ignore else\n if (props && props.onColorPick)\n props.onColorPick(props.colorDef, e);\n };\n\n const classes = classnames(\n \"components-color-swatch\",\n props.round && \"round\",\n props.className,\n );\n\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onColorPick, colorDef, round, // do not pass on color swatch specific props\n // eslint-disable-next-line comma-dangle\n ...otherProps // pass-through props\n } = props;\n\n return <button {...otherProps} style={colorStyle} className={classes} onClick={handleClick} />;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
.components-color-swatch {
|
|
9
|
+
font-size: $iui-font-size;
|
|
10
|
+
height: 1em * 1.2;
|
|
11
|
+
width: 1em * 1.2;
|
|
12
|
+
border-width: 1px;
|
|
13
|
+
border-radius: 3px;
|
|
14
|
+
border-style: solid;
|
|
15
|
+
border-color: $buic-inputs-border;
|
|
16
|
+
|
|
17
|
+
&.round {
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[disabled] {
|
|
22
|
+
opacity: .2;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCSSColorFromDef.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/getCSSColorFromDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAU7D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/** @internal */
|
|
9
|
+
export function getCSSColorFromDef(colorDef) {
|
|
10
|
+
const { b, g, r, t } = colorDef.colors;
|
|
11
|
+
let rgbaString = "";
|
|
12
|
+
if (t === 0)
|
|
13
|
+
rgbaString = `rgb(${r},${g},${b})`;
|
|
14
|
+
else {
|
|
15
|
+
const alpha = ((255 - t) / 255).toFixed(2);
|
|
16
|
+
rgbaString = `rgba(${r},${g},${b},${alpha})`;
|
|
17
|
+
}
|
|
18
|
+
return rgbaString;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=getCSSColorFromDef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCSSColorFromDef.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/getCSSColorFromDef.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,gBAAgB;AAChB,MAAM,UAAU,kBAAkB,CAAC,QAAkB;IACnD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;IACvC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC,KAAK,CAAC;QACT,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;SAChC;QACH,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3C,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;KAC9C;IACD,OAAO,UAAU,CAAC;AACpB,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 { ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport function getCSSColorFromDef(colorDef: ColorDef): string {\n const { b, g, r, t } = colorDef.colors;\n let rgbaString = \"\";\n if (t === 0)\n rgbaString = `rgb(${r},${g},${b})`;\n else {\n const alpha = ((255 - t) / 255).toFixed(2);\n rgbaString = `rgba(${r},${g},${b},${alpha})`;\n }\n return rgbaString;\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module PropertyEditors
|
|
3
|
+
*/
|
|
4
|
+
import "./ColorEditor.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { ColorDef } from "@itwin/core-common";
|
|
7
|
+
import { PropertyValue } from "@itwin/appui-abstract";
|
|
8
|
+
import { PropertyEditorBase, PropertyEditorProps, TypeEditor } from "@itwin/components-react";
|
|
9
|
+
/** @internal */
|
|
10
|
+
interface ColorEditorState {
|
|
11
|
+
colorValue: number;
|
|
12
|
+
readonly: boolean;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
numColumns: number;
|
|
15
|
+
availableColors: ColorDef[];
|
|
16
|
+
}
|
|
17
|
+
/** ColorEditor React component that is a property editor with text input
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
export declare class ColorEditor extends React.PureComponent<PropertyEditorProps, ColorEditorState> implements TypeEditor {
|
|
21
|
+
private _buttonElement;
|
|
22
|
+
/** @internal */
|
|
23
|
+
readonly state: Readonly<ColorEditorState>;
|
|
24
|
+
getPropertyValue(): Promise<PropertyValue | undefined>;
|
|
25
|
+
get htmlElement(): HTMLElement | null;
|
|
26
|
+
get hasFocus(): boolean;
|
|
27
|
+
private setFocus;
|
|
28
|
+
private _onColorPick;
|
|
29
|
+
/** @internal */
|
|
30
|
+
componentDidMount(): void;
|
|
31
|
+
/** @internal */
|
|
32
|
+
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
33
|
+
private setStateFromProps;
|
|
34
|
+
/** @internal */
|
|
35
|
+
render(): JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
/** Color Property Editor registered for the "number" type name and "color-picker" editor name.
|
|
38
|
+
* It uses the [[ColorEditor]] React component.
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export declare class ColorPropertyEditor extends PropertyEditorBase {
|
|
42
|
+
get reactNode(): React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=ColorEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorEditor.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/editors/ColorEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAC8E,aAAa,EAEjG,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAyB,mBAAmB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrH,gBAAgB;AAChB,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,QAAQ,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,gBAAgB,CAAE,YAAW,UAAU;IAC/G,OAAO,CAAC,cAAc,CAAyD;IAE/E,gBAAgB;IAChB,SAAyB,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAKxD;IAEW,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAgBnE,IAAW,WAAW,IAAI,WAAW,GAAG,IAAI,CAE3C;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,YAAY,CAelB;IAEF,gBAAgB;IACA,iBAAiB;IAIjC,gBAAgB;IACA,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;YAMnD,iBAAiB;IAkC/B,gBAAgB;IACA,MAAM;CAevB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;CACF"}
|
|
@@ -0,0 +1,125 @@
|
|
|
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 PropertyEditors
|
|
7
|
+
*/
|
|
8
|
+
import "./ColorEditor.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { ColorDef } from "@itwin/core-common";
|
|
12
|
+
import { PropertyEditorParamTypes, PropertyValueFormat, StandardEditorNames, StandardTypeNames, } from "@itwin/appui-abstract";
|
|
13
|
+
import { PropertyEditorBase, PropertyEditorManager } from "@itwin/components-react";
|
|
14
|
+
import { ColorPickerButton } from "../color/ColorPickerButton";
|
|
15
|
+
/** ColorEditor React component that is a property editor with text input
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export class ColorEditor extends React.PureComponent {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this._buttonElement = React.createRef();
|
|
22
|
+
/** @internal */
|
|
23
|
+
this.state = {
|
|
24
|
+
colorValue: 0,
|
|
25
|
+
readonly: false,
|
|
26
|
+
numColumns: 4,
|
|
27
|
+
availableColors: [],
|
|
28
|
+
};
|
|
29
|
+
this._onColorPick = (color) => {
|
|
30
|
+
const propertyRecord = this.props.propertyRecord;
|
|
31
|
+
this.setState({
|
|
32
|
+
colorValue: color.tbgr,
|
|
33
|
+
}, async () => {
|
|
34
|
+
// istanbul ignore else
|
|
35
|
+
if (propertyRecord && this.props.onCommit) {
|
|
36
|
+
const propertyValue = await this.getPropertyValue();
|
|
37
|
+
// istanbul ignore else
|
|
38
|
+
if (propertyValue !== undefined) {
|
|
39
|
+
this.props.onCommit({ propertyRecord, newValue: propertyValue });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async getPropertyValue() {
|
|
46
|
+
const record = this.props.propertyRecord;
|
|
47
|
+
let propertyValue;
|
|
48
|
+
// istanbul ignore else
|
|
49
|
+
if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {
|
|
50
|
+
propertyValue = {
|
|
51
|
+
valueFormat: PropertyValueFormat.Primitive,
|
|
52
|
+
value: this.state.colorValue,
|
|
53
|
+
displayValue: "",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return propertyValue;
|
|
57
|
+
}
|
|
58
|
+
get htmlElement() {
|
|
59
|
+
return this._buttonElement.current;
|
|
60
|
+
}
|
|
61
|
+
get hasFocus() {
|
|
62
|
+
return document.activeElement === this._buttonElement.current;
|
|
63
|
+
}
|
|
64
|
+
setFocus() {
|
|
65
|
+
// istanbul ignore else
|
|
66
|
+
if (this._buttonElement && this._buttonElement.current && !this.state.isDisabled) {
|
|
67
|
+
this._buttonElement.current.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** @internal */
|
|
71
|
+
componentDidMount() {
|
|
72
|
+
this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
75
|
+
componentDidUpdate(prevProps) {
|
|
76
|
+
if (this.props.propertyRecord !== prevProps.propertyRecord) {
|
|
77
|
+
this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async setStateFromProps() {
|
|
81
|
+
const record = this.props.propertyRecord;
|
|
82
|
+
// istanbul ignore else
|
|
83
|
+
if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {
|
|
84
|
+
const colorValue = record.value.value;
|
|
85
|
+
let numColumns = 4;
|
|
86
|
+
const availableColors = new Array();
|
|
87
|
+
const readonly = record && undefined !== record.isReadonly ? record.isReadonly : /* istanbul ignore next */ false;
|
|
88
|
+
const isDisabled = record ? record.isDisabled : /* istanbul ignore next */ undefined;
|
|
89
|
+
if (record.property.editor && record.property.editor.params) {
|
|
90
|
+
const colorParams = record.property.editor.params.find((param) => param.type === PropertyEditorParamTypes.ColorData);
|
|
91
|
+
// istanbul ignore else
|
|
92
|
+
if (colorParams) {
|
|
93
|
+
colorParams.colorValues.forEach((colorNumber) => {
|
|
94
|
+
availableColors.push(ColorDef.create(colorNumber));
|
|
95
|
+
});
|
|
96
|
+
// istanbul ignore else
|
|
97
|
+
if (colorParams.numColumns)
|
|
98
|
+
numColumns = colorParams.numColumns;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
this.setState({ colorValue, readonly, isDisabled, numColumns, availableColors }, () => {
|
|
102
|
+
if (this.props.setFocus) {
|
|
103
|
+
this.setFocus();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** @internal */
|
|
109
|
+
render() {
|
|
110
|
+
const colorDef = ColorDef.create(this.state.colorValue);
|
|
111
|
+
return (React.createElement("div", { className: classnames("components-color-editor", this.props.className), style: this.props.style },
|
|
112
|
+
React.createElement(ColorPickerButton, { ref: this._buttonElement, initialColor: colorDef, colorDefs: this.state.availableColors.length > 0 ? this.state.availableColors : [colorDef], numColumns: this.state.numColumns, disabled: this.state.isDisabled ? true : false, readonly: this.state.readonly, onColorPick: this._onColorPick, "data-testid": "components-color-editor" })));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Color Property Editor registered for the "number" type name and "color-picker" editor name.
|
|
116
|
+
* It uses the [[ColorEditor]] React component.
|
|
117
|
+
* @beta
|
|
118
|
+
*/
|
|
119
|
+
export class ColorPropertyEditor extends PropertyEditorBase {
|
|
120
|
+
get reactNode() {
|
|
121
|
+
return React.createElement(ColorEditor, null);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
PropertyEditorManager.registerEditor(StandardTypeNames.Number, ColorPropertyEditor, StandardEditorNames.ColorPicker);
|
|
125
|
+
//# sourceMappingURL=ColorEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorEditor.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/editors/ColorEditor.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;AAC/B,OAAO,EAAE,QAAQ,E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CAAC,CAAC;QACxD,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAClG,oBAAC,iBAAiB,IAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EACzC,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAC1F,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAC9C,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,WAAW,EAAE,IAAI,CAAC,YAAY,iBAClB,yBAAyB,GAAG,CACtC,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD,IAAW,SAAS;QAClB,OAAO,oBAAC,WAAW,OAAG,CAAC;IACzB,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,WAAW,CAAC,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 PropertyEditors\n */\n\nimport \"./ColorEditor.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport {\n ColorEditorParams, PropertyEditorParams, PropertyEditorParamTypes, PropertyRecord, PropertyValue, PropertyValueFormat,\n StandardEditorNames, StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport { PropertyEditorBase, PropertyEditorManager, PropertyEditorProps, TypeEditor } from \"@itwin/components-react\";\nimport { ColorPickerButton } from \"../color/ColorPickerButton\";\n\n/** @internal */\ninterface ColorEditorState {\n colorValue: number;\n readonly: boolean;\n isDisabled?: boolean;\n numColumns: number;\n availableColors: ColorDef[];\n}\n\n/** ColorEditor React component that is a property editor with text input\n * @beta\n */\nexport class ColorEditor extends React.PureComponent<PropertyEditorProps, ColorEditorState> implements TypeEditor {\n private _buttonElement: React.RefObject<HTMLButtonElement> = React.createRef();\n\n /** @internal */\n public override readonly state: Readonly<ColorEditorState> = {\n colorValue: 0,\n readonly: false,\n numColumns: 4,\n availableColors: [],\n };\n\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\n const record = this.props.propertyRecord;\n let propertyValue: PropertyValue | undefined;\n\n // istanbul ignore else\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: this.state.colorValue,\n displayValue: \"\",\n };\n }\n\n return propertyValue;\n }\n\n public get htmlElement(): HTMLElement | null {\n return this._buttonElement.current;\n }\n\n public get hasFocus(): boolean {\n return document.activeElement === this._buttonElement.current;\n }\n\n private setFocus(): void {\n // istanbul ignore else\n if (this._buttonElement && this._buttonElement.current && !this.state.isDisabled) {\n this._buttonElement.current.focus();\n }\n }\n\n private _onColorPick = (color: ColorDef) => {\n const propertyRecord = this.props.propertyRecord as PropertyRecord;\n\n this.setState({\n colorValue: color.tbgr,\n }, async () => {\n // istanbul ignore else\n if (propertyRecord && this.props.onCommit) {\n const propertyValue = await this.getPropertyValue();\n // istanbul ignore else\n if (propertyValue !== undefined) {\n this.props.onCommit({ propertyRecord, newValue: propertyValue });\n }\n }\n });\n };\n\n /** @internal */\n public override componentDidMount() {\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }\n }\n\n private async setStateFromProps() {\n const record = this.props.propertyRecord;\n\n // istanbul ignore else\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\n const colorValue = record.value.value as number;\n let numColumns = 4;\n const availableColors = new Array<ColorDef>();\n const readonly = record && undefined !== record.isReadonly ? record.isReadonly : /* istanbul ignore next */ false;\n const isDisabled = record ? record.isDisabled : /* istanbul ignore next */ undefined;\n\n if (record.property.editor && record.property.editor.params) {\n const colorParams = record.property.editor.params.find((param: PropertyEditorParams) => param.type === PropertyEditorParamTypes.ColorData) as ColorEditorParams;\n // istanbul ignore else\n if (colorParams) {\n colorParams.colorValues.forEach((colorNumber: number) => {\n availableColors.push(ColorDef.create(colorNumber));\n });\n // istanbul ignore else\n if (colorParams.numColumns)\n numColumns = colorParams.numColumns;\n }\n }\n this.setState(\n { colorValue, readonly, isDisabled, numColumns, availableColors },\n () => {\n if (this.props.setFocus) {\n this.setFocus();\n }\n },\n );\n }\n }\n\n /** @internal */\n public override render() {\n const colorDef = ColorDef.create(this.state.colorValue);\n return (\n <div className={classnames(\"components-color-editor\", this.props.className)} style={this.props.style}>\n <ColorPickerButton ref={this._buttonElement}\n initialColor={colorDef}\n colorDefs={this.state.availableColors.length > 0 ? this.state.availableColors : [colorDef]}\n numColumns={this.state.numColumns}\n disabled={this.state.isDisabled ? true : false}\n readonly={this.state.readonly}\n onColorPick={this._onColorPick}\n data-testid=\"components-color-editor\" />\n </div>\n );\n }\n}\n\n/** Color Property Editor registered for the \"number\" type name and \"color-picker\" editor name.\n * It uses the [[ColorEditor]] React component.\n * @beta\n */\nexport class ColorPropertyEditor extends PropertyEditorBase {\n public get reactNode(): React.ReactNode {\n return <ColorEditor />;\n }\n}\n\nPropertyEditorManager.registerEditor(StandardTypeNames.Number, ColorPropertyEditor, StandardEditorNames.ColorPicker);\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
|
|
6
|
+
@import "~@itwin/itwinui-css/scss/style/typography";
|
|
7
|
+
|
|
8
|
+
$components-color-editor-item-height: 100%;
|
|
9
|
+
|
|
10
|
+
.components-color-editor {
|
|
11
|
+
font-family: $iui-font-family;
|
|
12
|
+
font-size: $iui-font-size;
|
|
13
|
+
color: $buic-foreground-body;
|
|
14
|
+
border: none;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
height: $components-color-editor-item-height;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|