@vcmap/ui 5.1.0-rc.2 → 5.1.0-rc.4
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/www.config.json +11 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.5b03e5.js → core.2274d8.js} +598 -599
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-564248ae.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.67779e.js → ui.21bb56.js} +684 -649
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.3b3e23.js → vuetify.145dc5.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/plugins/package.json +5 -2
- package/src/components/import/ImportComponent.vue +13 -2
- package/src/components/import/ImportComponent.vue.d.ts +1 -1
- package/src/components/plugins/AbstractConfigEditor.vue +18 -0
- package/src/components/plugins/AbstractConfigEditor.vue.d.ts +27 -0
- package/src/contentTree/contentTreeCollection.js +6 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +3 -2
- package/src/manager/collectionManager/collectionComponentClass.js +20 -5
- package/src/manager/collectionManager/editorCollectionComponentClass.d.ts +3 -0
- package/src/manager/collectionManager/editorCollectionComponentClass.js +5 -1
- package/src/vcsUiApp.d.ts +2 -1
- package/src/vcsUiApp.js +9 -2
- package/dist/assets/index-92075a75.js +0 -1
- /package/dist/assets/{cesium.b97c3b.js → cesium.1bcede.js} +0 -0
- /package/dist/assets/{ol.0cd250.js → ol.d39205.js} +0 -0
- /package/dist/assets/{ui.67779e.css → ui.21bb56.css} +0 -0
- /package/dist/assets/{vue.62ecd5.js → vue.403631.js} +0 -0
- /package/dist/assets/{vuetify.3b3e23.css → vuetify.145dc5.css} +0 -0
package/dist/assets/ui.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from "./ui.
|
1
|
+
export * from "./ui.21bb56.js";
|
package/dist/assets/vue.js
CHANGED
@@ -13,7 +13,7 @@ function loadCss(href) {
|
|
13
13
|
elem.onerror = reject;
|
14
14
|
document.head.appendChild(elem);
|
15
15
|
});
|
16
|
-
} await loadCss('./assets/vuetify.
|
16
|
+
} await loadCss('./assets/vuetify.145dc5.css');import v from "./vue.403631.js";
|
17
17
|
const Ne = v.extend().extend({
|
18
18
|
name: "themeable",
|
19
19
|
provide() {
|
package/dist/assets/vuetify.js
CHANGED
package/dist/index.html
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vcmap/ui",
|
3
|
-
"version": "5.1.0-rc.
|
3
|
+
"version": "5.1.0-rc.4",
|
4
4
|
"author": "Virtual City Systems",
|
5
5
|
"license": "MIT",
|
6
6
|
"scripts": {
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"lint": "npm run lint:js && npm run lint:prettier && npm run lint:types",
|
20
20
|
"format": "prettier --write --list-different . && npm run lint:js -- --fix",
|
21
21
|
"prepack": "node build/build.js && node build/buildTypes.js",
|
22
|
-
"install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force
|
22
|
+
"install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force"
|
23
23
|
},
|
24
24
|
"repository": {
|
25
25
|
"type": "git",
|
@@ -53,7 +53,7 @@
|
|
53
53
|
},
|
54
54
|
"peerDependencies": {
|
55
55
|
"@vcmap-cesium/engine": "^4.0.3",
|
56
|
-
"@vcmap/core": "^5.1.0-rc.
|
56
|
+
"@vcmap/core": "^5.1.0-rc.3",
|
57
57
|
"ol": "^7.5.2",
|
58
58
|
"vue": "~2.7.3",
|
59
59
|
"vuetify": "~2.6.7"
|
package/plugins/package.json
CHANGED
@@ -10,7 +10,10 @@
|
|
10
10
|
"@vcmap/multi-view": "^1.0.1",
|
11
11
|
"@vcmap/cesium-filters": "^1.0.1",
|
12
12
|
"@vcmap/viewshed": "^2.0.1",
|
13
|
-
"@vcmap/measurement": "^1.0.2"
|
13
|
+
"@vcmap/measurement": "^1.0.2",
|
14
|
+
"@vcmap/flight": "^1.0.1"
|
14
15
|
},
|
15
|
-
"optionalDependencies": {
|
16
|
+
"optionalDependencies": {
|
17
|
+
"@vcmap/planning": "^1.0.1"
|
18
|
+
}
|
16
19
|
}
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<script>
|
25
25
|
import { VCard } from 'vuetify/lib';
|
26
|
-
import { inject, ref } from 'vue';
|
26
|
+
import { computed, inject, ref } from 'vue';
|
27
27
|
import FileDrop from './FileDrop.vue';
|
28
28
|
import VcsFormButton from '../buttons/VcsFormButton.vue';
|
29
29
|
import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
|
@@ -53,7 +53,18 @@
|
|
53
53
|
},
|
54
54
|
setup(props, { emit }) {
|
55
55
|
const app = inject('vcsApp');
|
56
|
-
const
|
56
|
+
const localFiles = ref([]);
|
57
|
+
/**
|
58
|
+
* @type {WritableComputedRef<Array<File>>}
|
59
|
+
*/
|
60
|
+
const files = computed({
|
61
|
+
get() {
|
62
|
+
return localFiles.value;
|
63
|
+
},
|
64
|
+
set(value) {
|
65
|
+
localFiles.value = Array.isArray(value) ? value : [value];
|
66
|
+
},
|
67
|
+
});
|
57
68
|
|
58
69
|
return {
|
59
70
|
files,
|
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
12
12
|
default: boolean;
|
13
13
|
};
|
14
14
|
}, {
|
15
|
-
files:
|
15
|
+
files: WritableComputedRef<File[]>;
|
16
16
|
doImport(): Promise<void>;
|
17
17
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
18
18
|
importFiles: {
|
@@ -34,6 +34,9 @@
|
|
34
34
|
* @vue-prop {string} [submitButtonTitle='components.apply'] - Option to change the submit button title, e.g. to 'components.add'.
|
35
35
|
* @vue-prop {boolean} [setConfigOnCancel=true] - Whether setConfig shall be called on cancel. Ensures compatability with v5.0.x
|
36
36
|
* @vue-prop {boolean} [autoClose=true] - Whether window component shall be close on submit or cancel.
|
37
|
+
* @vue-prop {function():void} [onSubmit] - Callback function called on submit.
|
38
|
+
* @vue-prop {function():void} [onReset] - Callback function called on reset.
|
39
|
+
* @vue-prop {function():void} [onCancel] - Callback function called on cancel.
|
37
40
|
* @vue-event {Event} submit - Event fired on clicking the submit button.
|
38
41
|
* @vue-event {Event} cancel - Event fired on clicking the cancel button.
|
39
42
|
* @vue-event {Event} reset - Event fired on clicking the reset button.
|
@@ -67,6 +70,18 @@
|
|
67
70
|
type: Boolean,
|
68
71
|
default: true,
|
69
72
|
},
|
73
|
+
onSubmit: {
|
74
|
+
type: Function,
|
75
|
+
default: () => {},
|
76
|
+
},
|
77
|
+
onReset: {
|
78
|
+
type: Function,
|
79
|
+
default: () => {},
|
80
|
+
},
|
81
|
+
onCancel: {
|
82
|
+
type: Function,
|
83
|
+
default: () => {},
|
84
|
+
},
|
70
85
|
},
|
71
86
|
setup(props, { attrs, emit }) {
|
72
87
|
const app = inject('vcsApp');
|
@@ -80,12 +95,14 @@
|
|
80
95
|
return {
|
81
96
|
isValid: ref(true),
|
82
97
|
submit(e) {
|
98
|
+
props.onSubmit();
|
83
99
|
emit('submit', e);
|
84
100
|
if (props.autoClose) {
|
85
101
|
close();
|
86
102
|
}
|
87
103
|
},
|
88
104
|
cancel(e) {
|
105
|
+
props.onCancel();
|
89
106
|
if (props.setConfigOnCancel) {
|
90
107
|
attrs.setConfig?.();
|
91
108
|
}
|
@@ -95,6 +112,7 @@
|
|
95
112
|
}
|
96
113
|
},
|
97
114
|
reset(e) {
|
115
|
+
props.onReset();
|
98
116
|
emit('reset', e);
|
99
117
|
},
|
100
118
|
};
|
@@ -19,6 +19,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
19
19
|
type: BooleanConstructor;
|
20
20
|
default: boolean;
|
21
21
|
};
|
22
|
+
onSubmit: {
|
23
|
+
type: FunctionConstructor;
|
24
|
+
default: () => void;
|
25
|
+
};
|
26
|
+
onReset: {
|
27
|
+
type: FunctionConstructor;
|
28
|
+
default: () => void;
|
29
|
+
};
|
30
|
+
onCancel: {
|
31
|
+
type: FunctionConstructor;
|
32
|
+
default: () => void;
|
33
|
+
};
|
22
34
|
}, {
|
23
35
|
isValid: import("vue").Ref<boolean>;
|
24
36
|
submit(e: any): void;
|
@@ -45,11 +57,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
45
57
|
type: BooleanConstructor;
|
46
58
|
default: boolean;
|
47
59
|
};
|
60
|
+
onSubmit: {
|
61
|
+
type: FunctionConstructor;
|
62
|
+
default: () => void;
|
63
|
+
};
|
64
|
+
onReset: {
|
65
|
+
type: FunctionConstructor;
|
66
|
+
default: () => void;
|
67
|
+
};
|
68
|
+
onCancel: {
|
69
|
+
type: FunctionConstructor;
|
70
|
+
default: () => void;
|
71
|
+
};
|
48
72
|
}>>, {
|
73
|
+
onReset: Function;
|
74
|
+
onSubmit: Function;
|
49
75
|
actions: unknown[];
|
50
76
|
showReset: boolean;
|
51
77
|
submitButtonTitle: string;
|
52
78
|
setConfigOnCancel: boolean;
|
53
79
|
autoClose: boolean;
|
80
|
+
onCancel: Function;
|
54
81
|
}>;
|
55
82
|
export default _default;
|
@@ -85,7 +85,12 @@ class ContentTreeCollection extends IndexedCollection {
|
|
85
85
|
* @private
|
86
86
|
*/
|
87
87
|
this._defaultSubtreeItem = new SubContentTreeItem(
|
88
|
-
{
|
88
|
+
{
|
89
|
+
name: 'Content',
|
90
|
+
icon: '$vcsLayers',
|
91
|
+
title: 'content.title',
|
92
|
+
tooltip: 'content.title',
|
93
|
+
},
|
89
94
|
app,
|
90
95
|
);
|
91
96
|
/**
|
@@ -195,8 +195,9 @@ declare class CollectionComponentClass<T extends Object | import("@vcmap/core/di
|
|
195
195
|
*/
|
196
196
|
private _handleItemReplaced;
|
197
197
|
/**
|
198
|
-
*
|
199
|
-
*
|
198
|
+
* Synchronizes the order of the list items with respect to the order of the items in the collection.
|
199
|
+
* Removes and reinserts the moved item.
|
200
|
+
* Ensures selection and hasUpdate.
|
200
201
|
* @param {T} item
|
201
202
|
* @template T
|
202
203
|
* @private
|
@@ -399,18 +399,32 @@ class CollectionComponentClass {
|
|
399
399
|
* @private
|
400
400
|
*/
|
401
401
|
_handleItemReplaced(replaced) {
|
402
|
+
const listItemHasUpdate = this.getListItemForItem(replaced.old)?.hasUpdate;
|
403
|
+
const idx = this._listItems.value.findIndex(
|
404
|
+
(l) => l.name === replaced.old[this.collection.uniqueKey],
|
405
|
+
);
|
402
406
|
const selectedIdx = this.selection.value.findIndex(
|
403
407
|
(l) => l.name === replaced.old[this.collection.uniqueKey],
|
404
408
|
);
|
405
409
|
this._handleItemRemoved(replaced.old);
|
406
|
-
if (selectedIdx > -1) {
|
410
|
+
if (selectedIdx > -1 || listItemHasUpdate !== undefined) {
|
407
411
|
const addedListener = this._collection.added.addEventListener((added) => {
|
408
412
|
if (added === replaced.new) {
|
409
|
-
const
|
413
|
+
const newIdx = this.items.value.findIndex(
|
410
414
|
(l) => l.name === added[this.collection.uniqueKey],
|
411
415
|
);
|
416
|
+
const newListItem = this._listItems.value[newIdx];
|
412
417
|
if (newListItem) {
|
413
|
-
|
418
|
+
if (listItemHasUpdate !== undefined) {
|
419
|
+
newListItem.hasUpdate = listItemHasUpdate;
|
420
|
+
}
|
421
|
+
if (newIdx !== idx) {
|
422
|
+
this._listItems.value.splice(newIdx, 1);
|
423
|
+
this._listItems.value.splice(idx, 0, newListItem);
|
424
|
+
}
|
425
|
+
if (selectedIdx > -1) {
|
426
|
+
this.selection.value.splice(selectedIdx, 0, newListItem);
|
427
|
+
}
|
414
428
|
}
|
415
429
|
addedListener();
|
416
430
|
}
|
@@ -419,8 +433,9 @@ class CollectionComponentClass {
|
|
419
433
|
}
|
420
434
|
|
421
435
|
/**
|
422
|
-
*
|
423
|
-
*
|
436
|
+
* Synchronizes the order of the list items with respect to the order of the items in the collection.
|
437
|
+
* Removes and reinserts the moved item.
|
438
|
+
* Ensures selection and hasUpdate.
|
424
439
|
* @param {T} item
|
425
440
|
* @template T
|
426
441
|
* @private
|
@@ -17,10 +17,12 @@ export function makeEditorCollectionComponentClass<T extends Object | import("@v
|
|
17
17
|
* @typedef {{
|
18
18
|
* editor: EditorWindowComponentOptions|function(T):EditorWindowComponentOptions|undefined,
|
19
19
|
* multiEditor?: EditorWindowComponentOptions,
|
20
|
+
* predicate?: import("./collectionManager.js").PredicateFunction<T>,
|
20
21
|
* selectionBased?: boolean
|
21
22
|
* }} EditingOptions
|
22
23
|
* @property {EditorWindowComponentOptions|function(T)|undefined} editor
|
23
24
|
* @property {EditorWindowComponentOptions} [multiEditor]
|
25
|
+
* @property {import("./collectionManager.js").PredicateFunction<T>} [predicate=()=>true] - Optional predicate function for editor
|
24
26
|
* @property {boolean} [selectionBased=true] - If true, editor windows are coupled to selection and editor windows are exclusive
|
25
27
|
* @template {Object} T
|
26
28
|
*/
|
@@ -45,6 +47,7 @@ export type EditorWindowComponentOptions = Omit<import("../window/windowManager.
|
|
45
47
|
export type EditingOptions<T extends Object> = {
|
46
48
|
editor: EditorWindowComponentOptions | ((arg0: T) => EditorWindowComponentOptions | undefined);
|
47
49
|
multiEditor?: EditorWindowComponentOptions;
|
50
|
+
predicate?: import("./collectionManager.js").PredicateFunction<T>;
|
48
51
|
selectionBased?: boolean;
|
49
52
|
};
|
50
53
|
export type EditorCollectionComponentClass<T extends Object> = import("./collectionComponentClass.js").default<T> & {
|
@@ -12,10 +12,12 @@ import { createListEditAction } from '../../actions/listActions.js';
|
|
12
12
|
* @typedef {{
|
13
13
|
* editor: EditorWindowComponentOptions|function(T):EditorWindowComponentOptions|undefined,
|
14
14
|
* multiEditor?: EditorWindowComponentOptions,
|
15
|
+
* predicate?: import("./collectionManager.js").PredicateFunction<T>,
|
15
16
|
* selectionBased?: boolean
|
16
17
|
* }} EditingOptions
|
17
18
|
* @property {EditorWindowComponentOptions|function(T)|undefined} editor
|
18
19
|
* @property {EditorWindowComponentOptions} [multiEditor]
|
20
|
+
* @property {import("./collectionManager.js").PredicateFunction<T>} [predicate=()=>true] - Optional predicate function for editor
|
19
21
|
* @property {boolean} [selectionBased=true] - If true, editor windows are coupled to selection and editor windows are exclusive
|
20
22
|
* @template {Object} T
|
21
23
|
*/
|
@@ -61,6 +63,7 @@ export function makeEditorCollectionComponentClass(
|
|
61
63
|
check(collectionComponent, CollectionComponentClass);
|
62
64
|
check(editingOptions.editor, [Object, Function]);
|
63
65
|
checkMaybe(editingOptions.multiEditor, Object);
|
66
|
+
checkMaybe(editingOptions.predicate, Function);
|
64
67
|
|
65
68
|
const editorCollectionComponent =
|
66
69
|
/** @type {EditorCollectionComponentClass} */ collectionComponent;
|
@@ -79,6 +82,7 @@ export function makeEditorCollectionComponentClass(
|
|
79
82
|
const {
|
80
83
|
editor,
|
81
84
|
multiEditor = undefined,
|
85
|
+
predicate = () => true,
|
82
86
|
selectionBased = true,
|
83
87
|
} = editingOptions;
|
84
88
|
const keyProperty = editorCollectionComponent.collection.uniqueKey;
|
@@ -214,7 +218,7 @@ export function makeEditorCollectionComponentClass(
|
|
214
218
|
);
|
215
219
|
|
216
220
|
editorCollectionComponent.addItemMapping({
|
217
|
-
predicate
|
221
|
+
predicate,
|
218
222
|
mappingFunction: (item, c, listItem) => {
|
219
223
|
listItem.clickedCallbacks.push((event) => {
|
220
224
|
if (!(event.shiftKey || event.ctrlKey)) {
|
package/src/vcsUiApp.d.ts
CHANGED
@@ -263,9 +263,10 @@ declare class VcsUiApp extends VcsApp {
|
|
263
263
|
* This function can be used for the WindowState infoUrlCallback property.
|
264
264
|
* @param {string} [path] - the path to a help section
|
265
265
|
* @param {string} [subpage='vc-map'] - path to a subpage. Default is 'vc-map'.
|
266
|
+
* @param {string=} [subpageVersion=undefined] - default version is the mapVersion, can be provided to use a plugin specific version
|
266
267
|
* @returns {function():string}
|
267
268
|
*/
|
268
|
-
getHelpUrlCallback(path?: string | undefined, subpage?: string | undefined): () => string;
|
269
|
+
getHelpUrlCallback(path?: string | undefined, subpage?: string | undefined, subpageVersion?: string | undefined): () => string;
|
269
270
|
/**
|
270
271
|
* Get the state of the application. When passed the forUrl flag, only a minimal set of states shall be provided for a sharable link to the current state (to ensure
|
271
272
|
* the maximum URL length is not exceeded). This includes: layer active state & styling, active map, active viewpoint,
|
package/src/vcsUiApp.js
CHANGED
@@ -458,10 +458,17 @@ class VcsUiApp extends VcsApp {
|
|
458
458
|
* This function can be used for the WindowState infoUrlCallback property.
|
459
459
|
* @param {string} [path] - the path to a help section
|
460
460
|
* @param {string} [subpage='vc-map'] - path to a subpage. Default is 'vc-map'.
|
461
|
+
* @param {string=} [subpageVersion=undefined] - default version is the mapVersion, can be provided to use a plugin specific version
|
461
462
|
* @returns {function():string}
|
462
463
|
*/
|
463
|
-
getHelpUrlCallback(
|
464
|
-
|
464
|
+
getHelpUrlCallback(
|
465
|
+
path = '',
|
466
|
+
subpage = 'vc-map',
|
467
|
+
subpageVersion = undefined,
|
468
|
+
) {
|
469
|
+
const mayorMinorVersion = /\d+\.\d+/.exec(
|
470
|
+
subpageVersion || VcsUiApp.getVersion(),
|
471
|
+
)[0];
|
465
472
|
return () => {
|
466
473
|
const base =
|
467
474
|
this.uiConfig.config.value.helpBaseUrl || 'https://help.vc.systems/';
|
@@ -1 +0,0 @@
|
|
1
|
-
import{initAppFromAppConfig as p}from"./ui.67779e.js";p("#app","app.config.json");
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|