kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50
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/@history.js +2 -0
- package/es/AppContext.js +3 -0
- package/es/KitchenConfigurator.js +645 -0
- package/es/KitchenConfiguratorApp.js +480 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +23 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +313 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +281 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/catalog/areas/area/planner-element.js +40 -0
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +277 -0
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +181 -0
- package/es/catalog/factories/area-factory.js +81 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +268 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +70 -0
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +116 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +97 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +101 -0
- package/es/catalog/properties/property-length-measure.js +134 -0
- package/es/catalog/properties/property-length-measure_hole.js +101 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/FuseUtils.js +82 -0
- package/es/catalog/utils/exporter.js +148 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1521 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +358 -0
- package/es/catalog/utils/obj-loader.js +477 -0
- package/es/class/FuseUtils.js +82 -0
- package/es/class/area.js +145 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +440 -0
- package/es/class/guide.js +62 -0
- package/es/class/hole.js +929 -0
- package/es/class/item.js +1883 -0
- package/es/class/layer.js +667 -0
- package/es/class/line.js +1180 -0
- package/es/class/project.js +793 -0
- package/es/class/vertex.js +202 -0
- package/es/components/content.js +107 -0
- package/es/components/disclaimer/disclaimer.js +97 -0
- package/es/components/export.js +9 -0
- package/es/components/style/button.js +113 -0
- package/es/components/style/cancel-button.js +22 -0
- package/es/components/style/content-container.js +33 -0
- package/es/components/style/content-title.js +29 -0
- package/es/components/style/delete-button.js +25 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +24 -0
- package/es/components/style/form-color-input.js +27 -0
- package/es/components/style/form-label.js +26 -0
- package/es/components/style/form-number-input.js +213 -0
- package/es/components/style/form-number-input_2.js +206 -0
- package/es/components/style/form-select.js +68 -0
- package/es/components/style/form-slider.js +61 -0
- package/es/components/style/form-submit-button.js +26 -0
- package/es/components/style/form-text-input.js +95 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
- package/es/components/viewer2d/grids/grids.js +35 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +513 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +882 -0
- package/es/components/viewer2d/ruler.js +100 -0
- package/es/components/viewer2d/rulerDist.js +146 -0
- package/es/components/viewer2d/rulerX.js +151 -0
- package/es/components/viewer2d/rulerY.js +153 -0
- package/es/components/viewer2d/scene.js +140 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +78 -0
- package/es/components/viewer2d/utils.js +198 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1398 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +66 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +699 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3608 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +315 -0
- package/es/components/viewer3d/viewer3d.js +2527 -0
- package/es/constants.js +636 -0
- package/es/index.js +16 -0
- package/es/models.js +510 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/autosave.js +33 -0
- package/es/plugins/console-debugger.js +37 -0
- package/es/plugins/export.js +9 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +140 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +129 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +40 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +84 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2420 -0
- package/es/utils/get-edges-of-subgraphs.js +27 -0
- package/es/utils/graph-cycles.js +237 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +150 -0
- package/es/utils/helper.js +268 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +19 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +871 -0
- package/es/utils/name-generator.js +18 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +18 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +99 -0
- package/es/utils/snap.js +237 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +498 -0
- package/es/version.js +2 -0
- package/lib/catalog/properties/property-string.js +55 -0
- package/lib/catalog/properties/property-toggle.js +46 -0
- package/lib/catalog/properties/shared-property-style.js +20 -0
- package/lib/catalog/utils/FuseUtils.js +88 -0
- package/lib/catalog/utils/exporter.js +155 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1533 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +363 -0
- package/lib/catalog/utils/obj-loader.js +482 -0
- package/lib/class/FuseUtils.js +88 -0
- package/lib/class/area.js +150 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +445 -0
- package/lib/class/guide.js +67 -0
- package/lib/class/hole.js +934 -0
- package/lib/class/item.js +1889 -0
- package/lib/class/layer.js +672 -0
- package/lib/class/line.js +1186 -0
- package/lib/class/project.js +799 -0
- package/lib/class/vertex.js +207 -0
- package/lib/components/content.js +116 -0
- package/lib/components/disclaimer/disclaimer.js +105 -0
- package/lib/components/export.js +33 -0
- package/lib/components/style/button.js +120 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +40 -0
- package/lib/components/style/content-title.js +37 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +31 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +33 -0
- package/lib/components/style/form-number-input.js +220 -0
- package/lib/components/style/form-number-input_2.js +213 -0
- package/lib/components/style/form-select.js +75 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +101 -0
- package/lib/components/viewer2d/area.js +88 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +44 -0
- package/lib/components/viewer2d/group.js +62 -0
- package/lib/components/viewer2d/item.js +521 -0
- package/lib/components/viewer2d/layer.js +171 -0
- package/lib/components/viewer2d/line.js +892 -0
- package/lib/components/viewer2d/ruler.js +107 -0
- package/lib/components/viewer2d/rulerDist.js +153 -0
- package/lib/components/viewer2d/rulerX.js +158 -0
- package/lib/components/viewer2d/rulerY.js +160 -0
- package/lib/components/viewer2d/scene.js +147 -0
- package/lib/components/viewer2d/snap.js +83 -0
- package/lib/components/viewer2d/state.js +87 -0
- package/lib/components/viewer2d/utils.js +210 -0
- package/lib/components/viewer2d/vertex.js +74 -0
- package/lib/components/viewer2d/viewer2d.js +1405 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
- package/lib/components/viewer3d/dcm.js +407 -0
- package/lib/components/viewer3d/fbm.js +420 -0
- package/lib/components/viewer3d/front3D.js +75 -0
- package/lib/components/viewer3d/grid-creator.js +34 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer3d/grids/grid-streak.js +35 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
- package/lib/components/viewer3d/libs/obj-loader.js +468 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
- package/lib/components/viewer3d/lrm.js +311 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
- package/lib/components/viewer3d/scene-creator.js +3642 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
- package/lib/components/viewer3d/viewer3d.js +2532 -0
- package/lib/constants.js +645 -0
- package/lib/index.js +96 -0
- package/lib/models.js +517 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/autosave.js +39 -0
- package/lib/plugins/console-debugger.js +44 -0
- package/lib/plugins/export.js +33 -0
- package/lib/plugins/keyboard.js +107 -0
- package/lib/reducers/areas-reducer.js +18 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +44 -0
- package/lib/reducers/holes-reducer.js +68 -0
- package/lib/reducers/items-reducer.js +146 -0
- package/lib/reducers/lines-reducer.js +51 -0
- package/lib/reducers/project-reducer.js +135 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +34 -0
- package/lib/reducers/user-reducer.js +46 -0
- package/lib/reducers/vertices-reducer.js +25 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/translator/en.js +110 -0
- package/lib/translator/it.js +85 -0
- package/lib/translator/ru.js +85 -0
- package/lib/translator/translator.js +90 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2516 -0
- package/lib/utils/get-edges-of-subgraphs.js +34 -0
- package/lib/utils/graph-cycles.js +240 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +157 -0
- package/lib/utils/helper.js +291 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +25 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +895 -0
- package/lib/utils/name-generator.js +23 -0
- package/lib/utils/objects-utils.js +60 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +24 -0
- package/lib/utils/react-if.js +24 -0
- package/lib/utils/snap-scene.js +105 -0
- package/lib/utils/snap.js +249 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +503 -0
- package/lib/version.js +8 -0
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF } from "../../utils/load-obj";
|
|
4
|
+
var cached3DMolding = null;
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Dcm',
|
|
7
|
+
prototype: 'molding',
|
|
8
|
+
info: {
|
|
9
|
+
title: 'Dcm',
|
|
10
|
+
tag: ['molding'],
|
|
11
|
+
description: 'dcm',
|
|
12
|
+
image: '/assets/img/svg/toolbar/dcm.png',
|
|
13
|
+
url: '/assets/model/DCM.gltf'
|
|
14
|
+
},
|
|
15
|
+
properties: {},
|
|
16
|
+
render3D: function render3D(element, layer, scene) {
|
|
17
|
+
var onLoadItem = function onLoadItem(object) {
|
|
18
|
+
return object;
|
|
19
|
+
};
|
|
20
|
+
if (cached3DMolding) {
|
|
21
|
+
return Promise.resolve(onLoadItem(cached3DMolding.clone()));
|
|
22
|
+
}
|
|
23
|
+
return loadGLTF(element.url).then(function (object) {
|
|
24
|
+
cached3DMolding = object;
|
|
25
|
+
return onLoadItem(cached3DMolding.clone());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF } from "../../utils/load-obj";
|
|
4
|
+
var cached3DMolding = null;
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Fbm',
|
|
7
|
+
prototype: 'molding',
|
|
8
|
+
info: {
|
|
9
|
+
title: 'Fbm',
|
|
10
|
+
tag: ['molding'],
|
|
11
|
+
description: 'Molding',
|
|
12
|
+
image: '/assets/img/svg/toolbar/fbm.png',
|
|
13
|
+
url: '/assets/model/FBM.gltf'
|
|
14
|
+
},
|
|
15
|
+
properties: {},
|
|
16
|
+
render3D: function render3D(element, layer, scene) {
|
|
17
|
+
var onLoadItem = function onLoadItem(object) {
|
|
18
|
+
return object;
|
|
19
|
+
};
|
|
20
|
+
if (cached3DMolding) {
|
|
21
|
+
return Promise.resolve(onLoadItem(cached3DMolding.clone()));
|
|
22
|
+
}
|
|
23
|
+
return loadGLTF(element.url).then(function (object) {
|
|
24
|
+
cached3DMolding = object;
|
|
25
|
+
return onLoadItem(cached3DMolding.clone());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF } from "../../utils/load-obj";
|
|
4
|
+
var cached3DMolding = null;
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Lrm',
|
|
7
|
+
prototype: 'molding',
|
|
8
|
+
info: {
|
|
9
|
+
title: 'Lrm',
|
|
10
|
+
tag: ['molding'],
|
|
11
|
+
description: 'Molding',
|
|
12
|
+
image: '/assets/img/svg/toolbar/lrm.png',
|
|
13
|
+
url: '/assets/model/LRM.gltf'
|
|
14
|
+
},
|
|
15
|
+
properties: {},
|
|
16
|
+
render3D: function render3D(element, layer, scene) {
|
|
17
|
+
var onLoadItem = function onLoadItem(object) {
|
|
18
|
+
return object;
|
|
19
|
+
};
|
|
20
|
+
if (cached3DMolding) {
|
|
21
|
+
return Promise.resolve(onLoadItem(cached3DMolding.clone()));
|
|
22
|
+
}
|
|
23
|
+
return loadGLTF(element.url).then(function (object) {
|
|
24
|
+
cached3DMolding = object;
|
|
25
|
+
return onLoadItem(cached3DMolding.clone());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PropertyColor from "./property-color";
|
|
2
|
+
import PropertyEnum from "./property-enum";
|
|
3
|
+
import PropertyString from "./property-string";
|
|
4
|
+
import PropertyNumber from "./property-number";
|
|
5
|
+
import PropertyLengthMeasure from "./property-length-measure";
|
|
6
|
+
import PropertyToggle from "./property-toggle";
|
|
7
|
+
import PropertyCheckbox from "./property-checkbox";
|
|
8
|
+
import PropertyHidden from "./property-hidden";
|
|
9
|
+
import PropertyReadOnly from "./property-read-only";
|
|
10
|
+
export { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly };
|
|
11
|
+
export default {
|
|
12
|
+
PropertyColor: PropertyColor,
|
|
13
|
+
PropertyEnum: PropertyEnum,
|
|
14
|
+
PropertyString: PropertyString,
|
|
15
|
+
PropertyNumber: PropertyNumber,
|
|
16
|
+
PropertyLengthMeasure: PropertyLengthMeasure,
|
|
17
|
+
PropertyToggle: PropertyToggle,
|
|
18
|
+
PropertyCheckbox: PropertyCheckbox,
|
|
19
|
+
PropertyHidden: PropertyHidden,
|
|
20
|
+
PropertyReadOnly: PropertyReadOnly
|
|
21
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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 React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
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
|
+
};
|
|
58
|
+
export default function PropertyCheckbox(_ref) {
|
|
59
|
+
var value = _ref.value,
|
|
60
|
+
onUpdate = _ref.onUpdate,
|
|
61
|
+
configs = _ref.configs,
|
|
62
|
+
sourceElement = _ref.sourceElement,
|
|
63
|
+
internalState = _ref.internalState,
|
|
64
|
+
state = _ref.state;
|
|
65
|
+
var update = function update(val) {
|
|
66
|
+
if (configs.hook) {
|
|
67
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
68
|
+
return onUpdate(_val);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return onUpdate(val);
|
|
72
|
+
};
|
|
73
|
+
var activeStyle = value == 0 ? {
|
|
74
|
+
left: 0
|
|
75
|
+
} : {
|
|
76
|
+
right: 0
|
|
77
|
+
};
|
|
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), {}, {
|
|
88
|
+
color: 'black'
|
|
89
|
+
}),
|
|
90
|
+
onClick: function onClick(e) {
|
|
91
|
+
return update(!value);
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
94
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_toggle_active.svg' : '2d3d_toggle.svg'),
|
|
95
|
+
style: {
|
|
96
|
+
width: '55px',
|
|
97
|
+
height: '30px'
|
|
98
|
+
}
|
|
99
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
style: _objectSpread(_objectSpread({}, styles.flipToggleIcon), activeStyle)
|
|
101
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
102
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_button_active.svg' : '2d3d_button.svg'),
|
|
103
|
+
style: _objectSpread({
|
|
104
|
+
width: '30px',
|
|
105
|
+
height: '30px'
|
|
106
|
+
}, styles.flipToggleIconImg)
|
|
107
|
+
}))));
|
|
108
|
+
}
|
|
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
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, FormColorInput } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyColor(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
onUpdate = _ref.onUpdate,
|
|
8
|
+
configs = _ref.configs,
|
|
9
|
+
sourceElement = _ref.sourceElement,
|
|
10
|
+
internalState = _ref.internalState,
|
|
11
|
+
state = _ref.state;
|
|
12
|
+
var update = function update(val) {
|
|
13
|
+
if (configs.hook) {
|
|
14
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
15
|
+
return onUpdate(_val);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return onUpdate(val);
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
21
|
+
className: "PropertyColor",
|
|
22
|
+
style: PropertyStyle.tableStyle
|
|
23
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
24
|
+
style: PropertyStyle.firstTdStyle
|
|
25
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormColorInput, {
|
|
26
|
+
value: value,
|
|
27
|
+
onChange: function onChange(event) {
|
|
28
|
+
return update(event.target.value);
|
|
29
|
+
}
|
|
30
|
+
})))));
|
|
31
|
+
}
|
|
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
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
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."); }
|
|
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; } }
|
|
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; }
|
|
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { Seq } from 'immutable';
|
|
10
|
+
import { FormSelect } from "../../components/style/export";
|
|
11
|
+
import { DEFAULT_FONT_FAMILY, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
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
|
+
}
|
|
43
|
+
export default function PropertyEnum(_ref) {
|
|
44
|
+
var value = _ref.value,
|
|
45
|
+
onUpdate = _ref.onUpdate,
|
|
46
|
+
configs = _ref.configs,
|
|
47
|
+
sourceElement = _ref.sourceElement,
|
|
48
|
+
internalState = _ref.internalState,
|
|
49
|
+
state = _ref.state;
|
|
50
|
+
var update = function update(val) {
|
|
51
|
+
if (configs.hook) {
|
|
52
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
53
|
+
return onUpdate(_val);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return onUpdate(val);
|
|
57
|
+
};
|
|
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, {
|
|
76
|
+
value: value,
|
|
77
|
+
onChange: function onChange(event) {
|
|
78
|
+
return update(event.target.value);
|
|
79
|
+
}
|
|
80
|
+
}, Seq(configs.values).entrySeq().map(function (_ref2) {
|
|
81
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
82
|
+
key = _ref3[0],
|
|
83
|
+
value = _ref3[1];
|
|
84
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
85
|
+
key: key,
|
|
86
|
+
value: key
|
|
87
|
+
}, value);
|
|
88
|
+
})));
|
|
89
|
+
}
|
|
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
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export default function PropertyHidden(_ref) {
|
|
4
|
+
var value = _ref.value,
|
|
5
|
+
onUpdate = _ref.onUpdate,
|
|
6
|
+
configs = _ref.configs,
|
|
7
|
+
sourceElement = _ref.sourceElement,
|
|
8
|
+
internalState = _ref.internalState,
|
|
9
|
+
state = _ref.state;
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
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
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var _excluded = ["hook", "label"];
|
|
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 _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
|
+
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
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNITS_LENGTH, UNIT_INCH } from "./../../constants";
|
|
8
|
+
import convert from 'convert-units';
|
|
9
|
+
import { FormLabel, FormNumberInput, FormSelect } from "../../components/style/export";
|
|
10
|
+
import { Map } from 'immutable';
|
|
11
|
+
import { toFixedFloat } from "../../utils/math";
|
|
12
|
+
import PropertyStyle from "./shared-property-style";
|
|
13
|
+
var internalTableStyle = {
|
|
14
|
+
borderCollapse: 'collapse'
|
|
15
|
+
};
|
|
16
|
+
var secondTdStyle = {
|
|
17
|
+
padding: 0
|
|
18
|
+
};
|
|
19
|
+
var unitContainerStyle = {
|
|
20
|
+
width: '5em'
|
|
21
|
+
};
|
|
22
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
23
|
+
var value = _ref.value,
|
|
24
|
+
onUpdate = _ref.onUpdate,
|
|
25
|
+
onValid = _ref.onValid,
|
|
26
|
+
configs = _ref.configs,
|
|
27
|
+
sourceElement = _ref.sourceElement,
|
|
28
|
+
internalState = _ref.internalState,
|
|
29
|
+
state = _ref.state;
|
|
30
|
+
var catalog = _ref2.catalog;
|
|
31
|
+
var length = value.get('length') || 0; // length in inch
|
|
32
|
+
var _length = value.get('_length') || length; // length in unit
|
|
33
|
+
var _unit = value.get('_unit') || UNIT_INCH;
|
|
34
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
35
|
+
var hook = configs.hook,
|
|
36
|
+
label = configs.label,
|
|
37
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
38
|
+
var update = function update(lengthInput, unitInput, type) {
|
|
39
|
+
var newLength = toFixedFloat(lengthInput);
|
|
40
|
+
var merged = null;
|
|
41
|
+
if (type === 0) {
|
|
42
|
+
merged = value.merge({
|
|
43
|
+
length: unitInput !== UNIT_INCH ? convert(newLength).from(unitInput).to(UNIT_INCH) : newLength,
|
|
44
|
+
_length: newLength
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
merged = value.merge({
|
|
48
|
+
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
49
|
+
_unit: unitInput
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (hook) {
|
|
53
|
+
return hook(merged, sourceElement, internalState, state).then(function (val) {
|
|
54
|
+
return onUpdate(val);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return onUpdate(merged);
|
|
58
|
+
};
|
|
59
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
60
|
+
className: "PropertyLengthMeasure",
|
|
61
|
+
style: PropertyStyle.tableStyle
|
|
62
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
63
|
+
style: PropertyStyle.firstTdStyle
|
|
64
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, label)), /*#__PURE__*/React.createElement("td", {
|
|
65
|
+
style: secondTdStyle
|
|
66
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
67
|
+
style: internalTableStyle
|
|
68
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormNumberInput, _extends({
|
|
69
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
70
|
+
value: _length,
|
|
71
|
+
onChange: function onChange(event) {
|
|
72
|
+
return update(event.target.value, _unit, 0);
|
|
73
|
+
},
|
|
74
|
+
onValid: onValid
|
|
75
|
+
}, configRest))), /*#__PURE__*/React.createElement("td", {
|
|
76
|
+
style: unitContainerStyle
|
|
77
|
+
}, /*#__PURE__*/React.createElement(FormSelect, {
|
|
78
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
79
|
+
value: _unit,
|
|
80
|
+
onChange: function onChange(event) {
|
|
81
|
+
return update(length, event.target.value, 1);
|
|
82
|
+
}
|
|
83
|
+
}, UNITS_LENGTH.map(function (el) {
|
|
84
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
85
|
+
key: el,
|
|
86
|
+
value: el
|
|
87
|
+
}, el);
|
|
88
|
+
}))))))))));
|
|
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
|
+
PropertyLengthMeasure.contextTypes = {
|
|
100
|
+
catalog: PropTypes.object.isRequired
|
|
101
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var _excluded = ["hook", "label"];
|
|
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; }
|
|
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; }
|
|
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; }
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
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 'convert-units';
|
|
15
|
+
import { FormNumberInput } from "../../components/style/export";
|
|
16
|
+
import { Map } from 'immutable';
|
|
17
|
+
import { toFixedFloat } from "../../utils/math";
|
|
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
|
+
}
|
|
49
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
50
|
+
var value = _ref.value,
|
|
51
|
+
onUpdate = _ref.onUpdate,
|
|
52
|
+
onValid = _ref.onValid,
|
|
53
|
+
configs = _ref.configs,
|
|
54
|
+
sourceElement = _ref.sourceElement,
|
|
55
|
+
internalState = _ref.internalState,
|
|
56
|
+
state = _ref.state;
|
|
57
|
+
var catalog = _ref2.catalog;
|
|
58
|
+
var _unit = value.get('_unit');
|
|
59
|
+
var unit = state.getIn(['scene', 'layers', state.scene.selectedLayer, 'unit']);
|
|
60
|
+
var length = value.get('length') || 0; // in centi
|
|
61
|
+
var _length = value.get('_length') || length; // in _unit
|
|
62
|
+
if (!_unit) {
|
|
63
|
+
_unit = UNIT_INCH;
|
|
64
|
+
_length = convert(length).from(UNIT_CENTIMETER).to(UNIT_INCH);
|
|
65
|
+
}
|
|
66
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
67
|
+
var hook = configs.hook,
|
|
68
|
+
label = configs.label,
|
|
69
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
70
|
+
var update = function update(lengthInput, unitInput, type) {
|
|
71
|
+
var newLength = toFixedFloat(lengthInput);
|
|
72
|
+
var merged = null;
|
|
73
|
+
if (type === 0) {
|
|
74
|
+
merged = value.merge({
|
|
75
|
+
_length: newLength,
|
|
76
|
+
_unit: unitInput,
|
|
77
|
+
length: convert(newLength).from(unitInput).to(UNIT_CENTIMETER)
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
merged = value.merge({
|
|
81
|
+
_length: convert(newLength).from(UNIT_CENTIMETER).to(unitInput),
|
|
82
|
+
_unit: unitInput,
|
|
83
|
+
length: newLength
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (hook) {
|
|
87
|
+
return hook(merged, sourceElement, internalState, state).then(function (val) {
|
|
88
|
+
return onUpdate(val);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return onUpdate(merged);
|
|
92
|
+
};
|
|
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({
|
|
111
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
112
|
+
value: convert(_length).from('in').to(unit),
|
|
113
|
+
onChange: function onChange(event) {
|
|
114
|
+
return update(event.target.value, _unit, 0);
|
|
115
|
+
},
|
|
116
|
+
onValid: onValid,
|
|
117
|
+
labelName: label,
|
|
118
|
+
style: {
|
|
119
|
+
paddingRight: '40px'
|
|
120
|
+
}
|
|
121
|
+
}, configRest)));
|
|
122
|
+
}
|
|
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
|
+
};
|