@vcmap/ui 5.1.8 → 5.2.1
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/build/buildTypes.js +9 -0
- package/config/base.config.json +33 -2
- package/config/dev.config.json +22 -2
- package/config/www.config.json +16 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.45041e.js → core.a8552c.js} +4160 -4041
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-8783569c.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.74ba2a.css → ui.aebd62.css} +2 -2
- package/dist/assets/{ui.74ba2a.js → ui.aebd62.js} +8031 -6985
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.72ace9.js → vuetify.c8459d.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.d.ts +22 -2
- package/index.js +29 -1
- package/package.json +2 -2
- package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +110 -37
- package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +4 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +10 -3
- package/plugins/@vcmap-show-case/panel-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/panel-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/panel-tester/src/IframePanelExample.vue +15 -0
- package/plugins/@vcmap-show-case/panel-tester/src/ImgPanelExample.vue +19 -0
- package/plugins/@vcmap-show-case/panel-tester/src/PanelExample.vue +128 -0
- package/plugins/@vcmap-show-case/panel-tester/src/TextPanelExample.vue +34 -0
- package/plugins/@vcmap-show-case/panel-tester/src/index.js +63 -0
- package/plugins/package.json +7 -3
- package/src/actions/actionHelper.js +1 -1
- package/src/actions/flightActions.d.ts +38 -2
- package/src/actions/flightActions.js +257 -6
- package/src/application/VcsApp.vue +4 -104
- package/src/application/VcsApp.vue.d.ts +0 -6
- package/src/application/VcsContainer.vue +105 -0
- package/src/application/VcsContainer.vue.d.ts +14 -0
- package/src/application/VcsMainMap.vue +68 -0
- package/src/application/VcsMainMap.vue.d.ts +9 -0
- package/src/application/markdownHelper.d.ts +7 -0
- package/src/application/markdownHelper.js +57 -1
- package/src/components/form-inputs-controls/VcsRadioGrid.vue +27 -42
- package/src/contentTree/LayerTree.vue +40 -14
- package/src/downloadHelper.d.ts +0 -2
- package/src/downloadHelper.js +2 -4
- package/src/featureInfo/BalloonComponent.vue +31 -3
- package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
- package/src/featureInfo/IframeComponent.vue +55 -0
- package/src/featureInfo/IframeComponent.vue.d.ts +25 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue +24 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +12 -0
- package/src/featureInfo/abstractFeatureInfoView.js +54 -22
- package/src/featureInfo/addressBalloonFeatureInfoView.d.ts +2 -2
- package/src/featureInfo/addressBalloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonHelper.js +16 -9
- package/src/featureInfo/featureInfo.js +15 -0
- package/src/featureInfo/iframeFeatureInfoView.js +1 -20
- package/src/featureInfo/iframeWmsFeatureInfoView.d.ts +41 -0
- package/src/featureInfo/iframeWmsFeatureInfoView.js +73 -0
- package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +47 -0
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +81 -0
- package/src/featureInfo/markdownFeatureInfoView.d.ts +47 -0
- package/src/featureInfo/markdownFeatureInfoView.js +95 -0
- package/src/i18n/de.d.ts +8 -3
- package/src/i18n/de.js +3 -0
- package/src/i18n/en.d.ts +32 -26
- package/src/i18n/en.js +4 -1
- package/src/manager/collectionManager/CollectionComponent.vue +12 -49
- package/src/manager/collectionManager/CollectionComponent.vue.d.ts +5 -9
- package/src/manager/collectionManager/CollectionComponentContent.vue +102 -0
- package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +17 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +10 -2
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +9 -0
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +91 -0
- package/src/manager/collectionManager/CollectionComponentStandalone.vue.d.ts +9 -0
- package/src/manager/collectionManager/collectionManager.d.ts +2 -2
- package/src/manager/collectionManager/collectionManager.js +21 -19
- package/src/manager/panel/PanelComponent.vue +110 -0
- package/src/manager/panel/PanelComponent.vue.d.ts +19 -0
- package/src/manager/panel/PanelManagerComponent.vue +224 -0
- package/src/manager/panel/PanelManagerComponent.vue.d.ts +36 -0
- package/src/manager/panel/panelHelper.d.ts +83 -0
- package/src/manager/panel/panelHelper.js +272 -0
- package/src/manager/panel/panelManager.d.ts +338 -0
- package/src/manager/panel/panelManager.js +381 -0
- package/src/manager/window/WindowManager.vue +14 -0
- package/src/manager/window/windowHelper.js +1 -1
- package/src/manager/window/windowManager.js +4 -0
- package/src/search/ResultItem.vue +1 -1
- package/src/search/search.d.ts +2 -2
- package/src/search/search.js +2 -2
- package/src/vcsUiApp.d.ts +14 -0
- package/src/vcsUiApp.js +23 -1
- package/dist/assets/index-3cd5a3f3.js +0 -1
- /package/dist/assets/{cesium.035e3a.js → cesium.1b488a.js} +0 -0
- /package/dist/assets/{ol.eb3bee.js → ol.7488a7.js} +0 -0
- /package/dist/assets/{vue.17a8fa.js → vue.df3538.js} +0 -0
- /package/dist/assets/{vuetify.72ace9.css → vuetify.c8459d.css} +0 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
<template>
|
2
|
+
<VcsFormSection
|
3
|
+
:heading="title"
|
4
|
+
:header-actions="actions"
|
5
|
+
:action-button-list-overflow-count="overflowCount"
|
6
|
+
v-bind="{ ...$attrs }"
|
7
|
+
>
|
8
|
+
<collection-component-list
|
9
|
+
v-if="componentListView"
|
10
|
+
hide-header
|
11
|
+
@closeList="closeList"
|
12
|
+
/>
|
13
|
+
<CollectionComponentContent v-else @openList="openList" />
|
14
|
+
</VcsFormSection>
|
15
|
+
</template>
|
16
|
+
|
17
|
+
<script>
|
18
|
+
import { computed, getCurrentInstance, inject, ref } from 'vue';
|
19
|
+
import VcsFormSection from '../../components/form-inputs-controls/VcsFormSection.vue';
|
20
|
+
import { createSelectionActions } from '../../components/lists/VcsList.vue';
|
21
|
+
import CollectionComponentList from './CollectionComponentList.vue';
|
22
|
+
import CollectionComponentContent from './CollectionComponentContent.vue';
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @description
|
26
|
+
* Renders the first ten items of a collectionComponent in a List. Uses CollectionComponentList to render more items.
|
27
|
+
* The collectionComponent must be passed via {@link https://vuejs.org/api/composition-api-dependency-injection.html |provide }.
|
28
|
+
*/
|
29
|
+
export default {
|
30
|
+
name: 'CollectionComponent',
|
31
|
+
components: {
|
32
|
+
CollectionComponentList,
|
33
|
+
CollectionComponentContent,
|
34
|
+
VcsFormSection,
|
35
|
+
},
|
36
|
+
setup(_props, { emit }) {
|
37
|
+
const vm = getCurrentInstance().proxy;
|
38
|
+
/**
|
39
|
+
* @type {CollectionComponentClass}
|
40
|
+
*/
|
41
|
+
const collectionComponent = inject('collectionComponent');
|
42
|
+
/**
|
43
|
+
* @type {import("vue").Ref<boolean>}
|
44
|
+
*/
|
45
|
+
const componentListView = ref(false);
|
46
|
+
|
47
|
+
const selectionActions = createSelectionActions(
|
48
|
+
collectionComponent.items,
|
49
|
+
collectionComponent.selection,
|
50
|
+
emit,
|
51
|
+
);
|
52
|
+
|
53
|
+
const actions = collectionComponent.getActions();
|
54
|
+
|
55
|
+
const title = computed(() => {
|
56
|
+
if (
|
57
|
+
collectionComponent.selectable &&
|
58
|
+
collectionComponent.selection.length > 0
|
59
|
+
) {
|
60
|
+
return `${vm.$t(collectionComponent.title.value)} (${
|
61
|
+
collectionComponent.selection.value.length
|
62
|
+
})`;
|
63
|
+
}
|
64
|
+
return collectionComponent.title.value;
|
65
|
+
});
|
66
|
+
|
67
|
+
return {
|
68
|
+
title,
|
69
|
+
overflowCount: collectionComponent.overflowCount,
|
70
|
+
actions: computed(() => {
|
71
|
+
if (
|
72
|
+
collectionComponent.selectable.value &&
|
73
|
+
!collectionComponent.singleSelect.value
|
74
|
+
) {
|
75
|
+
return [...selectionActions, ...actions.value];
|
76
|
+
}
|
77
|
+
return actions.value;
|
78
|
+
}),
|
79
|
+
componentListView,
|
80
|
+
openList() {
|
81
|
+
componentListView.value = true;
|
82
|
+
},
|
83
|
+
closeList() {
|
84
|
+
componentListView.value = false;
|
85
|
+
},
|
86
|
+
};
|
87
|
+
},
|
88
|
+
};
|
89
|
+
</script>
|
90
|
+
|
91
|
+
<style lang="scss" scoped></style>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
title: import("vue").ComputedRef<any>;
|
3
|
+
overflowCount: any;
|
4
|
+
actions: import("vue").ComputedRef<any>;
|
5
|
+
componentListView: import("vue").Ref<boolean>;
|
6
|
+
openList(): void;
|
7
|
+
closeList(): void;
|
8
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
9
|
+
export default _default;
|
@@ -86,10 +86,10 @@ declare class CollectionManager implements ICollectionManager {
|
|
86
86
|
*/
|
87
87
|
private _itemFilters;
|
88
88
|
/**
|
89
|
-
* @type {Array<{actions:Array<import("../../actions/actionHelper.js").VcsAction>,owner:string|symbol,collectionComponentIds:Array<string>}>}
|
89
|
+
* @type {Array<{ownedActions:Array<OwnedAction>,actions:Array<import("../../actions/actionHelper.js").VcsAction>,owner:string|symbol,collectionComponentIds:Array<string>}>}
|
90
90
|
* @private
|
91
91
|
*/
|
92
|
-
private
|
92
|
+
private _itemActions;
|
93
93
|
/**
|
94
94
|
* @param {string} id
|
95
95
|
* @returns {CollectionComponentClass<Object>|undefined}
|
@@ -78,10 +78,10 @@ class CollectionManager {
|
|
78
78
|
*/
|
79
79
|
this._itemFilters = [];
|
80
80
|
/**
|
81
|
-
* @type {Array<{actions:Array<import("../../actions/actionHelper.js").VcsAction>,owner:string|symbol,collectionComponentIds:Array<string>}>}
|
81
|
+
* @type {Array<{ownedActions:Array<OwnedAction>,actions:Array<import("../../actions/actionHelper.js").VcsAction>,owner:string|symbol,collectionComponentIds:Array<string>}>}
|
82
82
|
* @private
|
83
83
|
*/
|
84
|
-
this.
|
84
|
+
this._itemActions = [];
|
85
85
|
}
|
86
86
|
|
87
87
|
/**
|
@@ -163,12 +163,10 @@ class CollectionManager {
|
|
163
163
|
.forEach(({ collectionComponentIds, ...itemFilter }) =>
|
164
164
|
collectionComponent.addItemFilter(itemFilter),
|
165
165
|
);
|
166
|
-
this.
|
166
|
+
this._itemActions
|
167
167
|
.filter(filterIds)
|
168
|
-
.forEach(({
|
169
|
-
collectionComponent.addActions(
|
170
|
-
actions.map(({ action }) => ({ action, actionOwner })),
|
171
|
-
),
|
168
|
+
.forEach(({ ownedActions }) =>
|
169
|
+
collectionComponent.addActions(ownedActions),
|
172
170
|
);
|
173
171
|
|
174
172
|
this.added.raiseEvent(collectionComponent);
|
@@ -342,7 +340,7 @@ class CollectionManager {
|
|
342
340
|
}
|
343
341
|
|
344
342
|
if (
|
345
|
-
!this.
|
343
|
+
!this._itemActions.find(
|
346
344
|
(cached) => cached.actions === actions && cached.owner === owner,
|
347
345
|
)
|
348
346
|
) {
|
@@ -353,8 +351,9 @@ class CollectionManager {
|
|
353
351
|
component.addActions(ownedActions);
|
354
352
|
}
|
355
353
|
});
|
356
|
-
this.
|
354
|
+
this._itemActions.push({
|
357
355
|
actions,
|
356
|
+
ownedActions,
|
358
357
|
owner,
|
359
358
|
collectionComponentIds,
|
360
359
|
});
|
@@ -368,13 +367,16 @@ class CollectionManager {
|
|
368
367
|
removeActions(actions, owner) {
|
369
368
|
check(owner, [String, Symbol]);
|
370
369
|
|
371
|
-
const
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
370
|
+
const idx = this._itemActions.findIndex((a) => a.actions === actions);
|
371
|
+
if (idx > -1) {
|
372
|
+
const { collectionComponentIds, ownedActions } = this._itemActions[idx];
|
373
|
+
collectionComponentIds
|
374
|
+
.map((id) => this.get(id))
|
375
|
+
.forEach((collectionComponent) => {
|
376
|
+
collectionComponent.removeActions(ownedActions);
|
377
|
+
});
|
378
|
+
this._itemActions.splice(idx, 1);
|
379
|
+
}
|
378
380
|
}
|
379
381
|
|
380
382
|
/**
|
@@ -399,8 +401,8 @@ class CollectionManager {
|
|
399
401
|
this._itemFilters = this._itemFilters.filter((itemFilter) => {
|
400
402
|
return itemFilter.owner !== owner;
|
401
403
|
});
|
402
|
-
this.
|
403
|
-
(
|
404
|
+
this._itemActions = this._itemActions.filter(
|
405
|
+
(itemAction) => itemAction.owner !== owner,
|
404
406
|
);
|
405
407
|
}
|
406
408
|
|
@@ -422,7 +424,7 @@ class CollectionManager {
|
|
422
424
|
});
|
423
425
|
this._itemMappings = [];
|
424
426
|
this._itemFilters = [];
|
425
|
-
this.
|
427
|
+
this._itemActions = [];
|
426
428
|
}
|
427
429
|
|
428
430
|
/**
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
:id="panelState.id"
|
4
|
+
class="position-absolute panel-component"
|
5
|
+
:class="{
|
6
|
+
'panel-component-left': isLeft,
|
7
|
+
'panel-component-right': isRight,
|
8
|
+
'panel-component-bottom': isBottom,
|
9
|
+
'theme--light': !appIsDark,
|
10
|
+
'theme--dark': appIsDark,
|
11
|
+
resizable: panelState.resizable,
|
12
|
+
}"
|
13
|
+
@mousedown="startResize"
|
14
|
+
@mouseup="stopResize"
|
15
|
+
>
|
16
|
+
<slot />
|
17
|
+
</div>
|
18
|
+
</template>
|
19
|
+
|
20
|
+
<style scoped lang="scss">
|
21
|
+
@import '../../styles/shades.scss';
|
22
|
+
|
23
|
+
.panel-component {
|
24
|
+
padding: 0 4px;
|
25
|
+
}
|
26
|
+
.panel-component.theme--dark::after {
|
27
|
+
content: '';
|
28
|
+
position: absolute;
|
29
|
+
background: map-get($shades, 'black');
|
30
|
+
}
|
31
|
+
.panel-component.theme--light::after {
|
32
|
+
content: '';
|
33
|
+
position: absolute;
|
34
|
+
background: map-get($shades, 'white');
|
35
|
+
}
|
36
|
+
|
37
|
+
.panel-component-left::after {
|
38
|
+
width: 4px;
|
39
|
+
top: 0;
|
40
|
+
bottom: 0;
|
41
|
+
right: 0;
|
42
|
+
}
|
43
|
+
.panel-component-left.resizable::after {
|
44
|
+
cursor: ew-resize;
|
45
|
+
}
|
46
|
+
.panel-component-right::after {
|
47
|
+
width: 4px;
|
48
|
+
top: 0;
|
49
|
+
bottom: 0;
|
50
|
+
left: 0;
|
51
|
+
}
|
52
|
+
.panel-component-right.resizable::after {
|
53
|
+
cursor: ew-resize;
|
54
|
+
}
|
55
|
+
.panel-component-bottom::after {
|
56
|
+
left: 0;
|
57
|
+
right: 0;
|
58
|
+
top: 0;
|
59
|
+
height: 4px;
|
60
|
+
}
|
61
|
+
.panel-component-bottom.resizable::after {
|
62
|
+
cursor: n-resize;
|
63
|
+
}
|
64
|
+
</style>
|
65
|
+
|
66
|
+
<script>
|
67
|
+
import { computed, getCurrentInstance } from 'vue';
|
68
|
+
import { PanelLocation } from './panelManager.js';
|
69
|
+
|
70
|
+
export default {
|
71
|
+
name: 'PanelComponent',
|
72
|
+
props: {
|
73
|
+
panelState: {
|
74
|
+
type: Object,
|
75
|
+
required: true,
|
76
|
+
},
|
77
|
+
},
|
78
|
+
setup(props, { emit }) {
|
79
|
+
return {
|
80
|
+
appIsDark: computed(() => {
|
81
|
+
return getCurrentInstance().proxy.$vuetify.theme.dark || !1;
|
82
|
+
}),
|
83
|
+
isLeft: computed(
|
84
|
+
() => props.panelState.location === PanelLocation.LEFT,
|
85
|
+
),
|
86
|
+
isRight: computed(
|
87
|
+
() => props.panelState.location === PanelLocation.RIGHT,
|
88
|
+
),
|
89
|
+
isBottom: computed(
|
90
|
+
() => props.panelState.location === PanelLocation.BOTTOM,
|
91
|
+
),
|
92
|
+
startResize(e) {
|
93
|
+
const { resizable, location } = props.panelState;
|
94
|
+
if (
|
95
|
+
resizable &&
|
96
|
+
((location === PanelLocation.LEFT &&
|
97
|
+
e.currentTarget.clientWidth - e.offsetX < 4) ||
|
98
|
+
(location === PanelLocation.RIGHT && e.offsetX < 4) ||
|
99
|
+
(location === PanelLocation.BOTTOM && e.offsetY < 4))
|
100
|
+
) {
|
101
|
+
emit('resize', props.panelState.id);
|
102
|
+
}
|
103
|
+
},
|
104
|
+
stopResize() {
|
105
|
+
emit('resize', undefined);
|
106
|
+
},
|
107
|
+
};
|
108
|
+
},
|
109
|
+
};
|
110
|
+
</script>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
panelState: {
|
3
|
+
type: ObjectConstructor;
|
4
|
+
required: true;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
appIsDark: import("vue").ComputedRef<any>;
|
8
|
+
isLeft: import("vue").ComputedRef<boolean>;
|
9
|
+
isRight: import("vue").ComputedRef<boolean>;
|
10
|
+
isBottom: import("vue").ComputedRef<boolean>;
|
11
|
+
startResize(e: any): void;
|
12
|
+
stopResize(): void;
|
13
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
14
|
+
panelState: {
|
15
|
+
type: ObjectConstructor;
|
16
|
+
required: true;
|
17
|
+
};
|
18
|
+
}>>, {}>;
|
19
|
+
export default _default;
|
@@ -0,0 +1,224 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="vcs-panel-frame"
|
4
|
+
@mouseup="setResizing(undefined)"
|
5
|
+
ref="panelFrameRef"
|
6
|
+
>
|
7
|
+
<PanelComponent
|
8
|
+
:panel-state="mainPanel.state"
|
9
|
+
:style="getPosition(mainPanel)"
|
10
|
+
class="overflow-auto"
|
11
|
+
>
|
12
|
+
<VcsMainMap />
|
13
|
+
</PanelComponent>
|
14
|
+
<PanelComponent
|
15
|
+
v-for="id in componentIds"
|
16
|
+
:key="id"
|
17
|
+
:panel-state="getState(id)"
|
18
|
+
:style="getStyles(id).value"
|
19
|
+
:class="getState(id).classes"
|
20
|
+
class="overflow-auto"
|
21
|
+
@resize="setResizing"
|
22
|
+
>
|
23
|
+
<component
|
24
|
+
:is="getComponent(id)"
|
25
|
+
:panel-state="getState(id)"
|
26
|
+
v-bind="getProps(id)"
|
27
|
+
@close="close(id)"
|
28
|
+
/>
|
29
|
+
</PanelComponent>
|
30
|
+
</div>
|
31
|
+
</template>
|
32
|
+
|
33
|
+
<style scoped lang="scss">
|
34
|
+
.vcs-panel-frame {
|
35
|
+
position: absolute;
|
36
|
+
top: 0;
|
37
|
+
left: 0;
|
38
|
+
right: 0;
|
39
|
+
bottom: 0;
|
40
|
+
}
|
41
|
+
.vcs-panel-border {
|
42
|
+
padding: 5px;
|
43
|
+
}
|
44
|
+
</style>
|
45
|
+
|
46
|
+
<script>
|
47
|
+
import {
|
48
|
+
computed,
|
49
|
+
getCurrentInstance,
|
50
|
+
inject,
|
51
|
+
reactive,
|
52
|
+
ref,
|
53
|
+
watch,
|
54
|
+
} from 'vue';
|
55
|
+
import VcsMainMap from '../../application/VcsMainMap.vue';
|
56
|
+
import { vcsAppSymbol } from '../../pluginHelper.js';
|
57
|
+
import { updatePanelSizes, DefaultMainPanelPosition } from './panelHelper.js';
|
58
|
+
import {
|
59
|
+
getPanelPosition,
|
60
|
+
PanelLocation,
|
61
|
+
panelLocationSymbol,
|
62
|
+
panelPositionSymbol,
|
63
|
+
setPanelPosition,
|
64
|
+
} from './panelManager.js';
|
65
|
+
import PanelComponent from './PanelComponent.vue';
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @returns {Partial<import("./panelManager.js").PanelComponent>}
|
69
|
+
*/
|
70
|
+
export function createMainPanel() {
|
71
|
+
const id = 'vcs-main';
|
72
|
+
return {
|
73
|
+
id,
|
74
|
+
[panelPositionSymbol]: reactive({ ...DefaultMainPanelPosition }),
|
75
|
+
state: reactive({
|
76
|
+
id,
|
77
|
+
owner: vcsAppSymbol,
|
78
|
+
location: 'vcs-main',
|
79
|
+
}),
|
80
|
+
};
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* @description PanelManager rendering all Panels
|
85
|
+
*/
|
86
|
+
export default {
|
87
|
+
name: 'VcsPanelManager',
|
88
|
+
components: { VcsMainMap, PanelComponent },
|
89
|
+
setup() {
|
90
|
+
const app = inject('vcsApp');
|
91
|
+
/** @type {PanelManager} */
|
92
|
+
const { panelManager } = app;
|
93
|
+
const { componentIds } = panelManager;
|
94
|
+
const panelFrameRef = ref();
|
95
|
+
const resizing = ref(undefined);
|
96
|
+
let resizingFunction = () => {};
|
97
|
+
|
98
|
+
/**
|
99
|
+
* @param {string} id
|
100
|
+
* @returns {PanelState}
|
101
|
+
*/
|
102
|
+
const getState = (id) => {
|
103
|
+
return panelManager.get(id)?.state;
|
104
|
+
};
|
105
|
+
/**
|
106
|
+
* @param {string} id
|
107
|
+
* @returns {Object}
|
108
|
+
*/
|
109
|
+
const getProps = (id) => {
|
110
|
+
return panelManager.get(id)?.props ?? {};
|
111
|
+
};
|
112
|
+
/**
|
113
|
+
* @param {PanelComponent} panelComponent
|
114
|
+
* @returns {PanelPosition|null}
|
115
|
+
*/
|
116
|
+
const getPosition = (panelComponent) => {
|
117
|
+
return getPanelPosition(panelComponent);
|
118
|
+
};
|
119
|
+
/**
|
120
|
+
* @param {string} id
|
121
|
+
* @returns {import("vue").ComputedRef<Object>}
|
122
|
+
*/
|
123
|
+
const getStyles = (id) =>
|
124
|
+
computed(() => {
|
125
|
+
const panelComponent = panelManager.get(id);
|
126
|
+
return {
|
127
|
+
...getPosition(panelComponent),
|
128
|
+
...(panelComponent?.state?.styles || {}),
|
129
|
+
};
|
130
|
+
});
|
131
|
+
|
132
|
+
const mainPanel = createMainPanel();
|
133
|
+
|
134
|
+
const resize = (panel, e) => {
|
135
|
+
if (panel) {
|
136
|
+
let resizeKey;
|
137
|
+
if (panel[panelLocationSymbol] === PanelLocation.BOTTOM) {
|
138
|
+
const height =
|
139
|
+
((panelFrameRef.value.offsetTop + e.y) /
|
140
|
+
panelFrameRef.value.parentElement.offsetHeight) *
|
141
|
+
100;
|
142
|
+
setPanelPosition(panel, { height: `${Math.round(100 - height)}%` });
|
143
|
+
} else {
|
144
|
+
const width =
|
145
|
+
((panelFrameRef.value.offsetLeft + e.x) /
|
146
|
+
panelFrameRef.value.parentElement.offsetWidth) *
|
147
|
+
100;
|
148
|
+
if (panel[panelLocationSymbol] === PanelLocation.LEFT) {
|
149
|
+
setPanelPosition(panel, { width: `${width}%` });
|
150
|
+
resizeKey = 'left';
|
151
|
+
} else if (panel[panelLocationSymbol] === PanelLocation.RIGHT) {
|
152
|
+
setPanelPosition(panel, { width: `${Math.round(100 - width)}%` });
|
153
|
+
resizeKey = 'right';
|
154
|
+
}
|
155
|
+
}
|
156
|
+
updatePanelSizes(
|
157
|
+
panelManager,
|
158
|
+
mainPanel,
|
159
|
+
panelFrameRef.value.getBoundingClientRect(),
|
160
|
+
resizeKey,
|
161
|
+
);
|
162
|
+
}
|
163
|
+
};
|
164
|
+
|
165
|
+
const setResizing = (id) => {
|
166
|
+
if (id) {
|
167
|
+
resizing.value = id;
|
168
|
+
resizingFunction = (e) => {
|
169
|
+
e.preventDefault();
|
170
|
+
resize(panelManager.get(id), e);
|
171
|
+
};
|
172
|
+
panelFrameRef.value.addEventListener(
|
173
|
+
'mousemove',
|
174
|
+
resizingFunction,
|
175
|
+
false,
|
176
|
+
);
|
177
|
+
} else {
|
178
|
+
resizing.value = undefined;
|
179
|
+
panelFrameRef.value.removeEventListener(
|
180
|
+
'mousemove',
|
181
|
+
resizingFunction,
|
182
|
+
false,
|
183
|
+
);
|
184
|
+
}
|
185
|
+
};
|
186
|
+
|
187
|
+
const componentIdRef = ref(componentIds);
|
188
|
+
watch(
|
189
|
+
() => [...componentIdRef.value],
|
190
|
+
() => {
|
191
|
+
updatePanelSizes(
|
192
|
+
panelManager,
|
193
|
+
mainPanel,
|
194
|
+
panelFrameRef.value.getBoundingClientRect(),
|
195
|
+
);
|
196
|
+
},
|
197
|
+
);
|
198
|
+
|
199
|
+
const addMobileClass = computed(() => {
|
200
|
+
return (
|
201
|
+
getCurrentInstance().proxy.$vuetify.breakpoint.xs &&
|
202
|
+
componentIdRef.value.length > 0
|
203
|
+
);
|
204
|
+
});
|
205
|
+
|
206
|
+
return {
|
207
|
+
mainPanel,
|
208
|
+
componentIds: componentIdRef,
|
209
|
+
getComponent: (id) => panelManager.get(id).component,
|
210
|
+
getPosition,
|
211
|
+
getStyles,
|
212
|
+
getState,
|
213
|
+
getProps,
|
214
|
+
panelFrameRef,
|
215
|
+
setResizing,
|
216
|
+
resizingFunction,
|
217
|
+
close: (id) => {
|
218
|
+
panelManager.remove(id);
|
219
|
+
},
|
220
|
+
addMobileClass,
|
221
|
+
};
|
222
|
+
},
|
223
|
+
};
|
224
|
+
</script>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/**
|
2
|
+
* @returns {Partial<import("./panelManager.js").PanelComponent>}
|
3
|
+
*/
|
4
|
+
export function createMainPanel(): Partial<import("./panelManager.js").PanelComponent>;
|
5
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
6
|
+
mainPanel: Partial<import("./panelManager.js").PanelComponent>;
|
7
|
+
componentIds: PanelManager;
|
8
|
+
getComponent: (id: any) => any;
|
9
|
+
getPosition: (panelComponent: import("vue").DefineComponent<{
|
10
|
+
panelState: {
|
11
|
+
type: ObjectConstructor;
|
12
|
+
required: true;
|
13
|
+
};
|
14
|
+
}, {
|
15
|
+
appIsDark: import("vue").ComputedRef<any>;
|
16
|
+
isLeft: import("vue").ComputedRef<boolean>;
|
17
|
+
isRight: import("vue").ComputedRef<boolean>;
|
18
|
+
isBottom: import("vue").ComputedRef<boolean>;
|
19
|
+
startResize(e: any): void;
|
20
|
+
stopResize(): void;
|
21
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
22
|
+
panelState: {
|
23
|
+
type: ObjectConstructor;
|
24
|
+
required: true;
|
25
|
+
};
|
26
|
+
}>>, {}>) => PanelPosition | null;
|
27
|
+
getStyles: (id: string) => import("vue").ComputedRef<Object>;
|
28
|
+
getState: (id: string) => PanelState;
|
29
|
+
getProps: (id: string) => Object;
|
30
|
+
panelFrameRef: import("vue").Ref<any>;
|
31
|
+
setResizing: (id: any) => void;
|
32
|
+
resizingFunction: () => void;
|
33
|
+
close: (id: any) => void;
|
34
|
+
addMobileClass: import("vue").ComputedRef<any>;
|
35
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
36
|
+
export default _default;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* @typedef {Object} NumberPanelPosition
|
3
|
+
* @property {number?} left - The left CSS property participates in specifying the horizontal position of a panel.
|
4
|
+
* @property {number?} top - The top CSS property participates in specifying the vertical position of a panel.
|
5
|
+
* @property {number?} right - The right CSS property participates in specifying the horizontal position of a panel.
|
6
|
+
* @property {number?} bottom - The bottom CSS property participates in specifying the vertical position of a panel.
|
7
|
+
* @property {number} width - The width CSS property sets an element's width.
|
8
|
+
* @property {number} height - The height CSS property sets an element's height.
|
9
|
+
* @property {number} maxHeight - The maxHeight CSS property sets an element's maximal height.
|
10
|
+
* @property {number} maxWidth - The maxWidth CSS property sets an element's maximal width.
|
11
|
+
* @property {number} minHeight - The minHeight CSS property sets an element's minimal height.
|
12
|
+
* @property {number} minWidth - The minWidth CSS property sets an element's minimal width.
|
13
|
+
*/
|
14
|
+
/**
|
15
|
+
* Parses a position to numeric percentage value (0-100). Non-numeric values return undefined.
|
16
|
+
* @param {string|number|undefined} pos
|
17
|
+
* @param {string} key - one of PanelPosition keys
|
18
|
+
* @param {DOMRect} targetSize - size of the current target
|
19
|
+
* @returns {number|undefined}
|
20
|
+
*/
|
21
|
+
export function posToRelativeTarget(pos: string | number | undefined, key: string, targetSize: DOMRect): number | undefined;
|
22
|
+
/**
|
23
|
+
* Parses CSS position string properties to percentage numeric position properties
|
24
|
+
* @param {Partial<import("./panelManager.js").PanelPosition>} panelPosition
|
25
|
+
* @param {DOMRect} targetSize - the map's target size
|
26
|
+
* @returns {NumberPanelPosition}
|
27
|
+
*/
|
28
|
+
export function percentageFromPanelOptions(panelPosition: Partial<import("./panelManager.js").PanelPosition>, targetSize: DOMRect): NumberPanelPosition;
|
29
|
+
/**
|
30
|
+
* Updates size of main panel according to other active panels
|
31
|
+
* @param {import("./panelManager.js").default} panelManager
|
32
|
+
* @param {Partial<import("./panelManager.js").PanelComponent>} mainPanel
|
33
|
+
* @param {DOMRect} targetSize
|
34
|
+
* @param {string|undefined} resizeKey
|
35
|
+
*/
|
36
|
+
export function updatePanelSizes(panelManager: import("./panelManager.js").default, mainPanel: Partial<import("./panelManager.js").PanelComponent>, targetSize: DOMRect, resizeKey?: string | undefined): void;
|
37
|
+
/**
|
38
|
+
*
|
39
|
+
* @type {Partial<import("./panelManager.js").PanelPosition>}
|
40
|
+
*/
|
41
|
+
export const DefaultMainPanelPosition: Partial<import("./panelManager.js").PanelPosition>;
|
42
|
+
export type NumberPanelPosition = {
|
43
|
+
/**
|
44
|
+
* - The left CSS property participates in specifying the horizontal position of a panel.
|
45
|
+
*/
|
46
|
+
left: number | null;
|
47
|
+
/**
|
48
|
+
* - The top CSS property participates in specifying the vertical position of a panel.
|
49
|
+
*/
|
50
|
+
top: number | null;
|
51
|
+
/**
|
52
|
+
* - The right CSS property participates in specifying the horizontal position of a panel.
|
53
|
+
*/
|
54
|
+
right: number | null;
|
55
|
+
/**
|
56
|
+
* - The bottom CSS property participates in specifying the vertical position of a panel.
|
57
|
+
*/
|
58
|
+
bottom: number | null;
|
59
|
+
/**
|
60
|
+
* - The width CSS property sets an element's width.
|
61
|
+
*/
|
62
|
+
width: number;
|
63
|
+
/**
|
64
|
+
* - The height CSS property sets an element's height.
|
65
|
+
*/
|
66
|
+
height: number;
|
67
|
+
/**
|
68
|
+
* - The maxHeight CSS property sets an element's maximal height.
|
69
|
+
*/
|
70
|
+
maxHeight: number;
|
71
|
+
/**
|
72
|
+
* - The maxWidth CSS property sets an element's maximal width.
|
73
|
+
*/
|
74
|
+
maxWidth: number;
|
75
|
+
/**
|
76
|
+
* - The minHeight CSS property sets an element's minimal height.
|
77
|
+
*/
|
78
|
+
minHeight: number;
|
79
|
+
/**
|
80
|
+
* - The minWidth CSS property sets an element's minimal width.
|
81
|
+
*/
|
82
|
+
minWidth: number;
|
83
|
+
};
|