kitchen-simulator 3.1.2 → 4.0.0-react-18
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 +0 -3
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +15 -25
- package/es/LiteRenderer.js +2 -5
- package/es/actions/export.js +12 -25
- package/es/catalog/catalog.js +5 -21
- package/es/components/content.js +2 -5
- package/es/components/export.js +6 -4
- package/es/components/style/export.js +2 -28
- package/es/components/style/form-number-input.js +22 -11
- package/es/components/viewer2d/group.js +4 -5
- package/es/components/viewer2d/item.js +4 -5
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +47 -17
- package/es/components/viewer2d/rulerX.js +0 -3
- package/es/components/viewer2d/rulerY.js +0 -3
- package/es/components/viewer2d/scene.js +1 -4
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/viewer2d.js +43 -28
- package/es/components/viewer3d/viewer3d-first-person.js +0 -8
- package/es/components/viewer3d/viewer3d.js +0 -9
- package/es/devLiteRenderer.js +148 -317
- package/es/index.js +12 -4
- package/es/mocks/appliancePayload.json +27 -0
- package/es/mocks/cabinetPayload.json +1914 -0
- package/es/mocks/cabinetPayload2.json +76 -0
- package/es/mocks/dataBundle2.json +4 -0
- package/es/mocks/distancePayload.json +6 -0
- package/es/mocks/doorStylePayload2.json +84 -0
- package/es/mocks/furnishingPayload.json +23 -0
- package/es/mocks/itemCDSPayload.json +27 -0
- package/es/mocks/lightingPayload.json +23 -0
- package/es/mocks/mockProps.json +43 -0
- package/es/mocks/mockProps2.json +9 -0
- package/es/mocks/moldingPayload.json +19 -0
- package/es/mocks/projectItemsCatalog.json +133 -0
- package/es/mocks/rectangleShape.json +238 -0
- package/es/mocks/replaceCabinetPayload.json +81 -0
- package/es/mocks/roomShapePayload.json +5 -0
- package/es/useAppContext.js +8 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +15 -25
- package/lib/LiteRenderer.js +2 -5
- package/lib/actions/export.js +39 -35
- package/lib/catalog/catalog.js +4 -20
- package/lib/components/content.js +2 -5
- package/lib/components/export.js +26 -6
- package/lib/components/style/export.js +1 -105
- package/lib/components/style/form-number-input.js +22 -11
- package/lib/components/viewer2d/group.js +4 -5
- package/lib/components/viewer2d/item.js +4 -5
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +47 -17
- package/lib/components/viewer2d/rulerX.js +0 -3
- package/lib/components/viewer2d/rulerY.js +0 -3
- package/lib/components/viewer2d/scene.js +1 -4
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +42 -27
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -8
- package/lib/components/viewer3d/viewer3d.js +0 -9
- package/lib/devLiteRenderer.js +147 -316
- package/lib/index.js +12 -4
- package/lib/mocks/appliancePayload.json +27 -0
- package/lib/mocks/cabinetPayload.json +1914 -0
- package/lib/mocks/cabinetPayload2.json +76 -0
- package/lib/mocks/dataBundle2.json +4 -0
- package/lib/mocks/distancePayload.json +6 -0
- package/lib/mocks/doorStylePayload2.json +84 -0
- package/lib/mocks/furnishingPayload.json +23 -0
- package/lib/mocks/itemCDSPayload.json +27 -0
- package/lib/mocks/lightingPayload.json +23 -0
- package/lib/mocks/mockProps.json +43 -0
- package/lib/mocks/mockProps2.json +9 -0
- package/lib/mocks/moldingPayload.json +19 -0
- package/lib/mocks/projectItemsCatalog.json +133 -0
- package/lib/mocks/rectangleShape.json +238 -0
- package/lib/mocks/replaceCabinetPayload.json +81 -0
- package/lib/mocks/roomShapePayload.json +5 -0
- package/lib/useAppContext.js +16 -0
- package/package.json +16 -21
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-submit-button.js +0 -25
- package/es/components/style/form-text-input.js +0 -69
- package/es/plugins/SVGLoader.js +0 -1414
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/plugins/SVGLoader.js +0 -1419
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -1,209 +0,0 @@
|
|
|
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;
|
|
@@ -1,29 +0,0 @@
|
|
|
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;
|
|
@@ -1,68 +0,0 @@
|
|
|
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;
|
|
@@ -1,35 +0,0 @@
|
|
|
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;
|
|
@@ -1,78 +0,0 @@
|
|
|
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;
|