@vcmap/ui 5.0.0-rc.16 → 5.0.0-rc.18
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/buildHelpers.js +7 -1
- package/config/base.config.json +3 -45
- package/config/www.config.json +756 -132
- package/dist/assets/{cesium.430460.js → cesium.2f992f.js} +0 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.5089ba.js → core.cb0408.js} +1700 -1718
- package/dist/assets/core.js +1 -1
- package/dist/assets/{index.854f8e2b.js → index.bccdf969.js} +1 -1
- package/dist/assets/{ol.9be53a.js → ol.5e3fd0.js} +0 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.08c48f.css +1 -0
- package/dist/assets/{ui.49010a.js → ui.08c48f.js} +6254 -5906
- package/dist/assets/ui.js +1 -1
- package/dist/assets/{vue.247c1c.js → vue.228ead.js} +0 -0
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.735e58.css → vuetify.0b5039.css} +0 -0
- package/dist/assets/{vuetify.735e58.js → vuetify.0b5039.js} +5 -2
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +14 -3
- package/package.json +2 -2
- package/plugins/@vcmap/pluginExample/index.js +2 -1
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +7 -0
- package/plugins/buttonExamples/ButtonExamples.vue +18 -0
- package/plugins/categoryTest/Categories.vue +27 -13
- package/plugins/categoryTest/Category.vue +7 -1
- package/plugins/categoryTest/index.js +1 -1
- package/plugins/package.json +1 -1
- package/plugins/test/allIconsComponent.vue +3 -3
- package/plugins/test/index.js +9 -5
- package/plugins/test/testList.vue +4 -1
- package/plugins/test/toolbox-data.js +168 -111
- package/plugins/test/vcsContent.vue +1 -1
- package/plugins/test/windowManagerExample.vue +9 -7
- package/src/actions/actionHelper.js +13 -10
- package/src/application/VcsApp.vue +25 -26
- package/src/application/VcsNavbar.vue +1 -1
- package/src/components/buttons/VcsButton.vue +14 -3
- package/src/components/form-inputs-controls/VcsCheckbox.vue +1 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +14 -6
- package/src/components/lists/VcsActionList.vue +2 -0
- package/src/components/lists/VcsList.vue +4 -2
- package/src/contentTree/contentTreeCollection.js +9 -0
- package/src/contentTree/layerContentTreeItem.js +3 -3
- package/src/featureInfo/BalloonComponent.vue +5 -2
- package/src/featureInfo/balloonFeatureInfoView.js +2 -8
- package/src/featureInfo/balloonHelper.js +22 -5
- package/src/featureInfo/featureInfo.js +1 -2
- package/src/i18n/de.js +12 -3
- package/src/i18n/en.js +10 -1
- package/src/legend/legendHelper.js +6 -7
- package/src/legend/vcsLegend.vue +12 -3
- package/src/manager/categoryManager/CategoryComponent.vue +115 -0
- package/src/manager/categoryManager/CategoryComponentList.vue +57 -0
- package/src/manager/categoryManager/CategoryManager.vue +35 -0
- package/src/manager/categoryManager/categoryManager.js +251 -165
- package/src/manager/contextMenu/contextMenuManager.js +8 -2
- package/src/manager/toolbox/ToolboxManager.vue +1 -0
- package/src/manager/window/WindowComponent.vue +49 -75
- package/src/manager/window/WindowComponentHeader.vue +49 -7
- package/src/manager/window/WindowManager.vue +53 -30
- package/src/manager/window/windowHelper.js +341 -0
- package/src/manager/window/windowManager.js +162 -150
- package/src/notifier/notifier.js +4 -5
- package/src/vcsUiApp.js +7 -1
- package/dist/assets/ui.49010a.css +0 -1
- package/src/manager/categoryManager/ComponentsManager.vue +0 -30
@@ -1,4 +1,7 @@
|
|
1
1
|
import { ToolboxType } from '@vcmap/ui';
|
2
|
+
import { reactive, shallowRef } from 'vue';
|
3
|
+
import { VcsEvent } from '@vcmap/core';
|
4
|
+
import VcsContent from './vcsContent.vue';
|
2
5
|
|
3
6
|
const dummySelectAction = {
|
4
7
|
active: false,
|
@@ -32,123 +35,177 @@ const dummySelectAction = {
|
|
32
35
|
},
|
33
36
|
};
|
34
37
|
|
38
|
+
function createDummyTriStateAction(app) {
|
39
|
+
const windowComponent = {
|
40
|
+
id: 'tri-state-example',
|
41
|
+
state: {
|
42
|
+
headerTitle: 'Example Session Toggle',
|
43
|
+
},
|
44
|
+
component: VcsContent,
|
45
|
+
};
|
46
|
+
|
47
|
+
const action = reactive({
|
48
|
+
name: 'tri-state-action',
|
49
|
+
icon: 'mdi-triangle',
|
50
|
+
active: false,
|
51
|
+
background: false,
|
52
|
+
callback() {
|
53
|
+
if (this.active) {
|
54
|
+
if (this.background) {
|
55
|
+
return app.windowManager.add(windowComponent, '@vcmap/test');
|
56
|
+
} else {
|
57
|
+
app.windowManager.remove(windowComponent.id);
|
58
|
+
this.active = false;
|
59
|
+
}
|
60
|
+
} else {
|
61
|
+
this.active = true;
|
62
|
+
return app.windowManager.add(windowComponent, '@vcmap/test');
|
63
|
+
}
|
64
|
+
return null;
|
65
|
+
},
|
66
|
+
});
|
67
|
+
|
68
|
+
const listeners = [
|
69
|
+
app.windowManager.added.addEventListener(({ id }) => {
|
70
|
+
if (id === windowComponent.id) {
|
71
|
+
action.active = true;
|
72
|
+
action.background = false;
|
73
|
+
}
|
74
|
+
}),
|
75
|
+
app.windowManager.removed.addEventListener(({ id }) => {
|
76
|
+
if (id === windowComponent.id) {
|
77
|
+
action.background = true;
|
78
|
+
}
|
79
|
+
}),
|
80
|
+
];
|
81
|
+
|
82
|
+
const destroy = () => {
|
83
|
+
if (app.windowManager.has(windowComponent.id)) {
|
84
|
+
app.windowManager.remove(windowComponent.id);
|
85
|
+
}
|
86
|
+
listeners.forEach(cb => cb());
|
87
|
+
};
|
88
|
+
|
89
|
+
return { action, destroy };
|
90
|
+
}
|
91
|
+
|
35
92
|
// eslint-disable-next-line import/prefer-default-export
|
36
|
-
export
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
93
|
+
export function getToolboxData(app) {
|
94
|
+
const { action: triStateAction, destroy } = createDummyTriStateAction(app);
|
95
|
+
|
96
|
+
const toolboxData = [
|
97
|
+
[
|
98
|
+
{
|
99
|
+
id: 'singleSelect',
|
100
|
+
type: ToolboxType.SINGLE,
|
101
|
+
action: {
|
102
|
+
name: 'select',
|
103
|
+
title: 'single select',
|
104
|
+
icon: '$vcsPointSelect',
|
105
|
+
active: false,
|
106
|
+
callback() { this.active = !this.active; },
|
107
|
+
},
|
47
108
|
},
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
109
|
+
'@vcmap/test',
|
110
|
+
],
|
111
|
+
[
|
112
|
+
{
|
113
|
+
id: 'multiSelect',
|
114
|
+
type: ToolboxType.SELECT,
|
115
|
+
action: {
|
116
|
+
name: 'multiSelect',
|
117
|
+
title: 'multi select',
|
118
|
+
...dummySelectAction,
|
119
|
+
tools: [
|
120
|
+
{
|
121
|
+
name: 'pen',
|
122
|
+
title: 'Item 1',
|
123
|
+
icon: '$vcsPen',
|
124
|
+
},
|
125
|
+
{
|
126
|
+
name: 'object',
|
127
|
+
title: 'Item 2',
|
128
|
+
icon: '$vcsObjectSelect',
|
129
|
+
},
|
130
|
+
],
|
131
|
+
},
|
71
132
|
},
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
133
|
+
'@vcmap/test',
|
134
|
+
],
|
135
|
+
[
|
136
|
+
{
|
137
|
+
id: 'measurement',
|
138
|
+
type: ToolboxType.SELECT,
|
139
|
+
action: {
|
140
|
+
name: 'measurement',
|
141
|
+
title: 'measurement',
|
142
|
+
...dummySelectAction,
|
143
|
+
tools: [
|
144
|
+
{
|
145
|
+
name: 'distance',
|
146
|
+
title: '2D distance',
|
147
|
+
icon: '$vcs2dDistance',
|
148
|
+
},
|
149
|
+
{
|
150
|
+
name: 'area',
|
151
|
+
title: '2D area',
|
152
|
+
icon: '$vcs2dArea',
|
153
|
+
},
|
154
|
+
{
|
155
|
+
name: 'distance3D',
|
156
|
+
title: '3D distance',
|
157
|
+
icon: '$vcs3dDistance',
|
158
|
+
},
|
159
|
+
{
|
160
|
+
name: 'area3D',
|
161
|
+
title: '3D area',
|
162
|
+
icon: '$vcs3dArea',
|
163
|
+
},
|
164
|
+
],
|
165
|
+
},
|
166
|
+
},
|
167
|
+
'@vcmap/test',
|
168
|
+
],
|
169
|
+
[
|
170
|
+
{
|
171
|
+
id: 'toggle',
|
172
|
+
type: ToolboxType.SINGLE,
|
173
|
+
action: triStateAction,
|
174
|
+
},
|
175
|
+
'@vcmap/test',
|
176
|
+
],
|
177
|
+
[
|
178
|
+
{
|
179
|
+
id: 'flight',
|
180
|
+
type: ToolboxType.GROUP,
|
181
|
+
icon: '$vcsVideoRecorder',
|
182
|
+
title: 'flight',
|
183
|
+
buttonComponents: [
|
94
184
|
{
|
95
|
-
|
96
|
-
|
97
|
-
|
185
|
+
id: 'flight',
|
186
|
+
action: {
|
187
|
+
name: 'flight',
|
188
|
+
title: 'add flight',
|
189
|
+
icon: 'mdi-camera-plus',
|
190
|
+
active: false,
|
191
|
+
callback() { this.active = !this.active; },
|
192
|
+
},
|
98
193
|
},
|
99
194
|
{
|
100
|
-
|
101
|
-
|
102
|
-
|
195
|
+
id: 'export',
|
196
|
+
action: {
|
197
|
+
name: 'export',
|
198
|
+
title: 'export flight',
|
199
|
+
icon: '$vcsExportFlight',
|
200
|
+
active: false,
|
201
|
+
callback() { this.active = !this.active; },
|
202
|
+
},
|
103
203
|
},
|
104
204
|
],
|
105
205
|
},
|
106
|
-
|
107
|
-
|
108
|
-
]
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
type: ToolboxType.SINGLE,
|
113
|
-
action: {
|
114
|
-
name: 'split',
|
115
|
-
title: 'split view',
|
116
|
-
icon: '$vcsSplitView',
|
117
|
-
active: false,
|
118
|
-
callback() { this.active = !this.active; },
|
119
|
-
},
|
120
|
-
},
|
121
|
-
'@vcmap/test',
|
122
|
-
],
|
123
|
-
[
|
124
|
-
{
|
125
|
-
id: 'flight',
|
126
|
-
type: ToolboxType.GROUP,
|
127
|
-
icon: '$vcsVideoRecorder',
|
128
|
-
title: 'flight',
|
129
|
-
buttonComponents: [
|
130
|
-
{
|
131
|
-
id: 'flight',
|
132
|
-
action: {
|
133
|
-
name: 'flight',
|
134
|
-
title: 'add flight',
|
135
|
-
icon: 'mdi-camera-plus',
|
136
|
-
active: false,
|
137
|
-
callback() { this.active = !this.active; },
|
138
|
-
},
|
139
|
-
},
|
140
|
-
{
|
141
|
-
id: 'export',
|
142
|
-
action: {
|
143
|
-
name: 'export',
|
144
|
-
title: 'export flight',
|
145
|
-
icon: '$vcsExportFlight',
|
146
|
-
active: false,
|
147
|
-
callback() { this.active = !this.active; },
|
148
|
-
},
|
149
|
-
},
|
150
|
-
],
|
151
|
-
},
|
152
|
-
'@vcmap/test',
|
153
|
-
],
|
154
|
-
];
|
206
|
+
'@vcmap/test',
|
207
|
+
],
|
208
|
+
];
|
209
|
+
|
210
|
+
return { toolboxData, destroy };
|
211
|
+
}
|
@@ -88,7 +88,7 @@
|
|
88
88
|
{
|
89
89
|
id: 'position1',
|
90
90
|
state: {
|
91
|
-
headerTitle: 'Example position1',
|
91
|
+
headerTitle: 'Example position1 relative',
|
92
92
|
},
|
93
93
|
component: VcsContent,
|
94
94
|
position: {
|
@@ -101,15 +101,17 @@
|
|
101
101
|
{
|
102
102
|
id: 'position2',
|
103
103
|
state: {
|
104
|
-
hideHeader:
|
105
|
-
headerTitle: 'Example position2',
|
104
|
+
hideHeader: false,
|
105
|
+
headerTitle: 'Example position2 absolute',
|
106
106
|
},
|
107
107
|
component: EmptyComponent,
|
108
108
|
position: {
|
109
|
-
left: '
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
left: '200px',
|
110
|
+
top: '300px',
|
111
|
+
minHeight: '250px',
|
112
|
+
maxHeight: '500px',
|
113
|
+
minWidth: '400px',
|
114
|
+
maxWidth: '1000px',
|
113
115
|
},
|
114
116
|
},
|
115
117
|
];
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { v4 as uuid } from 'uuid';
|
2
2
|
import { check } from '@vcsuite/check';
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Collection, Extent, MapCollection, mercatorProjection, Viewpoint,
|
5
|
+
} from '@vcmap/core';
|
4
6
|
import { Feature } from 'ol';
|
5
7
|
import { reactive, ref } from 'vue';
|
6
8
|
import { vcsAppSymbol } from '../pluginHelper.js';
|
7
|
-
import {
|
9
|
+
import { WindowSlot } from '../manager/window/windowManager.js';
|
10
|
+
import { getWindowPositionOptions } from '../manager/window/windowHelper.js';
|
8
11
|
import SearchComponent from '../search/searchComponent.vue';
|
9
12
|
|
10
13
|
/**
|
@@ -189,11 +192,11 @@ export function createOverviewMapAction(overviewMap, windowComponent, windowMana
|
|
189
192
|
* at the clicked position (the actions position) by default, unless the window component already has a position set.
|
190
193
|
* @param {ActionOptions} actionOptions
|
191
194
|
* @param {WindowComponentOptions} modalComponent
|
192
|
-
* @param {
|
195
|
+
* @param {VcsUiApp} app
|
193
196
|
* @param {string|symbol} owner
|
194
197
|
* @returns {{action: VcsAction, destroy: Function}}
|
195
198
|
*/
|
196
|
-
export function createModalAction(actionOptions, modalComponent,
|
199
|
+
export function createModalAction(actionOptions, modalComponent, app, owner) {
|
197
200
|
check(actionOptions, {
|
198
201
|
name: String,
|
199
202
|
icon: [undefined, String],
|
@@ -216,7 +219,7 @@ export function createModalAction(actionOptions, modalComponent, windowManager,
|
|
216
219
|
left: 0,
|
217
220
|
right: 0,
|
218
221
|
});
|
219
|
-
elem.onclick = () => { windowManager.remove(id); };
|
222
|
+
elem.onclick = () => { app.windowManager.remove(id); };
|
220
223
|
document.body.appendChild(elem);
|
221
224
|
}
|
222
225
|
};
|
@@ -235,20 +238,20 @@ export function createModalAction(actionOptions, modalComponent, windowManager,
|
|
235
238
|
if (!this.active) {
|
236
239
|
this.active = true;
|
237
240
|
const { left, top, width } = event.currentTarget.getBoundingClientRect();
|
238
|
-
const position = getWindowPositionOptions(left + width, top);
|
241
|
+
const position = getWindowPositionOptions(left + width, top, app.maps.target);
|
239
242
|
const state = { ...modalComponent?.state, hideHeader: true };
|
240
|
-
windowManager.add({ position, ...modalComponent, id, state }, owner);
|
241
|
-
addModal(windowManager.componentIds.length - 2);
|
243
|
+
app.windowManager.add({ position, ...modalComponent, id, state }, owner);
|
244
|
+
addModal(app.windowManager.componentIds.length - 2);
|
242
245
|
} else {
|
243
246
|
this.active = false;
|
244
|
-
windowManager.remove(id);
|
247
|
+
app.windowManager.remove(id);
|
245
248
|
}
|
246
249
|
return null;
|
247
250
|
},
|
248
251
|
};
|
249
252
|
|
250
253
|
const listeners = [
|
251
|
-
windowManager.removed.addEventListener(({ id: windowId }) => {
|
254
|
+
app.windowManager.removed.addEventListener(({ id: windowId }) => {
|
252
255
|
if (windowId === id) {
|
253
256
|
action.active = false;
|
254
257
|
removeModal();
|
@@ -85,7 +85,7 @@
|
|
85
85
|
import MapNavigation from '../navigation/mapNavigation.vue';
|
86
86
|
import VcsSettings from './VcsSettings.vue';
|
87
87
|
import { WindowSlot } from '../manager/window/windowManager.js';
|
88
|
-
import
|
88
|
+
import CategoryManager from '../manager/categoryManager/CategoryManager.vue';
|
89
89
|
import { defaultPrimaryColor } from '../vuePlugins/vuetify.js';
|
90
90
|
import VcsLegend from '../legend/vcsLegend.vue';
|
91
91
|
import { getLegendEntries } from '../legend/legendHelper.js';
|
@@ -276,56 +276,54 @@
|
|
276
276
|
}
|
277
277
|
|
278
278
|
/**
|
279
|
-
* This helper function will add a
|
279
|
+
* This helper function will add a category manager button to the navbar. The category Manager
|
280
280
|
* will only be shown if there is at least one category under management in the categoryManager.
|
281
281
|
* @param {VcsUiApp} app
|
282
282
|
* @returns {function():void}
|
283
283
|
*/
|
284
|
-
export function
|
285
|
-
const
|
284
|
+
export function setupCategoryManagerWindow(app) {
|
285
|
+
const id = 'category-manager';
|
286
|
+
const { action: categoryManagerAction, destroy } = createToggleAction(
|
286
287
|
{
|
287
|
-
name:
|
288
|
+
name: id,
|
288
289
|
icon: '$vcsComponents',
|
289
|
-
title: '
|
290
|
+
title: 'categoryManager.tooltip',
|
290
291
|
},
|
291
292
|
{
|
292
|
-
id
|
293
|
+
id,
|
293
294
|
state: {
|
294
|
-
headerTitle: '
|
295
|
+
headerTitle: 'categoryManager.title',
|
295
296
|
headerIcon: '$vcsComponents',
|
296
297
|
},
|
297
|
-
component:
|
298
|
+
component: CategoryManager,
|
298
299
|
slot: WindowSlot.STATIC,
|
299
300
|
},
|
300
301
|
app.windowManager,
|
301
302
|
vcsAppSymbol,
|
302
303
|
);
|
303
304
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
{ id: 'component-manager', action: componentsManagerAction },
|
308
|
-
vcsAppSymbol,
|
309
|
-
ButtonLocation.CONTENT,
|
310
|
-
);
|
311
|
-
}
|
312
|
-
watch(app.categoryManager.items.value, () => {
|
313
|
-
if (app.categoryManager.items.value.length > 0) {
|
314
|
-
if (!app.navbarManager.has('component-manager')) {
|
305
|
+
const setupCategories = () => {
|
306
|
+
if (app.categoryManager.componentIds.length > 0) {
|
307
|
+
if (!app.navbarManager.has(id)) {
|
315
308
|
app.navbarManager.add(
|
316
|
-
{ id
|
309
|
+
{ id, action: categoryManagerAction },
|
317
310
|
vcsAppSymbol,
|
318
311
|
ButtonLocation.CONTENT,
|
319
312
|
);
|
320
313
|
}
|
321
314
|
} else {
|
322
|
-
app.windowManager.remove(
|
323
|
-
app.navbarManager.remove(
|
315
|
+
app.windowManager.remove(id);
|
316
|
+
app.navbarManager.remove(id);
|
324
317
|
}
|
325
|
-
}
|
318
|
+
};
|
319
|
+
const addedListener = app.categoryManager.added.addEventListener(setupCategories);
|
320
|
+
const removedListener = app.categoryManager.removed.addEventListener(setupCategories);
|
321
|
+
setupCategories();
|
326
322
|
|
327
323
|
return () => {
|
328
|
-
|
324
|
+
destroy();
|
325
|
+
addedListener();
|
326
|
+
removedListener();
|
329
327
|
};
|
330
328
|
}
|
331
329
|
|
@@ -432,7 +430,7 @@
|
|
432
430
|
const mapNavbarListener = setupMapNavbar(app);
|
433
431
|
const legendDestroy = setupLegendWindow(app);
|
434
432
|
const settingsDestroy = setupSettingsWindow(app);
|
435
|
-
const destroyComponentsWindow =
|
433
|
+
const destroyComponentsWindow = setupCategoryManagerWindow(app);
|
436
434
|
const destroyThemingListener = setupUiConfigTheming(app, getCurrentInstance().proxy.$vuetify);
|
437
435
|
const { attributionEntries, attributionAction, destroyAttributions } = setupAttributions(app);
|
438
436
|
|
@@ -440,6 +438,7 @@
|
|
440
438
|
onMounted(() => {
|
441
439
|
pluginMountedListener = setupPluginMountedListeners(app);
|
442
440
|
app.maps.setTarget(mapId);
|
441
|
+
app.mounted.raiseEvent(mapId);
|
443
442
|
});
|
444
443
|
|
445
444
|
onUnmounted(() => {
|
@@ -85,8 +85,14 @@
|
|
85
85
|
padding: 0;
|
86
86
|
position: relative;
|
87
87
|
|
88
|
-
&.vcs-button--active-
|
88
|
+
&.vcs-button--active-background {
|
89
89
|
border: 2px solid var(--v-primary-base);
|
90
|
+
color: var(--v-secondary-base);
|
91
|
+
background-color: var(--v-accent-darken1) !important;
|
92
|
+
}
|
93
|
+
|
94
|
+
&.v-btn--disabled {
|
95
|
+
background-color: transparent !important;
|
90
96
|
}
|
91
97
|
}
|
92
98
|
}
|
@@ -102,6 +108,7 @@
|
|
102
108
|
* @description a button with tooltip extending {@link https://vuetifyjs.com/en/api/v-btn/|vuetify v-btn} using {@link VcsTooltip}.
|
103
109
|
* @vue-prop {boolean} active - Whether button has background color. Applies vuetify primary color if color property is not set.
|
104
110
|
* @vue-prop {string} color - Passes property to v-btn in case prop active is true.
|
111
|
+
* @vue-prop {boolean} background - When applied with active the button shows an active-background state implying that a tool is active, but running in background, e.g. windowComponent closed.
|
105
112
|
* @vue-prop {boolean} hasUpdate - Whether the button shows a badge in the top right.
|
106
113
|
* @vue-prop {string} icon - When given, will display an icon in the button. Replaces vuetify icon property.
|
107
114
|
* @vue-prop {string} tooltip - Text content of a tooltip which appears on hover with default delay.
|
@@ -135,6 +142,10 @@
|
|
135
142
|
type: String,
|
136
143
|
default: undefined,
|
137
144
|
},
|
145
|
+
background: {
|
146
|
+
type: Boolean,
|
147
|
+
default: false,
|
148
|
+
},
|
138
149
|
hasUpdate: {
|
139
150
|
type: Boolean,
|
140
151
|
default: false,
|
@@ -175,7 +186,7 @@
|
|
175
186
|
'font-weight-bold': this.isStandard,
|
176
187
|
'text-capitalize': this.isStandard,
|
177
188
|
'vcs-button--large': this.isLarge,
|
178
|
-
'vcs-button--active-
|
189
|
+
'vcs-button--active-background': this.active && this.background && !this.$attrs.disabled,
|
179
190
|
};
|
180
191
|
},
|
181
192
|
hasDefaultSlot() {
|
@@ -192,7 +203,7 @@
|
|
192
203
|
},
|
193
204
|
isOutlined() {
|
194
205
|
if (this.isStandard) {
|
195
|
-
return this.active || this
|
206
|
+
return this.active || this.background;
|
196
207
|
}
|
197
208
|
return false;
|
198
209
|
},
|
@@ -1,11 +1,12 @@
|
|
1
1
|
<template>
|
2
2
|
<section class="vcs-form-section">
|
3
|
-
<slot name="header">
|
3
|
+
<slot name="header" :heading="heading" :actions="actions">
|
4
4
|
<article class="pa-2 accent">
|
5
5
|
<div class="form-section-header d-flex justify-space-between align-center">
|
6
6
|
<strong class="caption">{{ $t(heading) }}</strong>
|
7
7
|
<VcsActionButtonList
|
8
8
|
:actions="actions"
|
9
|
+
:overflow-count="actionButtonListOverflowCount"
|
9
10
|
small
|
10
11
|
/>
|
11
12
|
</div>
|
@@ -30,7 +31,7 @@
|
|
30
31
|
|
31
32
|
|
32
33
|
<script>
|
33
|
-
import { computed,
|
34
|
+
import { computed, reactive } from 'vue';
|
34
35
|
import { VAlert } from 'vuetify/lib';
|
35
36
|
import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
|
36
37
|
|
@@ -42,6 +43,7 @@
|
|
42
43
|
* @vue-data {slot} [#help] - Slot to specify html based help. Gets precedence over helpText prop.
|
43
44
|
* @vue-prop {string} heading - Title of the section to be displayed, will be translated.
|
44
45
|
* @vue-prop {Array<VcsAction>} headerActions - Icons to be displayed on the right side
|
46
|
+
* @vue-prop {number} [actionButtonListOverflowCount] - overflow count to use for action lists in the title and items
|
45
47
|
* @vue-prop {string} [helpText] - Optional help text. Must be plain string. Use 'help' slot for html based help texts. Help slot has precedence over helpText prop.
|
46
48
|
* @vue-computed {Array<VcsAction>} actions - Returns header actions extended by a help action, if help prop is passed or help slot is used.
|
47
49
|
*/
|
@@ -60,19 +62,25 @@
|
|
60
62
|
type: Array,
|
61
63
|
default: () => ([]),
|
62
64
|
},
|
65
|
+
actionButtonListOverflowCount: {
|
66
|
+
type: Number,
|
67
|
+
required: false,
|
68
|
+
default: undefined,
|
69
|
+
},
|
63
70
|
helpText: {
|
64
71
|
type: String,
|
65
72
|
default: undefined,
|
66
73
|
},
|
67
74
|
},
|
68
75
|
setup(props, { slots }) {
|
69
|
-
const
|
70
|
-
const helpAction = {
|
76
|
+
const helpAction = reactive({
|
71
77
|
name: 'help',
|
72
78
|
title: 'components.vcsFormSection.help',
|
79
|
+
active: false,
|
73
80
|
icon: 'mdi-help-circle',
|
74
|
-
callback
|
75
|
-
};
|
81
|
+
callback() { this.active = !this.active; },
|
82
|
+
});
|
83
|
+
const showHelp = computed(() => helpAction.active);
|
76
84
|
/**
|
77
85
|
* @type {ComputedRef<VcsAction>}
|
78
86
|
*/
|
@@ -52,6 +52,7 @@
|
|
52
52
|
* @property {string} [icon] - icon rendered on the button. If no icon provided, item is rendered in overflow
|
53
53
|
* @property {Function} callback - callback function is triggered when the button is clicked
|
54
54
|
* @property {boolean} [active=false] - optional state of button. If active, button is rendered in primary color
|
55
|
+
* @property {boolean} [background=false] - optional background state. If active and background, button is rendered in primary color outlined
|
55
56
|
*/
|
56
57
|
|
57
58
|
/**
|
@@ -64,6 +65,7 @@
|
|
64
65
|
icon: [undefined, String],
|
65
66
|
callback: Function,
|
66
67
|
active: [undefined, Boolean],
|
68
|
+
background: [undefined, Boolean],
|
67
69
|
};
|
68
70
|
|
69
71
|
/**
|