kitchen-simulator 1.1.1-test.30 → 1.1.1-test.32

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.
Files changed (106) hide show
  1. package/es/KitchenConfigurator.js +28 -27
  2. package/es/KitchenConfiguratorApp.js +33 -35
  3. package/es/catalog/catalog.js +2 -2
  4. package/es/catalog/molding/molding-dcm/planner-element.js +2 -0
  5. package/es/catalog/molding/molding-fbm/planner-element.js +2 -0
  6. package/es/catalog/molding/molding-lrm/planner-element.js +2 -0
  7. package/es/catalog/properties/property-checkbox.js +72 -26
  8. package/es/catalog/properties/property-color.js +10 -12
  9. package/es/catalog/properties/property-enum.js +58 -16
  10. package/es/catalog/properties/property-hidden.js +10 -11
  11. package/es/catalog/properties/property-lenght-measure.js +15 -16
  12. package/es/catalog/properties/property-length-measure.js +69 -21
  13. package/es/catalog/properties/property-length-measure_hole.js +15 -16
  14. package/es/catalog/properties/property-number.js +10 -11
  15. package/es/catalog/properties/property-read-only.js +9 -10
  16. package/es/catalog/properties/property-string.js +9 -10
  17. package/es/catalog/properties/property-toggle.js +10 -11
  18. package/es/components/content.js +11 -11
  19. package/es/components/disclaimer/disclaimer.js +86 -66
  20. package/es/components/style/button.js +7 -8
  21. package/es/components/style/content-container.js +1 -2
  22. package/es/components/style/content-title.js +1 -1
  23. package/es/components/style/form-number-input.js +50 -25
  24. package/es/components/style/form-number-input_2.js +17 -16
  25. package/es/components/style/form-select.js +55 -6
  26. package/es/components/style/form-text-input.js +30 -10
  27. package/es/components/viewer2d/area.js +6 -7
  28. package/es/components/viewer2d/grids/grid-horizontal-streak.js +7 -7
  29. package/es/components/viewer2d/grids/grid-streak.js +7 -7
  30. package/es/components/viewer2d/grids/grid-vertical-streak.js +7 -7
  31. package/es/components/viewer2d/grids/grids.js +4 -6
  32. package/es/components/viewer2d/group.js +10 -12
  33. package/es/components/viewer2d/item.js +14 -14
  34. package/es/components/viewer2d/layer.js +7 -8
  35. package/es/components/viewer2d/line.js +7 -8
  36. package/es/components/viewer2d/ruler.js +8 -8
  37. package/es/components/viewer2d/rulerDist.js +6 -7
  38. package/es/components/viewer2d/rulerX.js +17 -17
  39. package/es/components/viewer2d/rulerY.js +15 -15
  40. package/es/components/viewer2d/scene.js +12 -10
  41. package/es/components/viewer2d/snap.js +6 -7
  42. package/es/components/viewer2d/state.js +6 -7
  43. package/es/components/viewer2d/utils.js +1 -1
  44. package/es/components/viewer2d/vertex.js +5 -6
  45. package/es/components/viewer2d/viewer2d.js +16 -18
  46. package/es/components/viewer3d/front3D.js +1 -1
  47. package/es/components/viewer3d/grids/grid-streak.js +1 -0
  48. package/es/components/viewer3d/ruler-utils/layer3D.js +1 -1
  49. package/es/components/viewer3d/ruler-utils/ruler3D.js +1 -1
  50. package/es/components/viewer3d/ruler-utils/scene3D.js +1 -0
  51. package/es/components/viewer3d/viewer3d-first-person.js +16 -15
  52. package/es/components/viewer3d/viewer3d.js +18 -17
  53. package/es/utils/geometry.js +3 -3
  54. package/es/utils/react-if.js +5 -6
  55. package/es/utils/snap-scene.js +2 -2
  56. package/es/utils/snap.js +1 -1
  57. package/lib/KitchenConfigurator.js +29 -27
  58. package/lib/KitchenConfiguratorApp.js +34 -35
  59. package/lib/catalog/molding/molding-dcm/planner-element.js +5 -0
  60. package/lib/catalog/molding/molding-fbm/planner-element.js +5 -0
  61. package/lib/catalog/molding/molding-lrm/planner-element.js +5 -0
  62. package/lib/catalog/properties/property-checkbox.js +74 -26
  63. package/lib/catalog/properties/property-color.js +11 -11
  64. package/lib/catalog/properties/property-enum.js +60 -15
  65. package/lib/catalog/properties/property-hidden.js +13 -11
  66. package/lib/catalog/properties/property-lenght-measure.js +17 -15
  67. package/lib/catalog/properties/property-length-measure.js +71 -20
  68. package/lib/catalog/properties/property-length-measure_hole.js +17 -15
  69. package/lib/catalog/properties/property-number.js +12 -12
  70. package/lib/catalog/properties/property-read-only.js +11 -11
  71. package/lib/catalog/properties/property-string.js +11 -11
  72. package/lib/catalog/properties/property-toggle.js +11 -11
  73. package/lib/components/content.js +11 -12
  74. package/lib/components/disclaimer/disclaimer.js +86 -66
  75. package/lib/components/style/button.js +8 -8
  76. package/lib/components/style/content-container.js +2 -2
  77. package/lib/components/style/content-title.js +2 -1
  78. package/lib/components/style/form-number-input.js +50 -25
  79. package/lib/components/style/form-number-input_2.js +18 -16
  80. package/lib/components/style/form-select.js +55 -6
  81. package/lib/components/style/form-text-input.js +30 -11
  82. package/lib/components/viewer2d/area.js +8 -8
  83. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +9 -8
  84. package/lib/components/viewer2d/grids/grid-streak.js +9 -8
  85. package/lib/components/viewer2d/grids/grid-vertical-streak.js +9 -8
  86. package/lib/components/viewer2d/grids/grids.js +5 -5
  87. package/lib/components/viewer2d/group.js +10 -13
  88. package/lib/components/viewer2d/item.js +12 -12
  89. package/lib/components/viewer2d/layer.js +8 -8
  90. package/lib/components/viewer2d/line.js +7 -9
  91. package/lib/components/viewer2d/ruler.js +9 -8
  92. package/lib/components/viewer2d/rulerDist.js +8 -8
  93. package/lib/components/viewer2d/rulerX.js +18 -17
  94. package/lib/components/viewer2d/rulerY.js +16 -15
  95. package/lib/components/viewer2d/scene.js +12 -9
  96. package/lib/components/viewer2d/snap.js +6 -8
  97. package/lib/components/viewer2d/state.js +7 -7
  98. package/lib/components/viewer2d/vertex.js +5 -7
  99. package/lib/components/viewer2d/viewer2d.js +17 -18
  100. package/lib/components/viewer3d/grids/grid-streak.js +1 -0
  101. package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -0
  102. package/lib/components/viewer3d/viewer3d-first-person.js +16 -14
  103. package/lib/components/viewer3d/viewer3d.js +18 -16
  104. package/lib/utils/geometry.js +1 -1
  105. package/lib/utils/react-if.js +7 -7
  106. package/package.json +5 -24
