@vcmap/ui 5.1.0-rc.1 → 5.1.0-rc.3

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/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui.3c73c2.js";
1
+ export * from "./ui.7d2c2e.js";
@@ -1,5 +1,5 @@
1
- export * from "./vue.4fe14e.js";
2
- import { default as f } from "./vue.4fe14e.js";
1
+ export * from "./vue.e8ee6a.js";
2
+ import { default as f } from "./vue.e8ee6a.js";
3
3
  export {
4
4
  f as default
5
5
  };
@@ -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.260d9a.css');import v from "./vue.4fe14e.js";
16
+ } await loadCss('./assets/vuetify.d22222.css');import v from "./vue.e8ee6a.js";
17
17
  const Ne = v.extend().extend({
18
18
  name: "themeable",
19
19
  provide() {
@@ -1,5 +1,5 @@
1
- export * from "./vuetify.260d9a.js";
2
- import { default as f } from "./vuetify.260d9a.js";
1
+ export * from "./vuetify.d22222.js";
2
+ import { default as f } from "./vuetify.d22222.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/dist/index.html CHANGED
@@ -91,7 +91,7 @@
91
91
  }
92
92
  }
93
93
  </style>
94
- <script type="module" crossorigin src="./assets/index-bb2549d6.js"></script>
94
+ <script type="module" crossorigin src="./assets/index-94e13552.js"></script>
95
95
  </head>
96
96
  <body style="height: 100vh; margin: 0;">
97
97
  <noscript>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "5.1.0-rc.1",
3
+ "version": "5.1.0-rc.3",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@vcmap-cesium/engine": "^4.0.3",
56
- "@vcmap/core": "^5.1.0-rc.2",
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"
@@ -4,11 +4,14 @@
4
4
  "@vcmap/swipe-tool": "^1.0.3",
5
5
  "@vcmap/export": "^1.0.1",
6
6
  "@vcmap/shadow": "^1.0.1",
7
- "@vcmap/draw": "^1.0.0",
7
+ "@vcmap/draw": "^2.0.0",
8
8
  "@vcmap/create-link": "^1.0.1",
9
9
  "@vcmap/search-nominatim": "^1.0.1",
10
10
  "@vcmap/multi-view": "^1.0.1",
11
- "@vcmap/cesium-filters": "^1.0.1"
11
+ "@vcmap/cesium-filters": "^1.0.1",
12
+ "@vcmap/viewshed": "^2.0.1",
13
+ "@vcmap/measurement": "^1.0.2",
14
+ "@vcmap/flight": "^1.0.1"
12
15
  },
13
16
  "optionalDependencies": {}
14
17
  }
@@ -42,10 +42,10 @@ export function createListExportAction(selection: import("vue").Ref<Array<import
42
42
  * @param {import("../manager/window/windowManager.js").default} windowManager
43
43
  * @param {string|symbol} owner
44
44
  * @param {string} parentId
45
- * @returns {{ownedAction: import("../manager/collectionManager/collectionManager.js").OwnedAction, destroy: (function(): void)}}
45
+ * @returns {{action: import("../manager/collectionManager/collectionManager.js").OwnedAction, destroy: (function(): void)}}
46
46
  */
47
47
  export function createListImportAction(importCallback: (arg0: File[]) => void | Promise<void>, windowManager: import("../manager/window/windowManager.js").default, owner: string | symbol, parentId: string): {
48
- ownedAction: import("../manager/collectionManager/collectionManager.js").OwnedAction;
48
+ action: import("../manager/collectionManager/collectionManager.js").OwnedAction;
49
49
  destroy: (() => void);
50
50
  };
51
51
  /**
@@ -99,7 +99,7 @@ export function createListExportAction(selection, exportCallback, owner) {
99
99
  * @param {import("../manager/window/windowManager.js").default} windowManager
100
100
  * @param {string|symbol} owner
101
101
  * @param {string} parentId
102
- * @returns {{ownedAction: import("../manager/collectionManager/collectionManager.js").OwnedAction, destroy: (function(): void)}}
102
+ * @returns {{action: import("../manager/collectionManager/collectionManager.js").OwnedAction, destroy: (function(): void)}}
103
103
  */
104
104
  export function createListImportAction(
105
105
  importCallback,
@@ -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;
@@ -195,8 +195,9 @@ declare class CollectionComponentClass<T extends Object | import("@vcmap/core/di
195
195
  */
196
196
  private _handleItemReplaced;
197
197
  /**
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.
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,24 @@ class CollectionComponentClass {
399
399
  * @private
400
400
  */
401
401
  _handleItemReplaced(replaced) {
402
+ const listItemHasUpdate = this.getListItemForItem(replaced.old)?.hasUpdate;
402
403
  const selectedIdx = this.selection.value.findIndex(
403
404
  (l) => l.name === replaced.old[this.collection.uniqueKey],
404
405
  );
405
406
  this._handleItemRemoved(replaced.old);
406
- if (selectedIdx > -1) {
407
+ if (selectedIdx > -1 || listItemHasUpdate !== undefined) {
407
408
  const addedListener = this._collection.added.addEventListener((added) => {
408
409
  if (added === replaced.new) {
409
410
  const newListItem = this.items.value.find(
410
411
  (l) => l.name === added[this.collection.uniqueKey],
411
412
  );
412
413
  if (newListItem) {
413
- this.selection.value.splice(selectedIdx, 0, newListItem);
414
+ if (listItemHasUpdate !== undefined) {
415
+ newListItem.hasUpdate = listItemHasUpdate;
416
+ }
417
+ if (selectedIdx > -1) {
418
+ this.selection.value.splice(selectedIdx, 0, newListItem);
419
+ }
414
420
  }
415
421
  addedListener();
416
422
  }
@@ -419,8 +425,9 @@ class CollectionComponentClass {
419
425
  }
420
426
 
421
427
  /**
422
- * synchronizes the order of the list items with respect to the order of the items in the collection.
423
- * removes and reinserts the moved item.
428
+ * Synchronizes the order of the list items with respect to the order of the items in the collection.
429
+ * Removes and reinserts the moved item.
430
+ * Ensures selection and hasUpdate.
424
431
  * @param {T} item
425
432
  * @template T
426
433
  * @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: (item) => !!getEditorWindowOptions(item),
221
+ predicate,
218
222
  mappingFunction: (item, c, listItem) => {
219
223
  listItem.clickedCallbacks.push((event) => {
220
224
  if (!(event.shiftKey || event.ctrlKey)) {
@@ -1 +0,0 @@
1
- import{initAppFromAppConfig as p}from"./ui.3c73c2.js";p("#app","app.config.json");
File without changes
File without changes
File without changes