@babylonjs/shared-ui-components 5.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/colorPicker/colorComponentEntry.d.ts +18 -0
- package/colorPicker/colorComponentEntry.js +37 -0
- package/colorPicker/colorComponentEntry.js.map +1 -0
- package/colorPicker/colorPicker.d.ts +43 -0
- package/colorPicker/colorPicker.js +137 -0
- package/colorPicker/colorPicker.js.map +1 -0
- package/colorPicker/hexColor.d.ts +20 -0
- package/colorPicker/hexColor.js +43 -0
- package/colorPicker/hexColor.js.map +1 -0
- package/components/Button.d.ts +10 -0
- package/components/Button.js +7 -0
- package/components/Button.js.map +1 -0
- package/components/Icon.d.ts +6 -0
- package/components/Icon.js +7 -0
- package/components/Icon.js.map +1 -0
- package/components/Label.d.ts +7 -0
- package/components/Label.js +7 -0
- package/components/Label.js.map +1 -0
- package/components/MessageDialog.d.ts +7 -0
- package/components/MessageDialog.js +23 -0
- package/components/MessageDialog.js.map +1 -0
- package/components/Toggle.d.ts +8 -0
- package/components/Toggle.js +16 -0
- package/components/Toggle.js.map +1 -0
- package/components/bars/CommandBarComponent.d.ts +16 -0
- package/components/bars/CommandBarComponent.js +69 -0
- package/components/bars/CommandBarComponent.js.map +1 -0
- package/components/bars/CommandButtonComponent.d.ts +11 -0
- package/components/bars/CommandButtonComponent.js +7 -0
- package/components/bars/CommandButtonComponent.js.map +1 -0
- package/components/bars/CommandDropdownComponent.d.ts +26 -0
- package/components/bars/CommandDropdownComponent.js +49 -0
- package/components/bars/CommandDropdownComponent.js.map +1 -0
- package/components/classNames.d.ts +2 -0
- package/components/classNames.js +19 -0
- package/components/classNames.js.map +1 -0
- package/components/colorPicker/ColorComponentEntry.d.ts +18 -0
- package/components/colorPicker/ColorComponentEntry.js +38 -0
- package/components/colorPicker/ColorComponentEntry.js.map +1 -0
- package/components/colorPicker/ColorPicker.d.ts +43 -0
- package/components/colorPicker/ColorPicker.js +138 -0
- package/components/colorPicker/ColorPicker.js.map +1 -0
- package/components/colorPicker/HexColor.d.ts +20 -0
- package/components/colorPicker/HexColor.js +46 -0
- package/components/colorPicker/HexColor.js.map +1 -0
- package/components/lines/ColorLineComponent.d.ts +40 -0
- package/components/lines/ColorLineComponent.js +146 -0
- package/components/lines/ColorLineComponent.js.map +1 -0
- package/components/lines/ColorPickerLineComponent.d.ts +33 -0
- package/components/lines/ColorPickerLineComponent.js +62 -0
- package/components/lines/ColorPickerLineComponent.js.map +1 -0
- package/components/lines/FileButtonLineComponent.d.ts +16 -0
- package/components/lines/FileButtonLineComponent.js +22 -0
- package/components/lines/FileButtonLineComponent.js.map +1 -0
- package/components/lines/NumericInputComponent.d.ts +31 -0
- package/components/lines/NumericInputComponent.js +87 -0
- package/components/lines/NumericInputComponent.js.map +1 -0
- package/license.md +71 -0
- package/lines/booleanLineComponent.d.ts +11 -0
- package/lines/booleanLineComponent.js +15 -0
- package/lines/booleanLineComponent.js.map +1 -0
- package/lines/buttonLineComponent.d.ts +12 -0
- package/lines/buttonLineComponent.js +11 -0
- package/lines/buttonLineComponent.js.map +1 -0
- package/lines/checkBoxLineComponent.d.ts +36 -0
- package/lines/checkBoxLineComponent.js +89 -0
- package/lines/checkBoxLineComponent.js.map +1 -0
- package/lines/color3LineComponent.d.ts +18 -0
- package/lines/color3LineComponent.js +10 -0
- package/lines/color3LineComponent.js.map +1 -0
- package/lines/color4LineComponent.d.ts +18 -0
- package/lines/color4LineComponent.js +10 -0
- package/lines/color4LineComponent.js.map +1 -0
- package/lines/colorLineComponent.d.ts +40 -0
- package/lines/colorLineComponent.js +145 -0
- package/lines/colorLineComponent.js.map +1 -0
- package/lines/colorPickerComponent.d.ts +31 -0
- package/lines/colorPickerComponent.js +61 -0
- package/lines/colorPickerComponent.js.map +1 -0
- package/lines/draggableLineComponent.d.ts +9 -0
- package/lines/draggableLineComponent.js +13 -0
- package/lines/draggableLineComponent.js.map +1 -0
- package/lines/fileButtonLineComponent.d.ts +17 -0
- package/lines/fileButtonLineComponent.js +21 -0
- package/lines/fileButtonLineComponent.js.map +1 -0
- package/lines/fileMultipleButtonLineComponent.d.ts +17 -0
- package/lines/fileMultipleButtonLineComponent.js +21 -0
- package/lines/fileMultipleButtonLineComponent.js.map +1 -0
- package/lines/floatLineComponent.d.ts +50 -0
- package/lines/floatLineComponent.js +176 -0
- package/lines/floatLineComponent.js.map +1 -0
- package/lines/hexLineComponent.d.ts +40 -0
- package/lines/hexLineComponent.js +122 -0
- package/lines/hexLineComponent.js.map +1 -0
- package/lines/iSelectedLineContainer.d.ts +4 -0
- package/lines/iSelectedLineContainer.js +2 -0
- package/lines/iSelectedLineContainer.js.map +1 -0
- package/lines/iconButtonLineComponent.d.ts +11 -0
- package/lines/iconButtonLineComponent.js +11 -0
- package/lines/iconButtonLineComponent.js.map +1 -0
- package/lines/iconComponent.d.ts +9 -0
- package/lines/iconComponent.js +8 -0
- package/lines/iconComponent.js.map +1 -0
- package/lines/indentedTextLineComponent.d.ts +16 -0
- package/lines/indentedTextLineComponent.js +27 -0
- package/lines/indentedTextLineComponent.js.map +1 -0
- package/lines/inputArrowsComponent.d.ts +13 -0
- package/lines/inputArrowsComponent.js +38 -0
- package/lines/inputArrowsComponent.js.map +1 -0
- package/lines/lineContainerComponent.d.ts +19 -0
- package/lines/lineContainerComponent.js +50 -0
- package/lines/lineContainerComponent.js.map +1 -0
- package/lines/linkButtonComponent.d.ts +16 -0
- package/lines/linkButtonComponent.js +21 -0
- package/lines/linkButtonComponent.js.map +1 -0
- package/lines/matrixLineComponent.d.ts +36 -0
- package/lines/matrixLineComponent.js +103 -0
- package/lines/matrixLineComponent.js.map +1 -0
- package/lines/messageLineComponent.d.ts +12 -0
- package/lines/messageLineComponent.js +15 -0
- package/lines/messageLineComponent.js.map +1 -0
- package/lines/numericInputComponent.d.ts +31 -0
- package/lines/numericInputComponent.js +86 -0
- package/lines/numericInputComponent.js.map +1 -0
- package/lines/optionsLineComponent.d.ts +48 -0
- package/lines/optionsLineComponent.js +119 -0
- package/lines/optionsLineComponent.js.map +1 -0
- package/lines/popup.d.ts +4 -0
- package/lines/popup.js +68 -0
- package/lines/popup.js.map +1 -0
- package/lines/radioLineComponent.d.ts +21 -0
- package/lines/radioLineComponent.js +27 -0
- package/lines/radioLineComponent.js.map +1 -0
- package/lines/sliderLineComponent.d.ts +37 -0
- package/lines/sliderLineComponent.js +90 -0
- package/lines/sliderLineComponent.js.map +1 -0
- package/lines/targetsProxy.d.ts +11 -0
- package/lines/targetsProxy.js +43 -0
- package/lines/targetsProxy.js.map +1 -0
- package/lines/textInputLineComponent.d.ts +47 -0
- package/lines/textInputLineComponent.js +155 -0
- package/lines/textInputLineComponent.js.map +1 -0
- package/lines/textLineComponent.d.ts +21 -0
- package/lines/textLineComponent.js +31 -0
- package/lines/textLineComponent.js.map +1 -0
- package/lines/unitButton.d.ts +8 -0
- package/lines/unitButton.js +8 -0
- package/lines/unitButton.js.map +1 -0
- package/lines/valueLineComponent.d.ts +15 -0
- package/lines/valueLineComponent.js +13 -0
- package/lines/valueLineComponent.js.map +1 -0
- package/lines/vector2LineComponent.d.ts +36 -0
- package/lines/vector2LineComponent.js +64 -0
- package/lines/vector2LineComponent.js.map +1 -0
- package/lines/vector3LineComponent.d.ts +41 -0
- package/lines/vector3LineComponent.js +75 -0
- package/lines/vector3LineComponent.js.map +1 -0
- package/lines/vector4LineComponent.d.ts +42 -0
- package/lines/vector4LineComponent.js +82 -0
- package/lines/vector4LineComponent.js.map +1 -0
- package/nodeGraphSystem/displayLedger.d.ts +5 -0
- package/nodeGraphSystem/displayLedger.js +4 -0
- package/nodeGraphSystem/displayLedger.js.map +1 -0
- package/nodeGraphSystem/frameNodePort.d.ts +25 -0
- package/nodeGraphSystem/frameNodePort.js +60 -0
- package/nodeGraphSystem/frameNodePort.js.map +1 -0
- package/nodeGraphSystem/graphCanvas.d.ts +111 -0
- package/nodeGraphSystem/graphCanvas.js +1132 -0
- package/nodeGraphSystem/graphCanvas.js.map +1 -0
- package/nodeGraphSystem/graphFrame.d.ts +153 -0
- package/nodeGraphSystem/graphFrame.js +1329 -0
- package/nodeGraphSystem/graphFrame.js.map +1 -0
- package/nodeGraphSystem/graphNode.d.ts +79 -0
- package/nodeGraphSystem/graphNode.js +460 -0
- package/nodeGraphSystem/graphNode.js.map +1 -0
- package/nodeGraphSystem/interfaces/displayManager.d.ts +13 -0
- package/nodeGraphSystem/interfaces/displayManager.js +2 -0
- package/nodeGraphSystem/interfaces/displayManager.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeContainer.d.ts +6 -0
- package/nodeGraphSystem/interfaces/nodeContainer.js +2 -0
- package/nodeGraphSystem/interfaces/nodeContainer.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeData.d.ts +15 -0
- package/nodeGraphSystem/interfaces/nodeData.js +2 -0
- package/nodeGraphSystem/interfaces/nodeData.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.d.ts +26 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.js +2 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.js.map +1 -0
- package/nodeGraphSystem/interfaces/portData.d.ts +28 -0
- package/nodeGraphSystem/interfaces/portData.js +8 -0
- package/nodeGraphSystem/interfaces/portData.js.map +1 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.d.ts +6 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.js +2 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.js.map +1 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.d.ts +11 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.js +2 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.js.map +1 -0
- package/nodeGraphSystem/nodeLink.d.ts +31 -0
- package/nodeGraphSystem/nodeLink.js +183 -0
- package/nodeGraphSystem/nodeLink.js.map +1 -0
- package/nodeGraphSystem/nodePort.d.ts +35 -0
- package/nodeGraphSystem/nodePort.js +129 -0
- package/nodeGraphSystem/nodePort.js.map +1 -0
- package/nodeGraphSystem/propertyLedger.d.ts +8 -0
- package/nodeGraphSystem/propertyLedger.js +4 -0
- package/nodeGraphSystem/propertyLedger.js.map +1 -0
- package/nodeGraphSystem/stateManager.d.ts +45 -0
- package/nodeGraphSystem/stateManager.js +19 -0
- package/nodeGraphSystem/stateManager.js.map +1 -0
- package/nodeGraphSystem/tools.d.ts +5 -0
- package/nodeGraphSystem/tools.js +37 -0
- package/nodeGraphSystem/tools.js.map +1 -0
- package/nodeGraphSystem/typeLedger.d.ts +8 -0
- package/nodeGraphSystem/typeLedger.js +3 -0
- package/nodeGraphSystem/typeLedger.js.map +1 -0
- package/nodeGraphSystem/types/framePortData.d.ts +7 -0
- package/nodeGraphSystem/types/framePortData.js +2 -0
- package/nodeGraphSystem/types/framePortData.js.map +1 -0
- package/package.json +55 -0
- package/propertyChangedEvent.d.ts +7 -0
- package/propertyChangedEvent.js +3 -0
- package/propertyChangedEvent.js.map +1 -0
- package/readme.md +6 -0
- package/stories/Button.stories.d.ts +10 -0
- package/stories/Button.stories.js +20 -0
- package/stories/Button.stories.js.map +1 -0
- package/stories/Icon.stories.d.ts +9 -0
- package/stories/Icon.stories.js +17 -0
- package/stories/Icon.stories.js.map +1 -0
- package/stories/Label.stories.d.ts +8 -0
- package/stories/Label.stories.js +11 -0
- package/stories/Label.stories.js.map +1 -0
- package/stories/MessageDialog.stories.d.ts +9 -0
- package/stories/MessageDialog.stories.js +20 -0
- package/stories/MessageDialog.stories.js.map +1 -0
- package/stories/Toggle.stories.d.ts +9 -0
- package/stories/Toggle.stories.js +18 -0
- package/stories/Toggle.stories.js.map +1 -0
- package/stories/bars/CommandBarComponent.stories.d.ts +11 -0
- package/stories/bars/CommandBarComponent.stories.js +13 -0
- package/stories/bars/CommandBarComponent.stories.js.map +1 -0
- package/stories/bars/CommandButtonComponent.stories.d.ts +6 -0
- package/stories/bars/CommandButtonComponent.stories.js +7 -0
- package/stories/bars/CommandButtonComponent.stories.js.map +1 -0
- package/stories/colorPicker/ColorPicker.stories.d.ts +11 -0
- package/stories/colorPicker/ColorPicker.stories.js +5 -0
- package/stories/colorPicker/ColorPicker.stories.js.map +1 -0
- package/stories/lines/ColorLineComponent.stories.d.ts +21 -0
- package/stories/lines/ColorLineComponent.stories.js +10 -0
- package/stories/lines/ColorLineComponent.stories.js.map +1 -0
- package/stories/lines/ColorPickerLineComponent.stories.d.ts +14 -0
- package/stories/lines/ColorPickerLineComponent.stories.js +11 -0
- package/stories/lines/ColorPickerLineComponent.stories.js.map +1 -0
- package/stories/lines/FileButtonLineComponent.stories.d.ts +6 -0
- package/stories/lines/FileButtonLineComponent.stories.js +6 -0
- package/stories/lines/FileButtonLineComponent.stories.js.map +1 -0
- package/stories/lines/NumericInputComponent.stories.d.ts +11 -0
- package/stories/lines/NumericInputComponent.stories.js +6 -0
- package/stories/lines/NumericInputComponent.stories.js.map +1 -0
- package/stringTools.d.ts +11 -0
- package/stringTools.js +89 -0
- package/stringTools.js.map +1 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js +15 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.d.ts +17 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js +56 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.js +13 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.d.ts +17 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.js +39 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js +17 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.js +26 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js +18 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.d.ts +16 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.js +28 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js +18 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js +17 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js +15 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js +35 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/lockObject.d.ts +9 -0
- package/tabs/propertyGrids/lockObject.js +12 -0
- package/tabs/propertyGrids/lockObject.js.map +1 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IIndentedTextLineComponentProps {
|
3
|
+
value?: string;
|
4
|
+
color?: string;
|
5
|
+
underline?: boolean;
|
6
|
+
onLink?: () => void;
|
7
|
+
url?: string;
|
8
|
+
additionalClass?: string;
|
9
|
+
}
|
10
|
+
export declare class IndentedTextLineComponent extends React.Component<IIndentedTextLineComponentProps> {
|
11
|
+
constructor(props: IIndentedTextLineComponentProps);
|
12
|
+
onLink(): void;
|
13
|
+
renderContent(): JSX.Element;
|
14
|
+
render(): JSX.Element;
|
15
|
+
}
|
16
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class IndentedTextLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
}
|
7
|
+
onLink() {
|
8
|
+
if (this.props.url) {
|
9
|
+
window.open(this.props.url, "_blank");
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
if (!this.props.onLink) {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
this.props.onLink();
|
16
|
+
}
|
17
|
+
renderContent() {
|
18
|
+
if (this.props.onLink || this.props.url) {
|
19
|
+
return (_jsx("div", { className: "link-value", title: this.props.value, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
|
20
|
+
}
|
21
|
+
return (_jsx("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
|
22
|
+
}
|
23
|
+
render() {
|
24
|
+
return (_jsx("div", { className: "indented " + (this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : "")), children: this.renderContent() }));
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=indentedTextLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"indentedTextLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/indentedTextLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAA0C;IAC3F,YAAY,KAAsC;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACtC,OAAO;SACV;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACpB,OAAO;SACV;QAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;IAED,aAAa;QACT,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YACrC,OAAO,CACH,cAAK,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,YAC5E,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,GACrD,CACT,CAAC;SACL;QACD,OAAO,CACH,cAAK,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,YACrG,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,GAC5B,CACT,CAAC;IACN,CAAC;IAED,MAAM;QACF,OAAO,CACH,cAAK,SAAS,EAAE,WAAW,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,YAC1J,IAAI,CAAC,aAAa,EAAE,GACnB,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\n\r\ninterface IIndentedTextLineComponentProps {\r\n value?: string;\r\n color?: string;\r\n underline?: boolean;\r\n onLink?: () => void;\r\n url?: string;\r\n additionalClass?: string;\r\n}\r\n\r\nexport class IndentedTextLineComponent extends React.Component<IIndentedTextLineComponentProps> {\r\n constructor(props: IIndentedTextLineComponentProps) {\r\n super(props);\r\n }\r\n\r\n onLink() {\r\n if (this.props.url) {\r\n window.open(this.props.url, \"_blank\");\r\n return;\r\n }\r\n if (!this.props.onLink) {\r\n return;\r\n }\r\n\r\n this.props.onLink();\r\n }\r\n\r\n renderContent() {\r\n if (this.props.onLink || this.props.url) {\r\n return (\r\n <div className=\"link-value\" title={this.props.value} onClick={() => this.onLink()}>\r\n {this.props.url ? \"doc\" : this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n return (\r\n <div className=\"value\" title={this.props.value} style={{ color: this.props.color ? this.props.color : \"\" }}>\r\n {this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n\r\n render() {\r\n return (\r\n <div className={\"indented \" + (this.props.underline ? \"textLine underline\" : \"textLine\" + (this.props.additionalClass ? \" \" + this.props.additionalClass : \"\"))}>\r\n {this.renderContent()}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IInputArrowsComponentProps {
|
3
|
+
incrementValue: (amount: number) => void;
|
4
|
+
setDragging: (dragging: boolean) => void;
|
5
|
+
}
|
6
|
+
export declare class InputArrowsComponent extends React.Component<IInputArrowsComponentProps> {
|
7
|
+
private _arrowsRef;
|
8
|
+
private _drag;
|
9
|
+
private _releaseListener;
|
10
|
+
private _lockChangeListener;
|
11
|
+
render(): JSX.Element;
|
12
|
+
}
|
13
|
+
export {};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import upArrowIcon from "./valueUpArrowIcon.svg";
|
4
|
+
import downArrowIcon from "./valueDownArrowIcon.svg";
|
5
|
+
export class InputArrowsComponent extends React.Component {
|
6
|
+
constructor() {
|
7
|
+
super(...arguments);
|
8
|
+
this._arrowsRef = React.createRef();
|
9
|
+
this._drag = (event) => {
|
10
|
+
this.props.incrementValue(-event.movementY);
|
11
|
+
};
|
12
|
+
this._releaseListener = () => {
|
13
|
+
var _a, _b, _c, _d;
|
14
|
+
this.props.setDragging(false);
|
15
|
+
(_a = this._arrowsRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.exitPointerLock();
|
16
|
+
(_b = this._arrowsRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.defaultView.removeEventListener("pointerup", this._releaseListener);
|
17
|
+
(_c = this._arrowsRef.current) === null || _c === void 0 ? void 0 : _c.ownerDocument.removeEventListener("pointerlockchange", this._lockChangeListener);
|
18
|
+
(_d = this._arrowsRef.current) === null || _d === void 0 ? void 0 : _d.ownerDocument.defaultView.removeEventListener("mousemove", this._drag);
|
19
|
+
};
|
20
|
+
this._lockChangeListener = () => {
|
21
|
+
var _a;
|
22
|
+
if (((_a = this._arrowsRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.pointerLockElement) !== this._arrowsRef.current) {
|
23
|
+
this._releaseListener();
|
24
|
+
}
|
25
|
+
};
|
26
|
+
}
|
27
|
+
render() {
|
28
|
+
return (_jsxs("div", { className: "arrows", ref: this._arrowsRef, onPointerDown: () => {
|
29
|
+
var _a, _b, _c, _d;
|
30
|
+
(_a = this._arrowsRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.addEventListener("pointerlockchange", this._lockChangeListener);
|
31
|
+
(_b = this._arrowsRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.defaultView.addEventListener("pointerup", this._releaseListener);
|
32
|
+
(_c = this._arrowsRef.current) === null || _c === void 0 ? void 0 : _c.ownerDocument.defaultView.addEventListener("mousemove", this._drag);
|
33
|
+
this.props.setDragging(true);
|
34
|
+
(_d = this._arrowsRef.current) === null || _d === void 0 ? void 0 : _d.requestPointerLock();
|
35
|
+
}, onDragStart: (evt) => evt.preventDefault(), children: [_jsx("img", { className: "upArrowIcon", src: upArrowIcon, alt: "Increase Value" }), _jsx("img", { className: "downArrowIcon", src: downArrowIcon, alt: "Increase Value" })] }));
|
36
|
+
}
|
37
|
+
}
|
38
|
+
//# sourceMappingURL=inputArrowsComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inputArrowsComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/inputAr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AAO,CACH,eACI,SAAS,EAAC,QAAQ,EAClB,GAAG,EAAE,IAAI,CAAC,UAAU,EACpB,aAAa,EAAE,GAAG,EAAE;;gBAChB,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,aAAa,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACvG,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,aAAa,CAAC,WAAW,CAAE,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBACzG,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,aAAa,CAAC,WAAW,CAAE,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9F,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC7B,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,kBAAkB,EAAE,CAAC;YAClD,CAAC,EACD,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,EAAE,aAE1C,cAAK,SAAS,EAAC,aAAa,EAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAC,gBAAgB,GAAG,EACtE,cAAK,SAAS,EAAC,eAAe,EAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,IACxE,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\n\r\nimport upArrowIcon from \"./valueUpArrowIcon.svg\";\r\nimport downArrowIcon from \"./valueDownArrowIcon.svg\";\r\n\r\ninterface IInputArrowsComponentProps {\r\n incrementValue: (amount: number) => void;\r\n setDragging: (dragging: boolean) => void;\r\n}\r\n\r\nexport class InputArrowsComponent extends React.Component<IInputArrowsComponentProps> {\r\n private _arrowsRef = React.createRef<HTMLDivElement>();\r\n private _drag = (event: MouseEvent) => {\r\n this.props.incrementValue(-event.movementY);\r\n };\r\n private _releaseListener = () => {\r\n this.props.setDragging(false);\r\n this._arrowsRef.current?.ownerDocument.exitPointerLock();\r\n this._arrowsRef.current?.ownerDocument.defaultView!.removeEventListener(\"pointerup\", this._releaseListener);\r\n this._arrowsRef.current?.ownerDocument.removeEventListener(\"pointerlockchange\", this._lockChangeListener);\r\n this._arrowsRef.current?.ownerDocument.defaultView!.removeEventListener(\"mousemove\", this._drag);\r\n };\r\n private _lockChangeListener = () => {\r\n if (this._arrowsRef.current?.ownerDocument.pointerLockElement !== this._arrowsRef.current) {\r\n this._releaseListener();\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n <div\r\n className=\"arrows\"\r\n ref={this._arrowsRef}\r\n onPointerDown={() => {\r\n this._arrowsRef.current?.ownerDocument.addEventListener(\"pointerlockchange\", this._lockChangeListener);\r\n this._arrowsRef.current?.ownerDocument.defaultView!.addEventListener(\"pointerup\", this._releaseListener);\r\n this._arrowsRef.current?.ownerDocument.defaultView!.addEventListener(\"mousemove\", this._drag);\r\n this.props.setDragging(true);\r\n this._arrowsRef.current?.requestPointerLock();\r\n }}\r\n onDragStart={(evt) => evt.preventDefault()}\r\n >\r\n <img className=\"upArrowIcon\" src={upArrowIcon} alt=\"Increase Value\" />\r\n <img className=\"downArrowIcon\" src={downArrowIcon} alt=\"Increase Value\" />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { ISelectedLineContainer } from "./iSelectedLineContainer";
|
3
|
+
interface ILineContainerComponentProps {
|
4
|
+
selection?: ISelectedLineContainer;
|
5
|
+
title: string;
|
6
|
+
children: any[] | any;
|
7
|
+
closed?: boolean;
|
8
|
+
}
|
9
|
+
export declare class LineContainerComponent extends React.Component<ILineContainerComponentProps, {
|
10
|
+
isExpanded: boolean;
|
11
|
+
isHighlighted: boolean;
|
12
|
+
}> {
|
13
|
+
constructor(props: ILineContainerComponentProps);
|
14
|
+
switchExpandedState(): void;
|
15
|
+
renderHeader(): JSX.Element;
|
16
|
+
componentDidMount(): void;
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { DataStorage } from "@babylonjs/core/Misc/dataStorage.js";
|
4
|
+
import downArrow from "./downArrow.svg";
|
5
|
+
export class LineContainerComponent extends React.Component {
|
6
|
+
constructor(props) {
|
7
|
+
super(props);
|
8
|
+
const initialState = DataStorage.ReadBoolean(this.props.title, !this.props.closed);
|
9
|
+
this.state = { isExpanded: initialState, isHighlighted: false };
|
10
|
+
}
|
11
|
+
switchExpandedState() {
|
12
|
+
const newState = !this.state.isExpanded;
|
13
|
+
DataStorage.WriteBoolean(this.props.title, newState);
|
14
|
+
this.setState({ isExpanded: newState });
|
15
|
+
}
|
16
|
+
renderHeader() {
|
17
|
+
const className = this.state.isExpanded ? "collapse" : "collapse closed";
|
18
|
+
return (_jsxs("div", { className: "header", onClick: () => this.switchExpandedState(), children: [_jsx("div", { className: "title", children: this.props.title }), _jsx("div", { className: className, children: _jsx("img", { className: "img", title: this.props.title, src: downArrow }) })] }));
|
19
|
+
}
|
20
|
+
componentDidMount() {
|
21
|
+
if (!this.props.selection) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
if (this.props.selection.selectedLineContainerTitles.length === 0 && this.props.selection.selectedLineContainerTitlesNoFocus.length === 0) {
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
if (this.props.selection.selectedLineContainerTitles.indexOf(this.props.title) > -1) {
|
28
|
+
setTimeout(() => {
|
29
|
+
this.props.selection.selectedLineContainerTitles = [];
|
30
|
+
});
|
31
|
+
this.setState({ isExpanded: true, isHighlighted: true });
|
32
|
+
window.setTimeout(() => {
|
33
|
+
this.setState({ isHighlighted: false });
|
34
|
+
}, 5000);
|
35
|
+
}
|
36
|
+
else if (this.props.selection.selectedLineContainerTitlesNoFocus.indexOf(this.props.title) > -1) {
|
37
|
+
this.setState({ isExpanded: true, isHighlighted: false });
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
this.setState({ isExpanded: false });
|
41
|
+
}
|
42
|
+
}
|
43
|
+
render() {
|
44
|
+
if (!this.state.isExpanded) {
|
45
|
+
return (_jsx("div", { className: "paneContainer", children: _jsx("div", { className: "paneContainer-content", children: this.renderHeader() }) }));
|
46
|
+
}
|
47
|
+
return (_jsxs("div", { className: "paneContainer", children: [_jsxs("div", { className: "paneContainer-content", children: [this.renderHeader(), _jsx("div", { className: "paneList", children: this.props.children })] }), _jsx("div", { className: "paneContainer-highlight-border" + (!this.state.isHighlighted ? " transparent" : "") })] }));
|
48
|
+
}
|
49
|
+
}
|
50
|
+
//# sourceMappingURL=lineContainerComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lineContainerComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/lineContainerComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,4CAA8B;AAEpD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AASxC,MAAM,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAwF;IACtI,YAAY,KAAmC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,MAAM,YAAY,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnF,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IACpE,CAAC;IAED,mBAAmB;QACf,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QAExC,WAAW,CAAC,YAAY,CAAC,I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YAEzD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACnB,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5C,CAAC,EAAE,IAAI,CAAC,CAAC;SACZ;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,kCAAkC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;YAC/F,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;SAC7D;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;SACxC;IACL,CAAC;IAED,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACxB,OAAO,CACH,cAAK,SAAS,EAAC,eAAe,YAC1B,cAAK,SAAS,EAAC,uBAAuB,YAAE,IAAI,CAAC,YAAY,EAAE,GAAO,GAChE,CACT,CAAC;SACL;QAED,OAAO,CACH,eAAK,SAAS,EAAC,eAAe,aAC1B,eAAK,SAAS,EAAC,uBAAuB,aACjC,IAAI,CAAC,YAAY,EAAE,EACpB,cAAK,SAAS,EAAC,UAAU,YAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAO,IACnD,EACN,cAAK,SAAS,EAAE,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,GAAQ,IAC1G,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { DataStorage } from \"core/Misc/dataStorage\";\r\nimport type { ISelectedLineContainer } from \"./iSelectedLineContainer\";\r\nimport downArrow from \"./downArrow.svg\";\r\n\r\ninterface ILineContainerComponentProps {\r\n selection?: ISelectedLineContainer;\r\n title: string;\r\n children: any[] | any;\r\n closed?: boolean;\r\n}\r\n\r\nexport class LineContainerComponent extends React.Component<ILineContainerComponentProps, { isExpanded: boolean; isHighlighted: boolean }> {\r\n constructor(props: ILineContainerComponentProps) {\r\n super(props);\r\n\r\n const initialState = DataStorage.ReadBoolean(this.props.title, !this.props.closed);\r\n\r\n this.state = { isExpanded: initialState, isHighlighted: false };\r\n }\r\n\r\n switchExpandedState(): void {\r\n const newState = !this.state.isExpanded;\r\n\r\n DataStorage.WriteBoolean(this.props.title, newState);\r\n\r\n this.setState({ isExpanded: newState });\r\n }\r\n\r\n renderHeader() {\r\n const className = this.state.isExpanded ? \"collapse\" : \"collapse closed\";\r\n\r\n return (\r\n <div className=\"header\" onClick={() => this.switchExpandedState()}>\r\n <div className=\"title\">{this.props.title}</div>\r\n <div className={className}>\r\n <img className=\"img\" title={this.props.title} src={downArrow} />\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n componentDidMount() {\r\n if (!this.props.selection) {\r\n return;\r\n }\r\n\r\n if (this.props.selection.selectedLineContainerTitles.length === 0 && this.props.selection.selectedLineContainerTitlesNoFocus.length === 0) {\r\n return;\r\n }\r\n\r\n if (this.props.selection.selectedLineContainerTitles.indexOf(this.props.title) > -1) {\r\n setTimeout(() => {\r\n this.props.selection!.selectedLineContainerTitles = [];\r\n });\r\n\r\n this.setState({ isExpanded: true, isHighlighted: true });\r\n\r\n window.setTimeout(() => {\r\n this.setState({ isHighlighted: false });\r\n }, 5000);\r\n } else if (this.props.selection.selectedLineContainerTitlesNoFocus.indexOf(this.props.title) > -1) {\r\n this.setState({ isExpanded: true, isHighlighted: false });\r\n } else {\r\n this.setState({ isExpanded: false });\r\n }\r\n }\r\n\r\n render() {\r\n if (!this.state.isExpanded) {\r\n return (\r\n <div className=\"paneContainer\">\r\n <div className=\"paneContainer-content\">{this.renderHeader()}</div>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"paneContainer\">\r\n <div className=\"paneContainer-content\">\r\n {this.renderHeader()}\r\n <div className=\"paneList\">{this.props.children}</div>\r\n </div>\r\n <div className={\"paneContainer-highlight-border\" + (!this.state.isHighlighted ? \" transparent\" : \"\")}></div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
3
|
+
interface ILinkButtonComponentProps {
|
4
|
+
label: string;
|
5
|
+
buttonLabel: string;
|
6
|
+
url?: string;
|
7
|
+
onClick: () => void;
|
8
|
+
icon?: IconProp;
|
9
|
+
onIconClick?: () => void;
|
10
|
+
}
|
11
|
+
export declare class LinkButtonComponent extends React.Component<ILinkButtonComponentProps> {
|
12
|
+
constructor(props: ILinkButtonComponentProps);
|
13
|
+
onLink(): void;
|
14
|
+
render(): JSX.Element;
|
15
|
+
}
|
16
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
4
|
+
export class LinkButtonComponent extends React.Component {
|
5
|
+
constructor(props) {
|
6
|
+
super(props);
|
7
|
+
}
|
8
|
+
onLink() {
|
9
|
+
if (this.props.url) {
|
10
|
+
window.open(this.props.url, "_blank");
|
11
|
+
}
|
12
|
+
}
|
13
|
+
render() {
|
14
|
+
return (_jsxs("div", { className: "linkButtonLine", children: [_jsx("div", { className: "link", title: this.props.label, onClick: () => this.onLink(), children: this.props.label }), _jsx("div", { className: "link-button", children: _jsx("button", { onClick: () => this.props.onClick(), children: this.props.buttonLabel }) }), this.props.icon && (_jsx("div", { className: "link-icon hoverIcon", onClick: () => {
|
15
|
+
if (this.props.onIconClick) {
|
16
|
+
this.props.onIconClick();
|
17
|
+
}
|
18
|
+
}, children: _jsx(FontAwesomeIcon, { icon: this.props.icon }) }))] }));
|
19
|
+
}
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=linkButtonComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"linkButtonComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/linkButtonComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAWjE,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAAoC;IAC/E,YAAY,KAAgC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SACzC;IACL,CAAC;IAED,MAAM;QACF,OAAO,CACH,eAAK,SAAS,EAAE,gBAAgB,aAC5B,cAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,YACtE,IAAI,CAAC,KAAK,CAAC,KAAK,GACf,EACN,cAAK,SAAS,EAAC,aAAa,YACxB,iBAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,YAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAU,GAC5E,EACL,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAChB,cACI,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,GAAG,EAAE;wBACV,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;4BACxB,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;yBAC5B;oBACL,CAAC,YAED,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAI,GACxC,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\ninterface ILinkButtonComponentProps {\r\n label: string;\r\n buttonLabel: string;\r\n url?: string;\r\n onClick: () => void;\r\n icon?: IconProp;\r\n onIconClick?: () => void;\r\n}\r\n\r\nexport class LinkButtonComponent extends React.Component<ILinkButtonComponentProps> {\r\n constructor(props: ILinkButtonComponentProps) {\r\n super(props);\r\n }\r\n\r\n onLink() {\r\n if (this.props.url) {\r\n window.open(this.props.url, \"_blank\");\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <div className={\"linkButtonLine\"}>\r\n <div className=\"link\" title={this.props.label} onClick={() => this.onLink()}>\r\n {this.props.label}\r\n </div>\r\n <div className=\"link-button\">\r\n <button onClick={() => this.props.onClick()}>{this.props.buttonLabel}</button>\r\n </div>\r\n {this.props.icon && (\r\n <div\r\n className=\"link-icon hoverIcon\"\r\n onClick={() => {\r\n if (this.props.onIconClick) {\r\n this.props.onIconClick();\r\n }\r\n }}\r\n >\r\n <FontAwesomeIcon icon={this.props.icon} />\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
+
import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
4
|
+
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
5
|
+
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
6
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
7
|
+
interface IMatrixLineComponentProps {
|
8
|
+
label: string;
|
9
|
+
target: any;
|
10
|
+
propertyName: string;
|
11
|
+
step?: number;
|
12
|
+
onChange?: (newValue: Matrix) => void;
|
13
|
+
onModeChange?: (mode: number) => void;
|
14
|
+
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
15
|
+
mode?: number;
|
16
|
+
lockObject: LockObject;
|
17
|
+
}
|
18
|
+
export declare class MatrixLineComponent extends React.Component<IMatrixLineComponentProps, {
|
19
|
+
value: Matrix;
|
20
|
+
mode: number;
|
21
|
+
angle: number;
|
22
|
+
}> {
|
23
|
+
private _localChange;
|
24
|
+
constructor(props: IMatrixLineComponentProps);
|
25
|
+
shouldComponentUpdate(nextProps: IMatrixLineComponentProps, nextState: {
|
26
|
+
value: Matrix;
|
27
|
+
mode: number;
|
28
|
+
angle: number;
|
29
|
+
}): boolean;
|
30
|
+
raiseOnPropertyChanged(previousValue: Vector3): void;
|
31
|
+
updateMatrix(): void;
|
32
|
+
updateRow(value: Vector4, row: number): void;
|
33
|
+
updateBasedOnMode(value: number): void;
|
34
|
+
render(): JSX.Element;
|
35
|
+
}
|
36
|
+
export {};
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { Matrix, Quaternion } from "@babylonjs/core/Maths/math.vector.js";
|
4
|
+
import { Vector4LineComponent } from "./vector4LineComponent.js";
|
5
|
+
import { OptionsLineComponent } from "./optionsLineComponent.js";
|
6
|
+
import { SliderLineComponent } from "./sliderLineComponent.js";
|
7
|
+
export class MatrixLineComponent extends React.Component {
|
8
|
+
constructor(props) {
|
9
|
+
super(props);
|
10
|
+
this._localChange = false;
|
11
|
+
const matrix = this.props.target[this.props.propertyName].clone();
|
12
|
+
let angle = 0;
|
13
|
+
if (this.props.mode) {
|
14
|
+
const quat = new Quaternion();
|
15
|
+
matrix.decompose(undefined, quat);
|
16
|
+
const euler = quat.toEulerAngles();
|
17
|
+
switch (this.props.mode) {
|
18
|
+
case 1:
|
19
|
+
angle = euler.x;
|
20
|
+
break;
|
21
|
+
case 2:
|
22
|
+
angle = euler.y;
|
23
|
+
break;
|
24
|
+
case 3:
|
25
|
+
angle = euler.z;
|
26
|
+
break;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
this.state = { value: matrix, mode: this.props.mode || 0, angle: angle };
|
30
|
+
}
|
31
|
+
shouldComponentUpdate(nextProps, nextState) {
|
32
|
+
const nextPropsValue = nextProps.target[nextProps.propertyName];
|
33
|
+
if (!nextPropsValue.equals(nextState.value) || this._localChange) {
|
34
|
+
nextState.value = nextPropsValue.clone();
|
35
|
+
this._localChange = false;
|
36
|
+
return true;
|
37
|
+
}
|
38
|
+
return nextState.mode !== this.state.mode || nextState.angle !== this.state.angle;
|
39
|
+
}
|
40
|
+
raiseOnPropertyChanged(previousValue) {
|
41
|
+
if (this.props.onChange) {
|
42
|
+
this.props.onChange(this.state.value);
|
43
|
+
}
|
44
|
+
if (!this.props.onPropertyChangedObservable) {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
this.props.onPropertyChangedObservable.notifyObservers({
|
48
|
+
object: this.props.target,
|
49
|
+
property: this.props.propertyName,
|
50
|
+
value: this.state.value,
|
51
|
+
initialValue: previousValue,
|
52
|
+
});
|
53
|
+
}
|
54
|
+
updateMatrix() {
|
55
|
+
const store = this.props.target[this.props.propertyName].clone();
|
56
|
+
this.props.target[this.props.propertyName] = this.state.value;
|
57
|
+
this.setState({ value: store });
|
58
|
+
this.raiseOnPropertyChanged(store);
|
59
|
+
}
|
60
|
+
updateRow(value, row) {
|
61
|
+
this._localChange = true;
|
62
|
+
this.state.value.setRow(row, value);
|
63
|
+
this.updateMatrix();
|
64
|
+
}
|
65
|
+
updateBasedOnMode(value) {
|
66
|
+
switch (this.state.mode) {
|
67
|
+
case 1: {
|
68
|
+
Matrix.RotationXToRef(this.state.angle, this.state.value);
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
case 2: {
|
72
|
+
Matrix.RotationYToRef(this.state.angle, this.state.value);
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
case 3: {
|
76
|
+
Matrix.RotationZToRef(this.state.angle, this.state.value);
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
this.updateMatrix();
|
81
|
+
this.setState({ angle: value });
|
82
|
+
}
|
83
|
+
render() {
|
84
|
+
const modeOptions = [
|
85
|
+
{ label: "User-defined", value: 0 },
|
86
|
+
{ label: "Rotation over X axis", value: 1 },
|
87
|
+
{ label: "Rotation over Y axis", value: 2 },
|
88
|
+
{ label: "Rotation over Z axis", value: 3 },
|
89
|
+
];
|
90
|
+
return (_jsxs("div", { className: "vector3Line", children: [_jsx("div", { className: "firstLine", children: _jsx("div", { className: "label", title: this.props.label, children: this.props.label }) }), _jsx("div", { className: "secondLine", children: _jsx(OptionsLineComponent, { label: "Mode", className: "no-right-margin", options: modeOptions, target: this, noDirectUpdate: true, propertyName: "", extractValue: () => {
|
91
|
+
return this.state.mode;
|
92
|
+
}, onSelect: (value) => {
|
93
|
+
this.props.target[this.props.propertyName] = Matrix.Identity();
|
94
|
+
Matrix.IdentityToRef(this.state.value);
|
95
|
+
this.setState({ mode: value, angle: 0 });
|
96
|
+
this.updateMatrix();
|
97
|
+
if (this.props.onModeChange) {
|
98
|
+
this.props.onModeChange(value);
|
99
|
+
}
|
100
|
+
} }) }), this.state.mode === 0 && (_jsxs("div", { className: "secondLine", children: [_jsx(Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #0", value: this.state.value.getRow(0), onChange: (value) => this.updateRow(value, 0) }), _jsx(Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #1", value: this.state.value.getRow(1), onChange: (value) => this.updateRow(value, 1) }), _jsx(Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #2", value: this.state.value.getRow(2), onChange: (value) => this.updateRow(value, 2) }), _jsx(Vector4LineComponent, { lockObject: this.props.lockObject, label: "Row #3", value: this.state.value.getRow(3), onChange: (value) => this.updateRow(value, 3) })] })), this.state.mode !== 0 && (_jsx("div", { className: "secondLine", children: _jsx(SliderLineComponent, { label: "Angle", lockObject: this.props.lockObject, minimum: 0, maximum: 2 * Math.PI, useEuler: true, step: 0.1, directValue: this.state.angle, onChange: (value) => this.updateBasedOnMode(value) }) }))] }));
|
101
|
+
}
|
102
|
+
}
|
103
|
+
//# sourceMappingURL=matrixLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"matrixLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/matrixLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,6CAA+B;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAe5D,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAAoF;IAG/H,YAAY,KAAgC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHT,iBAAY,GAAG,KAAK,CAAC;QAKzB,MAAM,MAAM,GAAW,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;QAE1E,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACjB,MAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAElC,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAEnC,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;gBACrB,KAAK,CAAC;oBACF,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;oBAChB,MAAM;gBACV,KAAK,CAAC;oBACF,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;o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E,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,GAC/C,IACA,CACT,EACA,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CACtB,cAAK,SAAS,EAAC,YAAY,YACvB,KAAC,mBAAmB,IAChB,KAAK,EAAC,OAAO,EACb,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EACpB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GACpD,GACA,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { Matrix, Quaternion } from \"core/Maths/math.vector\";\r\nimport type { Observable } from \"core/Misc/observable\";\r\nimport { Vector4LineComponent } from \"./vector4LineComponent\";\r\nimport type { PropertyChangedEvent } from \"../propertyChangedEvent\";\r\nimport { OptionsLineComponent } from \"./optionsLineComponent\";\r\nimport { SliderLineComponent } from \"./sliderLineComponent\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\ninterface IMatrixLineComponentProps {\r\n label: string;\r\n target: any;\r\n propertyName: string;\r\n step?: number;\r\n onChange?: (newValue: Matrix) => void;\r\n onModeChange?: (mode: number) => void;\r\n onPropertyChangedObservable?: Observable<PropertyChangedEvent>;\r\n mode?: number;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class MatrixLineComponent extends React.Component<IMatrixLineComponentProps, { value: Matrix; mode: number; angle: number }> {\r\n private _localChange = false;\r\n\r\n constructor(props: IMatrixLineComponentProps) {\r\n super(props);\r\n\r\n const matrix: Matrix = this.props.target[this.props.propertyName].clone();\r\n\r\n let angle = 0;\r\n\r\n if (this.props.mode) {\r\n const quat = new Quaternion();\r\n matrix.decompose(undefined, quat);\r\n\r\n const euler = quat.toEulerAngles();\r\n\r\n switch (this.props.mode) {\r\n case 1:\r\n angle = euler.x;\r\n break;\r\n case 2:\r\n angle = euler.y;\r\n break;\r\n case 3:\r\n angle = euler.z;\r\n break;\r\n }\r\n }\r\n\r\n this.state = { value: matrix, mode: this.props.mode || 0, angle: angle };\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IMatrixLineComponentProps, nextState: { value: Matrix; mode: number; angle: number }) {\r\n const nextPropsValue = nextProps.target[nextProps.propertyName];\r\n\r\n if (!nextPropsValue.equals(nextState.value) || this._localChange) {\r\n nextState.value = nextPropsValue.clone();\r\n this._localChange = false;\r\n return true;\r\n }\r\n return nextState.mode !== this.state.mode || nextState.angle !== this.state.angle;\r\n }\r\n\r\n raiseOnPropertyChanged(previousValue: Vector3) {\r\n if (this.props.onChange) {\r\n this.props.onChange(this.state.value);\r\n }\r\n\r\n if (!this.props.onPropertyChangedObservable) {\r\n return;\r\n }\r\n this.props.onPropertyChangedObservable.notifyObservers({\r\n object: this.props.target,\r\n property: this.props.propertyName,\r\n value: this.state.value,\r\n initialValue: previousValue,\r\n });\r\n }\r\n\r\n updateMatrix() {\r\n const store = this.props.target[this.props.propertyName].clone();\r\n this.props.target[this.props.propertyName] = this.state.value;\r\n\r\n this.setState({ value: store });\r\n\r\n this.raiseOnPropertyChanged(store);\r\n }\r\n\r\n updateRow(value: Vector4, row: number) {\r\n this._localChange = true;\r\n\r\n this.state.value.setRow(row, value);\r\n this.updateMatrix();\r\n }\r\n\r\n updateBasedOnMode(value: number) {\r\n switch (this.state.mode) {\r\n case 1: {\r\n Matrix.RotationXToRef(this.state.angle, this.state.value);\r\n break;\r\n }\r\n case 2: {\r\n Matrix.RotationYToRef(this.state.angle, this.state.value);\r\n break;\r\n }\r\n case 3: {\r\n Matrix.RotationZToRef(this.state.angle, this.state.value);\r\n break;\r\n }\r\n }\r\n this.updateMatrix();\r\n\r\n this.setState({ angle: value });\r\n }\r\n\r\n render() {\r\n const modeOptions = [\r\n { label: \"User-defined\", value: 0 },\r\n { label: \"Rotation over X axis\", value: 1 },\r\n { label: \"Rotation over Y axis\", value: 2 },\r\n { label: \"Rotation over Z axis\", value: 3 },\r\n ];\r\n\r\n return (\r\n <div className=\"vector3Line\">\r\n <div className=\"firstLine\">\r\n <div className=\"label\" title={this.props.label}>\r\n {this.props.label}\r\n </div>\r\n </div>\r\n <div className=\"secondLine\">\r\n <OptionsLineComponent\r\n label=\"Mode\"\r\n className=\"no-right-margin\"\r\n options={modeOptions}\r\n target={this}\r\n noDirectUpdate={true}\r\n propertyName={\"\"}\r\n extractValue={() => {\r\n return this.state.mode;\r\n }}\r\n onSelect={(value: any) => {\r\n this.props.target[this.props.propertyName] = Matrix.Identity();\r\n Matrix.IdentityToRef(this.state.value);\r\n this.setState({ mode: value, angle: 0 });\r\n\r\n this.updateMatrix();\r\n\r\n if (this.props.onModeChange) {\r\n this.props.onModeChange(value);\r\n }\r\n }}\r\n />\r\n </div>\r\n {this.state.mode === 0 && (\r\n <div className=\"secondLine\">\r\n <Vector4LineComponent\r\n lockObject={this.props.lockObject}\r\n label=\"Row #0\"\r\n value={this.state.value.getRow(0)!}\r\n onChange={(value) => this.updateRow(value, 0)}\r\n />\r\n <Vector4LineComponent\r\n lockObject={this.props.lockObject}\r\n label=\"Row #1\"\r\n value={this.state.value.getRow(1)!}\r\n onChange={(value) => this.updateRow(value, 1)}\r\n />\r\n <Vector4LineComponent\r\n lockObject={this.props.lockObject}\r\n label=\"Row #2\"\r\n value={this.state.value.getRow(2)!}\r\n onChange={(value) => this.updateRow(value, 2)}\r\n />\r\n <Vector4LineComponent\r\n lockObject={this.props.lockObject}\r\n label=\"Row #3\"\r\n value={this.state.value.getRow(3)!}\r\n onChange={(value) => this.updateRow(value, 3)}\r\n />\r\n </div>\r\n )}\r\n {this.state.mode !== 0 && (\r\n <div className=\"secondLine\">\r\n <SliderLineComponent\r\n label=\"Angle\"\r\n lockObject={this.props.lockObject}\r\n minimum={0}\r\n maximum={2 * Math.PI}\r\n useEuler={true}\r\n step={0.1}\r\n directValue={this.state.angle}\r\n onChange={(value) => this.updateBasedOnMode(value)}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
3
|
+
interface IMessageLineComponentProps {
|
4
|
+
text: string;
|
5
|
+
color?: string;
|
6
|
+
icon?: IconProp;
|
7
|
+
}
|
8
|
+
export declare class MessageLineComponent extends React.Component<IMessageLineComponentProps> {
|
9
|
+
constructor(props: IMessageLineComponentProps);
|
10
|
+
render(): JSX.Element;
|
11
|
+
}
|
12
|
+
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
4
|
+
export class MessageLineComponent extends React.Component {
|
5
|
+
constructor(props) {
|
6
|
+
super(props);
|
7
|
+
}
|
8
|
+
render() {
|
9
|
+
if (this.props.icon) {
|
10
|
+
return (_jsxs("div", { className: "iconMessageLine", children: [_jsx("div", { className: "icon", style: { color: this.props.color ? this.props.color : "" }, children: _jsx(FontAwesomeIcon, { icon: this.props.icon }) }), _jsx("div", { className: "value", title: this.props.text, children: this.props.text })] }));
|
11
|
+
}
|
12
|
+
return (_jsx("div", { className: "messageLine", children: _jsx("div", { className: "value", title: this.props.text, style: { color: this.props.color ? this.props.color : "" }, children: this.props.text }) }));
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=messageLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messageLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/messageLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQjE,MAAM,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAqC;IACjF,YAAY,KAAiC;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACjB,OAAO,CACH,eAAK,SAAS,EAAC,iBAAiB,aAC5B,cAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,YAC5E,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAI,GACxC,EACN,cAAK,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,YACxC,IAAI,CAAC,KAAK,CAAC,IAAI,GACd,IACJ,CACT,CAAC;SACL;QAED,OAAO,CACH,cAAK,SAAS,EAAC,aAAa,YACxB,cAAK,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,YACpG,IAAI,CAAC,KAAK,CAAC,IAAI,GACd,GACJ,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\ninterface IMessageLineComponentProps {\r\n text: string;\r\n color?: string;\r\n icon?: IconProp;\r\n}\r\n\r\nexport class MessageLineComponent extends React.Component<IMessageLineComponentProps> {\r\n constructor(props: IMessageLineComponentProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n if (this.props.icon) {\r\n return (\r\n <div className=\"iconMessageLine\">\r\n <div className=\"icon\" style={{ color: this.props.color ? this.props.color : \"\" }}>\r\n <FontAwesomeIcon icon={this.props.icon} />\r\n </div>\r\n <div className=\"value\" title={this.props.text}>\r\n {this.props.text}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"messageLine\">\r\n <div className=\"value\" title={this.props.text} style={{ color: this.props.color ? this.props.color : \"\" }}>\r\n {this.props.text}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
3
|
+
interface INumericInputComponentProps {
|
4
|
+
label: string;
|
5
|
+
value: number;
|
6
|
+
step?: number;
|
7
|
+
onChange: (value: number) => void;
|
8
|
+
precision?: number;
|
9
|
+
icon?: string;
|
10
|
+
iconLabel?: string;
|
11
|
+
lockObject: LockObject;
|
12
|
+
}
|
13
|
+
export declare class NumericInputComponent extends React.Component<INumericInputComponentProps, {
|
14
|
+
value: string;
|
15
|
+
}> {
|
16
|
+
static defaultProps: {
|
17
|
+
step: number;
|
18
|
+
};
|
19
|
+
private _localChange;
|
20
|
+
constructor(props: INumericInputComponentProps);
|
21
|
+
componentWillUnmount(): void;
|
22
|
+
shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
|
23
|
+
value: string;
|
24
|
+
}): boolean;
|
25
|
+
updateValue(valueString: string): void;
|
26
|
+
onBlur(): void;
|
27
|
+
incrementValue(amount: number): void;
|
28
|
+
onKeyDown(evt: React.KeyboardEvent<HTMLInputElement>): void;
|
29
|
+
render(): JSX.Element;
|
30
|
+
}
|
31
|
+
export {};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class NumericInputComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
this._localChange = false;
|
7
|
+
this.state = { value: this.props.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3) };
|
8
|
+
}
|
9
|
+
componentWillUnmount() {
|
10
|
+
if (this.props.lockObject) {
|
11
|
+
this.props.lockObject.lock = false;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
shouldComponentUpdate(nextProps, nextState) {
|
15
|
+
if (this._localChange) {
|
16
|
+
return true;
|
17
|
+
}
|
18
|
+
if (nextProps.value.toString() !== nextState.value) {
|
19
|
+
nextState.value = nextProps.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3);
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
updateValue(valueString) {
|
25
|
+
if (/[^0-9.-]/g.test(valueString)) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
const valueAsNumber = parseFloat(valueString);
|
29
|
+
this._localChange = true;
|
30
|
+
this.setState({ value: valueString });
|
31
|
+
if (isNaN(valueAsNumber)) {
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
this.props.onChange(valueAsNumber);
|
35
|
+
}
|
36
|
+
onBlur() {
|
37
|
+
this._localChange = false;
|
38
|
+
const valueAsNumber = parseFloat(this.state.value);
|
39
|
+
if (this.props.lockObject) {
|
40
|
+
this.props.lockObject.lock = false;
|
41
|
+
}
|
42
|
+
if (isNaN(valueAsNumber)) {
|
43
|
+
this.props.onChange(this.props.value);
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
this.props.onChange(valueAsNumber);
|
47
|
+
}
|
48
|
+
incrementValue(amount) {
|
49
|
+
let currentValue = parseFloat(this.state.value);
|
50
|
+
if (isNaN(currentValue)) {
|
51
|
+
currentValue = 0;
|
52
|
+
}
|
53
|
+
this.updateValue((currentValue + amount).toFixed(this.props.precision !== undefined ? this.props.precision : 3));
|
54
|
+
}
|
55
|
+
onKeyDown(evt) {
|
56
|
+
const step = this.props.step || 1;
|
57
|
+
const handleArrowKey = (sign) => {
|
58
|
+
if (evt.shiftKey) {
|
59
|
+
sign *= 10;
|
60
|
+
if (evt.ctrlKey || evt.metaKey) {
|
61
|
+
sign *= 10;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
this.incrementValue(sign * step);
|
65
|
+
evt.preventDefault();
|
66
|
+
};
|
67
|
+
if (evt.key === "ArrowUp") {
|
68
|
+
handleArrowKey(1);
|
69
|
+
}
|
70
|
+
else if (evt.key === "ArrowDown") {
|
71
|
+
handleArrowKey(-1);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
render() {
|
75
|
+
return (_jsxs("div", { className: "numeric", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && (_jsx("div", { className: "numeric-label", title: this.props.label, children: `${this.props.label}: ` })), _jsx("input", { type: "number", step: this.props.step, className: "numeric-input", value: this.state.value, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), onFocus: () => {
|
76
|
+
if (this.props.lockObject) {
|
77
|
+
this.props.lockObject.lock = true;
|
78
|
+
}
|
79
|
+
}, onBlur: () => this.onBlur() })] }));
|
80
|
+
}
|
81
|
+
}
|
82
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
83
|
+
NumericInputComponent.defaultProps = {
|
84
|
+
step: 1,
|
85
|
+
};
|
86
|
+
//# sourceMappingURL=numericInputComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"numericInputComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/numericInputComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,MAAM,OAAO,qBAAs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AU,EAAE;4BACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;yBACrC;oBACL,CAAC,EACD,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,GAC7B,IACA,CACT,CAAC;IACN,CAAC;;AArHD,gEAAgE;AACzD,kCAAY,GAAG;IAClB,IAAI,EAAE,CAAC;CACV,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\ninterface INumericInputComponentProps {\r\n label: string;\r\n value: number;\r\n step?: number;\r\n onChange: (value: number) => void;\r\n precision?: number;\r\n icon?: string;\r\n iconLabel?: string;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class NumericInputComponent extends React.Component<INumericInputComponentProps, { value: string }> {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n static defaultProps = {\r\n step: 1,\r\n };\r\n\r\n private _localChange = false;\r\n constructor(props: INumericInputComponentProps) {\r\n super(props);\r\n\r\n this.state = { value: this.props.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3) };\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: { value: string }) {\r\n if (this._localChange) {\r\n return true;\r\n }\r\n\r\n if (nextProps.value.toString() !== nextState.value) {\r\n nextState.value = nextProps.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n updateValue(valueString: string) {\r\n if (/[^0-9.-]/g.test(valueString)) {\r\n return;\r\n }\r\n\r\n const valueAsNumber = parseFloat(valueString);\r\n\r\n this._localChange = true;\r\n this.setState({ value: valueString });\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n onBlur() {\r\n this._localChange = false;\r\n const valueAsNumber = parseFloat(this.state.value);\r\n\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n\r\n if (isNaN(valueAsNumber)) {\r\n this.props.onChange(this.props.value);\r\n return;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n incrementValue(amount: number) {\r\n let currentValue = parseFloat(this.state.value);\r\n if (isNaN(currentValue)) {\r\n currentValue = 0;\r\n }\r\n this.updateValue((currentValue + amount).toFixed(this.props.precision !== undefined ? this.props.precision : 3));\r\n }\r\n\r\n onKeyDown(evt: React.KeyboardEvent<HTMLInputElement>) {\r\n const step = this.props.step || 1;\r\n const handleArrowKey = (sign: number) => {\r\n if (evt.shiftKey) {\r\n sign *= 10;\r\n if (evt.ctrlKey || evt.metaKey) {\r\n sign *= 10;\r\n }\r\n }\r\n\r\n this.incrementValue(sign * step);\r\n evt.preventDefault();\r\n };\r\n\r\n if (evt.key === \"ArrowUp\") {\r\n handleArrowKey(1);\r\n } else if (evt.key === \"ArrowDown\") {\r\n handleArrowKey(-1);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <div className=\"numeric\">\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n {this.props.label && (\r\n <div className=\"numeric-label\" title={this.props.label}>\r\n {`${this.props.label}: `}\r\n </div>\r\n )}\r\n <input\r\n type=\"number\"\r\n step={this.props.step}\r\n className=\"numeric-input\"\r\n value={this.state.value}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n onKeyDown={(evt) => this.onKeyDown(evt)}\r\n onFocus={() => {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }}\r\n onBlur={() => this.onBlur()}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|