@@ -31,7 +31,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
31
31
  import axios from 'axios';
32
32
  import * as convert from 'convert-units';
33
33
  import { Plugins as PlannerPlugins } from "./index";
34
- //import PropTypes from 'prop-types';
34
+ import * as PropTypes from 'prop-types';
35
35
  import React, { Component } from 'react';
36
36
  import ReactGA from 'react-ga4';
37
37
  import { hotjar } from 'react-hotjar';
@@ -598,32 +598,33 @@ var KitchenConfigurator = /*#__PURE__*/function (_Component) {
598
598
  }))));
599
599
  }
600
600
  }]);
601
- }(Component); // KitchenConfigurator.propTypes = {
602
- // translator: PropTypes.instanceOf(Translator),
603
- //
604
- // catalog: PropTypes.instanceOf(Catalog),
605
- // allowProjectFileSupport: PropTypes.bool,
606
- // plugins: PropTypes.arrayOf(PropTypes.func),
607
- // autosaveKey: PropTypes.string,
608
- // autosaveDelay: PropTypes.number,
609
- // width: PropTypes.number.isRequired,
610
- // height: PropTypes.number.isRequired,
611
- // stateExtractor: PropTypes.func.isRequired,
612
- // toolbarButtons: PropTypes.array,
613
- // sidebarComponents: PropTypes.array,
614
- // footerbarComponents: PropTypes.array,
615
- // customContents: PropTypes.object,
616
- // softwareSignature: PropTypes.string,
617
- // configData: PropTypes.object
618
- // };
619
- // KitchenConfigurator.contextTypes = {
620
- // store: PropTypes.object.isRequired
621
- // };
622
- // KitchenConfigurator.childContextTypes = {
623
- // ...objectsMap(actions, () => PropTypes.object),
624
- // translator: PropTypes.object,
625
- // catalog: PropTypes.object
626
- // };
601
+ }(Component);
602
+ KitchenConfigurator.propTypes = {
603
+ translator: PropTypes.instanceOf(Translator),
604
+ catalog: PropTypes.instanceOf(Catalog),
605
+ allowProjectFileSupport: PropTypes.bool,
606
+ plugins: PropTypes.arrayOf(PropTypes.func),
607
+ autosaveKey: PropTypes.string,
608
+ autosaveDelay: PropTypes.number,
609
+ width: PropTypes.number.isRequired,
610
+ height: PropTypes.number.isRequired,
611
+ stateExtractor: PropTypes.func.isRequired,
612
+ toolbarButtons: PropTypes.array,
613
+ sidebarComponents: PropTypes.array,
614
+ footerbarComponents: PropTypes.array,
615
+ customContents: PropTypes.object,
616
+ softwareSignature: PropTypes.string,
617
+ configData: PropTypes.object
618
+ };
619
+ KitchenConfigurator.contextTypes = {
620
+ store: PropTypes.object.isRequired
621
+ };
622
+ KitchenConfigurator.childContextTypes = _objectSpread(_objectSpread({}, objectsMap(actions, function () {
623
+ return PropTypes.object;
624
+ })), {}, {
625
+ translator: PropTypes.object,
626
+ catalog: PropTypes.object
627
+ });
627
628
  KitchenConfigurator.defaultProps = {
628
629
  translator: new Translator(),
629
630
  catalog: new Catalog(),
@@ -19,9 +19,10 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19
19
  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; }
