@vcmap/ui 6.0.0-rc.2 → 6.0.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/build/build.js +40 -60
- package/build/buildHelpers.js +2 -8
- package/build/info/conf.json +1 -1
- package/config/projects.config.json +2 -1
- package/config/splashscreen.config.json +45 -0
- package/dist/.htaccess +7 -0
- package/dist/assets/@mdi/font/README.md +25 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min-7a4f6be0.css +3 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
- package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.cbf44a.js → core-72f21835.js} +673 -641
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol.86e93c.js → ol-2d33bc8b.js} +42505 -44282
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-2ab43a16.css +1 -0
- package/dist/assets/{ui.7c276c.js → ui-2ab43a16.js} +12026 -12100
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify.4d18fe.css → vuetify-760ced3b.css} +1 -1
- package/dist/assets/{vuetify.4d18fe.js → vuetify-760ced3b.js} +5720 -5662
- package/dist/assets/vuetify.js +1 -1
- package/dist/index.html +11 -10
- package/index.d.ts +7 -5
- package/index.html +5 -5
- package/index.js +3 -3
- package/lib/olLib.js +84 -23
- package/package.json +5 -5
- package/plugins/@vcmap-show-case/flight-component-example/src/FlightExample.vue +41 -1
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +70 -30
- package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +7 -11
- package/plugins/@vcmap-show-case/form-inputs-example/src/index.js +2 -2
- package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +21 -8
- package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +29 -90
- package/public/assets/@mdi/font/README.md +25 -0
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +2 -2
- package/public/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
- package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/src/actions/actionHelper.js +20 -20
- package/src/actions/flightActions.js +5 -5
- package/src/actions/listActions.d.ts +0 -7
- package/src/actions/listActions.js +4 -20
- package/src/actions/stateRefAction.js +2 -2
- package/src/application/VcsApp.vue +52 -27
- package/src/application/VcsApp.vue.d.ts +1 -0
- package/src/application/VcsAttributions.vue +2 -13
- package/src/application/VcsAttributionsFooter.vue +10 -11
- package/src/application/VcsPositionDisplay.vue +8 -23
- package/src/application/VcsPositionDisplay.vue.d.ts +0 -1
- package/src/application/VcsSettings.vue +10 -17
- package/src/application/VcsSplashScreen.vue +25 -42
- package/src/application/VcsSplashScreen.vue.d.ts +0 -2
- package/src/application/VcsTextPage.vue +12 -43
- package/src/application/VcsTextPage.vue.d.ts +4 -8
- package/src/application/VcsTextPageFooter.vue +22 -40
- package/src/components/extent/VcsExtentEditor.vue +1 -1
- package/src/components/flight/VcsFlightAnchorsComponent.vue +63 -36
- package/src/components/flight/VcsFlightComponent.vue +16 -21
- package/src/components/flight/VcsFlightPlayer.vue +27 -5
- package/src/components/form-inputs-controls/VcsCheckbox.vue +9 -5
- package/src/components/form-inputs-controls/VcsCoordinate.vue +13 -1
- package/src/components/form-inputs-controls/VcsCoordinate.vue.d.ts +5 -2
- package/src/components/form-inputs-controls/VcsDatePicker.vue +34 -60
- package/src/components/form-inputs-controls/VcsDatePicker.vue.d.ts +1 -63
- package/src/components/form-inputs-controls/VcsFileInput.vue +17 -18
- package/src/components/form-inputs-controls/VcsFileInput.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +17 -3
- package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +39 -27
- package/src/components/form-inputs-controls/VcsSelect.vue.d.ts +5 -2
- package/src/components/form-inputs-controls/VcsSlider.vue +14 -1
- package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +5 -2
- package/src/components/form-inputs-controls/VcsTextArea.vue +26 -22
- package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +6 -4
- package/src/components/form-inputs-controls/VcsWizardStep.vue +1 -1
- package/src/components/form-inputs-controls/vcsTextField.scss +8 -8
- package/src/components/form-output/VcsFormattedNumber.vue +15 -1
- package/src/components/form-output/VcsFormattedNumber.vue.d.ts +9 -0
- package/src/components/lists/VcsActionList.vue +7 -7
- package/src/components/lists/VcsList.vue +10 -17
- package/src/components/lists/VcsList.vue.d.ts +3 -7
- package/src/components/lists/VcsListItem.vue +51 -21
- package/src/components/lists/VcsListItem.vue.d.ts +11 -5
- package/src/components/section/VcsExpansionPanel.vue +101 -0
- package/src/components/section/VcsExpansionPanel.vue.d.ts +19 -0
- package/src/components/style/MenuWrapper.vue +24 -26
- package/src/components/style/MenuWrapper.vue.d.ts +4 -4
- package/src/components/style/VcsFillMenu.vue +9 -16
- package/src/components/style/VcsFillMenu.vue.d.ts +0 -18
- package/src/components/style/VcsFillSelector.vue +13 -16
- package/src/components/style/VcsImageMenu.vue +8 -25
- package/src/components/style/VcsImageMenu.vue.d.ts +0 -27
- package/src/components/style/VcsImageSelector.vue +102 -167
- package/src/components/style/VcsImageSelector.vue.d.ts +15 -15
- package/src/components/style/VcsStrokeMenu.vue +8 -15
- package/src/components/style/VcsStrokeMenu.vue.d.ts +0 -18
- package/src/components/style/VcsStrokeSelector.vue +11 -18
- package/src/components/style/VcsTextMenu.vue +9 -12
- package/src/components/style/VcsTextMenu.vue.d.ts +0 -9
- package/src/components/style/VcsTextSelector.vue +79 -95
- package/src/components/style/VcsTextSelector.vue.d.ts +20 -22
- package/src/components/style/VcsVectorStyleComponent.vue +7 -18
- package/src/components/style/VcsVectorStyleComponent.vue.d.ts +1 -1
- package/src/components/style/composables.d.ts +0 -14
- package/src/components/style/composables.js +0 -49
- package/src/components/vector-properties/VcsFeatureEditingWindow.vue +39 -6
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +1 -1
- package/src/components/viewpoint/VcsViewpointComponent.vue +21 -8
- package/src/components/viewpoint/VcsViewpointEditor.vue +1 -0
- package/src/contentTree/contentTreeItem.d.ts +2 -2
- package/src/contentTree/contentTreeItem.js +7 -7
- package/src/featureInfo/featureInfo.js +8 -10
- package/src/init.d.ts +5 -38
- package/src/init.js +19 -18
- package/src/legend/StyleLegendItem.vue +4 -9
- package/src/legend/VcsLegend.vue +28 -54
- package/src/manager/buttonManager.js +4 -4
- package/src/manager/collectionManager/CollectionComponent.vue +17 -42
- package/src/manager/collectionManager/CollectionComponent.vue.d.ts +4 -2
- package/src/manager/collectionManager/CollectionComponentContent.vue +7 -6
- package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +3 -1
- package/src/manager/collectionManager/CollectionComponentList.vue +10 -8
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +4 -2
- package/src/manager/collectionManager/CollectionComponentProvider.vue +1 -1
- package/src/manager/collectionManager/CollectionComponentStandalone.vue +3 -2
- package/src/manager/collectionManager/CollectionManager.vue +1 -1
- package/src/manager/collectionManager/collectionComponentClass.js +6 -9
- package/src/manager/collectionManager/collectionManager.js +10 -10
- package/src/manager/collectionManager/editorCollectionComponentClass.js +4 -4
- package/src/manager/contextMenu/contextMenuManager.js +2 -2
- package/src/manager/navbarManager.js +2 -2
- package/src/manager/panel/panelManager.js +3 -3
- package/src/manager/toolbox/toolboxManager.js +10 -10
- package/src/manager/window/windowManager.d.ts +2 -2
- package/src/manager/window/windowManager.js +4 -4
- package/src/search/search.js +2 -2
- package/src/siteConfig.js +1 -1
- package/src/state.js +4 -4
- package/src/vcsUiApp.d.ts +14 -10
- package/src/vcsUiApp.js +1 -1
- package/src/vuePlugins/vuetify.d.ts +2 -0
- package/src/vuePlugins/vuetify.js +11 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
- package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +0 -3
- package/dist/assets/index-8eGauqjA.js +0 -1
- package/dist/assets/ui.7c276c.css +0 -1
- package/public/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
- package/src/application/VcsCustomScreen.vue +0 -45
- package/src/application/VcsCustomScreen.vue.d.ts +0 -15
- /package/dist/assets/{cesium.0b750d.js → cesium-cb4dbfba.js} +0 -0
- /package/dist/assets/{favicon-128.4c4ce5.png → favicon-128-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-180.5b99c0.png → favicon-180-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-192.0e205e.png → favicon-192-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon-32.6b9add.png → favicon-32-4c4ce5df.png} +0 -0
- /package/dist/assets/{favicon.d5ec97.svg → favicon-4c4ce5df.svg} +0 -0
- /package/dist/assets/font/{TitilliumWeb-Regular.9ca076.woff2 → TitilliumWeb-Regular-9ca076be.woff2} +0 -0
- /package/dist/assets/style/{icon-marker.70960f.png → icon-marker-70960f05.png} +0 -0
- /package/dist/assets/style/{icon-marker-blue.534e37.png → icon-marker-blue-534e374b.png} +0 -0
- /package/dist/assets/style/{icon-marker-green.0b6a92.png → icon-marker-green-0b6a92bc.png} +0 -0
- /package/dist/assets/style/{icon-marker-o.036477.png → icon-marker-o-036477fa.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-blue.7b6d62.png → icon-marker-o-blue-7b6d6279.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-green.c863c0.png → icon-marker-o-green-c863c0fa.png} +0 -0
- /package/dist/assets/style/{icon-marker-o-red.93ff58.png → icon-marker-o-red-93ff58df.png} +0 -0
- /package/dist/assets/style/{icon-marker-red.313d03.png → icon-marker-red-313d03e8.png} +0 -0
- /package/dist/assets/style/{icon-pin.b7ce77.png → icon-pin-b7ce771e.png} +0 -0
- /package/dist/assets/style/{icon-pin-blue.7be369.png → icon-pin-blue-7be369a3.png} +0 -0
- /package/dist/assets/style/{icon-pin-green.cbb935.png → icon-pin-green-cbb935fe.png} +0 -0
- /package/dist/assets/style/{icon-pin-red.3f25b2.png → icon-pin-red-3f25b245.png} +0 -0
- /package/dist/assets/{vue.a3cd64.js → vue-03b265aa.js} +0 -0
- /package/public/assets/{favicon-128.png → favicon-128-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-180.png → favicon-180-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-192.png → favicon-192-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon-32.png → favicon-32-4c4ce5df.png} +0 -0
- /package/public/assets/{favicon.svg → favicon-4c4ce5df.svg} +0 -0
- /package/src/components/{form-inputs-controls → section}/VcsFormSection.vue +0 -0
- /package/src/components/{form-inputs-controls → section}/VcsFormSection.vue.d.ts +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<MenuWrapper
|
3
|
-
v-bind="{ ...$attrs,
|
3
|
+
v-bind="{ ...$attrs, ...$props }"
|
4
4
|
:value-fallback="fallbackStyle"
|
5
5
|
name="components.style.text"
|
6
6
|
>
|
@@ -10,13 +10,14 @@
|
|
10
10
|
</div>
|
11
11
|
</template>
|
12
12
|
<template #content>
|
13
|
-
<VcsTextSelector v-bind="{ ...$attrs,
|
13
|
+
<VcsTextSelector v-bind="{ ...$attrs, ...$props }" />
|
14
14
|
</template>
|
15
15
|
</MenuWrapper>
|
16
16
|
</template>
|
17
17
|
|
18
18
|
<script>
|
19
19
|
import { computed } from 'vue';
|
20
|
+
import { useProxiedAtomicModel } from '../modelHelper.js';
|
20
21
|
import VcsTextSelector from './VcsTextSelector.vue';
|
21
22
|
import MenuWrapper from './MenuWrapper.vue';
|
22
23
|
import { rgbaObjectToString, useColorObject } from './composables.js';
|
@@ -31,8 +32,7 @@
|
|
31
32
|
|
32
33
|
/**
|
33
34
|
* @description A wrapper for the VcsTextSelector, that has a small shape/icon preview and a menu that pops up when clicking the preview, containing the text style selector.
|
34
|
-
* @vue-prop {import("ol/style/Text").Options}
|
35
|
-
* @vue-prop {import("ol/style/Text").Options} valueDefault - The default ol Text style options
|
35
|
+
* @vue-prop {import("ol/style/Text").Options} [modelValue] - The ol Text style options
|
36
36
|
*/
|
37
37
|
export default {
|
38
38
|
name: 'VcsTextMenu',
|
@@ -45,17 +45,14 @@
|
|
45
45
|
type: Object,
|
46
46
|
default: undefined,
|
47
47
|
},
|
48
|
-
valueDefault: {
|
49
|
-
type: Object,
|
50
|
-
default: undefined,
|
51
|
-
},
|
52
48
|
},
|
53
|
-
setup(props) {
|
49
|
+
setup(props, { emit }) {
|
50
|
+
const localValue = useProxiedAtomicModel(props, 'modelValue', emit);
|
54
51
|
const fillColorObject = useColorObject(
|
55
|
-
() =>
|
52
|
+
() => localValue.value?.fill?.color,
|
56
53
|
);
|
57
54
|
const strokeColorObject = useColorObject(
|
58
|
-
() =>
|
55
|
+
() => localValue.value?.stroke?.color,
|
59
56
|
);
|
60
57
|
|
61
58
|
return {
|
@@ -63,7 +60,7 @@
|
|
63
60
|
rgbaObjectToString(strokeColorObject.value),
|
64
61
|
),
|
65
62
|
fillColor: computed(() => rgbaObjectToString(fillColorObject.value)),
|
66
|
-
fontStyle: computed(() =>
|
63
|
+
fontStyle: computed(() => localValue.value?.font),
|
67
64
|
fallbackStyle,
|
68
65
|
};
|
69
66
|
},
|
@@ -16,10 +16,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
16
16
|
type: ObjectConstructor;
|
17
17
|
default: undefined;
|
18
18
|
};
|
19
|
-
valueDefault: {
|
20
|
-
type: ObjectConstructor;
|
21
|
-
default: undefined;
|
22
|
-
};
|
23
19
|
}, {
|
24
20
|
strokeColor: import("vue").ComputedRef<string>;
|
25
21
|
fillColor: import("vue").ComputedRef<string>;
|
@@ -41,12 +37,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
41
37
|
type: ObjectConstructor;
|
42
38
|
default: undefined;
|
43
39
|
};
|
44
|
-
valueDefault: {
|
45
|
-
type: ObjectConstructor;
|
46
|
-
default: undefined;
|
47
|
-
};
|
48
40
|
}>>, {
|
49
41
|
modelValue: Record<string, any>;
|
50
|
-
valueDefault: Record<string, any>;
|
51
42
|
}, {}>;
|
52
43
|
export default _default;
|
@@ -4,26 +4,25 @@
|
|
4
4
|
<v-row no-gutters>
|
5
5
|
<v-col>
|
6
6
|
<VcsTextField
|
7
|
-
v-model="
|
7
|
+
v-model="localValue.text"
|
8
8
|
:placeholder="$t('components.style.enterText')"
|
9
9
|
/>
|
10
10
|
</v-col>
|
11
11
|
</v-row>
|
12
12
|
<v-row no-gutters>
|
13
13
|
<v-col>
|
14
|
-
<VcsSelect
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}}</span>
|
14
|
+
<VcsSelect :items="fontItems" v-model="fontFamily">
|
15
|
+
<template #item="scope">
|
16
|
+
<v-list-item density="compact" v-bind="scope.props" role="option">
|
17
|
+
<template #title="{ title }">
|
18
|
+
<span
|
19
|
+
:style="{
|
20
|
+
fontFamily: `${scope.item.value} !important`,
|
21
|
+
}"
|
22
|
+
>{{ title }}</span
|
23
|
+
>
|
24
|
+
</template>
|
25
|
+
</v-list-item>
|
27
26
|
</template>
|
28
27
|
</VcsSelect>
|
29
28
|
</v-col>
|
@@ -56,14 +55,14 @@
|
|
56
55
|
</VcsButton>
|
57
56
|
</div>
|
58
57
|
<VcsStrokeMenu
|
59
|
-
v-model="
|
58
|
+
v-model="localValue.stroke"
|
60
59
|
:value-default="valueDefault.stroke"
|
61
|
-
:disabled="!
|
60
|
+
:disabled="!localValue"
|
62
61
|
/>
|
63
62
|
<VcsFillMenu
|
64
|
-
v-model="
|
63
|
+
v-model="localValue.fill"
|
65
64
|
:value-default="valueDefault.fill"
|
66
|
-
:disabled="!
|
65
|
+
:disabled="!localValue"
|
67
66
|
/>
|
68
67
|
<v-row no-gutters>
|
69
68
|
<v-col cols="6">
|
@@ -73,7 +72,7 @@
|
|
73
72
|
<VcsTextField
|
74
73
|
:hide-spin-buttons="true"
|
75
74
|
type="number"
|
76
|
-
v-model.number="
|
75
|
+
v-model.number="localValue.offsetX"
|
77
76
|
tooltip-position="top"
|
78
77
|
prefix="X"
|
79
78
|
unit="px"
|
@@ -84,7 +83,7 @@
|
|
84
83
|
<VcsTextField
|
85
84
|
:hide-spin-buttons="true"
|
86
85
|
type="number"
|
87
|
-
v-model.number="
|
86
|
+
v-model.number="localValue.offsetY"
|
88
87
|
tooltip-position="top"
|
89
88
|
prefix="Y"
|
90
89
|
unit="px"
|
@@ -98,14 +97,20 @@
|
|
98
97
|
|
99
98
|
<script>
|
100
99
|
import { computed } from 'vue';
|
101
|
-
import {
|
100
|
+
import {
|
101
|
+
VSheet,
|
102
|
+
VContainer,
|
103
|
+
VRow,
|
104
|
+
VCol,
|
105
|
+
VListItem,
|
106
|
+
} from 'vuetify/components';
|
102
107
|
import VcsLabel from '../form-inputs-controls/VcsLabel.vue';
|
103
108
|
import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
|
104
109
|
import VcsSelect from '../form-inputs-controls/VcsSelect.vue';
|
105
110
|
import VcsButton from '../buttons/VcsButton.vue';
|
106
111
|
import VcsFillMenu from './VcsFillMenu.vue';
|
107
112
|
import VcsStrokeMenu from './VcsStrokeMenu.vue';
|
108
|
-
import {
|
113
|
+
import { useProxiedComplexModel } from '../modelHelper.js';
|
109
114
|
|
110
115
|
export const fonts = {
|
111
116
|
Georgia: 'Georgia, serif',
|
@@ -122,7 +127,7 @@
|
|
122
127
|
|
123
128
|
/**
|
124
129
|
* @description Allows to model a JSON representation of ol/style/Text style. It makes use of VcsStrokeMenu and VcsFillMenu.
|
125
|
-
* @vue-prop {import("ol/style/Text").Options}
|
130
|
+
* @vue-prop {import("ol/style/Text").Options} modelValue - The ol Text style options
|
126
131
|
* @vue-prop {import("ol/style/Text").Options} valueDefault - The default ol Text style options
|
127
132
|
*/
|
128
133
|
export default {
|
@@ -132,6 +137,7 @@
|
|
132
137
|
VContainer,
|
133
138
|
VRow,
|
134
139
|
VCol,
|
140
|
+
VListItem,
|
135
141
|
VcsSelect,
|
136
142
|
VcsTextField,
|
137
143
|
VcsButton,
|
@@ -146,51 +152,49 @@
|
|
146
152
|
},
|
147
153
|
valueDefault: {
|
148
154
|
type: Object,
|
149
|
-
|
155
|
+
default: undefined,
|
150
156
|
},
|
151
157
|
},
|
152
158
|
setup(props, { emit }) {
|
153
|
-
const
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
159
|
+
const localValue = useProxiedComplexModel(props, 'modelValue', emit);
|
160
|
+
const font = computed(() => {
|
161
|
+
if (localValue.value) {
|
162
|
+
const el = document.createElement('span');
|
163
|
+
el.setAttribute('style', `font: ${localValue.value.font}`);
|
164
|
+
const { fontStyle, fontWeight, fontSize, fontFamily } = el.style;
|
165
|
+
el.remove();
|
166
|
+
return {
|
167
|
+
fontStyle,
|
168
|
+
fontWeight,
|
169
|
+
fontSize,
|
170
|
+
fontFamily,
|
158
171
|
};
|
159
|
-
|
160
|
-
|
161
|
-
el.setAttribute('style', `font: ${props.modelValue.font}`);
|
162
|
-
fontStyle = el.style;
|
163
|
-
el.remove();
|
164
|
-
}
|
165
|
-
return fontStyle;
|
166
|
-
},
|
172
|
+
}
|
173
|
+
return {};
|
167
174
|
});
|
168
175
|
|
169
|
-
function
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
font.value.fontStyle,
|
174
|
-
font.value.fontWeight,
|
175
|
-
font.value.fontSize,
|
176
|
-
font.value.fontFamily,
|
177
|
-
];
|
178
|
-
emit(
|
179
|
-
'update:modelValue',
|
180
|
-
Object.assign(newModelObject, {
|
181
|
-
font: fontPropertyArray
|
182
|
-
.filter((prop) => prop && prop !== 'normal')
|
183
|
-
.join(' '),
|
184
|
-
}),
|
185
|
-
);
|
176
|
+
function setNewFont(fontPropertyArray) {
|
177
|
+
localValue.value.font = fontPropertyArray
|
178
|
+
.filter((prop) => prop && prop !== 'normal')
|
179
|
+
.join(' ');
|
186
180
|
}
|
187
181
|
|
182
|
+
const fontItems = Object.keys(fonts).map((key) => ({
|
183
|
+
title: key,
|
184
|
+
value: fonts[key],
|
185
|
+
}));
|
186
|
+
|
188
187
|
const fontFamily = computed({
|
189
188
|
get() {
|
190
189
|
return font.value.fontFamily;
|
191
190
|
},
|
192
191
|
set(newFamily) {
|
193
|
-
|
192
|
+
setNewFont([
|
193
|
+
font.value.fontStyle,
|
194
|
+
font.value.fontWeight,
|
195
|
+
font.value.fontSize,
|
196
|
+
newFamily,
|
197
|
+
]);
|
194
198
|
},
|
195
199
|
});
|
196
200
|
|
@@ -202,7 +206,12 @@
|
|
202
206
|
if (!newSize || newSize < 1) {
|
203
207
|
return;
|
204
208
|
}
|
205
|
-
|
209
|
+
setNewFont([
|
210
|
+
font.value.fontStyle,
|
211
|
+
font.value.fontWeight,
|
212
|
+
`${newSize}px`,
|
213
|
+
font.value.fontFamily,
|
214
|
+
]);
|
206
215
|
},
|
207
216
|
});
|
208
217
|
|
@@ -211,7 +220,12 @@
|
|
211
220
|
return font.value.fontWeight === 'bold';
|
212
221
|
},
|
213
222
|
set(newValue) {
|
214
|
-
|
223
|
+
setNewFont([
|
224
|
+
font.value.fontStyle,
|
225
|
+
newValue ? 'bold' : 'normal',
|
226
|
+
font.value.fontSize,
|
227
|
+
font.value.fontFamily,
|
228
|
+
]);
|
215
229
|
},
|
216
230
|
});
|
217
231
|
const isItalic = computed({
|
@@ -219,53 +233,23 @@
|
|
219
233
|
return font.value.fontStyle === 'italic';
|
220
234
|
},
|
221
235
|
set(newValue) {
|
222
|
-
|
236
|
+
setNewFont([
|
237
|
+
newValue ? 'italic' : 'normal',
|
238
|
+
font.value.fontWeight,
|
239
|
+
font.value.fontSize,
|
240
|
+
font.value.fontFamily,
|
241
|
+
]);
|
223
242
|
},
|
224
243
|
});
|
225
244
|
|
226
|
-
const selectedFill = useSelectedKey(
|
227
|
-
() => props.modelValue,
|
228
|
-
'fill',
|
229
|
-
props.valueDefault.fill,
|
230
|
-
emit,
|
231
|
-
);
|
232
|
-
const selectedStroke = useSelectedKey(
|
233
|
-
() => props.modelValue,
|
234
|
-
'stroke',
|
235
|
-
props.valueDefault.stroke,
|
236
|
-
emit,
|
237
|
-
);
|
238
|
-
const selectedOffsetX = useSelectedKey(
|
239
|
-
() => props.modelValue,
|
240
|
-
'offsetX',
|
241
|
-
props.valueDefault.offsetX,
|
242
|
-
emit,
|
243
|
-
);
|
244
|
-
const selectedOffsetY = useSelectedKey(
|
245
|
-
() => props.modelValue,
|
246
|
-
'offsetY',
|
247
|
-
props.valueDefault.offsetY,
|
248
|
-
emit,
|
249
|
-
);
|
250
|
-
const selectedText = useSelectedKey(
|
251
|
-
() => props.modelValue,
|
252
|
-
'text',
|
253
|
-
props.valueDefault.text,
|
254
|
-
emit,
|
255
|
-
);
|
256
245
|
return {
|
257
|
-
|
246
|
+
localValue,
|
247
|
+
fontItems,
|
258
248
|
font,
|
259
249
|
fontFamily,
|
260
250
|
fontSize,
|
261
|
-
selectedFill,
|
262
|
-
selectedStroke,
|
263
|
-
emitNewFont,
|
264
251
|
isBold,
|
265
252
|
isItalic,
|
266
|
-
selectedOffsetX,
|
267
|
-
selectedOffsetY,
|
268
|
-
selectedText,
|
269
253
|
};
|
270
254
|
},
|
271
255
|
};
|
@@ -17,32 +17,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
17
17
|
};
|
18
18
|
valueDefault: {
|
19
19
|
type: ObjectConstructor;
|
20
|
-
|
20
|
+
default: undefined;
|
21
21
|
};
|
22
22
|
}, {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
23
|
+
localValue: import("vue").Ref<any>;
|
24
|
+
fontItems: {
|
25
|
+
title: string;
|
26
|
+
value: any;
|
27
|
+
}[];
|
28
|
+
font: import("vue").ComputedRef<{
|
29
|
+
fontStyle: string;
|
30
|
+
fontWeight: string;
|
31
|
+
fontSize: string;
|
32
|
+
fontFamily: string;
|
33
|
+
} | {
|
34
|
+
fontStyle?: undefined;
|
35
|
+
fontWeight?: undefined;
|
36
|
+
fontSize?: undefined;
|
37
|
+
fontFamily?: undefined;
|
38
|
+
}>;
|
39
|
+
fontFamily: import("vue").WritableComputedRef<string | undefined>;
|
37
40
|
fontSize: import("vue").WritableComputedRef<number>;
|
38
|
-
selectedFill: import("vue").WritableComputedRef<unknown>;
|
39
|
-
selectedStroke: import("vue").WritableComputedRef<unknown>;
|
40
|
-
emitNewFont: (key: any, value: any) => void;
|
41
41
|
isBold: import("vue").WritableComputedRef<boolean>;
|
42
42
|
isItalic: import("vue").WritableComputedRef<boolean>;
|
43
|
-
selectedOffsetX: import("vue").WritableComputedRef<unknown>;
|
44
|
-
selectedOffsetY: import("vue").WritableComputedRef<unknown>;
|
45
|
-
selectedText: import("vue").WritableComputedRef<unknown>;
|
46
43
|
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
47
44
|
modelValue: {
|
48
45
|
type: ObjectConstructor;
|
@@ -50,9 +47,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
50
47
|
};
|
51
48
|
valueDefault: {
|
52
49
|
type: ObjectConstructor;
|
53
|
-
|
50
|
+
default: undefined;
|
54
51
|
};
|
55
52
|
}>>, {
|
56
53
|
modelValue: Record<string, any>;
|
54
|
+
valueDefault: Record<string, any>;
|
57
55
|
}, {}>;
|
58
56
|
export default _default;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:key="key"
|
6
6
|
:is="componentMap[key]"
|
7
7
|
:value-default="valueDefault[key]"
|
8
|
-
v-model="
|
8
|
+
v-model="localValue[key]"
|
9
9
|
@update:model-value="(v) => $emit(`update:${key}`, v)"
|
10
10
|
v-bind="specificProps[key]"
|
11
11
|
/>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
import VcsImageMenu from './VcsImageMenu.vue';
|
20
20
|
import VcsStrokeMenu from './VcsStrokeMenu.vue';
|
21
21
|
import VcsTextMenu from './VcsTextMenu.vue';
|
22
|
-
import {
|
22
|
+
import { useProxiedComplexModel } from '../modelHelper.js';
|
23
23
|
|
24
24
|
/**
|
25
25
|
* @enum {string}
|
@@ -44,9 +44,9 @@
|
|
44
44
|
|
45
45
|
/**
|
46
46
|
* @description Wraps the style component into a single component so whole @vcmap/core/VectorStyleItemOptions can be modelled.
|
47
|
-
* @vue-prop {import("@vcmap/core").VectorStyleItemOptions}
|
48
|
-
* @vue-prop {import("@vcmap/core").VectorStyleItemOptions} valueDefault - The default VectorStyleItemOptions.
|
49
|
-
* @vue-prop {VectorStyleMenus[]} styleComponents - The style component that should be rendered.
|
47
|
+
* @vue-prop {import("@vcmap/core").VectorStyleItemOptions} [modelValue] - The VectorStyleItemOptions that should be modelled.
|
48
|
+
* @vue-prop {import("@vcmap/core").VectorStyleItemOptions} [valueDefault] - The default VectorStyleItemOptions.
|
49
|
+
* @vue-prop {VectorStyleMenus[]} [styleComponents] - The style component that should be rendered.
|
50
50
|
* @vue-prop {boolean} [extendedShapeSettings=false] - If true, there are all the input fields needed to create arbitrary ol RegularShapes.
|
51
51
|
* @vue-prop {Array<import("ol/style/Icon").Options>} [iconOptions] - The icon options in the image component too choose from. Scale and opacity are ignored. The defaults are 3 different icon types with 4 different colors.
|
52
52
|
*/
|
@@ -86,18 +86,7 @@
|
|
86
86
|
},
|
87
87
|
},
|
88
88
|
setup(props, { emit }) {
|
89
|
-
const
|
90
|
-
// convert to Object with style prop names as keys and computed props as value to allow v-model.
|
91
|
-
props.styleComponents.reduce((acc, key) => {
|
92
|
-
acc[key] = useSelectedKey(
|
93
|
-
() => props.modelValue,
|
94
|
-
key,
|
95
|
-
props.valueDefault[key],
|
96
|
-
emit,
|
97
|
-
);
|
98
|
-
return acc;
|
99
|
-
}, {}),
|
100
|
-
);
|
89
|
+
const localValue = useProxiedComplexModel(props, 'modelValue', emit);
|
101
90
|
const specificProps = computed(() => ({
|
102
91
|
[VectorStyleMenus.IMAGE]: {
|
103
92
|
extendedShapeSettings: props.extendedShapeSettings,
|
@@ -105,7 +94,7 @@
|
|
105
94
|
},
|
106
95
|
}));
|
107
96
|
return {
|
108
|
-
|
97
|
+
localValue,
|
109
98
|
specificProps,
|
110
99
|
componentMap,
|
111
100
|
};
|
@@ -31,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
31
31
|
default: undefined;
|
32
32
|
};
|
33
33
|
}, {
|
34
|
-
|
34
|
+
localValue: import("vue").Ref<any>;
|
35
35
|
specificProps: import("vue").ComputedRef<{
|
36
36
|
[x: string]: {
|
37
37
|
extendedShapeSettings: boolean;
|
@@ -16,20 +16,6 @@ export function useColorObject(colorGetter: () => Array<number>): import("vue").
|
|
16
16
|
* @returns {boolean} If value is between min and max.
|
17
17
|
*/
|
18
18
|
export function between(value: number, range: number[]): boolean;
|
19
|
-
/**
|
20
|
-
* Creates a computed property with a getter and a setter for a specific object property/key of the value prop. If the value prop is an object, this composable allows to pass this computed to an v-model of a sub component. The getter returns the value of the key or, if it is undefined, a default value. The setter merges the passed value with the other object properties of the value prop and emits the whole object as a input event.
|
21
|
-
* @param {function():T} modelObject Getter for the property that is modelled by the component and should be updated with input event, usually this is the 'value' prop.
|
22
|
-
* @param {K} key The key of the modelObject that should be return on get and updated on set.
|
23
|
-
* @param {U} defaultValue Default value for the key of the modelObject.
|
24
|
-
* @param {function(string, ...unknown[]):void} emit The emit function of the component context that is using this composable.
|
25
|
-
* @param {Array<number>} [range] The allowed range of numbers.
|
26
|
-
* @param {boolean} [isRequired] If value is required.
|
27
|
-
* @returns {import("vue").WritableComputedRef<T[K]>} The value to the key param if the getter is called.
|
28
|
-
* @template {Object} T
|
29
|
-
* @template {string} K
|
30
|
-
* @template U
|
31
|
-
*/
|
32
|
-
export function useSelectedKey<T extends Object, K extends string, U>(modelObject: () => T, key: K, defaultValue: U, emit: (arg0: string, ...args: unknown[][]) => void, range?: number[] | undefined, isRequired?: boolean | undefined): import("vue").WritableComputedRef<T[K]>;
|
33
19
|
/**
|
34
20
|
* Creates a string from a color object.
|
35
21
|
* @param {{r: number, g: number, b: number, a: number}} rgbaObject An object with rgba keys.
|
@@ -31,55 +31,6 @@ export function between(value, range) {
|
|
31
31
|
return value >= range[0] && value <= range[1];
|
32
32
|
}
|
33
33
|
|
34
|
-
/**
|
35
|
-
* Creates a computed property with a getter and a setter for a specific object property/key of the value prop. If the value prop is an object, this composable allows to pass this computed to an v-model of a sub component. The getter returns the value of the key or, if it is undefined, a default value. The setter merges the passed value with the other object properties of the value prop and emits the whole object as a input event.
|
36
|
-
* @param {function():T} modelObject Getter for the property that is modelled by the component and should be updated with input event, usually this is the 'value' prop.
|
37
|
-
* @param {K} key The key of the modelObject that should be return on get and updated on set.
|
38
|
-
* @param {U} defaultValue Default value for the key of the modelObject.
|
39
|
-
* @param {function(string, ...unknown[]):void} emit The emit function of the component context that is using this composable.
|
40
|
-
* @param {Array<number>} [range] The allowed range of numbers.
|
41
|
-
* @param {boolean} [isRequired] If value is required.
|
42
|
-
* @returns {import("vue").WritableComputedRef<T[K]>} The value to the key param if the getter is called.
|
43
|
-
* @template {Object} T
|
44
|
-
* @template {string} K
|
45
|
-
* @template U
|
46
|
-
*/
|
47
|
-
export function useSelectedKey(
|
48
|
-
modelObject,
|
49
|
-
key,
|
50
|
-
defaultValue,
|
51
|
-
emit,
|
52
|
-
range,
|
53
|
-
isRequired,
|
54
|
-
) {
|
55
|
-
return computed({
|
56
|
-
get() {
|
57
|
-
if (modelObject()?.[key] === undefined && isRequired) {
|
58
|
-
return defaultValue;
|
59
|
-
}
|
60
|
-
return modelObject()?.[key];
|
61
|
-
},
|
62
|
-
set(value) {
|
63
|
-
if (
|
64
|
-
((value === null || value === undefined) && isRequired) ||
|
65
|
-
(value !== null &&
|
66
|
-
value !== undefined &&
|
67
|
-
range &&
|
68
|
-
!between(value, range))
|
69
|
-
) {
|
70
|
-
return;
|
71
|
-
}
|
72
|
-
const newModelObject = structuredClone(modelObject());
|
73
|
-
// is needed to get e.g. from square shape to x by setting radius2 from 0 to undefined
|
74
|
-
const newValue = value === '' ? undefined : value;
|
75
|
-
emit(
|
76
|
-
'update:modelValue',
|
77
|
-
Object.assign(newModelObject, { [key]: newValue }),
|
78
|
-
);
|
79
|
-
},
|
80
|
-
});
|
81
|
-
}
|
82
|
-
|
83
34
|
/**
|
84
35
|
* Creates a string from a color object.
|
85
36
|
* @param {{r: number, g: number, b: number, a: number}} rgbaObject An object with rgba keys.
|