kitchen-simulator 1.1.1-test.6 → 1.1.1-test.60
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/KitchenConfigurator.js +8 -15
- package/es/KitchenConfiguratorApp.js +11 -27
- package/es/actions/holes-actions.js +1 -1
- package/es/actions/items-actions.js +1 -1
- package/es/actions/lines-actions.js +1 -1
- package/es/actions/project-actions.js +1 -1
- package/es/actions/scene-actions.js +1 -1
- package/es/actions/vertices-actions.js +1 -1
- package/es/actions/viewer2d-actions.js +1 -1
- package/es/actions/viewer3d-actions.js +1 -1
- package/es/catalog/areas/area/planner-element.js +10 -7
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/holes/export.js +13 -13
- package/es/catalog/lines/wall/planner-element.js +13 -10
- package/es/catalog/properties/property-checkbox.js +63 -18
- package/es/catalog/properties/property-enum.js +51 -9
- package/es/catalog/properties/property-lenght-measure.js +2 -2
- package/es/catalog/properties/property-length-measure.js +58 -9
- package/es/catalog/properties/property-length-measure_hole.js +2 -2
- package/es/catalog/utils/exporter.js +1 -1
- package/es/catalog/utils/item-loader.js +1 -1
- package/es/catalog/utils/mtl-loader.js +3 -2
- package/es/catalog/utils/obj-loader.js +3 -2
- package/es/class/area.js +1 -1
- package/es/class/group.js +3 -3
- package/es/class/hole.js +5 -6
- package/es/class/item.js +8 -10
- package/es/class/layer.js +2 -2
- package/es/class/project.js +4 -4
- package/es/components/content.js +1 -0
- package/es/components/disclaimer/disclaimer.js +66 -86
- package/es/components/style/form-number-input.js +31 -7
- package/es/components/style/form-select.js +56 -8
- package/es/components/style/form-slider.js +22 -6
- package/es/components/style/form-text-input.js +31 -12
- package/es/components/viewer2d/area.js +4 -4
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/es/components/viewer2d/item.js +3 -5
- package/es/components/viewer2d/line.js +2 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/scene.js +2 -2
- package/es/components/viewer2d/utils.js +37 -1
- package/es/components/viewer2d/viewer2d.js +10 -4
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +6 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
- package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/ruler-utils/scene3D.js +2 -3
- package/es/components/viewer3d/scene-creator.js +1 -1
- package/es/components/viewer3d/viewer3d.js +12 -13
- package/es/index.js +20 -14
- package/es/models.js +4 -3
- package/es/plugins/keyboard.js +2 -2
- package/es/reducers/holes-reducer.js +1 -1
- package/es/reducers/items-reducer.js +2 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -2
- package/es/reducers/scene-reducer.js +1 -1
- package/es/reducers/user-reducer.js +1 -2
- package/es/reducers/vertices-reducer.js +1 -1
- package/es/reducers/viewer2d-reducer.js +2 -2
- package/es/reducers/viewer3d-reducer.js +2 -2
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/geometry.js +4 -4
- package/es/utils/get-edges-of-subgraphs.js +2 -1
- package/es/utils/graph-cycles.js +2 -3
- package/es/utils/graph.js +2 -1
- package/es/utils/helper.js +1 -69
- package/es/utils/id-broker.js +2 -2
- package/es/utils/molding.js +34 -34
- package/lib/KitchenConfigurator.js +33 -40
- package/lib/KitchenConfiguratorApp.js +34 -49
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/holes/export.js +13 -13
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/properties/property-checkbox.js +64 -19
- package/lib/catalog/properties/property-enum.js +49 -7
- package/lib/catalog/properties/property-lenght-measure.js +3 -3
- package/lib/catalog/properties/property-length-measure.js +60 -11
- package/lib/catalog/properties/property-length-measure_hole.js +3 -3
- package/lib/catalog/utils/exporter.js +5 -6
- package/lib/catalog/utils/item-loader.js +20 -21
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/item.js +13 -16
- package/lib/components/content.js +1 -0
- package/lib/components/disclaimer/disclaimer.js +66 -86
- package/lib/components/style/form-number-input.js +30 -6
- package/lib/components/style/form-select.js +54 -8
- package/lib/components/style/form-slider.js +22 -6
- package/lib/components/style/form-text-input.js +30 -12
- package/lib/components/viewer2d/area.js +5 -5
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/lib/components/viewer2d/item.js +7 -8
- package/lib/components/viewer2d/line.js +2 -5
- package/lib/components/viewer2d/ruler.js +6 -7
- package/lib/components/viewer2d/rulerDist.js +4 -4
- package/lib/components/viewer2d/scene.js +1 -1
- package/lib/components/viewer2d/utils.js +37 -0
- package/lib/components/viewer2d/viewer2d.js +25 -17
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
- package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
- package/lib/components/viewer3d/ruler-utils/scene3D.js +3 -4
- package/lib/components/viewer3d/scene-creator.js +24 -24
- package/lib/components/viewer3d/viewer3d.js +17 -17
- package/lib/index.js +22 -88
- package/lib/models.js +7 -7
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/geometry.js +9 -10
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph.js +9 -3
- package/lib/utils/helper.js +7 -76
- package/lib/utils/id-broker.js +2 -2
- package/lib/utils/molding.js +52 -52
- package/package.json +34 -70
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
|
@@ -1,19 +1,51 @@
|
|
|
1
1
|
var _excluded = ["hook", "label"];
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
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
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
4
9
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
10
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
7
11
|
import React from 'react';
|
|
8
12
|
import PropTypes from 'prop-types';
|
|
9
|
-
import {
|
|
10
|
-
import convert from
|
|
11
|
-
import {
|
|
13
|
+
import { BASE_CABINET_LAYOUTPOS, DEFAULT_FONT_FAMILY, TALL_CABINET_LAYOUTPOS, TEXT_COLOR_NEUTRAL_0, UNIT_CENTIMETER, UNIT_INCH } from "../../constants";
|
|
14
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
15
|
+
import { FormNumberInput } from "../../components/style/export";
|
|
12
16
|
import { Map } from 'immutable';
|
|
13
17
|
import { toFixedFloat } from "../../utils/math";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
var styles = {
|
|
19
|
+
distanceFloorWrapper: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
marginTop: 3
|
|
23
|
+
},
|
|
24
|
+
distanceFloorTitle: function distanceFloorTitle(fontSize) {
|
|
25
|
+
return {
|
|
26
|
+
marginRight: 'auto',
|
|
27
|
+
width: 110,
|
|
28
|
+
color: TEXT_COLOR_NEUTRAL_0,
|
|
29
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
30
|
+
fontSize: fontSize,
|
|
31
|
+
fontWeight: 400,
|
|
32
|
+
lineHeight: '15px',
|
|
33
|
+
textAlign: 'left'
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Responsive font size logic
|
|
39
|
+
function getFontSize() {
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
|
+
var w = window.innerWidth;
|
|
42
|
+
if (w <= 1024) return 11;
|
|
43
|
+
if (w <= 1366) return 13;
|
|
44
|
+
if (w <= 1440) return 16;
|
|
45
|
+
return 16;
|
|
46
|
+
}
|
|
47
|
+
return 13;
|
|
48
|
+
}
|
|
17
49
|
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
18
50
|
var value = _ref.value,
|
|
19
51
|
onUpdate = _ref.onUpdate,
|
|
@@ -58,7 +90,24 @@ export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
58
90
|
}
|
|
59
91
|
return onUpdate(merged);
|
|
60
92
|
};
|
|
61
|
-
|
|
93
|
+
var _React$useState = React.useState(getFontSize()),
|
|
94
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
95
|
+
fontSize = _React$useState2[0],
|
|
96
|
+
setFontSize = _React$useState2[1];
|
|
97
|
+
React.useEffect(function () {
|
|
98
|
+
function handleResize() {
|
|
99
|
+
setFontSize(getFontSize());
|
|
100
|
+
}
|
|
101
|
+
window.addEventListener('resize', handleResize);
|
|
102
|
+
return function () {
|
|
103
|
+
return window.removeEventListener('resize', handleResize);
|
|
104
|
+
};
|
|
105
|
+
}, []);
|
|
106
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
style: styles.distanceFloorWrapper
|
|
108
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
109
|
+
style: styles.distanceFloorTitle(fontSize)
|
|
110
|
+
}, label), /*#__PURE__*/React.createElement(FormNumberInput, _extends({
|
|
62
111
|
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
63
112
|
value: convert(_length).from('in').to(unit),
|
|
64
113
|
onChange: function onChange(event) {
|
|
@@ -4,8 +4,8 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import {
|
|
8
|
-
import convert from
|
|
7
|
+
import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "../../constants";
|
|
8
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
9
9
|
import { FormLabel, FormNumberInput1, FormSelect } from "../../components/style/export";
|
|
10
10
|
import { Map } from 'immutable';
|
|
11
11
|
import { toFixedFloat } from "../../utils/math";
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import convert from
|
|
7
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
8
8
|
export default function (_ref) {
|
|
9
9
|
var itemID = _ref.itemID,
|
|
10
10
|
type = _ref.type,
|
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
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; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
-
import convert from
|
|
13
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
14
14
|
import { fromJS, Map } from 'immutable';
|
|
15
15
|
import React, { useState } from 'react';
|
|
16
16
|
import * as Three from 'three';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author angelxuanchang
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var THREE = window.THREE
|
|
7
|
+
var THREE = window.THREE;
|
|
8
8
|
var MTLLoader;
|
|
9
9
|
MTLLoader = function MTLLoader(manager) {
|
|
10
10
|
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
@@ -354,4 +354,5 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
354
354
|
return texture;
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
export default MTLLoader;
|
|
358
|
+
export { MTLLoader };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author mrdoob / http://mrdoob.com/
|
|
3
3
|
*/
|
|
4
|
-
var THREE = window.THREE
|
|
4
|
+
var THREE = window.THREE;
|
|
5
5
|
var OBJLoader;
|
|
6
6
|
OBJLoader = function () {
|
|
7
7
|
// o object_name | g group_name
|
|
@@ -473,4 +473,5 @@ OBJLoader = function () {
|
|
|
473
473
|
};
|
|
474
474
|
return OBJLoader;
|
|
475
475
|
}();
|
|
476
|
-
|
|
476
|
+
export default OBJLoader;
|
|
477
|
+
export { OBJLoader };
|
package/es/class/area.js
CHANGED
|
@@ -8,7 +8,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
import { fromJS } from 'immutable';
|
|
11
|
-
import { Layer, Vertex
|
|
11
|
+
import { Group, Layer, Vertex } from "./export";
|
|
12
12
|
import { IDBroker, NameGenerator } from "../utils/export";
|
|
13
13
|
var Area = /*#__PURE__*/function () {
|
|
14
14
|
function Area() {
|
package/es/class/group.js
CHANGED
|
@@ -10,10 +10,10 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
10
10
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { Area, Hole, Item, Layer, Line, Project, Vertex } from "./export";
|
|
14
|
+
import { List, Map } from 'immutable';
|
|
15
15
|
import { Group as GroupModel } from "../models";
|
|
16
|
-
import {
|
|
16
|
+
import { GeometryUtils, IDBroker } from "../utils/export";
|
|
17
17
|
var Group = /*#__PURE__*/function () {
|
|
18
18
|
function Group() {
|
|
19
19
|
_classCallCheck(this, Group);
|
package/es/class/hole.js
CHANGED
|
@@ -4,12 +4,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
4
4
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { GeometryUtils } from "../utils/export";
|
|
7
|
+
import { fromJS, List, Map } from 'immutable';
|
|
8
|
+
import { Group, Layer } from "./export";
|
|
9
|
+
import { GeometryUtils, IDBroker } from "../utils/export";
|
|
10
|
+
import { addLineSegmentSnap, nearestSnap } from "../utils/snap";
|
|
11
|
+
import { MODE_DRAGGING_HOLE, MODE_DRAGGING_HOLE_3D, MODE_DRAWING_HOLE, MODE_DRAWING_HOLE_3D, MODE_IDLE, MODE_IDLE_3D } from "../constants";
|
|
13
12
|
var Hole = /*#__PURE__*/function () {
|
|
14
13
|
function Hole() {
|
|
15
14
|
_classCallCheck(this, Hole);
|
package/es/class/item.js
CHANGED
|
@@ -13,14 +13,12 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
13
13
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
import convert from
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import { MODE_IDLE, MODE_IDLE_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_DRAGGING_ITEM, MODE_DRAGGING_ITEM_3D, MODE_ROTATING_ITEM, MODE_ROTATING_ITEM_3D, MOLDING_LOCATIONS, INSTALLATION_SUFFIX_TYPE } from "../constants";
|
|
16
|
+
import { convert } from "../utils/convert-units-lite";
|
|
17
|
+
import { Group, Hole, Layer } from "./export";
|
|
18
|
+
import { GeometryUtils, IDBroker, MoldingUtils, NameGenerator } from "../utils/export";
|
|
19
|
+
import { fromJS, Map } from 'immutable';
|
|
20
|
+
import { INSTALLATION_SUFFIX_TYPE, MODE_DRAGGING_ITEM, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM, MODE_ROTATING_ITEM_3D, MOLDING_LOCATIONS } from "../constants";
|
|
22
21
|
import { debugUtil } from "../utils/helper";
|
|
23
|
-
import { isUndefined } from 'util';
|
|
24
22
|
import { hasMoldingLayout } from "../utils/molding";
|
|
25
23
|
import { getInstallationSuffix } from "../components/viewer2d/utils";
|
|
26
24
|
var allItemRect;
|
|
@@ -726,7 +724,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
726
724
|
value: function beginDraggingItem(state, layerID, itemID, x, y) {
|
|
727
725
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
728
726
|
time1 = debugUtil();
|
|
729
|
-
if (
|
|
727
|
+
if (!item) return;
|
|
730
728
|
state = state.merge({
|
|
731
729
|
mode: MODE_DRAGGING_ITEM,
|
|
732
730
|
draggingSupport: Map({
|
|
@@ -747,7 +745,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
747
745
|
value: function beginDraggingItem3D(state, layerID, itemID, x, y) {
|
|
748
746
|
var item = state.getIn(['scene', 'layers', layerID, 'items', itemID]);
|
|
749
747
|
state = state.setIn(['scene', 'isEndDragging'], false);
|
|
750
|
-
if (
|
|
748
|
+
if (!item) return {
|
|
751
749
|
updatedState: state
|
|
752
750
|
};
|
|
753
751
|
state = state.merge({
|
|
@@ -780,7 +778,7 @@ var Item = /*#__PURE__*/function () {
|
|
|
780
778
|
var diffX = startPointX - x;
|
|
781
779
|
var diffY = startPointY - y;
|
|
782
780
|
var item = scene.getIn(['layers', layerID, 'items', itemID]);
|
|
783
|
-
if (
|
|
781
|
+
if (!item) return {
|
|
784
782
|
updatedState: state
|
|
785
783
|
};
|
|
786
784
|
var tX = originalX - diffX;
|
package/es/class/layer.js
CHANGED
|
@@ -5,8 +5,8 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { List } from 'immutable';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Area, Hole, Item, Line, Project, Vertex } from "./export";
|
|
9
|
+
import { GeometryUtils, GraphInnerCycles, IDBroker } from "../utils/export";
|
|
10
10
|
import { Layer as LayerModel } from "../models";
|
|
11
11
|
import { isEmpty } from "../utils/helper";
|
|
12
12
|
var sameSet = function sameSet(set1, set2) {
|
package/es/class/project.js
CHANGED
|
@@ -7,12 +7,12 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
7
7
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
import {
|
|
11
|
-
import { MODE_VIEWING_CATALOG, MODE_CONFIGURING_PROJECT, MODE_IDLE, MODE_DRAWING_ITEM_3D, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_LINE, MODE_WAITING_DRAWING_LINE, MODE_DRAWING_HOLE, ARRAY_3D_MODES, END_DRAWING_LINE } from "../constants";
|
|
10
|
+
import { List, Map } from 'immutable';
|
|
12
11
|
import * as constants from "../constants";
|
|
13
|
-
import {
|
|
12
|
+
import { ARRAY_3D_MODES, END_DRAWING_LINE, MODE_CONFIGURING_PROJECT, MODE_DRAWING_HOLE, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_DRAWING_LINE, MODE_IDLE, MODE_IDLE_3D, MODE_VIEWING_CATALOG, MODE_WAITING_DRAWING_LINE } from "../constants";
|
|
13
|
+
import { Catalog, Scene, State } from "../models";
|
|
14
14
|
import { GeometryUtils, history } from "../utils/export";
|
|
15
|
-
import {
|
|
15
|
+
import { Area, Group, Hole, HorizontalGuide, Item, Layer, Line, VerticalGuide } from "../class/export";
|
|
16
16
|
import * as viewer2DActions from "../actions/viewer2d-actions";
|
|
17
17
|
import { isEmpty } from "../utils/helper";
|
|
18
18
|
var Project = /*#__PURE__*/function () {
|
package/es/components/content.js
CHANGED
|
@@ -17,6 +17,7 @@ export default function Content(_ref, _ref2) {
|
|
|
17
17
|
catalog = _ref.catalog;
|
|
18
18
|
var projectActions = _ref2.projectActions;
|
|
19
19
|
var mode = state.get('mode');
|
|
20
|
+
console.log('mode =>', mode);
|
|
20
21
|
switch (mode) {
|
|
21
22
|
// this mode is when view elevation
|
|
22
23
|
case constants.MODE_ELEVATION_VIEW:
|
|
@@ -1,80 +1,62 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
borderRadius: 100,
|
|
61
|
-
padding: '16px 72px',
|
|
62
|
-
textTransform: 'none',
|
|
63
|
-
fontWeight: 500,
|
|
64
|
-
fontSize: '1rem',
|
|
65
|
-
'&:hover': {
|
|
66
|
-
backgroundColor: '#7c3aed'
|
|
67
|
-
},
|
|
68
|
-
'&:active': {
|
|
69
|
-
backgroundColor: '#5a25c2'
|
|
70
|
-
},
|
|
71
|
-
'&:disabled': {
|
|
72
|
-
backgroundColor: '#F3E5F5',
|
|
73
|
-
color: '#1D1B20'
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
});
|
|
2
|
+
var styles = {
|
|
3
|
+
root: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
justifyContent: 'center',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
backgroundColor: '#D1C4E9',
|
|
8
|
+
background: 'url("/assets/img/svg/disclaimer/background.svg") no-repeat center',
|
|
9
|
+
backgroundSize: 'cover',
|
|
10
|
+
padding: '16px',
|
|
11
|
+
height: '100dvh',
|
|
12
|
+
width: '100dvw'
|
|
13
|
+
},
|
|
14
|
+
card: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
backgroundColor: '#fff',
|
|
19
|
+
borderRadius: 24,
|
|
20
|
+
width: '85vw',
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
boxShadow: '0 8px 20px rgba(0,0,0,0.08)',
|
|
23
|
+
height: 'fit-content',
|
|
24
|
+
opacity: '90%',
|
|
25
|
+
gap: '1rem',
|
|
26
|
+
padding: '1.5rem',
|
|
27
|
+
maxWidth: '364px'
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
fontSize: '1.5rem',
|
|
32
|
+
lineHeight: '133%',
|
|
33
|
+
letterSpacing: '0px',
|
|
34
|
+
textAlign: 'center',
|
|
35
|
+
verticalAlign: 'middle',
|
|
36
|
+
maxWidth: '200px'
|
|
37
|
+
},
|
|
38
|
+
body: {
|
|
39
|
+
fontWeight: 400,
|
|
40
|
+
fontStyle: 'normal',
|
|
41
|
+
fontSize: '0.875rem',
|
|
42
|
+
lineHeight: '143%',
|
|
43
|
+
letterSpacing: '0.17px',
|
|
44
|
+
color: '#49454F',
|
|
45
|
+
maxWidth: '90%'
|
|
46
|
+
},
|
|
47
|
+
button: {
|
|
48
|
+
marginTop: '0.5rem',
|
|
49
|
+
backgroundColor: '#6750A4',
|
|
50
|
+
color: '#fff',
|
|
51
|
+
borderRadius: 100,
|
|
52
|
+
padding: '16px 72px',
|
|
53
|
+
textTransform: 'none',
|
|
54
|
+
fontWeight: 500,
|
|
55
|
+
fontSize: '1rem',
|
|
56
|
+
border: 'none',
|
|
57
|
+
cursor: 'pointer'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
78
60
|
export default function DisclaimerScreen(_ref) {
|
|
79
61
|
var _ref$open = _ref.open,
|
|
80
62
|
open = _ref$open === void 0 ? true : _ref$open,
|
|
@@ -85,7 +67,6 @@ export default function DisclaimerScreen(_ref) {
|
|
|
85
67
|
message = _ref$message === void 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, "We\u2019re adding the finishing touches to the mobile version.", /*#__PURE__*/React.createElement("br", null), "In the meantime, try our desktop version to start designing your dream room.") : _ref$message,
|
|
86
68
|
_ref$buttonText = _ref.buttonText,
|
|
87
69
|
buttonText = _ref$buttonText === void 0 ? 'Close' : _ref$buttonText;
|
|
88
|
-
var classes = useStyles();
|
|
89
70
|
useEffect(function () {
|
|
90
71
|
var viewportMeta = document.querySelector('meta[name="viewport"]');
|
|
91
72
|
if (!viewportMeta) {
|
|
@@ -97,21 +78,20 @@ export default function DisclaimerScreen(_ref) {
|
|
|
97
78
|
}, []);
|
|
98
79
|
if (!open) return null;
|
|
99
80
|
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
|
|
81
|
+
style: styles.root
|
|
101
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
|
|
83
|
+
style: styles.card
|
|
103
84
|
}, /*#__PURE__*/React.createElement("img", {
|
|
104
85
|
width: 40,
|
|
105
86
|
height: 40,
|
|
106
87
|
alt: "loog",
|
|
107
88
|
src: '/assets/img/svg/disclaimer/logo-dots.svg'
|
|
108
|
-
}), /*#__PURE__*/React.createElement(
|
|
109
|
-
|
|
110
|
-
}, titleTop), /*#__PURE__*/React.createElement(
|
|
111
|
-
|
|
112
|
-
}, message), /*#__PURE__*/React.createElement(
|
|
113
|
-
|
|
114
|
-
className: classes.button,
|
|
89
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
style: styles.title
|
|
91
|
+
}, titleTop), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
style: styles.body
|
|
93
|
+
}, message), /*#__PURE__*/React.createElement("button", {
|
|
94
|
+
style: styles.button,
|
|
115
95
|
onClick: onClose
|
|
116
96
|
}, buttonText)));
|
|
117
97
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var
|
|
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
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3
5
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
4
6
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
5
7
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -12,13 +14,32 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
14
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
13
15
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
14
16
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
17
|
import React, { Component } from 'react';
|
|
17
18
|
import PropTypes from 'prop-types';
|
|
18
|
-
import {
|
|
19
|
-
import styled from 'styled-components';
|
|
19
|
+
import { DEFAULT_FONT_FAMILY, KEYBOARD_BUTTON_CODE, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
20
20
|
import { isValidNumber } from "../../utils/helper";
|
|
21
|
-
var
|
|
21
|
+
var styles = {
|
|
22
|
+
input: {
|
|
23
|
+
display: 'block',
|
|
24
|
+
padding: '15px 25px 12px 0px',
|
|
25
|
+
width: 120,
|
|
26
|
+
color: TEXT_COLOR_NEUTRAL_0,
|
|
27
|
+
backgroundColor: 'rgb(255, 255, 255)',
|
|
28
|
+
border: '2px solid',
|
|
29
|
+
textAlign: 'right',
|
|
30
|
+
"float": 'right',
|
|
31
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
32
|
+
fontSize: 16,
|
|
33
|
+
fontWeight: 600,
|
|
34
|
+
lineHeight: '17px',
|
|
35
|
+
borderRadius: 5,
|
|
36
|
+
outline: 0,
|
|
37
|
+
transition: 'border-color 0.2s'
|
|
38
|
+
},
|
|
39
|
+
inputFocus: {
|
|
40
|
+
borderColor: SECONDARY_PURPLE_COLOR
|
|
41
|
+
}
|
|
42
|
+
};
|
|
22
43
|
var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
23
44
|
function FormNumberInput(props, context) {
|
|
24
45
|
var _this;
|
|
@@ -110,13 +131,16 @@ var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
|
110
131
|
});
|
|
111
132
|
}
|
|
112
133
|
};
|
|
113
|
-
|
|
134
|
+
|
|
135
|
+
// Merge base style, focus style, and custom style
|
|
136
|
+
var inputStyle = _objectSpread(_objectSpread(_objectSpread({}, styles.input), this.state.focusOn ? styles.inputFocus : {}), style);
|
|
137
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
114
138
|
id: "form_number_input",
|
|
115
139
|
autoFocus: this.state.focusOn,
|
|
116
140
|
readOnly: !!this.props.disabled,
|
|
117
141
|
type: "text",
|
|
118
142
|
value: currValue,
|
|
119
|
-
style:
|
|
143
|
+
style: inputStyle,
|
|
120
144
|
onChange: function onChange(evt) {
|
|
121
145
|
_this2.context.projectActions.copyProperties('ddddd');
|
|
122
146
|
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
@@ -1,20 +1,68 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["children", "style"];
|
|
2
|
-
var _templateObject;
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
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; } }
|
|
12
|
+
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; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
4
15
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
7
17
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
import { DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_3 } from "../../constants";
|
|
19
|
+
var styles = {
|
|
20
|
+
select: {
|
|
21
|
+
display: 'block',
|
|
22
|
+
width: 120,
|
|
23
|
+
"float": 'right',
|
|
24
|
+
padding: '15px 10px 12px 0px',
|
|
25
|
+
color: TEXT_COLOR_NEUTRAL_3,
|
|
26
|
+
border: '2px solid',
|
|
27
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
28
|
+
fontSize: 12,
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
lineHeight: '17px',
|
|
31
|
+
textAlign: 'right',
|
|
32
|
+
outline: 'none',
|
|
33
|
+
borderRadius: 5,
|
|
34
|
+
transition: 'border-color 0.2s'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
12
37
|
export default function FormSelect(_ref) {
|
|
13
38
|
var children = _ref.children,
|
|
14
39
|
style = _ref.style,
|
|
15
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
|
|
41
|
+
var _React$useState = React.useState(false),
|
|
42
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
43
|
+
focus = _React$useState2[0],
|
|
44
|
+
setFocus = _React$useState2[1];
|
|
45
|
+
var _React$useState3 = React.useState(false),
|
|
46
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
47
|
+
hover = _React$useState4[0],
|
|
48
|
+
setHover = _React$useState4[1];
|
|
49
|
+
var borderColor = focus || hover ? SECONDARY_PURPLE_COLOR : undefined;
|
|
50
|
+
return /*#__PURE__*/React.createElement("select", _extends({
|
|
17
51
|
type: "text",
|
|
18
|
-
style:
|
|
52
|
+
style: _objectSpread(_objectSpread({}, styles.select), {}, {
|
|
53
|
+
borderColor: borderColor
|
|
54
|
+
}, style),
|
|
55
|
+
onFocus: function onFocus() {
|
|
56
|
+
return setFocus(true);
|
|
57
|
+
},
|
|
58
|
+
onBlur: function onBlur() {
|
|
59
|
+
return setFocus(false);
|
|
60
|
+
},
|
|
61
|
+
onMouseEnter: function onMouseEnter() {
|
|
62
|
+
return setHover(true);
|
|
63
|
+
},
|
|
64
|
+
onMouseLeave: function onMouseLeave() {
|
|
65
|
+
return setHover(false);
|
|
66
|
+
}
|
|
19
67
|
}, rest), children);
|
|
20
68
|
}
|