20
20
  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; }
21
21
  import React, { useEffect } from 'react';
22
- //import PropTypes from 'prop-types';
22
+ import * as PropTypes from 'prop-types';
23
23
  import { Provider } from 'react-redux';
24
24
  import { createStore } from 'redux';
25
+ import * as Models from "./models";
25
26
  import KitchenConfigurator from "./KitchenConfigurator";
26
27
  import AppContext from "./AppContext";
27
28
  import Catalog from "./catalog/catalog";
@@ -461,37 +462,34 @@ export default function KitchenConfiguratorApp(props) {
461
462
 
462
463
  /* ============================== prop types ============================== */
463
464
 
464
- // KitchenConfiguratorApp.propTypes = {
465
- // width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
466
- // height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
467
- // projectElement: PropTypes.arrayOf(PropTypes.object),
468
- // categoryData: PropTypes.any,
469
- // dataBundle: PropTypes.any,
470
- // configData: PropTypes.any,
471
- // catalog: PropTypes.oneOfType([
472
- // PropTypes.object,
473
- // PropTypes.instanceOf(Models.Catalog)
474
- // ]),
475
- // logoImg: PropTypes.any,
476
- // companyUrl: PropTypes.string,
477
- // toolbarButtons: PropTypes.any,
478
- // options: PropTypes.object,
479
- // user: PropTypes.object,
480
- // auth: PropTypes.object,
481
- // featureFlags: PropTypes.object,
482
- // sentry: PropTypes.shape({
483
- // dsn: PropTypes.string,
484
- // environment: PropTypes.string
485
- // }),
486
- // analytics: PropTypes.shape({
487
- // ga4Id: PropTypes.string,
488
- // hotjar: PropTypes.shape({
489
- // id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
490
- // sv: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
491
- // })
492
- // }),
493
- // onEvent: PropTypes.func,
494
- // onSave: PropTypes.func,
495
- // onError: PropTypes.func,
496
- // store: PropTypes.object
497
- // };
465
+ KitchenConfiguratorApp.propTypes = {
466
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
467
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
468
+ projectElement: PropTypes.arrayOf(PropTypes.object),
469
+ categoryData: PropTypes.any,
470
+ dataBundle: PropTypes.any,
471
+ configData: PropTypes.any,
472
+ catalog: PropTypes.oneOfType([PropTypes.object, PropTypes.instanceOf(Models.Catalog)]),
473
+ logoImg: PropTypes.any,
474
+ companyUrl: PropTypes.string,
475
+ toolbarButtons: PropTypes.any,
476
+ options: PropTypes.object,
477
+ user: PropTypes.object,
478
+ auth: PropTypes.object,
479
+ featureFlags: PropTypes.object,
480
+ sentry: PropTypes.shape({
481
+ dsn: PropTypes.string,
482
+ environment: PropTypes.string
483
+ }),
484
+ analytics: PropTypes.shape({
485
+ ga4Id: PropTypes.string,
486
+ hotjar: PropTypes.shape({
487
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
488
+ sv: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
489
+ })
490
+ }),
491
+ onEvent: PropTypes.func,
492
+ onSave: PropTypes.func,
493
+ onError: PropTypes.func,
494
+ store: PropTypes.object
495
+ };
@@ -10,8 +10,8 @@ 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 { PropertyCheckbox, PropertyColor, PropertyEnum, PropertyHidden, PropertyLengthMeasure, PropertyNumber, PropertyReadOnly, PropertyString, PropertyToggle } from "./properties/export";
14
- import { UNIT_CENTIMETER } from "../constants";
13
+ import { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly } from "./properties/export";
14
+ import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
15
15
  import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
16
16
  var Catalog = /*#__PURE__*/function () {
17
17
  function Catalog() {
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+ import * as Three from 'three';
1
3
  import { loadGLTF } from "../../utils/load-obj";
2
4
  var cached3DMolding = null;
3
5
  export default {
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+ import * as Three from 'three';
1
3
  import { loadGLTF } from "../../utils/load-obj";
2
4
  var cached3DMolding = null;
3
5
  export default {
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+ import * as Three from 'three';
1
3
  import { loadGLTF } from "../../utils/load-obj";
2
4
  var cached3DMolding = null;
3
5
  export default {
@@ -1,21 +1,60 @@
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 _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
3
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; }
4
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; }
5
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; }
6
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
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); }
8
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
9
7
  import React from 'react';
10
- //import PropTypes from 'prop-types';
11
- import styled from 'styled-components';
8
+ import * as PropTypes from 'prop-types';
12
9
  import { DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
13
- var FlipWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: 15px 0;\n justify-content: space-between;\n"])));
14
- var FlipTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n line-height: 18px;\n text-align: left;\n"])), SECONDARY_PURPLE_COLOR, DEFAULT_FONT_FAMILY);
15
- var FlipDescription = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
16
- var FlipInfoWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
17
- var FlipToggle = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n"])));
18
- var FlipToggleIcon = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n top: 0;\n position: absolute;\n ", "\n img {\n font-size: 1.4rem;\n box-sizing: border-box;\n border-radius: 50%;\n }\n"])), '' /* transition-duration: .3s; */);
10
+ var styles = {
11
+ flipWrapper: {
12
+ display: 'flex',
13
+ alignItems: 'center',
14
+ margin: '15px 0',
15
+ justifyContent: 'space-between'
16
+ },
17
+ flipTitle: {
18
+ marginRight: 'auto',
19
+ color: SECONDARY_PURPLE_COLOR,
20
+ fontFamily: DEFAULT_FONT_FAMILY,
21
+ fontSize: 16,
22
+ fontWeight: 600,
23
+ lineHeight: '18px',
24
+ textAlign: 'left'
25
+ },
26
+ flipDescription: {
27
+ marginRight: 'auto',
28
+ color: TEXT_COLOR_NEUTRAL_0,
29
+ fontFamily: DEFAULT_FONT_FAMILY,
30
+ fontSize: 13,
31
+ fontWeight: 400,
32
+ lineHeight: '18px',
33
+ textAlign: 'left'
34
+ },
35
+ flipInfoWrapper: {
36
+ display: 'flex',
37
+ flexDirection: 'column'
38
+ },
39
+ flipToggle: {
40
+ display: 'flex',
41
+ position: 'relative',
42
+ alignItems: 'center',
43
+ justifyContent: 'center',
44
+ fontSize: 14,
45
+ cursor: 'pointer',
46
+ userSelect: 'none'
47
+ },
48
+ flipToggleIcon: {
49
+ top: 0,
50
+ position: 'absolute'
51
+ },
52
+ flipToggleIconImg: {
53
+ fontSize: '1.4rem',
54
+ boxSizing: 'border-box',
55
+ borderRadius: '50%'
56
+ }
57
+ };
19
58
  export default function PropertyCheckbox(_ref) {
20
59
  var value = _ref.value,
21
60
  onUpdate = _ref.onUpdate,
@@ -36,10 +75,18 @@ export default function PropertyCheckbox(_ref) {
36
75
  } : {
37
76
  right: 0
38
77
  };
39
- return /*#__PURE__*/React.createElement(FlipWrapper, null, /*#__PURE__*/React.createElement(FlipInfoWrapper, null, /*#__PURE__*/React.createElement(FlipTitle, null, configs.label), configs.description && /*#__PURE__*/React.createElement(FlipDescription, null, configs.description)), /*#__PURE__*/React.createElement(FlipToggle, {
40
- style: {
78
+ return /*#__PURE__*/React.createElement("div", {
79
+ style: styles.flipWrapper
80
+ }, /*#__PURE__*/React.createElement("div", {
81
+ style: styles.flipInfoWrapper
82
+ }, /*#__PURE__*/React.createElement("span", {
83
+ style: styles.flipTitle
84
+ }, configs.label), configs.description && /*#__PURE__*/React.createElement("span", {
85
+ style: styles.flipDescription
86
+ }, configs.description)), /*#__PURE__*/React.createElement("div", {
87
+ style: _objectSpread(_objectSpread({}, styles.flipToggle), {}, {
41
88
  color: 'black'
42
- },
89
+ }),
43
90
  onClick: function onClick(e) {
44
91
  return update(!value);
45
92
  }
@@ -49,22 +96,21 @@ export default function PropertyCheckbox(_ref) {
49
96
  width: '55px',
50
97
  height: '30px'
51
98
  }
52
- }), /*#__PURE__*/React.createElement(FlipToggleIcon, {
53
- style: _objectSpread({}, activeStyle)
99
+ }), /*#__PURE__*/React.createElement("div", {
100
+ style: _objectSpread(_objectSpread({}, styles.flipToggleIcon), activeStyle)
54
101
  }, /*#__PURE__*/React.createElement("img", {
55
102
  src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_button_active.svg' : '2d3d_button.svg'),
56
- style: {
103
+ style: _objectSpread({
57
104
  width: '30px',
58
105
  height: '30px'
59
- }
106
+ }, styles.flipToggleIconImg)
60
107
  }))));
61
108
  }
62
-
63
- // PropertyCheckbox.propTypes = {
64
- // value: PropTypes.any.isRequired,
65
- // onUpdate: PropTypes.func.isRequired,
66
- // configs: PropTypes.object.isRequired,
67
- // sourceElement: PropTypes.object,
68
- // internalState: PropTypes.object,
69
- // state: PropTypes.object.isRequired
70
- // };
109
+ PropertyCheckbox.propTypes = {
110
+ value: PropTypes.any.isRequired,
111
+ onUpdate: PropTypes.func.isRequired,
112
+ configs: PropTypes.object.isRequired,
113
+ sourceElement: PropTypes.object,
114
+ internalState: PropTypes.object,
115
+ state: PropTypes.object.isRequired
116
+ };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
-
3
- //import PropTypes from 'prop-types';
4
- import { FormColorInput, FormLabel } from "../../components/style/export";
2
+ import * as PropTypes from 'prop-types';
3
+ import { FormLabel, FormColorInput } from "../../components/style/export";
5
4
  import PropertyStyle from "./shared-property-style";
6
5
  export default function PropertyColor(_ref) {
7
6
  var value = _ref.value,
@@ -30,12 +29,11 @@ export default function PropertyColor(_ref) {
30
29
  }
31
30
  })))));
