kitchen-simulator 1.1.1-test.47 → 1.1.1-test.49
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/lib/KitchenConfiguratorApp.js +3 -0
- package/package.json +15 -16
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -3
- package/es/KitchenConfigurator.js +0 -645
- package/es/KitchenConfiguratorApp.js +0 -478
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -313
- package/es/actions/lines-actions.js +0 -81
- package/es/actions/project-actions.js +0 -281
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/catalog/areas/area/planner-element.js +0 -40
- 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 +0 -277
- 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 +0 -181
- package/es/catalog/factories/area-factory.js +0 -81
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -268
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -70
- 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 +0 -28
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -116
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -97
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -101
- package/es/catalog/properties/property-length-measure.js +0 -134
- package/es/catalog/properties/property-length-measure_hole.js +0 -101
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -82
- package/es/catalog/utils/exporter.js +0 -148
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1521
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -358
- package/es/catalog/utils/obj-loader.js +0 -477
- package/es/class/FuseUtils.js +0 -82
- package/es/class/area.js +0 -145
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -440
- package/es/class/guide.js +0 -62
- package/es/class/hole.js +0 -929
- package/es/class/item.js +0 -1883
- package/es/class/layer.js +0 -667
- package/es/class/line.js +0 -1180
- package/es/class/project.js +0 -793
- package/es/class/vertex.js +0 -202
- package/es/components/content.js +0 -107
- package/es/components/disclaimer/disclaimer.js +0 -97
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -113
- package/es/components/style/cancel-button.js +0 -22
- package/es/components/style/content-container.js +0 -33
- package/es/components/style/content-title.js +0 -29
- package/es/components/style/delete-button.js +0 -25
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -24
- package/es/components/style/form-color-input.js +0 -27
- package/es/components/style/form-label.js +0 -26
- package/es/components/style/form-number-input.js +0 -213
- package/es/components/style/form-number-input_2.js +0 -206
- package/es/components/style/form-select.js +0 -68
- package/es/components/style/form-slider.js +0 -61
- package/es/components/style/form-submit-button.js +0 -26
- package/es/components/style/form-text-input.js +0 -95
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
- package/es/components/viewer2d/grids/grids.js +0 -35
- package/es/components/viewer2d/group.js +0 -53
- package/es/components/viewer2d/item.js +0 -513
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -882
- package/es/components/viewer2d/ruler.js +0 -100
- package/es/components/viewer2d/rulerDist.js +0 -146
- package/es/components/viewer2d/rulerX.js +0 -151
- package/es/components/viewer2d/rulerY.js +0 -153
- package/es/components/viewer2d/scene.js +0 -140
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -78
- package/es/components/viewer2d/utils.js +0 -198
- package/es/components/viewer2d/vertex.js +0 -65
- package/es/components/viewer2d/viewer2d.js +0 -1398
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -66
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -699
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3608
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -315
- package/es/components/viewer3d/viewer3d.js +0 -2527
- package/es/constants.js +0 -636
- package/es/index.js +0 -16
- package/es/models.js +0 -510
- package/es/plugins/SVGLoader.js +0 -1412
- package/es/plugins/autosave.js +0 -33
- package/es/plugins/console-debugger.js +0 -37
- package/es/plugins/export.js +0 -9
- package/es/plugins/keyboard.js +0 -101
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -140
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -129
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -40
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -75
- package/es/reducers/viewer3d-reducer.js +0 -56
- package/es/shared-style.js +0 -66
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -84
- package/es/utils/browser.js +0 -33
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2420
- package/es/utils/get-edges-of-subgraphs.js +0 -27
- package/es/utils/graph-cycles.js +0 -237
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -150
- package/es/utils/helper.js +0 -268
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -19
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -871
- package/es/utils/name-generator.js +0 -18
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -18
- package/es/utils/react-if.js +0 -18
- package/es/utils/snap-scene.js +0 -99
- package/es/utils/snap.js +0 -237
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -498
- package/es/version.js +0 -2
- package/lib/catalog/properties/property-string.js +0 -55
- package/lib/catalog/properties/property-toggle.js +0 -46
- package/lib/catalog/properties/shared-property-style.js +0 -20
- package/lib/catalog/utils/FuseUtils.js +0 -88
- package/lib/catalog/utils/exporter.js +0 -155
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1533
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -363
- package/lib/catalog/utils/obj-loader.js +0 -482
- package/lib/class/FuseUtils.js +0 -88
- package/lib/class/area.js +0 -150
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -445
- package/lib/class/guide.js +0 -67
- package/lib/class/hole.js +0 -934
- package/lib/class/item.js +0 -1889
- package/lib/class/layer.js +0 -672
- package/lib/class/line.js +0 -1186
- package/lib/class/project.js +0 -799
- package/lib/class/vertex.js +0 -207
- package/lib/components/content.js +0 -116
- package/lib/components/disclaimer/disclaimer.js +0 -105
- package/lib/components/export.js +0 -33
- package/lib/components/style/button.js +0 -120
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -40
- package/lib/components/style/content-title.js +0 -37
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/export.js +0 -121
- package/lib/components/style/form-block.js +0 -31
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -33
- package/lib/components/style/form-number-input.js +0 -220
- package/lib/components/style/form-number-input_2.js +0 -213
- package/lib/components/style/form-select.js +0 -75
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -101
- package/lib/components/viewer2d/area.js +0 -88
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -44
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -521
- package/lib/components/viewer2d/layer.js +0 -171
- package/lib/components/viewer2d/line.js +0 -892
- package/lib/components/viewer2d/ruler.js +0 -107
- package/lib/components/viewer2d/rulerDist.js +0 -153
- package/lib/components/viewer2d/rulerX.js +0 -158
- package/lib/components/viewer2d/rulerY.js +0 -160
- package/lib/components/viewer2d/scene.js +0 -147
- package/lib/components/viewer2d/snap.js +0 -83
- package/lib/components/viewer2d/state.js +0 -87
- package/lib/components/viewer2d/utils.js +0 -210
- package/lib/components/viewer2d/vertex.js +0 -74
- package/lib/components/viewer2d/viewer2d.js +0 -1405
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
- package/lib/components/viewer3d/dcm.js +0 -407
- package/lib/components/viewer3d/fbm.js +0 -420
- package/lib/components/viewer3d/front3D.js +0 -75
- package/lib/components/viewer3d/grid-creator.js +0 -34
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer3d/grids/grid-streak.js +0 -35
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
- package/lib/components/viewer3d/libs/obj-loader.js +0 -468
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
- package/lib/components/viewer3d/lrm.js +0 -311
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
- package/lib/components/viewer3d/scene-creator.js +0 -3642
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
- package/lib/components/viewer3d/viewer3d.js +0 -2532
- package/lib/constants.js +0 -645
- package/lib/index.js +0 -96
- package/lib/models.js +0 -517
- package/lib/plugins/SVGLoader.js +0 -1417
- package/lib/plugins/autosave.js +0 -39
- package/lib/plugins/console-debugger.js +0 -44
- package/lib/plugins/export.js +0 -33
- package/lib/plugins/keyboard.js +0 -107
- package/lib/reducers/areas-reducer.js +0 -18
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -44
- package/lib/reducers/holes-reducer.js +0 -68
- package/lib/reducers/items-reducer.js +0 -146
- package/lib/reducers/lines-reducer.js +0 -51
- package/lib/reducers/project-reducer.js +0 -135
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -34
- package/lib/reducers/user-reducer.js +0 -46
- package/lib/reducers/vertices-reducer.js +0 -25
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/styles/export.js +0 -13
- package/lib/translator/en.js +0 -110
- package/lib/translator/it.js +0 -85
- package/lib/translator/ru.js +0 -85
- package/lib/translator/translator.js +0 -90
- package/lib/utils/browser.js +0 -40
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2516
- package/lib/utils/get-edges-of-subgraphs.js +0 -34
- package/lib/utils/graph-cycles.js +0 -240
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -157
- package/lib/utils/helper.js +0 -291
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -26
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -23
- package/lib/utils/objects-utils.js +0 -60
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -24
- package/lib/utils/react-if.js +0 -24
- package/lib/utils/snap-scene.js +0 -105
- package/lib/utils/snap.js +0 -249
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -503
- package/lib/version.js +0 -8
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
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
|
-
};
|