@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,17 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IFileButtonLineComponentProps {
|
3
|
+
label: string;
|
4
|
+
onClick: (file: File) => void;
|
5
|
+
accept: string;
|
6
|
+
icon?: string;
|
7
|
+
iconLabel?: string;
|
8
|
+
}
|
9
|
+
export declare class FileButtonLineComponent extends React.Component<IFileButtonLineComponentProps> {
|
10
|
+
private static _IDGenerator;
|
11
|
+
private _id;
|
12
|
+
private _uploadInputRef;
|
13
|
+
constructor(props: IFileButtonLineComponentProps);
|
14
|
+
onChange(evt: any): void;
|
15
|
+
render(): JSX.Element;
|
16
|
+
}
|
17
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class FileButtonLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
this._id = FileButtonLineComponent._IDGenerator++;
|
7
|
+
this._uploadInputRef = React.createRef();
|
8
|
+
}
|
9
|
+
onChange(evt) {
|
10
|
+
const files = evt.target.files;
|
11
|
+
if (files && files.length) {
|
12
|
+
this.props.onClick(files[0]);
|
13
|
+
}
|
14
|
+
evt.target.value = "";
|
15
|
+
}
|
16
|
+
render() {
|
17
|
+
return (_jsxs("div", { className: "buttonLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), _jsx("label", { htmlFor: "file-upload" + this._id, className: "file-upload", children: this.props.label }), _jsx("input", { ref: this._uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: (evt) => this.onChange(evt) })] }));
|
18
|
+
}
|
19
|
+
}
|
20
|
+
FileButtonLineComponent._IDGenerator = 0;
|
21
|
+
//# sourceMappingURL=fileButtonLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fileButtonLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/fileButtonLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,OAAO,uBAAwB,SAAQ,KAAK,CAAC,SAAwC;IAKvF,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,QAAG,GAAG,uBAAuB,CAAC,YAAY,EAAE,CAAC;QAKjD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,GAAQ;QACb,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QACvC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAChC;QAED,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM;QACF,OAAO,CACH,eAAK,SAAS,EAAC,YAAY,aACtB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,cAAK,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,EAC1H,gBAAO,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,EAAC,aAAa,YAC5D,IAAI,CAAC,KAAK,CAAC,KAAK,GACb,EACR,gBAAO,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,EAAE,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAI,IAC9I,CACT,CAAC;IACN,CAAC;;AA5Bc,oCAAY,GAAG,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\n\r\ninterface IFileButtonLineComponentProps {\r\n label: string;\r\n onClick: (file: File) => void;\r\n accept: string;\r\n icon?: string;\r\n iconLabel?: string;\r\n}\r\n\r\nexport class FileButtonLineComponent extends React.Component<IFileButtonLineComponentProps> {\r\n private static _IDGenerator = 0;\r\n private _id = FileButtonLineComponent._IDGenerator++;\r\n private _uploadInputRef: React.RefObject<HTMLInputElement>;\r\n\r\n constructor(props: IFileButtonLineComponentProps) {\r\n super(props);\r\n this._uploadInputRef = React.createRef();\r\n }\r\n\r\n onChange(evt: any) {\r\n const files: File[] = evt.target.files;\r\n if (files && files.length) {\r\n this.props.onClick(files[0]);\r\n }\r\n\r\n evt.target.value = \"\";\r\n }\r\n\r\n render() {\r\n return (\r\n <div className=\"buttonLine\">\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <label htmlFor={\"file-upload\" + this._id} className=\"file-upload\">\r\n {this.props.label}\r\n </label>\r\n <input ref={this._uploadInputRef} id={\"file-upload\" + this._id} type=\"file\" accept={this.props.accept} onChange={(evt) => this.onChange(evt)} />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IFileMultipleButtonLineComponentProps {
|
3
|
+
label: string;
|
4
|
+
onClick: (event: any) => void;
|
5
|
+
accept: string;
|
6
|
+
icon?: string;
|
7
|
+
iconLabel?: string;
|
8
|
+
}
|
9
|
+
export declare class FileMultipleButtonLineComponent extends React.Component<IFileMultipleButtonLineComponentProps> {
|
10
|
+
private static _IDGenerator;
|
11
|
+
private _id;
|
12
|
+
private _uploadInputRef;
|
13
|
+
constructor(props: IFileMultipleButtonLineComponentProps);
|
14
|
+
onChange(evt: any): void;
|
15
|
+
render(): JSX.Element;
|
16
|
+
}
|
17
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class FileMultipleButtonLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
this._id = FileMultipleButtonLineComponent._IDGenerator++;
|
7
|
+
this._uploadInputRef = React.createRef();
|
8
|
+
}
|
9
|
+
onChange(evt) {
|
10
|
+
const files = evt.target.files;
|
11
|
+
if (files && files.length) {
|
12
|
+
this.props.onClick(evt);
|
13
|
+
}
|
14
|
+
evt.target.value = "";
|
15
|
+
}
|
16
|
+
render() {
|
17
|
+
return (_jsxs("div", { className: "buttonLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), _jsx("label", { htmlFor: "file-upload" + this._id, className: "file-upload", children: this.props.label }), _jsx("input", { ref: this._uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: (evt) => this.onChange(evt), multiple: true })] }));
|
18
|
+
}
|
19
|
+
}
|
20
|
+
FileMultipleButtonLineComponent._IDGenerator = 0;
|
21
|
+
//# sourceMappingURL=fileMultipleButtonLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fileMultipleButtonLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/fileMultipleButtonLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,OAAO,+BAAgC,SAAQ,KAAK,CAAC,SAAgD;IAKvG,YAAY,KAA4C;QACpD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,QAAG,GAAG,+BAA+B,CAAC,YAAY,EAAE,CAAC;QAKzD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,GAAQ;QACb,MAAM,KAAK,GAAW,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QACvC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAC3B;QAED,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM;QACF,OAAO,CACH,eAAK,SAAS,EAAC,YAAY,aACtB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,cAAK,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,EAC1H,gBAAO,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,EAAC,aAAa,YAC5D,IAAI,CAAC,KAAK,CAAC,KAAK,GACb,EACR,gBAAO,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,EAAE,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,SAAG,IACvJ,CACT,CAAC;IACN,CAAC;;AA5Bc,4CAAY,GAAG,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\n\r\ninterface IFileMultipleButtonLineComponentProps {\r\n label: string;\r\n onClick: (event: any) => void;\r\n accept: string;\r\n icon?: string;\r\n iconLabel?: string;\r\n}\r\n\r\nexport class FileMultipleButtonLineComponent extends React.Component<IFileMultipleButtonLineComponentProps> {\r\n private static _IDGenerator = 0;\r\n private _id = FileMultipleButtonLineComponent._IDGenerator++;\r\n private _uploadInputRef: React.RefObject<HTMLInputElement>;\r\n\r\n constructor(props: IFileMultipleButtonLineComponentProps) {\r\n super(props);\r\n this._uploadInputRef = React.createRef();\r\n }\r\n\r\n onChange(evt: any) {\r\n const files: File[] = evt.target.files;\r\n if (files && files.length) {\r\n this.props.onClick(evt);\r\n }\r\n\r\n evt.target.value = \"\";\r\n }\r\n\r\n render() {\r\n return (\r\n <div className=\"buttonLine\">\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <label htmlFor={\"file-upload\" + this._id} className=\"file-upload\">\r\n {this.props.label}\r\n </label>\r\n <input ref={this._uploadInputRef} id={\"file-upload\" + this._id} type=\"file\" accept={this.props.accept} onChange={(evt) => this.onChange(evt)} multiple />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
3
|
+
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
4
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
5
|
+
interface IFloatLineComponentProps {
|
6
|
+
label: string;
|
7
|
+
target: any;
|
8
|
+
propertyName: string;
|
9
|
+
lockObject: LockObject;
|
10
|
+
onChange?: (newValue: number) => void;
|
11
|
+
isInteger?: boolean;
|
12
|
+
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
13
|
+
additionalClass?: string;
|
14
|
+
step?: string;
|
15
|
+
digits?: number;
|
16
|
+
useEuler?: boolean;
|
17
|
+
min?: number;
|
18
|
+
max?: number;
|
19
|
+
smallUI?: boolean;
|
20
|
+
onEnter?: (newValue: number) => void;
|
21
|
+
icon?: string;
|
22
|
+
iconLabel?: string;
|
23
|
+
defaultValue?: number;
|
24
|
+
arrows?: boolean;
|
25
|
+
unit?: React.ReactNode;
|
26
|
+
onDragStart?: (newValue: number) => void;
|
27
|
+
onDragStop?: (newValue: number) => void;
|
28
|
+
}
|
29
|
+
export declare class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
|
30
|
+
value: string;
|
31
|
+
dragging: boolean;
|
32
|
+
}> {
|
33
|
+
private _localChange;
|
34
|
+
private _store;
|
35
|
+
constructor(props: IFloatLineComponentProps);
|
36
|
+
componentWillUnmount(): void;
|
37
|
+
getValueString(value: any): string;
|
38
|
+
shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: {
|
39
|
+
value: string;
|
40
|
+
dragging: boolean;
|
41
|
+
}): boolean;
|
42
|
+
raiseOnPropertyChanged(newValue: number, previousValue: number): void;
|
43
|
+
updateValue(valueString: string): void;
|
44
|
+
lock(): void;
|
45
|
+
unlock(): void;
|
46
|
+
incrementValue(amount: number, processStep?: boolean): void;
|
47
|
+
onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;
|
48
|
+
render(): JSX.Element;
|
49
|
+
}
|
50
|
+
export {};
|
@@ -0,0 +1,176 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { SliderLineComponent } from "./sliderLineComponent.js";
|
4
|
+
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
5
|
+
import { conflictingValuesPlaceholder } from "./targetsProxy.js";
|
6
|
+
import { InputArrowsComponent } from "./inputArrowsComponent.js";
|
7
|
+
export class FloatLineComponent extends React.Component {
|
8
|
+
constructor(props) {
|
9
|
+
super(props);
|
10
|
+
this._localChange = false;
|
11
|
+
const currentValue = this.props.target[this.props.propertyName];
|
12
|
+
this.state = { value: this.getValueString(currentValue), dragging: false };
|
13
|
+
this._store = currentValue;
|
14
|
+
}
|
15
|
+
componentWillUnmount() {
|
16
|
+
this.unlock();
|
17
|
+
}
|
18
|
+
getValueString(value) {
|
19
|
+
if (value) {
|
20
|
+
if (value === conflictingValuesPlaceholder) {
|
21
|
+
return conflictingValuesPlaceholder;
|
22
|
+
}
|
23
|
+
else if (this.props.isInteger) {
|
24
|
+
return value.toFixed(0);
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
return value.toFixed(this.props.digits || 4);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
return "0";
|
31
|
+
}
|
32
|
+
shouldComponentUpdate(nextProps, nextState) {
|
33
|
+
if (this._localChange) {
|
34
|
+
this._localChange = false;
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
const newValue = nextProps.target[nextProps.propertyName];
|
38
|
+
const newValueString = this.getValueString(newValue);
|
39
|
+
if (newValueString !== nextState.value) {
|
40
|
+
nextState.value = newValueString;
|
41
|
+
return true;
|
42
|
+
}
|
43
|
+
if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {
|
44
|
+
return true;
|
45
|
+
}
|
46
|
+
return false;
|
47
|
+
}
|
48
|
+
raiseOnPropertyChanged(newValue, previousValue) {
|
49
|
+
if (this.props.onChange) {
|
50
|
+
this.props.onChange(newValue);
|
51
|
+
}
|
52
|
+
if (!this.props.onPropertyChangedObservable) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
this.props.onPropertyChangedObservable.notifyObservers({
|
56
|
+
object: this.props.target,
|
57
|
+
property: this.props.propertyName,
|
58
|
+
value: newValue,
|
59
|
+
initialValue: previousValue,
|
60
|
+
});
|
61
|
+
}
|
62
|
+
updateValue(valueString) {
|
63
|
+
if (/[^0-9.-]/g.test(valueString)) {
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
let valueAsNumber;
|
67
|
+
if (this.props.isInteger) {
|
68
|
+
valueAsNumber = parseInt(valueString);
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
valueAsNumber = parseFloat(valueString);
|
72
|
+
}
|
73
|
+
if (!isNaN(valueAsNumber)) {
|
74
|
+
if (this.props.min !== undefined) {
|
75
|
+
if (valueAsNumber < this.props.min) {
|
76
|
+
valueAsNumber = this.props.min;
|
77
|
+
valueString = valueAsNumber.toString();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
if (this.props.max !== undefined) {
|
81
|
+
if (valueAsNumber > this.props.max) {
|
82
|
+
valueAsNumber = this.props.max;
|
83
|
+
valueString = valueAsNumber.toString();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
else if (this.props.defaultValue != null) {
|
88
|
+
valueAsNumber = this.props.defaultValue;
|
89
|
+
}
|
90
|
+
this._localChange = true;
|
91
|
+
this.setState({ value: valueString });
|
92
|
+
if (isNaN(valueAsNumber)) {
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
this.props.target[this.props.propertyName] = valueAsNumber;
|
96
|
+
this.raiseOnPropertyChanged(valueAsNumber, this._store);
|
97
|
+
this._store = valueAsNumber;
|
98
|
+
}
|
99
|
+
lock() {
|
100
|
+
if (this.props.lockObject) {
|
101
|
+
this.props.lockObject.lock = true;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
unlock() {
|
105
|
+
if (this.props.lockObject) {
|
106
|
+
this.props.lockObject.lock = false;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
incrementValue(amount, processStep = true) {
|
110
|
+
if (processStep && this.props.step) {
|
111
|
+
amount *= parseFloat(this.props.step);
|
112
|
+
}
|
113
|
+
let currentValue = parseFloat(this.state.value);
|
114
|
+
if (isNaN(currentValue)) {
|
115
|
+
currentValue = 0;
|
116
|
+
}
|
117
|
+
this.updateValue((currentValue + amount).toFixed(2));
|
118
|
+
}
|
119
|
+
onKeyDown(event) {
|
120
|
+
const step = parseFloat(this.props.step || this.props.isInteger ? "1" : "0.01");
|
121
|
+
const handleArrowKey = (sign) => {
|
122
|
+
if (event.shiftKey) {
|
123
|
+
sign *= 10;
|
124
|
+
if (event.ctrlKey || event.metaKey) {
|
125
|
+
sign *= 10;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
this.incrementValue(sign * step, false);
|
129
|
+
event.preventDefault();
|
130
|
+
};
|
131
|
+
if (event.key === "ArrowUp") {
|
132
|
+
handleArrowKey(1);
|
133
|
+
}
|
134
|
+
else if (event.key === "ArrowDown") {
|
135
|
+
handleArrowKey(-1);
|
136
|
+
}
|
137
|
+
if (event.key === "Enter" && this.props.onEnter) {
|
138
|
+
this.props.onEnter(this._store);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
render() {
|
142
|
+
let valueAsNumber;
|
143
|
+
if (this.props.isInteger) {
|
144
|
+
valueAsNumber = parseInt(this.state.value);
|
145
|
+
}
|
146
|
+
else {
|
147
|
+
valueAsNumber = parseFloat(this.state.value);
|
148
|
+
}
|
149
|
+
let className = this.props.smallUI ? "short" : "value";
|
150
|
+
if (this.state.dragging) {
|
151
|
+
className += " dragging";
|
152
|
+
}
|
153
|
+
if (this.props.arrows) {
|
154
|
+
className += " hasArrows";
|
155
|
+
}
|
156
|
+
const value = this.state.value === conflictingValuesPlaceholder ? "" : this.state.value;
|
157
|
+
const placeholder = this.state.value === conflictingValuesPlaceholder ? conflictingValuesPlaceholder : "";
|
158
|
+
return (_jsxs(_Fragment, { children: [!this.props.useEuler && (_jsxs("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && (_jsx("div", { className: "label", title: this.props.label, children: this.props.label })), _jsxs("div", { className: className, children: [_jsx("input", { type: "number", step: this.props.step || this.props.isInteger ? "1" : "0.01", className: "numeric-input", onKeyDown: (evt) => this.onKeyDown(evt), value: value, onBlur: () => {
|
159
|
+
this.unlock();
|
160
|
+
if (this.props.onEnter) {
|
161
|
+
this.props.onEnter(this._store);
|
162
|
+
}
|
163
|
+
}, placeholder: placeholder, onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value) }), this.props.arrows && (_jsx(InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (newDragging) => {
|
164
|
+
const currentDragging = this.state.dragging;
|
165
|
+
// drag stopped
|
166
|
+
if (!currentDragging && newDragging && this.props.onDragStart) {
|
167
|
+
this.props.onDragStart(valueAsNumber);
|
168
|
+
}
|
169
|
+
else if (currentDragging && !newDragging && this.props.onDragStop) {
|
170
|
+
this.props.onDragStop(valueAsNumber);
|
171
|
+
}
|
172
|
+
this.setState({ dragging: newDragging });
|
173
|
+
} }))] }), this.props.unit] })), this.props.useEuler && (_jsx(SliderLineComponent, { lockObject: this.props.lockObject, label: this.props.label, minimum: 0, maximum: 360, step: 0.1, directValue: Tools.ToDegrees(valueAsNumber), onChange: (value) => this.updateValue(Tools.ToRadians(value).toString()) }))] }));
|
174
|
+
}
|
175
|
+
}
|
176
|
+
//# sourceMappingURL=floatLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"floatLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/floatLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gB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AAQ,CAAC;wCAC5C,eAAe;wCACf,IAAI,CAAC,eAAe,IAAI,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;4CAC3D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;yCACzC;6CAAM,IAAI,eAAe,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;4CACjE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;yCACxC;wCACD,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;oCAC7C,CAAC,GACH,CACL,IACC,EACL,IAAI,CAAC,KAAK,CAAC,IAAI,IACd,CACT,EACA,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CACpB,KAAC,mBAAmB,IAChB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,EAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,GAC1E,CACL,IACF,CACN,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\n\r\nimport type { Observable } from \"core/Misc/observable\";\r\nimport type { PropertyChangedEvent } from \"../propertyChangedEvent\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\nimport { SliderLineComponent } from \"./sliderLineComponent\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { conflictingValuesPlaceholder } from \"./targetsProxy\";\r\nimport { InputArrowsComponent } from \"./inputArrowsComponent\";\r\n\r\ninterface IFloatLineComponentProps {\r\n label: string;\r\n target: any;\r\n propertyName: string;\r\n lockObject: LockObject;\r\n onChange?: (newValue: number) => void;\r\n isInteger?: boolean;\r\n onPropertyChangedObservable?: Observable<PropertyChangedEvent>;\r\n additionalClass?: string;\r\n step?: string;\r\n digits?: number;\r\n useEuler?: boolean;\r\n min?: number;\r\n max?: number;\r\n smallUI?: boolean;\r\n onEnter?: (newValue: number) => void;\r\n icon?: string;\r\n iconLabel?: string;\r\n defaultValue?: number;\r\n arrows?: boolean;\r\n unit?: React.ReactNode;\r\n onDragStart?: (newValue: number) => void;\r\n onDragStop?: (newValue: number) => void;\r\n}\r\n\r\nexport class FloatLineComponent extends React.Component<IFloatLineComponentProps, { value: string; dragging: boolean }> {\r\n private _localChange = false;\r\n private _store: number;\r\n\r\n constructor(props: IFloatLineComponentProps) {\r\n super(props);\r\n\r\n const currentValue = this.props.target[this.props.propertyName];\r\n this.state = { value: this.getValueString(currentValue), dragging: false };\r\n this._store = currentValue;\r\n }\r\n\r\n componentWillUnmount() {\r\n this.unlock();\r\n }\r\n\r\n getValueString(value: any): string {\r\n if (value) {\r\n if (value === conflictingValuesPlaceholder) {\r\n return conflictingValuesPlaceholder;\r\n } else if (this.props.isInteger) {\r\n return value.toFixed(0);\r\n } else {\r\n return value.toFixed(this.props.digits || 4);\r\n }\r\n }\r\n return \"0\";\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: { value: string; dragging: boolean }) {\r\n if (this._localChange) {\r\n this._localChange = false;\r\n return true;\r\n }\r\n\r\n const newValue = nextProps.target[nextProps.propertyName];\r\n const newValueString = this.getValueString(newValue);\r\n\r\n if (newValueString !== nextState.value) {\r\n nextState.value = newValueString;\r\n return true;\r\n }\r\n\r\n if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n raiseOnPropertyChanged(newValue: number, previousValue: number) {\r\n if (this.props.onChange) {\r\n this.props.onChange(newValue);\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: newValue,\r\n initialValue: previousValue,\r\n });\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 let valueAsNumber: number;\r\n\r\n if (this.props.isInteger) {\r\n valueAsNumber = parseInt(valueString);\r\n } else {\r\n valueAsNumber = parseFloat(valueString);\r\n }\r\n\r\n if (!isNaN(valueAsNumber)) {\r\n if (this.props.min !== undefined) {\r\n if (valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n valueString = valueAsNumber.toString();\r\n }\r\n }\r\n if (this.props.max !== undefined) {\r\n if (valueAsNumber > this.props.max) {\r\n valueAsNumber = this.props.max;\r\n valueString = valueAsNumber.toString();\r\n }\r\n }\r\n } else if (this.props.defaultValue != null) {\r\n valueAsNumber = this.props.defaultValue;\r\n }\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.target[this.props.propertyName] = valueAsNumber;\r\n this.raiseOnPropertyChanged(valueAsNumber, this._store);\r\n\r\n this._store = valueAsNumber;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n incrementValue(amount: number, processStep: boolean = true) {\r\n if (processStep && this.props.step) {\r\n amount *= parseFloat(this.props.step);\r\n }\r\n\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(2));\r\n }\r\n\r\n onKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\r\n const step = parseFloat(this.props.step || this.props.isInteger ? \"1\" : \"0.01\");\r\n const handleArrowKey = (sign: number) => {\r\n if (event.shiftKey) {\r\n sign *= 10;\r\n if (event.ctrlKey || event.metaKey) {\r\n sign *= 10;\r\n }\r\n }\r\n\r\n this.incrementValue(sign * step, false);\r\n event.preventDefault();\r\n };\r\n\r\n if (event.key === \"ArrowUp\") {\r\n handleArrowKey(1);\r\n } else if (event.key === \"ArrowDown\") {\r\n handleArrowKey(-1);\r\n }\r\n if (event.key === \"Enter\" && this.props.onEnter) {\r\n this.props.onEnter(this._store);\r\n }\r\n }\r\n\r\n render() {\r\n let valueAsNumber: number;\r\n\r\n if (this.props.isInteger) {\r\n valueAsNumber = parseInt(this.state.value);\r\n } else {\r\n valueAsNumber = parseFloat(this.state.value);\r\n }\r\n\r\n let className = this.props.smallUI ? \"short\" : \"value\";\r\n if (this.state.dragging) {\r\n className += \" dragging\";\r\n }\r\n if (this.props.arrows) {\r\n className += \" hasArrows\";\r\n }\r\n\r\n const value = this.state.value === conflictingValuesPlaceholder ? \"\" : this.state.value;\r\n const placeholder = this.state.value === conflictingValuesPlaceholder ? conflictingValuesPlaceholder : \"\";\r\n return (\r\n <>\r\n {!this.props.useEuler && (\r\n <div className={this.props.additionalClass ? this.props.additionalClass + \" floatLine\" : \"floatLine\"}>\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n {(!this.props.icon || this.props.label != \"\") && (\r\n <div className=\"label\" title={this.props.label}>\r\n {this.props.label}\r\n </div>\r\n )}\r\n <div className={className}>\r\n <input\r\n type={\"number\"}\r\n step={this.props.step || this.props.isInteger ? \"1\" : \"0.01\"}\r\n className=\"numeric-input\"\r\n onKeyDown={(evt) => this.onKeyDown(evt)}\r\n value={value}\r\n onBlur={() => {\r\n this.unlock();\r\n if (this.props.onEnter) {\r\n this.props.onEnter(this._store);\r\n }\r\n }}\r\n placeholder={placeholder}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n />\r\n {this.props.arrows && (\r\n <InputArrowsComponent\r\n incrementValue={(amount) => this.incrementValue(amount)}\r\n setDragging={(newDragging) => {\r\n const currentDragging = this.state.dragging;\r\n // drag stopped\r\n if (!currentDragging && newDragging && this.props.onDragStart) {\r\n this.props.onDragStart(valueAsNumber);\r\n } else if (currentDragging && !newDragging && this.props.onDragStop) {\r\n this.props.onDragStop(valueAsNumber);\r\n }\r\n this.setState({ dragging: newDragging });\r\n }}\r\n />\r\n )}\r\n </div>\r\n {this.props.unit}\r\n </div>\r\n )}\r\n {this.props.useEuler && (\r\n <SliderLineComponent\r\n lockObject={this.props.lockObject}\r\n label={this.props.label}\r\n minimum={0}\r\n maximum={360}\r\n step={0.1}\r\n directValue={Tools.ToDegrees(valueAsNumber)}\r\n onChange={(value) => this.updateValue(Tools.ToRadians(value).toString())}\r\n />\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
3
|
+
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
4
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
5
|
+
interface IHexLineComponentProps {
|
6
|
+
label: string;
|
7
|
+
target: any;
|
8
|
+
propertyName: string;
|
9
|
+
lockObject?: LockObject;
|
10
|
+
onChange?: (newValue: number) => void;
|
11
|
+
isInteger?: boolean;
|
12
|
+
replaySourceReplacement?: string;
|
13
|
+
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
14
|
+
additionalClass?: string;
|
15
|
+
step?: string;
|
16
|
+
digits?: number;
|
17
|
+
useEuler?: boolean;
|
18
|
+
min?: number;
|
19
|
+
icon?: string;
|
20
|
+
iconLabel?: string;
|
21
|
+
}
|
22
|
+
export declare class HexLineComponent extends React.Component<IHexLineComponentProps, {
|
23
|
+
value: string;
|
24
|
+
}> {
|
25
|
+
private _localChange;
|
26
|
+
private _store;
|
27
|
+
private _propertyChange;
|
28
|
+
constructor(props: IHexLineComponentProps);
|
29
|
+
componentWillUnmount(): void;
|
30
|
+
shouldComponentUpdate(nextProps: IHexLineComponentProps, nextState: {
|
31
|
+
value: string;
|
32
|
+
}): boolean;
|
33
|
+
raiseOnPropertyChanged(newValue: number, previousValue: number): void;
|
34
|
+
convertToHexString(valueString: string): string;
|
35
|
+
updateValue(valueString: string, raisePropertyChanged: boolean): void;
|
36
|
+
lock(): void;
|
37
|
+
unlock(): void;
|
38
|
+
render(): JSX.Element;
|
39
|
+
}
|
40
|
+
export {};
|
@@ -0,0 +1,122 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class HexLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
this._localChange = false;
|
7
|
+
this._propertyChange = true;
|
8
|
+
const currentValue = this.props.target[this.props.propertyName];
|
9
|
+
this.state = { value: currentValue ? (this.props.isInteger ? currentValue.toFixed(0) : currentValue.toFixed(this.props.digits || 3)) : "0" };
|
10
|
+
this._store = currentValue;
|
11
|
+
}
|
12
|
+
componentWillUnmount() {
|
13
|
+
this.unlock();
|
14
|
+
}
|
15
|
+
shouldComponentUpdate(nextProps, nextState) {
|
16
|
+
if (this._localChange) {
|
17
|
+
this._localChange = false;
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
const newValue = nextProps.target[nextProps.propertyName];
|
21
|
+
const newValueString = newValue ? (this.props.isInteger ? newValue.toFixed(0) : newValue.toFixed(this.props.digits || 3)) : "0";
|
22
|
+
if (newValueString !== nextState.value) {
|
23
|
+
nextState.value = newValueString;
|
24
|
+
return true;
|
25
|
+
}
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
raiseOnPropertyChanged(newValue, previousValue) {
|
29
|
+
var _a;
|
30
|
+
if (this.props.onChange) {
|
31
|
+
this.props.onChange(newValue);
|
32
|
+
}
|
33
|
+
if (!this.props.onPropertyChangedObservable) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
this.props.onPropertyChangedObservable.notifyObservers({
|
37
|
+
object: (_a = this.props.replaySourceReplacement) !== null && _a !== void 0 ? _a : this.props.target,
|
38
|
+
property: this.props.propertyName,
|
39
|
+
value: newValue,
|
40
|
+
initialValue: previousValue,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
convertToHexString(valueString) {
|
44
|
+
while (valueString.length < 10) {
|
45
|
+
valueString += "0";
|
46
|
+
}
|
47
|
+
return valueString;
|
48
|
+
}
|
49
|
+
updateValue(valueString, raisePropertyChanged) {
|
50
|
+
if (valueString.substr(0, 2) != "0x") {
|
51
|
+
if (valueString.substr(0, 1) != "0") {
|
52
|
+
valueString = "0x" + valueString;
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
valueString = "0x" + valueString.substr(1);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
const valueSubstr = valueString.substr(2);
|
59
|
+
if (valueSubstr != "" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
if (valueString.length > 10) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
const valueStringAsHex = this.convertToHexString(valueString);
|
66
|
+
let valueAsNumber;
|
67
|
+
valueAsNumber = parseInt(valueStringAsHex);
|
68
|
+
if (!isNaN(valueAsNumber) && this.props.min !== undefined) {
|
69
|
+
if (valueAsNumber < this.props.min) {
|
70
|
+
valueAsNumber = this.props.min;
|
71
|
+
valueString = valueAsNumber.toString();
|
72
|
+
}
|
73
|
+
}
|
74
|
+
this._localChange = true;
|
75
|
+
if (isNaN(valueAsNumber)) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
this.setState({ value: valueString });
|
79
|
+
if (raisePropertyChanged) {
|
80
|
+
this._propertyChange = true;
|
81
|
+
this.props.target[this.props.propertyName] = valueAsNumber;
|
82
|
+
this.raiseOnPropertyChanged(valueAsNumber, this._store);
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
this._propertyChange = false;
|
86
|
+
}
|
87
|
+
this._store = valueAsNumber;
|
88
|
+
}
|
89
|
+
lock() {
|
90
|
+
if (this.props.lockObject) {
|
91
|
+
this.props.lockObject.lock = true;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
unlock() {
|
95
|
+
if (this.props.lockObject) {
|
96
|
+
this.props.lockObject.lock = false;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
render() {
|
100
|
+
let valueAsHex;
|
101
|
+
if (this._propertyChange) {
|
102
|
+
const valueAsNumber = parseInt(this.state.value);
|
103
|
+
valueAsHex = valueAsNumber.toString(16);
|
104
|
+
let hex0String = "";
|
105
|
+
for (let i = 0; i < 8 - valueAsHex.length; i++) {
|
106
|
+
//padding the '0's
|
107
|
+
hex0String += "0";
|
108
|
+
}
|
109
|
+
valueAsHex = "0x" + hex0String + valueAsHex.toUpperCase();
|
110
|
+
}
|
111
|
+
else {
|
112
|
+
valueAsHex = this.state.value;
|
113
|
+
}
|
114
|
+
return (_jsx("div", { children: !this.props.useEuler && (_jsxs("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), _jsx("div", { className: "label", title: this.props.label, children: this.props.label }), _jsx("div", { className: "value", children: _jsx("input", { type: "string", className: "hex-input", value: valueAsHex, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value, false), onKeyDown: (evt) => {
|
115
|
+
if (evt.keyCode !== 13) {
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
this.updateValue(this.state.value, true);
|
119
|
+
} }) })] })) }));
|
120
|
+
}
|
121
|
+
}
|
122
|
+
//# sourceMappingURL=hexLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hexLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiCom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KAAK,CAAC,KAAK,YACzC,IAAI,CAAC,KAAK,CAAC,KAAK,GACf,EACN,cAAK,SAAS,EAAC,OAAO,YAClB,gBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,WAAW,EACrB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC5D,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;gCACf,IAAI,GAAG,CAAC,OAAO,KAAK,EAAE,EAAE;oCACpB,OAAO;iCACV;gCACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;4BAC7C,CAAC,GACH,GACA,IACJ,CACT,GACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { Observable } from \"core/Misc/observable\";\r\nimport type { PropertyChangedEvent } from \"../propertyChangedEvent\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\ninterface IHexLineComponentProps {\r\n label: string;\r\n target: any;\r\n propertyName: string;\r\n lockObject?: LockObject;\r\n onChange?: (newValue: number) => void;\r\n isInteger?: boolean;\r\n replaySourceReplacement?: string;\r\n onPropertyChangedObservable?: Observable<PropertyChangedEvent>;\r\n additionalClass?: string;\r\n step?: string;\r\n digits?: number;\r\n useEuler?: boolean;\r\n min?: number;\r\n icon?: string;\r\n iconLabel?: string;\r\n}\r\n\r\nexport class HexLineComponent extends React.Component<IHexLineComponentProps, { value: string }> {\r\n private _localChange = false;\r\n private _store: number;\r\n private _propertyChange = true;\r\n\r\n constructor(props: IHexLineComponentProps) {\r\n super(props);\r\n\r\n const currentValue = this.props.target[this.props.propertyName];\r\n this.state = { value: currentValue ? (this.props.isInteger ? currentValue.toFixed(0) : currentValue.toFixed(this.props.digits || 3)) : \"0\" };\r\n this._store = currentValue;\r\n }\r\n\r\n componentWillUnmount() {\r\n this.unlock();\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IHexLineComponentProps, nextState: { value: string }) {\r\n if (this._localChange) {\r\n this._localChange = false;\r\n return true;\r\n }\r\n\r\n const newValue = nextProps.target[nextProps.propertyName];\r\n const newValueString = newValue ? (this.props.isInteger ? newValue.toFixed(0) : newValue.toFixed(this.props.digits || 3)) : \"0\";\r\n\r\n if (newValueString !== nextState.value) {\r\n nextState.value = newValueString;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n raiseOnPropertyChanged(newValue: number, previousValue: number) {\r\n if (this.props.onChange) {\r\n this.props.onChange(newValue);\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.replaySourceReplacement ?? this.props.target,\r\n property: this.props.propertyName,\r\n value: newValue,\r\n initialValue: previousValue,\r\n });\r\n }\r\n\r\n convertToHexString(valueString: string): string {\r\n while (valueString.length < 10) {\r\n valueString += \"0\";\r\n }\r\n return valueString;\r\n }\r\n\r\n updateValue(valueString: string, raisePropertyChanged: boolean) {\r\n if (valueString.substr(0, 2) != \"0x\") {\r\n if (valueString.substr(0, 1) != \"0\") {\r\n valueString = \"0x\" + valueString;\r\n } else {\r\n valueString = \"0x\" + valueString.substr(1);\r\n }\r\n }\r\n\r\n const valueSubstr = valueString.substr(2);\r\n if (valueSubstr != \"\" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {\r\n return;\r\n }\r\n\r\n if (valueString.length > 10) {\r\n return;\r\n }\r\n\r\n const valueStringAsHex = this.convertToHexString(valueString);\r\n let valueAsNumber: number;\r\n\r\n valueAsNumber = parseInt(valueStringAsHex);\r\n\r\n if (!isNaN(valueAsNumber) && this.props.min !== undefined) {\r\n if (valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n valueString = valueAsNumber.toString();\r\n }\r\n }\r\n\r\n this._localChange = true;\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n\r\n this.setState({ value: valueString });\r\n if (raisePropertyChanged) {\r\n this._propertyChange = true;\r\n this.props.target[this.props.propertyName] = valueAsNumber;\r\n this.raiseOnPropertyChanged(valueAsNumber, this._store);\r\n } else {\r\n this._propertyChange = false;\r\n }\r\n\r\n this._store = valueAsNumber;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n render() {\r\n let valueAsHex: string;\r\n if (this._propertyChange) {\r\n const valueAsNumber = parseInt(this.state.value);\r\n valueAsHex = valueAsNumber.toString(16);\r\n let hex0String = \"\";\r\n for (let i = 0; i < 8 - valueAsHex.length; i++) {\r\n //padding the '0's\r\n hex0String += \"0\";\r\n }\r\n valueAsHex = \"0x\" + hex0String + valueAsHex.toUpperCase();\r\n } else {\r\n valueAsHex = this.state.value;\r\n }\r\n\r\n return (\r\n <div>\r\n {!this.props.useEuler && (\r\n <div className={this.props.additionalClass ? this.props.additionalClass + \" floatLine\" : \"floatLine\"}>\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <div className=\"label\" title={this.props.label}>\r\n {this.props.label}\r\n </div>\r\n <div className=\"value\">\r\n <input\r\n type=\"string\"\r\n className=\"hex-input\"\r\n value={valueAsHex}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value, false)}\r\n onKeyDown={(evt) => {\r\n if (evt.keyCode !== 13) {\r\n return;\r\n }\r\n this.updateValue(this.state.value, true);\r\n }}\r\n />\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iSelectedLineContainer.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/iSelectedLineContainer.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISelectedLineContainer {\r\n selectedLineContainerTitles: Array<string>;\r\n selectedLineContainerTitlesNoFocus: Array<string>;\r\n}\r\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
export interface IIconButtonLineComponentProps {
|
3
|
+
icon: string;
|
4
|
+
onClick: () => void;
|
5
|
+
tooltip: string;
|
6
|
+
active?: boolean;
|
7
|
+
}
|
8
|
+
export declare class IconButtonLineComponent extends React.Component<IIconButtonLineComponentProps> {
|
9
|
+
constructor(props: IIconButtonLineComponentProps);
|
10
|
+
render(): JSX.Element;
|
11
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class IconButtonLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
}
|
7
|
+
render() {
|
8
|
+
return (_jsx("div", { style: { backgroundColor: this.props.active ? "#111111" : "" }, title: this.props.tooltip, className: `icon ${this.props.icon}`, onClick: () => this.props.onClick() }));
|
9
|
+
}
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=iconButtonLineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iconButtonLineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/iconButtonLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,OAAO,uBAAwB,SAAQ,KAAK,CAAC,SAAwC;IACvF,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,MAAM;QACF,OAAO,CACH,cACI,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAC9D,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EACzB,SAAS,EAAE,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EACpC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GACrC,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\n\r\nexport interface IIconButtonLineComponentProps {\r\n icon: string;\r\n onClick: () => void;\r\n tooltip: string;\r\n active?: boolean;\r\n}\r\n\r\nexport class IconButtonLineComponent extends React.Component<IIconButtonLineComponentProps> {\r\n constructor(props: IIconButtonLineComponentProps) {\r\n super(props);\r\n }\r\n\r\n render() {\r\n return (\r\n <div\r\n style={{ backgroundColor: this.props.active ? \"#111111\" : \"\" }}\r\n title={this.props.tooltip}\r\n className={`icon ${this.props.icon}`}\r\n onClick={() => this.props.onClick()}\r\n />\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class IconComponent extends React.Component {
|
4
|
+
render() {
|
5
|
+
return _jsx("img", { src: this.props.icon, title: this.props.label, alt: this.props.label, color: "black", className: "icon", onDragStart: (evt) => evt.preventDefault() });
|
6
|
+
}
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=iconComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iconComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/iconComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAA8B;IACnE,MAAM;QACF,OAAO,cAAK,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,EAAE,GAAI,CAAC;IACpK,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\n\r\ninterface IIconComponentProps {\r\n icon: string;\r\n label?: string;\r\n}\r\n\r\nexport class IconComponent extends React.Component<IIconComponentProps> {\r\n render() {\r\n return <img src={this.props.icon} title={this.props.label} alt={this.props.label} color=\"black\" className=\"icon\" onDragStart={(evt) => evt.preventDefault()} />;\r\n }\r\n}\r\n"]}
|