32
31
  }
33
-
34
- // PropertyColor.propTypes = {
35
- // value: PropTypes.any.isRequired,
36
- // onUpdate: PropTypes.func.isRequired,
37
- // configs: PropTypes.object.isRequired,
38
- // sourceElement: PropTypes.object,
39
- // internalState: PropTypes.object,
40
- // state: PropTypes.object.isRequired
41
- // };
32
+ PropertyColor.propTypes = {
33
+ value: PropTypes.any.isRequired,
34
+ onUpdate: PropTypes.func.isRequired,
35
+ configs: PropTypes.object.isRequired,
36
+ sourceElement: PropTypes.object,
37
+ internalState: PropTypes.object,
38
+ state: PropTypes.object.isRequired
39
+ };
@@ -1,19 +1,45 @@
1
- var _templateObject, _templateObject2;
2
1
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3
2
  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."); }
4
3
  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; } }
5
4
  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; }
6
5
  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; } }
7
6
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
8
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
9
7
  import React from 'react';
10
- //import PropTypes from 'prop-types';
8
+ import * as PropTypes from 'prop-types';
11
9
  import { Seq } from 'immutable';
12
10
  import { FormSelect } from "../../components/style/export";
13
- import styled from 'styled-components';
14
11
  import { DEFAULT_FONT_FAMILY, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
15
- var EnumWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n"])));
16
- var EnumTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n width: 110px;\n color: ", ";\n font-family: ", ";\n\n @media screen and (min-width: 1024) {\n font-size: 11px;\n }\n @media screen and (max-width: 1024) {\n font-size: 11px;\n }\n @media screen and (min-width: 1366) {\n font-size: 13px;\n }\n @media screen and (max-width: 1366) {\n font-size: 13px;\n }\n @media screen and (min-width: 1440) {\n font-size: 16px;\n }\n @media screen and (max-width: 1440) {\n font-size: 16px;\n }\n font-weight: 400;\n line-height: 15px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
12
+ var styles = {
13
+ enumWrapper: {
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ marginTop: 3
17
+ },
18
+ enumTitle: function enumTitle(fontSize) {
19
+ return {
20
+ marginRight: 'auto',
21
+ width: 110,
22
+ color: TEXT_COLOR_NEUTRAL_0,
23
+ fontFamily: DEFAULT_FONT_FAMILY,
24
+ fontSize: fontSize,
25
+ fontWeight: 400,
26
+ lineHeight: '15px',
27
+ textAlign: 'left'
28
+ };
29
+ }
30
+ };
31
+
32
+ // Responsive font size logic
33
+ function getFontSize() {
34
+ if (typeof window !== 'undefined') {
35
+ var w = window.innerWidth;
36
+ if (w <= 1024) return 11;
37
+ if (w <= 1366) return 13;
38
+ if (w <= 1440) return 16;
39
+ return 16;
40
+ }
41
+ return 13;
42
+ }
17
43
  export default function PropertyEnum(_ref) {
18
44
  var value = _ref.value,
19
45
  onUpdate = _ref.onUpdate,
@@ -29,7 +55,24 @@ export default function PropertyEnum(_ref) {
29
55
  }
30
56
  return onUpdate(val);
31
57
  };
32
- return /*#__PURE__*/React.createElement(EnumWrapper, null, /*#__PURE__*/React.createElement(EnumTitle, null, configs.label), /*#__PURE__*/React.createElement(FormSelect, {
58
+ var _React$useState = React.useState(getFontSize()),
59
+ _React$useState2 = _slicedToArray(_React$useState, 2),
60
+ fontSize = _React$useState2[0],
61
+ setFontSize = _React$useState2[1];
62
+ React.useEffect(function () {
63
+ function handleResize() {
64
+ setFontSize(getFontSize());
65
+ }
66
+ window.addEventListener('resize', handleResize);
67
+ return function () {
68
+ return window.removeEventListener('resize', handleResize);
69
+ };
70
+ }, []);
71
+ return /*#__PURE__*/React.createElement("div", {
72
+ style: styles.enumWrapper
73
+ }, /*#__PURE__*/React.createElement("span", {
74
+ style: styles.enumTitle(fontSize)
75
+ }, configs.label), /*#__PURE__*/React.createElement(FormSelect, {
33
76
  value: value,
34
77
  onChange: function onChange(event) {
35
78
  return update(event.target.value);
@@ -44,12 +87,11 @@ export default function PropertyEnum(_ref) {
44
87
  }, value);
45
88
  })));
46
89
  }
47
-
48
- // PropertyEnum.propTypes = {
49
- // value: PropTypes.any.isRequired,
50
- // onUpdate: PropTypes.func.isRequired,
51
- // configs: PropTypes.object.isRequired,
52
- // sourceElement: PropTypes.object,
53
- // internalState: PropTypes.object,
54
- // state: PropTypes.object.isRequired
55
- // };
90
+ PropertyEnum.propTypes = {
91
+ value: PropTypes.any.isRequired,
92
+ onUpdate: PropTypes.func.isRequired,
93
+ configs: PropTypes.object.isRequired,
94
+ sourceElement: PropTypes.object,
95
+ internalState: PropTypes.object,
96
+ state: PropTypes.object.isRequired
97
+ };
@@ -1,5 +1,5 @@
1
- //import PropTypes from 'prop-types';
2
-
1
+ import React from 'react';
2
+ import * as PropTypes from 'prop-types';
3
3
  export default function PropertyHidden(_ref) {
4
4
  var value = _ref.value,
5
5
  onUpdate = _ref.onUpdate,
@@ -9,12 +9,11 @@ export default function PropertyHidden(_ref) {
9
9
  state = _ref.state;
10
10
  return null;
11
11
  }
12
-
13
- // PropertyHidden.propTypes = {
14
- // value: PropTypes.any.isRequired,
15
- // onUpdate: PropTypes.func.isRequired,
16
- // configs: PropTypes.object.isRequired,
17
- // sourceElement: PropTypes.object,
18
- // internalState: PropTypes.object,
19
- // state: PropTypes.object.isRequired
20
- // };
12
+ PropertyHidden.propTypes = {
13
+ value: PropTypes.any.isRequired,
14
+ onUpdate: PropTypes.func.isRequired,
15
+ configs: PropTypes.object.isRequired,
16
+ sourceElement: PropTypes.object,
17
+ internalState: PropTypes.object,
18
+ state: PropTypes.object.isRequired
19
+ };
@@ -3,10 +3,11 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  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; }
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
- //import PropTypes from 'prop-types';
7
- import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "./../../constants";
6
+ import * as PropTypes from 'prop-types';
7
+ import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNITS_LENGTH, UNIT_INCH } from "./../../constants";
8
8
  import convert from 'convert-units';
9
9
  import { FormLabel, FormNumberInput, FormSelect } from "../../components/style/export";
10
+ import { Map } from 'immutable';
10
11
  import { toFixedFloat } from "../../utils/math";
11
12
  import PropertyStyle from "./shared-property-style";
12
13
  var internalTableStyle = {
@@ -86,17 +87,15 @@ export default function PropertyLengthMeasure(_ref, _ref2) {
86
87
  }, el);
87
88
  }))))))))));
