@vcmap/ui 6.0.0-rc.5 → 6.0.0-rc.6
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/buildTypes.js +9 -5
- package/config/base.config.json +0 -6
- package/config/dev.config.json +4 -0
- package/config/projects.config.json +2 -1
- package/config/theming.config.json +68 -0
- package/config/www.config.json +31 -30
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-1c8b8674.js → core-e06aa7a6.js} +1403 -1375
- package/dist/assets/core.js +1 -1
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-5dda32d2.css +1 -0
- package/dist/assets/{ui-7214428e.js → ui-5dda32d2.js} +11632 -11501
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-88a2fabe.css → vuetify-4c4e4217.css} +1 -1
- package/dist/assets/{vuetify-88a2fabe.js → vuetify-4c4e4217.js} +2375 -2369
- package/dist/assets/vuetify.js +1 -1
- package/index.d.ts +22 -10
- package/index.js +9 -3
- package/package.json +3 -3
- package/plugins/@vcmap-show-case/custom-icons-example/README.md +3 -0
- package/plugins/@vcmap-show-case/custom-icons-example/assets/imageExample.png +0 -0
- package/plugins/@vcmap-show-case/custom-icons-example/assets/svgExample.svg +1 -0
- package/plugins/@vcmap-show-case/custom-icons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/custom-icons-example/src/CustomIconsExample.vue +90 -0
- package/plugins/@vcmap-show-case/custom-icons-example/src/index.js +45 -0
- package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +11 -7
- package/plugins/@vcmap-show-case/theming-example/README.md +3 -0
- package/plugins/@vcmap-show-case/theming-example/package.json +5 -0
- package/plugins/@vcmap-show-case/theming-example/src/ThemingExample.vue +116 -0
- package/plugins/@vcmap-show-case/theming-example/src/index.js +53 -0
- package/plugins/package.json +5 -1
- package/src/actions/actionHelper.d.ts +4 -11
- package/src/actions/actionHelper.js +2 -5
- package/src/actions/listActions.d.ts +2 -2
- package/src/application/VcsApp.vue +17 -19
- package/src/application/VcsApp.vue.d.ts +5 -1
- package/src/application/VcsAttributionsFooter.vue.d.ts +1 -1
- package/src/application/VcsContainer.vue +2 -2
- package/src/application/VcsContainer.vue.d.ts +5 -1
- package/src/application/VcsNavbar.vue +9 -1
- package/src/application/VcsNavbar.vue.d.ts +1 -0
- package/src/application/VcsSplashScreen.vue +11 -2
- package/src/application/attributionsHelper.d.ts +20 -22
- package/src/application/attributionsHelper.js +4 -4
- package/src/callback/vcsCallback.d.ts +2 -2
- package/src/callback/vcsCallback.js +1 -1
- package/src/components/buttons/VcsActionButtonList.vue +2 -3
- package/src/components/buttons/VcsButton.vue +2 -4
- package/src/components/buttons/VcsButton.vue.d.ts +1 -1
- package/src/components/buttons/VcsFormButton.vue +4 -4
- package/src/components/buttons/VcsToolButton.vue +4 -2
- package/src/components/buttons/VcsToolButton.vue.d.ts +2 -2
- package/src/components/composables.d.ts +5 -0
- package/src/components/composables.js +79 -9
- package/src/components/extent/VcsExtent.vue +10 -6
- package/src/components/extent/VcsExtent.vue.d.ts +1 -0
- package/src/components/flight/VcsFlightComponent.vue +13 -13
- package/src/components/flight/VcsFlightComponent.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +8 -3
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +3 -8
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +0 -1
- package/src/components/form-inputs-controls/VcsCoordinate.vue +1 -2
- package/src/components/form-inputs-controls/VcsFileInput.vue +1 -1
- package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +8 -6
- package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +1 -1
- package/src/components/form-inputs-controls/VcsSlider.vue +5 -5
- package/src/components/form-inputs-controls/VcsTextArea.vue +1 -1
- package/src/components/form-inputs-controls/VcsTextField.vue +10 -1
- package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +2 -1
- package/src/components/form-inputs-controls/VcsWizard.vue +3 -3
- package/src/components/form-inputs-controls/VcsWizardStep.vue +5 -1
- package/src/components/form-inputs-controls/vcsTextField.scss +7 -1
- package/src/components/form-output/VcsFormattedNumber.vue +1 -1
- package/src/components/import/VcsImportComponent.vue +7 -4
- package/src/components/import/VcsImportComponent.vue.d.ts +1 -1
- package/src/components/lists/VcsActionList.vue +2 -6
- package/src/components/lists/VcsListItemComponent.vue +20 -10
- package/src/components/lists/VcsListItemComponent.vue.d.ts +11 -1
- package/src/components/lists/VcsTreeview.vue +53 -11
- package/src/components/lists/VcsTreeview.vue.d.ts +2 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +14 -3
- package/src/components/lists/VcsTreeviewSearchbar.vue.d.ts +3 -1
- package/src/components/lists/VcsTreeviewTitle.vue +36 -0
- package/src/components/modelHelper.d.ts +10 -8
- package/src/components/modelHelper.js +8 -6
- package/src/components/notification/VcsHelp.vue +6 -7
- package/src/components/notification/VcsHelp.vue.d.ts +0 -9
- package/src/components/plugins/AbstractConfigEditor.vue +1 -22
- package/src/components/plugins/AbstractConfigEditor.vue.d.ts +6 -29
- package/src/components/section/VcsExpansionPanel.vue +9 -3
- package/src/components/section/VcsExpansionPanel.vue.d.ts +2 -2
- package/src/components/section/VcsFormSection.vue +6 -6
- package/src/components/section/VcsFormSection.vue.d.ts +2 -2
- package/src/components/style/VcsImageSelector.vue +14 -6
- package/src/components/style/VcsImageSelector.vue.d.ts +1 -0
- package/src/components/style/VcsStrokeSelector.vue +5 -2
- package/src/components/style/VcsStrokeSelector.vue.d.ts +1 -0
- package/src/components/style/VcsTextMenu.vue +2 -2
- package/src/components/tables/VcsDataTable.vue +14 -10
- package/src/components/tables/VcsDataTable.vue.d.ts +1 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +42 -31
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +1 -0
- package/src/components/viewpoint/VcsViewpointComponent.vue +12 -9
- package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +1 -0
- package/src/contentTree/contentTreeItem.d.ts +2 -2
- package/src/contentTree/contentTreeItem.js +1 -1
- package/src/featureInfo/BalloonComponent.vue +21 -13
- package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
- package/src/featureInfo/abstractFeatureInfoView.d.ts +4 -4
- package/src/featureInfo/abstractFeatureInfoView.js +4 -4
- package/src/featureInfo/featureInfo.d.ts +2 -2
- package/src/featureInfo/featureInfo.js +1 -1
- package/src/i18n/i18nCollection.d.ts +9 -15
- package/src/i18n/i18nCollection.js +3 -3
- package/src/legend/VcsLegend.vue +6 -2
- package/src/legend/VcsLegend.vue.d.ts +1 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +1 -1
- package/src/manager/collectionManager/categoryManager.d.ts +1 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +2 -2
- package/src/manager/collectionManager/collectionComponentClass.js +4 -4
- package/src/manager/collectionManager/collectionManager.d.ts +1 -1
- package/src/manager/toolbox/GroupToolboxComponent.vue +8 -6
- package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -1
- package/src/manager/toolbox/SelectToolboxComponent.vue +8 -6
- package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -1
- package/src/manager/toolbox/{ToolboxManager.vue → ToolboxManagerComponent.vue} +8 -5
- package/src/manager/toolbox/{ToolboxManager.vue.d.ts → ToolboxManagerComponent.vue.d.ts} +1 -1
- package/src/manager/window/WindowComponentHeader.vue +6 -3
- package/src/manager/window/WindowComponentHeader.vue.d.ts +1 -0
- package/src/manager/window/windowManager.d.ts +6 -6
- package/src/manager/window/windowManager.js +3 -3
- package/src/navigation/OrientationToolsButton.vue +2 -4
- package/src/navigation/TiltSlider.vue +3 -5
- package/src/search/SearchComponent.vue +8 -6
- package/src/search/SearchComponent.vue.d.ts +1 -1
- package/src/styles/vcsList.scss +1 -1
- package/src/uiConfig.d.ts +12 -3
- package/src/uiConfig.js +2 -1
- package/src/vcsUiApp.d.ts +41 -56
- package/src/vcsUiApp.js +34 -28
- package/src/vuePlugins/vuetify.d.ts +88 -62
- package/src/vuePlugins/vuetify.js +116 -20
- package/dist/assets/ui-7214428e.css +0 -1
- package/plugins/@vcmap-show-case/theme-changer/README.md +0 -23
- package/plugins/@vcmap-show-case/theme-changer/config.json +0 -69
- package/plugins/@vcmap-show-case/theme-changer/package.json +0 -11
- package/plugins/@vcmap-show-case/theme-changer/src/ThemeChangerComponent.vue +0 -120
- package/plugins/@vcmap-show-case/theme-changer/src/index.js +0 -108
- package/src/components/lists/VcsTreeviewLeaf.vue +0 -92
- /package/dist/assets/{cesium-126f111a.js → cesium-ccb4cc30.js} +0 -0
- /package/dist/assets/{ol-27f9b3f3.js → ol-e7981d5c.js} +0 -0
- /package/dist/assets/{vue-c78a5f76.js → vue-87bc6efe.js} +0 -0
- /package/src/components/lists/{VcsTreeviewLeaf.vue.d.ts → VcsTreeviewTitle.vue.d.ts} +0 -0
@@ -63,7 +63,11 @@
|
|
63
63
|
import VcsSettings from './VcsSettings.vue';
|
64
64
|
import { WindowSlot } from '../manager/window/windowManager.js';
|
65
65
|
import CollectionManager from '../manager/collectionManager/CollectionManager.vue';
|
66
|
-
import {
|
66
|
+
import {
|
67
|
+
createVcsThemes,
|
68
|
+
setTheme,
|
69
|
+
useFontSize,
|
70
|
+
} from '../vuePlugins/vuetify.js';
|
67
71
|
import VcsLegend from '../legend/VcsLegend.vue';
|
68
72
|
import { getLegendEntries } from '../legend/legendHelper.js';
|
69
73
|
import VcsAttributionsFooter from './VcsAttributionsFooter.vue';
|
@@ -590,25 +594,19 @@
|
|
590
594
|
* @returns {function():void} - call to stop syncing
|
591
595
|
*/
|
592
596
|
export function setupUiConfigTheming(app) {
|
597
|
+
function updateTheme(item) {
|
598
|
+
if (item.name === 'primaryColor' || item.name === 'vuetifyTheme') {
|
599
|
+
const mergedThemes = createVcsThemes(
|
600
|
+
app.uiConfig.getByKey('vuetifyTheme')?.value,
|
601
|
+
app.uiConfig.getByKey('primaryColor')?.value,
|
602
|
+
);
|
603
|
+
setTheme(app.vuetify, mergedThemes);
|
604
|
+
app.themeChanged.raiseEvent();
|
605
|
+
}
|
606
|
+
}
|
593
607
|
const listeners = [
|
594
|
-
app.uiConfig.added.addEventListener(
|
595
|
-
|
596
|
-
app.vuetify.theme.themes.value.dark.colors.primary =
|
597
|
-
item.value?.dark || item.value;
|
598
|
-
app.vuetify.theme.themes.value.light.colors.primary =
|
599
|
-
item.value?.light || item.value;
|
600
|
-
app.themeChanged.raiseEvent();
|
601
|
-
}
|
602
|
-
}),
|
603
|
-
app.uiConfig.removed.addEventListener((item) => {
|
604
|
-
if (item.name === 'primaryColor') {
|
605
|
-
app.vuetify.theme.themes.value.dark.colors.primary =
|
606
|
-
defaultPrimaryColor.dark;
|
607
|
-
app.vuetify.theme.themes.value.light.colors.primary =
|
608
|
-
defaultPrimaryColor.light;
|
609
|
-
app.themeChanged.raiseEvent();
|
610
|
-
}
|
611
|
-
}),
|
608
|
+
app.uiConfig.added.addEventListener(updateTheme),
|
609
|
+
app.uiConfig.removed.addEventListener(updateTheme),
|
612
610
|
];
|
613
611
|
const stopWatching = watch(
|
614
612
|
() => app.vuetify.theme.current.value.dark,
|
@@ -99,7 +99,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
99
99
|
*/
|
100
100
|
readonly appTitle?: string | undefined;
|
101
101
|
/**
|
102
|
-
* - an optional primary color to use in all themes
|
102
|
+
* - an optional primary color to use in all themes, can be overwritten by `vuetifyTheme`
|
103
103
|
*/
|
104
104
|
readonly primaryColor?: string | undefined;
|
105
105
|
/**
|
@@ -320,6 +320,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
320
320
|
readonly layerSSEFactor?: number | undefined;
|
321
321
|
} | undefined;
|
322
322
|
} | undefined;
|
323
|
+
/**
|
324
|
+
* - Vuetify Theming, also see vuetify configuration https://vuetifyjs.com/en/features/theme/
|
325
|
+
*/
|
326
|
+
readonly vuetifyTheme?: any;
|
323
327
|
};
|
324
328
|
showFooter: import("vue").ComputedRef<boolean>;
|
325
329
|
footerHeight: import("vue").ComputedRef<number>;
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
11
11
|
mergedAttributions: import("vue").ComputedRef<{
|
12
12
|
provider: string;
|
13
13
|
years: string;
|
14
|
-
url:
|
14
|
+
url: string;
|
15
15
|
}[]>;
|
16
16
|
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
17
17
|
entries: {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
top: 0px;
|
42
42
|
}
|
43
43
|
.with-header {
|
44
|
-
top:
|
44
|
+
top: calc(var(--v-vcs-font-size) * 3 + 9px);
|
45
45
|
}
|
46
46
|
.vcs-container {
|
47
47
|
position: absolute;
|
@@ -87,7 +87,7 @@
|
|
87
87
|
import { VContainer } from 'vuetify/components';
|
88
88
|
import PanelManagerComponent from '../manager/panel/PanelManagerComponent.vue';
|
89
89
|
import WindowManagerComponent from '../manager/window/WindowManager.vue';
|
90
|
-
import ToolboxManagerComponent from '../manager/toolbox/
|
90
|
+
import ToolboxManagerComponent from '../manager/toolbox/ToolboxManagerComponent.vue';
|
91
91
|
import NotifierComponent from '../notifier/NotifierComponent.vue';
|
92
92
|
import VcsDefaultLogoMobile from '../logo-mobile.svg';
|
93
93
|
|
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
19
19
|
*/
|
20
20
|
readonly appTitle?: string | undefined;
|
21
21
|
/**
|
22
|
-
* - an optional primary color to use in all themes
|
22
|
+
* - an optional primary color to use in all themes, can be overwritten by `vuetifyTheme`
|
23
23
|
*/
|
24
24
|
readonly primaryColor?: string | undefined;
|
25
25
|
/**
|
@@ -240,6 +240,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
240
240
|
readonly layerSSEFactor?: number | undefined;
|
241
241
|
} | undefined;
|
242
242
|
} | undefined;
|
243
|
+
/**
|
244
|
+
* - Vuetify Theming, also see vuetify configuration https://vuetifyjs.com/en/features/theme/
|
245
|
+
*/
|
246
|
+
readonly vuetifyTheme?: any;
|
243
247
|
};
|
244
248
|
xs: import("vue").Ref<boolean>;
|
245
249
|
mobileLogo: import("vue").ComputedRef<any>;
|
@@ -4,6 +4,7 @@
|
|
4
4
|
:density="density"
|
5
5
|
elevation="0"
|
6
6
|
class="px-4"
|
7
|
+
:height="toolbarHeight"
|
7
8
|
:style="xs ? { bottom: 0 } : { top: 0 }"
|
8
9
|
>
|
9
10
|
<v-container fluid class="pa-0">
|
@@ -124,7 +125,7 @@
|
|
124
125
|
|
125
126
|
<style lang="scss" scoped>
|
126
127
|
.logo {
|
127
|
-
max-height:
|
128
|
+
max-height: calc(var(--v-vcs-font-size) * 3 - 3px);
|
128
129
|
margin: 0 auto;
|
129
130
|
}
|
130
131
|
.v-toolbar.v-toolbar--bottom {
|
@@ -154,6 +155,7 @@
|
|
154
155
|
import VcsToolButton from '../components/buttons/VcsToolButton.vue';
|
155
156
|
import { createSearchButtonAction } from '../actions/actionHelper.js';
|
156
157
|
import VcsDefaultLogo from '../logo.svg';
|
158
|
+
import { useFontSize } from '../vuePlugins/vuetify.js';
|
157
159
|
|
158
160
|
/**
|
159
161
|
* @description The menu bar of a VcsMap application.
|
@@ -206,6 +208,11 @@
|
|
206
208
|
return xs.value ? 'comfortable' : 'compact';
|
207
209
|
});
|
208
210
|
|
211
|
+
const fontSize = useFontSize();
|
212
|
+
const toolbarHeight = computed(() => {
|
213
|
+
return fontSize.value * 3 + 8 + 16;
|
214
|
+
});
|
215
|
+
|
209
216
|
return {
|
210
217
|
mapActions: getActions(ButtonLocation.MAP),
|
211
218
|
contentActions: getActions(ButtonLocation.CONTENT),
|
@@ -219,6 +226,7 @@
|
|
219
226
|
xs,
|
220
227
|
density,
|
221
228
|
mdAndUp,
|
229
|
+
toolbarHeight,
|
222
230
|
};
|
223
231
|
},
|
224
232
|
};
|
@@ -44,5 +44,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
44
44
|
xs: import("vue").Ref<boolean>;
|
45
45
|
density: import("vue").ComputedRef<"compact" | "comfortable">;
|
46
46
|
mdAndUp: import("vue").Ref<boolean>;
|
47
|
+
toolbarHeight: import("vue").ComputedRef<number>;
|
47
48
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
48
49
|
export default _default;
|
@@ -14,7 +14,12 @@
|
|
14
14
|
<VcsCheckbox v-if="options.acceptInput" v-model="checkBox">
|
15
15
|
<template #label>
|
16
16
|
<VcsMarkdown
|
17
|
-
:content="
|
17
|
+
:content="
|
18
|
+
$st(
|
19
|
+
options.checkBoxText ||
|
20
|
+
'components.splashScreen.checkBoxText',
|
21
|
+
)
|
22
|
+
"
|
18
23
|
class="marked-checkbox-content"
|
19
24
|
/>
|
20
25
|
</template>
|
@@ -29,7 +34,11 @@
|
|
29
34
|
variant="filled"
|
30
35
|
@click="exitScreen"
|
31
36
|
:disabled="options.acceptInput && !checkBox"
|
32
|
-
>{{
|
37
|
+
>{{
|
38
|
+
$st(
|
39
|
+
options.buttonTitle || 'components.splashScreen.buttonTitle',
|
40
|
+
)
|
41
|
+
}}</VcsFormButton
|
33
42
|
>
|
34
43
|
</v-col>
|
35
44
|
</v-row>
|
@@ -1,24 +1,24 @@
|
|
1
1
|
/**
|
2
|
-
* @typedef {Object}
|
2
|
+
* @typedef {Object} AttributionOptions
|
3
3
|
* @property {string} provider - name of the data provider
|
4
4
|
* @property {number} [year] - year of dataset
|
5
|
-
* @property {
|
5
|
+
* @property {string} url - link to data provider
|
6
6
|
*/
|
7
7
|
/**
|
8
8
|
* @typedef {Object} AttributionEntry
|
9
9
|
* @property {string} key - name of the VcsObject the attribution applies to
|
10
10
|
* @property {string} title - title of the VcsObject the attribution applies to
|
11
|
-
* @property {
|
11
|
+
* @property {AttributionOptions|Array<AttributionOptions>} attributions - attributions of a map, layer or oblique collection
|
12
12
|
*/
|
13
13
|
/**
|
14
14
|
* merges attribution entries of same providers
|
15
15
|
* @param {Array<AttributionEntry>} entries
|
16
|
-
* @returns {Array<{provider: string, years: string, url:
|
16
|
+
* @returns {Array<{provider: string, years: string, url: string}>}
|
17
17
|
*/
|
18
18
|
export function mergeAttributions(entries: Array<AttributionEntry>): Array<{
|
19
19
|
provider: string;
|
20
20
|
years: string;
|
21
|
-
url:
|
21
|
+
url: string;
|
22
22
|
}>;
|
23
23
|
/**
|
24
24
|
* Gets attributions of all active maps, layers and oblique collections and returns an array of entries.
|
@@ -32,22 +32,20 @@ export function getAttributions(app: import("../vcsUiApp.js").default): {
|
|
32
32
|
entries: import("vue").UnwrapRef<Array<AttributionEntry>>;
|
33
33
|
destroy: () => void;
|
34
34
|
};
|
35
|
-
export
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
};
|
50
|
-
}
|
35
|
+
export type AttributionOptions = {
|
36
|
+
/**
|
37
|
+
* - name of the data provider
|
38
|
+
*/
|
39
|
+
provider: string;
|
40
|
+
/**
|
41
|
+
* - year of dataset
|
42
|
+
*/
|
43
|
+
year?: number | undefined;
|
44
|
+
/**
|
45
|
+
* - link to data provider
|
46
|
+
*/
|
47
|
+
url: string;
|
48
|
+
};
|
51
49
|
export type AttributionEntry = {
|
52
50
|
/**
|
53
51
|
* - name of the VcsObject the attribution applies to
|
@@ -60,5 +58,5 @@ export type AttributionEntry = {
|
|
60
58
|
/**
|
61
59
|
* - attributions of a map, layer or oblique collection
|
62
60
|
*/
|
63
|
-
attributions:
|
61
|
+
attributions: AttributionOptions | Array<AttributionOptions>;
|
64
62
|
};
|
@@ -2,23 +2,23 @@ import { reactive } from 'vue';
|
|
2
2
|
import { ObliqueMap } from '@vcmap/core';
|
3
3
|
|
4
4
|
/**
|
5
|
-
* @typedef {Object}
|
5
|
+
* @typedef {Object} AttributionOptions
|
6
6
|
* @property {string} provider - name of the data provider
|
7
7
|
* @property {number} [year] - year of dataset
|
8
|
-
* @property {
|
8
|
+
* @property {string} url - link to data provider
|
9
9
|
*/
|
10
10
|
|
11
11
|
/**
|
12
12
|
* @typedef {Object} AttributionEntry
|
13
13
|
* @property {string} key - name of the VcsObject the attribution applies to
|
14
14
|
* @property {string} title - title of the VcsObject the attribution applies to
|
15
|
-
* @property {
|
15
|
+
* @property {AttributionOptions|Array<AttributionOptions>} attributions - attributions of a map, layer or oblique collection
|
16
16
|
*/
|
17
17
|
|
18
18
|
/**
|
19
19
|
* merges attribution entries of same providers
|
20
20
|
* @param {Array<AttributionEntry>} entries
|
21
|
-
* @returns {Array<{provider: string, years: string, url:
|
21
|
+
* @returns {Array<{provider: string, years: string, url: string}>}
|
22
22
|
*/
|
23
23
|
export function mergeAttributions(entries) {
|
24
24
|
const providers = {};
|
@@ -5,9 +5,9 @@
|
|
5
5
|
*/
|
6
6
|
export function executeCallbacks(app: import("@src/vcsUiApp.js").default, vcsCallbackOptions: Array<VcsCallbackOptions>): void;
|
7
7
|
/**
|
8
|
-
* @type {ClassRegistry<
|
8
|
+
* @type {ClassRegistry<typeof VcsCallback>}
|
9
9
|
*/
|
10
|
-
export const callbackClassRegistry: ClassRegistry<
|
10
|
+
export const callbackClassRegistry: ClassRegistry<typeof VcsCallback>;
|
11
11
|
export default VcsCallback;
|
12
12
|
export type VcsCallbackOptions = {
|
13
13
|
type: string;
|
@@ -64,7 +64,7 @@
|
|
64
64
|
import { computed } from 'vue';
|
65
65
|
import { VBtn, VIcon, VTooltip } from 'vuetify/components';
|
66
66
|
import VcsBadge from '../notification/VcsBadge.vue';
|
67
|
-
import { useFontSize } from '../../vuePlugins/vuetify.js';
|
67
|
+
import { useFontSize, useIconSize } from '../../vuePlugins/vuetify.js';
|
68
68
|
import { useForwardSlots } from '../composables.js';
|
69
69
|
|
70
70
|
/**
|
@@ -132,9 +132,7 @@
|
|
132
132
|
const minHeight = computed(() => {
|
133
133
|
return fontSize.value * 1.5;
|
134
134
|
});
|
135
|
-
const iconSize =
|
136
|
-
return fontSize.value * (1.2 + 0.1 / 3);
|
137
|
-
});
|
135
|
+
const iconSize = useIconSize();
|
138
136
|
return {
|
139
137
|
forwardSlots,
|
140
138
|
hasDefaultSlot,
|
@@ -67,7 +67,7 @@
|
|
67
67
|
import { computed } from 'vue';
|
68
68
|
import { VBtn, VIcon, VTooltip } from 'vuetify/components';
|
69
69
|
import VcsBadge from '../notification/VcsBadge.vue';
|
70
|
-
import { useFontSize,
|
70
|
+
import { useFontSize, useIconSize } from '../../vuePlugins/vuetify.js';
|
71
71
|
import { useForwardSlots } from '../composables.js';
|
72
72
|
|
73
73
|
/**
|
@@ -112,7 +112,6 @@
|
|
112
112
|
},
|
113
113
|
},
|
114
114
|
setup(props, { slots }) {
|
115
|
-
const itemHeight = useItemHeight();
|
116
115
|
const buttonVariant = computed(() => {
|
117
116
|
if (props.variant === 'filled') {
|
118
117
|
return 'flat';
|
@@ -124,8 +123,9 @@
|
|
124
123
|
});
|
125
124
|
const forwardSlots = useForwardSlots(slots, ['default']);
|
126
125
|
const fontSize = useFontSize();
|
127
|
-
const iconSize =
|
128
|
-
|
126
|
+
const iconSize = useIconSize();
|
127
|
+
const itemHeight = computed(() => {
|
128
|
+
return fontSize.value * 2 + 6;
|
129
129
|
});
|
130
130
|
return {
|
131
131
|
forwardSlots,
|
@@ -70,7 +70,7 @@
|
|
70
70
|
import { VBtn, VIcon, VTooltip } from 'vuetify/components';
|
71
71
|
import VcsBadge from '../notification/VcsBadge.vue';
|
72
72
|
import { useForwardSlots } from '../composables.js';
|
73
|
-
import {
|
73
|
+
import { useFontSize } from '../../vuePlugins/vuetify.js';
|
74
74
|
|
75
75
|
/**
|
76
76
|
* @description a button with tooltip extending {@link https://vuetifyjs.com/en/api/v-btn/|vuetify v-btn} using {@link VcsTooltip}. Used for tool buttons in the Navbar.
|
@@ -149,7 +149,9 @@
|
|
149
149
|
});
|
150
150
|
|
151
151
|
const fontSize = useFontSize();
|
152
|
-
const itemHeight =
|
152
|
+
const itemHeight = computed(() => {
|
153
|
+
return fontSize.value * 2 + 6;
|
154
|
+
});
|
153
155
|
const iconSize = computed(() => {
|
154
156
|
return fontSize.value * 1.5;
|
155
157
|
});
|
@@ -72,11 +72,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
72
72
|
default: string;
|
73
73
|
};
|
74
74
|
}>>, {
|
75
|
-
background: boolean;
|
76
75
|
icon: string;
|
76
|
+
background: boolean;
|
77
|
+
disabled: boolean;
|
77
78
|
active: boolean;
|
78
79
|
hasUpdate: boolean;
|
79
|
-
disabled: boolean;
|
80
80
|
color: string;
|
81
81
|
tooltip: string;
|
82
82
|
tooltipPosition: string;
|
@@ -19,3 +19,8 @@ export function useForwardSlots(slots: import("vue").Slots, exclude?: Array<stri
|
|
19
19
|
* @returns {import("vue").ComputedRef<string>}
|
20
20
|
*/
|
21
21
|
export function createEllipseTooltip(parent: import("vue").ComputedRef<HTMLElement | undefined>, tooltip: import("vue").ComputedRef<string | undefined>, title: import("vue").ComputedRef<string | undefined>): import("vue").ComputedRef<string>;
|
22
|
+
/**
|
23
|
+
* Returns a globally unique vcs component id string
|
24
|
+
* @returns {string}
|
25
|
+
*/
|
26
|
+
export function useComponentId(): string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { computed, nextTick, ref, watch } from 'vue';
|
1
|
+
import { computed, nextTick, onUnmounted, ref, watch } from 'vue';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* returns a computed which is true, if the provided attributes contain one or more
|
@@ -30,6 +30,35 @@ export function useForwardSlots(slots, exclude = []) {
|
|
30
30
|
});
|
31
31
|
}
|
32
32
|
|
33
|
+
let intersectionObserver = null;
|
34
|
+
/** @type {WeakMap<WeakKey<HTMLElement>, import("vue").ComputedRef<boolean>>} */
|
35
|
+
const observedTargets = new WeakMap();
|
36
|
+
|
37
|
+
/**
|
38
|
+
* if the visibility of the element changes, the computed ref will be set.
|
39
|
+
* @param {HTMLElement} elem
|
40
|
+
* @param {import("vue").ComputedRef<boolean>} visible
|
41
|
+
* @returns {() => void}}
|
42
|
+
*/
|
43
|
+
function registerTargetWithIntersectionObserver(elem, visible) {
|
44
|
+
if (!intersectionObserver) {
|
45
|
+
intersectionObserver = new IntersectionObserver((targets) => {
|
46
|
+
targets.forEach((target) => {
|
47
|
+
const visibilityRef = observedTargets.get(target.target);
|
48
|
+
if (visibilityRef) {
|
49
|
+
visibilityRef.value = target.isIntersecting;
|
50
|
+
}
|
51
|
+
});
|
52
|
+
});
|
53
|
+
}
|
54
|
+
intersectionObserver.observe(elem);
|
55
|
+
observedTargets.set(elem, visible);
|
56
|
+
return () => {
|
57
|
+
intersectionObserver.unobserve(elem);
|
58
|
+
observedTargets.delete(elem);
|
59
|
+
};
|
60
|
+
}
|
61
|
+
|
33
62
|
/**
|
34
63
|
* @param {import("vue").ComputedRef<HTMLElement|undefined>} parent
|
35
64
|
* @param {import("vue").ComputedRef<string|undefined>} tooltip
|
@@ -39,19 +68,49 @@ export function useForwardSlots(slots, exclude = []) {
|
|
39
68
|
export function createEllipseTooltip(parent, tooltip, title) {
|
40
69
|
const offsetWidth = ref(0);
|
41
70
|
const scrollWidth = ref(0);
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
if (
|
46
|
-
|
47
|
-
|
48
|
-
scrollWidth.value = elem.scrollWidth;
|
49
|
-
});
|
71
|
+
const visible = ref(false);
|
72
|
+
let observerListener = () => {};
|
73
|
+
watch(visible, () => {
|
74
|
+
if (visible.value && parent.value) {
|
75
|
+
offsetWidth.value = parent.value.offsetWidth;
|
76
|
+
scrollWidth.value = parent.value.scrollWidth;
|
50
77
|
} else {
|
51
78
|
offsetWidth.value = 0;
|
52
79
|
scrollWidth.value = 0;
|
53
80
|
}
|
54
81
|
});
|
82
|
+
watch(
|
83
|
+
parent,
|
84
|
+
() => {
|
85
|
+
observerListener();
|
86
|
+
visible.value = false;
|
87
|
+
const elem = parent.value;
|
88
|
+
if (elem) {
|
89
|
+
if (elem.checkVisibility()) {
|
90
|
+
visible.value = true;
|
91
|
+
} else {
|
92
|
+
observerListener = registerTargetWithIntersectionObserver(
|
93
|
+
elem,
|
94
|
+
visible,
|
95
|
+
);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
},
|
99
|
+
{ immediate: true },
|
100
|
+
);
|
101
|
+
|
102
|
+
watch(title, async () => {
|
103
|
+
if (visible.value) {
|
104
|
+
await nextTick(() => {
|
105
|
+
offsetWidth.value = parent.value.offsetWidth;
|
106
|
+
scrollWidth.value = parent.value.scrollWidth;
|
107
|
+
});
|
108
|
+
}
|
109
|
+
});
|
110
|
+
|
111
|
+
onUnmounted(() => {
|
112
|
+
observerListener();
|
113
|
+
});
|
55
114
|
|
56
115
|
return computed(() => {
|
57
116
|
if (tooltip.value) {
|
@@ -63,3 +122,14 @@ export function createEllipseTooltip(parent, tooltip, title) {
|
|
63
122
|
return '';
|
64
123
|
});
|
65
124
|
}
|
125
|
+
|
126
|
+
let componentIdCounter = 0;
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Returns a globally unique vcs component id string
|
130
|
+
* @returns {string}
|
131
|
+
*/
|
132
|
+
export function useComponentId() {
|
133
|
+
componentIdCounter += 1;
|
134
|
+
return `vcs-${componentIdCounter}`;
|
135
|
+
}
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<v-container class="py-0 px-1">
|
3
3
|
<v-row no-gutters v-if="modelValue.projection">
|
4
4
|
<v-col :cols="firstCols">
|
5
|
-
<VcsLabel html-for="projection">
|
5
|
+
<VcsLabel :html-for="`${cid}-projection`">
|
6
6
|
{{ $t('components.extent.projection') }}
|
7
7
|
</VcsLabel>
|
8
8
|
</v-col>
|
9
9
|
<v-col>
|
10
10
|
<VcsTextField
|
11
|
-
id="projection"
|
11
|
+
:id="`${cid}-projection`"
|
12
12
|
disabled
|
13
13
|
:model-value="modelValue.projection.epsg"
|
14
14
|
/>
|
@@ -23,9 +23,9 @@
|
|
23
23
|
[(v) => checkInput(v, max[1])],
|
24
24
|
]"
|
25
25
|
>
|
26
|
-
<template #prepend
|
26
|
+
<template #prepend>
|
27
27
|
<v-col :cols="firstCols">
|
28
|
-
<VcsLabel
|
28
|
+
<VcsLabel>
|
29
29
|
{{ $t('components.extent.min') }}
|
30
30
|
</VcsLabel>
|
31
31
|
</v-col>
|
@@ -40,9 +40,9 @@
|
|
40
40
|
[(v) => checkInput(min[1], v)],
|
41
41
|
]"
|
42
42
|
>
|
43
|
-
<template #prepend
|
43
|
+
<template #prepend>
|
44
44
|
<v-col :cols="firstCols">
|
45
|
-
<VcsLabel
|
45
|
+
<VcsLabel>
|
46
46
|
{{ $t('components.extent.max') }}
|
47
47
|
</VcsLabel>
|
48
48
|
</v-col>
|
@@ -59,6 +59,7 @@
|
|
59
59
|
import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
|
60
60
|
import VcsCoordinate from '../form-inputs-controls/VcsCoordinate.vue';
|
61
61
|
import { useProxiedComplexModel } from '../modelHelper.js';
|
62
|
+
import { useComponentId } from '../composables.js';
|
62
63
|
|
63
64
|
function checkInput(min, max) {
|
64
65
|
return min < max || 'components.extent.invalid';
|
@@ -114,10 +115,13 @@
|
|
114
115
|
},
|
115
116
|
});
|
116
117
|
|
118
|
+
const cid = useComponentId();
|
119
|
+
|
117
120
|
return {
|
118
121
|
min: getCoordinate(0, 2),
|
119
122
|
max: getCoordinate(2),
|
120
123
|
checkInput,
|
124
|
+
cid,
|
121
125
|
};
|
122
126
|
},
|
123
127
|
};
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
15
15
|
min: import("vue").WritableComputedRef<any>;
|
16
16
|
max: import("vue").WritableComputedRef<any>;
|
17
17
|
checkInput: typeof checkInput;
|
18
|
+
cid: string;
|
18
19
|
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
19
20
|
modelValue: {
|
20
21
|
type: ObjectConstructor;
|