@vcmap/ui 6.1.13 → 6.2.0-rc.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/build.js +2 -2
- package/build/buildHelpers.js +2 -3
- package/build/buildTypes.js +1 -1
- package/build/commonViteConfig.js +0 -1
- package/build/lintTypes.js +1 -1
- package/config/dev.config.json +4 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-171d1d84.js → core-de8e51b5.js} +2 -2
- package/dist/assets/core.js +1 -1
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-4f308e45.css +1 -0
- package/dist/assets/{ui-78b0084c.js → ui-4f308e45.js} +9084 -8706
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-d26d8a53.js → vuetify-99195777.js} +1 -1
- package/dist/assets/vuetify.js +1 -1
- package/index.d.ts +4 -0
- package/index.js +5 -0
- package/package.json +4 -46
- package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +2 -3
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +0 -1
- package/plugins/@vcmap-show-case/form-inputs-example/src/index.js +3 -3
- package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +6 -6
- package/plugins/@vcmap-show-case/hello-world/src/index.js +0 -6
- package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +1 -1
- package/plugins/@vcmap-show-case/panel-tester/src/IframePanelExample.vue +1 -1
- package/plugins/@vcmap-show-case/panel-tester/src/ImgPanelExample.vue +1 -1
- package/plugins/@vcmap-show-case/panel-tester/src/PanelExample.vue +1 -1
- package/plugins/@vcmap-show-case/panel-tester/src/TextPanelExample.vue +1 -1
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +1 -0
- package/plugins/@vcmap-show-case/toolbox-example/src/TriStateExampleWindow.vue +1 -1
- package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +5 -5
- package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +1 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +1 -1
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +1 -1
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +1 -1
- package/src/application/MapsGroupMobileMenu.vue +6 -5
- package/src/application/MapsGroupMobileMenu.vue.d.ts +3 -1
- package/src/application/VcsApp.vue +36 -46
- package/src/application/VcsApp.vue.d.ts +19 -45
- package/src/application/VcsAppWrapper.vue +4 -4
- package/src/application/VcsAttributions.vue +12 -12
- package/src/application/VcsAttributionsFooter.vue +27 -27
- package/src/application/VcsContainer.vue +50 -51
- package/src/application/VcsContainer.vue.d.ts +14 -2
- package/src/application/VcsMainMap.vue +2 -2
- package/src/application/VcsMap.vue +16 -16
- package/src/application/VcsNavbar.vue +17 -15
- package/src/application/VcsNavbarMobile.vue +15 -15
- package/src/application/VcsObliqueFooter.vue +10 -9
- package/src/application/VcsPositionDisplay.vue +8 -8
- package/src/application/VcsTextPage.vue +10 -10
- package/src/application/VcsTextPageFooter.vue +9 -9
- package/src/application/uiConfigHelper.d.ts +6 -0
- package/src/application/uiConfigHelper.js +19 -0
- package/src/callback/stopRotationCallback.js +0 -1
- package/src/callback/toggleToolbarButtonCallback.d.ts +48 -0
- package/src/callback/toggleToolbarButtonCallback.js +115 -0
- package/src/components/attrsHelpers.js +1 -1
- package/src/components/buttons/VcsActionButtonList.vue +5 -5
- package/src/components/buttons/VcsButton.vue +26 -26
- package/src/components/buttons/VcsFormButton.vue +31 -31
- package/src/components/buttons/VcsToolButton.vue +29 -29
- package/src/components/extent/VcsExtent.vue +1 -1
- package/src/components/extent/VcsExtentEditor.vue +1 -1
- package/src/components/flight/VcsFlightAnchorsComponent.vue +2 -2
- package/src/components/flight/VcsFlightAnchorsComponent.vue.d.ts +1 -4
- package/src/components/flight/VcsFlightEditor.vue +1 -0
- package/src/components/flight/VcsFlightEditor.vue.d.ts +4 -2
- package/src/components/flight/VcsFlightPlayer.vue +1 -1
- package/src/components/form-inputs-controls/VcsCheckbox.vue +23 -23
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +20 -20
- package/src/components/form-inputs-controls/VcsCoordinate.vue +3 -3
- package/src/components/form-inputs-controls/VcsDatePicker.vue +7 -7
- package/src/components/form-inputs-controls/VcsFileInput.vue +14 -14
- package/src/components/form-inputs-controls/VcsLabel.vue +26 -26
- package/src/components/form-inputs-controls/VcsRadio.vue +27 -27
- package/src/components/form-inputs-controls/VcsSelect.vue +78 -78
- package/src/components/form-inputs-controls/VcsSlider.vue +43 -43
- package/src/components/form-inputs-controls/VcsTextArea.vue +47 -47
- package/src/components/form-inputs-controls/VcsTextField.vue +4 -4
- package/src/components/form-inputs-controls/VcsWizard.vue +4 -4
- package/src/components/form-output/VcsFormattedNumber.vue +11 -11
- package/src/components/form-output/VcsMarkdown.vue +23 -22
- package/src/components/form-output/markdownHelper.js +1 -1
- package/src/components/import/VcsImportComponent.vue +1 -0
- package/src/components/import/VcsImportComponent.vue.d.ts +4 -2
- package/src/components/lists/VcsActionList.vue +14 -14
- package/src/components/lists/VcsList.vue +24 -20
- package/src/components/lists/VcsList.vue.d.ts +4 -6
- package/src/components/lists/VcsListItemComponent.vue +28 -8
- package/src/components/lists/VcsTreeNode.vue +138 -38
- package/src/components/lists/VcsTreeview.vue +65 -23
- package/src/components/lists/VcsTreeview.vue.d.ts +34 -9
- package/src/components/lists/VcsTreeviewSearchbar.vue +50 -50
- package/src/components/lists/VcsTreeviewTitle.vue +13 -13
- package/src/components/lists/dragHelper.d.ts +118 -0
- package/src/components/lists/dragHelper.js +325 -0
- package/src/components/lists/listHelper.d.ts +3 -2
- package/src/components/lists/listHelper.js +8 -1
- package/src/components/notification/VcsBadge.vue +12 -12
- package/src/components/notification/VcsHelp.vue +9 -9
- package/src/components/notification/VcsHelpTooltip.vue +1 -1
- package/src/components/style/StyleMenuWrapper.vue +1 -1
- package/src/components/tables/VcsDataTable.vue +3 -2
- package/src/components/tables/VcsDataTable.vue.d.ts +4 -2
- package/src/components/vector-properties/VcsFeatureEditingWindow.vue +1 -1
- package/src/components/vector-properties/VcsFeatureTransforms.vue +1 -1
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +1 -1
- package/src/components/viewpoint/VcsViewpointEditor.vue +1 -0
- package/src/components/viewpoint/VcsViewpointEditor.vue.d.ts +4 -2
- package/src/contentTree/LayerSwap.vue +149 -0
- package/src/contentTree/LayerSwap.vue.d.ts +27 -0
- package/src/contentTree/LayerTree.vue +53 -3
- package/src/contentTree/LayerTree.vue.d.ts +3 -0
- package/src/contentTree/contentTreeCollection.js +0 -1
- package/src/i18n/de.d.ts +63 -55
- package/src/i18n/de.js +5 -0
- package/src/i18n/en.d.ts +63 -55
- package/src/i18n/en.js +5 -0
- package/src/init.js +1 -1
- package/src/manager/collectionManager/CollectionComponent.vue +1 -1
- package/src/manager/collectionManager/CollectionComponentContent.vue +2 -2
- package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +1 -4
- package/src/manager/collectionManager/CollectionComponentList.vue +14 -13
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +3 -7
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +2 -2
- package/src/manager/collectionManager/CollectionManager.vue +2 -2
- package/src/manager/panel/PanelComponent.vue +40 -39
- package/src/manager/panel/PanelComponent.vue.d.ts +4 -2
- package/src/manager/panel/PanelManagerComponent.vue +13 -13
- package/src/manager/panel/PanelManagerComponent.vue.d.ts +4 -2
- package/src/manager/panel/panelHelper.js +19 -21
- package/src/manager/toolbox/GroupToolboxComponent.vue +9 -8
- package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +5 -2
- package/src/manager/toolbox/SelectToolboxComponent.vue +9 -8
- package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +5 -2
- package/src/manager/toolbox/ToolboxManagerComponent.vue +23 -23
- package/src/manager/window/WindowComponent.vue +12 -12
- package/src/manager/window/WindowComponent.vue.d.ts +7 -4
- package/src/manager/window/WindowComponentHeader.vue +24 -24
- package/src/manager/window/WindowComponentHeader.vue.d.ts +7 -4
- package/src/manager/window/WindowManager.vue +41 -41
- package/src/navigation/MapNavCompass.vue +4 -3
- package/src/navigation/MapNavCompass.vue.d.ts +4 -2
- package/src/navigation/ObliqueRotation.vue +1 -0
- package/src/navigation/ObliqueRotation.vue.d.ts +4 -2
- package/src/navigation/OrientationToolsButton.vue +1 -1
- package/src/navigation/TiltSlider.vue +35 -35
- package/src/navigation/VcsCompass.vue +18 -13
- package/src/navigation/VcsCompass.vue.d.ts +6 -2
- package/src/navigation/VcsZoomButton.vue +1 -0
- package/src/navigation/VcsZoomButton.vue.d.ts +5 -2
- package/src/navigation/locatorHelper.js +1 -1
- package/src/notifier/NotifierComponent.vue +1 -1
- package/src/pluginHelper.js +2 -1
- package/src/search/ResultItem.vue +1 -0
- package/src/search/SearchComponent.vue +35 -35
- package/src/search/markText.js +2 -2
- package/src/state.d.ts +12 -1
- package/src/state.js +59 -4
- package/src/uiConfig.d.ts +30 -3
- package/src/uiConfig.js +4 -1
- package/src/vcsUiApp.js +20 -0
- package/dist/assets/ui-78b0084c.css +0 -1
- /package/dist/assets/{cesium-76fff1d7.js → cesium-ac6c193a.js} +0 -0
- /package/dist/assets/{ol-76b9c9e3.js → ol-94c57f2e.js} +0 -0
- /package/dist/assets/{vue-859ae1f4.js → vue-62303c82.js} +0 -0
- /package/dist/assets/{vuetify-d26d8a53.css → vuetify-99195777.css} +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { ref, computed } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @enum {number}
|
|
5
|
+
*/
|
|
6
|
+
export const InsertMode = {
|
|
7
|
+
BEFORE: -1,
|
|
8
|
+
INTO: 0,
|
|
9
|
+
AFTER: 1,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef { Object &
|
|
14
|
+
* (import('./VcsTreeNode.vue').VcsTreeNodeItem | import('./VcsListItemComponent.vue').VcsListItem)
|
|
15
|
+
* } VcsDraggableItem
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {{
|
|
20
|
+
* item: VcsDraggableItem,
|
|
21
|
+
* targetItem: VcsDraggableItem,
|
|
22
|
+
* targetIndex: number,
|
|
23
|
+
* position?: InsertMode
|
|
24
|
+
* }} ItemMovedEvent
|
|
25
|
+
* @property {VcsDraggableItem} item
|
|
26
|
+
* @property {VcsDraggableItem} targetItem
|
|
27
|
+
* @property {number} targetIndex @deprecated targetIndex is deprecated and will be removed on next mayor release. Use targetItem instead.
|
|
28
|
+
* @property {InsertMode?} position
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {{
|
|
33
|
+
* dragging: import("vue").Ref<boolean>,
|
|
34
|
+
* isDraggable: import("vue").ComputedRef<boolean>,
|
|
35
|
+
* dragStart: (
|
|
36
|
+
* e: MouseEvent,
|
|
37
|
+
* item: VcsDraggableItem
|
|
38
|
+
* ) => void;
|
|
39
|
+
* dragOver: (
|
|
40
|
+
* e: MouseEvent,
|
|
41
|
+
* item: VcsDraggableItem,
|
|
42
|
+
* dropTarget: HTMLElement,
|
|
43
|
+
* dropTargetZones?: DropZones,
|
|
44
|
+
* isOpen?: boolean,
|
|
45
|
+
* ) => void;
|
|
46
|
+
* dragLeave: (e: MouseEvent) => void;
|
|
47
|
+
* dragEnd: (e: MouseEvent) => void;
|
|
48
|
+
* drop: (
|
|
49
|
+
* e: MouseEvent,
|
|
50
|
+
* item: VcsDraggableItem
|
|
51
|
+
* ) => void;
|
|
52
|
+
* }} DraggableListOrTreeSetup
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Defines the allowed drop zones for an item.
|
|
57
|
+
* True allows all zones (3 for trees, 2 for lists), false prohibits dropping on the item.
|
|
58
|
+
* Used for styling the item.
|
|
59
|
+
* @typedef {{
|
|
60
|
+
* before:boolean,
|
|
61
|
+
* after:boolean,
|
|
62
|
+
* into?:boolean
|
|
63
|
+
* }|boolean} DropZones
|
|
64
|
+
* @property {boolean} before - allow insert before target
|
|
65
|
+
* @property {boolean} after - allow insert after target
|
|
66
|
+
* @property {boolean?} into - allow insert into target. Only available for tree, not for list!
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A function defining the drop zones of a target item.
|
|
71
|
+
* Provides item and targetItem to implement corresponding conditions.
|
|
72
|
+
* Returns the allowed DropZones of the targetItem.
|
|
73
|
+
* @typedef {(item: VcsDraggableItem,targetItem: VcsDraggableItem) => DropZones} DropTargetZonesFunction
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Function setting up drag logic for lists or trees. Use only in setup function of components!
|
|
78
|
+
* This requires items (VcsListItem or VcsTreeNode) with unique keys (name property).
|
|
79
|
+
* @param {Object & { items: Array<VcsDraggableItem>, draggable: boolean, dropTargetZones?: DropTargetZonesFunction }} props
|
|
80
|
+
* @param {import("vue").Ref<string>} query
|
|
81
|
+
* @param {(event: 'itemMoved', value: ItemMovedEvent) => void} emit
|
|
82
|
+
* @returns {DraggableListOrTreeSetup}
|
|
83
|
+
*/
|
|
84
|
+
export function setupDraggableListOrTree(props, query, emit) {
|
|
85
|
+
const dragging = ref(false);
|
|
86
|
+
/**
|
|
87
|
+
* @type {VcsDraggableItem|null}
|
|
88
|
+
*/
|
|
89
|
+
let draggedItem = null;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @type {InsertMode|null}
|
|
93
|
+
*/
|
|
94
|
+
let dropPosition = null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @type {import("vue").ComputedRef<boolean>}
|
|
98
|
+
*/
|
|
99
|
+
const isDraggable = computed(() => {
|
|
100
|
+
return !query.value && props.draggable;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param {HTMLElement} target
|
|
106
|
+
*/
|
|
107
|
+
function clearDropTargetClasses(target) {
|
|
108
|
+
target.classList.remove(
|
|
109
|
+
'drop-target-before',
|
|
110
|
+
'drop-target-after',
|
|
111
|
+
'drop-target-into',
|
|
112
|
+
'no-drop-allowed',
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Add css classes to visualize drop targets on tue current dragover item
|
|
118
|
+
* @param {MouseEvent} e
|
|
119
|
+
* @param {HTMLElement} dropTarget
|
|
120
|
+
* @param {DropZones} dropTargetZones
|
|
121
|
+
* @param {boolean} isOpen
|
|
122
|
+
*/
|
|
123
|
+
function addDropTargetClasses(e, dropTarget, dropTargetZones, isOpen) {
|
|
124
|
+
const isAfterAllowed =
|
|
125
|
+
dropTargetZones === true ||
|
|
126
|
+
(typeof dropTargetZones === 'object' && dropTargetZones?.after !== false);
|
|
127
|
+
const isBeforeAllowed =
|
|
128
|
+
dropTargetZones === true ||
|
|
129
|
+
(typeof dropTargetZones === 'object' &&
|
|
130
|
+
dropTargetZones?.before !== false);
|
|
131
|
+
const isIntoAllowed =
|
|
132
|
+
dropTargetZones === true || dropTargetZones.into === true;
|
|
133
|
+
|
|
134
|
+
const denominator = isIntoAllowed ? 4 : 2;
|
|
135
|
+
const rect = dropTarget.getBoundingClientRect();
|
|
136
|
+
const threshold = rect.height / denominator;
|
|
137
|
+
const relativeY = e.clientY - rect.top;
|
|
138
|
+
const { currentTarget } = /** @type {{ currentTarget: HTMLElement }} */ (e);
|
|
139
|
+
|
|
140
|
+
e.dataTransfer.dropEffect = 'move';
|
|
141
|
+
if (isBeforeAllowed && relativeY < threshold) {
|
|
142
|
+
dropPosition = InsertMode.BEFORE;
|
|
143
|
+
currentTarget.classList.add('drop-target-before');
|
|
144
|
+
} else if (
|
|
145
|
+
isAfterAllowed &&
|
|
146
|
+
relativeY >= (denominator - 1) * threshold &&
|
|
147
|
+
!isOpen
|
|
148
|
+
) {
|
|
149
|
+
dropPosition = InsertMode.AFTER;
|
|
150
|
+
currentTarget.classList.add('drop-target-after');
|
|
151
|
+
} else if (dropTargetZones === true || dropTargetZones.into === true) {
|
|
152
|
+
dropPosition = InsertMode.INTO;
|
|
153
|
+
currentTarget.classList.add('drop-target-into');
|
|
154
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
155
|
+
} else {
|
|
156
|
+
e.dataTransfer.dropEffect = 'none';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @param {MouseEvent} e
|
|
162
|
+
* @param {VcsDraggableItem} item
|
|
163
|
+
*/
|
|
164
|
+
function drop(e, item) {
|
|
165
|
+
if (isDraggable.value) {
|
|
166
|
+
if (draggedItem && item && draggedItem !== item) {
|
|
167
|
+
emit('itemMoved', {
|
|
168
|
+
item: draggedItem,
|
|
169
|
+
targetItem: item,
|
|
170
|
+
position: dropPosition,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
draggedItem = null;
|
|
174
|
+
dropPosition = null;
|
|
175
|
+
dragging.value = false;
|
|
176
|
+
clearDropTargetClasses(e.currentTarget);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @param {MouseEvent} e
|
|
182
|
+
* @param {VcsDraggableItem} item
|
|
183
|
+
*/
|
|
184
|
+
function dragStart(e, item) {
|
|
185
|
+
e.stopPropagation();
|
|
186
|
+
if (isDraggable.value) {
|
|
187
|
+
draggedItem = item;
|
|
188
|
+
e.dataTransfer.effectAllowed = 'all';
|
|
189
|
+
dragging.value = true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @param {MouseEvent} e
|
|
195
|
+
* @param {VcsDraggableItem} item
|
|
196
|
+
* @param {HTMLElement} dropTarget
|
|
197
|
+
* @param {DropZones} [dropTargetZones=true]
|
|
198
|
+
* @param {boolean} [isOpen=false]
|
|
199
|
+
*/
|
|
200
|
+
function dragOver(
|
|
201
|
+
e,
|
|
202
|
+
item,
|
|
203
|
+
dropTarget,
|
|
204
|
+
dropTargetZones = true,
|
|
205
|
+
isOpen = false,
|
|
206
|
+
) {
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
if (
|
|
210
|
+
!isDraggable.value ||
|
|
211
|
+
!dragging.value ||
|
|
212
|
+
draggedItem?.name === item.name
|
|
213
|
+
) {
|
|
214
|
+
e.dataTransfer.dropEffect = 'none';
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
clearDropTargetClasses(e.currentTarget);
|
|
219
|
+
addDropTargetClasses(
|
|
220
|
+
e,
|
|
221
|
+
dropTarget,
|
|
222
|
+
props.dropTargetZones
|
|
223
|
+
? props.dropTargetZones(draggedItem, item)
|
|
224
|
+
: dropTargetZones,
|
|
225
|
+
isOpen,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {MouseEvent} e
|
|
231
|
+
*/
|
|
232
|
+
function dragLeave(e) {
|
|
233
|
+
e.stopPropagation();
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
dropPosition = null;
|
|
236
|
+
clearDropTargetClasses(e.currentTarget);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @param {MouseEvent} e
|
|
241
|
+
*/
|
|
242
|
+
function dragEnd(e) {
|
|
243
|
+
e.stopPropagation();
|
|
244
|
+
dropPosition = null;
|
|
245
|
+
dragging.value = false;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
dragging,
|
|
250
|
+
isDraggable,
|
|
251
|
+
dragStart,
|
|
252
|
+
dragOver,
|
|
253
|
+
dragLeave,
|
|
254
|
+
dragEnd,
|
|
255
|
+
drop,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Recursively searches for an item in a nested array and performs a splice operation
|
|
261
|
+
* @param {Array<VcsDraggableItem>} array - The array to search in
|
|
262
|
+
* @param {VcsDraggableItem} item - The item to find
|
|
263
|
+
* @param {number} deleteCount - Number of items to delete
|
|
264
|
+
* @param {InsertMode?} insertPosition - Default is inserting before provided item. Other options are after and into.
|
|
265
|
+
* @param {...VcsDraggableItem} itemsToInsert - Items to insert
|
|
266
|
+
* @returns {Array<VcsDraggableItem>|undefined} - The removed items or undefined if not found
|
|
267
|
+
*/
|
|
268
|
+
function findAndSplice(
|
|
269
|
+
array,
|
|
270
|
+
item,
|
|
271
|
+
deleteCount,
|
|
272
|
+
insertPosition,
|
|
273
|
+
...itemsToInsert
|
|
274
|
+
) {
|
|
275
|
+
const index = array.findIndex((i) => i === item);
|
|
276
|
+
|
|
277
|
+
if (index !== -1) {
|
|
278
|
+
if (insertPosition === InsertMode.AFTER) {
|
|
279
|
+
return array.splice(
|
|
280
|
+
index + InsertMode.AFTER,
|
|
281
|
+
deleteCount,
|
|
282
|
+
...itemsToInsert,
|
|
283
|
+
);
|
|
284
|
+
} else if (insertPosition === InsertMode.INTO) {
|
|
285
|
+
array[index].children = array[index].children || [];
|
|
286
|
+
array[index].children.push(...itemsToInsert);
|
|
287
|
+
return array;
|
|
288
|
+
}
|
|
289
|
+
// delete or insert before
|
|
290
|
+
return array.splice(index, deleteCount, ...itemsToInsert);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Item not found at current level, search in children
|
|
294
|
+
for (let i = 0; i < array.length; i++) {
|
|
295
|
+
const node = array[i];
|
|
296
|
+
if (node.children && node.children.length > 0) {
|
|
297
|
+
const result = findAndSplice(
|
|
298
|
+
node.children,
|
|
299
|
+
item,
|
|
300
|
+
deleteCount,
|
|
301
|
+
insertPosition,
|
|
302
|
+
...itemsToInsert,
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
if (result !== undefined) {
|
|
306
|
+
return result; // Item was found in this subtree
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Item not found
|
|
312
|
+
return undefined;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* A function moving items of a nested tree. Can be used for VcsTreeView @item-moved
|
|
317
|
+
* @example
|
|
318
|
+
* <VcsTreeView @item-moved="moveDraggableItems(items,$event)" />
|
|
319
|
+
* @param {Array<VcsDraggableItem>} items
|
|
320
|
+
* @param {ItemMovedEvent} event
|
|
321
|
+
*/
|
|
322
|
+
export function moveDraggableItems(items, { item, targetItem, position }) {
|
|
323
|
+
findAndSplice(items, item, 1);
|
|
324
|
+
findAndSplice(items, targetItem, 0, position, item);
|
|
325
|
+
}
|
|
@@ -56,12 +56,13 @@ export function setupSelectableList(props: Object & SelectableListProps, renderi
|
|
|
56
56
|
* This requires VcsListItems with unique keys (name property).
|
|
57
57
|
* @param {Object & { draggable: boolean }} props
|
|
58
58
|
* @param {import("vue").Ref<string>} query
|
|
59
|
-
* @param {(event: 'itemMoved', value: import("./
|
|
59
|
+
* @param {(event: 'itemMoved', value: import("./dragHelper.js").ItemMovedEvent) => void} emit
|
|
60
60
|
* @returns {DraggableListSetup}
|
|
61
|
+
* @deprecated This function is deprecated and will be removed in version 7. Use setupDraggableListOrTree from dragHelper.js instead.
|
|
61
62
|
*/
|
|
62
63
|
export function setupDraggableList(props: Object & {
|
|
63
64
|
draggable: boolean;
|
|
64
|
-
}, query: import("vue").Ref<string>, emit: (event: 'itemMoved', value: import("./
|
|
65
|
+
}, query: import("vue").Ref<string>, emit: (event: 'itemMoved', value: import("./dragHelper.js").ItemMovedEvent) => void): DraggableListSetup;
|
|
65
66
|
export type SelectableListProps = Object & {
|
|
66
67
|
selectable?: boolean;
|
|
67
68
|
singleSelect?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, isReactive, reactive, ref, shallowRef, watch } from 'vue';
|
|
2
|
+
import { getLogger } from '@vcsuite/logger';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @param {import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>} items
|
|
@@ -229,10 +230,16 @@ export function setupSelectableList(props, renderingItems, emit) {
|
|
|
229
230
|
* This requires VcsListItems with unique keys (name property).
|
|
230
231
|
* @param {Object & { draggable: boolean }} props
|
|
231
232
|
* @param {import("vue").Ref<string>} query
|
|
232
|
-
* @param {(event: 'itemMoved', value: import("./
|
|
233
|
+
* @param {(event: 'itemMoved', value: import("./dragHelper.js").ItemMovedEvent) => void} emit
|
|
233
234
|
* @returns {DraggableListSetup}
|
|
235
|
+
* @deprecated This function is deprecated and will be removed in version 7. Use setupDraggableListOrTree from dragHelper.js instead.
|
|
234
236
|
*/
|
|
235
237
|
export function setupDraggableList(props, query, emit) {
|
|
238
|
+
getLogger('listHelper.js').deprecate(
|
|
239
|
+
'setupDraggableList',
|
|
240
|
+
'Use setupDraggableListOrTree instead.',
|
|
241
|
+
);
|
|
242
|
+
|
|
236
243
|
/** @type {import("vue").Ref<number|undefined>} */
|
|
237
244
|
const hovering = ref(undefined);
|
|
238
245
|
/** @type {import("vue").Ref<number|undefined>} */
|
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
<span class="vcs-badge rounded-circle h-3 w-3" :class="[color]" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<style lang="scss" scoped>
|
|
6
|
-
.vcs-badge {
|
|
7
|
-
border: 1px solid rgb(var(--v-theme-surface)) !important;
|
|
8
|
-
}
|
|
9
|
-
.h-3 {
|
|
10
|
-
height: 12px;
|
|
11
|
-
}
|
|
12
|
-
.w-3 {
|
|
13
|
-
width: 12px;
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
16
|
-
|
|
17
5
|
<script>
|
|
18
6
|
/**
|
|
19
7
|
* @description UI component representing a circular indicator.
|
|
@@ -29,3 +17,15 @@
|
|
|
29
17
|
},
|
|
30
18
|
};
|
|
31
19
|
</script>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
.vcs-badge {
|
|
23
|
+
border: 1px solid rgb(var(--v-theme-surface)) !important;
|
|
24
|
+
}
|
|
25
|
+
.h-3 {
|
|
26
|
+
height: 12px;
|
|
27
|
+
}
|
|
28
|
+
.w-3 {
|
|
29
|
+
width: 12px;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -10,15 +10,6 @@
|
|
|
10
10
|
</v-container>
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
|
-
<style lang="scss">
|
|
14
|
-
.vcs-help {
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
ol,
|
|
17
|
-
ul {
|
|
18
|
-
padding-left: 16px; /* Indentation for list items */
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
13
|
<script>
|
|
23
14
|
import { VContainer } from 'vuetify/components';
|
|
24
15
|
|
|
@@ -40,3 +31,12 @@
|
|
|
40
31
|
},
|
|
41
32
|
};
|
|
42
33
|
</script>
|
|
34
|
+
<style lang="scss">
|
|
35
|
+
.vcs-help {
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
ol,
|
|
38
|
+
ul {
|
|
39
|
+
padding-left: 16px; /* Indentation for list items */
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
</v-container>
|
|
11
11
|
</v-tooltip>
|
|
12
12
|
</template>
|
|
13
|
-
<style lang="scss" scoped></style>
|
|
14
13
|
<script>
|
|
15
14
|
import { VTooltip, VIcon, VContainer } from 'vuetify/components';
|
|
16
15
|
import { useFontSize } from '../../vuePlugins/vuetify.js';
|
|
@@ -46,3 +45,4 @@
|
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
47
|
</script>
|
|
48
|
+
<style lang="scss" scoped></style>
|
|
@@ -238,6 +238,7 @@
|
|
|
238
238
|
default: undefined,
|
|
239
239
|
},
|
|
240
240
|
},
|
|
241
|
+
emits: ['update:items'],
|
|
241
242
|
setup(props, { attrs, emit, slots }) {
|
|
242
243
|
const vm = getCurrentInstance().proxy;
|
|
243
244
|
const hovering = ref(null);
|
|
@@ -396,8 +397,8 @@
|
|
|
396
397
|
|
|
397
398
|
const showFooter = computed(
|
|
398
399
|
() =>
|
|
399
|
-
props.items.length >
|
|
400
|
-
props.serverItemsLength >
|
|
400
|
+
props.items.length > Math.min(...props.itemsPerPageArray) ||
|
|
401
|
+
props.serverItemsLength > Math.min(...props.itemsPerPageArray),
|
|
401
402
|
);
|
|
402
403
|
|
|
403
404
|
const forwardSlots = getForwardSlots(slots, [
|
|
@@ -64,7 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
64
|
translatedHeaders: ComputedRef<Object[]>;
|
|
65
65
|
showFooter: import("vue").ComputedRef<boolean>;
|
|
66
66
|
forwardSlots: string[];
|
|
67
|
-
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
67
|
+
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:items"[], "update:items", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
68
|
baseComponent: {
|
|
69
69
|
type: StringConstructor;
|
|
70
70
|
default: string;
|
|
@@ -110,7 +110,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
type: FunctionConstructor;
|
|
111
111
|
default: undefined;
|
|
112
112
|
};
|
|
113
|
-
}
|
|
113
|
+
}>> & {
|
|
114
|
+
"onUpdate:items"?: ((...args: any[]) => any) | undefined;
|
|
115
|
+
}, {
|
|
114
116
|
items: unknown[];
|
|
115
117
|
customFilter: Function;
|
|
116
118
|
showSearchbar: boolean;
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
* @vue-prop {boolean} [showStyle=true] - Whether the style component should be shown.
|
|
144
144
|
*/
|
|
145
145
|
export default {
|
|
146
|
+
name: 'VcsFeatureEditingWindow',
|
|
146
147
|
components: {
|
|
147
148
|
VcsSnapTo,
|
|
148
149
|
VcsFeatureTransforms,
|
|
@@ -151,7 +152,6 @@
|
|
|
151
152
|
VcsVectorPropertiesComponent,
|
|
152
153
|
VcsFeatureStyleComponent,
|
|
153
154
|
},
|
|
154
|
-
name: 'VcsFeatureEditingWindow',
|
|
155
155
|
props: {
|
|
156
156
|
allowedVectorProperties: {
|
|
157
157
|
type: Array,
|
|
@@ -137,6 +137,7 @@
|
|
|
137
137
|
* @vue-prop {boolean} [allowZInput=false]
|
|
138
138
|
*/
|
|
139
139
|
export default {
|
|
140
|
+
name: 'VcsFeatureTransforms',
|
|
140
141
|
components: {
|
|
141
142
|
VcsButton,
|
|
142
143
|
VSheet,
|
|
@@ -160,7 +161,6 @@
|
|
|
160
161
|
default: false,
|
|
161
162
|
},
|
|
162
163
|
},
|
|
163
|
-
name: 'VcsFeatureTransforms',
|
|
164
164
|
setup(props) {
|
|
165
165
|
/** @type {import("./VcsFeatureEditingWindow.vue").EditorManager} */
|
|
166
166
|
const manager = inject('manager');
|
|
@@ -546,7 +546,6 @@
|
|
|
546
546
|
*/
|
|
547
547
|
export default {
|
|
548
548
|
name: 'VcsVectorPropertiesComponent',
|
|
549
|
-
methods: { computed },
|
|
550
549
|
components: {
|
|
551
550
|
VcsFormSection,
|
|
552
551
|
VcsLabel,
|
|
@@ -770,5 +769,6 @@
|
|
|
770
769
|
cid,
|
|
771
770
|
};
|
|
772
771
|
},
|
|
772
|
+
methods: { computed },
|
|
773
773
|
};
|
|
774
774
|
</script>
|
|
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
apply(): void;
|
|
17
17
|
cancel(): Promise<void>;
|
|
18
18
|
reset: () => Promise<void>;
|
|
19
|
-
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
19
|
+
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
20
|
getConfig: {
|
|
21
21
|
type: FunctionConstructor;
|
|
22
22
|
required: true;
|
|
@@ -29,7 +29,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
29
|
type: ArrayConstructor;
|
|
30
30
|
default: () => never[];
|
|
31
31
|
};
|
|
32
|
-
}
|
|
32
|
+
}>> & {
|
|
33
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}, {
|
|
33
35
|
nameRules: unknown[];
|
|
34
36
|
}, {}>;
|
|
35
37
|
export default _default;
|