@vcmap/ui 5.0.0-rc.6 → 5.0.0-rc.9
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/README.md +72 -22
- package/build/build.js +0 -3
- package/build/buildHelpers.js +0 -1
- package/build/commonViteConfig.js +1 -1
- package/config/aerowest.config.json +2 -1
- package/config/base.config.json +7 -7
- package/config/dev.config.json +4 -4
- package/dist/assets/cesium/Workers/{AttributeCompression-27507afe.js → AttributeCompression-80665726.js} +1 -1
- package/dist/assets/cesium/Workers/{AxisAlignedBoundingBox-7565c1e8.js → AxisAlignedBoundingBox-a655a4bc.js} +1 -1
- package/dist/assets/cesium/Workers/{BoundingRectangle-9d707275.js → BoundingRectangle-c3b79029.js} +1 -1
- package/dist/assets/cesium/Workers/{BoxGeometry-fb31d3b5.js → BoxGeometry-f8f9c981.js} +1 -1
- package/dist/assets/cesium/Workers/{Color-56bb5728.js → Color-de06a177.js} +1 -1
- package/dist/assets/cesium/Workers/{CoplanarPolygonGeometryLibrary-72143c19.js → CoplanarPolygonGeometryLibrary-48cdc26d.js} +1 -1
- package/dist/assets/cesium/Workers/{CorridorGeometryLibrary-7bae1712.js → CorridorGeometryLibrary-ddc027d3.js} +1 -1
- package/dist/assets/cesium/Workers/{CylinderGeometry-331891fe.js → CylinderGeometry-82a8cbe6.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseGeometry-5e3f67b6.js → EllipseGeometry-32d55454.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseGeometryLibrary-dbc15162.js → EllipseGeometryLibrary-b2ae188a.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseOutlineGeometry-21191fce.js → EllipseOutlineGeometry-f05a5a27.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidGeodesic-cc3bace8.js → EllipsoidGeodesic-19e75e11.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidGeometry-8bfa24a9.js → EllipsoidGeometry-7c99fc81.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidOutlineGeometry-48d9c023.js → EllipsoidOutlineGeometry-21c243df.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidRhumbLine-125a8b72.js → EllipsoidRhumbLine-6145377b.js} +1 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +1 -0
- package/dist/assets/cesium/Workers/{EncodedCartesian3-96fdc0ef.js → EncodedCartesian3-d9f5c4a4.js} +1 -1
- package/dist/assets/cesium/Workers/{FrustumGeometry-9ab86004.js → FrustumGeometry-17776af8.js} +1 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +1 -0
- package/dist/assets/cesium/Workers/{GeometryInstance-13e4ff38.js → GeometryInstance-4fbf16ba.js} +1 -1
- package/dist/assets/cesium/Workers/{GeometryPipeline-e0eb4567.js → GeometryPipeline-309fad76.js} +1 -1
- package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +1 -0
- package/dist/assets/cesium/Workers/{Matrix2-37e55508.js → Matrix2-47e98d76.js} +0 -0
- package/dist/assets/cesium/Workers/{OrientedBoundingBox-e9c07538.js → OrientedBoundingBox-fcb5b750.js} +1 -1
- package/dist/assets/cesium/Workers/{Plane-6ee42cab.js → Plane-3f01019d.js} +1 -1
- package/dist/assets/cesium/Workers/{PolygonGeometryLibrary-b408c688.js → PolygonGeometryLibrary-0b29eb16.js} +1 -1
- package/dist/assets/cesium/Workers/{PolygonPipeline-7b8e4643.js → PolygonPipeline-a934c4dd.js} +1 -1
- package/dist/assets/cesium/Workers/{PolylinePipeline-6757400c.js → PolylinePipeline-8095c9bc.js} +1 -1
- package/dist/assets/cesium/Workers/{PolylineVolumeGeometryLibrary-eb972210.js → PolylineVolumeGeometryLibrary-67d12fff.js} +1 -1
- package/dist/assets/cesium/Workers/{PrimitivePipeline-f244975e.js → PrimitivePipeline-980e44c5.js} +1 -1
- package/dist/assets/cesium/Workers/{RectangleGeometryLibrary-1bd6152a.js → RectangleGeometryLibrary-621c6de8.js} +1 -1
- package/dist/assets/cesium/Workers/{TerrainEncoding-5a21a97f.js → TerrainEncoding-f96552d5.js} +1 -1
- package/dist/assets/cesium/Workers/{Transforms-eb5c1a84.js → Transforms-c8cb8f43.js} +3 -3
- package/dist/assets/cesium/Workers/{WallGeometryLibrary-a6b6a368.js → WallGeometryLibrary-c03d8479.js} +1 -1
- package/dist/assets/cesium/Workers/{WebMercatorProjection-2839e524.js → WebMercatorProjection-79b3214e.js} +1 -1
- package/dist/assets/cesium/Workers/combineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createBoxGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCircleGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSphereGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
- package/dist/assets/cesium/Workers/createWallGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/dist/assets/{cesium.fba8ca.js → cesium.4e40f4.js} +955 -968
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/core.edcf5e.js +4 -0
- package/dist/assets/core.js +1 -1
- package/dist/assets/{index.6a83278e.js → index.889d0f3a.js} +1 -1
- package/dist/assets/{ol.abea3a.js → ol.246fd4.js} +0 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.df4f6d.css +1 -0
- package/dist/assets/ui.df4f6d.js +43 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/{vue-composition-api.7051d7.js → vue-composition-api.a520f3.js} +1 -1
- package/dist/assets/vue-composition-api.js +2 -2
- package/dist/assets/{vue.9fd7f6.js → vue.2cee44.js} +0 -0
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify.33dafc.css → vuetify.cc817b.css} +1 -1
- package/dist/assets/{vuetify.33dafc.js → vuetify.cc817b.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +96 -6
- package/package.json +3 -4
- package/plugins/@vcmap/pluginExample/index.js +5 -5
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +1 -1
- package/plugins/@vcmap/project-selector/ContextsListComponent.vue +1 -1
- package/plugins/@vcmap/project-selector/index.js +5 -5
- package/plugins/@vcmap/project-selector/package.json +1 -2
- package/plugins/@vcmap/theme-changer/index.js +6 -6
- package/plugins/buttonExamples/ButtonExamples.vue +1 -1
- package/plugins/buttonExamples/index.js +5 -4
- package/plugins/categoryTest/Categories.vue +1 -1
- package/plugins/categoryTest/Category.vue +1 -1
- package/plugins/categoryTest/index.js +5 -5
- package/plugins/example/index.js +33 -14
- package/plugins/test/allIconsComponent.vue +34 -0
- package/plugins/test/editor.vue +1 -1
- package/plugins/test/index.js +40 -17
- package/plugins/test/toolbox-data.js +106 -26
- package/plugins/test/windowManagerExample.vue +1 -2
- package/src/actions/actionHelper.js +41 -1
- package/src/actions/styleSelector.vue +1 -1
- package/src/application/Navbar.vue +47 -6
- package/src/application/VcsApp.vue +37 -29
- package/src/application/VcsMap.vue +1 -20
- package/src/assets/logo-mobile.svg +9 -0
- package/src/assets/logo.svg +23 -23
- package/src/components/buttons/VcsActionButtonList.vue +99 -0
- package/src/components/buttons/VcsButton.vue +201 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +73 -0
- package/src/components/form-inputs-controls/VcsColorPicker.vue +81 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +46 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +38 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +97 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +130 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +129 -0
- package/src/components/form-output/VcsFormattedNumber.vue +103 -0
- package/src/components/lists/VcsActionList.vue +100 -0
- package/src/components/lists/VcsTreeview.vue +109 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +105 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +156 -0
- package/src/components/notification/VcsBadge.vue +27 -0
- package/src/components/notification/VcsTooltip.vue +154 -0
- package/src/components/notification/validation.js +19 -0
- package/src/contentTree/LayerTree.vue +1 -1
- package/src/contentTree/contentTreeCollection.js +6 -2
- package/src/icons/+all.js +359 -0
- package/src/icons/2DAreaIcon.vue +21 -0
- package/src/icons/2DDistanceIcon.vue +18 -0
- package/src/icons/3DAreaIcon.vue +21 -0
- package/src/icons/3DDistanceIcon.vue +18 -0
- package/src/icons/3DHeightIcon.vue +18 -0
- package/src/icons/AngleIcon.vue +8 -0
- package/src/icons/AssociationsIcon.vue +34 -0
- package/src/icons/AxisIcon.vue +10 -0
- package/src/icons/BoundingBoxIcon.vue +15 -0
- package/src/icons/CheckboxCheckedIcon.vue +16 -0
- package/src/icons/CheckboxIcon.vue +23 -0
- package/src/icons/CheckboxIndeterminateIcon.vue +24 -0
- package/src/icons/CircleIcon.vue +10 -0
- package/src/icons/ColorSwatchIcon.vue +17 -0
- package/src/icons/CommentIcon.vue +19 -0
- package/src/icons/CompassIcon.vue +8 -0
- package/src/icons/ComponentsIcon.vue +7 -0
- package/src/icons/ConeIcon.vue +11 -0
- package/src/icons/DimensionsHouseIcon.vue +14 -0
- package/src/icons/ElevationProfileIcon.vue +111 -0
- package/src/icons/ExportAreaIcon.vue +7 -0
- package/src/icons/ExportFlightIcon.vue +7 -0
- package/src/icons/ExportIcon.vue +8 -0
- package/src/icons/ExternalLinkIcon.vue +10 -0
- package/src/icons/EyeIcon.vue +7 -0
- package/src/icons/FastForwardIcon.vue +7 -0
- package/src/icons/FilterIcon.vue +8 -0
- package/src/icons/GlobeNatureIcon.vue +14 -0
- package/src/icons/HealthCareIndustriesIcon.vue +118 -0
- package/src/icons/HelpIcon.vue +7 -0
- package/src/icons/HomePointIcon.vue +8 -0
- package/src/icons/HospitalsIcon.vue +237 -0
- package/src/icons/HouseIcon.vue +25 -0
- package/src/icons/ImportIcon.vue +8 -0
- package/src/icons/InfoIcon.vue +10 -0
- package/src/icons/KebabIcon.vue +36 -0
- package/src/icons/LabelIcon.vue +7 -0
- package/src/icons/LayersIcon.vue +26 -0
- package/src/icons/LegendIcon.vue +65 -0
- package/src/icons/LineIcon.vue +7 -0
- package/src/icons/LinkIcon.vue +7 -0
- package/src/icons/MapIcon.vue +8 -0
- package/src/icons/MenuIcon.vue +34 -0
- package/src/icons/MinusIcon.vue +8 -0
- package/src/icons/ObjectAttributeIcon.vue +18 -0
- package/src/icons/ObjectSelectIcon.vue +8 -0
- package/src/icons/ObliqueViewIcon.vue +13 -0
- package/src/icons/PdfIcon.vue +10 -0
- package/src/icons/PedestrianIcon.vue +8 -0
- package/src/icons/PenIcon.vue +14 -0
- package/src/icons/PlayCircleIcon.vue +10 -0
- package/src/icons/PlusIcon.vue +9 -0
- package/src/icons/PoiIcon.vue +7 -0
- package/src/icons/PointSelectIcon.vue +7 -0
- package/src/icons/PolygonIcon.vue +38 -0
- package/src/icons/PresentationModeIcon.vue +7 -0
- package/src/icons/ProgressIcon.vue +24 -0
- package/src/icons/QueryIcon.vue +15 -0
- package/src/icons/RectangleIcon.vue +9 -0
- package/src/icons/ReturnIcon.vue +7 -0
- package/src/icons/RewindIcon.vue +6 -0
- package/src/icons/SearchIcon.vue +8 -0
- package/src/icons/ShadowIcon.vue +9 -0
- package/src/icons/ShapesIcon.vue +28 -0
- package/src/icons/ShareIcon.vue +22 -0
- package/src/icons/SimpleCircleFilledIcon.vue +15 -0
- package/src/icons/SimpleCircleHalfFilledIcon.vue +12 -0
- package/src/icons/SimpleCircleOutlinedIcon.vue +15 -0
- package/src/icons/SkipNextIcon.vue +7 -0
- package/src/icons/SkipPreviousIcon.vue +9 -0
- package/src/icons/SplitViewIcon.vue +19 -0
- package/src/icons/TextStyleIcon.vue +14 -0
- package/src/icons/ThreeDimensionsIcon.vue +7 -0
- package/src/icons/ToolsIcon.vue +35 -0
- package/src/icons/TouchIcon.vue +8 -0
- package/src/icons/TrashCanIcon.vue +7 -0
- package/src/icons/TriangleIcon.vue +15 -0
- package/src/icons/TwoDimensionsIcon.vue +8 -0
- package/src/icons/UploadIcon.vue +14 -0
- package/src/icons/VideoRecorderIcon.vue +14 -0
- package/src/icons/WalkingIcon.vue +7 -0
- package/src/icons/WallIcon.vue +14 -0
- package/src/manager/buttonManager.js +5 -52
- package/src/manager/navbarManager.js +81 -0
- package/src/manager/toolbox/ToolboxGroupComponent.vue +128 -0
- package/src/manager/toolbox/ToolboxManager.vue +119 -76
- package/src/manager/toolbox/toolboxManager.js +204 -0
- package/src/manager/window/WindowComponent.vue +27 -20
- package/src/manager/window/WindowComponentHeader.vue +13 -6
- package/src/manager/window/WindowManager.vue +18 -1
- package/src/manager/window/windowManager.js +3 -5
- package/src/navigation/mapNavigation.vue +34 -5
- package/src/navigation/orientationToolsButton.vue +1 -1
- package/src/navigation/overviewMap.js +616 -0
- package/src/navigation/overviewMapClickedInteraction.js +38 -0
- package/src/navigation/tiltSlider.vue +1 -1
- package/src/styles/_theming.scss +10 -0
- package/src/styles/main.scss +3 -0
- package/src/styles/variables.scss +70 -0
- package/src/styles/vcsFont.scss +5 -0
- package/src/styles/vcsGrid.scss +4 -0
- package/src/vcsUiApp.js +18 -3
- package/src/vuePlugins/vuetify.js +1 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-678e34e4.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-3915ea0b.js +0 -1
- package/dist/assets/cesium/Workers/IntersectionTests-ac2459de.js +0 -1
- package/dist/assets/core.d5ed0f.js +0 -4
- package/dist/assets/ui.ad1ec9.css +0 -1
- package/dist/assets/ui.ad1ec9.js +0 -39
- package/dist/assets/uicomponents.161461.css +0 -1
- package/dist/assets/uicomponents.161461.js +0 -31
- package/dist/assets/uicomponents.js +0 -1
- package/lib/uicomponents.js +0 -1
- package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
- package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
- package/src/manager/toolbox/toolbox-manager.js +0 -203
@@ -1,203 +0,0 @@
|
|
1
|
-
/* eslint-disable import/prefer-default-export */
|
2
|
-
import { VcsEvent } from '@vcmap/core';
|
3
|
-
import { reactive } from '@vue/composition-api';
|
4
|
-
import Vue from 'vue';
|
5
|
-
|
6
|
-
/**
|
7
|
-
* @typedef ToolboxGroup
|
8
|
-
* @property {string} icon
|
9
|
-
* @property {string | number} id
|
10
|
-
* @property {boolean} open
|
11
|
-
* @property {ToolboxItem[]} options
|
12
|
-
* @property {boolean} active
|
13
|
-
*/
|
14
|
-
/**
|
15
|
-
* @typedef ToolboxManagerState
|
16
|
-
* @property {boolean} visible
|
17
|
-
* @property {Object.<string, ToolboxGroup>} groups
|
18
|
-
*/
|
19
|
-
|
20
|
-
/**
|
21
|
-
* @typedef ToolboxItem
|
22
|
-
* @property {string | number} id
|
23
|
-
* @property {string} icon
|
24
|
-
* @property {boolean} active
|
25
|
-
* @property {boolean} selected
|
26
|
-
* @property {boolean} disabled
|
27
|
-
* @property {number} slot
|
28
|
-
*/
|
29
|
-
|
30
|
-
export class ToolboxManager {
|
31
|
-
constructor() {
|
32
|
-
this.onAdded = new VcsEvent();
|
33
|
-
this.onRemoved = new VcsEvent();
|
34
|
-
/** @type {ToolboxManagerState} */
|
35
|
-
this.state = reactive({
|
36
|
-
visible: true,
|
37
|
-
groups: {},
|
38
|
-
});
|
39
|
-
}
|
40
|
-
|
41
|
-
setGroupOpen(id, open) {
|
42
|
-
Object.values(this.state.groups).forEach((group) => {
|
43
|
-
if (group.id === id) {
|
44
|
-
Vue.set(this.state.groups, group.id, {
|
45
|
-
...group,
|
46
|
-
open,
|
47
|
-
});
|
48
|
-
} else {
|
49
|
-
Vue.set(this.state.groups, group.id, {
|
50
|
-
...group,
|
51
|
-
open: false,
|
52
|
-
});
|
53
|
-
}
|
54
|
-
});
|
55
|
-
}
|
56
|
-
|
57
|
-
/** @method */
|
58
|
-
toggle() {
|
59
|
-
Vue.set(this.state, 'visible', !this.state.visible);
|
60
|
-
}
|
61
|
-
|
62
|
-
/**
|
63
|
-
* @method
|
64
|
-
* @param {string} id
|
65
|
-
* @returns {boolean}
|
66
|
-
*/
|
67
|
-
has(id) {
|
68
|
-
return !!this.get(id);
|
69
|
-
}
|
70
|
-
|
71
|
-
/**
|
72
|
-
* @method
|
73
|
-
* @param {string} id
|
74
|
-
* @returns {Object}
|
75
|
-
*/
|
76
|
-
get(id) {
|
77
|
-
return Object.values(this.state.groups)
|
78
|
-
.map(group => group.options)
|
79
|
-
.flat()
|
80
|
-
.find(item => item && item.id === id);
|
81
|
-
}
|
82
|
-
|
83
|
-
/**
|
84
|
-
* @param {string} id
|
85
|
-
* @param {boolean} disabled
|
86
|
-
*/
|
87
|
-
setDisabled(id, disabled) {
|
88
|
-
const [key, slot] = this.getSlotIndexAndEntry(id);
|
89
|
-
const entry = slot.options.find(s => s.id === id);
|
90
|
-
entry.disabled = disabled;
|
91
|
-
|
92
|
-
Vue.set(this.state.groups, key, slot);
|
93
|
-
}
|
94
|
-
|
95
|
-
/**
|
96
|
-
* TODO: return item as well
|
97
|
-
* @param {string} id
|
98
|
-
* @returns {[string, ToolboxGroup]}
|
99
|
-
*/
|
100
|
-
getSlotIndexAndEntry(id) {
|
101
|
-
return Object.entries(this.state.groups).find(
|
102
|
-
entry => entry[1] &&
|
103
|
-
entry[1].options &&
|
104
|
-
entry[1].options.find(v => v.id === id),
|
105
|
-
);
|
106
|
-
}
|
107
|
-
|
108
|
-
/** @param {string} id */
|
109
|
-
selectOption(id) {
|
110
|
-
const [key, slot] = this.getSlotIndexAndEntry(id);
|
111
|
-
const option = slot.options.find(opt => opt.id === id);
|
112
|
-
if (option) {
|
113
|
-
option.selected = !option.selected;
|
114
|
-
}
|
115
|
-
|
116
|
-
Vue.set(this.state.groups, key, { ...slot });
|
117
|
-
}
|
118
|
-
|
119
|
-
/**
|
120
|
-
* @param {string} id
|
121
|
-
* @returns {number}
|
122
|
-
*/
|
123
|
-
getSlotIndexFor(id) {
|
124
|
-
const [index] = Object.entries(this.state.groups).find(entry => entry[1].options.find(o => o.id === id));
|
125
|
-
return index;
|
126
|
-
}
|
127
|
-
|
128
|
-
/** @returns {number} */
|
129
|
-
getNumberOfUsedSlots() {
|
130
|
-
return Object.values(this.state.groups).reduce(
|
131
|
-
(acc, curr) => (curr.type === 'toggleButton' ||
|
132
|
-
curr.type === 'customComponent' ||
|
133
|
-
(curr.options && curr.options.length) ?
|
134
|
-
acc + 1 :
|
135
|
-
acc),
|
136
|
-
0,
|
137
|
-
);
|
138
|
-
}
|
139
|
-
|
140
|
-
/** @param {string} id */
|
141
|
-
bringToTop(id) {
|
142
|
-
const [key, slot] = this.getSlotIndexAndEntry(id);
|
143
|
-
|
144
|
-
const updated = [
|
145
|
-
slot.options.find(i => i.id === id),
|
146
|
-
...slot.options.filter(i => i.id !== id),
|
147
|
-
];
|
148
|
-
|
149
|
-
Vue.set(this.state.groups, key, {
|
150
|
-
...slot,
|
151
|
-
options: updated,
|
152
|
-
});
|
153
|
-
}
|
154
|
-
|
155
|
-
/**
|
156
|
-
* @param {ToolboxItem} toolboxItem
|
157
|
-
* @param {string | number} slot
|
158
|
-
*/
|
159
|
-
addToolboxItem(toolboxItem, slot) {
|
160
|
-
if (this.has(toolboxItem.id)) {
|
161
|
-
throw new Error(
|
162
|
-
`Toolbox-Item with id ${toolboxItem.id} has already been registered`,
|
163
|
-
);
|
164
|
-
}
|
165
|
-
Vue.set(this.state.groups, slot, {
|
166
|
-
...this.state.groups[slot],
|
167
|
-
options: [...this.state.groups[slot].options, toolboxItem],
|
168
|
-
});
|
169
|
-
this.onAdded.raiseEvent(toolboxItem.id);
|
170
|
-
}
|
171
|
-
|
172
|
-
/**
|
173
|
-
* @param {ToolboxGroup} group
|
174
|
-
* @param {string | number} slot
|
175
|
-
*/
|
176
|
-
addToolboxGroup(group, slot) {
|
177
|
-
if (this.state.groups[slot]) {
|
178
|
-
throw new Error(
|
179
|
-
`Toolbox-Group with slot-id ${slot} has already been registered`,
|
180
|
-
);
|
181
|
-
}
|
182
|
-
Vue.set(this.state.groups, slot, group);
|
183
|
-
}
|
184
|
-
|
185
|
-
/**
|
186
|
-
* @method
|
187
|
-
* @param {string | number} id ID of popover to be removed
|
188
|
-
*/
|
189
|
-
removeToolboxItem(id) {
|
190
|
-
const slotIndex = this.getSlotIndexFor(id);
|
191
|
-
if (!slotIndex) {
|
192
|
-
throw new Error(`Cannot find slot index for toolbar item with id ${id}`);
|
193
|
-
}
|
194
|
-
|
195
|
-
Vue.set(this.state.groups, slotIndex, {
|
196
|
-
...this.state.groups[slotIndex],
|
197
|
-
options: [
|
198
|
-
...this.state.groups[slotIndex].options.filter(s => s.id !== id),
|
199
|
-
],
|
200
|
-
});
|
201
|
-
this.onRemoved.raiseEvent(id);
|
202
|
-
}
|
203
|
-
}
|