88
89
  }
89
-
90
- // PropertyLengthMeasure.propTypes = {
91
- // value: PropTypes.instanceOf(Map).isRequired,
92
- // onUpdate: PropTypes.func.isRequired,
93
- // onValid: PropTypes.func,
94
- // configs: PropTypes.object.isRequired,
95
- // sourceElement: PropTypes.object,
96
- // internalState: PropTypes.object,
97
- // state: PropTypes.object.isRequired
98
- // };
99
-
100
- // PropertyLengthMeasure.contextTypes = {
101
- // catalog: PropTypes.object.isRequired
102
- // };
90
+ PropertyLengthMeasure.propTypes = {
91
+ value: PropTypes.instanceOf(Map).isRequired,
92
+ onUpdate: PropTypes.func.isRequired,
93
+ onValid: PropTypes.func,
94
+ configs: PropTypes.object.isRequired,
95
+ sourceElement: PropTypes.object,
96
+ internalState: PropTypes.object,
97
+ state: PropTypes.object.isRequired
98
+ };
99
+ PropertyLengthMeasure.contextTypes = {
100
+ catalog: PropTypes.object.isRequired
101
+ };
@@ -1,18 +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
- //import PropTypes from 'prop-types';
12
+ import * as PropTypes from 'prop-types';
9
13
  import { BASE_CABINET_LAYOUTPOS, DEFAULT_FONT_FAMILY, TALL_CABINET_LAYOUTPOS, TEXT_COLOR_NEUTRAL_0, UNIT_CENTIMETER, UNIT_INCH } from "../../constants";
