@vcmap/ui 5.1.4 → 5.1.6
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/config/base.config.json +0 -2
- package/config/dev.config.json +4 -0
- package/config/www.config.json +0 -2
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.8b769f.js → core.950fcb.js} +707 -678
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-c4a24e02.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.576b59.css → ui.a4ccf8.css} +2 -2
- package/dist/assets/{ui.576b59.js → ui.a4ccf8.js} +3783 -3647
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.515b3c.js → vuetify.f23a17.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +6 -2
- package/index.d.ts +1 -1
- package/index.html +5 -1
- package/index.js +1 -0
- package/package.json +2 -2
- package/src/actions/listActions.d.ts +57 -2
- package/src/actions/listActions.js +111 -1
- package/src/application/VcsApp.vue +20 -4
- package/src/application/VcsApp.vue.d.ts +8 -2
- package/src/application/VcsNavbar.vue +1 -1
- package/src/application/VcsTextPageFooter.vue +47 -30
- package/src/application/VcsTextPageFooter.vue.d.ts +5 -3
- package/src/components/form-inputs-controls/VcsTextArea.vue +11 -3
- package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +2 -0
- package/src/components/viewpoint/VcsViewpointComponent.vue +27 -5
- package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +9 -0
- package/src/components/viewpoint/VcsViewpointEditor.vue +10 -1
- package/src/components/viewpoint/VcsViewpointEditor.vue.d.ts +11 -1
- package/src/contentTree/LayerTree.vue +22 -3
- package/src/i18n/de.d.ts +6 -1
- package/src/i18n/de.js +6 -1
- package/src/i18n/en.d.ts +6 -1
- package/src/i18n/en.js +6 -1
- package/src/siteConfig.d.ts +5 -0
- package/src/siteConfig.js +93 -0
- package/src/uiConfig.d.ts +16 -6
- package/src/uiConfig.js +5 -3
- package/src/vcsUiApp.d.ts +1 -0
- package/src/vcsUiApp.js +4 -0
- package/dist/assets/index-97b02a80.js +0 -1
- /package/dist/assets/{cesium.88a354.js → cesium.a8db01.js} +0 -0
- /package/dist/assets/{ol.98520e.js → ol.39cfab.js} +0 -0
- /package/dist/assets/{vue.e13c02.js → vue.4e258b.js} +0 -0
- /package/dist/assets/{vuetify.515b3c.css → vuetify.f23a17.css} +0 -0
@@ -43,6 +43,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
43
43
|
type: BooleanConstructor;
|
44
44
|
default: boolean;
|
45
45
|
};
|
46
|
+
nameRules: {
|
47
|
+
type: ArrayConstructor;
|
48
|
+
default: () => never[];
|
49
|
+
};
|
46
50
|
}, {
|
47
51
|
isCesiumMap: import("vue").Ref<boolean>;
|
48
52
|
gotoViewpoint: () => Promise<void>;
|
@@ -114,6 +118,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
114
118
|
type: BooleanConstructor;
|
115
119
|
default: boolean;
|
116
120
|
};
|
121
|
+
nameRules: {
|
122
|
+
type: ArrayConstructor;
|
123
|
+
default: () => never[];
|
124
|
+
};
|
117
125
|
}>>, {
|
118
126
|
value: Record<string, any>;
|
119
127
|
expandable: boolean;
|
@@ -122,5 +130,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
130
|
hideTitle: boolean;
|
123
131
|
hideAnimate: boolean;
|
124
132
|
hideGeneral: boolean;
|
133
|
+
nameRules: unknown[];
|
125
134
|
}>;
|
126
135
|
export default _default;
|
@@ -6,7 +6,11 @@
|
|
6
6
|
:auto-close="false"
|
7
7
|
v-bind="{ ...$attrs, ...$props }"
|
8
8
|
>
|
9
|
-
<VcsViewpointComponent
|
9
|
+
<VcsViewpointComponent
|
10
|
+
v-model="localConfig"
|
11
|
+
hide-name
|
12
|
+
:name-rules="nameRules"
|
13
|
+
/>
|
10
14
|
</AbstractConfigEditor>
|
11
15
|
</template>
|
12
16
|
|
@@ -23,6 +27,7 @@
|
|
23
27
|
* An editor component for viewpoints using AbstractConfigEditor and VcsViewpointComponent
|
24
28
|
* @vue-prop {() => import("@vcmap/core").ViewpointOptions} getConfig
|
25
29
|
* @vue-prop {(import("@vcmap/core").ViewpointOptions) => Promise<void>} setConfig
|
30
|
+
* @vue-prop {Array<(v:string)=>(boolean|string)>} nameRules - Optional rules for name input.
|
26
31
|
*/
|
27
32
|
export default {
|
28
33
|
name: 'VcsViewpointEditor',
|
@@ -39,6 +44,10 @@
|
|
39
44
|
type: Function,
|
40
45
|
required: true,
|
41
46
|
},
|
47
|
+
nameRules: {
|
48
|
+
type: Array,
|
49
|
+
default: () => [],
|
50
|
+
},
|
42
51
|
},
|
43
52
|
setup(props, { emit }) {
|
44
53
|
const app = inject('vcsApp');
|
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
7
7
|
type: FunctionConstructor;
|
8
8
|
required: true;
|
9
9
|
};
|
10
|
+
nameRules: {
|
11
|
+
type: ArrayConstructor;
|
12
|
+
default: () => never[];
|
13
|
+
};
|
10
14
|
}, {
|
11
15
|
localConfig: any;
|
12
16
|
apply(): void;
|
@@ -21,5 +25,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
25
|
type: FunctionConstructor;
|
22
26
|
required: true;
|
23
27
|
};
|
24
|
-
|
28
|
+
nameRules: {
|
29
|
+
type: ArrayConstructor;
|
30
|
+
default: () => never[];
|
31
|
+
};
|
32
|
+
}>>, {
|
33
|
+
nameRules: unknown[];
|
34
|
+
}>;
|
25
35
|
export default _default;
|
@@ -15,13 +15,13 @@
|
|
15
15
|
</template>
|
16
16
|
|
17
17
|
<script>
|
18
|
-
import { inject } from 'vue';
|
18
|
+
import { inject, watch } from 'vue';
|
19
19
|
import { VSheet } from 'vuetify/lib';
|
20
20
|
import VcsTreeview from '../components/lists/VcsTreeview.vue';
|
21
21
|
|
22
22
|
/**
|
23
23
|
* @description
|
24
|
-
* Implements Treeview and shows
|
24
|
+
* Implements Treeview and shows content tree
|
25
25
|
*/
|
26
26
|
export default {
|
27
27
|
name: 'VcsLayerTree',
|
@@ -35,8 +35,27 @@
|
|
35
35
|
setup(props) {
|
36
36
|
const app = inject('vcsApp');
|
37
37
|
const open = app.contentTree.getTreeOpenStateRef(props.windowState.id);
|
38
|
+
|
39
|
+
const initOpen = app.contentTree
|
40
|
+
.getChildrenForSubTree(props.windowState.id)
|
41
|
+
.filter((i) => i.initOpen)
|
42
|
+
.map((i) => i.name);
|
43
|
+
|
44
|
+
const tree = app.contentTree.getComputedVisibleTree(props.windowState.id);
|
45
|
+
|
46
|
+
// watch for new visible children, which should start init open
|
47
|
+
watch(tree, (value, oldValue) => {
|
48
|
+
const changed = value
|
49
|
+
.filter(
|
50
|
+
({ name }) =>
|
51
|
+
!oldValue.find((o) => o.name === name) && initOpen.includes(name),
|
52
|
+
)
|
53
|
+
.map(({ name }) => name);
|
54
|
+
open.value.push(...changed);
|
55
|
+
});
|
56
|
+
|
38
57
|
return {
|
39
|
-
tree
|
58
|
+
tree,
|
40
59
|
open,
|
41
60
|
};
|
42
61
|
},
|
package/src/i18n/de.d.ts
CHANGED
@@ -68,6 +68,11 @@ declare namespace messages {
|
|
68
68
|
export namespace _import {
|
69
69
|
let submit: string;
|
70
70
|
let fileDrop: string;
|
71
|
+
let failure: string;
|
72
|
+
let predicateFailure: string;
|
73
|
+
let addFailure: string;
|
74
|
+
let featuresAdded: string;
|
75
|
+
let nothingAdded: string;
|
71
76
|
}
|
72
77
|
export { _import as import };
|
73
78
|
export namespace vcsFormSection {
|
@@ -302,7 +307,7 @@ declare namespace messages {
|
|
302
307
|
let tooltip_8: string;
|
303
308
|
export { tooltip_8 as tooltip };
|
304
309
|
}
|
305
|
-
export namespace
|
310
|
+
export namespace dataProtection {
|
306
311
|
let title_17: string;
|
307
312
|
export { title_17 as title };
|
308
313
|
let tooltip_9: string;
|
package/src/i18n/de.js
CHANGED
@@ -61,6 +61,11 @@ const messages = {
|
|
61
61
|
import: {
|
62
62
|
submit: 'Importieren',
|
63
63
|
fileDrop: 'Dateien hierher ziehen',
|
64
|
+
failure: 'Datei {fileName} konnte nicht gelesen werden.',
|
65
|
+
predicateFailure: '{0} Feature entsprechen nicht den Anforderungen.',
|
66
|
+
addFailure: '{0} Feature existieren bereits.',
|
67
|
+
featuresAdded: '{0} Feature importiert.',
|
68
|
+
nothingAdded: 'Es konnten keine Feature importiert werden.',
|
64
69
|
},
|
65
70
|
vcsFormSection: {
|
66
71
|
help: 'Hilfe anzeigen',
|
@@ -263,7 +268,7 @@ const messages = {
|
|
263
268
|
title: 'Impressum',
|
264
269
|
tooltip: 'Öffne Impressumsfenster',
|
265
270
|
},
|
266
|
-
|
271
|
+
dataProtection: {
|
267
272
|
title: 'Datenschutz',
|
268
273
|
tooltip: 'Öffne Datenschutzfenster',
|
269
274
|
},
|
package/src/i18n/en.d.ts
CHANGED
@@ -68,6 +68,11 @@ declare namespace messages {
|
|
68
68
|
export namespace _import {
|
69
69
|
let submit: string;
|
70
70
|
let fileDrop: string;
|
71
|
+
let failure: string;
|
72
|
+
let predicateFailure: string;
|
73
|
+
let addFailure: string;
|
74
|
+
let featuresAdded: string;
|
75
|
+
let nothingAdded: string;
|
71
76
|
}
|
72
77
|
export { _import as import };
|
73
78
|
export namespace vcsFormSection {
|
@@ -301,7 +306,7 @@ declare namespace messages {
|
|
301
306
|
let tooltip_8: string;
|
302
307
|
export { tooltip_8 as tooltip };
|
303
308
|
}
|
304
|
-
export namespace
|
309
|
+
export namespace dataProtection {
|
305
310
|
let title_16: string;
|
306
311
|
export { title_16 as title };
|
307
312
|
let tooltip_9: string;
|
package/src/i18n/en.js
CHANGED
@@ -61,6 +61,11 @@ const messages = {
|
|
61
61
|
import: {
|
62
62
|
submit: 'Import',
|
63
63
|
fileDrop: 'Drop files here',
|
64
|
+
failure: 'File {fileName} could not be parsed.',
|
65
|
+
predicateFailure: '{0} features to not fullfill requirements.',
|
66
|
+
addFailure: '{0} feature are already exist.',
|
67
|
+
featuresAdded: '{0} feature imported.',
|
68
|
+
nothingAdded: 'No features could be imported.',
|
64
69
|
},
|
65
70
|
vcsFormSection: {
|
66
71
|
help: 'Show help',
|
@@ -263,7 +268,7 @@ const messages = {
|
|
263
268
|
title: 'Imprint',
|
264
269
|
tooltip: 'Open imprint window',
|
265
270
|
},
|
266
|
-
|
271
|
+
dataProtection: {
|
267
272
|
title: 'Data Protection',
|
268
273
|
tooltip: 'Open data protection window',
|
269
274
|
},
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { check } from '@vcsuite/check';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @param {string} src
|
5
|
+
*/
|
6
|
+
function setFavicon(src) {
|
7
|
+
check(src, String);
|
8
|
+
|
9
|
+
const link = document.createElement('link');
|
10
|
+
link.className = 'vcs-favicon';
|
11
|
+
const oldLinks = document.getElementsByClassName('vcs-favicon');
|
12
|
+
const toRemove = [];
|
13
|
+
for (let i = 0; i < oldLinks.length; i++) {
|
14
|
+
toRemove.push(oldLinks.item(i));
|
15
|
+
}
|
16
|
+
toRemove.forEach((elem) => {
|
17
|
+
document.head.removeChild(elem);
|
18
|
+
});
|
19
|
+
link.id = 'dynamic-favicon';
|
20
|
+
link.rel = 'shortcut icon';
|
21
|
+
link.href = src;
|
22
|
+
document.head.appendChild(link);
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @param {string} title
|
27
|
+
*/
|
28
|
+
function setHeaderTitle(title) {
|
29
|
+
const titleElement = document.createElement('title');
|
30
|
+
titleElement.innerText = title;
|
31
|
+
const oldTitle = document.getElementsByTagName('title').item(0);
|
32
|
+
if (oldTitle) {
|
33
|
+
document.head.removeChild(oldTitle);
|
34
|
+
}
|
35
|
+
document.head.appendChild(titleElement);
|
36
|
+
}
|
37
|
+
|
38
|
+
const defaultFavicon = './assets/favicon.svg';
|
39
|
+
|
40
|
+
const defaultHeaderTitle = 'VC Map';
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @param {import("./uiConfig.js").default} uiConfig
|
44
|
+
* @returns {() => void}
|
45
|
+
*/
|
46
|
+
export default function createSiteConfig(uiConfig) {
|
47
|
+
if (typeof uiConfig.config.value.favicon === 'string') {
|
48
|
+
setFavicon(uiConfig.config.value.favicon);
|
49
|
+
}
|
50
|
+
|
51
|
+
if (typeof uiConfig.config.value.headerTitle === 'string') {
|
52
|
+
setHeaderTitle(uiConfig.config.value.headerTitle);
|
53
|
+
}
|
54
|
+
|
55
|
+
const updateFavicon = () => {
|
56
|
+
if (typeof uiConfig.config.value.favicon === 'string') {
|
57
|
+
setFavicon(uiConfig.config.value.favicon);
|
58
|
+
} else {
|
59
|
+
setFavicon(defaultFavicon);
|
60
|
+
}
|
61
|
+
};
|
62
|
+
|
63
|
+
const updateHeaderTitle = () => {
|
64
|
+
if (typeof uiConfig.config.value.headerTitle === 'string') {
|
65
|
+
setHeaderTitle(uiConfig.config.value.headerTitle);
|
66
|
+
} else {
|
67
|
+
setHeaderTitle(defaultHeaderTitle);
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
const listeners = [
|
72
|
+
uiConfig.added.addEventListener(({ name }) => {
|
73
|
+
if (name === 'favicon') {
|
74
|
+
updateFavicon();
|
75
|
+
} else if (name === 'headerTitle') {
|
76
|
+
updateHeaderTitle();
|
77
|
+
}
|
78
|
+
}),
|
79
|
+
uiConfig.removed.addEventListener(({ name }) => {
|
80
|
+
if (name === 'favicon') {
|
81
|
+
updateFavicon();
|
82
|
+
} else if (name === 'headerTitle') {
|
83
|
+
updateHeaderTitle();
|
84
|
+
}
|
85
|
+
}),
|
86
|
+
];
|
87
|
+
|
88
|
+
return () => {
|
89
|
+
listeners.forEach((cb) => {
|
90
|
+
cb();
|
91
|
+
});
|
92
|
+
};
|
93
|
+
}
|
package/src/uiConfig.d.ts
CHANGED
@@ -4,7 +4,7 @@ export type UiConfigurationItem<T> = {
|
|
4
4
|
value: T;
|
5
5
|
};
|
6
6
|
export type TextPageType = {
|
7
|
-
title
|
7
|
+
title?: string | undefined;
|
8
8
|
url?: string | URL | undefined;
|
9
9
|
content?: string | undefined;
|
10
10
|
};
|
@@ -38,13 +38,21 @@ export type UiConfigObject = {
|
|
38
38
|
*/
|
39
39
|
helpBaseUrl?: string | undefined;
|
40
40
|
/**
|
41
|
-
* - an option imprint, will show a link in the footer.
|
41
|
+
* - an option imprint, will show a link in the footer. Default title is 'footer.imprint.title'.
|
42
42
|
*/
|
43
43
|
imprint?: TextPageType | undefined;
|
44
44
|
/**
|
45
|
-
* - an option dataProtection, will show a link in the footer.
|
45
|
+
* - an option dataProtection, will show a link in the footer. Default title is 'footer.dataProtection.title'.
|
46
46
|
*/
|
47
47
|
dataProtection?: TextPageType | undefined;
|
48
|
+
/**
|
49
|
+
* - the favicon to set
|
50
|
+
*/
|
51
|
+
favicon?: string | undefined;
|
52
|
+
/**
|
53
|
+
* - the title to display in the tab of the browser
|
54
|
+
*/
|
55
|
+
headerTitle?: string | undefined;
|
48
56
|
};
|
49
57
|
/**
|
50
58
|
* @typedef {{
|
@@ -55,7 +63,7 @@ export type UiConfigObject = {
|
|
55
63
|
*/
|
56
64
|
/**
|
57
65
|
* @typedef {Object} TextPageType
|
58
|
-
* @property {string} title
|
66
|
+
* @property {string} [title]
|
59
67
|
* @property {URL|string} [url]
|
60
68
|
* @property {string} [content]
|
61
69
|
*/
|
@@ -68,8 +76,10 @@ export type UiConfigObject = {
|
|
68
76
|
* @property {boolean} [startingFeatureInfo] - an optional flag whether to activate feature info on startup (default active)
|
69
77
|
* @property {string} [positionDisplayEventType] - mouse event, when position display is updated. Either 'click' (default) or 'move'.
|
70
78
|
* @property {string} [helpBaseUrl='https://help.vc.systems/'] - an optional URL to a help landing page
|
71
|
-
* @property {TextPageType} [imprint] - an option imprint, will show a link in the footer.
|
72
|
-
* @property {TextPageType} [dataProtection] - an option dataProtection, will show a link in the footer.
|
79
|
+
* @property {TextPageType} [imprint] - an option imprint, will show a link in the footer. Default title is 'footer.imprint.title'.
|
80
|
+
* @property {TextPageType} [dataProtection] - an option dataProtection, will show a link in the footer. Default title is 'footer.dataProtection.title'.
|
81
|
+
* @property {string} [favicon] - the favicon to set
|
82
|
+
* @property {string} [headerTitle] - the title to display in the tab of the browser
|
73
83
|
*/
|
74
84
|
/**
|
75
85
|
* @extends {Collection<UiConfigurationItem<unknown>>}
|
package/src/uiConfig.js
CHANGED
@@ -11,7 +11,7 @@ import { ref } from 'vue';
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* @typedef {Object} TextPageType
|
14
|
-
* @property {string} title
|
14
|
+
* @property {string} [title]
|
15
15
|
* @property {URL|string} [url]
|
16
16
|
* @property {string} [content]
|
17
17
|
*/
|
@@ -25,8 +25,10 @@ import { ref } from 'vue';
|
|
25
25
|
* @property {boolean} [startingFeatureInfo] - an optional flag whether to activate feature info on startup (default active)
|
26
26
|
* @property {string} [positionDisplayEventType] - mouse event, when position display is updated. Either 'click' (default) or 'move'.
|
27
27
|
* @property {string} [helpBaseUrl='https://help.vc.systems/'] - an optional URL to a help landing page
|
28
|
-
* @property {TextPageType} [imprint] - an option imprint, will show a link in the footer.
|
29
|
-
* @property {TextPageType} [dataProtection] - an option dataProtection, will show a link in the footer.
|
28
|
+
* @property {TextPageType} [imprint] - an option imprint, will show a link in the footer. Default title is 'footer.imprint.title'.
|
29
|
+
* @property {TextPageType} [dataProtection] - an option dataProtection, will show a link in the footer. Default title is 'footer.dataProtection.title'.
|
30
|
+
* @property {string} [favicon] - the favicon to set
|
31
|
+
* @property {string} [headerTitle] - the title to display in the tab of the browser
|
30
32
|
*/
|
31
33
|
|
32
34
|
/**
|
package/src/vcsUiApp.d.ts
CHANGED
@@ -188,6 +188,7 @@ declare class VcsUiApp extends VcsApp {
|
|
188
188
|
* @type {import("@vcmap/core").VcsEvent<string>}
|
189
189
|
*/
|
190
190
|
mounted: import("@vcmap/core").VcsEvent<string>;
|
191
|
+
_destroySiteConfig: () => void;
|
191
192
|
/**
|
192
193
|
* @type {import("@vcmap/core").OverrideCollection<VcsPlugin<Object, Object>>}
|
193
194
|
*/
|
package/src/vcsUiApp.js
CHANGED
@@ -42,6 +42,7 @@ import Notifier from './notifier/notifier.js';
|
|
42
42
|
import AbstractFeatureInfoView from './featureInfo/abstractFeatureInfoView.js';
|
43
43
|
import { createVueI18n, setupI18n } from './vuePlugins/i18n.js';
|
44
44
|
import { callbackClassRegistry } from './callback/vcsCallback.js';
|
45
|
+
import createSiteConfig from './siteConfig.js';
|
45
46
|
|
46
47
|
/**
|
47
48
|
* @typedef {import("@vcmap/core").VcsModuleConfig & {
|
@@ -330,6 +331,8 @@ class VcsUiApp extends VcsApp {
|
|
330
331
|
* @type {import("@vcmap/core").VcsEvent<string>}
|
331
332
|
*/
|
332
333
|
this.mounted = new VcsEvent();
|
334
|
+
|
335
|
+
this._destroySiteConfig = createSiteConfig(this._uiConfig);
|
333
336
|
}
|
334
337
|
|
335
338
|
/**
|
@@ -682,6 +685,7 @@ class VcsUiApp extends VcsApp {
|
|
682
685
|
this._featureInfoClassRegistry.destroy();
|
683
686
|
this._featureInfo.destroy();
|
684
687
|
this._uiConfig.destroy();
|
688
|
+
this._destroySiteConfig();
|
685
689
|
super.destroy();
|
686
690
|
}
|
687
691
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{initAppFromAppConfig as p}from"./ui.576b59.js";p("#app","app.config.json");
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|