kitchen-simulator 4.0.4-react-18 → 4.0.4
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 +161 -104
- package/es/LiteRenderer.js +161 -129
- 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 +35 -26
- 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 +93 -80
- package/es/components/content.js +5 -93
- 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 +29 -27
- 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/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +155 -359
- 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 +4 -2
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +17 -12
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/vertex.js +3 -2
- package/es/components/viewer2d/viewer2d.js +51 -87
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +59 -18
- package/es/components/viewer3d/viewer3d-first-person.js +24 -26
- package/es/components/viewer3d/viewer3d.js +100 -112
- package/es/constants.js +6 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +566 -25
- package/es/models.js +3 -2
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +110 -0
- package/es/reducers/project-reducer.js +3 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +72 -114
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +826 -606
- package/es/utils/molding.js +457 -11
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +160 -104
- package/lib/LiteRenderer.js +160 -129
- 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 +35 -26
- 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 +93 -80
- package/lib/components/content.js +5 -93
- 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 +29 -27
- 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/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +152 -356
- 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 +4 -2
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +17 -12
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/vertex.js +3 -2
- package/lib/components/viewer2d/viewer2d.js +49 -84
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +57 -16
- package/lib/components/viewer3d/viewer3d-first-person.js +24 -26
- package/lib/components/viewer3d/viewer3d.js +97 -108
- package/lib/constants.js +11 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +566 -25
- package/lib/models.js +3 -2
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +42 -0
- package/lib/plugins/export.js +25 -0
- package/lib/plugins/keyboard.js +117 -0
- package/lib/reducers/project-reducer.js +3 -0
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +72 -114
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +826 -605
- 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
|
@@ -6,21 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
17
|
var _constants = require("../../constants");
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
18
19
|
var _helper = require("../../utils/helper");
|
|
20
|
+
var _templateObject;
|
|
19
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
-
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; }
|
|
21
|
-
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) { (0, _defineProperty2["default"])(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; }
|
|
22
22
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\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"])), _constants.TEXT_COLOR_NEUTRAL_0, _constants.DEFAULT_FONT_FAMILY, _constants.SECONDARY_PURPLE_COLOR);
|
|
24
25
|
var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
25
26
|
function FormNumberInput(props, context) {
|
|
26
27
|
var _this;
|
|
@@ -38,14 +39,26 @@ var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
38
39
|
}
|
|
39
40
|
(0, _inherits2["default"])(FormNumberInput, _Component);
|
|
40
41
|
return (0, _createClass2["default"])(FormNumberInput, [{
|
|
41
|
-
key: "
|
|
42
|
-
value: function
|
|
43
|
-
if (this.
|
|
42
|
+
key: "componentDidMount",
|
|
43
|
+
value: function componentDidMount() {
|
|
44
|
+
if (this.input.current && ['width', 'length'].includes(this.props.labelName.toLowerCase())) {
|
|
45
|
+
this.input.current.focus();
|
|
46
|
+
this.input.current.select();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "componentWillReceiveProps",
|
|
51
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
52
|
+
if (this.props.value !== nextProps.value || this.props.focus !== nextProps.focus) {
|
|
44
53
|
this.setState({
|
|
45
|
-
showedValue:
|
|
46
|
-
focusOn:
|
|
54
|
+
showedValue: nextProps.value,
|
|
55
|
+
focusOn: nextProps.focus
|
|
47
56
|
});
|
|
48
57
|
}
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "componentDidUpdate",
|
|
61
|
+
value: function componentDidUpdate(prevProps, preprevState) {
|
|
49
62
|
if (this.props.value !== prevProps.value && prevProps.labelName !== 'Ceiling Height') {
|
|
50
63
|
this.input.current.focus();
|
|
51
64
|
this.input.current.select();
|
|
@@ -66,6 +79,7 @@ var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
66
79
|
});
|
|
67
80
|
}
|
|
68
81
|
}
|
|
82
|
+
return null;
|
|
69
83
|
}
|
|
70
84
|
}, {
|
|
71
85
|
key: "render",
|
|
@@ -99,30 +113,13 @@ var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
99
113
|
});
|
|
100
114
|
}
|
|
101
115
|
};
|
|
102
|
-
|
|
103
|
-
display: 'block',
|
|
104
|
-
padding: '15px 25px 12px 0px',
|
|
105
|
-
width: '120px',
|
|
106
|
-
color: _constants.TEXT_COLOR_NEUTRAL_0,
|
|
107
|
-
backgroundColor: 'rgb(255, 255, 255)',
|
|
108
|
-
border: '2px solid',
|
|
109
|
-
textAlign: 'right',
|
|
110
|
-
"float": 'right',
|
|
111
|
-
fontFamily: _constants.DEFAULT_FONT_FAMILY,
|
|
112
|
-
fontSize: '16px',
|
|
113
|
-
fontWeight: 600,
|
|
114
|
-
lineHeight: '17px',
|
|
115
|
-
borderRadius: '5px',
|
|
116
|
-
outline: 0,
|
|
117
|
-
borderColor: this.state.focusOn ? _constants.SECONDARY_PURPLE_COLOR : undefined
|
|
118
|
-
};
|
|
119
|
-
return /*#__PURE__*/_react["default"].createElement("input", {
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInput, {
|
|
120
117
|
id: "form_number_input",
|
|
121
118
|
autoFocus: this.state.focusOn,
|
|
122
119
|
readOnly: !!this.props.disabled,
|
|
123
120
|
type: "text",
|
|
124
121
|
value: currValue,
|
|
125
|
-
style:
|
|
122
|
+
style: style,
|
|
126
123
|
onChange: function onChange(evt) {
|
|
127
124
|
_this2.context.projectActions.copyProperties('ddddd');
|
|
128
125
|
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
@@ -178,6 +175,11 @@ FormNumberInput.propTypes = {
|
|
|
178
175
|
labelName: _propTypes["default"].string,
|
|
179
176
|
isCeiling: _propTypes["default"].string
|
|
180
177
|
};
|
|
178
|
+
FormNumberInput.contextTypes = {
|
|
179
|
+
translator: _propTypes["default"].object.isRequired,
|
|
180
|
+
projectActions: _propTypes["default"].object.isRequired,
|
|
181
|
+
linesActions: _propTypes["default"].object.isRequired
|
|
182
|
+
};
|
|
181
183
|
FormNumberInput.defaultProps = {
|
|
182
184
|
value: 0,
|
|
183
185
|
style: {},
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
18
|
+
var _md = require("react-icons/md");
|
|
19
|
+
var _constants = require("../../constants");
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
|
+
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; }
|
|
22
|
+
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) { (0, _defineProperty2["default"])(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; }
|
|
23
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
24
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
+
var STYLE_INPUT = {
|
|
26
|
+
display: 'block',
|
|
27
|
+
width: '100%',
|
|
28
|
+
padding: '0 2px',
|
|
29
|
+
fontSize: '13px',
|
|
30
|
+
lineHeight: '1.25',
|
|
31
|
+
color: SharedStyle.PRIMARY_COLOR.input,
|
|
32
|
+
backgroundColor: SharedStyle.COLORS.white,
|
|
33
|
+
backgroundImage: 'none',
|
|
34
|
+
border: '1px solid rgba(0,0,0,.15)',
|
|
35
|
+
outline: 'none',
|
|
36
|
+
height: '30px'
|
|
37
|
+
};
|
|
38
|
+
var confirmStyle = {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
width: '20px',
|
|
42
|
+
height: '20px',
|
|
43
|
+
right: '5px',
|
|
44
|
+
top: '5px',
|
|
45
|
+
backgroundColor: SharedStyle.SECONDARY_COLOR.main,
|
|
46
|
+
color: '#FFF',
|
|
47
|
+
transition: 'all 0.1s linear'
|
|
48
|
+
};
|
|
49
|
+
var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
50
|
+
function FormNumberInput(props, context) {
|
|
51
|
+
var _this;
|
|
52
|
+
(0, _classCallCheck2["default"])(this, FormNumberInput);
|
|
53
|
+
_this = _callSuper(this, FormNumberInput, [props, context]);
|
|
54
|
+
_this.state = {
|
|
55
|
+
focus: false,
|
|
56
|
+
valid: true,
|
|
57
|
+
showedValue: props.value,
|
|
58
|
+
disabled: props.disabled === true ? true : false,
|
|
59
|
+
focusOn: false
|
|
60
|
+
};
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
(0, _inherits2["default"])(FormNumberInput, _Component);
|
|
64
|
+
return (0, _createClass2["default"])(FormNumberInput, [{
|
|
65
|
+
key: "componentWillReceiveProps",
|
|
66
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
67
|
+
if (this.props.value !== nextProps.value || this.props.focus !== nextProps.focus) {
|
|
68
|
+
this.setState({
|
|
69
|
+
showedValue: nextProps.value,
|
|
70
|
+
focusOn: nextProps.focus
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (this.props.focus !== nextProps.focus) {
|
|
74
|
+
this.Input.focus();
|
|
75
|
+
this.Input.select();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "render",
|
|
80
|
+
value: function render() {
|
|
81
|
+
var _this2 = this;
|
|
82
|
+
var _this$props = this.props,
|
|
83
|
+
value = _this$props.value,
|
|
84
|
+
min = _this$props.min,
|
|
85
|
+
max = _this$props.max,
|
|
86
|
+
precision = _this$props.precision,
|
|
87
|
+
onChange = _this$props.onChange,
|
|
88
|
+
onValid = _this$props.onValid,
|
|
89
|
+
onInvalid = _this$props.onInvalid,
|
|
90
|
+
style = _this$props.style,
|
|
91
|
+
placeholder = _this$props.placeholder;
|
|
92
|
+
var numericInputStyle = _objectSpread(_objectSpread({}, STYLE_INPUT), style);
|
|
93
|
+
if (this.state.focusOn) numericInputStyle.border = "1px solid ".concat(SharedStyle.SECONDARY_COLOR.main);
|
|
94
|
+
var regexp = new RegExp("^-?([0-9]+)?\\.?([0-9]{0,".concat(precision, "})?$"));
|
|
95
|
+
if (!isNaN(min) && isFinite(min) && this.state.showedValue < min) this.setState({
|
|
96
|
+
showedValue: min
|
|
97
|
+
}); // value = min;
|
|
98
|
+
if (!isNaN(max) && isFinite(max) && this.state.showedValue > max) this.setState({
|
|
99
|
+
showedValue: max
|
|
100
|
+
}); // value = max;
|
|
101
|
+
|
|
102
|
+
var currValue = regexp.test(this.state.showedValue) ? this.state.showedValue : parseFloat(this.state.showedValue).toFixed(precision);
|
|
103
|
+
var different = parseFloat(this.props.value).toFixed(precision) !== parseFloat(this.state.showedValue).toFixed(precision);
|
|
104
|
+
var saveFn = function saveFn(e) {
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
if (_this2.state.valid) {
|
|
107
|
+
var savedValue = _this2.state.showedValue !== '' && _this2.state.showedValue !== '-' ? parseFloat(_this2.state.showedValue) : 0;
|
|
108
|
+
_this2.setState({
|
|
109
|
+
showedValue: savedValue
|
|
110
|
+
});
|
|
111
|
+
onChange({
|
|
112
|
+
target: {
|
|
113
|
+
value: savedValue
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
119
|
+
style: {
|
|
120
|
+
position: 'relative'
|
|
121
|
+
}
|
|
122
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
123
|
+
autoFocus: this.state.focusOn,
|
|
124
|
+
readOnly: this.state.disabled,
|
|
125
|
+
type: "text",
|
|
126
|
+
value: currValue,
|
|
127
|
+
style: numericInputStyle,
|
|
128
|
+
onChange: function onChange(evt) {
|
|
129
|
+
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
130
|
+
if (valid) {
|
|
131
|
+
_this2.setState({
|
|
132
|
+
showedValue: evt.nativeEvent.target.value
|
|
133
|
+
});
|
|
134
|
+
if (onValid) onValid(evt.nativeEvent);
|
|
135
|
+
} else {
|
|
136
|
+
if (onInvalid) onInvalid(evt.nativeEvent);
|
|
137
|
+
}
|
|
138
|
+
_this2.setState({
|
|
139
|
+
valid: valid
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
onFocus: function onFocus(e) {
|
|
143
|
+
return _this2.setState({
|
|
144
|
+
focusOn: true
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
onBlur: function onBlur(e) {
|
|
148
|
+
return _this2.setState({
|
|
149
|
+
focusOn: false
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
ref: function ref(ele) {
|
|
153
|
+
_this2.Input = ele;
|
|
154
|
+
},
|
|
155
|
+
onKeyDown: function onKeyDown(e) {
|
|
156
|
+
var keyCode = e.keyCode || e.which;
|
|
157
|
+
if (keyCode == _constants.KEYBOARD_BUTTON_CODE.ENTER || keyCode == _constants.KEYBOARD_BUTTON_CODE.TAB) {
|
|
158
|
+
saveFn(e);
|
|
159
|
+
_this2.Input.blur();
|
|
160
|
+
}
|
|
161
|
+
if (keyCode == _constants.KEYBOARD_BUTTON_CODE.ESC) {
|
|
162
|
+
_this2.context.projectActions.rollback();
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
placeholder: placeholder
|
|
166
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
|
+
onClick: function onClick(e) {
|
|
168
|
+
if (different) saveFn(e);
|
|
169
|
+
},
|
|
170
|
+
title: this.context.translator.t('Confirm'),
|
|
171
|
+
style: _objectSpread(_objectSpread({}, confirmStyle), {}, {
|
|
172
|
+
visibility: different ? 'visible' : 'hidden',
|
|
173
|
+
opacity: different ? '1' : '0'
|
|
174
|
+
})
|
|
175
|
+
}, /*#__PURE__*/_react["default"].createElement(_md.MdUpdate, {
|
|
176
|
+
style: {
|
|
177
|
+
width: '100%',
|
|
178
|
+
height: '100%',
|
|
179
|
+
padding: '0.2em',
|
|
180
|
+
color: '#FFF'
|
|
181
|
+
}
|
|
182
|
+
})));
|
|
183
|
+
}
|
|
184
|
+
}]);
|
|
185
|
+
}(_react.Component);
|
|
186
|
+
FormNumberInput.propTypes = {
|
|
187
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
188
|
+
style: _propTypes["default"].object,
|
|
189
|
+
onChange: _propTypes["default"].func.isRequired,
|
|
190
|
+
onValid: _propTypes["default"].func,
|
|
191
|
+
onInvalid: _propTypes["default"].func,
|
|
192
|
+
min: _propTypes["default"].number,
|
|
193
|
+
max: _propTypes["default"].number,
|
|
194
|
+
precision: _propTypes["default"].number,
|
|
195
|
+
placeholder: _propTypes["default"].string
|
|
196
|
+
};
|
|
197
|
+
FormNumberInput.contextTypes = {
|
|
198
|
+
translator: _propTypes["default"].object.isRequired,
|
|
199
|
+
projectActions: _propTypes["default"].object.isRequired
|
|
200
|
+
};
|
|
201
|
+
FormNumberInput.defaultProps = {
|
|
202
|
+
value: 0,
|
|
203
|
+
style: {},
|
|
204
|
+
min: Number.MIN_SAFE_INTEGER,
|
|
205
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
206
|
+
precision: 2,
|
|
207
|
+
disabled: false
|
|
208
|
+
};
|
|
209
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = FormSelect;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
var _constants = require("../../constants");
|
|
16
|
+
var _excluded = ["children", "style"];
|
|
17
|
+
var _templateObject;
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
+
var StyledSelect = _styledComponents["default"].select(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\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"])), _constants.TEXT_COLOR_NEUTRAL_3, _constants.DEFAULT_FONT_FAMILY, _constants.SECONDARY_PURPLE_COLOR, _constants.SECONDARY_PURPLE_COLOR);
|
|
20
|
+
function FormSelect(_ref) {
|
|
21
|
+
var children = _ref.children,
|
|
22
|
+
style = _ref.style,
|
|
23
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
24
|
+
return /*#__PURE__*/_react["default"].createElement(StyledSelect, (0, _extends2["default"])({
|
|
25
|
+
type: "text",
|
|
26
|
+
style: style
|
|
27
|
+
}, rest), children);
|
|
28
|
+
}
|
|
29
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = FormNumberInput;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _formTextInput = _interopRequireDefault(require("./form-text-input"));
|
|
12
|
+
var _excluded = ["value", "onChange", "min", "max", "step"];
|
|
13
|
+
var sliderContainerStyle = {
|
|
14
|
+
display: 'inline-block',
|
|
15
|
+
width: '80%',
|
|
16
|
+
marginRight: '5%'
|
|
17
|
+
};
|
|
18
|
+
var sliderStyle = {
|
|
19
|
+
display: 'block',
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '30px'
|
|
22
|
+
};
|
|
23
|
+
var textContainerStyle = {
|
|
24
|
+
display: 'inline-block',
|
|
25
|
+
width: '15%',
|
|
26
|
+
"float": 'right'
|
|
27
|
+
};
|
|
28
|
+
var textStyle = {
|
|
29
|
+
height: '34px',
|
|
30
|
+
textAlign: 'center'
|
|
31
|
+
};
|
|
32
|
+
function FormNumberInput(_ref) {
|
|
33
|
+
var value = _ref.value,
|
|
34
|
+
onChange = _ref.onChange,
|
|
35
|
+
_ref$min = _ref.min,
|
|
36
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
37
|
+
_ref$max = _ref.max,
|
|
38
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
39
|
+
_ref$step = _ref.step,
|
|
40
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
41
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
42
|
+
// Handle both slider and text input changes
|
|
43
|
+
var handleSliderChange = function handleSliderChange(e) {
|
|
44
|
+
onChange(Number(e.target.value));
|
|
45
|
+
};
|
|
46
|
+
var handleTextChange = function handleTextChange(e) {
|
|
47
|
+
var val = e.target.value === '' ? '' : Number(e.target.value);
|
|
48
|
+
onChange(val);
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
|
+
style: sliderContainerStyle
|
|
52
|
+
}, /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({
|
|
53
|
+
type: "range",
|
|
54
|
+
style: sliderStyle,
|
|
55
|
+
min: min,
|
|
56
|
+
max: max,
|
|
57
|
+
step: step,
|
|
58
|
+
value: value,
|
|
59
|
+
onChange: handleSliderChange
|
|
60
|
+
}, rest))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
61
|
+
style: textContainerStyle
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement(_formTextInput["default"], {
|
|
63
|
+
value: value,
|
|
64
|
+
onChange: handleTextChange,
|
|
65
|
+
style: textStyle
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
68
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = FormSubmitButton;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _button = _interopRequireDefault(require("./button"));
|
|
13
|
+
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
14
|
+
var _excluded = ["children"];
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
|
+
var STYLE = {
|
|
17
|
+
borderColor: '#415375',
|
|
18
|
+
backgroundColor: '#415375',
|
|
19
|
+
color: SharedStyle.COLORS.white
|
|
20
|
+
};
|
|
21
|
+
var STYLE_HOVER = {
|
|
22
|
+
borderColor: '#1f3149',
|
|
23
|
+
backgroundColor: '#1f3149',
|
|
24
|
+
color: SharedStyle.COLORS.white
|
|
25
|
+
};
|
|
26
|
+
function FormSubmitButton(_ref) {
|
|
27
|
+
var children = _ref.children,
|
|
28
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], (0, _extends2["default"])({
|
|
30
|
+
type: "submit",
|
|
31
|
+
style: STYLE,
|
|
32
|
+
styleHover: STYLE_HOVER
|
|
33
|
+
}, rest), children);
|
|
34
|
+
}
|
|
35
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
+
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
19
|
+
var _constants = require("../../constants");
|
|
20
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
|
+
var _excluded = ["style"];
|
|
22
|
+
var _templateObject;
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
+
var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: block;\n padding: 15px 10px 12px 0px;\n width: 120px;\n font-family: ", ";\n font-size: 12px;\n font-weight: 600;\n line-height: 17px;\n color: ", ";\n background-color: ", ";\n border: 2px solid;\n text-align: right;\n float: right;\n border-radius: 5px;\n outline: 0;\n :focus {\n border-color: ", ";\n }\n"])), _constants.DEFAULT_FONT_FAMILY, _constants.TEXT_COLOR_NEUTRAL_3, _constants.BG_COLOR_0, _constants.SECONDARY_PURPLE_COLOR);
|
|
27
|
+
var FormTextInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
28
|
+
function FormTextInput(props) {
|
|
29
|
+
var _this;
|
|
30
|
+
(0, _classCallCheck2["default"])(this, FormTextInput);
|
|
31
|
+
_this = _callSuper(this, FormTextInput, [props]);
|
|
32
|
+
_this.state = {
|
|
33
|
+
focus: false
|
|
34
|
+
};
|
|
35
|
+
_this.input = /*#__PURE__*/_react["default"].createRef(null);
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
(0, _inherits2["default"])(FormTextInput, _Component);
|
|
39
|
+
return (0, _createClass2["default"])(FormTextInput, [{
|
|
40
|
+
key: "componentDidMount",
|
|
41
|
+
value: function componentDidMount() {
|
|
42
|
+
if (this.input.current) {
|
|
43
|
+
this.input.current.select();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "render",
|
|
48
|
+
value: function render() {
|
|
49
|
+
var _this2 = this;
|
|
50
|
+
var _this$props = this.props,
|
|
51
|
+
style = _this$props.style,
|
|
52
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
|
|
53
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInput, (0, _extends2["default"])({
|
|
54
|
+
ref: this.input,
|
|
55
|
+
onFocus: function onFocus(e) {
|
|
56
|
+
return _this2.setState({
|
|
57
|
+
focus: true
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
onBlur: function onBlur(e) {
|
|
61
|
+
return _this2.setState({
|
|
62
|
+
focus: false
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
style: style
|
|
66
|
+
// autoFocus
|
|
67
|
+
,
|
|
68
|
+
type: "text"
|
|
69
|
+
}, rest, {
|
|
70
|
+
maxLength: _constants.PROJECT_NAME_LENGTH_LIMIT
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
}]);
|
|
74
|
+
}(_react.Component);
|
|
75
|
+
FormTextInput.defaultProps = {
|
|
76
|
+
style: {}
|
|
77
|
+
};
|
|
78
|
+
module.exports = exports.default;
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _reactIf = _interopRequireDefault(require("../../utils/react-if"));
|
|
12
12
|
var sharedStyles = _interopRequireWildcard(require("../../shared-style"));
|
|
13
|
-
var _useAppContext2 = require("../../useAppContext");
|
|
14
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
14
|
var cx = 0;
|
|
16
15
|
var cy = 0;
|
|
@@ -20,13 +19,12 @@ var STYLE_CIRCLE = {
|
|
|
20
19
|
stroke: sharedStyles.MATERIAL_COLORS[500].orange,
|
|
21
20
|
cursor: 'default'
|
|
22
21
|
};
|
|
23
|
-
function Group(_ref) {
|
|
22
|
+
function Group(_ref, _ref2) {
|
|
24
23
|
var layer = _ref.layer,
|
|
25
24
|
group = _ref.group,
|
|
26
25
|
scene = _ref.scene,
|
|
27
26
|
catalog = _ref.catalog;
|
|
28
|
-
var
|
|
29
|
-
translator = _useAppContext.translator;
|
|
27
|
+
var translator = _ref2.translator;
|
|
30
28
|
return /*#__PURE__*/_react["default"].createElement("g", {
|
|
31
29
|
"data-element-root": true,
|
|
32
30
|
"data-prototype": group.prototype,
|
|
@@ -59,4 +57,7 @@ Group.propTypes = {
|
|
|
59
57
|
scene: _propTypes["default"].object.isRequired,
|
|
60
58
|
catalog: _propTypes["default"].object.isRequired
|
|
61
59
|
};
|
|
60
|
+
Group.contextTypes = {
|
|
61
|
+
translator: _propTypes["default"].object.isRequired
|
|
62
|
+
};
|
|
62
63
|
module.exports = exports.default;
|