10
14
  import convert from 'convert-units';
11
15
  import { FormNumberInput } from "../../components/style/export";
16
+ import { Map } from 'immutable';
12
17
  import { toFixedFloat } from "../../utils/math";
13
- import styled from 'styled-components';
14
- var DistanceFloorWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n"])));
15
- var DistanceFloorTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n width: 110px;\n color: ", ";\n font-family: ", ";\n font-size: 16px;\n\n @media screen and (min-width: 1024) {\n font-size: 11px;\n }\n @media screen and (max-width: 1024) {\n font-size: 11px;\n }\n @media screen and (min-width: 1366) {\n font-size: 13px;\n }\n @media screen and (max-width: 1366) {\n font-size: 13px;\n }\n @media screen and (min-width: 1440) {\n font-size: 16px;\n }\n @media screen and (max-width: 1440) {\n font-size: 16px;\n }\n font-weight: 400;\n line-height: 15px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
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
+ }
16
49
  export default function PropertyLengthMeasure(_ref, _ref2) {
17
50
  var value = _ref.value,
18
51
  onUpdate = _ref.onUpdate,
@@ -57,7 +90,24 @@ export default function PropertyLengthMeasure(_ref, _ref2) {
57
90
  }
58
91
  return onUpdate(merged);
59
92
  };
