@vcmap/ui 5.0.0-rc.26 → 5.0.0-rc.27
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/buildCesium.js +7 -0
- package/config/dev.config.json +4 -0
- package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/dist/assets/cesium/ThirdParty/Workers/draco_decoder_nodejs.js +117 -0
- package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/dist/assets/{cesium.305b7c.js → cesium.82fdbe.js} +4 -4
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.f3d6d4.js → core.df069a.js} +2 -2
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-1cff371d.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
- package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
- package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
- package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
- package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
- package/dist/assets/style/icon-marker-o.036477.png +0 -0
- package/dist/assets/style/icon-marker-red.313d03.png +0 -0
- package/dist/assets/style/icon-marker.70960f.png +0 -0
- package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
- package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
- package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
- package/dist/assets/style/icon-pin.b7ce77.png +0 -0
- package/dist/assets/{ui.74022f.css → ui.3ed7ff.css} +2 -2
- package/dist/assets/ui.3ed7ff.js +14763 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.30486f.js → vuetify.614278.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +17 -1
- package/package.json +1 -1
- package/plugins/@vcmap/create-link/index.js +8 -8
- package/plugins/@vcmap-show-case/collection-manager-example/index.js +6 -1
- package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +36 -8
- package/plugins/@vcmap-show-case/form-inputs-example/exampleActions.js +0 -19
- package/plugins/@vcmap-show-case/form-inputs-example/index.js +1 -2
- package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
- package/plugins/@vcmap-show-case/style-input-example/index.js +42 -0
- package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
- package/plugins/@vcmap-show-case/style-input-example/styleExample.vue +191 -0
- package/plugins/@vcmap-show-case/window-tester/WindowExample.vue +12 -13
- package/plugins/@vcmap-show-case/window-tester/windowExampleToggleChild.vue +44 -0
- package/public/assets/style/icon-marker-blue.png +0 -0
- package/public/assets/style/icon-marker-green.png +0 -0
- package/public/assets/style/icon-marker-o-blue.png +0 -0
- package/public/assets/style/icon-marker-o-green.png +0 -0
- package/public/assets/style/icon-marker-o-red.png +0 -0
- package/public/assets/style/icon-marker-o.png +0 -0
- package/public/assets/style/icon-marker-red.png +0 -0
- package/public/assets/style/icon-marker.png +0 -0
- package/public/assets/style/icon-pin-blue.png +0 -0
- package/public/assets/style/icon-pin-green.png +0 -0
- package/public/assets/style/icon-pin-red.png +0 -0
- package/public/assets/style/icon-pin.png +0 -0
- package/src/actions/actionHelper.js +1 -0
- package/src/application/VcsApp.vue +7 -1
- package/src/components/buttons/VcsActionButtonList.vue +1 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +3 -2
- package/src/components/form-inputs-controls/VcsFormSection.vue +59 -9
- package/src/components/form-inputs-controls/VcsLabel.vue +10 -0
- package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +3 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +12 -0
- package/src/components/icons/+all.js +4 -0
- package/src/components/icons/EditVerticesIcon.vue +39 -0
- package/src/components/lists/VcsActionList.vue +2 -0
- package/src/components/style/MenuWrapper.vue +138 -0
- package/src/components/style/VcsFillMenu.vue +61 -0
- package/src/components/style/VcsFillSelector.vue +45 -0
- package/src/components/style/VcsImageMenu.vue +84 -0
- package/src/components/style/VcsImageSelector.vue +609 -0
- package/src/components/style/VcsStrokeMenu.vue +73 -0
- package/src/components/style/VcsStrokeSelector.vue +87 -0
- package/src/components/style/VcsTextMenu.vue +81 -0
- package/src/components/style/VcsTextSelector.vue +271 -0
- package/src/components/style/VcsVectorStyleComponent.vue +119 -0
- package/src/components/style/composables.js +84 -0
- package/src/contentTree/contentTreeCollection.js +1 -0
- package/src/i18n/de.js +51 -17
- package/src/i18n/en.js +56 -22
- package/src/legend/vcsLegend.vue +7 -5
- package/src/manager/collectionManager/CollectionComponent.vue +9 -17
- package/src/manager/collectionManager/CollectionComponentList.vue +22 -9
- package/src/manager/collectionManager/CollectionManager.vue +20 -1
- package/src/manager/collectionManager/collectionComponent.js +11 -0
- package/src/manager/window/WindowComponent.vue +2 -1
- package/src/manager/window/WindowManager.vue +23 -9
- package/src/manager/window/windowHelper.js +76 -4
- package/src/manager/window/windowManager.js +38 -6
- package/src/vcsUiApp.js +1 -0
- package/dist/assets/index-f94d5be3.js +0 -1
- package/dist/assets/ui.74022f.js +0 -13466
- /package/dist/assets/{ol.39cc05.js → ol.90a5d0.js} +0 -0
- /package/dist/assets/{vue.9b8c6e.js → vue.537ff3.js} +0 -0
- /package/dist/assets/{vuetify.30486f.css → vuetify.614278.css} +0 -0
package/dist/assets/ui.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from "./ui.
|
1
|
+
export * from "./ui.3ed7ff.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.614278.css');import v from "./vue.537ff3.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
@@ -29,7 +29,7 @@
|
|
29
29
|
/>
|
30
30
|
<link rel="icon" type="image/svg+xml" href="./assets/favicon.d5ec97.svg" />
|
31
31
|
|
32
|
-
<script type="module" crossorigin src="./assets/index-
|
32
|
+
<script type="module" crossorigin src="./assets/index-1cff371d.js"></script>
|
33
33
|
</head>
|
34
34
|
<body style="height: 100vh">
|
35
35
|
<noscript>
|
package/index.js
CHANGED
@@ -68,6 +68,7 @@ export {
|
|
68
68
|
WindowAlignment,
|
69
69
|
getFittedWindowPositionOptions,
|
70
70
|
getFittedWindowPositionOptionsFromMapEvent,
|
71
|
+
getTargetSize,
|
71
72
|
getWindowPositionOptions,
|
72
73
|
getWindowPositionOptionsFromMapEvent,
|
73
74
|
posToNumber,
|
@@ -76,7 +77,8 @@ export {
|
|
76
77
|
updateWindowPosition,
|
77
78
|
clipToTargetSize,
|
78
79
|
moveWindow,
|
79
|
-
|
80
|
+
applyParentPosition,
|
81
|
+
getPositionAppliedOnTarget,
|
80
82
|
} from './src/manager/window/windowHelper.js';
|
81
83
|
|
82
84
|
export { default as ButtonManager } from './src/manager/buttonManager.js';
|
@@ -192,6 +194,7 @@ export { default as VcsDataTable } from './src/components/tables/VcsDataTable.vu
|
|
192
194
|
export { default as VcsLabel } from './src/components/form-inputs-controls/VcsLabel.vue';
|
193
195
|
export { default as VcsCheckbox } from './src/components/form-inputs-controls/VcsCheckbox.vue';
|
194
196
|
export { default as VcsRadio } from './src/components/form-inputs-controls/VcsRadio.vue';
|
197
|
+
export { default as VcsRadioGrid } from './src/components/form-inputs-controls/VcsRadioGrid.vue';
|
195
198
|
// export { default as VcsColorPicker } from './src/components/form-inputs-controls/VcsColorPicker.vue';
|
196
199
|
export { default as VcsFormSection } from './src/components/form-inputs-controls/VcsFormSection.vue';
|
197
200
|
// export { default as VcsInputColumnCoordinates } from './src/components/form-inputs-controls/VcsInputColumnCoordinates.vue';
|
@@ -228,5 +231,18 @@ export { default as VcsBadge } from './src/components/notification/VcsBadge.vue'
|
|
228
231
|
export { default as VcsDefaultLogo } from './src/logo.svg';
|
229
232
|
export { default as VcsDefaultMobileLogo } from './src/logo-mobile.svg';
|
230
233
|
|
234
|
+
export { default as VcsFillSelector } from './src/components/style/VcsFillSelector.vue';
|
235
|
+
export { default as VcsFillMenu } from './src/components/style/VcsFillMenu.vue';
|
236
|
+
export { default as VcsStrokeSelector } from './src/components/style/VcsStrokeSelector.vue';
|
237
|
+
export { default as VcsStrokeMenu } from './src/components/style/VcsStrokeMenu.vue';
|
238
|
+
export { default as VcsImageSelector } from './src/components/style/VcsImageSelector.vue';
|
239
|
+
export { default as VcsImageMenu } from './src/components/style/VcsImageMenu.vue';
|
240
|
+
export { default as VcsTextSelector } from './src/components/style/VcsTextSelector.vue';
|
241
|
+
export { default as VcsTextMenu } from './src/components/style/VcsTextMenu.vue';
|
242
|
+
export {
|
243
|
+
default as VcsVectorStyleComponent,
|
244
|
+
VectorStyleMenus,
|
245
|
+
} from './src/components/style/VcsVectorStyleComponent.vue';
|
246
|
+
|
231
247
|
// export { default as VcsFileNamePopover } from './src/components/popovers/VcsFileNamePopover.vue';
|
232
248
|
// export { default as VcsTexturePopover } from './src/components/popovers/VcsTexturePopover.vue';
|
package/package.json
CHANGED
@@ -34,18 +34,18 @@ export default function createLink() {
|
|
34
34
|
i18n: {
|
35
35
|
de: {
|
36
36
|
createLink: {
|
37
|
-
title: 'Link
|
38
|
-
windowTitle: '
|
39
|
-
tooltip: 'Dialog zum
|
40
|
-
copyToClipboard: '
|
41
|
-
refreshTooltip: '
|
42
|
-
copied: '
|
37
|
+
title: 'Link kopieren',
|
38
|
+
windowTitle: 'Anwendungslink',
|
39
|
+
tooltip: 'Dialog zum Kopieren des Anwendungslinks anzeigen',
|
40
|
+
copyToClipboard: 'Anwendungslinks in Zwischenablage kopieren',
|
41
|
+
refreshTooltip: 'Anwendungslinks aktualisieren',
|
42
|
+
copied: 'Der Anwendungslink in wurde in die Zwischenablage kopiert.',
|
43
43
|
},
|
44
44
|
},
|
45
45
|
en: {
|
46
46
|
createLink: {
|
47
|
-
title: 'Copy
|
48
|
-
windowTitle: 'Application
|
47
|
+
title: 'Copy link',
|
48
|
+
windowTitle: 'Application link',
|
49
49
|
tooltip: 'Open dialog to copy application link to clipboard',
|
50
50
|
copyToClipboard: 'Copy application link to clipboard',
|
51
51
|
refreshTooltip: 'Refresh application link',
|
@@ -11,6 +11,8 @@ import CollectionManagerExample from './CollectionManagerExample.vue';
|
|
11
11
|
* @returns {VcsPlugin}
|
12
12
|
*/
|
13
13
|
export default async function collectionManagerExample() {
|
14
|
+
let collectionManager;
|
15
|
+
|
14
16
|
return {
|
15
17
|
get name() {
|
16
18
|
return packageJSON.name;
|
@@ -21,8 +23,11 @@ export default async function collectionManagerExample() {
|
|
21
23
|
get vcMapVersion() {
|
22
24
|
return packageJSON.vcMapVersion;
|
23
25
|
},
|
26
|
+
get collectionManager() {
|
27
|
+
return collectionManager;
|
28
|
+
},
|
24
29
|
initialize(app) {
|
25
|
-
|
30
|
+
collectionManager = new CollectionManager(app);
|
26
31
|
const { action, destroy } = createToggleAction(
|
27
32
|
{
|
28
33
|
name: 'Collection Manager Tester',
|
@@ -2,6 +2,8 @@
|
|
2
2
|
<v-form v-model="isValid" ref="form">
|
3
3
|
<VcsFormSection
|
4
4
|
heading="VcsFormSection Select & Text Inputs"
|
5
|
+
expandable
|
6
|
+
start-open
|
5
7
|
:header-actions="actions"
|
6
8
|
:action-button-list-overflow-count="4"
|
7
9
|
>
|
@@ -15,7 +17,7 @@
|
|
15
17
|
<span>{{ $t('form-inputs-example.help3desc') }}</span>
|
16
18
|
</ol>
|
17
19
|
</template>
|
18
|
-
<template #default
|
20
|
+
<template #default>
|
19
21
|
<v-container class="py-0 px-1">
|
20
22
|
<v-row no-gutters>
|
21
23
|
<v-col class="w-max-half">
|
@@ -79,7 +81,9 @@
|
|
79
81
|
</v-row>
|
80
82
|
<v-row no-gutters>
|
81
83
|
<v-col>
|
82
|
-
<VcsLabel html-for="emailInput" :dense="dense"
|
84
|
+
<VcsLabel html-for="emailInput" :dense="dense" required>
|
85
|
+
Email
|
86
|
+
</VcsLabel>
|
83
87
|
</v-col>
|
84
88
|
<v-col>
|
85
89
|
<VcsTextField
|
@@ -230,7 +234,12 @@
|
|
230
234
|
</v-container>
|
231
235
|
</template>
|
232
236
|
</VcsFormSection>
|
233
|
-
<VcsFormSection
|
237
|
+
<VcsFormSection
|
238
|
+
heading="VcsFormSection Radio & Checkbox"
|
239
|
+
expandable
|
240
|
+
start-open
|
241
|
+
:disabled="!state.checkboxInput"
|
242
|
+
>
|
234
243
|
<template #default>
|
235
244
|
<v-container class="py-0 px-1">
|
236
245
|
<v-row no-gutters>
|
@@ -333,6 +342,26 @@
|
|
333
342
|
/>
|
334
343
|
</v-col>
|
335
344
|
</v-row>
|
345
|
+
<v-row no-gutters>
|
346
|
+
<v-col>
|
347
|
+
<VcsRadioGrid
|
348
|
+
v-model="state.selected"
|
349
|
+
:items="[
|
350
|
+
{ value: 'A', src: 'mdi-circle-outline' },
|
351
|
+
{ value: 'B', src: 'mdi-close' },
|
352
|
+
{ value: 'C', src: 'mdi-triangle-outline' },
|
353
|
+
{ value: 'D', src: 'mdi-square-outline' },
|
354
|
+
]"
|
355
|
+
:dense="dense"
|
356
|
+
:rules="[(v) => v !== 'D' || 'Square is not allowed']"
|
357
|
+
>
|
358
|
+
<!-- if label slot is not used, src is forwarded to img src -->
|
359
|
+
<template #label="{ src }">
|
360
|
+
<v-icon size="24">{{ src }}</v-icon>
|
361
|
+
</template>
|
362
|
+
</VcsRadioGrid>
|
363
|
+
</v-col>
|
364
|
+
</v-row>
|
336
365
|
</v-container>
|
337
366
|
</template>
|
338
367
|
</VcsFormSection>
|
@@ -371,8 +400,9 @@
|
|
371
400
|
VcsTextArea,
|
372
401
|
VcsDatePicker,
|
373
402
|
VcsSlider,
|
403
|
+
VcsRadioGrid,
|
374
404
|
} from '@vcmap/ui';
|
375
|
-
import { VCol, VContainer, VForm, VRow } from 'vuetify/lib';
|
405
|
+
import { VCol, VContainer, VForm, VRow, VIcon } from 'vuetify/lib';
|
376
406
|
import packageJSON from './package.json';
|
377
407
|
import { isValidText, conditionalTest, isValidEmail } from './validation.js';
|
378
408
|
|
@@ -394,6 +424,8 @@
|
|
394
424
|
VContainer,
|
395
425
|
VcsDatePicker,
|
396
426
|
VcsSlider,
|
427
|
+
VcsRadioGrid,
|
428
|
+
VIcon,
|
397
429
|
},
|
398
430
|
props: {
|
399
431
|
actions: {
|
@@ -404,10 +436,6 @@
|
|
404
436
|
type: Object,
|
405
437
|
required: true,
|
406
438
|
},
|
407
|
-
showSection: {
|
408
|
-
type: Object,
|
409
|
-
required: true,
|
410
|
-
},
|
411
439
|
},
|
412
440
|
setup() {
|
413
441
|
const app = inject('vcsApp');
|
@@ -23,25 +23,6 @@ export default function createExampleActions() {
|
|
23
23
|
title: 'another action without icon',
|
24
24
|
callback: () => {},
|
25
25
|
},
|
26
|
-
reactive({
|
27
|
-
name: 'toggleSection',
|
28
|
-
title: 'toggle section',
|
29
|
-
icon: showSection.value ? '$vcsMinus' : '$vcsPlus',
|
30
|
-
callback() {
|
31
|
-
showSection.value = !showSection.value;
|
32
|
-
this.icon = showSection.value ? '$vcsMinus' : '$vcsPlus';
|
33
|
-
},
|
34
|
-
}),
|
35
|
-
reactive({
|
36
|
-
name: 'toggleIcon',
|
37
|
-
title: 'toggle switch textfields-example',
|
38
|
-
icon: showSection.value ? 'mdi-toggle-switch' : 'mdi-toggle-switch-off',
|
39
|
-
active: showSection.value,
|
40
|
-
callback() {
|
41
|
-
showSection.value = !showSection.value;
|
42
|
-
this.active = showSection.value;
|
43
|
-
},
|
44
|
-
}),
|
45
26
|
{
|
46
27
|
name: 'alert',
|
47
28
|
icon: 'mdi-message-text',
|
@@ -176,7 +176,7 @@ export default function formInputsExample(config) {
|
|
176
176
|
getSerializedState,
|
177
177
|
setSerializedState,
|
178
178
|
onVcsAppMounted(app) {
|
179
|
-
const { actions,
|
179
|
+
const { actions, dense } = createExampleActions();
|
180
180
|
|
181
181
|
const { action, destroy } = createToggleAction(
|
182
182
|
{
|
@@ -197,7 +197,6 @@ export default function formInputsExample(config) {
|
|
197
197
|
},
|
198
198
|
props: {
|
199
199
|
actions,
|
200
|
-
showSection,
|
201
200
|
dense,
|
202
201
|
},
|
203
202
|
},
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { WindowSlot, createToggleAction, ButtonLocation } from '@vcmap/ui';
|
2
|
+
import packageJSON from './package.json';
|
3
|
+
import component from './styleExample.vue';
|
4
|
+
|
5
|
+
export default function createStyleExamplePlugin() {
|
6
|
+
return {
|
7
|
+
get name() {
|
8
|
+
return packageJSON.name;
|
9
|
+
},
|
10
|
+
get version() {
|
11
|
+
return packageJSON.version;
|
12
|
+
},
|
13
|
+
get vcMapVersion() {
|
14
|
+
return packageJSON.vcMapVersion;
|
15
|
+
},
|
16
|
+
initialize(vcsApp) {
|
17
|
+
const { action, destroy } = createToggleAction(
|
18
|
+
{
|
19
|
+
name: 'Style Example',
|
20
|
+
icon: '$vcsColorSwatch',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
id: 'style-input-example',
|
24
|
+
state: {
|
25
|
+
headerTitle: 'Style example',
|
26
|
+
headerIcon: '$vcsColorSwatch',
|
27
|
+
},
|
28
|
+
component,
|
29
|
+
slot: WindowSlot.DYNAMIC_LEFT,
|
30
|
+
},
|
31
|
+
vcsApp.windowManager,
|
32
|
+
packageJSON.name,
|
33
|
+
);
|
34
|
+
vcsApp.navbarManager.add(
|
35
|
+
{ id: 'style', action },
|
36
|
+
packageJSON.name,
|
37
|
+
ButtonLocation.TOOL,
|
38
|
+
);
|
39
|
+
this.destroy = destroy;
|
40
|
+
},
|
41
|
+
};
|
42
|
+
}
|
@@ -0,0 +1,191 @@
|
|
1
|
+
<template>
|
2
|
+
<v-sheet>
|
3
|
+
<VcsFormSection heading="Style menus">
|
4
|
+
<VcsVectorStyleComponent
|
5
|
+
v-model="styleOptions"
|
6
|
+
:value-default="defaultStyleOptions"
|
7
|
+
/>
|
8
|
+
</VcsFormSection>
|
9
|
+
<VcsFormSection :expandable="true" heading="Fill Selector">
|
10
|
+
<VcsFillSelector v-model="styleOptions.fill" />
|
11
|
+
</VcsFormSection>
|
12
|
+
<VcsFormSection :expandable="true" heading="Stroke Selector">
|
13
|
+
<VcsStrokeSelector v-model="styleOptions.stroke" />
|
14
|
+
</VcsFormSection>
|
15
|
+
<VcsFormSection :expandable="true" heading="Image Selector">
|
16
|
+
<VcsImageSelector
|
17
|
+
v-model="styleOptions.image"
|
18
|
+
:value-default="defaultStyleOptions.image"
|
19
|
+
:extended-shape-settings="true"
|
20
|
+
/>
|
21
|
+
</VcsFormSection>
|
22
|
+
<VcsFormSection :expandable="true" heading="Text Selector">
|
23
|
+
<VcsTextSelector
|
24
|
+
v-model="styleOptions.text"
|
25
|
+
:value-default="defaultStyleOptions.text"
|
26
|
+
/>
|
27
|
+
</VcsFormSection>
|
28
|
+
</v-sheet>
|
29
|
+
</template>
|
30
|
+
|
31
|
+
<script>
|
32
|
+
import { VSheet } from 'vuetify/lib';
|
33
|
+
import { onMounted, ref, watchEffect } from 'vue';
|
34
|
+
import {
|
35
|
+
VcsFormSection,
|
36
|
+
VcsFillSelector,
|
37
|
+
VcsStrokeSelector,
|
38
|
+
VcsImageSelector,
|
39
|
+
VcsTextSelector,
|
40
|
+
VcsVectorStyleComponent,
|
41
|
+
VectorStyleMenus,
|
42
|
+
} from '@vcmap/ui';
|
43
|
+
import { parseColor } from '@vcmap/core';
|
44
|
+
import { Fill, Icon, RegularShape, Stroke, Style, Text } from 'ol/style.js';
|
45
|
+
|
46
|
+
export default {
|
47
|
+
name: 'StyleExample',
|
48
|
+
components: {
|
49
|
+
VSheet,
|
50
|
+
VcsFormSection,
|
51
|
+
VcsFillSelector,
|
52
|
+
VcsStrokeSelector,
|
53
|
+
VcsImageSelector,
|
54
|
+
VcsTextSelector,
|
55
|
+
VcsVectorStyleComponent,
|
56
|
+
},
|
57
|
+
setup() {
|
58
|
+
const exampleStyle = new Style({
|
59
|
+
fill: new Fill({ color: 'rgba(255,255,255,0.4)' }),
|
60
|
+
stroke: undefined,
|
61
|
+
image: new RegularShape({
|
62
|
+
points: undefined,
|
63
|
+
radius: 11,
|
64
|
+
angle: undefined,
|
65
|
+
radius2: undefined,
|
66
|
+
fill: new Fill({ color: 'rgba(255,255,255,1)' }),
|
67
|
+
stroke: new Stroke({ color: 'rgba(0,0,0,1)', width: 1 }),
|
68
|
+
}),
|
69
|
+
text: new Text({
|
70
|
+
font: '10px Arial, Helvetica, sans-serif',
|
71
|
+
fill: new Fill({ color: 'rgba(0,0,0,1)' }),
|
72
|
+
stroke: new Stroke({ color: 'rgba(255,255,255,1)', width: 1 }),
|
73
|
+
}),
|
74
|
+
});
|
75
|
+
|
76
|
+
const defaultStyleOptions = {
|
77
|
+
fill: undefined,
|
78
|
+
stroke: {
|
79
|
+
color: [0, 0, 0, 1],
|
80
|
+
width: 2,
|
81
|
+
},
|
82
|
+
image: {
|
83
|
+
fill: undefined,
|
84
|
+
stroke: {
|
85
|
+
color: [0, 0, 0, 1],
|
86
|
+
width: 2,
|
87
|
+
},
|
88
|
+
radius: 10,
|
89
|
+
scale: 1,
|
90
|
+
opacity: 1,
|
91
|
+
},
|
92
|
+
text: {
|
93
|
+
font: '10px Arial, Helvetica, sans-serif',
|
94
|
+
offsetX: 0,
|
95
|
+
offsetY: 0,
|
96
|
+
text: '',
|
97
|
+
},
|
98
|
+
};
|
99
|
+
|
100
|
+
const styleOptions = ref({
|
101
|
+
fill: undefined,
|
102
|
+
stroke: undefined,
|
103
|
+
image: undefined,
|
104
|
+
text: undefined,
|
105
|
+
});
|
106
|
+
|
107
|
+
const fill = exampleStyle.getFill();
|
108
|
+
const stroke = exampleStyle.getStroke();
|
109
|
+
const image = exampleStyle.getImage();
|
110
|
+
const text = exampleStyle.getText();
|
111
|
+
|
112
|
+
// TODO: Replace with new getStyleOptions from @vcmap/core as soon as available
|
113
|
+
if (fill) {
|
114
|
+
styleOptions.value.fill = {
|
115
|
+
color: parseColor(fill.getColor()),
|
116
|
+
};
|
117
|
+
}
|
118
|
+
if (stroke) {
|
119
|
+
styleOptions.value.stroke = {
|
120
|
+
color: parseColor(stroke.getColor()),
|
121
|
+
width: exampleStyle.getStroke().getWidth(),
|
122
|
+
};
|
123
|
+
}
|
124
|
+
if (image) {
|
125
|
+
if (image instanceof RegularShape) {
|
126
|
+
styleOptions.value.image = {
|
127
|
+
points: image.getPoints(),
|
128
|
+
radius: image.getRadius(),
|
129
|
+
radius2: image.getRadius2(),
|
130
|
+
angle: image.getAngle(),
|
131
|
+
fill: {
|
132
|
+
color: parseColor(image.getFill().getColor()),
|
133
|
+
},
|
134
|
+
stroke: {
|
135
|
+
color: parseColor(image.getStroke().getColor()),
|
136
|
+
width: image.getStroke().getWidth(),
|
137
|
+
},
|
138
|
+
src: 'mdi-circle-outline',
|
139
|
+
};
|
140
|
+
} else if (image instanceof Icon) {
|
141
|
+
styleOptions.value.image = {
|
142
|
+
src: image.getSrc(),
|
143
|
+
scale: image.getScale(),
|
144
|
+
opacity: image.getOpacity(),
|
145
|
+
};
|
146
|
+
}
|
147
|
+
}
|
148
|
+
if (text) {
|
149
|
+
styleOptions.value.text = {
|
150
|
+
font: text.getFont(),
|
151
|
+
fill: {
|
152
|
+
color: parseColor(text.getFill()?.getColor()),
|
153
|
+
},
|
154
|
+
stroke: {
|
155
|
+
color: parseColor(text.getStroke()?.getColor()),
|
156
|
+
width: text.getStroke().getWidth(),
|
157
|
+
},
|
158
|
+
textBaseline: text.getTextBaseline(),
|
159
|
+
offsetY: text.getOffsetY(),
|
160
|
+
offsetX: text.getOffsetX(),
|
161
|
+
text: text.getText(),
|
162
|
+
};
|
163
|
+
}
|
164
|
+
|
165
|
+
onMounted(() => {
|
166
|
+
watchEffect(() => {
|
167
|
+
const newFill = styleOptions.value.fill;
|
168
|
+
const newStroke = styleOptions.value.stroke;
|
169
|
+
const newImage = styleOptions.value.image;
|
170
|
+
// const newText = styleOptions.value.text;
|
171
|
+
// TODO: Replace with new getStyleFromOptions from @vcmap/core as soon as available
|
172
|
+
exampleStyle.setFill(newFill ? new Fill(newFill) : null);
|
173
|
+
exampleStyle.setStroke(newStroke ? new Stroke(newStroke) : null);
|
174
|
+
if (newImage?.points) {
|
175
|
+
// exampleStyle.setImage(new RegularShape(newImage));
|
176
|
+
} else if (newImage?.src) {
|
177
|
+
exampleStyle.setImage(new Icon(newImage));
|
178
|
+
} else {
|
179
|
+
exampleStyle.setImage(null);
|
180
|
+
}
|
181
|
+
});
|
182
|
+
});
|
183
|
+
|
184
|
+
return {
|
185
|
+
styleOptions,
|
186
|
+
defaultStyleOptions,
|
187
|
+
VectorStyleMenus,
|
188
|
+
};
|
189
|
+
},
|
190
|
+
};
|
191
|
+
</script>
|
@@ -20,9 +20,11 @@
|
|
20
20
|
import { getLogger } from '@vcsuite/logger';
|
21
21
|
|
22
22
|
import { WindowSlot, VcsFormButton } from '@vcmap/ui';
|
23
|
-
import
|
23
|
+
import WindowExampleToggleChild from './windowExampleToggleChild.vue';
|
24
|
+
import WindowExampleContent from './windowExampleContent.vue';
|
24
25
|
import MyCustomHeader from './myCustomHeader.vue';
|
25
26
|
import EmptyComponent from './emptyComponent.vue';
|
27
|
+
import { name as owner } from './package.json';
|
26
28
|
|
27
29
|
const showTestClass = ref(false);
|
28
30
|
|
@@ -34,7 +36,7 @@
|
|
34
36
|
{
|
35
37
|
id: 'dynamicLeft',
|
36
38
|
headerTitle: 'Example dynamicLeft',
|
37
|
-
component:
|
39
|
+
component: WindowExampleToggleChild,
|
38
40
|
slot: WindowSlot.DYNAMIC_LEFT,
|
39
41
|
},
|
40
42
|
{
|
@@ -42,7 +44,7 @@
|
|
42
44
|
state: {
|
43
45
|
headerTitle: 'Example dynamicLeft2',
|
44
46
|
},
|
45
|
-
component:
|
47
|
+
component: WindowExampleToggleChild,
|
46
48
|
slot: WindowSlot.DYNAMIC_LEFT,
|
47
49
|
},
|
48
50
|
{
|
@@ -50,7 +52,7 @@
|
|
50
52
|
state: {
|
51
53
|
headerTitle: 'Example dynamicLeft2 with 1000px width',
|
52
54
|
},
|
53
|
-
component:
|
55
|
+
component: WindowExampleToggleChild,
|
54
56
|
slot: WindowSlot.DYNAMIC_LEFT,
|
55
57
|
position: {
|
56
58
|
width: '1000px',
|
@@ -61,7 +63,7 @@
|
|
61
63
|
state: {
|
62
64
|
headerTitle: 'Example dynamicRight',
|
63
65
|
},
|
64
|
-
component:
|
66
|
+
component: WindowExampleContent,
|
65
67
|
headerComponent: MyCustomHeader,
|
66
68
|
slot: WindowSlot.DYNAMIC_RIGHT,
|
67
69
|
props: {
|
@@ -73,7 +75,7 @@
|
|
73
75
|
state: {
|
74
76
|
headerTitle: 'Example dynamicRight2',
|
75
77
|
},
|
76
|
-
component:
|
78
|
+
component: WindowExampleContent,
|
77
79
|
slot: WindowSlot.DYNAMIC_RIGHT,
|
78
80
|
},
|
79
81
|
{
|
@@ -82,7 +84,7 @@
|
|
82
84
|
headerTitle: 'Example static',
|
83
85
|
styles: { 'background-color': 'red' },
|
84
86
|
},
|
85
|
-
component:
|
87
|
+
component: WindowExampleToggleChild,
|
86
88
|
slot: WindowSlot.STATIC,
|
87
89
|
},
|
88
90
|
{
|
@@ -103,7 +105,7 @@
|
|
103
105
|
state: {
|
104
106
|
headerTitle: 'Example position1 relative',
|
105
107
|
},
|
106
|
-
component:
|
108
|
+
component: WindowExampleToggleChild,
|
107
109
|
position: {
|
108
110
|
left: '30%',
|
109
111
|
right: '30%',
|
@@ -117,7 +119,7 @@
|
|
117
119
|
hideHeader: false,
|
118
120
|
headerTitle: 'Example position2 absolute',
|
119
121
|
},
|
120
|
-
component:
|
122
|
+
component: WindowExampleToggleChild,
|
121
123
|
position: {
|
122
124
|
left: '200px',
|
123
125
|
top: '300px',
|
@@ -155,10 +157,7 @@
|
|
155
157
|
const windowComponentOptions = exampleWindows.find(
|
156
158
|
(item) => item.id === windowId,
|
157
159
|
);
|
158
|
-
app.windowManager.add(
|
159
|
-
windowComponentOptions,
|
160
|
-
'WindowManagerExample',
|
161
|
-
);
|
160
|
+
app.windowManager.add(windowComponentOptions, owner);
|
162
161
|
}
|
163
162
|
},
|
164
163
|
examples: exampleWindows.map((item) => item.id),
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<template>
|
2
|
+
<v-container>
|
3
|
+
<VcsFormButton @click="toggle">toggle child</VcsFormButton>
|
4
|
+
</v-container>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<style scoped></style>
|
8
|
+
<script>
|
9
|
+
import { VContainer } from 'vuetify/lib';
|
10
|
+
import { VcsFormButton, WindowSlot } from '@vcmap/ui';
|
11
|
+
import { inject } from 'vue';
|
12
|
+
import WindowExampleContent from './windowExampleContent.vue';
|
13
|
+
import { name as owner } from './package.json';
|
14
|
+
|
15
|
+
export default {
|
16
|
+
name: 'WindowExampleContent',
|
17
|
+
components: { VContainer, VcsFormButton },
|
18
|
+
setup(props, { attrs }) {
|
19
|
+
const app = inject('vcsApp');
|
20
|
+
const parentId = attrs['window-state'].id;
|
21
|
+
const childId = `dynamicChild-${parentId}`;
|
22
|
+
|
23
|
+
return {
|
24
|
+
toggle(e) {
|
25
|
+
if (app.windowManager.has(childId)) {
|
26
|
+
app.windowManager.remove(childId);
|
27
|
+
} else {
|
28
|
+
e.stopPropagation();
|
29
|
+
app.windowManager.add(
|
30
|
+
{
|
31
|
+
id: childId,
|
32
|
+
parentId,
|
33
|
+
headerTitle: 'Example dynamicChild',
|
34
|
+
component: WindowExampleContent,
|
35
|
+
slot: WindowSlot.DYNAMIC_CHILD,
|
36
|
+
},
|
37
|
+
owner,
|
38
|
+
);
|
39
|
+
}
|
40
|
+
},
|
41
|
+
};
|
42
|
+
},
|
43
|
+
};
|
44
|
+
</script>
|
Binary file
|
Binary file
|