kitchen-simulator 4.0.1-react-18 → 4.0.1
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/README.md +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +156 -108
- package/es/LiteRenderer.js +159 -130
- package/es/actions/export.js +25 -12
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/exporter.js +1 -0
- package/es/catalog/utils/item-loader.js +17 -12
- package/es/class/hole.js +0 -2
- package/es/class/item.js +95 -69
- package/es/class/line.js +4 -8
- package/es/class/project.js +91 -80
- package/es/components/content.js +5 -2
- package/es/components/export.js +4 -6
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +11 -22
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +339 -299
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +17 -47
- package/es/components/viewer2d/ruler.js +5 -3
- package/es/components/viewer2d/rulerDist.js +8 -7
- package/es/components/viewer2d/rulerX.js +3 -0
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +4 -1
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/viewer2d.js +51 -84
- package/es/components/viewer3d/scene-creator.js +51 -15
- package/es/components/viewer3d/viewer3d-first-person.js +8 -0
- package/es/components/viewer3d/viewer3d.js +80 -88
- package/es/constants.js +6 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +567 -25
- package/es/models.js +2 -1
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +0 -2
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +52 -96
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +781 -577
- package/es/utils/molding.js +457 -11
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +155 -108
- package/lib/LiteRenderer.js +158 -130
- package/lib/actions/export.js +35 -39
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/catalog.js +20 -4
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/exporter.js +1 -0
- package/lib/catalog/utils/item-loader.js +17 -12
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +93 -67
- package/lib/class/line.js +3 -7
- package/lib/class/project.js +91 -80
- package/lib/components/content.js +5 -2
- package/lib/components/export.js +6 -26
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +105 -1
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +11 -22
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +337 -297
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +17 -47
- package/lib/components/viewer2d/ruler.js +4 -2
- package/lib/components/viewer2d/rulerDist.js +8 -7
- package/lib/components/viewer2d/rulerX.js +3 -0
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +4 -1
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +49 -81
- package/lib/components/viewer3d/scene-creator.js +49 -13
- package/lib/components/viewer3d/viewer3d-first-person.js +8 -0
- package/lib/components/viewer3d/viewer3d.js +77 -84
- package/lib/constants.js +11 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +567 -25
- package/lib/models.js +2 -1
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +0 -2
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +52 -96
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +781 -576
- package/lib/utils/molding.js +458 -9
- package/package.json +21 -16
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/useAppContext.js +0 -16
package/es/components/content.js
CHANGED
|
@@ -7,8 +7,7 @@ import Viewer3DFirstPerson from "./viewer3d/viewer3d-first-person";
|
|
|
7
7
|
// import ProjectConfigurator from './configurator/project-configurator';
|
|
8
8
|
import * as constants from "../constants";
|
|
9
9
|
import Front3D from "./viewer3d/front3D";
|
|
10
|
-
|
|
11
|
-
export default function Content(_ref) {
|
|
10
|
+
export default function Content(_ref, _ref2) {
|
|
12
11
|
var width = _ref.width,
|
|
13
12
|
height = _ref.height,
|
|
14
13
|
state = _ref.state,
|
|
@@ -19,6 +18,7 @@ export default function Content(_ref) {
|
|
|
19
18
|
keyDownEnable = _ref.keyDownEnable,
|
|
20
19
|
catalog = _ref.catalog,
|
|
21
20
|
onInternalEvent = _ref.onInternalEvent;
|
|
21
|
+
var projectActions = _ref2.projectActions;
|
|
22
22
|
var mode = state.get('mode');
|
|
23
23
|
|
|
24
24
|
// Internal Event for unselect_all
|
|
@@ -133,4 +133,7 @@ Content.propTypes = {
|
|
|
133
133
|
height: PropTypes.number.isRequired,
|
|
134
134
|
replaceCabinet: PropTypes.func.isRequired,
|
|
135
135
|
onInternalEvent: PropTypes.func.isRequired
|
|
136
|
+
};
|
|
137
|
+
Content.contextTypes = {
|
|
138
|
+
projectActions: PropTypes.object.isRequired
|
|
136
139
|
};
|
package/es/components/export.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import Content from "./content";
|
|
2
2
|
import Viewer2DComponents from "./viewer2d/export";
|
|
3
3
|
import StyleComponents from "./style/export";
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
StyleComponents: StyleComponents
|
|
9
|
-
};
|
|
4
|
+
|
|
5
|
+
export { Content, Viewer2DComponents, StyleComponents };
|
|
6
|
+
|
|
7
|
+
export default { Content, Viewer2DComponents, StyleComponents };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
var _excluded = ["type", "style", "styleHover", "children", "size"];
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
import React, { Component } from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import * as SharedStyle from "../../shared-style";
|
|
14
|
+
var BASE_STYLE = {
|
|
15
|
+
display: 'inline-block',
|
|
16
|
+
fontWeight: '400',
|
|
17
|
+
lineHeight: '1.25',
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
whiteSpace: 'nowrap',
|
|
20
|
+
verticalAlign: 'middle',
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
WebkitUserSelect: 'none',
|
|
23
|
+
MozUserSelect: 'none',
|
|
24
|
+
MsUserSelect: 'none',
|
|
25
|
+
userSelect: 'none',
|
|
26
|
+
padding: '5px 14px',
|
|
27
|
+
fontSize: '14px',
|
|
28
|
+
color: SharedStyle.COLORS.black,
|
|
29
|
+
fonWeight: '400px',
|
|
30
|
+
transition: 'background-color 175ms ease, border 175ms ease',
|
|
31
|
+
outline: 'none',
|
|
32
|
+
borderRadius: '2px',
|
|
33
|
+
borderWidth: '1px',
|
|
34
|
+
borderType: 'solid',
|
|
35
|
+
width: '100%'
|
|
36
|
+
};
|
|
37
|
+
var BASE_STYLE_SIZE = {
|
|
38
|
+
small: {
|
|
39
|
+
fontSize: '12px',
|
|
40
|
+
padding: '3px 8px'
|
|
41
|
+
},
|
|
42
|
+
normal: {},
|
|
43
|
+
large: {
|
|
44
|
+
padding: '8px 20px'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var Button = /*#__PURE__*/function (_Component) {
|
|
48
|
+
function Button(props) {
|
|
49
|
+
var _this;
|
|
50
|
+
_classCallCheck(this, Button);
|
|
51
|
+
_this = _callSuper(this, Button, [props]);
|
|
52
|
+
_this.state = {
|
|
53
|
+
hover: false
|
|
54
|
+
};
|
|
55
|
+
return _this;
|
|
56
|
+
}
|
|
57
|
+
_inherits(Button, _Component);
|
|
58
|
+
return _createClass(Button, [{
|
|
59
|
+
key: "render",
|
|
60
|
+
value: function render() {
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
var hover = this.state.hover;
|
|
63
|
+
var _this$props = this.props,
|
|
64
|
+
type = _this$props.type,
|
|
65
|
+
customStyle = _this$props.style,
|
|
66
|
+
customStyleHover = _this$props.styleHover,
|
|
67
|
+
children = _this$props.children,
|
|
68
|
+
size = _this$props.size,
|
|
69
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
70
|
+
var styleMerged = Object.assign({}, BASE_STYLE, BASE_STYLE_SIZE[size], hover ? customStyleHover : customStyle);
|
|
71
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
72
|
+
type: type,
|
|
73
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
74
|
+
return _this2.setState({
|
|
75
|
+
hover: true
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
79
|
+
return _this2.setState({
|
|
80
|
+
hover: false
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
style: styleMerged
|
|
84
|
+
}, rest), children);
|
|
85
|
+
}
|
|
86
|
+
}]);
|
|
87
|
+
}(Component);
|
|
88
|
+
export { Button as default };
|
|
89
|
+
Button.defaultProps = {
|
|
90
|
+
type: 'button',
|
|
91
|
+
size: 'normal',
|
|
92
|
+
style: {
|
|
93
|
+
backgroundColor: '#e6e6e6',
|
|
94
|
+
borderColor: '#adadad'
|
|
95
|
+
},
|
|
96
|
+
styleHover: {
|
|
97
|
+
backgroundColor: '#d4d4d4',
|
|
98
|
+
borderColor: '#8c8c8c'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
Button.propTypes = {
|
|
102
|
+
type: PropTypes.string,
|
|
103
|
+
style: PropTypes.object,
|
|
104
|
+
styleHover: PropTypes.object,
|
|
105
|
+
size: PropTypes.oneOf(['large', 'normal', 'small'])
|
|
106
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Button from "./button";
|
|
6
|
+
var STYLE = {
|
|
7
|
+
borderColor: '#adadad',
|
|
8
|
+
backgroundColor: '#e6e6e6'
|
|
9
|
+
};
|
|
10
|
+
var STYLE_HOVER = {
|
|
11
|
+
backgroundColor: '#d4d4d4',
|
|
12
|
+
borderColor: '#8c8c8c'
|
|
13
|
+
};
|
|
14
|
+
export default function CancelButton(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
18
|
+
style: STYLE,
|
|
19
|
+
styleHover: STYLE_HOVER
|
|
20
|
+
}, rest), children);
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
var STYLE = {
|
|
7
|
+
padding: '0 20px',
|
|
8
|
+
overflowY: 'auto'
|
|
9
|
+
};
|
|
10
|
+
export default function ContentContainer(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
width = _ref.width,
|
|
13
|
+
height = _ref.height,
|
|
14
|
+
_ref$style = _ref.style,
|
|
15
|
+
style = _ref$style === void 0 ? {} : _ref$style;
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
style: _objectSpread(_objectSpread({
|
|
18
|
+
width: width,
|
|
19
|
+
height: height
|
|
20
|
+
}, STYLE), style),
|
|
21
|
+
onWheel: function onWheel(event) {
|
|
22
|
+
return event.stopPropagation();
|
|
23
|
+
}
|
|
24
|
+
}, children);
|
|
25
|
+
}
|
|
26
|
+
ContentContainer.propsType = {
|
|
27
|
+
width: PropTypes.number.isRequired,
|
|
28
|
+
height: PropTypes.number.isRequired,
|
|
29
|
+
style: PropTypes.object
|
|
30
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "style"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import * as SharedStyle from "../../shared-style";
|
|
10
|
+
var STYLE = {
|
|
11
|
+
color: SharedStyle.PRIMARY_COLOR.alt,
|
|
12
|
+
fontWeight: 300
|
|
13
|
+
};
|
|
14
|
+
export default function ContentTitle(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
_ref$style = _ref.style,
|
|
17
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
return /*#__PURE__*/React.createElement("h1", _extends({
|
|
20
|
+
style: _objectSpread(_objectSpread({}, STYLE), style)
|
|
21
|
+
}, rest), children);
|
|
22
|
+
}
|
|
23
|
+
ContentTitle.propsType = {
|
|
24
|
+
style: PropTypes.object
|
|
25
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Button from "./button";
|
|
6
|
+
import * as SharedStyle from "../../shared-style";
|
|
7
|
+
var STYLE = {
|
|
8
|
+
borderColor: '#c12e2a',
|
|
9
|
+
backgroundColor: '#c9302c',
|
|
10
|
+
color: SharedStyle.COLORS.white
|
|
11
|
+
};
|
|
12
|
+
var STYLE_HOVER = {
|
|
13
|
+
backgroundColor: '#972726',
|
|
14
|
+
borderColor: '#c12e2a',
|
|
15
|
+
color: SharedStyle.COLORS.white
|
|
16
|
+
};
|
|
17
|
+
export default function FormDeleteButton(_ref) {
|
|
18
|
+
var children = _ref.children,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
21
|
+
style: STYLE,
|
|
22
|
+
styleHover: STYLE_HOVER
|
|
23
|
+
}, rest), children);
|
|
24
|
+
}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
+
import Button from "./button";
|
|
2
|
+
import CancelButton from "./cancel-button";
|
|
3
|
+
import ContentContainer from "./content-container";
|
|
4
|
+
import ContentTitle from "./content-title";
|
|
5
|
+
import DeleteButton from "./delete-button";
|
|
6
|
+
import FormBlock from "./form-block";
|
|
7
|
+
import FormColorInput from "./form-color-input";
|
|
8
|
+
import FormLabel from "./form-label";
|
|
1
9
|
import FormNumberInput from "./form-number-input";
|
|
2
|
-
|
|
10
|
+
import FormSelect from "./form-select";
|
|
11
|
+
import FormSlider from "./form-slider";
|
|
12
|
+
import FormSubmitButton from "./form-submit-button";
|
|
13
|
+
import FormTextInput from "./form-text-input";
|
|
14
|
+
import FormNumberInput2 from "./form-number-input_2";
|
|
15
|
+
export { Button, CancelButton, ContentContainer, ContentTitle, DeleteButton, FormBlock, FormColorInput, FormLabel, FormNumberInput, FormSelect, FormSlider, FormSubmitButton, FormTextInput, FormNumberInput2 };
|
|
3
16
|
export default {
|
|
4
|
-
|
|
17
|
+
Button: Button,
|
|
18
|
+
CancelButton: CancelButton,
|
|
19
|
+
ContentContainer: ContentContainer,
|
|
20
|
+
ContentTitle: ContentTitle,
|
|
21
|
+
DeleteButton: DeleteButton,
|
|
22
|
+
FormBlock: FormBlock,
|
|
23
|
+
FormColorInput: FormColorInput,
|
|
24
|
+
FormLabel: FormLabel,
|
|
25
|
+
FormNumberInput: FormNumberInput,
|
|
26
|
+
FormSelect: FormSelect,
|
|
27
|
+
FormSlider: FormSlider,
|
|
28
|
+
FormSubmitButton: FormSubmitButton,
|
|
29
|
+
FormTextInput: FormTextInput,
|
|
30
|
+
FormNumberInput2: FormNumberInput2
|
|
5
31
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "style"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var BASE_STYLE = {
|
|
9
|
+
marginBottom: '16px'
|
|
10
|
+
};
|
|
11
|
+
export default function FormBlock(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
style = _ref.style,
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
|
+
style: _objectSpread(_objectSpread({}, BASE_STYLE), {}, {
|
|
17
|
+
style: style
|
|
18
|
+
})
|
|
19
|
+
}, rest), children);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["onChange"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import FormTextInput from "./form-text-input";
|
|
6
|
+
var STYLE = {
|
|
7
|
+
padding: 0,
|
|
8
|
+
border: 0
|
|
9
|
+
};
|
|
10
|
+
var EREG_NUMBER = /^.*$/;
|
|
11
|
+
export default function FormColorInput(_ref) {
|
|
12
|
+
var onChange = _ref.onChange,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
var onChangeCustom = function onChangeCustom(event) {
|
|
15
|
+
var value = event.target.value;
|
|
16
|
+
if (EREG_NUMBER.test(value)) {
|
|
17
|
+
onChange(event);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement(FormTextInput, _extends({
|
|
21
|
+
type: "color",
|
|
22
|
+
style: STYLE,
|
|
23
|
+
onChange: onChangeCustom,
|
|
24
|
+
autoComplete: "off"
|
|
25
|
+
}, rest));
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "style"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var BASE_STYLE = {
|
|
9
|
+
display: 'block',
|
|
10
|
+
marginBottom: '2px',
|
|
11
|
+
fontSize: '12px'
|
|
12
|
+
};
|
|
13
|
+
export default function FormLabel(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
style = _ref.style,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
return /*#__PURE__*/React.createElement("label", _extends({
|
|
18
|
+
style: _objectSpread(_objectSpread({}, BASE_STYLE), {}, {
|
|
19
|
+
style: style
|
|
20
|
+
})
|
|
21
|
+
}, rest), children);
|
|
22
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
7
|
+
var _templateObject;
|
|
9
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
10
|
import React, { Component } from 'react';
|
|
12
11
|
import PropTypes from 'prop-types';
|
|
13
12
|
import { KEYBOARD_BUTTON_CODE, TEXT_COLOR_NEUTRAL_0, SECONDARY_PURPLE_COLOR, DEFAULT_FONT_FAMILY } from "../../constants";
|
|
13
|
+
import styled from 'styled-components';
|
|
14
14
|
import { isValidNumber } from "../../utils/helper";
|
|
15
|
+
var StyledInput = styled.input(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n padding: 15px 25px 12px 0px;\n width: 120px;\n color: ", ";\n background-color: rgb(255, 255, 255);\n border: 2px solid;\n text-align: right;\n float: right;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n line-height: 17px;\n border-radius: 5px;\n outline: 0;\n :focus {\n border-color: ", ";\n }\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR);
|
|
15
16
|
var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
16
17
|
function FormNumberInput(props, context) {
|
|
17
18
|
var _this;
|
|
@@ -103,30 +104,13 @@ var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
|
-
|
|
107
|
-
display: 'block',
|
|
108
|
-
padding: '15px 25px 12px 0px',
|
|
109
|
-
width: '120px',
|
|
110
|
-
color: TEXT_COLOR_NEUTRAL_0,
|
|
111
|
-
backgroundColor: 'rgb(255, 255, 255)',
|
|
112
|
-
border: '2px solid',
|
|
113
|
-
textAlign: 'right',
|
|
114
|
-
"float": 'right',
|
|
115
|
-
fontFamily: DEFAULT_FONT_FAMILY,
|
|
116
|
-
fontSize: '16px',
|
|
117
|
-
fontWeight: 600,
|
|
118
|
-
lineHeight: '17px',
|
|
119
|
-
borderRadius: '5px',
|
|
120
|
-
outline: 0,
|
|
121
|
-
borderColor: this.state.focusOn ? SECONDARY_PURPLE_COLOR : undefined
|
|
122
|
-
};
|
|
123
|
-
return /*#__PURE__*/React.createElement("input", {
|
|
107
|
+
return /*#__PURE__*/React.createElement(StyledInput, {
|
|
124
108
|
id: "form_number_input",
|
|
125
109
|
autoFocus: this.state.focusOn,
|
|
126
110
|
readOnly: !!this.props.disabled,
|
|
127
111
|
type: "text",
|
|
128
112
|
value: currValue,
|
|
129
|
-
style:
|
|
113
|
+
style: style,
|
|
130
114
|
onChange: function onChange(evt) {
|
|
131
115
|
_this2.context.projectActions.copyProperties('ddddd');
|
|
132
116
|
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
@@ -183,6 +167,11 @@ FormNumberInput.propTypes = {
|
|
|
183
167
|
labelName: PropTypes.string,
|
|
184
168
|
isCeiling: PropTypes.string
|
|
185
169
|
};
|
|
170
|
+
FormNumberInput.contextTypes = {
|
|
171
|
+
translator: PropTypes.object.isRequired,
|
|
172
|
+
projectActions: PropTypes.object.isRequired,
|
|
173
|
+
linesActions: PropTypes.object.isRequired
|
|
174
|
+
};
|
|
186
175
|
FormNumberInput.defaultProps = {
|
|
187
176
|
value: 0,
|
|
188
177
|
style: {},
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
import React, { Component } from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import * as SharedStyle from "../../shared-style";
|
|
14
|
+
import { MdUpdate } from 'react-icons/md';
|
|
15
|
+
import { KEYBOARD_BUTTON_CODE } from "../../constants";
|
|
16
|
+
var STYLE_INPUT = {
|
|
17
|
+
display: 'block',
|
|
18
|
+
width: '100%',
|
|
19
|
+
padding: '0 2px',
|
|
20
|
+
fontSize: '13px',
|
|
21
|
+
lineHeight: '1.25',
|
|
22
|
+
color: SharedStyle.PRIMARY_COLOR.input,
|
|
23
|
+
backgroundColor: SharedStyle.COLORS.white,
|
|
24
|
+
backgroundImage: 'none',
|
|
25
|
+
border: '1px solid rgba(0,0,0,.15)',
|
|
26
|
+
outline: 'none',
|
|
27
|
+
height: '30px'
|
|
28
|
+
};
|
|
29
|
+
var confirmStyle = {
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
cursor: 'pointer',
|
|
32
|
+
width: '20px',
|
|
33
|
+
height: '20px',
|
|
34
|
+
right: '5px',
|
|
35
|
+
top: '5px',
|
|
36
|
+
backgroundColor: SharedStyle.SECONDARY_COLOR.main,
|
|
37
|
+
color: '#FFF',
|
|
38
|
+
transition: 'all 0.1s linear'
|
|
39
|
+
};
|
|
40
|
+
var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
41
|
+
function FormNumberInput(props, context) {
|
|
42
|
+
var _this;
|
|
43
|
+
_classCallCheck(this, FormNumberInput);
|
|
44
|
+
_this = _callSuper(this, FormNumberInput, [props, context]);
|
|
45
|
+
_this.state = {
|
|
46
|
+
focus: false,
|
|
47
|
+
valid: true,
|
|
48
|
+
showedValue: props.value,
|
|
49
|
+
disabled: props.disabled === true ? true : false,
|
|
50
|
+
focusOn: false
|
|
51
|
+
};
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
_inherits(FormNumberInput, _Component);
|
|
55
|
+
return _createClass(FormNumberInput, [{
|
|
56
|
+
key: "componentWillReceiveProps",
|
|
57
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
58
|
+
if (this.props.value !== nextProps.value || this.props.focus !== nextProps.focus) {
|
|
59
|
+
this.setState({
|
|
60
|
+
showedValue: nextProps.value,
|
|
61
|
+
focusOn: nextProps.focus
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (this.props.focus !== nextProps.focus) {
|
|
65
|
+
this.Input.focus();
|
|
66
|
+
this.Input.select();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "render",
|
|
71
|
+
value: function render() {
|
|
72
|
+
var _this2 = this;
|
|
73
|
+
var _this$props = this.props,
|
|
74
|
+
value = _this$props.value,
|
|
75
|
+
min = _this$props.min,
|
|
76
|
+
max = _this$props.max,
|
|
77
|
+
precision = _this$props.precision,
|
|
78
|
+
onChange = _this$props.onChange,
|
|
79
|
+
onValid = _this$props.onValid,
|
|
80
|
+
onInvalid = _this$props.onInvalid,
|
|
81
|
+
style = _this$props.style,
|
|
82
|
+
placeholder = _this$props.placeholder;
|
|
83
|
+
var numericInputStyle = _objectSpread(_objectSpread({}, STYLE_INPUT), style);
|
|
84
|
+
if (this.state.focusOn) numericInputStyle.border = "1px solid ".concat(SharedStyle.SECONDARY_COLOR.main);
|
|
85
|
+
var regexp = new RegExp("^-?([0-9]+)?\\.?([0-9]{0,".concat(precision, "})?$"));
|
|
86
|
+
if (!isNaN(min) && isFinite(min) && this.state.showedValue < min) this.setState({
|
|
87
|
+
showedValue: min
|
|
88
|
+
}); // value = min;
|
|
89
|
+
if (!isNaN(max) && isFinite(max) && this.state.showedValue > max) this.setState({
|
|
90
|
+
showedValue: max
|
|
91
|
+
}); // value = max;
|
|
92
|
+
|
|
93
|
+
var currValue = regexp.test(this.state.showedValue) ? this.state.showedValue : parseFloat(this.state.showedValue).toFixed(precision);
|
|
94
|
+
var different = parseFloat(this.props.value).toFixed(precision) !== parseFloat(this.state.showedValue).toFixed(precision);
|
|
95
|
+
var saveFn = function saveFn(e) {
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
if (_this2.state.valid) {
|
|
98
|
+
var savedValue = _this2.state.showedValue !== '' && _this2.state.showedValue !== '-' ? parseFloat(_this2.state.showedValue) : 0;
|
|
99
|
+
_this2.setState({
|
|
100
|
+
showedValue: savedValue
|
|
101
|
+
});
|
|
102
|
+
onChange({
|
|
103
|
+
target: {
|
|
104
|
+
value: savedValue
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
style: {
|
|
111
|
+
position: 'relative'
|
|
112
|
+
}
|
|
113
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
114
|
+
autoFocus: this.state.focusOn,
|
|
115
|
+
readOnly: this.state.disabled,
|
|
116
|
+
type: "text",
|
|
117
|
+
value: currValue,
|
|
118
|
+
style: numericInputStyle,
|
|
119
|
+
onChange: function onChange(evt) {
|
|
120
|
+
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
121
|
+
if (valid) {
|
|
122
|
+
_this2.setState({
|
|
123
|
+
showedValue: evt.nativeEvent.target.value
|
|
124
|
+
});
|
|
125
|
+
if (onValid) onValid(evt.nativeEvent);
|
|
126
|
+
} else {
|
|
127
|
+
if (onInvalid) onInvalid(evt.nativeEvent);
|
|
128
|
+
}
|
|
129
|
+
_this2.setState({
|
|
130
|
+
valid: valid
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
onFocus: function onFocus(e) {
|
|
134
|
+
return _this2.setState({
|
|
135
|
+
focusOn: true
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
onBlur: function onBlur(e) {
|
|
139
|
+
return _this2.setState({
|
|
140
|
+
focusOn: false
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
ref: function ref(ele) {
|
|
144
|
+
_this2.Input = ele;
|
|
145
|
+
},
|
|
146
|
+
onKeyDown: function onKeyDown(e) {
|
|
147
|
+
var keyCode = e.keyCode || e.which;
|
|
148
|
+
if (keyCode == KEYBOARD_BUTTON_CODE.ENTER || keyCode == KEYBOARD_BUTTON_CODE.TAB) {
|
|
149
|
+
saveFn(e);
|
|
150
|
+
_this2.Input.blur();
|
|
151
|
+
}
|
|
152
|
+
if (keyCode == KEYBOARD_BUTTON_CODE.ESC) {
|
|
153
|
+
_this2.context.projectActions.rollback();
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
placeholder: placeholder
|
|
157
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
onClick: function onClick(e) {
|
|
159
|
+
if (different) saveFn(e);
|
|
160
|
+
},
|
|
161
|
+
title: this.context.translator.t('Confirm'),
|
|
162
|
+
style: _objectSpread(_objectSpread({}, confirmStyle), {}, {
|
|
163
|
+
visibility: different ? 'visible' : 'hidden',
|
|
164
|
+
opacity: different ? '1' : '0'
|
|
165
|
+
})
|
|
166
|
+
}, /*#__PURE__*/React.createElement(MdUpdate, {
|
|
167
|
+
style: {
|
|
168
|
+
width: '100%',
|
|
169
|
+
height: '100%',
|
|
170
|
+
padding: '0.2em',
|
|
171
|
+
color: '#FFF'
|
|
172
|
+
}
|
|
173
|
+
})));
|
|
174
|
+
}
|
|
175
|
+
}]);
|
|
176
|
+
}(Component);
|
|
177
|
+
export { FormNumberInput as default };
|
|
178
|
+
FormNumberInput.propTypes = {
|
|
179
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
180
|
+
style: PropTypes.object,
|
|
181
|
+
onChange: PropTypes.func.isRequired,
|
|
182
|
+
onValid: PropTypes.func,
|
|
183
|
+
onInvalid: PropTypes.func,
|
|
184
|
+
min: PropTypes.number,
|
|
185
|
+
max: PropTypes.number,
|
|
186
|
+
precision: PropTypes.number,
|
|
187
|
+
placeholder: PropTypes.string
|
|
188
|
+
};
|
|
189
|
+
FormNumberInput.contextTypes = {
|
|
190
|
+
translator: PropTypes.object.isRequired,
|
|
191
|
+
projectActions: PropTypes.object.isRequired
|
|
192
|
+
};
|
|
193
|
+
FormNumberInput.defaultProps = {
|
|
194
|
+
value: 0,
|
|
195
|
+
style: {},
|
|
196
|
+
min: Number.MIN_SAFE_INTEGER,
|
|
197
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
198
|
+
precision: 2,
|
|
199
|
+
disabled: false
|
|
200
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["children", "style"];
|
|
5
|
+
var _templateObject;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import * as SharedStyle from "../../shared-style";
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { TEXT_COLOR_NEUTRAL_3, DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR } from "../../constants";
|
|
10
|
+
var StyledSelect = styled.select(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n width: 120px;\n float: right;\n padding: 15px 10px 12px 0px;\n color: ", ";\n border: 2px solid;\n font-family: ", ";\n font-size: 12px;\n font-weight: 600;\n line-height: 17px;\n text-align: right;\n outline: none;\n border-radius: 5px;\n :hover {\n border-color: ", ";\n }\n :focus {\n border-color: ", ";\n }\n"])), TEXT_COLOR_NEUTRAL_3, DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, SECONDARY_PURPLE_COLOR);
|
|
11
|
+
export default function FormSelect(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
style = _ref.style,
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
return /*#__PURE__*/React.createElement(StyledSelect, _extends({
|
|
16
|
+
type: "text",
|
|
17
|
+
style: style
|
|
18
|
+
}, rest), children);
|
|
19
|
+
}
|