60
- return /*#__PURE__*/React.createElement(DistanceFloorWrapper, null, /*#__PURE__*/React.createElement(DistanceFloorTitle, null, label), /*#__PURE__*/React.createElement(FormNumberInput, _extends({
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({
61
111
  disabled: type === TALL_CABINET_LAYOUTPOS,
62
112
  value: convert(_length).from('in').to(unit),
63
113
  onChange: function onChange(event) {
@@ -70,17 +120,15 @@ export default function PropertyLengthMeasure(_ref, _ref2) {
70
120
  }
71
121
  }, configRest)));
72
122
  }
73
-
74
- // PropertyLengthMeasure.propTypes = {
75
- // value: PropTypes.instanceOf(Map).isRequired,
76
- // onUpdate: PropTypes.func.isRequired,
77
- // onValid: PropTypes.func,
78
- // configs: PropTypes.object.isRequired,
79
- // sourceElement: PropTypes.object,
80
- // internalState: PropTypes.object,
81
- // state: PropTypes.object.isRequired
82
- // };
83
-
84
- // PropertyLengthMeasure.contextTypes = {
85
- // catalog: PropTypes.object.isRequired
86
- // };
123
+ PropertyLengthMeasure.propTypes = {
124
+ value: PropTypes.instanceOf(Map).isRequired,
125
+ onUpdate: PropTypes.func.isRequired,
126
+ onValid: PropTypes.func,
127
+ configs: PropTypes.object.isRequired,
128
+ sourceElement: PropTypes.object,
129
+ internalState: PropTypes.object,
130
+ state: PropTypes.object.isRequired
131
+ };
132
+ PropertyLengthMeasure.contextTypes = {
133
+ catalog: PropTypes.object.isRequired
134
+ };