kitchen-simulator 5.0.0-new-api → 5.0.0-new-api.2
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/es/LiteKitchenConfigurator.js +1 -1
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/utils/exporter.js +2 -0
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +7 -5
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +3 -3
- package/es/devLiteRenderer.js +119 -61
- package/es/events/external/handleExternalEvent.js +140 -0
- package/es/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +17 -563
- package/es/events/external/handlers.addItem.js +47 -0
- package/es/events/external/handlers.changeDoorStyle.js +131 -0
- package/es/events/external/handlers.elementOps.js +8 -0
- package/es/events/external/handlers.finishing.js +26 -0
- package/es/events/external/handlers.hole.js +4 -0
- package/es/events/external/handlers.loadProject.js +117 -0
- package/es/events/external/handlers.molding.js +24 -0
- package/es/events/external/handlers.projectLifecycle.js +11 -0
- package/es/events/external/handlers.projectSettings.js +32 -0
- package/es/events/external/handlers.replaceCabinet.js +41 -0
- package/es/events/external/handlers.roomShape.js +8 -0
- package/es/events/external/handlers.syncScene.js +21 -0
- package/es/events/external/handlers.updateSelectedElements.js +11 -0
- package/es/events/external/handlers.viewMode.js +11 -0
- package/es/events/external/handlers.viewerNavigation.js +108 -0
- package/es/events/external/handlers.wall.js +7 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/molding.js +6 -20
- package/lib/LiteKitchenConfigurator.js +2 -2
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +7 -5
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +8 -8
- package/lib/devLiteRenderer.js +118 -60
- package/lib/events/external/handleExternalEvent.js +147 -0
- package/lib/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +14 -557
- package/lib/events/external/handlers.addItem.js +54 -0
- package/lib/events/external/handlers.changeDoorStyle.js +138 -0
- package/lib/events/external/handlers.elementOps.js +15 -0
- package/lib/events/external/handlers.finishing.js +32 -0
- package/lib/events/external/handlers.hole.js +10 -0
- package/lib/events/external/handlers.loadProject.js +124 -0
- package/lib/events/external/handlers.molding.js +31 -0
- package/lib/events/external/handlers.projectLifecycle.js +19 -0
- package/lib/events/external/handlers.projectSettings.js +38 -0
- package/lib/events/external/handlers.replaceCabinet.js +48 -0
- package/lib/events/external/handlers.roomShape.js +14 -0
- package/lib/events/external/handlers.syncScene.js +27 -0
- package/lib/events/external/handlers.updateSelectedElements.js +17 -0
- package/lib/events/external/handlers.viewMode.js +19 -0
- package/lib/events/external/handlers.viewerNavigation.js +117 -0
- package/lib/events/external/handlers.wall.js +13 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/molding.js +6 -20
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- 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/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- 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-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- 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/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- 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-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var tableStyle = {
|
|
2
|
-
width: '100%',
|
|
3
|
-
borderSpacing: '2px 0',
|
|
4
|
-
marginBottom: '2px'
|
|
5
|
-
};
|
|
6
|
-
var firstTdStyle = {
|
|
7
|
-
width: '6em',
|
|
8
|
-
textTransform: 'capitalize'
|
|
9
|
-
};
|
|
10
|
-
var PropertyStyle = {
|
|
11
|
-
tableStyle: tableStyle,
|
|
12
|
-
firstTdStyle: firstTdStyle
|
|
13
|
-
};
|
|
14
|
-
export default PropertyStyle;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
5
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
|
-
var FuseUtils = /*#__PURE__*/function () {
|
|
8
|
-
function FuseUtils() {
|
|
9
|
-
_classCallCheck(this, FuseUtils);
|
|
10
|
-
}
|
|
11
|
-
return _createClass(FuseUtils, null, [{
|
|
12
|
-
key: "filterArrayByString",
|
|
13
|
-
value: function filterArrayByString(mainArr, searchText) {
|
|
14
|
-
var _this = this;
|
|
15
|
-
if (searchText === '') {
|
|
16
|
-
return mainArr;
|
|
17
|
-
}
|
|
18
|
-
searchText = searchText.toLowerCase();
|
|
19
|
-
return mainArr.filter(function (itemObj) {
|
|
20
|
-
return _this.searchInObj(itemObj, searchText);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}, {
|
|
24
|
-
key: "searchInObj",
|
|
25
|
-
value: function searchInObj(itemObj, searchText) {
|
|
26
|
-
for (var prop in itemObj) {
|
|
27
|
-
if (!itemObj.hasOwnProperty(prop)) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
var value = itemObj[prop];
|
|
31
|
-
if (typeof value === 'string') {
|
|
32
|
-
if (this.searchInString(value, searchText)) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
} else if (Array.isArray(value)) {
|
|
36
|
-
if (this.searchInArray(value, searchText)) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (_typeof(value) === 'object') {
|
|
41
|
-
if (this.searchInObj(value, searchText)) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "searchInArray",
|
|
49
|
-
value: function searchInArray(arr, searchText) {
|
|
50
|
-
var _iterator = _createForOfIteratorHelper(arr),
|
|
51
|
-
_step;
|
|
52
|
-
try {
|
|
53
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
54
|
-
var value = _step.value;
|
|
55
|
-
if (typeof value === 'string') {
|
|
56
|
-
if (this.searchInString(value, searchText)) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (_typeof(value) === 'object') {
|
|
61
|
-
if (this.searchInObj(value, searchText)) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
_iterator.e(err);
|
|
68
|
-
} finally {
|
|
69
|
-
_iterator.f();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "searchInString",
|
|
74
|
-
value: function searchInString(value, searchText) {
|
|
75
|
-
return value.toLowerCase().includes(searchText);
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
}();
|
|
79
|
-
export default FuseUtils;
|
package/es/class/FuseUtils.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
5
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
|
-
var FuseUtils = /*#__PURE__*/function () {
|
|
8
|
-
function FuseUtils() {
|
|
9
|
-
_classCallCheck(this, FuseUtils);
|
|
10
|
-
}
|
|
11
|
-
return _createClass(FuseUtils, null, [{
|
|
12
|
-
key: "filterArrayByString",
|
|
13
|
-
value: function filterArrayByString(mainArr, searchText) {
|
|
14
|
-
var _this = this;
|
|
15
|
-
if (searchText === '') {
|
|
16
|
-
return mainArr;
|
|
17
|
-
}
|
|
18
|
-
searchText = searchText.toLowerCase();
|
|
19
|
-
return mainArr.filter(function (itemObj) {
|
|
20
|
-
return _this.searchInObj(itemObj, searchText);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}, {
|
|
24
|
-
key: "searchInObj",
|
|
25
|
-
value: function searchInObj(itemObj, searchText) {
|
|
26
|
-
for (var prop in itemObj) {
|
|
27
|
-
if (!itemObj.hasOwnProperty(prop)) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
var value = itemObj[prop];
|
|
31
|
-
if (typeof value === 'string') {
|
|
32
|
-
if (this.searchInString(value, searchText)) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
} else if (Array.isArray(value)) {
|
|
36
|
-
if (this.searchInArray(value, searchText)) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (_typeof(value) === 'object') {
|
|
41
|
-
if (this.searchInObj(value, searchText)) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "searchInArray",
|
|
49
|
-
value: function searchInArray(arr, searchText) {
|
|
50
|
-
var _iterator = _createForOfIteratorHelper(arr),
|
|
51
|
-
_step;
|
|
52
|
-
try {
|
|
53
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
54
|
-
var value = _step.value;
|
|
55
|
-
if (typeof value === 'string') {
|
|
56
|
-
if (this.searchInString(value, searchText)) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (_typeof(value) === 'object') {
|
|
61
|
-
if (this.searchInObj(value, searchText)) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
_iterator.e(err);
|
|
68
|
-
} finally {
|
|
69
|
-
_iterator.f();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "searchInString",
|
|
74
|
-
value: function searchInString(value, searchText) {
|
|
75
|
-
return value.toLowerCase().includes(searchText);
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
}();
|
|
79
|
-
export default FuseUtils;
|
|
@@ -1,106 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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,20 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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,200 +0,0 @@
|
|
|
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
|
-
};
|