@babylonjs/shared-ui-components 5.28.0 → 5.30.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 -18
- package/colorPicker/colorComponentEntry.js +36 -36
- package/colorPicker/colorPicker.d.ts +43 -43
- package/colorPicker/colorPicker.js +136 -136
- package/colorPicker/hexColor.d.ts +20 -20
- package/colorPicker/hexColor.js +42 -42
- package/components/Button.d.ts +10 -10
- package/components/Button.js +6 -6
- package/components/Icon.d.ts +6 -6
- package/components/Icon.js +6 -6
- package/components/Label.d.ts +7 -7
- package/components/Label.js +6 -6
- package/components/MessageDialog.d.ts +7 -7
- package/components/MessageDialog.js +22 -22
- package/components/Toggle.d.ts +8 -8
- package/components/Toggle.js +15 -15
- package/components/bars/CommandBarComponent.d.ts +16 -16
- package/components/bars/CommandBarComponent.js +68 -68
- package/components/bars/CommandBarComponent.js.map +1 -1
- package/components/bars/CommandButtonComponent.d.ts +11 -11
- package/components/bars/CommandButtonComponent.js +6 -6
- package/components/bars/CommandDropdownComponent.d.ts +26 -26
- package/components/bars/CommandDropdownComponent.js +48 -48
- package/components/classNames.d.ts +2 -2
- package/components/classNames.js +18 -18
- package/components/colorPicker/ColorComponentEntry.d.ts +18 -18
- package/components/colorPicker/ColorComponentEntry.js +37 -37
- package/components/colorPicker/ColorPicker.d.ts +43 -43
- package/components/colorPicker/ColorPicker.js +137 -137
- package/components/colorPicker/HexColor.d.ts +20 -20
- package/components/colorPicker/HexColor.js +45 -45
- package/components/layout/DraggableIcon.d.ts +23 -0
- package/components/layout/DraggableIcon.js +18 -0
- package/components/layout/DraggableIcon.js.map +1 -0
- package/components/layout/FlexibleColumn.d.ts +17 -0
- package/components/layout/FlexibleColumn.js +12 -0
- package/components/layout/FlexibleColumn.js.map +1 -0
- package/components/layout/FlexibleDragHandler.d.ts +18 -0
- package/components/layout/FlexibleDragHandler.js +88 -0
- package/components/layout/FlexibleDragHandler.js.map +1 -0
- package/components/layout/FlexibleDropZone.d.ts +19 -0
- package/components/layout/FlexibleDropZone.js +12 -0
- package/components/layout/FlexibleDropZone.js.map +1 -0
- package/components/layout/FlexibleGridContainer.d.ts +10 -0
- package/components/layout/FlexibleGridContainer.js +23 -0
- package/components/layout/FlexibleGridContainer.js.map +1 -0
- package/components/layout/FlexibleGridLayout.d.ts +16 -0
- package/components/layout/FlexibleGridLayout.js +24 -0
- package/components/layout/FlexibleGridLayout.js.map +1 -0
- package/components/layout/FlexibleResizeBar.d.ts +40 -0
- package/components/layout/FlexibleResizeBar.js +21 -0
- package/components/layout/FlexibleResizeBar.js.map +1 -0
- package/components/layout/FlexibleTab.d.ts +34 -0
- package/components/layout/FlexibleTab.js +36 -0
- package/components/layout/FlexibleTab.js.map +1 -0
- package/components/layout/FlexibleTabsContainer.d.ts +28 -0
- package/components/layout/FlexibleTabsContainer.js +54 -0
- package/components/layout/FlexibleTabsContainer.js.map +1 -0
- package/components/layout/LayoutContext.d.ts +12 -0
- package/components/layout/LayoutContext.js +3 -0
- package/components/layout/LayoutContext.js.map +1 -0
- package/components/layout/types.d.ts +82 -0
- package/components/layout/types.js +13 -0
- package/components/layout/types.js.map +1 -0
- package/components/layout/utils.d.ts +25 -0
- package/components/layout/utils.js +68 -0
- package/components/layout/utils.js.map +1 -0
- package/components/lines/ColorLineComponent.d.ts +40 -40
- package/components/lines/ColorLineComponent.js +145 -145
- package/components/lines/ColorPickerLineComponent.d.ts +33 -33
- package/components/lines/ColorPickerLineComponent.js +61 -61
- package/components/lines/FileButtonLineComponent.d.ts +16 -16
- package/components/lines/FileButtonLineComponent.js +21 -21
- package/components/lines/NumericInputComponent.d.ts +31 -31
- package/components/lines/NumericInputComponent.js +86 -86
- package/lines/booleanLineComponent.d.ts +11 -11
- package/lines/booleanLineComponent.js +14 -14
- package/lines/buttonLineComponent.d.ts +12 -12
- package/lines/buttonLineComponent.js +10 -10
- package/lines/checkBoxLineComponent.d.ts +36 -36
- package/lines/checkBoxLineComponent.js +88 -88
- package/lines/color3LineComponent.d.ts +18 -18
- package/lines/color3LineComponent.js +9 -9
- package/lines/color4LineComponent.d.ts +18 -18
- package/lines/color4LineComponent.js +9 -9
- package/lines/colorLineComponent.d.ts +40 -40
- package/lines/colorLineComponent.js +144 -144
- package/lines/colorPickerComponent.d.ts +31 -31
- package/lines/colorPickerComponent.js +60 -60
- package/lines/draggableLineComponent.d.ts +9 -9
- package/lines/draggableLineComponent.js +12 -12
- package/lines/fileButtonLineComponent.d.ts +17 -17
- package/lines/fileButtonLineComponent.js +20 -20
- package/lines/fileMultipleButtonLineComponent.d.ts +17 -17
- package/lines/fileMultipleButtonLineComponent.js +20 -20
- package/lines/floatLineComponent.d.ts +50 -50
- package/lines/floatLineComponent.js +175 -175
- package/lines/hexLineComponent.d.ts +40 -40
- package/lines/hexLineComponent.js +121 -121
- package/lines/iSelectedLineContainer.d.ts +4 -4
- package/lines/iSelectedLineContainer.js +1 -1
- package/lines/iconButtonLineComponent.d.ts +11 -11
- package/lines/iconButtonLineComponent.js +10 -10
- package/lines/iconComponent.d.ts +9 -9
- package/lines/iconComponent.js +7 -7
- package/lines/indentedTextLineComponent.d.ts +16 -16
- package/lines/indentedTextLineComponent.js +26 -26
- package/lines/inputArrowsComponent.d.ts +13 -13
- package/lines/inputArrowsComponent.js +37 -37
- package/lines/lineContainerComponent.d.ts +19 -19
- package/lines/lineContainerComponent.js +49 -49
- package/lines/linkButtonComponent.d.ts +16 -16
- package/lines/linkButtonComponent.js +20 -20
- package/lines/matrixLineComponent.d.ts +36 -36
- package/lines/matrixLineComponent.js +102 -102
- package/lines/messageLineComponent.d.ts +12 -12
- package/lines/messageLineComponent.js +14 -14
- package/lines/numericInputComponent.d.ts +31 -31
- package/lines/numericInputComponent.js +85 -85
- package/lines/optionsLineComponent.d.ts +48 -48
- package/lines/optionsLineComponent.js +118 -118
- package/lines/popup.d.ts +4 -4
- package/lines/popup.js +67 -67
- package/lines/radioLineComponent.d.ts +21 -21
- package/lines/radioLineComponent.js +26 -26
- package/lines/sliderLineComponent.d.ts +37 -37
- package/lines/sliderLineComponent.js +89 -89
- package/lines/targetsProxy.d.ts +11 -11
- package/lines/targetsProxy.js +42 -42
- package/lines/textInputLineComponent.d.ts +47 -47
- package/lines/textInputLineComponent.js +154 -154
- package/lines/textLineComponent.d.ts +21 -21
- package/lines/textLineComponent.js +30 -30
- package/lines/unitButton.d.ts +8 -8
- package/lines/unitButton.js +7 -7
- package/lines/valueLineComponent.d.ts +15 -15
- package/lines/valueLineComponent.js +12 -12
- package/lines/vector2LineComponent.d.ts +36 -36
- package/lines/vector2LineComponent.js +63 -63
- package/lines/vector3LineComponent.d.ts +41 -41
- package/lines/vector3LineComponent.js +74 -74
- package/lines/vector4LineComponent.d.ts +42 -42
- package/lines/vector4LineComponent.js +81 -81
- package/nodeGraphSystem/displayLedger.d.ts +5 -5
- package/nodeGraphSystem/displayLedger.js +3 -3
- package/nodeGraphSystem/frameNodePort.d.ts +25 -25
- package/nodeGraphSystem/frameNodePort.js +59 -59
- package/nodeGraphSystem/graphCanvas.d.ts +117 -111
- package/nodeGraphSystem/graphCanvas.js +1137 -1131
- package/nodeGraphSystem/graphCanvas.js.map +1 -1
- package/nodeGraphSystem/graphFrame.d.ts +153 -153
- package/nodeGraphSystem/graphFrame.js +1328 -1328
- package/nodeGraphSystem/graphNode.d.ts +81 -79
- package/nodeGraphSystem/graphNode.js +465 -459
- package/nodeGraphSystem/graphNode.js.map +1 -1
- package/nodeGraphSystem/interfaces/displayManager.d.ts +13 -13
- package/nodeGraphSystem/interfaces/displayManager.js +1 -1
- package/nodeGraphSystem/interfaces/nodeContainer.d.ts +6 -6
- package/nodeGraphSystem/interfaces/nodeContainer.js +1 -1
- package/nodeGraphSystem/interfaces/nodeData.d.ts +15 -15
- package/nodeGraphSystem/interfaces/nodeData.js +1 -1
- package/nodeGraphSystem/interfaces/nodeLocationInfo.d.ts +26 -26
- package/nodeGraphSystem/interfaces/nodeLocationInfo.js +1 -1
- package/nodeGraphSystem/interfaces/portData.d.ts +28 -28
- package/nodeGraphSystem/interfaces/portData.js +7 -7
- package/nodeGraphSystem/interfaces/propertyComponentProps.d.ts +6 -6
- package/nodeGraphSystem/interfaces/propertyComponentProps.js +1 -1
- package/nodeGraphSystem/interfaces/selectionChangedOptions.d.ts +11 -11
- package/nodeGraphSystem/interfaces/selectionChangedOptions.js +1 -1
- package/nodeGraphSystem/nodeLink.d.ts +31 -31
- package/nodeGraphSystem/nodeLink.js +182 -182
- package/nodeGraphSystem/nodePort.d.ts +35 -35
- package/nodeGraphSystem/nodePort.js +128 -128
- package/nodeGraphSystem/propertyLedger.d.ts +8 -8
- package/nodeGraphSystem/propertyLedger.js +3 -3
- package/nodeGraphSystem/stateManager.d.ts +45 -45
- package/nodeGraphSystem/stateManager.js +18 -18
- package/nodeGraphSystem/tools.d.ts +5 -5
- package/nodeGraphSystem/tools.js +36 -36
- package/nodeGraphSystem/typeLedger.d.ts +8 -8
- package/nodeGraphSystem/typeLedger.js +2 -2
- package/nodeGraphSystem/types/framePortData.d.ts +7 -7
- package/nodeGraphSystem/types/framePortData.js +1 -1
- package/package.json +4 -3
- package/propertyChangedEvent.d.ts +7 -7
- package/propertyChangedEvent.js +2 -2
- package/stories/Button.stories.d.ts +10 -10
- package/stories/Button.stories.js +19 -19
- package/stories/Icon.stories.d.ts +9 -9
- package/stories/Icon.stories.js +16 -16
- package/stories/Label.stories.d.ts +8 -8
- package/stories/Label.stories.js +10 -10
- package/stories/MessageDialog.stories.d.ts +9 -9
- package/stories/MessageDialog.stories.js +19 -19
- package/stories/Toggle.stories.d.ts +9 -9
- package/stories/Toggle.stories.js +17 -17
- package/stories/bars/CommandBarComponent.stories.d.ts +11 -11
- package/stories/bars/CommandBarComponent.stories.js +12 -12
- package/stories/bars/CommandButtonComponent.stories.d.ts +6 -6
- package/stories/bars/CommandButtonComponent.stories.js +6 -6
- package/stories/colorPicker/ColorPicker.stories.d.ts +11 -11
- package/stories/colorPicker/ColorPicker.stories.js +4 -4
- package/stories/layout/FlexibleGridLayout.stories.d.ts +46 -0
- package/stories/layout/FlexibleGridLayout.stories.js +48 -0
- package/stories/layout/FlexibleGridLayout.stories.js.map +1 -0
- package/stories/lines/ColorLineComponent.stories.d.ts +21 -21
- package/stories/lines/ColorLineComponent.stories.js +9 -9
- package/stories/lines/ColorPickerLineComponent.stories.d.ts +14 -14
- package/stories/lines/ColorPickerLineComponent.stories.js +10 -10
- package/stories/lines/FileButtonLineComponent.stories.d.ts +6 -6
- package/stories/lines/FileButtonLineComponent.stories.js +5 -5
- package/stories/lines/NumericInputComponent.stories.d.ts +11 -11
- package/stories/lines/NumericInputComponent.stories.js +5 -5
- package/stringTools.d.ts +11 -11
- package/stringTools.js +88 -88
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js +15 -15
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js +14 -14
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.d.ts +17 -17
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js +55 -55
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.js +12 -12
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js +15 -15
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.d.ts +17 -17
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.js +38 -38
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js +16 -16
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.js +25 -25
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js +17 -17
- package/tabs/propertyGrids/gui/linePropertyGridComponent.d.ts +16 -16
- package/tabs/propertyGrids/gui/linePropertyGridComponent.js +27 -27
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js +17 -17
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js +15 -15
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js +15 -15
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js +16 -16
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js +14 -14
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.d.ts +15 -15
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js +34 -34
- package/tabs/propertyGrids/lockObject.d.ts +9 -9
- package/tabs/propertyGrids/lockObject.js +11 -11
@@ -1,155 +1,155 @@
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import * as React from "react";
|
3
|
-
import { conflictingValuesPlaceholder } from "./targetsProxy.js";
|
4
|
-
import { InputArrowsComponent } from "./inputArrowsComponent.js";
|
5
|
-
export class TextInputLineComponent extends React.Component {
|
6
|
-
constructor(props) {
|
7
|
-
super(props);
|
8
|
-
this._localChange = false;
|
9
|
-
const emptyValue = this.props.numeric ? "0" : "";
|
10
|
-
this.state = {
|
11
|
-
value: (this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || emptyValue,
|
12
|
-
dragging: false,
|
13
|
-
};
|
14
|
-
}
|
15
|
-
componentWillUnmount() {
|
16
|
-
if (this.props.lockObject) {
|
17
|
-
this.props.lockObject.lock = false;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
shouldComponentUpdate(nextProps, nextState) {
|
21
|
-
if (this._localChange) {
|
22
|
-
this._localChange = false;
|
23
|
-
return true;
|
24
|
-
}
|
25
|
-
const newValue = nextProps.value !== undefined ? nextProps.value : nextProps.target[nextProps.propertyName];
|
26
|
-
if (newValue !== nextState.value) {
|
27
|
-
nextState.value = newValue || "";
|
28
|
-
return true;
|
29
|
-
}
|
30
|
-
if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {
|
31
|
-
return true;
|
32
|
-
}
|
33
|
-
return false;
|
34
|
-
}
|
35
|
-
raiseOnPropertyChanged(newValue, previousValue) {
|
36
|
-
if (this.props.onChange) {
|
37
|
-
this.props.onChange(newValue);
|
38
|
-
return;
|
39
|
-
}
|
40
|
-
if (!this.props.onPropertyChangedObservable) {
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
this.props.onPropertyChangedObservable.notifyObservers({
|
44
|
-
object: this.props.target,
|
45
|
-
property: this.props.propertyName,
|
46
|
-
value: newValue,
|
47
|
-
initialValue: previousValue,
|
48
|
-
});
|
49
|
-
}
|
50
|
-
getCurrentNumericValue(value) {
|
51
|
-
const numeric = parseFloat(value);
|
52
|
-
if (!isNaN(numeric)) {
|
53
|
-
return numeric;
|
54
|
-
}
|
55
|
-
if (this.props.placeholder !== undefined) {
|
56
|
-
const placeholderNumeric = parseFloat(this.props.placeholder);
|
57
|
-
if (!isNaN(placeholderNumeric)) {
|
58
|
-
return placeholderNumeric;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
return 0;
|
62
|
-
}
|
63
|
-
updateValue(value, valueToValidate) {
|
64
|
-
if (this.props.numbersOnly) {
|
65
|
-
if (/[^0-9.\p\x%-]/g.test(value)) {
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
if (!value) {
|
69
|
-
value = "0";
|
70
|
-
}
|
71
|
-
//Removing starting zero if there is a number of a minus after it.
|
72
|
-
if (value.search(/0+[0-9-]/g) === 0) {
|
73
|
-
value = value.substr(1);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
if (this.props.numeric) {
|
77
|
-
let numericValue = this.getCurrentNumericValue(value);
|
78
|
-
if (this.props.roundValues) {
|
79
|
-
numericValue = Math.round(numericValue);
|
80
|
-
}
|
81
|
-
if (this.props.min !== undefined) {
|
82
|
-
numericValue = Math.max(this.props.min, numericValue);
|
83
|
-
}
|
84
|
-
if (this.props.max !== undefined) {
|
85
|
-
numericValue = Math.min(this.props.max, numericValue);
|
86
|
-
}
|
87
|
-
value = numericValue.toString();
|
88
|
-
}
|
89
|
-
this._localChange = true;
|
90
|
-
const store = this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName];
|
91
|
-
if (this.props.validator && valueToValidate) {
|
92
|
-
if (this.props.validator(valueToValidate) == false) {
|
93
|
-
value = store;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
this.setState({ value: value });
|
97
|
-
if (this.props.propertyName && !this.props.delayInput) {
|
98
|
-
this.props.target[this.props.propertyName] = value;
|
99
|
-
}
|
100
|
-
this.raiseOnPropertyChanged(value, store);
|
101
|
-
}
|
102
|
-
incrementValue(amount) {
|
103
|
-
if (this.props.step) {
|
104
|
-
amount *= this.props.step;
|
105
|
-
}
|
106
|
-
if (this.props.arrowsIncrement) {
|
107
|
-
this.props.arrowsIncrement(amount);
|
108
|
-
return;
|
109
|
-
}
|
110
|
-
const currentValue = this.getCurrentNumericValue(this.state.value);
|
111
|
-
this.updateValue((currentValue + amount).toFixed(2));
|
112
|
-
}
|
113
|
-
onKeyDown(event) {
|
114
|
-
if (this.props.arrows) {
|
115
|
-
if (event.key === "ArrowUp") {
|
116
|
-
this.incrementValue(1);
|
117
|
-
event.preventDefault();
|
118
|
-
}
|
119
|
-
if (event.key === "ArrowDown") {
|
120
|
-
this.incrementValue(-1);
|
121
|
-
event.preventDefault();
|
122
|
-
}
|
123
|
-
}
|
124
|
-
}
|
125
|
-
render() {
|
126
|
-
const value = this.state.value === conflictingValuesPlaceholder ? "" : this.state.value;
|
127
|
-
const placeholder = this.state.value === conflictingValuesPlaceholder ? conflictingValuesPlaceholder : this.props.placeholder || "";
|
128
|
-
const step = this.props.step || (this.props.roundValues ? 1 : 0.01);
|
129
|
-
return (_jsxs("div", { className: this.props.multilines ? "textInputArea" : this.props.unit !== undefined ? "textInputLine withUnits" : "textInputLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), this.props.label !== undefined && (_jsx("div", { className: "label", title: this.props.label, children: this.props.label })), this.props.multilines && (_jsx(_Fragment, { children: _jsx("textarea", { value: this.state.value, onFocus: () => {
|
130
|
-
if (this.props.lockObject) {
|
131
|
-
this.props.lockObject.lock = true;
|
132
|
-
}
|
133
|
-
}, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => {
|
134
|
-
if (evt.keyCode !== 13) {
|
135
|
-
return;
|
136
|
-
}
|
137
|
-
this.updateValue(this.state.value);
|
138
|
-
}, onBlur: (evt) => {
|
139
|
-
this.updateValue(evt.target.value, evt.target.value);
|
140
|
-
if (this.props.lockObject) {
|
141
|
-
this.props.lockObject.lock = false;
|
142
|
-
}
|
143
|
-
} }) })), !this.props.multilines && (_jsxs("div", { className: `value${this.props.noUnderline === true ? " noUnderline" : ""}${this.props.arrows ? " hasArrows" : ""}${this.state.dragging ? " dragging" : ""}`, children: [_jsx("input", { value: value, onBlur: (evt) => {
|
144
|
-
if (this.props.lockObject) {
|
145
|
-
this.props.lockObject.lock = false;
|
146
|
-
}
|
147
|
-
this.updateValue((this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || "", evt.target.value);
|
148
|
-
}, onFocus: () => {
|
149
|
-
if (this.props.lockObject) {
|
150
|
-
this.props.lockObject.lock = true;
|
151
|
-
}
|
152
|
-
}, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), placeholder: placeholder, type: this.props.numeric ? "number" : "text", step: step }), this.props.arrows && (_jsx(InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (dragging) => this.setState({ dragging }) }))] })), this.props.unit] }));
|
153
|
-
}
|
154
|
-
}
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { conflictingValuesPlaceholder } from "./targetsProxy.js";
|
4
|
+
import { InputArrowsComponent } from "./inputArrowsComponent.js";
|
5
|
+
export class TextInputLineComponent extends React.Component {
|
6
|
+
constructor(props) {
|
7
|
+
super(props);
|
8
|
+
this._localChange = false;
|
9
|
+
const emptyValue = this.props.numeric ? "0" : "";
|
10
|
+
this.state = {
|
11
|
+
value: (this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || emptyValue,
|
12
|
+
dragging: false,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
componentWillUnmount() {
|
16
|
+
if (this.props.lockObject) {
|
17
|
+
this.props.lockObject.lock = false;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
shouldComponentUpdate(nextProps, nextState) {
|
21
|
+
if (this._localChange) {
|
22
|
+
this._localChange = false;
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
const newValue = nextProps.value !== undefined ? nextProps.value : nextProps.target[nextProps.propertyName];
|
26
|
+
if (newValue !== nextState.value) {
|
27
|
+
nextState.value = newValue || "";
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {
|
31
|
+
return true;
|
32
|
+
}
|
33
|
+
return false;
|
34
|
+
}
|
35
|
+
raiseOnPropertyChanged(newValue, previousValue) {
|
36
|
+
if (this.props.onChange) {
|
37
|
+
this.props.onChange(newValue);
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
if (!this.props.onPropertyChangedObservable) {
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
this.props.onPropertyChangedObservable.notifyObservers({
|
44
|
+
object: this.props.target,
|
45
|
+
property: this.props.propertyName,
|
46
|
+
value: newValue,
|
47
|
+
initialValue: previousValue,
|
48
|
+
});
|
49
|
+
}
|
50
|
+
getCurrentNumericValue(value) {
|
51
|
+
const numeric = parseFloat(value);
|
52
|
+
if (!isNaN(numeric)) {
|
53
|
+
return numeric;
|
54
|
+
}
|
55
|
+
if (this.props.placeholder !== undefined) {
|
56
|
+
const placeholderNumeric = parseFloat(this.props.placeholder);
|
57
|
+
if (!isNaN(placeholderNumeric)) {
|
58
|
+
return placeholderNumeric;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
return 0;
|
62
|
+
}
|
63
|
+
updateValue(value, valueToValidate) {
|
64
|
+
if (this.props.numbersOnly) {
|
65
|
+
if (/[^0-9.\p\x%-]/g.test(value)) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
if (!value) {
|
69
|
+
value = "0";
|
70
|
+
}
|
71
|
+
//Removing starting zero if there is a number of a minus after it.
|
72
|
+
if (value.search(/0+[0-9-]/g) === 0) {
|
73
|
+
value = value.substr(1);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
if (this.props.numeric) {
|
77
|
+
let numericValue = this.getCurrentNumericValue(value);
|
78
|
+
if (this.props.roundValues) {
|
79
|
+
numericValue = Math.round(numericValue);
|
80
|
+
}
|
81
|
+
if (this.props.min !== undefined) {
|
82
|
+
numericValue = Math.max(this.props.min, numericValue);
|
83
|
+
}
|
84
|
+
if (this.props.max !== undefined) {
|
85
|
+
numericValue = Math.min(this.props.max, numericValue);
|
86
|
+
}
|
87
|
+
value = numericValue.toString();
|
88
|
+
}
|
89
|
+
this._localChange = true;
|
90
|
+
const store = this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName];
|
91
|
+
if (this.props.validator && valueToValidate) {
|
92
|
+
if (this.props.validator(valueToValidate) == false) {
|
93
|
+
value = store;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
this.setState({ value: value });
|
97
|
+
if (this.props.propertyName && !this.props.delayInput) {
|
98
|
+
this.props.target[this.props.propertyName] = value;
|
99
|
+
}
|
100
|
+
this.raiseOnPropertyChanged(value, store);
|
101
|
+
}
|
102
|
+
incrementValue(amount) {
|
103
|
+
if (this.props.step) {
|
104
|
+
amount *= this.props.step;
|
105
|
+
}
|
106
|
+
if (this.props.arrowsIncrement) {
|
107
|
+
this.props.arrowsIncrement(amount);
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
const currentValue = this.getCurrentNumericValue(this.state.value);
|
111
|
+
this.updateValue((currentValue + amount).toFixed(2));
|
112
|
+
}
|
113
|
+
onKeyDown(event) {
|
114
|
+
if (this.props.arrows) {
|
115
|
+
if (event.key === "ArrowUp") {
|
116
|
+
this.incrementValue(1);
|
117
|
+
event.preventDefault();
|
118
|
+
}
|
119
|
+
if (event.key === "ArrowDown") {
|
120
|
+
this.incrementValue(-1);
|
121
|
+
event.preventDefault();
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
render() {
|
126
|
+
const value = this.state.value === conflictingValuesPlaceholder ? "" : this.state.value;
|
127
|
+
const placeholder = this.state.value === conflictingValuesPlaceholder ? conflictingValuesPlaceholder : this.props.placeholder || "";
|
128
|
+
const step = this.props.step || (this.props.roundValues ? 1 : 0.01);
|
129
|
+
return (_jsxs("div", { className: this.props.multilines ? "textInputArea" : this.props.unit !== undefined ? "textInputLine withUnits" : "textInputLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), this.props.label !== undefined && (_jsx("div", { className: "label", title: this.props.label, children: this.props.label })), this.props.multilines && (_jsx(_Fragment, { children: _jsx("textarea", { value: this.state.value, onFocus: () => {
|
130
|
+
if (this.props.lockObject) {
|
131
|
+
this.props.lockObject.lock = true;
|
132
|
+
}
|
133
|
+
}, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => {
|
134
|
+
if (evt.keyCode !== 13) {
|
135
|
+
return;
|
136
|
+
}
|
137
|
+
this.updateValue(this.state.value);
|
138
|
+
}, onBlur: (evt) => {
|
139
|
+
this.updateValue(evt.target.value, evt.target.value);
|
140
|
+
if (this.props.lockObject) {
|
141
|
+
this.props.lockObject.lock = false;
|
142
|
+
}
|
143
|
+
} }) })), !this.props.multilines && (_jsxs("div", { className: `value${this.props.noUnderline === true ? " noUnderline" : ""}${this.props.arrows ? " hasArrows" : ""}${this.state.dragging ? " dragging" : ""}`, children: [_jsx("input", { value: value, onBlur: (evt) => {
|
144
|
+
if (this.props.lockObject) {
|
145
|
+
this.props.lockObject.lock = false;
|
146
|
+
}
|
147
|
+
this.updateValue((this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || "", evt.target.value);
|
148
|
+
}, onFocus: () => {
|
149
|
+
if (this.props.lockObject) {
|
150
|
+
this.props.lockObject.lock = true;
|
151
|
+
}
|
152
|
+
}, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), placeholder: placeholder, type: this.props.numeric ? "number" : "text", step: step }), this.props.arrows && (_jsx(InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (dragging) => this.setState({ dragging }) }))] })), this.props.unit] }));
|
153
|
+
}
|
154
|
+
}
|
155
155
|
//# sourceMappingURL=textInputLineComponent.js.map
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
interface ITextLineComponentProps {
|
3
|
-
label?: string;
|
4
|
-
value?: string;
|
5
|
-
color?: string;
|
6
|
-
underline?: boolean;
|
7
|
-
onLink?: () => void;
|
8
|
-
url?: string;
|
9
|
-
ignoreValue?: boolean;
|
10
|
-
additionalClass?: string;
|
11
|
-
icon?: string;
|
12
|
-
iconLabel?: string;
|
13
|
-
tooltip?: string;
|
14
|
-
}
|
15
|
-
export declare class TextLineComponent extends React.Component<ITextLineComponentProps> {
|
16
|
-
constructor(props: ITextLineComponentProps);
|
17
|
-
onLink(): void;
|
18
|
-
renderContent(): JSX.Element | null;
|
19
|
-
render(): JSX.Element;
|
20
|
-
}
|
21
|
-
export {};
|
1
|
+
import * as React from "react";
|
2
|
+
interface ITextLineComponentProps {
|
3
|
+
label?: string;
|
4
|
+
value?: string;
|
5
|
+
color?: string;
|
6
|
+
underline?: boolean;
|
7
|
+
onLink?: () => void;
|
8
|
+
url?: string;
|
9
|
+
ignoreValue?: boolean;
|
10
|
+
additionalClass?: string;
|
11
|
+
icon?: string;
|
12
|
+
iconLabel?: string;
|
13
|
+
tooltip?: string;
|
14
|
+
}
|
15
|
+
export declare class TextLineComponent extends React.Component<ITextLineComponentProps> {
|
16
|
+
constructor(props: ITextLineComponentProps);
|
17
|
+
onLink(): void;
|
18
|
+
renderContent(): JSX.Element | null;
|
19
|
+
render(): JSX.Element;
|
20
|
+
}
|
21
|
+
export {};
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import * as React from "react";
|
3
|
-
export class TextLineComponent 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.ignoreValue) {
|
19
|
-
return null;
|
20
|
-
}
|
21
|
-
if (this.props.onLink || this.props.url) {
|
22
|
-
return (_jsx("div", { className: "link-value", title: this.props.value, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
|
23
|
-
}
|
24
|
-
return (_jsx("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
|
25
|
-
}
|
26
|
-
render() {
|
27
|
-
var _a, _b, _c;
|
28
|
-
return (_jsxs("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : ""), 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: (_b = (_a = this.props.tooltip) !== null && _a !== void 0 ? _a : this.props.label) !== null && _b !== void 0 ? _b : "", children: (_c = this.props.label) !== null && _c !== void 0 ? _c : "" }), this.renderContent()] }));
|
29
|
-
}
|
30
|
-
}
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class TextLineComponent 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.ignoreValue) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
if (this.props.onLink || this.props.url) {
|
22
|
+
return (_jsx("div", { className: "link-value", title: this.props.value, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
|
23
|
+
}
|
24
|
+
return (_jsx("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
|
25
|
+
}
|
26
|
+
render() {
|
27
|
+
var _a, _b, _c;
|
28
|
+
return (_jsxs("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : ""), 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: (_b = (_a = this.props.tooltip) !== null && _a !== void 0 ? _a : this.props.label) !== null && _b !== void 0 ? _b : "", children: (_c = this.props.label) !== null && _c !== void 0 ? _c : "" }), this.renderContent()] }));
|
29
|
+
}
|
30
|
+
}
|
31
31
|
//# sourceMappingURL=textLineComponent.js.map
|
package/lines/unitButton.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
interface IUnitButtonProps {
|
3
|
-
unit: string;
|
4
|
-
locked?: boolean;
|
5
|
-
onClick?: (unit: string) => void;
|
6
|
-
}
|
7
|
-
export declare function UnitButton(props: IUnitButtonProps): JSX.Element;
|
8
|
-
export {};
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface IUnitButtonProps {
|
3
|
+
unit: string;
|
4
|
+
locked?: boolean;
|
5
|
+
onClick?: (unit: string) => void;
|
6
|
+
}
|
7
|
+
export declare function UnitButton(props: IUnitButtonProps): JSX.Element;
|
8
|
+
export {};
|
package/lines/unitButton.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
export function UnitButton(props) {
|
3
|
-
return (_jsx("button", { className: "unit", onClick: () => {
|
4
|
-
if (props.onClick && !props.locked)
|
5
|
-
props.onClick(props.unit || "");
|
6
|
-
}, disabled: props.locked, children: props.unit }));
|
7
|
-
}
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
export function UnitButton(props) {
|
3
|
+
return (_jsx("button", { className: "unit", onClick: () => {
|
4
|
+
if (props.onClick && !props.locked)
|
5
|
+
props.onClick(props.unit || "");
|
6
|
+
}, disabled: props.locked, children: props.unit }));
|
7
|
+
}
|
8
8
|
//# sourceMappingURL=unitButton.js.map
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
interface IValueLineComponentProps {
|
3
|
-
label: string;
|
4
|
-
value: number;
|
5
|
-
color?: string;
|
6
|
-
fractionDigits?: number;
|
7
|
-
units?: string;
|
8
|
-
icon?: string;
|
9
|
-
iconLabel?: string;
|
10
|
-
}
|
11
|
-
export declare class ValueLineComponent extends React.Component<IValueLineComponentProps> {
|
12
|
-
constructor(props: IValueLineComponentProps);
|
13
|
-
render(): JSX.Element;
|
14
|
-
}
|
15
|
-
export {};
|
1
|
+
import * as React from "react";
|
2
|
+
interface IValueLineComponentProps {
|
3
|
+
label: string;
|
4
|
+
value: number;
|
5
|
+
color?: string;
|
6
|
+
fractionDigits?: number;
|
7
|
+
units?: string;
|
8
|
+
icon?: string;
|
9
|
+
iconLabel?: string;
|
10
|
+
}
|
11
|
+
export declare class ValueLineComponent extends React.Component<IValueLineComponentProps> {
|
12
|
+
constructor(props: IValueLineComponentProps);
|
13
|
+
render(): JSX.Element;
|
14
|
+
}
|
15
|
+
export {};
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import * as React from "react";
|
3
|
-
export class ValueLineComponent extends React.Component {
|
4
|
-
constructor(props) {
|
5
|
-
super(props);
|
6
|
-
}
|
7
|
-
render() {
|
8
|
-
const digits = this.props.fractionDigits !== undefined ? this.props.fractionDigits : 2;
|
9
|
-
const value = this.props.value.toFixed(digits) + (this.props.units ? " " + this.props.units : "");
|
10
|
-
return (_jsxs("div", { className: "textLine", 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", style: { color: this.props.color ? this.props.color : "" }, children: value })] }));
|
11
|
-
}
|
12
|
-
}
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
export class ValueLineComponent extends React.Component {
|
4
|
+
constructor(props) {
|
5
|
+
super(props);
|
6
|
+
}
|
7
|
+
render() {
|
8
|
+
const digits = this.props.fractionDigits !== undefined ? this.props.fractionDigits : 2;
|
9
|
+
const value = this.props.value.toFixed(digits) + (this.props.units ? " " + this.props.units : "");
|
10
|
+
return (_jsxs("div", { className: "textLine", 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", style: { color: this.props.color ? this.props.color : "" }, children: value })] }));
|
11
|
+
}
|
12
|
+
}
|
13
13
|
//# sourceMappingURL=valueLineComponent.js.map
|
@@ -1,36 +1,36 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import type { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
-
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
4
|
-
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
5
|
-
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
6
|
-
interface IVector2LineComponentProps {
|
7
|
-
label: string;
|
8
|
-
target: any;
|
9
|
-
propertyName: string;
|
10
|
-
step?: number;
|
11
|
-
onChange?: (newvalue: Vector2) => void;
|
12
|
-
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
13
|
-
icon?: string;
|
14
|
-
iconLabel?: string;
|
15
|
-
lockObject: LockObject;
|
16
|
-
}
|
17
|
-
export declare class Vector2LineComponent extends React.Component<IVector2LineComponentProps, {
|
18
|
-
isExpanded: boolean;
|
19
|
-
value: Vector2;
|
20
|
-
}> {
|
21
|
-
static defaultProps: {
|
22
|
-
step: number;
|
23
|
-
};
|
24
|
-
private _localChange;
|
25
|
-
constructor(props: IVector2LineComponentProps);
|
26
|
-
shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {
|
27
|
-
isExpanded: boolean;
|
28
|
-
value: Vector2;
|
29
|
-
}): boolean;
|
30
|
-
switchExpandState(): void;
|
31
|
-
raiseOnPropertyChanged(previousValue: Vector2): void;
|
32
|
-
updateStateX(value: number): void;
|
33
|
-
updateStateY(value: number): void;
|
34
|
-
render(): JSX.Element;
|
35
|
-
}
|
36
|
-
export {};
|
1
|
+
import * as React from "react";
|
2
|
+
import type { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
+
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
4
|
+
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
5
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
6
|
+
interface IVector2LineComponentProps {
|
7
|
+
label: string;
|
8
|
+
target: any;
|
9
|
+
propertyName: string;
|
10
|
+
step?: number;
|
11
|
+
onChange?: (newvalue: Vector2) => void;
|
12
|
+
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
13
|
+
icon?: string;
|
14
|
+
iconLabel?: string;
|
15
|
+
lockObject: LockObject;
|
16
|
+
}
|
17
|
+
export declare class Vector2LineComponent extends React.Component<IVector2LineComponentProps, {
|
18
|
+
isExpanded: boolean;
|
19
|
+
value: Vector2;
|
20
|
+
}> {
|
21
|
+
static defaultProps: {
|
22
|
+
step: number;
|
23
|
+
};
|
24
|
+
private _localChange;
|
25
|
+
constructor(props: IVector2LineComponentProps);
|
26
|
+
shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {
|
27
|
+
isExpanded: boolean;
|
28
|
+
value: Vector2;
|
29
|
+
}): boolean;
|
30
|
+
switchExpandState(): void;
|
31
|
+
raiseOnPropertyChanged(previousValue: Vector2): void;
|
32
|
+
updateStateX(value: number): void;
|
33
|
+
updateStateY(value: number): void;
|
34
|
+
render(): JSX.Element;
|
35
|
+
}
|
36
|
+
export {};
|