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
package/es/utils/threeCSG.es6.js
DELETED
|
@@ -1,498 +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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
-
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); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), 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
|
-
/*jshint esversion: 6 */
|
|
8
|
-
import * as THREE from 'three';
|
|
9
|
-
var EPSILON = 1e-5,
|
|
10
|
-
COPLANAR = 0,
|
|
11
|
-
FRONT = 1,
|
|
12
|
-
BACK = 2,
|
|
13
|
-
SPANNING = 3;
|
|
14
|
-
var ThreeBSP = /*#__PURE__*/function () {
|
|
15
|
-
function ThreeBSP(geometry) {
|
|
16
|
-
_classCallCheck(this, ThreeBSP);
|
|
17
|
-
// Convert THREE.Geometry to ThreeBSP
|
|
18
|
-
var i,
|
|
19
|
-
_length_i,
|
|
20
|
-
face,
|
|
21
|
-
vertex,
|
|
22
|
-
faceVertexUvs,
|
|
23
|
-
uvs,
|
|
24
|
-
polygon,
|
|
25
|
-
polygons = [],
|
|
26
|
-
tree;
|
|
27
|
-
this.Polygon = Polygon;
|
|
28
|
-
this.Vertex = Vertex;
|
|
29
|
-
this.Node = Node;
|
|
30
|
-
if (geometry instanceof THREE.BufferGeometry) {
|
|
31
|
-
this.matrix = new THREE.Matrix4();
|
|
32
|
-
} else if (geometry instanceof THREE.Mesh) {
|
|
33
|
-
// #todo: add hierarchy support
|
|
34
|
-
geometry.updateMatrix();
|
|
35
|
-
this.matrix = geometry.matrix.clone();
|
|
36
|
-
geometry = geometry.geometry;
|
|
37
|
-
} else if (geometry instanceof Node) {
|
|
38
|
-
this.tree = geometry;
|
|
39
|
-
this.matrix = new THREE.Matrix4();
|
|
40
|
-
return this;
|
|
41
|
-
} else {
|
|
42
|
-
throw 'ThreeBSP: Given geometry is unsupported';
|
|
43
|
-
}
|
|
44
|
-
// Retrieve attributes and indices
|
|
45
|
-
var positionAttribute = geometry.attributes.position;
|
|
46
|
-
var normalAttribute = geometry.attributes.normal;
|
|
47
|
-
var uvAttribute = geometry.attributes.uv;
|
|
48
|
-
var indexAttribute = geometry.index;
|
|
49
|
-
for (var _i = 0; _i < indexAttribute.count; _i += 3) {
|
|
50
|
-
polygon = new Polygon();
|
|
51
|
-
for (var j = 0; j < 3; j++) {
|
|
52
|
-
var index = indexAttribute.getX(_i + j);
|
|
53
|
-
var _vertex = new THREE.Vector3().fromBufferAttribute(positionAttribute, index);
|
|
54
|
-
var normal = new THREE.Vector3().fromBufferAttribute(normalAttribute, index);
|
|
55
|
-
var _uvs = uvAttribute ? new THREE.Vector2().fromBufferAttribute(uvAttribute, index) : null;
|
|
56
|
-
var vertexData = new Vertex(_vertex.x, _vertex.y, _vertex.z, normal, _uvs);
|
|
57
|
-
vertexData.applyMatrix4(this.matrix);
|
|
58
|
-
polygon.vertices.push(vertexData);
|
|
59
|
-
}
|
|
60
|
-
polygon.calculateProperties();
|
|
61
|
-
polygons.push(polygon);
|
|
62
|
-
}
|
|
63
|
-
this.tree = new Node(polygons);
|
|
64
|
-
}
|
|
65
|
-
return _createClass(ThreeBSP, [{
|
|
66
|
-
key: "subtract",
|
|
67
|
-
value: function subtract(other_tree) {
|
|
68
|
-
var a = this.tree.clone(),
|
|
69
|
-
b = other_tree.tree.clone();
|
|
70
|
-
a.invert();
|
|
71
|
-
a.clipTo(b);
|
|
72
|
-
b.clipTo(a);
|
|
73
|
-
b.invert();
|
|
74
|
-
b.clipTo(a);
|
|
75
|
-
b.invert();
|
|
76
|
-
a.build(b.allPolygons());
|
|
77
|
-
a.invert();
|
|
78
|
-
a = new ThreeBSP(a);
|
|
79
|
-
a.matrix = this.matrix;
|
|
80
|
-
return a;
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
key: "union",
|
|
84
|
-
value: function union(other_tree) {
|
|
85
|
-
var a = this.tree.clone(),
|
|
86
|
-
b = other_tree.tree.clone();
|
|
87
|
-
a.clipTo(b);
|
|
88
|
-
b.clipTo(a);
|
|
89
|
-
b.invert();
|
|
90
|
-
b.clipTo(a);
|
|
91
|
-
b.invert();
|
|
92
|
-
a.build(b.allPolygons());
|
|
93
|
-
a = new ThreeBSP(a);
|
|
94
|
-
a.matrix = this.matrix;
|
|
95
|
-
return a;
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: "intersect",
|
|
99
|
-
value: function intersect(other_tree) {
|
|
100
|
-
var a = this.tree.clone(),
|
|
101
|
-
b = other_tree.tree.clone();
|
|
102
|
-
a.invert();
|
|
103
|
-
b.clipTo(a);
|
|
104
|
-
b.invert();
|
|
105
|
-
a.clipTo(b);
|
|
106
|
-
b.clipTo(a);
|
|
107
|
-
a.build(b.allPolygons());
|
|
108
|
-
a.invert();
|
|
109
|
-
a = new ThreeBSP(a);
|
|
110
|
-
a.matrix = this.matrix;
|
|
111
|
-
return a;
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
key: "toGeometry",
|
|
115
|
-
value: function toGeometry() {
|
|
116
|
-
var matrix = new THREE.Matrix4().copy(this.matrix).invert();
|
|
117
|
-
var geometry = new THREE.BufferGeometry();
|
|
118
|
-
var polygons = this.tree.allPolygons();
|
|
119
|
-
var verticeDict = new Map();
|
|
120
|
-
var positions = [];
|
|
121
|
-
var normals = [];
|
|
122
|
-
var uvs = [];
|
|
123
|
-
var indices = [];
|
|
124
|
-
polygons.forEach(function (polygon) {
|
|
125
|
-
var polygonVertices = polygon.vertices;
|
|
126
|
-
var _loop = function _loop() {
|
|
127
|
-
var verts = [polygonVertices[0], polygonVertices[j - 1], polygonVertices[j]];
|
|
128
|
-
var verticeIndices = [];
|
|
129
|
-
verts.forEach(function (vertex) {
|
|
130
|
-
var vector = new THREE.Vector3(vertex.x, vertex.y, vertex.z).applyMatrix4(matrix);
|
|
131
|
-
var verticeIndex = positions.length / 3;
|
|
132
|
-
verticeIndices.push(verticeIndex);
|
|
133
|
-
positions.push(vector.x, vector.y, vector.z);
|
|
134
|
-
normals.push(vertex.normal.x, vertex.normal.y, vertex.normal.z);
|
|
135
|
-
uvs.push(vertex.uv.x, vertex.uv.y);
|
|
136
|
-
});
|
|
137
|
-
indices.push(verticeIndices[0], verticeIndices[1], verticeIndices[2]);
|
|
138
|
-
};
|
|
139
|
-
for (var j = 2; j < polygonVertices.length; j++) {
|
|
140
|
-
_loop();
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
geometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3));
|
|
144
|
-
geometry.setAttribute('normal', new THREE.Float32BufferAttribute(normals, 3));
|
|
145
|
-
geometry.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));
|
|
146
|
-
geometry.setIndex(indices);
|
|
147
|
-
return geometry;
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "toMesh",
|
|
151
|
-
value: function toMesh(material) {
|
|
152
|
-
var geometry = this.toGeometry(),
|
|
153
|
-
mesh = new THREE.Mesh(geometry, material);
|
|
154
|
-
mesh.position.setFromMatrixPosition(this.matrix);
|
|
155
|
-
mesh.rotation.setFromRotationMatrix(this.matrix);
|
|
156
|
-
return mesh;
|
|
157
|
-
}
|
|
158
|
-
}]);
|
|
159
|
-
}();
|
|
160
|
-
export { ThreeBSP as default };
|
|
161
|
-
var Polygon = /*#__PURE__*/function () {
|
|
162
|
-
function Polygon(vertices, normal, w) {
|
|
163
|
-
_classCallCheck(this, Polygon);
|
|
164
|
-
if (!(vertices instanceof Array)) {
|
|
165
|
-
vertices = [];
|
|
166
|
-
}
|
|
167
|
-
this.vertices = vertices;
|
|
168
|
-
if (vertices.length > 0) {
|
|
169
|
-
this.calculateProperties();
|
|
170
|
-
} else {
|
|
171
|
-
this.normal = this.w = undefined;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return _createClass(Polygon, [{
|
|
175
|
-
key: "calculateProperties",
|
|
176
|
-
value: function calculateProperties() {
|
|
177
|
-
var a = this.vertices[0],
|
|
178
|
-
b = this.vertices[1],
|
|
179
|
-
c = this.vertices[2];
|
|
180
|
-
this.normal = b.clone().subtract(a).cross(c.clone().subtract(a)).normalize();
|
|
181
|
-
this.w = this.normal.clone().dot(a);
|
|
182
|
-
return this;
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
key: "clone",
|
|
186
|
-
value: function clone() {
|
|
187
|
-
var i,
|
|
188
|
-
vertice_count,
|
|
189
|
-
polygon = new Polygon();
|
|
190
|
-
for (i = 0, vertice_count = this.vertices.length; i < vertice_count; i++) {
|
|
191
|
-
polygon.vertices.push(this.vertices[i].clone());
|
|
192
|
-
}
|
|
193
|
-
polygon.calculateProperties();
|
|
194
|
-
return polygon;
|
|
195
|
-
}
|
|
196
|
-
}, {
|
|
197
|
-
key: "flip",
|
|
198
|
-
value: function flip() {
|
|
199
|
-
var i,
|
|
200
|
-
vertices = [];
|
|
201
|
-
this.normal.multiplyScalar(-1);
|
|
202
|
-
this.w *= -1;
|
|
203
|
-
for (i = this.vertices.length - 1; i >= 0; i--) {
|
|
204
|
-
vertices.push(this.vertices[i]);
|
|
205
|
-
}
|
|
206
|
-
this.vertices = vertices;
|
|
207
|
-
return this;
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "classifyVertex",
|
|
211
|
-
value: function classifyVertex(vertex) {
|
|
212
|
-
var side_value = this.normal.dot(vertex) - this.w;
|
|
213
|
-
if (side_value < -EPSILON) {
|
|
214
|
-
return BACK;
|
|
215
|
-
} else if (side_value > EPSILON) {
|
|
216
|
-
return FRONT;
|
|
217
|
-
} else {
|
|
218
|
-
return COPLANAR;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
key: "classifySide",
|
|
223
|
-
value: function classifySide(polygon) {
|
|
224
|
-
var i,
|
|
225
|
-
vertex,
|
|
226
|
-
classification,
|
|
227
|
-
num_positive = 0,
|
|
228
|
-
num_negative = 0,
|
|
229
|
-
vertice_count = polygon.vertices.length;
|
|
230
|
-
for (i = 0; i < vertice_count; i++) {
|
|
231
|
-
vertex = polygon.vertices[i];
|
|
232
|
-
classification = this.classifyVertex(vertex);
|
|
233
|
-
if (classification === FRONT) {
|
|
234
|
-
num_positive++;
|
|
235
|
-
} else if (classification === BACK) {
|
|
236
|
-
num_negative++;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (num_positive > 0 && num_negative === 0) {
|
|
240
|
-
return FRONT;
|
|
241
|
-
} else if (num_positive === 0 && num_negative > 0) {
|
|
242
|
-
return BACK;
|
|
243
|
-
} else if (num_positive === 0 && num_negative === 0) {
|
|
244
|
-
return COPLANAR;
|
|
245
|
-
} else {
|
|
246
|
-
return SPANNING;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}, {
|
|
250
|
-
key: "splitPolygon",
|
|
251
|
-
value: function splitPolygon(polygon, coplanar_front, coplanar_back, front, back) {
|
|
252
|
-
var classification = this.classifySide(polygon);
|
|
253
|
-
if (classification === COPLANAR) {
|
|
254
|
-
(this.normal.dot(polygon.normal) > 0 ? coplanar_front : coplanar_back).push(polygon);
|
|
255
|
-
} else if (classification === FRONT) {
|
|
256
|
-
front.push(polygon);
|
|
257
|
-
} else if (classification === BACK) {
|
|
258
|
-
back.push(polygon);
|
|
259
|
-
} else {
|
|
260
|
-
var vertice_count,
|
|
261
|
-
i,
|
|
262
|
-
j,
|
|
263
|
-
ti,
|
|
264
|
-
tj,
|
|
265
|
-
vi,
|
|
266
|
-
vj,
|
|
267
|
-
t,
|
|
268
|
-
v,
|
|
269
|
-
f = [],
|
|
270
|
-
b = [];
|
|
271
|
-
for (i = 0, vertice_count = polygon.vertices.length; i < vertice_count; i++) {
|
|
272
|
-
j = (i + 1) % vertice_count;
|
|
273
|
-
vi = polygon.vertices[i];
|
|
274
|
-
vj = polygon.vertices[j];
|
|
275
|
-
ti = this.classifyVertex(vi);
|
|
276
|
-
tj = this.classifyVertex(vj);
|
|
277
|
-
if (ti != BACK) f.push(vi);
|
|
278
|
-
if (ti != FRONT) b.push(vi);
|
|
279
|
-
if ((ti | tj) === SPANNING) {
|
|
280
|
-
t = (this.w - this.normal.dot(vi)) / this.normal.dot(vj.clone().subtract(vi));
|
|
281
|
-
v = vi.interpolate(vj, t);
|
|
282
|
-
f.push(v);
|
|
283
|
-
b.push(v);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (f.length >= 3) front.push(new Polygon(f).calculateProperties());
|
|
287
|
-
if (b.length >= 3) back.push(new Polygon(b).calculateProperties());
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}]);
|
|
291
|
-
}();
|
|
292
|
-
var Vertex = /*#__PURE__*/function () {
|
|
293
|
-
function Vertex(x, y, z, normal, uv) {
|
|
294
|
-
_classCallCheck(this, Vertex);
|
|
295
|
-
this.x = x;
|
|
296
|
-
this.y = y;
|
|
297
|
-
this.z = z;
|
|
298
|
-
this.normal = normal || new THREE.Vector3();
|
|
299
|
-
this.uv = uv || new THREE.Vector2();
|
|
300
|
-
}
|
|
301
|
-
return _createClass(Vertex, [{
|
|
302
|
-
key: "clone",
|
|
303
|
-
value: function clone() {
|
|
304
|
-
return new Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone());
|
|
305
|
-
}
|
|
306
|
-
}, {
|
|
307
|
-
key: "add",
|
|
308
|
-
value: function add(vertex) {
|
|
309
|
-
this.x += vertex.x;
|
|
310
|
-
this.y += vertex.y;
|
|
311
|
-
this.z += vertex.z;
|
|
312
|
-
return this;
|
|
313
|
-
}
|
|
314
|
-
}, {
|
|
315
|
-
key: "subtract",
|
|
316
|
-
value: function subtract(vertex) {
|
|
317
|
-
this.x -= vertex.x;
|
|
318
|
-
this.y -= vertex.y;
|
|
319
|
-
this.z -= vertex.z;
|
|
320
|
-
return this;
|
|
321
|
-
}
|
|
322
|
-
}, {
|
|
323
|
-
key: "multiplyScalar",
|
|
324
|
-
value: function multiplyScalar(scalar) {
|
|
325
|
-
this.x *= scalar;
|
|
326
|
-
this.y *= scalar;
|
|
327
|
-
this.z *= scalar;
|
|
328
|
-
return this;
|
|
329
|
-
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "cross",
|
|
332
|
-
value: function cross(vertex) {
|
|
333
|
-
var x = this.x,
|
|
334
|
-
y = this.y,
|
|
335
|
-
z = this.z;
|
|
336
|
-
this.x = y * vertex.z - z * vertex.y;
|
|
337
|
-
this.y = z * vertex.x - x * vertex.z;
|
|
338
|
-
this.z = x * vertex.y - y * vertex.x;
|
|
339
|
-
return this;
|
|
340
|
-
}
|
|
341
|
-
}, {
|
|
342
|
-
key: "normalize",
|
|
343
|
-
value: function normalize() {
|
|
344
|
-
var length = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
345
|
-
this.x /= length;
|
|
346
|
-
this.y /= length;
|
|
347
|
-
this.z /= length;
|
|
348
|
-
return this;
|
|
349
|
-
}
|
|
350
|
-
}, {
|
|
351
|
-
key: "dot",
|
|
352
|
-
value: function dot(vertex) {
|
|
353
|
-
return this.x * vertex.x + this.y * vertex.y + this.z * vertex.z;
|
|
354
|
-
}
|
|
355
|
-
}, {
|
|
356
|
-
key: "lerp",
|
|
357
|
-
value: function lerp(a, t) {
|
|
358
|
-
this.add(a.clone().subtract(this).multiplyScalar(t));
|
|
359
|
-
this.normal.add(a.normal.clone().sub(this.normal).multiplyScalar(t));
|
|
360
|
-
this.uv.add(a.uv.clone().sub(this.uv).multiplyScalar(t));
|
|
361
|
-
return this;
|
|
362
|
-
}
|
|
363
|
-
}, {
|
|
364
|
-
key: "interpolate",
|
|
365
|
-
value: function interpolate(other, t) {
|
|
366
|
-
return this.clone().lerp(other, t);
|
|
367
|
-
}
|
|
368
|
-
}, {
|
|
369
|
-
key: "applyMatrix4",
|
|
370
|
-
value: function applyMatrix4(m) {
|
|
371
|
-
// input: THREE.Matrix4 affine matrix
|
|
372
|
-
|
|
373
|
-
var x = this.x,
|
|
374
|
-
y = this.y,
|
|
375
|
-
z = this.z;
|
|
376
|
-
var e = m.elements;
|
|
377
|
-
this.x = e[0] * x + e[4] * y + e[8] * z + e[12];
|
|
378
|
-
this.y = e[1] * x + e[5] * y + e[9] * z + e[13];
|
|
379
|
-
this.z = e[2] * x + e[6] * y + e[10] * z + e[14];
|
|
380
|
-
return this;
|
|
381
|
-
}
|
|
382
|
-
}]);
|
|
383
|
-
}();
|
|
384
|
-
var Node = /*#__PURE__*/function () {
|
|
385
|
-
function Node(polygons) {
|
|
386
|
-
_classCallCheck(this, Node);
|
|
387
|
-
var i,
|
|
388
|
-
polygon_count,
|
|
389
|
-
front = [],
|
|
390
|
-
back = [];
|
|
391
|
-
this.polygons = [];
|
|
392
|
-
this.front = this.back = undefined;
|
|
393
|
-
if (!(polygons instanceof Array) || polygons.length === 0) return;
|
|
394
|
-
this.divider = polygons[0].clone();
|
|
395
|
-
for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
|
|
396
|
-
this.divider.splitPolygon(polygons[i], this.polygons, this.polygons, front, back);
|
|
397
|
-
}
|
|
398
|
-
if (front.length > 0) {
|
|
399
|
-
this.front = new Node(front);
|
|
400
|
-
}
|
|
401
|
-
if (back.length > 0) {
|
|
402
|
-
this.back = new Node(back);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return _createClass(Node, [{
|
|
406
|
-
key: "isConvex",
|
|
407
|
-
value: function isConvex(polygons) {
|
|
408
|
-
var i, j;
|
|
409
|
-
for (i = 0; i < polygons.length; i++) {
|
|
410
|
-
for (j = 0; j < polygons.length; j++) {
|
|
411
|
-
if (i !== j && polygons[i].classifySide(polygons[j]) !== BACK) {
|
|
412
|
-
return false;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return true;
|
|
417
|
-
}
|
|
418
|
-
}, {
|
|
419
|
-
key: "build",
|
|
420
|
-
value: function build(polygons) {
|
|
421
|
-
var i,
|
|
422
|
-
polygon_count,
|
|
423
|
-
front = [],
|
|
424
|
-
back = [];
|
|
425
|
-
if (!this.divider) {
|
|
426
|
-
this.divider = polygons[0].clone();
|
|
427
|
-
}
|
|
428
|
-
for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
|
|
429
|
-
this.divider.splitPolygon(polygons[i], this.polygons, this.polygons, front, back);
|
|
430
|
-
}
|
|
431
|
-
if (front.length > 0) {
|
|
432
|
-
if (!this.front) this.front = new Node();
|
|
433
|
-
this.front.build(front);
|
|
434
|
-
}
|
|
435
|
-
if (back.length > 0) {
|
|
436
|
-
if (!this.back) this.back = new Node();
|
|
437
|
-
this.back.build(back);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}, {
|
|
441
|
-
key: "allPolygons",
|
|
442
|
-
value: function allPolygons() {
|
|
443
|
-
var polygons = this.polygons.slice();
|
|
444
|
-
if (this.front) polygons = polygons.concat(this.front.allPolygons());
|
|
445
|
-
if (this.back) polygons = polygons.concat(this.back.allPolygons());
|
|
446
|
-
return polygons;
|
|
447
|
-
}
|
|
448
|
-
}, {
|
|
449
|
-
key: "clone",
|
|
450
|
-
value: function clone() {
|
|
451
|
-
var node = new Node();
|
|
452
|
-
node.divider = this.divider.clone();
|
|
453
|
-
node.polygons = this.polygons.map(function (polygon) {
|
|
454
|
-
return polygon.clone();
|
|
455
|
-
});
|
|
456
|
-
node.front = this.front && this.front.clone();
|
|
457
|
-
node.back = this.back && this.back.clone();
|
|
458
|
-
return node;
|
|
459
|
-
}
|
|
460
|
-
}, {
|
|
461
|
-
key: "invert",
|
|
462
|
-
value: function invert() {
|
|
463
|
-
var i, polygon_count, temp;
|
|
464
|
-
for (i = 0, polygon_count = this.polygons.length; i < polygon_count; i++) {
|
|
465
|
-
this.polygons[i].flip();
|
|
466
|
-
}
|
|
467
|
-
this.divider.flip();
|
|
468
|
-
if (this.front) this.front.invert();
|
|
469
|
-
if (this.back) this.back.invert();
|
|
470
|
-
temp = this.front;
|
|
471
|
-
this.front = this.back;
|
|
472
|
-
this.back = temp;
|
|
473
|
-
return this;
|
|
474
|
-
}
|
|
475
|
-
}, {
|
|
476
|
-
key: "clipPolygons",
|
|
477
|
-
value: function clipPolygons(polygons) {
|
|
478
|
-
var i, polygon_count, front, back;
|
|
479
|
-
if (!this.divider) return polygons.slice();
|
|
480
|
-
front = [];
|
|
481
|
-
back = [];
|
|
482
|
-
for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
|
|
483
|
-
this.divider.splitPolygon(polygons[i], front, back, front, back);
|
|
484
|
-
}
|
|
485
|
-
if (this.front) front = this.front.clipPolygons(front);
|
|
486
|
-
if (this.back) back = this.back.clipPolygons(back);else back = [];
|
|
487
|
-
return front.concat(back);
|
|
488
|
-
}
|
|
489
|
-
}, {
|
|
490
|
-
key: "clipTo",
|
|
491
|
-
value: function clipTo(node) {
|
|
492
|
-
this.polygons = node.clipPolygons(this.polygons);
|
|
493
|
-
if (this.front) this.front.clipTo(node);
|
|
494
|
-
if (this.back) this.back.clipTo(node);
|
|
495
|
-
}
|
|
496
|
-
}]);
|
|
497
|
-
}();
|
|
498
|
-
window.ThreeBSP = ThreeBSP;
|
package/es/version.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = PropertyString;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _export = require("../../components/style/export");
|
|
10
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
var tableStyle = {
|
|
13
|
-
width: '100%',
|
|
14
|
-
borderSpacing: '2px 0',
|
|
15
|
-
marginBottom: '2px'
|
|
16
|
-
};
|
|
17
|
-
var firstTdStyle = {
|
|
18
|
-
width: '6em',
|
|
19
|
-
textTransform: 'capitalize'
|
|
20
|
-
};
|
|
21
|
-
function PropertyString(_ref) {
|
|
22
|
-
var value = _ref.value,
|
|
23
|
-
onUpdate = _ref.onUpdate,
|
|
24
|
-
configs = _ref.configs,
|
|
25
|
-
sourceElement = _ref.sourceElement,
|
|
26
|
-
internalState = _ref.internalState,
|
|
27
|
-
state = _ref.state;
|
|
28
|
-
var update = function update(val) {
|
|
29
|
-
if (configs.hook) {
|
|
30
|
-
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
31
|
-
return onUpdate(_val);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return onUpdate(val);
|
|
35
|
-
};
|
|
36
|
-
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
37
|
-
className: "PropertyString",
|
|
38
|
-
style: _sharedPropertyStyle["default"].tableStyle
|
|
39
|
-
}, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
|
|
40
|
-
style: _sharedPropertyStyle["default"].firstTdStyle
|
|
41
|
-
}, /*#__PURE__*/_react["default"].createElement(_export.FormLabel, null, configs.label)), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_export.FormTextInput, {
|
|
42
|
-
value: value,
|
|
43
|
-
onChange: function onChange(event) {
|
|
44
|
-
return update(event.target.value);
|
|
45
|
-
}
|
|
46
|
-
})))));
|
|
47
|
-
}
|
|
48
|
-
PropertyString.propTypes = {
|
|
49
|
-
value: _propTypes["default"].any.isRequired,
|
|
50
|
-
onUpdate: _propTypes["default"].func.isRequired,
|
|
51
|
-
configs: _propTypes["default"].object.isRequired,
|
|
52
|
-
sourceElement: _propTypes["default"].object,
|
|
53
|
-
internalState: _propTypes["default"].object,
|
|
54
|
-
state: _propTypes["default"].object.isRequired
|
|
55
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = PropertyToggle;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _export = require("../../components/style/export");
|
|
10
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
function PropertyToggle(_ref) {
|
|
13
|
-
var value = _ref.value,
|
|
14
|
-
onUpdate = _ref.onUpdate,
|
|
15
|
-
configs = _ref.configs,
|
|
16
|
-
sourceElement = _ref.sourceElement,
|
|
17
|
-
internalState = _ref.internalState,
|
|
18
|
-
state = _ref.state;
|
|
19
|
-
var update = function update(val) {
|
|
20
|
-
if (configs.hook) {
|
|
21
|
-
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
22
|
-
return onUpdate(_val);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return onUpdate(val);
|
|
26
|
-
};
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
28
|
-
className: "PropertyToggle",
|
|
29
|
-
style: _sharedPropertyStyle["default"].tableStyle
|
|
30
|
-
}, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
|
|
31
|
-
style: _sharedPropertyStyle["default"].firstTdStyle
|
|
32
|
-
}, /*#__PURE__*/_react["default"].createElement(_export.FormLabel, null, configs.label)), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_export.Button, {
|
|
33
|
-
onClick: function onClick(e) {
|
|
34
|
-
return update(!value);
|
|
35
|
-
},
|
|
36
|
-
size: "small"
|
|
37
|
-
}, configs.actionName)))));
|
|
38
|
-
}
|
|
39
|
-
PropertyToggle.propTypes = {
|
|
40
|
-
value: _propTypes["default"].any.isRequired,
|
|
41
|
-
onUpdate: _propTypes["default"].func.isRequired,
|
|
42
|
-
configs: _propTypes["default"].object.isRequired,
|
|
43
|
-
sourceElement: _propTypes["default"].object,
|
|
44
|
-
internalState: _propTypes["default"].object,
|
|
45
|
-
state: _propTypes["default"].object.isRequired
|
|
46
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var tableStyle = {
|
|
8
|
-
width: '100%',
|
|
9
|
-
borderSpacing: '2px 0',
|
|
10
|
-
marginBottom: '2px'
|
|
11
|
-
};
|
|
12
|
-
var firstTdStyle = {
|
|
13
|
-
width: '6em',
|
|
14
|
-
textTransform: 'capitalize'
|
|
15
|
-
};
|
|
16
|
-
var PropertyStyle = {
|
|
17
|
-
tableStyle: tableStyle,
|
|
18
|
-
firstTdStyle: firstTdStyle
|
|
19
|
-
};
|
|
20
|
-
var _default = exports["default"] = PropertyStyle;
|