kitchen-simulator 1.1.1-test.48 → 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 +1 -1
- 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 -25
- 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,213 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
11
|
-
var _md = require("react-icons/md");
|
|
12
|
-
var _constants = require("../../constants");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
20
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
-
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); }
|
|
23
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
25
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
26
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
28
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
29
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
|
-
var STYLE_INPUT = {
|
|
31
|
-
display: 'block',
|
|
32
|
-
width: '100%',
|
|
33
|
-
padding: '0 2px',
|
|
34
|
-
fontSize: '13px',
|
|
35
|
-
lineHeight: '1.25',
|
|
36
|
-
color: SharedStyle.PRIMARY_COLOR.input,
|
|
37
|
-
backgroundColor: SharedStyle.COLORS.white,
|
|
38
|
-
backgroundImage: 'none',
|
|
39
|
-
border: '1px solid rgba(0,0,0,.15)',
|
|
40
|
-
outline: 'none',
|
|
41
|
-
height: '30px'
|
|
42
|
-
};
|
|
43
|
-
var confirmStyle = {
|
|
44
|
-
position: 'absolute',
|
|
45
|
-
cursor: 'pointer',
|
|
46
|
-
width: '20px',
|
|
47
|
-
height: '20px',
|
|
48
|
-
right: '5px',
|
|
49
|
-
top: '5px',
|
|
50
|
-
backgroundColor: SharedStyle.SECONDARY_COLOR.main,
|
|
51
|
-
color: '#FFF',
|
|
52
|
-
transition: 'all 0.1s linear'
|
|
53
|
-
};
|
|
54
|
-
var FormNumberInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
55
|
-
function FormNumberInput(props, context) {
|
|
56
|
-
var _this;
|
|
57
|
-
_classCallCheck(this, FormNumberInput);
|
|
58
|
-
_this = _callSuper(this, FormNumberInput, [props, context]);
|
|
59
|
-
_this.state = {
|
|
60
|
-
focus: false,
|
|
61
|
-
valid: true,
|
|
62
|
-
showedValue: props.value,
|
|
63
|
-
disabled: props.disabled === true ? true : false,
|
|
64
|
-
focusOn: false
|
|
65
|
-
};
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
_inherits(FormNumberInput, _Component);
|
|
69
|
-
return _createClass(FormNumberInput, [{
|
|
70
|
-
key: "componentWillReceiveProps",
|
|
71
|
-
value: function componentWillReceiveProps(nextProps) {
|
|
72
|
-
if (this.props.value !== nextProps.value || this.props.focus !== nextProps.focus) {
|
|
73
|
-
this.setState({
|
|
74
|
-
showedValue: nextProps.value,
|
|
75
|
-
focusOn: nextProps.focus
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
if (this.props.focus !== nextProps.focus) {
|
|
79
|
-
this.Input.focus();
|
|
80
|
-
this.Input.select();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "render",
|
|
85
|
-
value: function render() {
|
|
86
|
-
var _this2 = this;
|
|
87
|
-
var _this$props = this.props,
|
|
88
|
-
value = _this$props.value,
|
|
89
|
-
min = _this$props.min,
|
|
90
|
-
max = _this$props.max,
|
|
91
|
-
precision = _this$props.precision,
|
|
92
|
-
onChange = _this$props.onChange,
|
|
93
|
-
onValid = _this$props.onValid,
|
|
94
|
-
onInvalid = _this$props.onInvalid,
|
|
95
|
-
style = _this$props.style,
|
|
96
|
-
placeholder = _this$props.placeholder;
|
|
97
|
-
var numericInputStyle = _objectSpread(_objectSpread({}, STYLE_INPUT), style);
|
|
98
|
-
if (this.state.focusOn) numericInputStyle.border = "1px solid ".concat(SharedStyle.SECONDARY_COLOR.main);
|
|
99
|
-
var regexp = new RegExp("^-?([0-9]+)?\\.?([0-9]{0,".concat(precision, "})?$"));
|
|
100
|
-
if (!isNaN(min) && isFinite(min) && this.state.showedValue < min) this.setState({
|
|
101
|
-
showedValue: min
|
|
102
|
-
}); // value = min;
|
|
103
|
-
if (!isNaN(max) && isFinite(max) && this.state.showedValue > max) this.setState({
|
|
104
|
-
showedValue: max
|
|
105
|
-
}); // value = max;
|
|
106
|
-
|
|
107
|
-
var currValue = regexp.test(this.state.showedValue) ? this.state.showedValue : parseFloat(this.state.showedValue).toFixed(precision);
|
|
108
|
-
var different = parseFloat(this.props.value).toFixed(precision) !== parseFloat(this.state.showedValue).toFixed(precision);
|
|
109
|
-
var saveFn = function saveFn(e) {
|
|
110
|
-
e.stopPropagation();
|
|
111
|
-
if (_this2.state.valid) {
|
|
112
|
-
var savedValue = _this2.state.showedValue !== '' && _this2.state.showedValue !== '-' ? parseFloat(_this2.state.showedValue) : 0;
|
|
113
|
-
_this2.setState({
|
|
114
|
-
showedValue: savedValue
|
|
115
|
-
});
|
|
116
|
-
onChange({
|
|
117
|
-
target: {
|
|
118
|
-
value: savedValue
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
124
|
-
style: {
|
|
125
|
-
position: 'relative'
|
|
126
|
-
}
|
|
127
|
-
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
128
|
-
autoFocus: this.state.focusOn,
|
|
129
|
-
readOnly: this.state.disabled,
|
|
130
|
-
type: "text",
|
|
131
|
-
value: currValue,
|
|
132
|
-
style: numericInputStyle,
|
|
133
|
-
onChange: function onChange(evt) {
|
|
134
|
-
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
135
|
-
if (valid) {
|
|
136
|
-
_this2.setState({
|
|
137
|
-
showedValue: evt.nativeEvent.target.value
|
|
138
|
-
});
|
|
139
|
-
if (onValid) onValid(evt.nativeEvent);
|
|
140
|
-
} else {
|
|
141
|
-
if (onInvalid) onInvalid(evt.nativeEvent);
|
|
142
|
-
}
|
|
143
|
-
_this2.setState({
|
|
144
|
-
valid: valid
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
onFocus: function onFocus(e) {
|
|
148
|
-
return _this2.setState({
|
|
149
|
-
focusOn: true
|
|
150
|
-
});
|
|
151
|
-
},
|
|
152
|
-
onBlur: function onBlur(e) {
|
|
153
|
-
return _this2.setState({
|
|
154
|
-
focusOn: false
|
|
155
|
-
});
|
|
156
|
-
},
|
|
157
|
-
ref: function ref(ele) {
|
|
158
|
-
_this2.Input = ele;
|
|
159
|
-
},
|
|
160
|
-
onKeyDown: function onKeyDown(e) {
|
|
161
|
-
var keyCode = e.keyCode || e.which;
|
|
162
|
-
if (keyCode == _constants.KEYBOARD_BUTTON_CODE.ENTER || keyCode == _constants.KEYBOARD_BUTTON_CODE.TAB) {
|
|
163
|
-
saveFn(e);
|
|
164
|
-
_this2.Input.blur();
|
|
165
|
-
}
|
|
166
|
-
if (keyCode == _constants.KEYBOARD_BUTTON_CODE.ESC) {
|
|
167
|
-
_this2.context.projectActions.rollback();
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
placeholder: placeholder
|
|
171
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
172
|
-
onClick: function onClick(e) {
|
|
173
|
-
if (different) saveFn(e);
|
|
174
|
-
},
|
|
175
|
-
title: this.context.translator.t('Confirm'),
|
|
176
|
-
style: _objectSpread(_objectSpread({}, confirmStyle), {}, {
|
|
177
|
-
visibility: different ? 'visible' : 'hidden',
|
|
178
|
-
opacity: different ? '1' : '0'
|
|
179
|
-
})
|
|
180
|
-
}, /*#__PURE__*/_react["default"].createElement(_md.MdUpdate, {
|
|
181
|
-
style: {
|
|
182
|
-
width: '100%',
|
|
183
|
-
height: '100%',
|
|
184
|
-
padding: '0.2em',
|
|
185
|
-
color: '#FFF'
|
|
186
|
-
}
|
|
187
|
-
})));
|
|
188
|
-
}
|
|
189
|
-
}]);
|
|
190
|
-
}(_react.Component);
|
|
191
|
-
FormNumberInput.propTypes = {
|
|
192
|
-
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
193
|
-
style: _propTypes["default"].object,
|
|
194
|
-
onChange: _propTypes["default"].func.isRequired,
|
|
195
|
-
onValid: _propTypes["default"].func,
|
|
196
|
-
onInvalid: _propTypes["default"].func,
|
|
197
|
-
min: _propTypes["default"].number,
|
|
198
|
-
max: _propTypes["default"].number,
|
|
199
|
-
precision: _propTypes["default"].number,
|
|
200
|
-
placeholder: _propTypes["default"].string
|
|
201
|
-
};
|
|
202
|
-
FormNumberInput.contextTypes = {
|
|
203
|
-
translator: _propTypes["default"].object.isRequired,
|
|
204
|
-
projectActions: _propTypes["default"].object.isRequired
|
|
205
|
-
};
|
|
206
|
-
FormNumberInput.defaultProps = {
|
|
207
|
-
value: 0,
|
|
208
|
-
style: {},
|
|
209
|
-
min: Number.MIN_SAFE_INTEGER,
|
|
210
|
-
max: Number.MAX_SAFE_INTEGER,
|
|
211
|
-
precision: 2,
|
|
212
|
-
disabled: false
|
|
213
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = FormSelect;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _constants = require("../../constants");
|
|
10
|
-
var _excluded = ["children", "style"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
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); }
|
|
18
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
-
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."); }
|
|
20
|
-
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; } }
|
|
21
|
-
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; }
|
|
22
|
-
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; } }
|
|
23
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
|
-
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; }
|
|
25
|
-
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; }
|
|
26
|
-
var styles = {
|
|
27
|
-
select: {
|
|
28
|
-
display: 'block',
|
|
29
|
-
width: 120,
|
|
30
|
-
"float": 'right',
|
|
31
|
-
padding: '15px 10px 12px 0px',
|
|
32
|
-
color: _constants.TEXT_COLOR_NEUTRAL_3,
|
|
33
|
-
border: '2px solid',
|
|
34
|
-
fontFamily: _constants.DEFAULT_FONT_FAMILY,
|
|
35
|
-
fontSize: 12,
|
|
36
|
-
fontWeight: 600,
|
|
37
|
-
lineHeight: '17px',
|
|
38
|
-
textAlign: 'right',
|
|
39
|
-
outline: 'none',
|
|
40
|
-
borderRadius: 5,
|
|
41
|
-
transition: 'border-color 0.2s'
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
function FormSelect(_ref) {
|
|
45
|
-
var children = _ref.children,
|
|
46
|
-
style = _ref.style,
|
|
47
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
-
var _React$useState = _react["default"].useState(false),
|
|
49
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
-
focus = _React$useState2[0],
|
|
51
|
-
setFocus = _React$useState2[1];
|
|
52
|
-
var _React$useState3 = _react["default"].useState(false),
|
|
53
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
54
|
-
hover = _React$useState4[0],
|
|
55
|
-
setHover = _React$useState4[1];
|
|
56
|
-
var borderColor = focus || hover ? _constants.SECONDARY_PURPLE_COLOR : undefined;
|
|
57
|
-
return /*#__PURE__*/_react["default"].createElement("select", _extends({
|
|
58
|
-
type: "text",
|
|
59
|
-
style: _objectSpread(_objectSpread({}, styles.select), {}, {
|
|
60
|
-
borderColor: borderColor
|
|
61
|
-
}, style),
|
|
62
|
-
onFocus: function onFocus() {
|
|
63
|
-
return setFocus(true);
|
|
64
|
-
},
|
|
65
|
-
onBlur: function onBlur() {
|
|
66
|
-
return setFocus(false);
|
|
67
|
-
},
|
|
68
|
-
onMouseEnter: function onMouseEnter() {
|
|
69
|
-
return setHover(true);
|
|
70
|
-
},
|
|
71
|
-
onMouseLeave: function onMouseLeave() {
|
|
72
|
-
return setHover(false);
|
|
73
|
-
}
|
|
74
|
-
}, rest), children);
|
|
75
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = FormNumberInput;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _formTextInput = _interopRequireDefault(require("./form-text-input"));
|
|
9
|
-
var _excluded = ["value", "onChange", "min", "max", "step"];
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
var sliderContainerStyle = {
|
|
15
|
-
display: 'inline-block',
|
|
16
|
-
width: '80%',
|
|
17
|
-
marginRight: '5%'
|
|
18
|
-
};
|
|
19
|
-
var sliderStyle = {
|
|
20
|
-
display: 'block',
|
|
21
|
-
width: '100%',
|
|
22
|
-
height: '30px'
|
|
23
|
-
};
|
|
24
|
-
var textContainerStyle = {
|
|
25
|
-
display: 'inline-block',
|
|
26
|
-
width: '15%',
|
|
27
|
-
"float": 'right'
|
|
28
|
-
};
|
|
29
|
-
var textStyle = {
|
|
30
|
-
height: '34px',
|
|
31
|
-
textAlign: 'center'
|
|
32
|
-
};
|
|
33
|
-
function FormNumberInput(_ref) {
|
|
34
|
-
var value = _ref.value,
|
|
35
|
-
onChange = _ref.onChange,
|
|
36
|
-
_ref$min = _ref.min,
|
|
37
|
-
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
38
|
-
_ref$max = _ref.max,
|
|
39
|
-
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
40
|
-
_ref$step = _ref.step,
|
|
41
|
-
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
42
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
// Handle both slider and text input changes
|
|
44
|
-
var handleSliderChange = function handleSliderChange(e) {
|
|
45
|
-
onChange(Number(e.target.value));
|
|
46
|
-
};
|
|
47
|
-
var handleTextChange = function handleTextChange(e) {
|
|
48
|
-
var val = e.target.value === '' ? '' : Number(e.target.value);
|
|
49
|
-
onChange(val);
|
|
50
|
-
};
|
|
51
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
-
style: sliderContainerStyle
|
|
53
|
-
}, /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
54
|
-
type: "range",
|
|
55
|
-
style: sliderStyle,
|
|
56
|
-
min: min,
|
|
57
|
-
max: max,
|
|
58
|
-
step: step,
|
|
59
|
-
value: value,
|
|
60
|
-
onChange: handleSliderChange
|
|
61
|
-
}, rest))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
-
style: textContainerStyle
|
|
63
|
-
}, /*#__PURE__*/_react["default"].createElement(_formTextInput["default"], {
|
|
64
|
-
value: value,
|
|
65
|
-
onChange: handleTextChange,
|
|
66
|
-
style: textStyle
|
|
67
|
-
})));
|
|
68
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = FormSubmitButton;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _button = _interopRequireDefault(require("./button"));
|
|
10
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
11
|
-
var _excluded = ["children"];
|
|
12
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
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); }
|
|
15
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
-
var STYLE = {
|
|
18
|
-
borderColor: '#415375',
|
|
19
|
-
backgroundColor: '#415375',
|
|
20
|
-
color: SharedStyle.COLORS.white
|
|
21
|
-
};
|
|
22
|
-
var STYLE_HOVER = {
|
|
23
|
-
borderColor: '#1f3149',
|
|
24
|
-
backgroundColor: '#1f3149',
|
|
25
|
-
color: SharedStyle.COLORS.white
|
|
26
|
-
};
|
|
27
|
-
function FormSubmitButton(_ref) {
|
|
28
|
-
var children = _ref.children,
|
|
29
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
-
return /*#__PURE__*/_react["default"].createElement(_button["default"], _extends({
|
|
31
|
-
type: "submit",
|
|
32
|
-
style: STYLE,
|
|
33
|
-
styleHover: STYLE_HOVER
|
|
34
|
-
}, rest), children);
|
|
35
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _constants = require("../../constants");
|
|
10
|
-
var _excluded = ["style"];
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
20
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
-
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); }
|
|
23
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
25
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
26
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
28
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
29
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
|
-
var styles = {
|
|
31
|
-
input: {
|
|
32
|
-
display: 'block',
|
|
33
|
-
padding: '15px 10px 12px 0px',
|
|
34
|
-
width: 120,
|
|
35
|
-
fontFamily: _constants.DEFAULT_FONT_FAMILY,
|
|
36
|
-
fontSize: 12,
|
|
37
|
-
fontWeight: 600,
|
|
38
|
-
lineHeight: '17px',
|
|
39
|
-
color: _constants.TEXT_COLOR_NEUTRAL_3,
|
|
40
|
-
backgroundColor: _constants.BG_COLOR_0,
|
|
41
|
-
border: '2px solid',
|
|
42
|
-
textAlign: 'right',
|
|
43
|
-
"float": 'right',
|
|
44
|
-
borderRadius: 5,
|
|
45
|
-
outline: 0,
|
|
46
|
-
transition: 'border-color 0.2s'
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var FormTextInput = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
50
|
-
function FormTextInput(props) {
|
|
51
|
-
var _this;
|
|
52
|
-
_classCallCheck(this, FormTextInput);
|
|
53
|
-
_this = _callSuper(this, FormTextInput, [props]);
|
|
54
|
-
_this.state = {
|
|
55
|
-
focus: false
|
|
56
|
-
};
|
|
57
|
-
_this.input = /*#__PURE__*/_react["default"].createRef(null);
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
_inherits(FormTextInput, _Component);
|
|
61
|
-
return _createClass(FormTextInput, [{
|
|
62
|
-
key: "componentDidMount",
|
|
63
|
-
value: function componentDidMount() {
|
|
64
|
-
if (this.input.current) {
|
|
65
|
-
this.input.current.select();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "render",
|
|
70
|
-
value: function render() {
|
|
71
|
-
var _this2 = this;
|
|
72
|
-
var _this$props = this.props,
|
|
73
|
-
style = _this$props.style,
|
|
74
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
75
|
-
var focus = this.state.focus;
|
|
76
|
-
var inputStyle = _objectSpread(_objectSpread({}, styles.input), {}, {
|
|
77
|
-
borderColor: focus ? _constants.SECONDARY_PURPLE_COLOR : undefined
|
|
78
|
-
}, style);
|
|
79
|
-
return /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
80
|
-
ref: this.input,
|
|
81
|
-
onFocus: function onFocus() {
|
|
82
|
-
return _this2.setState({
|
|
83
|
-
focus: true
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
onBlur: function onBlur() {
|
|
87
|
-
return _this2.setState({
|
|
88
|
-
focus: false
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
style: inputStyle,
|
|
92
|
-
type: "text"
|
|
93
|
-
}, rest, {
|
|
94
|
-
maxLength: _constants.PROJECT_NAME_LENGTH_LIMIT
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
}]);
|
|
98
|
-
}(_react.Component);
|
|
99
|
-
FormTextInput.defaultProps = {
|
|
100
|
-
style: {}
|
|
101
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = Area;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _polylabel = _interopRequireDefault(require("polylabel"));
|
|
10
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
11
|
-
var _math = require("../../utils/math");
|
|
12
|
-
var _constants = require("../../constants");
|
|
13
|
-
var _utils = require("./utils");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
-
var STYLE_TEXT = {
|
|
16
|
-
textAnchor: 'middle',
|
|
17
|
-
fontSize: '12px',
|
|
18
|
-
fontFamily: '"Courier New", Courier, monospace',
|
|
19
|
-
pointerEvents: 'none',
|
|
20
|
-
fontWeight: 'bold',
|
|
21
|
-
//http://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting-using-css
|
|
22
|
-
WebkitTouchCallout: 'none' /* iOS Safari */,
|
|
23
|
-
WebkitUserSelect: 'none' /* Chrome/Safari/Opera */,
|
|
24
|
-
MozUserSelect: 'none' /* Firefox */,
|
|
25
|
-
MsUserSelect: 'none' /* Internet Explorer/Edge */,
|
|
26
|
-
userSelect: 'none'
|
|
27
|
-
};
|
|
28
|
-
function Area(_ref) {
|
|
29
|
-
var layer = _ref.layer,
|
|
30
|
-
area = _ref.area,
|
|
31
|
-
catalog = _ref.catalog;
|
|
32
|
-
var rendered = catalog.getElement(area.type).render2D(area, layer);
|
|
33
|
-
// let element = catalog.getElement(item.type);
|
|
34
|
-
// let renderedItem = element.render2D(item, layer, scene);
|
|
35
|
-
var renderedAreaSize = null;
|
|
36
|
-
if (area.selected) {
|
|
37
|
-
var polygon = area.vertices.toArray().map(function (vertexID) {
|
|
38
|
-
var _layer$vertices$get = layer.vertices.get(vertexID),
|
|
39
|
-
x = _layer$vertices$get.x,
|
|
40
|
-
y = _layer$vertices$get.y;
|
|
41
|
-
return [x, y];
|
|
42
|
-
});
|
|
43
|
-
var polygonWithHoles = polygon;
|
|
44
|
-
area.holes.forEach(function (holeID) {
|
|
45
|
-
var polygonHole = layer.areas.get(holeID).vertices.toArray().map(function (vertexID) {
|
|
46
|
-
var _layer$vertices$get2 = layer.vertices.get(vertexID),
|
|
47
|
-
x = _layer$vertices$get2.x,
|
|
48
|
-
y = _layer$vertices$get2.y;
|
|
49
|
-
return [x, y];
|
|
50
|
-
});
|
|
51
|
-
polygonWithHoles = polygonWithHoles.concat(polygonHole.reverse());
|
|
52
|
-
});
|
|
53
|
-
var center = (0, _polylabel["default"])([polygonWithHoles], 1.0);
|
|
54
|
-
var areaSize = (0, _utils.areaPolygon)(polygon, false);
|
|
55
|
-
//subtract holes area
|
|
56
|
-
area.holes.forEach(function (areaID) {
|
|
57
|
-
var hole = layer.areas.get(areaID);
|
|
58
|
-
var holePolygon = hole.vertices.toArray().map(function (vertexID) {
|
|
59
|
-
var _layer$vertices$get3 = layer.vertices.get(vertexID),
|
|
60
|
-
x = _layer$vertices$get3.x,
|
|
61
|
-
y = _layer$vertices$get3.y;
|
|
62
|
-
return [x, y];
|
|
63
|
-
});
|
|
64
|
-
areaSize -= (0, _utils.areaPolygon)(holePolygon, false);
|
|
65
|
-
});
|
|
66
|
-
renderedAreaSize = /*#__PURE__*/_react["default"].createElement("text", {
|
|
67
|
-
x: "0",
|
|
68
|
-
y: "0",
|
|
69
|
-
transform: "translate(".concat(center[0], " ").concat(center[1], ") scale(1, -1)"),
|
|
70
|
-
style: STYLE_TEXT
|
|
71
|
-
}, (0, _math.formatNumber)((0, _convertUnits["default"])(areaSize).from('cm2').to('ft2'), _constants.DECIMAL_PLACES_2), ' ', "ft", String.fromCharCode(0xb2));
|
|
72
|
-
}
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement("g", {
|
|
74
|
-
"data-element-root": true,
|
|
75
|
-
"data-prototype": area.prototype,
|
|
76
|
-
"data-id": area.id,
|
|
77
|
-
"data-selected": area.selected,
|
|
78
|
-
"data-layer": layer.id,
|
|
79
|
-
style: {
|
|
80
|
-
opacity: 1
|
|
81
|
-
}
|
|
82
|
-
}, rendered, renderedAreaSize);
|
|
83
|
-
}
|
|
84
|
-
Area.propTypes = {
|
|
85
|
-
area: _propTypes["default"].object.isRequired,
|
|
86
|
-
layer: _propTypes["default"].object.isRequired,
|
|
87
|
-
catalog: _propTypes["default"].object.isRequired
|
|
88
|
-
};
|