@vcmap/ui 6.0.0-rc.3 → 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/buildHelpers.js +60 -11
- package/build/buildTypes.js +9 -5
- package/build/bundle.js +1 -1
- package/build/info/publish.js +25 -31
- package/build/lintTypes.js +5 -0
- package/config/base.config.json +2 -7
- package/config/dev.config.json +11 -1
- package/config/projects.config.json +2 -1
- package/config/theming.config.json +68 -0
- package/config/www.config.json +27 -23
- package/dist/assets/@mdi/font/css/{materialdesignicons.min-7a4f6be0.css → materialdesignicons.min-680621ca.css} +1 -1
- package/dist/assets/{cesium-cb4dbfba.js → cesium-ccb4cc30.js} +272 -385
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-72f21835.js → core-e06aa7a6.js} +2313 -2321
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol-2d33bc8b.js → ol-e7981d5c.js} +233 -329
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-5dda32d2.css +1 -0
- package/dist/assets/{ui-2ab43a16.js → ui-5dda32d2.js} +11344 -11078
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue-87bc6efe.js +6083 -0
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-760ced3b.css → vuetify-4c4e4217.css} +2 -2
- package/dist/assets/{vuetify-760ced3b.js → vuetify-4c4e4217.js} +8063 -8262
- package/dist/assets/vuetify.js +1 -1
- package/index.d.ts +27 -17
- package/index.js +16 -8
- package/package.json +17 -17
- 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/form-inputs-example/src/FormInputsExample.vue +2 -3
- package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +11 -7
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +18 -11
- package/plugins/@vcmap-show-case/search-example/src/index.js +1 -0
- package/plugins/@vcmap-show-case/search-example/src/searchImpl.js +35 -5
- 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/@vcmap-show-case/toolbox-example/src/index.js +2 -1
- package/plugins/package.json +7 -23
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +1 -1
- package/src/actions/StyleSelector.vue +1 -1
- package/src/actions/actionHelper.d.ts +4 -11
- package/src/actions/actionHelper.js +15 -7
- package/src/actions/listActions.d.ts +5 -5
- package/src/actions/listActions.js +2 -2
- package/src/application/VcsApp.vue +113 -50
- package/src/application/VcsApp.vue.d.ts +301 -4
- package/src/application/VcsAttributionsFooter.vue.d.ts +1 -1
- package/src/application/VcsContainer.vue +27 -10
- package/src/application/VcsContainer.vue.d.ts +241 -0
- package/src/application/VcsMainMap.vue +7 -7
- package/src/application/VcsMainMap.vue.d.ts +2 -2
- package/src/application/VcsNavbar.vue +14 -2
- package/src/application/VcsNavbar.vue.d.ts +1 -0
- package/src/application/VcsSplashScreen.vue +33 -26
- package/src/application/VcsTextPageFooter.vue +2 -1
- 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 +61 -6
- package/src/components/buttons/VcsActionButtonList.vue.d.ts +28 -0
- 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 +13 -16
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +2 -4
- package/src/components/form-inputs-controls/VcsCoordinate.vue +4 -4
- 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 +2 -5
- package/src/components/form-inputs-controls/VcsSlider.vue +5 -6
- package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +2 -4
- package/src/components/form-inputs-controls/VcsTextArea.vue +2 -5
- package/src/components/form-inputs-controls/VcsTextField.vue +24 -1
- package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +11 -1
- package/src/components/form-inputs-controls/VcsWizard.vue +3 -3
- package/src/components/form-inputs-controls/VcsWizardStep.vue +6 -5
- package/src/components/form-inputs-controls/vcsTextField.scss +8 -5
- package/src/components/form-output/VcsFormattedNumber.vue +7 -5
- package/src/components/form-output/VcsMarkdown.vue +15 -12
- package/src/components/form-output/VcsMarkdown.vue.d.ts +1 -0
- package/src/components/form-output/markdownHelper.d.ts +30 -0
- package/src/components/form-output/markdownHelper.js +398 -0
- package/src/components/import/VcsFileDrop.vue +8 -5
- package/src/components/import/VcsImportComponent.vue +8 -4
- package/src/components/import/VcsImportComponent.vue.d.ts +1 -2
- package/src/components/lists/VcsActionList.vue +6 -6
- package/src/components/lists/VcsList.vue +22 -37
- package/src/components/lists/VcsList.vue.d.ts +14 -55
- package/src/components/lists/{VcsListItem.vue → VcsListItemComponent.vue} +37 -11
- package/src/components/lists/VcsListItemComponent.vue.d.ts +79 -0
- package/src/components/lists/VcsTreeview.vue +95 -26
- package/src/components/lists/VcsTreeview.vue.d.ts +16 -3
- package/src/components/lists/VcsTreeviewSearchbar.vue +16 -5
- 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 -8
- 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 +13 -7
- package/src/components/section/VcsFormSection.vue.d.ts +2 -3
- 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 +3 -3
- package/src/components/style/VcsVectorStyleComponent.vue +1 -1
- package/src/components/tables/VcsDataTable.vue +42 -32
- package/src/components/tables/VcsDataTable.vue.d.ts +1 -0
- package/src/components/tables/VcsTable.vue +45 -62
- package/src/components/tables/VcsTable.vue.d.ts +30 -17
- package/src/components/tables/VcsTableCell.vue +72 -0
- package/src/components/tables/VcsTableCell.vue.d.ts +13 -0
- package/src/components/vector-properties/VcsFeatureEditingWindow.vue +6 -5
- package/src/components/vector-properties/VcsFeatureTransforms.vue +5 -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 +14 -11
- package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +1 -0
- package/src/components/viewpoint/VcsViewpointEditor.vue +2 -2
- package/src/contentTree/LayerTree.vue +9 -27
- package/src/contentTree/LayerTree.vue.d.ts +1 -1
- package/src/contentTree/contentTreeCollection.d.ts +1 -0
- package/src/contentTree/contentTreeCollection.js +45 -11
- package/src/contentTree/contentTreeItem.d.ts +2 -2
- package/src/contentTree/contentTreeItem.js +1 -1
- package/src/featureInfo/BalloonComponent.vue +32 -25
- package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue +4 -2
- package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +2 -2
- package/src/featureInfo/abstractFeatureInfoView.d.ts +10 -4
- package/src/featureInfo/abstractFeatureInfoView.js +19 -11
- package/src/featureInfo/featureInfo.d.ts +7 -7
- package/src/featureInfo/featureInfo.js +51 -31
- package/src/featureInfo/iframeFeatureInfoView.d.ts +8 -2
- package/src/featureInfo/iframeFeatureInfoView.js +15 -5
- package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +5 -5
- package/src/featureInfo/markdownFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownFeatureInfoView.js +9 -11
- package/src/featureInfo/tableFeatureInfoView.js +13 -4
- 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 +2 -2
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +2 -2
- package/src/manager/collectionManager/categoryManager.d.ts +1 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +3 -3
- package/src/manager/collectionManager/collectionComponentClass.js +6 -6
- package/src/manager/collectionManager/collectionManager.d.ts +1 -1
- package/src/manager/collectionManager/editorCollectionComponentClass.js +2 -1
- package/src/manager/panel/PanelComponent.vue +2 -9
- package/src/manager/panel/PanelManagerComponent.vue +7 -3
- package/src/manager/panel/panelHelper.js +3 -3
- package/src/manager/panel/panelManager.d.ts +9 -1
- package/src/manager/panel/panelManager.js +15 -3
- package/src/manager/toolbox/GroupToolboxComponent.vue +11 -5
- package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +11 -6
- package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/{ToolboxManager.vue → ToolboxManagerComponent.vue} +13 -7
- package/src/manager/toolbox/{ToolboxManager.vue.d.ts → ToolboxManagerComponent.vue.d.ts} +1 -0
- package/src/manager/window/WindowComponent.vue +12 -8
- package/src/manager/window/WindowComponentHeader.vue +33 -9
- package/src/manager/window/WindowComponentHeader.vue.d.ts +3 -0
- package/src/manager/window/WindowManager.vue +2 -2
- package/src/manager/window/windowManager.d.ts +6 -6
- package/src/manager/window/windowManager.js +3 -3
- package/src/navigation/MapNavigation.vue +20 -0
- package/src/navigation/OrientationToolsButton.vue +2 -4
- package/src/navigation/TiltSlider.vue +3 -5
- package/src/navigation/locatorHelper.js +1 -1
- package/src/navigation/overviewMap.js +1 -1
- package/src/notifier/NotifierComponent.vue +18 -15
- package/src/search/ResultItem.vue +18 -6
- package/src/search/ResultsComponent.vue +31 -20
- package/src/search/ResultsComponent.vue.d.ts +2 -1
- package/src/search/SearchComponent.vue +11 -15
- package/src/search/SearchComponent.vue.d.ts +1 -0
- package/src/siteConfig.js +8 -8
- package/src/styles/_typography.scss +0 -2
- package/src/styles/main.scss +0 -4
- package/src/styles/vcsList.scss +1 -1
- package/src/uiConfig.d.ts +311 -7
- package/src/uiConfig.js +30 -17
- package/src/vcsUiApp.d.ts +48 -63
- package/src/vcsUiApp.js +44 -37
- package/src/vuePlugins/vuetify.d.ts +88 -62
- package/src/vuePlugins/vuetify.js +119 -20
- package/dist/assets/ui-2ab43a16.css +0 -1
- package/dist/assets/vue-03b265aa.js +0 -6096
- 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/application/markdownHelper.d.ts +0 -12
- package/src/application/markdownHelper.js +0 -70
- package/src/components/lists/VcsListItem.vue.d.ts +0 -27
- package/src/components/lists/VcsTreeviewLeaf.vue +0 -83
- package/src/components/notification/VcsTooltip.vue +0 -156
- package/src/components/notification/VcsTooltip.vue.d.ts +0 -27
- package/src/featureInfo/MarkdownComponent.vue +0 -16
- package/src/featureInfo/MarkdownComponent.vue.d.ts +0 -7
- package/src/styles/_theming.scss +0 -73
- package/src/styles/settings.scss +0 -6
- package/src/styles/shades.scss +0 -4
- package/src/styles/variables.scss +0 -140
- package/src/styles/vcsFont.scss +0 -2
- package/src/styles/vcsGrid.scss +0 -3
- /package/src/components/lists/{VcsTreeviewLeaf.vue.d.ts → VcsTreeviewTitle.vue.d.ts} +0 -0
@@ -1,23 +0,0 @@
|
|
1
|
-
# VC Map Plugin Theme Changer
|
2
|
-
|
3
|
-
This is a plugin to manage themes of the VC Map.
|
4
|
-
This plugin provides 4 themes:
|
5
|
-
|
6
|
-
- VCS Theme (defined by `@vcmap/ui`)
|
7
|
-
- Theme 1
|
8
|
-
- Theme 2
|
9
|
-
- Theme 3
|
10
|
-
|
11
|
-
Per config custom themes can be added.
|
12
|
-
|
13
|
-
## configuration
|
14
|
-
|
15
|
-
You can override the themes array by defining your own themes. A theme must provide:
|
16
|
-
|
17
|
-
### VcMapTheme
|
18
|
-
|
19
|
-
| Property | Type | Description |
|
20
|
-
| -------- | ------------ | ---------------------- |
|
21
|
-
| name | string | name of the theme |
|
22
|
-
| dark | VuetifyTheme | dark theme definition |
|
23
|
-
| light | VuetifyTheme | light theme definition |
|
@@ -1,69 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "@vcmap-show-case/theme-changer",
|
3
|
-
"entry": "plugins/@vcmap-show-case/theme-changer/index.js",
|
4
|
-
"themes": [
|
5
|
-
{
|
6
|
-
"name": "Theme 1",
|
7
|
-
"dark": {
|
8
|
-
"primary": "#21CFF3",
|
9
|
-
"accent": "#FF4081",
|
10
|
-
"secondary": "#21dc79",
|
11
|
-
"success": "#86af3f",
|
12
|
-
"info": "#f34fc6",
|
13
|
-
"warning": "#FB8C00",
|
14
|
-
"error": "#FF5252"
|
15
|
-
},
|
16
|
-
"light": {
|
17
|
-
"primary": "#22daff",
|
18
|
-
"accent": "#ff6b99",
|
19
|
-
"secondary": "#26ff8c",
|
20
|
-
"success": "#a5d64c",
|
21
|
-
"info": "#ff53d0",
|
22
|
-
"warning": "#ff8e00",
|
23
|
-
"error": "#ff5252"
|
24
|
-
}
|
25
|
-
},
|
26
|
-
{
|
27
|
-
"name": "Theme 2",
|
28
|
-
"dark": {
|
29
|
-
"primary": "#E65100",
|
30
|
-
"accent": "#7CB342",
|
31
|
-
"secondary": "#689F38",
|
32
|
-
"success": "#4CAF50",
|
33
|
-
"info": "#6156d8",
|
34
|
-
"warning": "#1565C0",
|
35
|
-
"error": "#FF7043"
|
36
|
-
},
|
37
|
-
"light": {
|
38
|
-
"primary": "#ffa450",
|
39
|
-
"accent": "#a1e754",
|
40
|
-
"secondary": "#92de4e",
|
41
|
-
"success": "#6dff74",
|
42
|
-
"info": "#7365ff",
|
43
|
-
"warning": "#2e8ac0",
|
44
|
-
"error": "#ff5e3c"
|
45
|
-
}
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"name": "Theme 3",
|
49
|
-
"dark": {
|
50
|
-
"primary": "#33691E",
|
51
|
-
"accent": "#FFCA28",
|
52
|
-
"secondary": "#607D8B",
|
53
|
-
"success": "#FFEB3B",
|
54
|
-
"info": "#2196F3",
|
55
|
-
"warning": "#9C27B0",
|
56
|
-
"error": "#B71C1C"
|
57
|
-
},
|
58
|
-
"light": {
|
59
|
-
"primary": "#6ae240",
|
60
|
-
"accent": "#ffe063",
|
61
|
-
"secondary": "#7ea4b6",
|
62
|
-
"success": "#ffea70",
|
63
|
-
"info": "#229eff",
|
64
|
-
"warning": "#e239ff",
|
65
|
-
"error": "#e82424"
|
66
|
-
}
|
67
|
-
}
|
68
|
-
]
|
69
|
-
}
|
@@ -1,120 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<v-card>
|
3
|
-
<v-list-item>
|
4
|
-
<v-list-item-content>
|
5
|
-
<v-list-item-title class="font-weight-bold">
|
6
|
-
Dark Mode
|
7
|
-
</v-list-item-title>
|
8
|
-
</v-list-item-content>
|
9
|
-
<v-list-item-action>
|
10
|
-
<v-switch v-model="$vuetify.theme.dark" />
|
11
|
-
</v-list-item-action>
|
12
|
-
</v-list-item>
|
13
|
-
<v-divider />
|
14
|
-
<v-card-text>
|
15
|
-
<v-card
|
16
|
-
class="my-2"
|
17
|
-
:disabled="state.selected.value === theme.name"
|
18
|
-
@click="setTheme(theme)"
|
19
|
-
hover
|
20
|
-
outlined
|
21
|
-
v-for="(theme, index) in config.themes.value"
|
22
|
-
:key="index"
|
23
|
-
>
|
24
|
-
<v-list-item>
|
25
|
-
<v-list-item-content>
|
26
|
-
<v-list-item-title class="font-weight-bold">
|
27
|
-
{{ theme.name }}
|
28
|
-
</v-list-item-title>
|
29
|
-
</v-list-item-content>
|
30
|
-
<v-list-item-action>
|
31
|
-
<v-avatar
|
32
|
-
color="success"
|
33
|
-
size="30"
|
34
|
-
v-if="state.selected.value === theme.name"
|
35
|
-
>
|
36
|
-
<v-icon>mdi-check</v-icon>
|
37
|
-
</v-avatar>
|
38
|
-
</v-list-item-action>
|
39
|
-
</v-list-item>
|
40
|
-
<v-card class="my-1 ma-1 py-1 white">
|
41
|
-
<h2>light</h2>
|
42
|
-
<v-chip
|
43
|
-
class="mx-1"
|
44
|
-
label
|
45
|
-
:color="theme.light[key]?.base || theme.light[key]"
|
46
|
-
v-for="(key, lightIdx) in Object.keys(theme.light)"
|
47
|
-
:key="lightIdx"
|
48
|
-
>
|
49
|
-
{{ key }}
|
50
|
-
</v-chip>
|
51
|
-
</v-card>
|
52
|
-
<v-card class="my-1 ma-1 py-1 black">
|
53
|
-
<h2 class="white--text">dark</h2>
|
54
|
-
<v-chip
|
55
|
-
class="mx-1"
|
56
|
-
label
|
57
|
-
:color="theme.dark[key]?.base || theme.dark[key]"
|
58
|
-
v-for="(key, darkIdx) in Object.keys(theme.dark)"
|
59
|
-
:key="darkIdx"
|
60
|
-
>
|
61
|
-
{{ key }}
|
62
|
-
</v-chip>
|
63
|
-
</v-card>
|
64
|
-
</v-card>
|
65
|
-
</v-card-text>
|
66
|
-
</v-card>
|
67
|
-
</template>
|
68
|
-
<script>
|
69
|
-
import { inject } from 'vue';
|
70
|
-
import {
|
71
|
-
VCard,
|
72
|
-
VCardText,
|
73
|
-
VChip,
|
74
|
-
VListItem,
|
75
|
-
// VListItemContent,
|
76
|
-
VListItemTitle,
|
77
|
-
VListItemAction,
|
78
|
-
VAvatar,
|
79
|
-
VIcon,
|
80
|
-
VDivider,
|
81
|
-
VSwitch,
|
82
|
-
} from 'vuetify/components';
|
83
|
-
|
84
|
-
export default {
|
85
|
-
name: 'ThemeChanger',
|
86
|
-
components: {
|
87
|
-
VCard,
|
88
|
-
VCardText,
|
89
|
-
VChip,
|
90
|
-
VListItem,
|
91
|
-
// VListItemContent,
|
92
|
-
VListItemTitle,
|
93
|
-
VListItemAction,
|
94
|
-
VAvatar,
|
95
|
-
VIcon,
|
96
|
-
VDivider,
|
97
|
-
VSwitch,
|
98
|
-
},
|
99
|
-
setup() {
|
100
|
-
const app = inject('vcsApp');
|
101
|
-
const plugin = app.plugins.getByKey('@vcmap-show-case/theme-changer');
|
102
|
-
|
103
|
-
function setTheme(theme) {
|
104
|
-
const { name, dark, light } = theme;
|
105
|
-
Object.keys(dark).forEach((i) => {
|
106
|
-
this.$vuetify.theme.themes.dark[i] = dark[i];
|
107
|
-
});
|
108
|
-
Object.keys(light).forEach((i) => {
|
109
|
-
this.$vuetify.theme.themes.light[i] = light[i];
|
110
|
-
});
|
111
|
-
plugin.state.selected.value = name;
|
112
|
-
}
|
113
|
-
return {
|
114
|
-
state: plugin.state,
|
115
|
-
config: plugin.config,
|
116
|
-
setTheme,
|
117
|
-
};
|
118
|
-
},
|
119
|
-
};
|
120
|
-
</script>
|
@@ -1,108 +0,0 @@
|
|
1
|
-
import { ref } from 'vue';
|
2
|
-
import { check } from '@vcsuite/check';
|
3
|
-
import { ButtonLocation, createToggleAction, createVcsThemes } from '@vcmap/ui';
|
4
|
-
import ThemeChangerComponent from './ThemeChangerComponent.vue';
|
5
|
-
import packageJSON from '../package.json';
|
6
|
-
import defaultConfig from '../config.json';
|
7
|
-
|
8
|
-
/**
|
9
|
-
* @typedef {Object} VuetifyTheme
|
10
|
-
* @property {string} primary
|
11
|
-
* @property {string} secondary
|
12
|
-
* @property {string} accent
|
13
|
-
* @property {string} error
|
14
|
-
* @property {string} info
|
15
|
-
* @property {string} success
|
16
|
-
* @property {string} warning
|
17
|
-
*/
|
18
|
-
|
19
|
-
/**
|
20
|
-
* @typedef {Object} VcMapTheme
|
21
|
-
* @property {string} name
|
22
|
-
* @property {VuetifyTheme} light
|
23
|
-
* @property {VuetifyTheme} dark
|
24
|
-
*/
|
25
|
-
|
26
|
-
/**
|
27
|
-
* @param {Object} config
|
28
|
-
* @returns {VcsPlugin}
|
29
|
-
*/
|
30
|
-
export default async function themeChanger(config) {
|
31
|
-
/** @type {VcMapTheme} */
|
32
|
-
const vcsTheme = {
|
33
|
-
name: 'VCS Theme',
|
34
|
-
...createVcsThemes(),
|
35
|
-
};
|
36
|
-
const customThemes = config.themes || defaultConfig.themes;
|
37
|
-
const availableThemes = [vcsTheme, ...customThemes];
|
38
|
-
|
39
|
-
const pluginConfig = {
|
40
|
-
themes: ref(/** @type {Array<VcMapTheme>} */ []),
|
41
|
-
};
|
42
|
-
|
43
|
-
const pluginState = {
|
44
|
-
selected: ref(vcsTheme.name),
|
45
|
-
};
|
46
|
-
|
47
|
-
/**
|
48
|
-
* @param {VcMapTheme} theme
|
49
|
-
*/
|
50
|
-
function addTheme(theme) {
|
51
|
-
check(theme.name, String);
|
52
|
-
check(theme.light, Object);
|
53
|
-
check(theme.dark, Object);
|
54
|
-
pluginConfig.themes.value.push(theme);
|
55
|
-
}
|
56
|
-
availableThemes.forEach((t) => addTheme(t));
|
57
|
-
|
58
|
-
return {
|
59
|
-
get name() {
|
60
|
-
return packageJSON.name;
|
61
|
-
},
|
62
|
-
get version() {
|
63
|
-
return packageJSON.version;
|
64
|
-
},
|
65
|
-
get mapVersion() {
|
66
|
-
return packageJSON.mapVersion;
|
67
|
-
},
|
68
|
-
config: pluginConfig,
|
69
|
-
state: pluginState,
|
70
|
-
addTheme,
|
71
|
-
onVcsAppMounted(app) {
|
72
|
-
const { action, destroy } = createToggleAction(
|
73
|
-
{
|
74
|
-
name: 'Theme Changer',
|
75
|
-
icon: 'mdi-palette',
|
76
|
-
},
|
77
|
-
{
|
78
|
-
id: 'theme-changer',
|
79
|
-
component: ThemeChangerComponent,
|
80
|
-
position: {
|
81
|
-
left: '60%',
|
82
|
-
right: '0%',
|
83
|
-
top: '5%',
|
84
|
-
bottom: '50%',
|
85
|
-
},
|
86
|
-
state: {
|
87
|
-
headerTitle: 'Theme Changer',
|
88
|
-
headerIcon: 'mdi-palette',
|
89
|
-
},
|
90
|
-
},
|
91
|
-
app.windowManager,
|
92
|
-
packageJSON.name,
|
93
|
-
);
|
94
|
-
app.navbarManager.add(
|
95
|
-
{ id: 'theme-changer', action },
|
96
|
-
packageJSON.name,
|
97
|
-
ButtonLocation.MENU,
|
98
|
-
);
|
99
|
-
this._destroyAction = destroy;
|
100
|
-
},
|
101
|
-
destroy() {
|
102
|
-
if (this._destroyAction) {
|
103
|
-
this._destroyAction();
|
104
|
-
this._destroyAction = null;
|
105
|
-
}
|
106
|
-
},
|
107
|
-
};
|
108
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @param {string} content
|
3
|
-
* @returns {string}
|
4
|
-
*/
|
5
|
-
export function parseAndSanitizeMarkdown(content: string): string;
|
6
|
-
/**
|
7
|
-
* Replaces template strings by provided attributes, e.g. {{myAttribute}}
|
8
|
-
* @param {string|string[]} template
|
9
|
-
* @param {Record<string, unknown>} attributes
|
10
|
-
* @returns {string}
|
11
|
-
*/
|
12
|
-
export function replaceAttributes(template: string | string[], attributes: Record<string, unknown>): string;
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import { marked } from 'marked';
|
2
|
-
import DOMPurify from 'dompurify';
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @param {string} content
|
6
|
-
* @returns {string}
|
7
|
-
*/
|
8
|
-
export function parseAndSanitizeMarkdown(content) {
|
9
|
-
const html = marked.parse(content, { breaks: true });
|
10
|
-
|
11
|
-
// Then sanitize the HTML using DOMPurify
|
12
|
-
return DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });
|
13
|
-
}
|
14
|
-
|
15
|
-
/**
|
16
|
-
* @param {Record<string, unknown>} parent
|
17
|
-
* @param {(string|number)[]} keys
|
18
|
-
* @returns {undefined|T}
|
19
|
-
* @template {*} T
|
20
|
-
*/
|
21
|
-
function findRecursive(parent, keys) {
|
22
|
-
if (keys.length === 1) {
|
23
|
-
return parent[keys[0]];
|
24
|
-
} else {
|
25
|
-
const nextKey = keys.shift();
|
26
|
-
const nextParent = parent[nextKey];
|
27
|
-
if (nextParent) {
|
28
|
-
return findRecursive(nextParent, keys);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
return undefined;
|
32
|
-
}
|
33
|
-
|
34
|
-
/**
|
35
|
-
* Replaces template strings by provided attributes, e.g. {{myAttribute}}
|
36
|
-
* @param {string|string[]} template
|
37
|
-
* @param {Record<string, unknown>} attributes
|
38
|
-
* @returns {string}
|
39
|
-
*/
|
40
|
-
export function replaceAttributes(template, attributes) {
|
41
|
-
const templateString = Array.isArray(template)
|
42
|
-
? template.join('\n')
|
43
|
-
: template;
|
44
|
-
return templateString.replace(/\{\{([^}]+)}}/g, (p, value) => {
|
45
|
-
const keys = value.trim().split('.');
|
46
|
-
|
47
|
-
for (let i = 0; i < keys.length; i++) {
|
48
|
-
let key = keys[i];
|
49
|
-
if (typeof key === 'string') {
|
50
|
-
const indices = [];
|
51
|
-
let arrayIndex = /\[["']?([^\]]+)["']?]$/.exec(key);
|
52
|
-
while (arrayIndex != null) {
|
53
|
-
let bracketKey = arrayIndex[1];
|
54
|
-
if (/^\d+$/.test(bracketKey)) {
|
55
|
-
bracketKey = Number(bracketKey);
|
56
|
-
}
|
57
|
-
indices.push(bracketKey);
|
58
|
-
key = key.substring(0, arrayIndex.index);
|
59
|
-
arrayIndex = /\[["']?([^\]]+)["']?]$/.exec(key);
|
60
|
-
}
|
61
|
-
|
62
|
-
if (indices.length > 0) {
|
63
|
-
keys.splice(i, 1, key, ...indices);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
return findRecursive(attributes, keys) ?? '';
|
69
|
-
});
|
70
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
|
2
|
-
$props: {
|
3
|
-
readonly [x: string]: any;
|
4
|
-
};
|
5
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
6
|
-
title?(_: {
|
7
|
-
item: any;
|
8
|
-
dragging: any;
|
9
|
-
tooltip: string;
|
10
|
-
}): any;
|
11
|
-
subtitle?(_: {
|
12
|
-
item: any;
|
13
|
-
}): any;
|
14
|
-
default?(_: {
|
15
|
-
item: any;
|
16
|
-
dragging: any;
|
17
|
-
tooltip: string;
|
18
|
-
isActive: boolean;
|
19
|
-
isSelected: boolean;
|
20
|
-
isIndeterminate: boolean;
|
21
|
-
select: (value: boolean) => void;
|
22
|
-
}): any;
|
23
|
-
}>;
|
24
|
-
export default _default;
|
25
|
-
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
26
|
-
$slots: S;
|
27
|
-
});
|
@@ -1,83 +0,0 @@
|
|
1
|
-
<script setup>
|
2
|
-
import { computed, onUnmounted, ref, watch } from 'vue';
|
3
|
-
import { VIcon, VTooltip } from 'vuetify/components';
|
4
|
-
import { VTreeviewItem } from 'vuetify/labs/VTreeview';
|
5
|
-
import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
|
6
|
-
import ImageElementInjector from '../ImageElementInjector.vue';
|
7
|
-
|
8
|
-
const props = defineProps({
|
9
|
-
item: {
|
10
|
-
type: Object,
|
11
|
-
default: undefined,
|
12
|
-
},
|
13
|
-
});
|
14
|
-
|
15
|
-
const isStringIcon = computed(() => typeof props.item?.icon === 'string');
|
16
|
-
const parentElement = ref();
|
17
|
-
const titleElem = ref();
|
18
|
-
const offsetWidth = ref(0);
|
19
|
-
const scrollWidth = ref(0);
|
20
|
-
|
21
|
-
const observer = new ResizeObserver(() => {
|
22
|
-
offsetWidth.value = titleElem.value.offsetWidth;
|
23
|
-
scrollWidth.value = titleElem.value.scrollWidth;
|
24
|
-
});
|
25
|
-
|
26
|
-
watch(
|
27
|
-
parentElement,
|
28
|
-
(newValue, oldValue) => {
|
29
|
-
if (oldValue) {
|
30
|
-
observer.unobserve(oldValue.$el);
|
31
|
-
}
|
32
|
-
if (newValue) {
|
33
|
-
observer.observe(newValue.$el);
|
34
|
-
}
|
35
|
-
},
|
36
|
-
{ immediate: true },
|
37
|
-
);
|
38
|
-
|
39
|
-
const tooltip = computed(() => {
|
40
|
-
// tooltipIteration.value -= 1;
|
41
|
-
if (props.item?.tooltip) {
|
42
|
-
return props.item.tooltip;
|
43
|
-
}
|
44
|
-
if (offsetWidth.value < scrollWidth.value) {
|
45
|
-
return props.item?.title ?? '';
|
46
|
-
}
|
47
|
-
return '';
|
48
|
-
});
|
49
|
-
|
50
|
-
onUnmounted(() => {
|
51
|
-
observer.disconnect();
|
52
|
-
});
|
53
|
-
</script>
|
54
|
-
|
55
|
-
<template>
|
56
|
-
<v-treeview-item v-if="item" ref="parentElement">
|
57
|
-
<template #prepend v-if="item.icon">
|
58
|
-
<v-icon v-if="isStringIcon" :size="16" class="mr-1">
|
59
|
-
{{ item.icon }}
|
60
|
-
</v-icon>
|
61
|
-
<ImageElementInjector :element="item.icon" v-else />
|
62
|
-
</template>
|
63
|
-
<div class="text-truncate" ref="titleElem">
|
64
|
-
{{ $st(item.title || item.name) }}
|
65
|
-
</div>
|
66
|
-
<v-tooltip
|
67
|
-
activator="parent"
|
68
|
-
v-if="tooltip"
|
69
|
-
:text="$st(tooltip)"
|
70
|
-
location="bottom"
|
71
|
-
/>
|
72
|
-
<template #append>
|
73
|
-
<VcsActionButtonList
|
74
|
-
v-if="item.actions?.length > 0"
|
75
|
-
:actions="item.actions"
|
76
|
-
:overflow-count="3"
|
77
|
-
:disabled="item.disabled"
|
78
|
-
right
|
79
|
-
class="col-4 pa-0 d-flex align-center"
|
80
|
-
/>
|
81
|
-
</template>
|
82
|
-
</v-treeview-item>
|
83
|
-
</template>
|
@@ -1,156 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<v-tooltip
|
3
|
-
:disabled="!tooltip"
|
4
|
-
:content-class="`tooltip ${arrowClass}`"
|
5
|
-
transition="expand-x-transition"
|
6
|
-
v-bind="{ ...$props, ...$attrs }"
|
7
|
-
>
|
8
|
-
<template #activator="{ props }">
|
9
|
-
<slot name="activator" v-bind="props" />
|
10
|
-
</template>
|
11
|
-
<span v-if="tooltip">{{ $st(tooltip) }}</span>
|
12
|
-
</v-tooltip>
|
13
|
-
</template>
|
14
|
-
<style lang="scss" scoped>
|
15
|
-
//.v-tooltip__content.tooltip {
|
16
|
-
// border: 1px solid black;
|
17
|
-
// border-radius: 0;
|
18
|
-
// background-color: #222222;
|
19
|
-
//
|
20
|
-
//&.arrow-top {
|
21
|
-
// transform: translateY(-6px);
|
22
|
-
//
|
23
|
-
//&::after, &::before {
|
24
|
-
// bottom: 100%;
|
25
|
-
// left: 50%;
|
26
|
-
// border: solid transparent;
|
27
|
-
// content: "";
|
28
|
-
// height: 0;
|
29
|
-
// width: 0;
|
30
|
-
// position: absolute;
|
31
|
-
// pointer-events: none;
|
32
|
-
// }
|
33
|
-
//
|
34
|
-
//&::before {
|
35
|
-
// border-color: rgba(194, 225, 245, 0);
|
36
|
-
// border-bottom-color: black;
|
37
|
-
// border-width: 5px;
|
38
|
-
// margin-left: -5px;
|
39
|
-
// }
|
40
|
-
//}
|
41
|
-
//
|
42
|
-
//&.arrow-bottom {
|
43
|
-
// transform: translateY(6px);
|
44
|
-
//
|
45
|
-
//&::after, &::before {
|
46
|
-
// top: 100%;
|
47
|
-
// left: 50%;
|
48
|
-
// border: solid transparent;
|
49
|
-
// content: "";
|
50
|
-
// height: 0;
|
51
|
-
// width: 0;
|
52
|
-
// position: absolute;
|
53
|
-
// pointer-events: none;
|
54
|
-
// }
|
55
|
-
//
|
56
|
-
//&::before {
|
57
|
-
// border-color: rgba(194, 225, 245, 0);
|
58
|
-
// border-top-color: black;
|
59
|
-
// border-width: 5px;
|
60
|
-
// margin-left: -5px;
|
61
|
-
// }
|
62
|
-
//}
|
63
|
-
//
|
64
|
-
//&.arrow-right {
|
65
|
-
//&::after, &::before {
|
66
|
-
// top: 50%;
|
67
|
-
// right: -11px;
|
68
|
-
// transform: translateY(-50%);
|
69
|
-
// border: solid transparent;
|
70
|
-
// content: "";
|
71
|
-
// height: 0;
|
72
|
-
// width: 0;
|
73
|
-
// position: absolute;
|
74
|
-
// pointer-events: none;
|
75
|
-
// }
|
76
|
-
//
|
77
|
-
//&::before {
|
78
|
-
// border-color: rgba(255, 0, 0, 0);
|
79
|
-
// border-left-color: black;
|
80
|
-
// border-width: 5px;
|
81
|
-
// margin-left: -5px;
|
82
|
-
// }
|
83
|
-
//}
|
84
|
-
//
|
85
|
-
//&.arrow-left {
|
86
|
-
//
|
87
|
-
//&::after, &::before {
|
88
|
-
// top: 50%;
|
89
|
-
// left: -11px;
|
90
|
-
// transform: translateY(-50%);
|
91
|
-
// border: solid transparent;
|
92
|
-
// content: "";
|
93
|
-
// height: 0;
|
94
|
-
// width: 0;
|
95
|
-
// position: absolute;
|
96
|
-
// pointer-events: none;
|
97
|
-
// }
|
98
|
-
//
|
99
|
-
//&::before {
|
100
|
-
// border-color: rgba(194, 225, 245, 0);
|
101
|
-
// border-right-color: black;
|
102
|
-
// border-width: 5px;
|
103
|
-
// }
|
104
|
-
//}
|
105
|
-
//}
|
106
|
-
</style>
|
107
|
-
<script>
|
108
|
-
import { VTooltip } from 'vuetify/components';
|
109
|
-
|
110
|
-
/**
|
111
|
-
* @enum {string} TooltipPositions
|
112
|
-
* @property {string} bottom
|
113
|
-
* @property {string} left
|
114
|
-
* @property {string} top
|
115
|
-
* @property {string} right
|
116
|
-
* @readonly
|
117
|
-
* @module VcsTooltip
|
118
|
-
*/
|
119
|
-
const TooltipPositions = {
|
120
|
-
bottom: 'arrow-top',
|
121
|
-
top: 'arrow-bottom',
|
122
|
-
left: 'arrow-right',
|
123
|
-
right: 'arrow-left',
|
124
|
-
};
|
125
|
-
|
126
|
-
/**
|
127
|
-
* @description tooltip extending {@link https://vuetifyjs.com/en/api/v-tooltip/|vuetify v-tooltip}.
|
128
|
-
* @vue-prop {string} tooltip - Text content of a tooltip which appears on hover with default delay. This should be an i18n key.
|
129
|
-
* @vue-prop {string} [tooltipPosition='bottom'] - Position of the tooltip (allowed values: 'bottom'|'left'|'top'|'right').
|
130
|
-
* @vue-computed {string} arrowClass - direction of tooltip arrow
|
131
|
-
*/
|
132
|
-
export default {
|
133
|
-
name: 'VcsTooltip',
|
134
|
-
components: {
|
135
|
-
VTooltip,
|
136
|
-
},
|
137
|
-
props: {
|
138
|
-
tooltip: {
|
139
|
-
type: String,
|
140
|
-
default: undefined,
|
141
|
-
},
|
142
|
-
tooltipPosition: {
|
143
|
-
type: String,
|
144
|
-
default: 'bottom',
|
145
|
-
validator(value) {
|
146
|
-
return Object.keys(TooltipPositions).includes(value);
|
147
|
-
},
|
148
|
-
},
|
149
|
-
},
|
150
|
-
computed: {
|
151
|
-
arrowClass() {
|
152
|
-
return TooltipPositions[this.tooltipPosition];
|
153
|
-
},
|
154
|
-
},
|
155
|
-
};
|
156
|
-
</script>
|